Archive for May, 2012

Python- Basic Datatypes n Operators

Posted: May 31, 2012 by AnKz . . in FOSS
Tags: ,

Python has a rich collection of datatypes and associated operators. It uses Dynamic typing system where type checking is performed at run time instead of compile time. Here the values have types and not the variables(as in C,C++….).

Datatype of an value stored in variable (a) can be verified as  —  type(a)

Datatypes and operators are as follows :-

1) Numbers

  a)  int —–> Ex. a=28

  b) float

 c) complex ——> Ex. c=5+6j(Real part= c.real, Imaginary part= c.imag, Absolute value= abs(c))

2) Sequence

Used to hold a bunch of elements in a sequence.

 a) String

Anything within quotes is a string.

Ex.str = ‘Decoding’

print str # Prints complete string

print str[0] # Prints first character of the string

print str[2:5] # Prints characters starting from 3rd to 6th

print str[2:] # Prints string starting from 3rd character

print str * 2 # Prints string two times

print str + “TEST” # Prints concatenated string

 b) List

 Items enclosed in [] and separated  by , constitute a list

Ex.list = [ ‘abcd’, 786 , 2.23, ‘john’, 70.2 ]

print list # Prints complete list

print list[0] # Prints first element of the list

print list[1:3] # Prints elements starting from 2nd to 4th(Slicing)

print list[2:] # Prints elements starting from 3rd element

print list[0:4:1] # Prints alternate element from 1st to 4th.

print tinylist * 2 # Prints list two times

print list + tinylist # Prints concatenated lists

 c) Tuples

Items enclosed in [] are tuples. Tuples are read-only lists.That makes a difference in both of them.

Ex. can be same as lists only [] should be replaced by ().

d) Dictionary

Dictionary consist of associative arrays with key-value pairs.

Ex.tinydict = {‘name’: ‘ankz’,’code’:2628, ‘company’: ‘decoding’}

print tinydict # Prints complete dictionary

print tinydict.keys() # Prints all the keys

print tinydict.values() # Prints all the values

Try playing on these datatypes. There is lot more to work on.

Happy Decoding…!

If you wish to automate your tedious task, write a GUI app or a game, Python is a language just for you. You can use shell script or batch files for the same but they are not well-suited for apps or games.

Python is a high level language with high database, Kool and readable syntax and best part- easy to learn.

Because you time is more valuable than machine time.

So let’s decode……

  • Invoking Python Interpreter

Start python interpreter on your shell.  Well it would be better if you use Ipython, an enhanced interpreter.

$python

OR

$ipython

                       Python  2.7.1  ( r271:86832,  Feb  21  2011,  01:28:26 )

                       [GCC  4.5.2  20110127 ( prerelease ) ]  on  linux2

                      Type  ” help ” ,  ” copyright ” ,  ” credits ”  or  ” license “

                       >>> 

Where >>> is the interpreter prompt. The interpreter is ready and waiting for you to enter a  command line.Ctrl+D is used to exit python.

  • Hello World !!!

Following the tradition, let’s work on a Hello World program. Here no need to include any header file, directly prompt it

>>> print “Hello World !!!” [Enter]

Hello World !!!

  • Basics

Some basic Level 0 ‘ to remember’ points while we start working with python.

1)      Python is case-sensitive programming language. Eg. ‘Decoding’ and ‘decoding’ are two different names or identifiers in python

2)      Indentation : There are no braces to indicate blocks, instead line indentation is used. No. of spaces in indentation is variable but all statements within the block must be indented by same amount.

3)      Multi-line statements can be written using line continuation character(\ )

   Exception :- Statements in (),{},[] can be written without using \.

4)      Quotations (‘ ’,” ”,’’’ ‘’’ or “”” “””)

word= ‘decoding’

sentence=”Decoding is fabulous.”

Paragraph=””” There are two ways to write an error free program.

And only third one works.”””

5)      Comments(#)

Eg.          #First Comment

print “Hello Decoders”      #Second Comment

Just revise these basics and we will move on to programming in next Article.

Till then Happy Decoding

At this point, you are probably tired of hearing how HTML5 is changing everything. Everything in web applications and even mobile applications are changing. HTML5 even lets you create a web application that works almost like a desktop application. Yes, there is a lot of hype about HTML5, especially when you consider that the specification is not entirely complete. However, there is a lot of information that is fairly stable, and this is driving much of the hype.

So, what is HTML5? Actually, it is not just HTML. It is a family of technologies that includes new HTML tags, CSS3, and some new APIs. The new tags and css are really helpful, but the APIs are the parts of the specification that are the source of the hype.belwo are some key features about HTML5:

Semantics

HTML5 adds new tags for defining the structure of your pages. Tags like <header>, <footer>, <nav>, <section> and <article> help put meaning into the structure of your documents. The addition of RDFa, microformats and microdata, add more programmatic accessibility and meaning to your content.

Offline & Storage

Offline access and storage is the most volatile section of the specification. The App Cache and Local Storage APIs are stable, and will prove very helpful to application developers looking to extend their reach and allow usage when not connected. Other APIs that are also being developed are the Indexed DB and File APIs.

Device Access

One of the more talked about aspects of this category is the Geolocation API, which gives web developers access to a user’s location similar to what many mobile applications have. There is access to other local device features (microphones and cameras) and data (contacts and events).

Connectivity

Quite possibly the most interesting piece of HTML5 is the WebSockets API. This allows the web application to make calls to a server without hacking together various AJAX requests or worrying about polling the server constantly. Additionally, the Server-Sent events (or push notifications) further the communications between the client and the server.

Multimedia

HTML5 adds several new audio and video tags that enable developers to add multimedia without the use of Flash. This becomes more important when dealing with the various mobile devices, especially those that are not Flash-enabled, like the iPhone.

3D, Graphics & Effects

There are a lot of features that have been added but the new Canvas has received all of the talk. CSS 3D effects have been implemented in browser-specific extensions. SVG  has also been used for quite some time, as well as the WebGL specification. So, it makes sense that Canvas gets all of the attention, it is the only real new feature in the category.

Performance & Integration

People have been using AJAX for years, but the new specification has improvements in XMLHttpRequest 2. More interesting is the new WebWorkers specification, a new API that will help application developers develop background processes.

Objective-C : An Introduction

Posted: May 21, 2012 by Shashwat Pradhan in Uncategorized
Tags: , ,

The Objective-C language is a simple computer language designed to enable sophisticated object-oriented programming. Objective-C is defined as a small but powerful set of extensions to the standard ANSI C language. Its additions to C are mostly based on Smalltalk, one of the first object-oriented programming languages.
It is almost 30 years old(origin is from NeXT) and today, it is used primarily on Apple’s Mac OS X and iOS.

The Objective-C language defers as many decisions as it can from compile time and link time to runtime. Whenever possible, it dynamically performs operations such as creating objects and determining what method to invoke. Therefore, the language requires not just a compiler, but also a runtime system to execute the compiled code.

The Objective-C model of object-oriented programming is based on message passing to object instances.Sending the message method to the object pointed to by the pointer obj : 

[obj method:argument];

Objective-C requires that the interface and implementation of a class be in separately declared code blocks. By convention, developers place the interface in a header file and the implementation in a code file. The header files, normally suffixed .h, are similar to C header files while the implementation (method) files, normally suffixed .m

 
@interface classname : superclassname {
    // instance variables
}
+ classMethod1;
+ (return_type)classMethod2; 
- (return_type)instanceMethod2WithParameter :
(param1_type)param1_varName andOtherParameter:(param2_type)param2_varName;
@end

Plus signs denote class methods, or methods that can be called on the class itself (not on an instance), and minus signs denote instance methods, which can only be called on a particular instance of the class.

So this was just the basic of objective-C. You can learn more about the language from here : http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjectiveC/Introduction/introObjectiveC.html

Although this language will look tough to learn on its first glimpse, it is one of the simplest and powerful OOP language one can learn ! You can follow us on Facebook for more info on programming languages.

BB10 Dev AlphaBehold the BlackBerry 10 Dev Alpha. RIM has revealed the pièce de résistance. These devices are being distributed to developers at BlackBerry Jam keynote sessions and the Dev Alpha will be the primary vehicle to drive BB 10 developers until the final production smartphones begin shipping sometime later this year.

The Dev Alpha boasts a 4.2-inch screen (it’s still unclear what type it is, and if it’s PenTile) with a stunning resolution of 1280 x 768.  The Dev Alpha still runs on  BlackBerry PlayBook OS 2.0(which will be different from BB OS 10), it uses bezel gestures to navigate around the device and swipe between apps. The developer device is powered by a TI OMAP processor similar to the one found in the BlackBerry PlayBook.

This device may just be the game changer RIM is looking for. We will keep you updated! You can follow us on Facebook for the latest updates.

Samsung Galaxy S III: Meet the New Android Emperor

Before we discuss about the new Galaxy lets take a quick look at its specs which seem pretty interesting. The 4.8-inch display is a Super AMOLED panel with 720 x 1280 (306ppi) resolution.It has a 1.9MP forward-facing camera which shoots 720p video. Over on the Galaxy S III’s backside, it’s got a simple 8MP camera that can shoot 1080p video. But don’t let that lowly sensor number put you off – Samsung’s got a few camera tricks in store this time.

Running on one of Samsung’s beastly new 1.4GHz Exynos 4 Cortex-A9 quad-core chips, it comes with 1GB of RAM, and a choice of either 16, 32 or 64GB internal storage configurations (all of which also let you chuck a microSD card up to 64GB in, as well.)

Seven sensors, including an accelerometer; RGB light; digital compass; proximity; gryoscope; NFC, and barometer have been shoved in too.

All of this in a body that weighs 133grams, measures 136.6 x 70.6 x 8.6mm, and houses a 2100mAh battery; Samsung’s first smartphone with a battery that size.

It has android ICS 4.0 (Ice Cream Sandwich) which has been tweaked to perfection! It has new features like  S Voice, which is a Siri-like voice recognition feature, that you can use to enquire about the weather; take a photo (“Hi Galaxy, please take a photo” to open the camera app, or “cheese” to snap it), and other tasks.

There will be two colour options, marble white and pebble blue.

The Korean manufactuer claimed the phone was “Inspired by nature, developed for humans”. The word out there is that the Galaxy S3 doesn’t only beat the current iPhone but takes on the next one as well ! Its a little early to say that,as we will have to wait and see but the specs on paper seem pretty impressive.

The Galaxy S III will be available in the US this summer. We are looking forward for your comments on the Samsung Galaxy SIII.

Posted: May 3, 2012 by Mayur More in Uncategorized

BLOG COVERS TECH NEWS & HACKING ARTICES

Now we download stuff almost daily. New products pop out so often. You can use any software forever you want. You can download trial version, right. Trial version expires after some days. You can stop that expiration. You can tell trial version of the software to not count days or do not bother about time. The software will stay and keep working like original software forever and will not expire or cease to work. You do not have to change your system clock. This little software does it all.



Time Stopper : use Trial Version software forever without Expiration
Time Stopper : use Trial Version software forever without Expiration

Time Stopper is the software which can stop the time for try out version software. When you stop
the time you can use your try-out versions forever. When you stop the time of a try-out version using this Time Stopper it works via this Time Stopper. Real time and date run…

View original post 131 more words