Saturday, July 25, 2015

Yoga for beginners for a healthy living


Introduction

Take your time out and do these basic yoga poses or asanas even for 10 minutes everyday for great health and fitness and mental peace. Health and fitness is more important than money, because if you do not have good health, what is the use of money? If your health goes bad, you spend all your money on improving your health, which can be prevented ahead of time if you can spend some time everyday. Or if you earn enough money but do not have the health to enjoy, that is even worse! 

Below are a set of poses (asanas) for beginners in Yoga. These are very simple and easy to follow with only 3-4 days of practice you can become a master of these asanas and move to the next level of "Advanced Yoga Asanas"

Remember ---- ASANA = POSE!

What you need

You practically don't need to buy anything to be healthy with Yoga. All you need is some space and some quiet environment to increase concentration and improve the technique. Wear comfortable clothes so that you can stretch or bend without any resistance from your clothing.

List of Yoga Poses (asanas) for beginners

  • Tadasana (Palm Tree Pose)
  • AdhoMukha Svanasana (Downward Dog Pose)
  • Veerabhadrasana (Warrior pose)
  • Vrikshasana (Tree Pose)
  • Setubandh asana (Bridge Pose)
  • Trikonasana (Triangle Pose)
  • Ardhamatsyendrasana (Seated Twist pose)
  • Bhujang asana (Cobra pose)
  • Rajakapot asana (Pigeon Pose)
  • Bakasana (Crow Pose)
  • Balasana (Childs Pose)

Tadasana (Palm Tree Pose)


Benefits: Stretches the arms, the chest, the abdominal muscles, the spine and the leg muscles along with giving a sense of balance. This is an easy asana and can be done by all age groups
1. Take a deep breath and stretch the arms, shoulders and chest upwards
2. Remain in this position for few seconds
3. Bring down the heels, arms, shoulders and chest to normal position while breathing out

AdhoMukha Svanasana (Downward Dog Pose)

Benefits: Lengthens the spine, strengthens the muscles of the chest increasing lung capacity. This is an easy asana and can be done by most age groups

1. Come onto your fours. Lift the hips up, straightening the knees and elbows, form an inverted V-shape with the body
2. Remain in this position for few seconds
3. Exhale. Bend the knees, return to all fours. Relax

Veerabhadrasana (Warrior pose)

Benefits: Tones the legs and back and improves balance of the body. Increases concentration and improves stamina. This is an easy asana and can be done by all age groups
1. Take a deep breath and stretch the arms, and legs
2. Remain in this position for few seconds
3. Exhale and get back to the standing position with arms, shoulders and leg back in position


Wednesday, July 22, 2015

NSUserDefaults - Swift

NSUserDefaults is a class that allows simple storage of different data types.  It is ideal for small bits of information you need to persist between app launches or device restarts.
NSUserDefaults supports the following data types:
  • NSString
  • NSNumber
  • NSDate
  • NSArray
  • NSDictionary
  • NSData
NSUserDefaults should be used to store small amounts of data.  Here is simple use of NSUserDefaults to save the user name so that the next time they open up the app, I don’t have to ask them again. In this case, it would be overkill for me to store this type of data in Core Data or other complex mechanism. I simply check NSUserDefaults for a value and go from there. It is important to remember that NSUserDefaults are just that, helpful for reading/writing user preferences and other similar things.

Saving data:
Before we read or write data from NSUserDefaults, we must first get a reference to the NSUserDefaults class.
            1. let refs = NSUserDefaults.standardUserDefaults()
Once we have the reference saved to a constant, we can write data to it. You will be defining both the value and the key name to store the data.
            1. refs.setValue("Json Smith", forKey: "userName")
//This code saves the value "Json Smith" to a key named "userName".
Reading data:
Reading data is similiar to writing it. Again, let’s get a reference to the NSUserDefaults class and then we can query a key for a value.

1. let refs = NSUserDefaults.standardUserDefaults()
Once we have the reference saved to a constant, we can read data from it.
  1. 1. if let name = refs.stringForKey("userName"){
  2. 2. println("User Name: " + name)
  3. 3. }else{
  4. 4. //Nothing stored in NSUserDefaults yet. Set a value.
  5. 5. prefs.setValue("Json Smith", forKey: "userName")
  6. }
We are querying (in this case) the key named “userName” for a value. If the key returns a value, we print it out to the console. Otherwise, if there is no value saved yet, we use .setValue to save the name to NSUserDefaults.
In this case we are saving a string but you can use this with any of the data types described above. If you need to persist when the app was last opened, you can use NSDate in combination with NSUserDefaults.
Gopinath TB, 
CEO, Meteora Gaming
www.meteoragaming.com

Monday, July 20, 2015

How to use TableView using iOS Swift and display some data?

Introduction


A TableView is a very nice implementation in iOS to show a list of data. There are a lot of articles on the web but some are simple and many are quite complex.
Lets try and make this a simple exercise so that you can implement it in your project very easily.


Below are the steps to follow to get a tableview working in your iOS Swift Application

Step 1.

 Open XCode and create a new Project of the type "Single View Application"

Step 2. 

Give a name for your project (for eg: TryTableView) and choose Swift as the language

Step 3.

 After clicking finish you will see some files generated on the left side project navigation bar

Step 4.

 Search for Main.Storyboard and Click on it once (do not double click as it will open in a new window)

Step 5.

 Once the Storyboard is loaded in the center of the screen, look to the right side bottom of the screen where you will see "Object Library"

Step 6.

 In the Object Library find the "Table View" object

Note: Do NOT use Table View Controller but use TableView as seen in the above picture

Step 7.

 Drag the TableView to the ViewController that you see in the center of the storyboard
Now drag an IBOutlet of the TableView to your viewcontroller.swift file
For that you have to switch to Assistant Editor mode and Control+Click on the TableView control and drag it to your .swift file. You can refer the diagram below to see how it looks.

This will produce the line below in your code
     @IBOutlet weak var tv: TableView!

If you are not very clear on how to do that, please refer "Creating an IBOutlet in Swift"






Step 8.

 Now let us make some settings that is required for the tableview. Click on the TableView and on         the right side window, go to "Attributes Inspector" and set the value of "Prototype Cells" to 1. By default this might be zero

Step 11.

In project  navigator go to view controller.swift and write the functions as below.

        1.  // Add 2 new delegates UITableViewDataSource, UITableViewDelegate
           
             class viewController: UIViewController, UITableViewDataSource, UITableViewDelegate
            {
 
     
        2. // Create an array of any items or things those we wanted to show in Table
              let states = ["Karnataka", "Gujarat", "Maharashtra", "Tamilnadu"]

     
        3. //  soon after the view controller  loads the first function that executes is viewDidLoad()
              override  func viewDidLoad()
             {
                super.viewDidLoad()
                // Do any additional setup after loading the view, typically from a nib.
                 tv.delegate = self
                 tv.dataSource = self
              }

   
        4. //Write two important delegate functions like  (numberOfRowsInsections), (cellFor RowIndexPath)

             func tableView(tableView: UITableView, numberOfRowsInSection: Int) -> Int
             {

         // this return is used to return all the items assigned without mentioning the specific number of                items
              return states.count
             }

            func tableView(tableView: UITableView, cellForRowIndexPath indexPath: NSIndexPath) ->              UITableViewCell
            {
             var tblCell = tv.dequeueReusableCellwithIdentifier("cell", forIndexPath: indexPath) as!                        UITableViewcell

              tblcell.textlabel?.text = states[indexPath.row]

              return tblCell
            }
                 }


 Step 13.

  Run the project to get TableView.
  


I hope this article was helpful for beginners trying to create a TableView using iOS Swift  .
I am Revati Billur and I am a beginner myself with one month of total experience working at Nanite Solutions as an iOS developer.

If you have further questions about TableView using iOS Swift. Please feel free to write to me at revati@nanitesol.com

Thanks

Guided by: Praveen Kumar, Nanite Solutions



      


How to create a Restful Service in Php and MySQL with JSON data as output? (In Simple Steps)




Step 1 : 

Go to phpMyAdmin ,
select an existing database or create one

Step 2 : 

Create a sample Table (for eg: customers)

Step 3 : 

Insert a few records into the table

Step 4 : 

Create a new php page under www folder (or public_html folder)
Give name for your page (for eg: Get_Customers.php)

Step 5 : 

In the php page, follow these steps
              

             1. Connect to your database

           
 <?php
           
 $con = mysqli_connect("localhost", "<user name>" , "<password>", "<db name>") or die('could not connect');

//Write a query
$qry = "SELECT * FROM  Customers"

//Execute the query
$result = mysqli_query($con,$qry);
?>

               2. Put the data into array

<?php

$json = array();

//Loop through each record in the database and read the values
while($row=mysqli_fetch_array($result))
  {
      $arrcustomers = array
      (
         'customer_id' => $row['customer_id'],
         'customer_name' => $row['customer_name'],
         'shop_name' => $row['shop_name'],
         'loyalty_points' => $row['loyalty_points']
      );
           //push each row into an array
         array_push($json, $arrcustomers);
  }
?>


               3. Output the array as json


<?php

$json1['Customers']=$json;
echo json_encode($json1);

?>

Step 6 : 

Call Php Page in browser (for eg: http://localhost/Get_Customers.php)

Step 7 : 

Get the Result in Web Page in JSON format

Result:

{"Customers":[{"customer_id":"1","customer_name":"sam","shop_name":"SamMedicals","loyalty_points":"50"},{"customer_id":"2","customer_name":"sandy","shop_name":"upahar_gruha","loyalty_points":"100"},{"customer_id":"3","customer_name":"vishal","shop_name":"vishal_panshop","loyalty_points":"30"},{"customer_id":"4","customer_name":"sunny","shop_name":"sunnys shop","loyalty_points":"40"}]}


I hope this article was helpful for beginners trying to create a simple php RESTful service.
I am Shruti Kulkarni and I am a beginner myself with one month of total experience working at Nanite Solutions as an iOS developer.

If you have further questions about RESTful services please feel free to write to me at shruti@nanitesol.com

Thanks

Guided by: Praveen Kumar, Nanite Solutions

Saturday, July 18, 2015

Location Based Social Networking


Topics

  1. Preface
  2. Introduction to Location Based Social
  3. Keywords and Terms
  4. Types or Classification of Location Based Social    - Current Location Social, Resident Social, Non-Resident Social and more
  5. Social Network
  6. End Note

Preface

This article is an abstract on Location Based Social (LBS), introducing the idea, features & activities, classification and benefits of LBS.

Introduction to Location Based Social

In a very broad sense, Location Based Social (LBS) or Location Based Social Networking (LBSN), means what is says. It is all about connecting people via various modes who are situated, involved or interested in a specific geographic location.


Keywords and Terms

Mobile Social, Geo-tagging, Geo-fencing, Geo-Social, Social Units, Crowd-sourced, Community Based

Types or Classification of Location Based Social

There are different types of LBS
  • Current Location Social
  • Resident Social
  • Non Resident Social
  • Travel Social
  • Elsewhere Social
  • Others (Can be more specific, for eg: Parking Social, Gaming Social)

Definition: Social Network

To make sure these terms are clearly understood, let us define Social Network first. Social Network (or Social Networking) represents relationships between individual people, establishments, groups or like-minded social-units in any combination and their interactions digitally or in any other form.
Social Networking interaction generally comprises of the following activities and much more:
  • Sharing knowledge or information
  • Connecting with friends, family and acquaintances
  • Sharing updates or digital media (pictures, audio, video)
  • Connecting with people of similar interests
  • Targeted Advertising or Broadcasting
  • Promotions and offers for monetary benefit
  • Interacting in Fan Clubs, Culture Groups and other Social Units
  • Chats, Messages, Celebrations and Wishes
  • Technology Solutions, Messageboards, Forums
Add "location" to the mix and it produces an entirely new interesting entity.

Now, let us take a look at the different types of Location Social

Current Location Social

This type of Location Based Social Networking is all about where you are at this present time ("Right here, Right now"). If you are in a stadium watching a Baseball game think about the possibilities of Location Based Social. You could:
  • Share/view Geo-tagged content (pictures, video or updates) of the event
  • Connect if there are any friends or colleagues at the same location (or NOT)
  • Find people of your origin or country or fan-club member
  • Find Geo-fenced deals and promotions for dinner, shopping and more
  • Advertise for that location of your product or service if relevant
  • Share rides, car pool, connect in the area
  • Find out public transportation information like Schedule, Stations, Routes, Changes near the event
The possibilities are limitless.

Resident Social

This type of Location Based Social Networking is all about the place where you reside. This could be a macro or a micro level social, right from being a Resident of London or being a Resident of a specific apartment complex in Worcestershire. A Location based Resident Social could mean a lot of things, which involves:
  • Events happening in your locality / neighborhood / town
  • Subscribing to Local news/updates specific to your locality
  • Find restaurants, shops, services in the locality
  • Deals and promotions near your home
  • Find groups, clubs or people of similar interest in your locality (for eg: People speaking French, Wine Lovers etc)
  • Conduct events in the area and invite people in the network
  • Share rides, car pool
  • Public transportation information
  • Contibute to the society by sharing information about your resident area

Non Resident Social

This type of Location Based Social Networking is when you have moved to a different country, city or locality that you are not as familiar with either temporarily or for long term. People buy/build houses in a new locality and move there, people change jobs and move, or it could be temporary move for various other reasons. This could get even more beneficial because it is not your home turf and there will be a need for information in various situations.

  • Find schools, tuition, summer camps and more for kids in the new locality
  • Find/Connect with co-workers, ex-colleagues, batch-mates or friends in the new area
  • Find hobbies or interests in the new location (Guitar classes, Tennis, Hangouts etc)
  • Share rides, car pool to work or other places
  • Find restaurants, shops, services in the new locality
  • Deals and promotions in the new locality

Travel Social

This type of Location Based Social Networking is about places that you are travelling to or travelled from or interested to visit etc. Imagine planning to visit a city in China or Turkey or anywhere else as a tourist; it would be great if you can get specific information like where you could get Vegan food or a homestay or cheap mode of travel etc. Traveling can be very eventful if unplanned, unconnected or can get expensive due to lack of information. Travel Social involves the following and more:
  • Tourist information that can be beneficial ahead of time
  • Where, others "like me" would like to eat or stay or visit
  • Local updates on news, weather for the place of travel
  • Deals and promotions at the place of travel (for eg: Hard Rock Cafe specials in Hong Kong during your visit)
  • Connect with friendly local people who may offer homestay, help, tourist information etc
  • Connect with people of your origin, ethnicity, language or country settled in the place of travel (it is a very happy feeling to meet someone from your hometown in a far off country even if you do not know the person)
  • Find food/products of your origin, ethnicity, language or country when traveling to another destination
  • Car pooling in Europe to travel between multiple countries
  • Information about Pubs and Bars and nightlife especially as a tourist
  • Publish information about your upcomming travel so that someone in your network might have someone in that area of travel for help, information, Do's and Dont's and more

Elsewhere Social

This type of Location Based Social Networking is of a very different nature. This is for those who are interested in a particular location neither as a resident, non-resident nor for traveling to that location. There are many situations when you might be interested to connect with a network about another location. You could be a fan of a band like TomorrowLand and would like to get updates on the event in Brussels though you are located in California. You may want to help your friend who is traveling to a city like Abu Dhabi which he has never been to; as another example, you may want to connect to a network in a place you lived 10 years ago; you wish to buy a Cologne from Koln, Germany and then find a friend on the network who is traveling back from Germany to your location. One more example: Send a birthday dinner gift to your sister in England while you are residing in Johannesburg.
While the Elsewhere Social seems a bit out of place for Location Based Social Networking, surprisingly we all keep trying to connect with People, Events, Groups or other Social Units elsewhere all the time, "with or without our knowledge".

Others

Apart from the broad classification above, on Location Based Social Networking, there could be many specific type of Location Social.
Think about "Parking Social" for a minute!! Find parking spots near your workplace when you are about to reach the office. How many times have we been circling-around-the-blocks trying to find a parking spot especially in downtowns and busy locallities? Saving 5-10 minutes in finding a parking could mean spending 5-10 minutes "extra" with your kid or wife or close friends. You could be late for a meeting at work just because you were frantically finding a parking spot and could not get any. Think about paying 25 bucks for parking in a garage in a busy locality just to find a guy pulling out of a free street parking spot right in front of your office building. What if you could get an update that someone near you has just removed their car and a spot is free or if you get a notification that someone is taking their car out in the next 2 minutes 3 blocks away. What if you could be able to decide which nearest Metro station to park the car from downtown so you could drive more and park closer?
There can be many other types of Location Based Social Networking that can be very specific in nature like Environment and Human Rights, Gaming Social, Health & Fitness and more.


End Note

There could be some disadvantages of Location Based Social Networking too.  You may not want a person, say your boss, to connect with you when you are in that baseball game. While trying to search for information, you end up giving information about your whereabouts or interests that you are searching which can be an intrusion to your own privacy.

Leaving that aside, Location Based Social Networking can be a great tool of limitless possibilities to connect, interact, find, publish and share useful information/interactions among individuals, community, related groups and other types of networks.

All in all, Location Based Social is a potential area for Businesses and Individuals alike to explore a plethora of possibilities with challenging problems to solve and an unexpected knowledge to mine.

Cloud computing primer - What is cloud computing?

What is Cloud Computing?
For people who have "no clue" what is cloud computing, below is a simple example:

Scenario: Imagine its your wedding and many guests are coming from different cities. Questions: 
Would you buy a house for them to stay during the wedding? 
Would you rent a house with a 6-month or one-year contract for their accommodation arrangements?  DEFINITELY NOT!!

Would you rather book some hotel rooms during the wedding? Of course! 
You will end up paying only for your usage and nothing more.

The notion or concept or idea of Cloud computing is somewhat similar to this situation.

Scenario: Imagine you want to create a Gift Products website as a business idea. The traffic to your website is extremely high needing 10 server machines during Christmas or Valentines and only 1-2 servers during off-peak gifting seasons.
Questions:
Would you buy 10 dedicated servers and host them in your office though only 1-2 servers are used for many of the days?
Would you rent 10 servers on a hosting domain for 1 year contract and pay money for more than your usage?  DEFINITELY NOT!!

This is exactly where you can host your application on cloud servers. You can increase or decrease the number of servers or CPU or RAM for your application or even have single or multiple instances of your critical components running based on usage. 
(Remember the hotel booking example above?) 
You will end up paying only for your usage and nothing more.

Let us understand some of the "jargons" related to Cloud Computing

What is IAAS?
INFRASTRUCTURE-AS-A-SERVICE - As the acronym says, only the infrastructure is available for you as a business to use. You can have the option to increase or decrease any amount of infrastructure like Servers, CPU, RAM, I/O etc in this model. But the Applications, Data, Runtime, Middleware, OS all have to managed by you. Things like Virtualization, Servers, Storage, Networking etc will be handled by the Cloud provider.

What is PAAS?
PLATFORM-AS-A-SERVICE - Along with the Infrastructure, even the platform (for eg: Microsoft Azure Cloud, Amazon Cloud or some others) is available for you to host your application. In this case you don't have to worry about Operating System, Runtime, Middleware, Networking, Storage etc as it will be managed by the Cloud provider. Only the applications and the data is something you have to manage.

What is SAAS?
SOFTWARE-AS-A-SERVICE - To quote an example: A complete healthcare application is made available for your to configure and start using on a cloud infrastructure with the platform and software and features and hardware and everything. It can be a Travel Application or a Manufacturing system etc.

Who are some primary cloud computing providers or cloud providers?
There are many players in Cloud computing. Some of the important ones are:

IAAS Providers
Amazon Web Services (AWS), Google Compute Engine, Rackspace Open Cloud, IBM Smartcloud Enterprise, HP Enterprise Converged Infrastructure, Openstack, VMWare, CSC and more

PAAS Providers
AWS (EC2), Force.com (SalesForce), Heroku, EngineYard, DotCloud, Windows Azure (Microsoft), Google App Engine to name a few

SAAS Providers
SalesForce.com, NetSuite, Oracle On Demand, SAP Business (ERP/CRM), Accelops, abiquo, AppDynamics and many more

What is a Public cloud? What is a Private cloud? What is a Hybrid cloud?


1. Public Cloud is hosted by a cloud provider which can be accessed with proper authorization. Infrastructure is shared between tenants and an internet connection is required.

2. Private Cloud is your own cloud solution hosted within the enterprise. This is very Safe and secure and self managed but can be very expensive due to cost of the hardware and maintenance involved

3. Hybrid is a mix of Public and Private cloud. You can separate your Sensitive application data in your private cloud, and the not sensitive and bigger applications can go to Public cloud. Benefits of both Security and Scaling is possible here.

You can take a look at these diagrams for further reading. Hope these simple diagrams very easily help in understanding Hybrid cloud.

Top searched keywords on Google by people

This summary is not available. Please click here to view the post.