RSS

Monthly Archives: February 2011

New Weekly Version – العدد الاسبوعي

New Weekly Version – العدد الاسبوعي

السلام عليكم ورحمه الله وبركاته

العدد السادس من الاصدار اللايف من مجله الكاتازين

 
Leave a comment

Posted by on February 24, 2011 in CATaZineLive Weekly Versions

 

The next three handshakes

The next three handshakes

The title expresses the way TCP establish a connection.

When TCP establish a connection it must do that scenario :-

  1. your server should be prepared to accept a connection.
  2. the client issues something called active open (Enables Socket – Allocate socket – initiate the connection). this causes the connection to send a synchronize segment (SYN) to tell the server client’s initial sequence for the data that will be sent. a SYN has only the TCP header and IP header.
  3. server must Acknowledge (ACK) the client’s SYN and the server must send it’s own SYN. with the data sequence that the server will send. so an ACK and SYN are sent in the same time.
  4. the client acknowledge the server’s SYN.

in normal cases only three packets are exchanged to establish a connection, so this is like 2 people shaking hands before getting known to each others ( three-way handshakes).



Connection Termination follows the same handshaking thing but 4 instead but we don’t call it the 4 way handshake. the termination goes as follows :-

  1. An application of the two requests to close the connection, so he performs an active close. so the guy who wants to close the connection says it’s finished sending data by sending a FIN segment.
  2. when the other guy receives that FIN. it acknowledges the received FIN, and passes the application an end-of-file (EOF). which is called a passive close
  3. later the other guy who just received that FIN will close it’s connection too. so it will send FIN.
  4. and the guy who receives that FIN perform the active close. connection is now history

By the way the title’s idea is from (The next three days)  for Russell crowe.

 
Leave a comment

Posted by on February 24, 2011 in Networks

 

User Interface Design In Android

User Interface  Design In Android

Designing User Interface in android

There are 2 methods for designing user interfaces : procedural and declarative…

Procedural

means in code >> when you’re programming an application you write a code to create the user interface objects ( Jframe , Jbutton)..

Declarative

doesn’t involve any code . When you are designing a webpage , you use HTML , that is a markup language based on XML >> describes the design of the webpage not how you want to do it..

In android you can create user interface in either style. You can create it using java code or XML descriptors .If you look up the documentation for any Android user interface component, you’ll see both the Java APIs and the corresponding declarative XML attributes that do the same thing.

Google Advice : use XML code as much as possible . XML code is shorter and easier to understand than java code.

why does android use “XML”?!

you may wonder why & how android uses XML specially that android is optimized for mobile devices with a limited memory .XML is a human readable format not known for its efficiency. Although you see XML when writing your program, the Eclipse plug-in invokes the Android resource compiler, aapt, to preprocess the XML into a compressed binary format. It is this format, not the original XML text, that is stored on the device.

layout

is a container for one or more child and is used to position them on the screen.

Here is the list of the most layouts provided by android :

  • FrameLayout : arranges its children , all start at the top left of the screen.

  • LinearLayout : arranges its children in single row or a column , this is the most common layout u’ll use.

  • RelativeLayout : arranges its children in relation to each other or to the parent (used in forms).

  • TableLayout : arranges its children in rows & columns.

simple sudoku interface:

when you create a sudoku project , the sudoku plugins will create a simple activity in sudoku.java :

what happended in this code >> android calls the onCreate() method to initialize it setContectView() .

R.layout.main >> is a resource identifier that refers to the main.xml file in the res/layout directory .

Main.xml declares the user interface .

Its important to know that R class is managed automatically by the android eclipse plugin . When u put a file in the res directory , the plugin notices the change and adds the new resource Ids in R.java.

The following XML code makes four buttons :.

the first line :

<?xml version=”1.0″ encoding=”utf-8″?>

all android xml code start with this line , it tells the compiler that the file in xml format and utf-8 encoding .

The following line : defines the xml namespace in android >>

xmlns:android=”http://schemas.android.com/apk/res/android

the following line takes up the entire width and height of the parent

android:layout_width=”fill_parent”, android:layout_height=”fill_parent”

<TextView> tag defines a simple text label

you have to refer to strings in strings.xml (res>values>strings.xml)

when you run the program now , you should see something like the following figure :

congratulations , ur first interface for beginning new sudoku game was created …

 
2 Comments

Posted by on February 24, 2011 in SmartPhones Development

 

Don't underestimate the power of a teen

Don't underestimate the power of a teen


10 Awesome Companies Built by Teens

The entrepreneurial spirit starts early for many teenagers, but for most things like high school, college and social lives overpower the urge to start a business.

But not every teenager.

Occasionally there are a few really driven youngsters who actually create successful companies before they are old enough to vote, buy alcohol, or even drive. Here are 10 inspirational stories of some incredibly successful young entrepreneurs, who all started their empires in their teens.

1. Fred De Luca

In 1965 Fred De Luca borrowed just $1,000 to start the now-famous Subway sandwich restaurant. Fred was only 17 years old when he decided to be an entrepreneur, and he started the restaurant as a way to earn money for college. Since opening the first shop in Boston, the chain now has 32,401 locations and makes over $9 billion in sales yearly. Fred and his co-founder Peter Buck have also founded Franchise Brands, a resource to help franchisors and entrepreneurs grow their brands.

2. Mark Zuckerberg

Mark Zuckerberg created the software that would eventually become the popular social networking site Facebook while he was at Harvard. He launched the site from his dorm room, and since that day has become the youngest self-made businessman who is worth more than a billion dollars. Zuckerberg dropped out of college and became the CEO of the fastest-growing site on the Internet. Facebook has since recorded over 400 million users and is now one of the most successful Web sites ever built.

3. Matt Mullenweg

Matt Mullenweg is another software developer who found success at a very early age. When Matt was 19, he announced that he would be starting an open source initiative for better blogging software and started WordPress. Since then the software programmer started Automattic, which has two flagship products Akismet, a trap for site comment spam, and WordPress.com, the hosted version of the open source WordPress software. Since founding Automattic, the company has raised over $30 million dollars and owns some of the most popular software on the Web.

4. Anand Lal Shimpi

Anand Lal Shimpi started AnandTech in 1997, when he was only 14 years old. The original AnandTech Web site was hosted on a GeoCities platform. What started as a simple hobby grew into one of the world’s largest Web sites covering computer hardware. The AnandTech forums is one of the best places to get computer advice and find tech bargains.

5. Carl Churchill

By 2020, Carl Churchill is expected to be worth $100 million. Carl founded DMC Internet in 2001 at the age of 15, and since has built an empire on helping businesses with their Internet presence. Churchill’s company offers anything from wireless broadband to server security for businesses, and from its launch grew exponentially. So much so that in 2003 Churchill was listed in the Royal Bank of Scotland’s “Rich List” of under 21s who would be millionaires.

6. Farrah Gray

Farrah Gray was a successful businessman before he reached his teens, and his success story is so bizarre that it’s almost impossible to believe. When he was 10 Gray formed a club that raised $15,000 for financing a lemonade stand, by 12 he had started a venture capital firm that raised $1 million from investors to help teenagers start their own business. Before he was 16 he had started business ventures that include pre-paid phone cards, One Stop Mailboxes & More franchises and The Teenscope “Youth AM/FM” interactive talk show. He became executive producer of a comedy show on the Las Vegas Strip, and was the owner of a food company that had orders exceeding $1.5 million.

Gray has since become a best-selling author. In 2005 his book Reallionaire was an international bestseller, and was even endorsed by Bill Clinton. Gray has written many books since then, including co-authoring Chicken Soup for the African-American Soul. But aside from all his success, Gray started his own non-profit Farrah Gray Foundation, which gives grants and scholarships to inner-city and students with at-risk backgrounds. And he’s done all this well before his thirtieth birthday.

7. Romero Bryan

Romero Bryan started designing clothes at the age of 12, and his own clothing line has taken off like a rocket. He’s dressed some of the most popular people on the planet including Beyonce, Victoria Beckham, Cameron Diaz, and Alicia Keys. Romero’s empire is expected to earn him over 30 million pounds by 2020.

8. Kristopher Tate

Kristopher Tate is a kind of programming wunderkind. Tate started working with HTML at age 4, before most kids have started reading. He started the photo-sharing site Zooomr at age 17 as a competitor to Flickr. Since then the company has grown into one of the top photo-sharing services on the Web. He has since moved the site’s headquarters to Japan, and is involved in creating Japan’s first society-based community site.

9. Jason O’Neill

Jason O’Neill has probably the most successful business created by someone under 10. At the age of 9, Jason started making Pencil Bugs, colorful pencil toppers in the shape of bugs. Aside from his business, Jason’s been featured on many major network shows, not only for his young entrepreneurship, but also for his philanthropic efforts. He’s donated money for foster children, and has sent his pencils to schoolchildren in Africa.

10. Fraser Doherty

While most successful young entrepreneurs make their money building popular Web sites, Fraser Doherty built his empire using a more traditional way. Fraser started making jams at the age of 14 in Scotland, and by 16 left school to work on his jam business SuperJam full-time. SuperJam sells around 500,000 jars a year, which currently has around 10 percent of UK jam market.

 
1 Comment

Posted by on February 24, 2011 in Companies

 

Static Routing Vs Dynamic Routing

Static Routing Vs Dynamic Routing

If you’re not familiar with “routing” and “routing tables” please refer to this topic before you continue : http://catazinelive.catreloaded.net/2010/12/routing-tables/

Static routing , Isn’t really a routing protocol all you need –as explained before- is to add the routes and you’re good to go , doing this in only convenient with small networks

*surprise* It wont change unless a human change it , so it wont handle any changes in your network –if a device is updated or something- you’ll need to reconfigure the route.

Dynamic routing :

Each router runs a routing daemon which allows it to communitcate with other routers in the network and transfere it’s routing table to other routers . using this information they’re able to decide an accurate picture of the network and calculate the best route to every destination on the network,Then this data will be stored into the routing table in the kernel.

This is implemented in two algorithms (vector distance , Link state)

Briefly , in vector distance algorithm each router communicates with it’s neighbors , a receiving router will then updated it’s routing table and transfere it to the next neighbour which is really slow.

While in Link state algorithm each router multicasts it’s table to every router in the network , that’s how every router will be able to calculate the best route for every destination on the network , however it’s much more complex.

Based on these algorithms several protocols have been designed to implement them they include :

-RIP (Route Information Protocol)

-RIP V2

-OSPF(Open Shortest Path first) which is used for complex unstable networks

-BGP(Border Gateway Protocol) the standard protocol for the internet

These protocols are Implemnted in what I mentioned before , the routing daemons most Unix systems has two or three daemons which are :

1-routed : The oldest daemon ,It implements RIP protocol only which doesn’t need any configuration the only thing you need to do is set IP forwarding on

# echo 1 > /proc/sys/net/ipv4/ip_forward

Or to make this perminant :

Edit /etc/sysctl.conf

“ip.ipv4.ip_forward=1”

2-gated : A commercial daemon ,It implements every routing protocol which is really complex

3-Zebra : The open source response to gated

routing daemon management is usually a task done by someone other than the system admin but I think I’ll cover that part anyways later isA.

 
Leave a comment

Posted by on February 24, 2011 in Networks