Tuesday 30 April 2013

Amazing Shots - 360 degree

1. Lake Hillier, is a lake on Middle Island, the largest of the islands and islets that make up the Recherche Archipelago, Western Australia. The most notable feature of this lake is its pink color.

Lake Hillier


2. Sagano bamboo forest (located near Kyoto, Japan) is one of the most beautiful bamboo forests in the world.


Sagano Bamboo Forest


3. This is Hala Fruit from Hawaii.


Hala fruit


4. If Saturn were as close to Earth as the Moon is, this is how it would look like.


Saturn_close_to_earth


5. There's a butterfly (Glasswing Butterfly) with transparent wings.


Glasswing Butterfly


6. The Tsunami Cloud !!!  This incredible photograph was taken by Gary Brink at the Holland State Park in Michigan, USA. The incredible cloud formation formed on Lake Michigan just off the beach.


Tsunami cloud


7. Amazing shot of lenticular clouds over Lake Crowley, California.


Amazing clouds, CA


8. Mount Roraima one of the oldest geological formations on Earth!


Mount Roraima


9. Cotton Grass, Iceland.


Cotton grass, Iceland


10. "Blue Emperor Scorpion". One of the largest scorpion in the world.


Blue Emperor Scorpion

Monday 29 April 2013

Interesting but weird - Omar Borkan Al Gala : one of the three irresistibly handsome men who were deported

Omar Borkan Al Gala

If you thought that there’s no flip side to being impossibly handsome, think again

Three men from United Arab Emirates were attending the Jenadrivah Heritage & Culture Festival in Riyadh, the capital of Saudi Arabia. They were forcibly evicted from the festival by Saudi police officers. The grounds for this harsh move? The visitors were too handsome.

“A festival official said the three Emiratis were taken out on the grounds they are too handsome and that the Commission [for the Promotion of Virtue and Prevention of Vices] members feared female visitors could fall for them,” a Saudi Arabian newspaper Elaph reported.

After evicting them, the police immediately deported the trio back to Abu Dhabi, lest any Saudi women see them and find them too irresistible to not fall in love.

Saudi Arabia is extremely conservative and offers little liberty to its women citizens. The female population of the country is not permitted to talk to any men to whom they are not related.

asaintown.net recently posted some pictures of Omar Borkan Al Gala, saying that he was one of the three irresistibly handsome men who were deported.

Thursday 25 April 2013

Awesome editor for any Scripting Language - Sub lime Text Editor

In Linux and Mac, most people use Vi editor and text editor for editing any scripting languages like shell, Python..etc,

This editor will be a bit complex and will not be handy to use.

One of my friend, A Linux enthusiast has introduced me a editor called "Sub Lime". 

This is an awesome text editor.  I found it very useful and handy. So thought of sharing it with you all.

Advantages of Sublime Text editor:

1. It gives auto suggestions for keywords and variables.

2. You can easily manage files and folders.

Steps to install :

sudo add-apt-repository ppa:webupd8team/sublime-text-2
sudo apt-get update
sudo apt-get install sublime-text

After installing you can type the following command to open it.

sudo sublime-text

You can also find this in the applications after installing.

Do easy programming....

Reference Link : http://ellislab.com/forums/viewthread/232759/

Here is the preview ....

sublime

Wednesday 24 April 2013

Python Programming Tutorial 2 - Strings

Python has a built-in string class named 'str'(Java - String) with lot of features. Python strings are immutable which means they can't be changed after creation(Java strings are also immutable). String can be enclosed by either single or double quotes.

Characters in a string can be accessible through [] syntax and python is also zero-based index as Java and C++. Built-in function len(str) returns the length of string(number of characters in input string)

Note: Don't use "len" as a variable name, it will block the len(str) functionality.

[code]>>> s='hi'
>>> s[1]
'i'
>>> len(s)
2[/code]

Below given video, demonstrates the some of the python String literals.

Note: Content was Scrapped from youtube.


In Java the '+' automatically converts the any types to String while appending with String literal but in Python this is not a case. The function str(data) will convert the input data to String.

[code]>>> pi=3.14

>>> str(pi)
'3.14'
>>> 'rrr'+pi
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: cannot concatenate 'str' and 'float' objects
>>> 'rrr'+str(pi)
'rrr3.14'
>>> num=18
>>> print "ff" + repr(num)
ff18
>>> print "ff" + `num`
ff18[/code]

Below given video, demonstrates the some of the python String representation.

Note: Content was Scrapped from youtube.



If the value to String literal is prefixed with 'r' and interpreter will pass all the chars without special treatment of backslash '\'.

[code]>>> raw="test\nraw\t.."
>>> print raw
test
raw ..
>>> raw=r"test\nraw\t.."
>>> print raw
test\nraw\t..[/code]

A 'u' prefix allows you to write a unicode string literal (Python has lots of other unicode support features)

[code]>>> data=u'Hello World !'
>>> data
u'Hello World !'
>>> data=u'Hello\u0020World !'
>>> data
u'Hello World !'[/code]

The escape sequence \u0020 indicates to insert the Unicode character with the ordinal value 0x0020 (the space character) at the given position.

Python Programming Tutorial 1 - Numbers and Math

This tutorials gives overview of the Python numbers and Math functions.

Using the Python as Calculator


Let's try some python command line options.  The python Interpreter act as an Calculator, we can do simple mathematical function in the command line.

Below given video, demonstrates the some of the python number and mathematical functions.

Note: Content was Scrapped from youtube.



A values can be assigned to several variable simultaneously.

[code]>>> x = y = z = 0 # Zero x, y and z
>>> x
0
>>> y
0
>>> z
0[/code]

Complex numbers are also supported; imaginary numbers are written with a suffix of j or J. Complex numbers with a nonzero real component are written as (real+imagj), or can be created with the complex(real, imag) function.

[code]>>> 1j * 1J
(-1+0j)
>>> 1j * complex(0,1)
(-1+0j)
>>> 3+1j*3
(3+3j)
>>> (3+1j)*3
(9+3j)
>>> a=(1+2j)/(1+1j)
>>> a
(1.5+0.5j)
>>> a.real
1.5
>>>a.imag
0.5
>>> abs(a) # sqrt(a.real**2 + a.imag**2)
5.0[/code]

In interactive mode, the last printed expression is assigned to the variable _. This means that when you are using Python as a desk calculator, it is somewhat easier to continue calculations, for example:

[code]>>> tax = 12.5 / 100
>>> price = 100.50
>>> price * tax
12.5625
>>> price + _
113.0625
>>> round(_, 2)
113.06[/code]

Python Programming Tutorial 2 - Strings

Subscribe for next update. Thanks you.

Technology Driven Startups

Struts Video Tutorial

http://www.youtube.com/watch?v=f46WEeM8HTA&list=PLB7BB551126EDD5E0

Spring Video Tutorials

Tuesday 23 April 2013

Ways to Contribute to Open Source

Plenty of people want to get involved in the open source and they do not know where to start. Below source will give plenty of tips and ways of contribution.

Open source software has changed computing and the world, and many of you would love to contribute. Unfortunately, many people are daunted by what they imagine is a high barrier to entry into a project. I commonly hear people say that they'd love to contribute but can't because of three reasons:

  • "I'm not a very good programmer."

  • "I don't have much time to put into it."

  • "I don't know what project to work on.”


There are three core principles to remember as you look for opportunities to contribute:

  • Projects need contributions from everyone of all skills and levels of expertise.

  • The smallest of contributions is still more than none.

  • The best project to start working on is one that you use already.


Continue Reading.

Tuesday 16 April 2013

Significance of Host File in Windows

What is host file?

Almost every operating system that communicates via TCP/IP, the standard of communication on the Internet, has a file called the HOSTS file. This file allows you to create mappings between domain names and IP addresses.

You can command your machine to contact the only a particular machine for replies.

How to set your local machine to contact only a particular machine for the replies with the host file on Windows?

1.Click on Win+R or Start -> run and type drivers as below:

1

2. Goto the “etc” directory and open the hosts file

3

3. Add the entries in the following format and save it

{IP}         {Domain Name}

Example:

127.0.0.1              localhost

10.90.112.101     domainname

5

Note:

You must have the administrative rights to modify/add the entries in hosts file.

4. After saved the above host entries, whenever you gave the request the particular domain configured in the hosts file then response will come directly from the ip which we configured(example: 10.90.112.101)

5. If you need to host entries, just delete the line which you added or insert “#” in front of the line as below

#10.90.112.101  domainname

Thursday 11 April 2013

iOS UI Automation






Introduction / Overview

iPhone apps are developed using native or native-hybrid bridge.

native-hybrid : The datas are rendered in HTML and the native actions are performed using js callbacks

Automation testing framework for these applications is mainly to,

  • Reduce the manual testing effort

  • Reduce the testing cycles involved for any changes to the application

  • Provide maximum test coverage


images



Why UIAutomation ?


Selenium Automation

Using selenium the basic level functionalities like tapping, swiping could not be done in the iPhone app. so,selenium could not be an option to automate the iPhone app
Jasmine framework


  •     Jasmine is a BDD (Behavior Driven Development) framework.

  •     Jasmine is mainly used for Unit testing

  •     More or less jasmine is same as tuneup framework

  •    Jasmine provides good reporting structure

  •    Reports can be in xml or html format


UI Automation + tuneup.js


  •     It is the Apple's inbuilt Automation testing framework.

  •     It is highly stable and also reliable testing framework.

  •     It uses javascript to automate the testcases.

  •     Automation can also be performed in the specified devices

  •     It can also be accessible from command line so that we can also integrate this with Hudson

  •     Considering its salient features,simplicity UIAutomation is preferred for automating the test cases over other testing frameworks


Tools used



  •      Xcode IDE (Version 4.X and above)

  •      Instruments


Instruments Tool

Instruments is a tool for UIAutomation provided by Xcode. Instruments provides us the record and playback feature which will be very useful in doing automation

It can be used to collect data about the performance and behavior of one or more processes on the system and track that data over time.
Test Case Log

The test case when executed on the iOS application target, using Instruments,

The Instruments console will show the details of,

Log Message - What Test case is being executed

Log Type - Test case is Pass or Fail.

If a test case fails, it would display the

  •  Element tree in the failed page meaning, what are the UI elements present in the current page.

  •   Also the screen shot of the page in which error occured.


Automation Framework


Tune-up  is the framework used for automation

Tune-up is a collection of JavaScript utilities that builds upon and improves the UIAutomation library provided by Apple for testing iOS applications via Instruments.
You can find more details about the Tune-up framework from here:https://github.com/alexvollmer/tuneup_js/blob/master/README.md
an also in http://alexvollmer.com/posts/2010/07/03/working-with-uiautomation/

Test Structure in Tune-up


To create a test case, use the test() function, which takes the name of the test case as a string, and a function. The function will be given a UIATarget instance and a UIAApplication instance.

For example:


test("Sign In to the app", function(target, app) {

// The target and app arguments are root elements

/* (i.e) The element structure of every element in the app goes in this way
UIATarget.localTarget().frontMostApp().(position of the particular element in the view)
for reusing UIATarget.localTarget().frontMostApp() we store it in target,app   */

// The UIATarget is the primary portal into the application running on the device or simulator

// Steps for Sign-in

});

test("Sign out from the app", function(target, app) {

// Steps for Sign-out

});





Integrating with the Project



MakeFile configuration:


Configure the MakeFile which is in the project home , with the command lines which is used to build the project and Launch the instrument.

Add the following configuration,

1.TRACE_PATH : Location to store the .trace file, which will create after the execution of test script using instruments.

2.TEMPLATE_PATH : Location where the test case TemplateTrace files are stored, which is created from the instruments by saving the testSuite script as Template.

3.uiautomation :

Shell command which

  • Builds the project ,

  • Executes the test case script by launching the Instruments tool.

  • And this executes the test Suite which has the entire flow.


Ex.
/* Specify the Trace path, Template path and App path */












TRACE_PATH = TraceDocument/UIAutomationTrace

TEMPLATE_PATH = Test/Automation/Resources/TestCaseTemplates

APP_PATH = /Users/${projectpath}//Products/Debug-iphonesimulator/sample.app





/* Shell commands to Run the Test cases */












uiautomation:


    xcodebuild -workspace sample.xcworkspace -scheme Release -sdk iphonesimulator5.0


    instruments -t ${TEMPLATE_PATH}/testSuiteTemplate.tracetemplate -D ${TRACE_PATH} ${APP_PATH}





Running the Automation Script


Command to run automation from Terminal using the MakeFile ,

In Terminal ,Move to the directory where the ‘.xcodeproj‘ file resides

And execute the following Command,











make uiautomation





Additional Info about Shell Commands


Write a Shell Script to execute the following commands

1) Building the Project


At first the Project should be build through ‘xcodebuild’ command

xcodebuild:

This command is used to build the xcode project.

Xcodebuild Usage

Xcodebuild -- workspace [PROJECT-WORKSPACE] --scheme [SCHEME-NAME] --sdk [DEVICE/SIMULATOR NAME]




















Option Description
-- workspacePROJECT-WORKSPACE
Name of the Project file(ex sample.xcworkspace)
--schemeSCHEME-NAME
Name of the Sheme
--sdkSpecify the device/simulator name(ex: simulator name – iPhoneSimulator5.0)


Move to the directory where the ‘.xcodeproj‘ file resides and then the command Should be executed

Ex:

Move to the directory where the project resides

Execute the xcodebuild command

$bash: xcodebuild -workspace sample.xcworkspace -scheme Release -sdk iphonesimulator5.0

This command will build the project with configuration as release and sdk as iphone simulator5.0

2) Launching the Instruments tool


Execute a command to launch the Instrument with the latest build

This command executes the saved ‘.tracetemplate’ file and saves the result in the path specified
Instruments Command Usage

instruments [-t template] [-d document] [-w device] [-p pid] | [application [-e variable value ]]




































Options                                                 Description
-t     templateFile name of type ‘ .tracetemplate ‘ with the path of  the file location
-s     Show list of known templates and exit
-d     documentThe path to save the trace document data to (This may already exist, in which case
a new Run will be added)
-p     pidThe ID of the process to attach to
application     The path to the application or command to launch
-w     hardware deviceThe identifier of the hardware to target
-e     variable valueAn environment variable setting (You may specify more than one)


Ex :

       instruments -t $TEMPLATE_PATH -D $TRACE_PATH  $APP_PATH
























OptionDescriptionExample
TEMPLATE_PATHTemplate path is the path of the saved template file$PROJECT_HOME/Test/Automation/Resources/TestCaseTemplates/testSuite.tracetemplate
TRACE_PATHIt is the path where the .trace will be saved after executing the automation$PROJECT_HOME/TraceDocument/UIAutomationTrace
APP_PATHIt is the path of the latest build of the APP~/Library/Developer/Xcode/DerivedData/sample-gxfepasnjxtmhjcevjkpyunezjca/Build/Products/Debug-iphonesimulator/sample.app


Note: After the execution of the xcodebuild command the app will be build in a directory; APP_PATH should have that directory path

The Build path can be customized. To change the app build path, In  the Xcode Choose the Xcode option int the Menu bar choose Preferences – Locations and then give the custom location in the derived data field

On executing this command, the script loaded in the .tracetemplate file will get executed on the specified simulator/device and stores the .trace file in the specified path



Friday 5 April 2013

Light smart by going green

I was in dilemma, when I started to write this blog. Because the content that am going to narrate here is a well known fact.  But still, a recent incident has urged me post this blog.

How many of us have cursed the Tamil Nadu or Indian government for inconsistent power supply. We blame political parties, politicians and even God at times for lack of rain which has a direct influence in power production.  But we fail to think that there is only few that can be done by the government and we as a citizen of this country need to take responsibility and do some possible deed.

There is a simple step that you can contribute to nature in two ways, one by consuming less energy and another by polluting the environment less.

Its nothing but replacing incandescent bulbs with CFL bulbs. How this will help us ???.

DSC_0285-1

A CFL consumes 25% less energy when compared to an incandescent bulb. This saves electricity by 70%. An incandescent bulb glowing for 1 hr consumes 60 watts, whereas a CFL glowing for 1 hour consumes 10 watts only. You will get the same glow from both these bulbs. We save 50 Watts of energy per hour, if we do a simple change.  This is how we consume less energy.

"We never know the worth of water till the well is dry".  ~Thomas Fuller,Gnomologia. Same is the case for power we waste most of the time without knowing its value. 

On the other side of the story, If we light an incandescent lamp for one hour it produces 5 kg of co2, which is an endanger for the environment. This is equal to riding a bike for 8 km. So the first immediate step we need to do is to change all the incandescent bulb with CFL wherever  we could.  So that you can contribute something valuable to the environment and to the nation by saving a decent amount of electricity.

You may have lot of questions that, who is buying incandescent these days and where will be these kind of bulbs found now a days. Yes, we have many people around who are unaware of it. The reason why am writing this here is, one of my well educated friend has recently bought a incandescent bulb to our home.  That's the time I have decided to post this blog and create awareness about the same.  You can find these kind of bulbs in rural areas mostly than the urban. It is not uncommon to find these kind of bulb in rural areas.

If we change every such Bulb in our state(Tamil Nadu), we can get an extra 15 mins of power for each day in our state. We can do this instead blaming our government or politicians. If we could make it happen and if we do the same in all states of our country, we could save a lot of power and that can be used for many other industrialization purposes.

I thought of this blog a long time back and drafted this, But I need to be a "Doer before a Sayer".  It took a months time for me to change all incandescent lamps wherever I could (In my home, My Grandma's home, Our current rented home in Chennai). Totally 5 is what I have changed so far.  Even its a little am happy that I have contributed something to the environment and did a good deed as a citizen to my country.

Little progress together makes a brighter and greener future. I want my friends to do and Share the same.

Lets create a better future together.....