Wednesday, January 22, 2014

Is it not too late!

The art of creating hope is really sth of need to the people who would like to do sth in their lives.
Why I am saying so?!
After I have passed by http://www.damonkohler.com/2012/12/cloud-robotics-at-devoxx-2012.html
about Cloud Robotics at Devoxx 2012... I just remembered old days when I dreamed about Robotics and how my objective at that time to be IT and Control Systems Engineer. Also, how I use his blog at 2009 to help me with my 1st Android application. I was having a passion for science and technology and I still do but I could not utilize it. I have this discovery spirit, moving from a technology to another without producing sth.
It is not enough to have a good intention or to be talented. It is ultimately critical to utilize what you have for what you want...
Stand up and survive!

Thursday, January 16, 2014

Restart Concept

In Digital World, The reboot or restart concept is always dominating! That is it if you have the ability to

  • Switch (device...) off and on 
  • Plug (cable...) and unplug 
  • Kill (app...) and restart it
  • ...
would be the easiest and the fastest way to solve the problem. If you are afraid from losing data or interrupting service then troubleshooting is the way but some times even you will need to apply the reboot concept.

A case study:
If you are facing a problem in identifying your android device to the ADB tool:
adb devices
List of devices attached is empty

device then, apply the Reboot Concept: All steps are intuitive but for the app, issue the following CMDs:
adb kill-server
adb start-server
BTW, to move new installtions in Android to the SDCard to solve the Memory low problem:
adb shell pm set-install-location 2



Wednesday, January 15, 2014

Some notes in Restful APIs

There are many tutorials describing RESTFUL APIs, but here I would just highlight some of the things that I think they are really important:

  • HTTP request and response consists of Header "template based text" and Body "any format". the content type of the body is specified in the header "i.e Content/Type: application/json"
  • S = Stateless: means every transaction or request to the server is independent from others


  • HTTP verbs:

- GET: a read-only request from the server for a certain URL to retrieve data. But the the client can do some processing on the coming data such as changing the appearance. Body is Empty.

- PUT: mostly used for updating data (with a specified URL i.e id) but also can be used to create data on the server. Body has data.

- Delete: the opposite of put for this specified URL. Body is Empty

- POST: mostly used for creating resources but without a specified URL. Body has data.


  • Idempotent methods: whenever they are repeated the result is the same. PUT "the specified url has been updated or created by its ID", DELETE "deleted once, a repetition has no effect as it is already deleted", GET "retrieve the same data as it is a safe operation no data will be changed".
References:

Tuesday, January 7, 2014

Git in a nutshell

The most basic CMDs you need in order to deal with Git and GitHub:

  git init      // initialize the git repository
  ls
  git status     //show what is going on!
  git add .     //add files from directory to the index
  git status
  git commit -m "add basic files"     // commit index to the head
  git status
  git remote add origin https://github.com/aselims/UCML.git      //the point connecting to GitHub
  git remote -v  
  git pull origin master   // retrieve data from server 1st step before uploading
  git add .
  git commit -m "modify readme2"
  git status
  git push origin master   // upload data


-- Terminology
§ master: This is what a branch is: it’s simply the hash of the last commit scribbled down in a file. It’s a clue, a starting point, sometimes called a tip because this represents the tip of the iceberg that is the entire history of the master branch.
~/mysite$ cat .git/refs/heads/master
0d0321f29f04f734e8d9873e34d9409fe115b496

And since you can have multiple branches in a repository, we should also remember which one we’re working on right now.
~/mysite$ cat .git/HEAD
ref: refs/heads/master

show the commit of 3bd54c
git checkout 3bd54c

- One good resource: http://rogerdudler.github.io/git-guide