Friday, June 26, 2009

How to redirect gmail




You can redirect the emails sent to your gmail account to other email address.
Step 1
On the upper-right corner of your gmail webpage, Select
Settings -> Forwarding and POP/IMAP

Step 2
In the "Forwarding:" tab
click the radio button in front of "Forward a copy of incoming mail to"

Step 3
In the textbox "email address", change "email address" to the email address you want to foward to.

Step 4
Press save changes.

What is Spam2.0

I bumped into a new jargon "Spam2.0" or "Spam 2.0" recently.

After some research, I found out the word "Spam2.0" or "Spam 2.0" is originated from a post on Official Google WebMaster Center Blog by Jason Morrison, a member of Search Quality Team today. There is no google product called "Spam2.0" or "Spam 2.0" so far. The author seems to refer to spam targeting Web2.0 websites as "Spam2.0" or "Spam 2.0".

original post.

[ Socialize This]

Thursday, June 25, 2009

Whois databases

The main whois database for the top-level domains ".com", ".net", and ".org" can be searched through any of the following sites:
The InterNIC Whois Search *
Domain registrars -- each with their own whois database
BetterWhois.com
AllWhois.com
SWITCH Whois Gateway
Google - Domain Name Search
Yahoo Whois Directory
The following Whois databases can be searched for information on other areas of the Internet, including Asian, Caribbean, European, and Latin American countries, and the ".mil" and ".gov" domains:
American Registry for Internet Numbers Whois
Asia Pacific IP Address Allocations Whois
European IP Address Allocations Whois
Latin American and Caribbean Internet Addresses Registry
US Military Whois - requires authorization to access
US Government Whois
Matt Power's Whois Servers List provides a long list of searchable world wide whois database servers.

[ Socialize This]

What is spam hunting

A favorite sport among many people is spammer hunting. It begins when you receive a piece of spam in the mail. Instead of deleting it, spam hunters track down who sent it, and take action, usually resulting in a loss of account for the spammer.

To find out the spam source, check out the Whois database.

If the address is hosted at a legitimate provider such as yahoo, google, they usually have a team to address violation of their terms of usage such as spamming, and you can fill the response forms at their web site to report the problem. They will often close the account.

If the address is part of a larger site like a community home page site, then you can complain to that site's administrators -- they will often close the user's account.


[ Socialize This]

How do spammers get email addresses?

Be aware that vicious spammers can collect the spam list in various ways, the best way to protect yourself from spam is not to give out the email address publicly.

Spammer can generally get your email address in the following ways:


From Spambot harvest
Spambots is a software like scrawl and spider, which basically follow links and grab email addresses from "mailto" links. Spambots can scour usernet/newsgroups/webpage/blogs and grab email addresses from post body and newsreader settings.

From a mailing list
Spammers join a mailing list, then gather the email addresses of the members, either from a list of the members provided by the mailing list software, or from people as they post.

From email reply
The spammer can got your email address from mail-servers using dictionary attacks then send you a email requesting for a reply. The email can be anything from "if you are interested please reply" or "if you want to be removed from the mailing list, please reply". If you replied, the spammer's email address was verified as valid by your email-server then the spammer can sent you more spam in the future.

From other spammers
Some spammers harvest the email address then sell it to other spammers using "Over 1 million email addresses on a CD"

[ Socialize This]

What is dictionary attack

Dictionary attack is an old cracker's trick aiming for vulnerable e-mail servers such as Hotmail and MSN servers. The cracker utilizes software that opens a connection to the mail server and then automatically submits random e-mail addresses. Many of these addresses are similar, such as "JONATHANjm8q631rj7ROSENBLATT@hotmail.com" and "JONATHANjm8q631rj8ROSENBLATT@hotmail.com." The software then records which addresses are "live" and adds the addresses to the spammer's list. Many mail server nowadays protected against dictinary attack.

[ Socialize This]

Spammer alert "Leve LED unique jewellery atelier"

A company claimed "Leve LED unique jewellery atelier" sent out a lot of emails through multiple hotmail accounts asking the user to submit resume to level.dep@gmail.com or leveldep@gmail.com ...

This company seems to be a spammer, they maybe use software to register many slightly different accounts from Hotmail and MSN servers, then use those hotmail accounts to spread the spam and collect personal informations in a few gmail accounts. Google have disabled the gmail accounts mentioned above, but those hotmail accounts are still at large. Learn how spammer get your email address and spam hunting.
The spam email looks like the following:

“Hello!

My name is Beata Hellmyrs and I am representative of Leve LED unique jewellery atelier. Our atelier is looking for a responsible and dedicated person on the position of purchasing agent.

The main responsibility is to deal with individual orders of our customers.

Salary: USD 3000 per month.

Timing: free schedule, part-time.

Requirements: good employment history (not necessarily in procurement field), ability to meet the deadlines and good analytical skills.

Employment: contract-base position for a foreign company (Our atelier is located in Sweden, Stockholm)

Training and supervisory during starting period are provided.

More information about the position you'll be able to learn during phone interview.

If you are interested in our job proposal, please send us your resume leveldep@gmail.com and we will contact you.

Thank you!”

[ Socialize This]

Monday, June 22, 2009

binary, decimal, and hex numbers

There are three major number systems in network, binary, decimal and hex numbers.
The binary numeral system, or base-2 number system represents numeric values using two symbols, usually 0 and 1.
The decimal number system, or base-10 number system represents numeric values using 10 symbols, 0,1,2,3,4,5,6,7,8,9, which we use everyday.
The hex number system, or base-16 number system represents numeric values using 16 symbols, 0,1,2,...8,9, a, b, c, d, e, f.

For example, a subnet mask 255.255.255.224, can be expressed in binary as 11111111.11111111.11111111.11100000, in decimal as 255.255.255.224 or in hex as ff.ff.ff.e0.

In cyber world, binary and hex reign, owing to their straightforward implementation in digital electronic circuitry using logic gates. Binary and hex are actually much simpler than decimal, if we can cast away our prejudice for these "strangers".

Since both binary and hex are machine friendly, it is very simple to convert between them.
16 = 2^4, so it takes four digits of binary to represent one digit of hexadecimal.

Binary to Hex convert
Given a binary number 11100000, we divide it into 4 digits groups as 1110,0000, then convert each group to its hex counter part, d for 1110 (1111 is f, so 1110 is f minus 1 -- d) and 0 for 0000, thus the answer e0.

Hex to Binary convert
The same applied to hex-binary convert. Given hex number f0, we divide it into two groups as f,0, then convert each group to its binary counter part, f for 1111, 0 for 0000, thus the answer 11110000.

Convert from hex and binary to decimal or vise versa is a little bit harder, because there's no natural relationship between them. (By the way, Arab mathematician Abu'l-Hasan al-Uqlidisi invented the decimal number system. If he picked 16 instead of 10 as the base number from the beginning, he would have saved us zillions of headach!!)

A decimal number 224 have value:
224 = 2*base^2 + 2*base^1 + 4*base^0 = 2*100 + 2*10 + 4, the same rule applied to binary and hex.
Binary to Decimal convert
Given binary number 11100000, we begin from the most significent bit (leftmost), the first 1 is at the eighth bit, thus represents value 1*base^(8-1) = 1*2^7 = 128. The second 1 is at the seventh bit, thus represents value 1*base^(7-1) = 2^6 = 64, the third one 2^5 = 32, the first 0 represents 0*2^4 = 0... Finally the value is 128+64+32+0+0+0....+0 = 224.

Hex to Decimal convert
Given hex number e0, we begin from the most significent bit (leftmost), the first e is at the second bit, thus represents value e*base^(2-1) = 14*16^1 = 224. The second 0 is at the first bit, thus represents value 0*base^(1-1) = 0*16^0 = 0. Finally the value is 224+0 = 224.

Decimal to Binary convert
Short division by two with remainder, it relies only on division by two.
Given decimal number 224, write the decimal number as the dividend inside an upside-down "long division" symbol. Write the base of the destination system (in our case, "2" for binary) as the divisor outside the curve of the division symbol.
2)224
_______

Write the integer answer (quotient) under the long division symbol, and write the remainder (0 or 1) to the right of the dividend.
2)224 0
_______
112
Continue downwards, dividing each new quotient by two and writing the remainders to the right of each dividend. Stop when the quotient is 1.
2)224 0
_______
2)112 0
_______
2 )56 0
_______
2 )28 0
_______
2 )14 0
_______
2 ) 7 1
_______
2 ) 3 1
_______
2) 1 1
_______
2) 0 0
_______

Starting with the bottom 1, read the sequence of 1's and 0's upwards to the top. You should have 11100000. This is the binary equivalent of the decimal number 224.

Hex to Binary convert
Short division by 16 with remainder, it relies only on division by 16.
Given decimal number 224, write the decimal number as the dividend inside an upside-down "long division" symbol. Write the base of the destination system (in our case, "16" for hex) as the divisor outside the curve of the division symbol.
16)224
_______
Write the integer answer (quotient) under the long division symbol, and write the remainder (0 to f) to the right of the dividend.
16)224 0
_______
14
Continue downwards, dividing each new quotient by 16 and writing the remainders to the right of each dividend. Stop when the quotient is less than 16.
16)224 0
_______
16) 14 e
_______
Starting with the bottom, read the sequence of digits upwards to the top. You should have e0. This is the hex equivalent of the decimal number 224.

[ Socialize This]

Friday, June 19, 2009

Apple released a new iPhone today




Apple Inc. release a new iPhone today. It’s now selling the 8-gigabyte version of the year-old iPhone 3G for $99, half the original price. Analysits predicts a 500,000 sell this weekend. At this moment, the apple stock is 138.50, rose 2.6 percent in Nasdaq Stock Market trading.


In the background of economy downturn and the recent recovery signs, apple's strategy seems to using massive production to compensate the 50% price cut and gaining more market share from its rivals like Palm and RIM. As the the recession easing at the third quarter and consummers spend more, apple together with AT&T could expand its bussiness easily riding the trend of another economy upturn. Just think about the potential market -- moving most of the desk top applications onto the smart phone and re-invent your living room by integrating your TV, home studio, video game, social network, internet, etc. into one smart system.



Wednesday, June 17, 2009

Cisco's 3 Layered Model

Over years of building network equipment, Cisco Systems has developed a three Layered model. Starting with the basics, the Cisco network is traditionally defined as a three-tier hierarchical model comprising the core, distribution, and access layers. Cisco both developed their system according to this model and recommend their end-users to follow the same philosophy.

History
The cisco three layered model is originated from the enterprise campus network which has evolved over the last 20 years.

Early LAN-based computer networks were made of small number of simply connected servers, PCs and printers. The first generation of campus networks came into form by interconnecting these LANs. Problems in one area of the network ofter impacted the entire network and a failure in one part of the campus often affected the entire campus network.

To address the above problems, Cisco borrowed the structured programming design principle from software engineer. Based on two complementary principles: hierarchy and modularity, large complex Cisco system must be built using a set of modularized components that can be assembled in a hierarchical and structured manner. The hierarchy is Cisco's three Layered Model.

Discription of Cisco Layers

Core Layer
The core layer is literally the internet backbone, the simplest yet most critical layer. The primary purpose of the core is to provide fault isolation and backbone connectivity, in another words, the core must be highly reliable and switch traffic as fast as possible. Therefore, on one hand, the core must provide the appropriate level of redundancy to allow fault tolerance in case of hardware/software failure or upgrade; on the other hand, the high-end switches and high-speed cables are implemented to achieve High data transfer rate and Low latency period.

The core means to be simple and provides a very limited set of services. We shouldn't implement complex policy services or attach user/server connections directly at this layer.

Examples of core layer Cisco equipment include:
Cisco switches such as 7000, 7200, 7500, and 12000 (for WAN use)
Catalyst switches such as 6000, 5000, and 4000 (for LAN use)
T-1 and E-1 lines, Frame relay connections, ATM networks, Switched Multimegabit Data Service (SMDS)

Distribution Layer
The distribution layer acts as an interface between the access layer and the core layer. The primary function of the distribution layer is to provide routing, filtering, and WAN access and to determine how packets can access the core, if needed.

While core layer and access layer are special purpose layers, the distribution layer on the other hand serves multiple purposes. It is an aggregation point for all of the access layer switches and also participates in the core routing design. This layer includes LAN-based routers and OSI layer 3 switches. It ensures that packets are properly routed between subnets and VLANs.

Access Layer
The access layer is sometimes referred to as the desktop layer. The network resources the workgroup and users needed will be available locally.

The access layer is the edge of the entire network, where wide variety of types of consumer devices such as PCs, printers, cameras attach to the wired portion of the network, various services provided, and dynamic configuration mechanisms implemeted. As a result, the access layer is most feature-rich layer of the Cisco three layered model.

List 1 lists examples of the types of services and capabilities that need to be defined and supported in the access layer of the network.

Enable MAC address filtering: It is possible to program a switch to allow only certain systems to access the connected LANs.
Create separate collision domains: A switch can create separate collision domains for each connected node to improve performance.
Share bandwidth: You can allow the same network connection to handle all data.
Handle switch bandwidth: You can move data from one network to another to perform load balancing.

^up
[ Socialize This]

TCP/IP Layered Model




The TCP/IP model was created by the U.S. Department of Defencse (DoD), to create a network that could survive any conditions. Some of the layers in the TCP/IP model have the same names as layers in the OSI model. TCP/IP is a "protocal specific" model while OSI model is "protocal independent" model.

Application Layer: Include the OSI Application, Presentation and Session Layer.

Transport Layer: Similar to OSI, with transmission control protocol (TCP) and user datagram protocal (UDP) operating at this layer.

Internet Layer: Similar to OSI Network layer. IP resides at this layer.

Network Access Layer: Combines all functionality of physical and Data Link layers of OSI model.

Normally, application programmers are concerned only with interfaces in the Application Layer and often also in the Transport Layer, while the layers below are services provided by the TCP/IP stack in the operating system. Microcontroller firmware in the network adapter typically handles Network Access issues, supported by driver software in the operational system. Non-programmable analog and digital electronics are normally in charge of the physical components in the Network Access Layer, typically using an ASIC chipset for each network interface or other physical standard.

What's a browser



[ Socialize This]

Bing continue to gain market share

Microsoft Corp.'s new Bing search engine was available two weeks ago, with a $100 million marketing campain.

Just in two weeks, Microsoft's share of search results pages -- a measure of the intensity of search activity by online users -- rose to 12.1% between June 8 and June 12.

It is unclear, if bing will shake the dominate position of Google and Yahoo which have U.S. market share around 60% and 20% respectively.

Compared with Google, bing has a more attractive user interface, and optimized for searching on shopping, travel, health and local businesses. Rumors said, Larry Page had teamed up his top experts to analyze the bing's algorithms. The war is coming? Let's see.

[ Socialize This]

Obama Sees 10% Unemployment Rate


June 17 -- In an interview of the President yesterday by Hunt, Obama predicted the jobless rate will continue to climb from its current 25-year high of 9.4 percent as employers are slow to take on new workers.



Hunt: Will unemployment reach 10%?
President: “Yes,”
Hunt: Before the end of this year?
President: “Yes,”
President: “I think that what you’ve seen is that the pace of job loss has slowed and I think that the economy is going to turn around. But as you know, jobs are a lagging indicator. And we've got to produce 150,000 jobs every month just to keep pace. we will end up seeing recovery shortly.”


Biggest Health Care Reform in US history is coming


June 17 (Bloomberg) -- The largest expansion of U.S. health care since the creation of Medicare in 1965 may emerge from legislation designed to reshape the medical industry and change how Americans receive and pay for care.

Congress today begins crafting legislation that Democratic leaders plan to push through both chambers by their August recess. The measure may require all Americans to get medical insurance, force insurers to accept all patients and end the tax break for employer-paid health benefits. These changes may be hammered out with unprecedented speed at the urging of President Barack Obama, who four days ago said “this is the moment.” The U.S. will spend more than $2 trillion this year on health care, the Health and Human Services department reported in February.

Obama has made a health-care overhaul his top domestic priority, using his February budget proposal to call it a “moral” imperative to extend coverage to the country’s 46 million uninsured. Obama also tied the long-term fiscal soundness of the U.S. to controlling medical costs. Health care consumes 18 percent of the U.S. economy and may rise to 34 percent by 2040, the White House Council of Economic Advisers reported June 2. The coming weeks will be pivotal if the House and Senate are to meet their goal to send Obama a single bill in October. “The president wants a bill by Oct. 15,” Baucus said in an interview yesterday. “He’ll get it.”

One issue is taxing employer-provided health benefits, which Obama opposed during his presidential campaign. In an interview yesterday with Bloomberg News, Obama said he wouldn’t rule out such a proposal.

“I don’t want to predetermine the best way to do this,” he said. “I’ve already put forward what I think is the best way. Let me see what comes out of the Hill and we’ll have that debate then.”

[ Socialize This]

Tuesday, June 16, 2009

ISO's OSI Layered Model - Summary

network stack
network stack

The picture is the summary of the 7 OSI layer we have discussed before.

ISO's OSI Layered Model - Application Layer


The application layer provides the services that directly support an application running on a host. This layer is closest to the end user. Examples of layer 7 services include:
FTP, Telnet, HTTP, DHCP, DNS, Gopher, SNMP, NIS, NNTP, SIP, SSI, NFS, NTP, SMPP, SMTP, RIP, BGP, etc.

previous [page 9] next

[ Socialize This]

ISO's OSI Layered Model - Presentation Layer


This layer provides independence from differences in data representation (e.g., encryption) by translating from application to network format, and vice versa. The presentation layer works to transform data into the form that the application layer can accept. This layer formats and encrypts data to be sent across a network, providing freedom from compatibility problems. It is sometimes called the syntax layer.

Most file format belong to this layer, such as QuickTime, TIFF, JPEG, TDI, ASCII, EBCDIC, MIDI, MPEG, etc.

previous [page 8] next

[ Socialize This]

ISO's OSI Layered Model - Session Layer


The Session Layer controls the dialogues (connections) between computers. It establishes, manages and terminates the connections between the local and remote application.
Synchronization of communicating applications comes into play,
The Session Layer is commonly implemented explicitly in application environments that use remote procedure (RPC) calls. RPC may be built on either TCP or UDP. Login sessions uses TCP whereas NFS and broadcast use UDP.

The session layer examples include SQL, RPC, XWindows, etc.

previous [page 7] next

[ Socialize This]

ISO's OSI Layered Model - Application Set





We have walked through the first 4 layers of OSI model.
Layer 1, physical layer.
Layer 2, DataLink Layer.
Layer 3, Network Layer.
Layer 4, Transport Layer.

which is low-level infrastructure of network, and can be grouped as transport set. In the next 3 articles, we will introduce the layers in the application set, which is closer to the end user and more software application stuff--
Layer 5, Session Layer.
Layer 6, Presentation Layer.
Layer 7, Application Layer.

previous [page 6] next

ISO's OSI Layered Model - Transport Layer





The OSI Model layer 4 is Transport Layer. This layer maintains flow control of data and provides for error checking and recovery of data between the source and the destination. Transport Layer messages are called segments or transport protocal data units (TPDUs). Unlike the hop-by-hop communication at network layer, transport layer is an end-to-end communication -- that is -- the two communicating hosts need not be concerned with the topology of the internet work, which lies between them. They only need to know the state of their communication.

Two transport protocols, Transmission Control Protocol (TCP) and User Datagram Protocol (UDP), sits at the transport layer.


TCP establishes connections between two hosts on the network through 'sockets' which are determined by the IP address and port number. The sender of data, first establishes a logical connection with the prospective receiver of the data, sends the data and then terminates the connection. TCP is connection oriented and uses a 3 way handshake to establish a connection before data is sent.

UDP on the other hand provides a low overhead transmission service, but with less error checking. The sender does not establish a contact with the receiver first. Whenever there is a data packet ready to be sent, it independently routes the packet to a gateway. UDP is a connectionless protocal at the transport layer.

The device at transport layer is gateway. The layer 4 examples are TCP, UDP, SPX

previous [page 5] next

[ Socialize This]

ISO's OSI Layered Model - Network Layer




The way that the data will be sent to the recipient device is determined in this layer. The famous Internet Protocol (IP) resides in this layer. The Internetwork Protocal identifies each host with a 32-bit IP address (for detail, see understanding subnet mask). IP is responsible for routing, directing datagrams from one network to another. It manages the connectionless transfer of data one hop at a time, from router to router. It is not responsible for reliable delivery to a next hop, but only for the detection of errored packets so they may be discarded. It is like a postal department, where the letter is passed from location to location, until it reaches the destination address on the envelope. The network layer may have to break large datagrams, larger than MTU, into smaller packets and host receiving the packet will have to reassemble the fragmented datagram.

Even though IP packets are addressed using IP addresses, hardware addresses must be used to actually transport data from one host to another. The DataLink layer protocal Address Resolution Protocol (ARP) is used to map the IP address to its hardware address.

In summary, the main functionality of network layer is routing and logical addressing, the data unit is packets, the network layer device is router and the network layer examples include IP, IPX, IPsec, ICMP, IGMP, OSPF, IGRP and EIGRP.

ISO's OSI Layered Model - DataLink Layer




The Data Link layer packages raw bits from the Physical layer into frames. This layer is responsible for transferring frames from one computer to another, without errors. A network data frame includes checksum, source and destination address, and data. The largest packet that can be sent through a data link layer defines the Maximum Transmission Unit (MTU).

The Data Link layer's functionality includes flow control, error detection and control, defining topologies such as star, bus, ring and media access control (MAC).

Ethernet addresses a host using a unique, 48-bit address called its Ethernet address or Media Access Control (MAC) address. MAC is closely associated with the physical layer and defines the means by which the physical medium may be accessed. MAC addresses are usually represented as six colon-separated pairs of hex digits, e.g., 8:0:20:11:ac:85. This number is unique and is associated with a particular Ethernet device; the first 3 bytes 8:0:20 specify the vendor/manufacturer of the NIC; the other 3 bytes 11:ac:85 define the host. The data link layer's protocolspecific header specifies the MAC address of the packet's source and destination. When a packet is sent to all hosts (broadcast), a special MAC address (ff:ff:ff:ff:ff:ff) is used.

The DataLink Layer Devices include switch, bridge.

DataLink Layer example include: 802.3, ATM, Frame Relay, PPP, Token Ring, ARP, SLIP

previous [page 3] next

[ Socialize This]

ISO's OSI Layered Model - Physical Layer




The first layer is the physical layer. This is the level of the actual hardware. It defines the physical characteristics of the network such as connections, voltage levels, transmission frequencies, timing, etc. The physical layer provides an unstructured bit stream, which is the phycial basis for all the higher layers.

Devices at this layer includes: Multiplexer, Repeater, hub, cable, network card, unshielded twisted pairs (UTP), etc.

Examples are Ethernet, RS-232, T1, DSL, etc.


previous [page 2] next


ISO's OSI Layered Model


The Open Systems Interconnection Reference Model (OSI Reference Model or OSI Model) is an abstract description for layered communications and computer network protocol design. It was developed as part of the Open Systems Interconnection (OSI) initiative. In its most basic form, it divides network architecture into seven layers which, from bottom to top, are the Physical, Data-Link, Network, Transport, Session, Presentation, Application Layers (Please Do Not Throw Sausage Pizza Away). It is therefore often referred to as the OSI Seven Layer Model.
Control is passed from one layer to the next, starting at the application layer in one station, proceeding to the bottom layer, over the channel to the next station and back up the hierarchy. Data exists at each layer in units called Protocal Data units (PDU). The picture gives the PDU at each layer.
previous [page 1] next


OSI Model v.s. TCP/IP Model v.s. Cisco 3 Layer Model


A computer communication protocal is a set of rules that govern the exchange of information whin a network. Communication protocols define the manner in which peer processes communicate among various computer hardware devices.

You can organize the modules of protocal software on each machine into "layers". Each layer will handle a specific communication sub-problem. There are many specific advantages of layering such as data hiding and encapsulation, reduced complexity, increased evolution, easy extension and multi vendor integration.

OSI model vs TCP/IP model


The most mommon layered Models are
a. ISO's OSI Layered Model
b. TCP/IP Layered Model
c. Cisco's 3 Layered Model
d. IBM's SNA Model (don't discuss it here)

This tutorial series will explain and compare these models.
previous next

Monday, June 15, 2009

Understanding Subnet Mask

If you are winxp user, just type "ipconfig" in the command window, you will probably see something like:

Connection-specific DNS Suffix... somedomain.com
IP address...................................... 192.168.5.10
Subnet Mask................................. 255.255.255.0
Default Gateway........................... 192.168.5.100

SubnetMask seems always go with IP address.
Ever wondering what subnet mask is?
If the answer is yes, you may want to read this article.


Part 1 IP Addressing
Computers and devices that are part of an internetworking network such as the Internet each have a logical address. The network address is unique to each device and can either be dynamically or statically configured. An address allows a device to communicate with other devices connected to a network. The most common network addressing scheme is IPv4. An IPv4 address consists of a 32 bit address written into 4 octets (e.g. 192.168.5.10) and a subnet mask (e.g. 255.255.255.0).

Suppose a home network consists of computers named Foo and Bar, connected to a router, and then via a cable modem to the Internet. The home network is configured as a subnet: address 17.76.99.1 is assigned to Foo, address 17.76.99.2 to Bar, and address 17.76.99.100 to the router. The subnet has been configured so that the first three octets of its members' addresses are all the same subnet id, 17.76.99, and this fact is expressed by the subnet mask 255.255.255.0 (binary 11111111 11111111 11111111 00000000) configured in the router.
When Foo sends data to example.com at 208.77.188.166, the router performs a logical AND of the destination example.com address with the subnet mask. It also performs a logical AND of the origin address (17.76.99.1) and recognizes that these two results are different, and therefore sends the data over the Internet, via the subnet's default gateway.
When Foo sends data to Bar, however, it determines that the results of the two AND operations are the same, therefore the destination lies within the subnet and the default gateway is not required. The data is transmitted directly from Foo to Bar within the home network.

For detail about IP address, see the network 101 -- Understanding IP address.

Part 2 Why subnet mask
As Intenet grows, more network IP address number are needed. The InterNIC (who in charge of IP address allocation), however, is not eager to hand out unlimited network addresses because they are quickly running out of them. One way of IP address conservation is to take the address that is assigned to a network and expand the capacity with subnets. Subnetting allows you to increase the number of networks available to you without applying for another IP address number.
On the other hand, putting too many computers in a single network is problematic. Due to heavy transfer of data, the packets become slow resulting in collision and retransmission. As there is no security barrel, critical data can be accessed by any other computer. Again, subnetwoking is needed here.

Part 3 IP Address Classes
The IP address is composed of 32 bits, which consist of two parts: the most significant bits (MSBs) identify a particular network and the remaining bits specify a host on that network. The most significant bits of the network portion actually determine the address class as shown in this table: Address MSB
Class Pattern
Class A 0
Class B 10
Class C 110

A class A address could be diagramed:
Network Host
+------+ +----------------------+
[0xxxxxxx][xxxxxxxxxxxxxxxxxxxxxxxx]
which shows the eight network bits followed by the 24 host bits.

Class A address would have a range of address numbers from 1.0.0.0 through 126.0.0.0 ( 0. x.x.x and 127. x.x.x are reserved). The number of host addresses per network is 16,777,214, which is two less than two raised to the 24th power because both host numbers 0.0.0 and 255.255.255 are reserved.

The first two bits of a Class B address are 1 and 0, the next fourteen bits identify the network and the last sixteen the host, as diagramed:
Network Host
+--------------+ +--------------+
[10xxxxxxxxxxxxxx][xxxxxxxxxxxxxxxx]
Thus, Class B addresses include the network numbers in the range from 128.1.0.0 through 191.254.0.0 for a total of 65,534 host addresses.

The first three bits of a Class C address are 1, 1, and 0, the next 21 bits identify the network and the last eight the host, as diagramed:
Network Host
+----------------------+ +------+
[110xxxxxxxxxxxxxxxxxxxxx][xxxxxxxx]
Thus, Class C addresses include the network numbers in the range 192.0.1.0 through 223.255.254.0 for a total of 254 host addresses per network address.
Finally, we have Class D and Class E addresses. Class D address start at 224.0.0.0 and are used for multicast purposes. Class E addresses start at 240.0.0.0 and are currently used only for experimental purposes.

Part 4 The Subnet Mask
A subnet mask (or number) is used to determine the number of bits used for the subnet and host portions of the address. The network bits are represented by the 1s in the mask and the host bits are represented by the 0s in the mask. The result of a bit-wise logical 'AND' operation between the IP address and the subnet mask is a Network Address or Number or Subnet Address.
Let's look at an example. Here we have a Class B address of 191.70.55.130 and apply the default subnet mask 255.255.0.0.
1011 1111 1000 0110 0011 0111 1000 0010 IP address
1111 1111 1111 1111 0000 0000 0000 0000 Subnet mask
1011 1111 1000 0110 0000 0000 0000 0000 Result

Subnet Mask can take value other than 255.255.0.0, here we employ a mask 255.255.255.0 that divides the host portion into a subnet and host that are each eight bits wide:
1011 1111 1000 0110 0011 0111 1000 0010 IP address
1111 1111 1111 1111 1111 1111 0000 0000 Subnet mask
1011 1111 1000 0110 0011 0111 0000 0000 Result
This division allows 254 (256-2 reserved) subnets, each with 254 hosts.


This division on a byte boundary makes it easy to determine the subnet and host from the dotted-decimal IP address. However, the subnet-host boundary can be at any bit position in the host portion of the IP address. Here, we use a mask 255.255.128.0 that allows more subnets (512-2 reserved), but with the trade-off of fewer hosts (128-2) per subnet:

1011 1111 1000 0110 0011 0111 1000 0010 IP address
1111 1111 1111 1111 1111 1111 1000 0000 Subnet mask
1011 1111 1000 0110 0011 0111 1000 0000 Result

Part 5 Private Subnets

There are three IP network address reserved for private networks.

10.0.0.0 to 10.255.255.255

172.16.0.0 to 172.31.255.255

192.168.0.0 to 192.168.255.255

These can be used by anyone setting up internal IP networks, because routers on the Internet will never forward packets coming from these addresses.

Part 6 Design Example
Suppose you have a Class C IP address of 200.133.175.0, and you want to break the network into 6 subnets of 30 nodes each, which limits us to 180 nodes.
To accomplish this, we need to use a subnet mask 3 bits long.
255.255.255.224 (11111111.11111111.11111111.11100000)
This gives us 6 possible network numbers, 2 of which cannot be used.

Subnet bits, Subnet Address, Node Addresses, Broadcast Address
000, 200.133.175.0, Reserved, None
001, 200.133.175.32, .33 thru .62, 200.133.175.63
010, 200.133.175.64, .65 thru .94, 200.133.175.95
011, 200.133.175.96, .97 thru .126, 200.133.175.127
100, 200.133.175.128, .129 thru .158, 200.133.175.159
101, 200.133.175.160, .161 thru .190, 200.133.175.191
110, 200.133.175.192, .193 thru .222, 200.133.175.223
111, 200.133.175.224, Reserved, None

Part 7 CIDR
To simplify subnet mask notation, CIDR suffix address (e.g. /18) is used, which list only 1s bits that start the mask.
Class A= /8, Class B = /16, Class C =/24
For instance, the following are equivalent:
192.168.0.0 with netmask 255.255.0.0
192.168.0.0/16

For another instance, the following are equivalent:
192.168.0.0 with netmask 255.255.128.0
192.168.0.0/17

[ Socialize This]

Friday, June 12, 2009

What is Virtue LAN?

Monday

thursday

In the previous post, we have talked about LAN (local area network), which is
computer network covering a small physical area. The LAN we talked about is made of physical devices such as computer, hub, switch, router, repeater which hurt if dropping on your feet. So.... what the heck is a "virtual LAN"? The name seems to suggest some kind of imaginary network... Ok, forget about the god-knows-who Virtue LAN for now, let's talk about a roommates crisis recently.

Charlse, Tony, Kelley and Alice are roommates. Their computers are connected together by a switch, thus form a home LAN. By default, if one computer in the LAN send a message, the switch will broadcast the message to all the other three computers.
At Wenesday night, Tony did a stupid thing, Kelley and Alice became so angry at him that they even refuse to share the LAN with this guy. As Tony's best friend, Charlse decided to stood with him. So the roommates reconfigured the switch. Now, There are two groups: group 1 -- Charlse and Tony; group 2 -- Alice and Kelley. The message from either Tony's or Charlse's computer will not be passed to Alice's and Kelley's. The same thing happened at the girls side, the girls' messages now only broadcast between girls. As a result, we get two VLAN, physically, they share the same LAN, but logically, when a member of one VLAN sends a broadcast, only the other members of the same VLAN will receive the broadcast.

By the way, at Friday, all the roommates agreed that it's a sick example of VLAN, so they set the switches back to the default value thus wiped out the poor VLANs from the face of the earth.

[ Supporting files]
[ Socialize This]


Thursday, June 11, 2009

hub, switch and router

Hub, switch and router are the building blocks of computer network. Each has two or more connectors called ports into which you plug in the cables to make the connection.


;

A hub's job is very simple: anything that comes in one port is sent out to the others. That's it. Every computer connected to the hub "sees" everything that every other computer on the hub sees. The hub itself is blissfully ignorant of the data being transmitted.

A switch does essentially what a hub does but more intelegently. The net result of using a switch over a hub is that most of the network traffic only goes where it needs to rather than to every port. On busy networks this can make the network significantly faster.

While hubs and switches connect pcs within a network. routers are the crucial devices that let messages flow between networks. For example, Charlse sends a message to the copy machine on the other side of the room, the message goes through hub (switch) to the printer; if Charlse tries to post on the blogger.com, the message must go through the company's router, which connect to the internet.


[ Supporting files]
[ Socialize This]

What are Internet made of? (LAN, ISP, POP, NAP)


People talk about LAN, ISP, POP, NAP, what are they talking about?

LAN, ISP, POP, NAP


Every computer that is connected to the Internet is part of a network, even the one in your home. For example, you may use a modem and dial a local number to connect to an Internet Service Provider (ISP). At work, you may be part of a local area network (LAN), but you most likely still connect to the Internet using an ISP that your company has contracted with. When you connect to your ISP, you become part of their network. The ISP may then connect to a larger network and become part of their network. The Internet is simply a network of networks.
Most large communications companies have their own dedicated backbones connecting various regions. In each region, the company has a Point of Presence (POP). The POP is a place for local users to access the company's network, often through a local phone number or dedicated line. The amazing thing here is that there is no overall controlling network. Instead, there are several high-level networks connecting to each other through (Network Access Points) NAPs.
Today's Take home:

LAN (local area network):
Computer network covering a small physical area, like your home, office, or a few buildings, such as a school, or an airport.

ISP (internet service provider):
The company that sells Internet access plan to you (their typical slogan: fast internet connetion...blablabla...)

POP (point of presence):
an access point from one place to the rest of the Internet. A phrase only matters to the ISP sells guy. Your Internet service provider (ISP) has a point-of-presence on the Internet and probably more than one. The number of POPs that an ISP has is sometimes used as a measure of its size or growth rate.

NAP (network access points):
Short for network access point, a public network exchange facility where Internet Service Providers (ISPs) can connect with one another in peering arrangements. The NAPs are a key component of the Internet backbone because the connections within them determine how traffic is routed. They are also the points of most Internet congestion.


[ Supporting files]
[ Socialize This]

How servers talk to each other (Unicast, Multicast and Broadcast)

Believe it or not, servers in the network talk to each other just as we did.
Say, Charlse(me) wants to have a private conversation with Kelley, one to one. In the network jargon, this is called unicast. A unicast is a message intended for one other host.

In the same manner, I gave a lecture to a class of students, everybody in the classroom heard me. I don't intend to lecture the whole world. In the network, it is called multicast --a multicast is intended for a group of hosts.

So far, you may already know what broadcast is. Right, Charlse got a beautiful idea, he can't help but told everybody, and even persuade them to spead the message for him. That's exactly broadcast mean --a broadcast is intended for every host that can possibly receive it.

Broadcasts tend to result in more broadcasts, and if hosts on the network continue to answers broadcasts with broadcasts, we end up with a broadcast storm. So be careful with your crazy new idea. :)


[ Supporting files]
[ Socialize This]

iPhone users angry over AT&T's pricing policy for the new iPhone 3G




Computerworld - iPhone users angry over AT&T's pricing policy for the new iPhone 3G S have taken their campaign to Twitter, where more than 7,013 have added their names to an instant petition. Twitter petition.


[ Supporting files]
[ Socialize This]

Signs for economy recovery.


According to Bloomberg report this morning.
#1 Sales at U.S. retailers rose in May for the first time in three months as shoppers returned to automobile showrooms seeking bargains from the ailing carmakers.

#2 Crude oil rose for a third day, climbing above $72 a barrel for the first time in seven months as the International Energy Agency raised its demand forecast and China’s net imports jumped to a 14-month high.

#3 Fewer Americans filed claims for unemployment benefits last week, indicating the deepest job cuts may be subsiding even as companies hold off on hiring.


[ Supporting files]
[ Socialize This]

Tomorrow night (June 13, 2009): Get Facebook Usernames! Huarry!!



Starting at 12:01 a.m. EDT on Saturday, June 13, you'll be able to choose a username on a first-come, first-serve basis for your profile and the Facebook Pages that you administer by visiting www.facebook.com/username/. You'll also see a notice on your home page with instructions for obtaining your username at that time.

Monday, June 8, 2009

Horizontal navigation Tabs Bar for Blogger

Horizontal navigation Tabs Bar makes your blog stylish and easy to navigate. The trick here is to creat links for each Tab which links to the url of your labels. You have to label your posts to make it work.



Just Go To Layout > Edit Html

And Search For

Now add these below Css codes before it-



/* ----- LINKBAR ----- */
#bg_nav {
display: block;
background: #000;
width: 760px;
height: 29px;
font-size: 11px;
font-family: Arial, Tahoma, Verdana;
color: #FFF;
font-weight: bold;
margin: 0px auto 0px;
padding: 0px;
border-top: 1px solid #333;
border-bottom: 1px solid #000;
overflow: hidden;
}

#bg_nav a, #bg_nav a:visited {
color: #FFF;
font-size: 11px;
text-decoration: none;
text-transform: uppercase;
padding: 0px 0px 0px 3px;
}

#bg_nav a:hover {
color: #FFF;
text-decoration: underline;
padding: 0px 0px 0px 3px;
}

#navleft {
width: 720px;
float: left;
margin: 0px;
padding: 0px;
}

#navright {
width: 220px;
font-size: 11px;
float: right;
margin: 0px;
padding: 6px 5px 0px 0px;
}

#navright a img {
border: none;
margin: 0px;
padding: 0px;
}


#nav {
margin: 0px;
padding: 0px;
list-style: none;
}

#nav ul {
margin: 0px;
padding: 0px;
list-style: none;
}

#nav a, #nav a:visited {
background: #222;
color: #FFF;
display: block;
font-weight: bold;
margin: 0px;
padding: 8px 15px;
border-left: 1px solid #000;
}

#nav a:hover {
background: #6e6d6d;
color: #FFFFFF;
margin: 0px;
padding: 8px 15px;
text-decoration: none;
}

#nav li {
float: left;
margin: 0px;
padding: 0px;
}

#nav li li {
float: left;
margin: 0px;
padding: 0px;
width: 150px;
}

#nav li li a, #nav li li a:link, #nav li li a:visited {
background: #333;
width: 160px;
float: none;
margin: 0px;
padding: 7px 30px 7px 10px;
border-bottom: 1px solid #000;
border-left: 1px solid #000;
border-right: 1px solid #000;
}

#nav li li a:hover, #nav li li a:active {
background: #666;
padding: 7px 30px 7px 10px;
}

#nav li ul {
position: absolute;
width: 10em;
left: -999em;
}

#nav li:hover ul {
left: auto;
display: block;
}

#nav li:hover ul, #nav li.sfhover ul {
left: auto;
}
/*for Linkbar*/



Please edit the width of the above codes in red to adjust to the width of the navigation menu to adjust it to yours template width.You can change the color and design of above css also if you are capable of it.
Now Search for below codes-


<div id="'header-wrapper'">
<b:section class="'header'" id="'header'" maxwidgets="'1'" showaddelement="'no'">
<b:widget id="'Header1'" locked="'true'" title="'Testing" type="'Header'/">

</b:section>
</div>


And add the below codes after the above codes:-


<div id='bg_nav'>
<div id='navleft'>
<div id='nav'>
<ul>
<li><a href='/'>home</a></li>
<li><a href='http://cyberjedizen.blogspot.com/search/label/Blogger%20Hack'> Blogger Hacks</a></li>
<li><a href='http://cyberjedizen.blogspot.com/search/label/Electronics'> Electronics</a></li>
<li><a href='http://cyberjedizen.blogspot.com/search/label/Tutorial'> Tutorials</a></li>
<li><a href='http://cyberjedizen.blogspot.com/search/label/Resources'> Resources</a></li>
<li><a href='http://cyberjedizen.blogspot.com/'>Contact</a></li>
</ul>
</div>
</div>
</div>



[ Socialize This]

Saturday, June 6, 2009

How to put two widgets side by side in blogger head

I'm trying to put two flash widgets side by side in my blog's head area. Here is how I did it:

Just Go To Layout > Edit Html

And Search For </b:skin>

Now add these below Css codes before it-





/*-- Two part Header --*/
#contentbar {
position: relative;
clear: both;
display: block;
$startSide top;
width: 760px;
}

#headbar1 {
display:block;
float:left;
margin-left:0px;
width:220px;
}
#headbar2 {
display:block;
float:right;
margin-left:0px;
width:540px;
}


Please edit the width of the above codes in red to adjust to the width of the navigation menu to adjust it to yours template width.You can change the color and design of above css also if you are capable of it.
Now Search for below codes-


<div id="'header-wrapper'">


And add the below codes after the above codes:-


<div id='contentbar'>
<div id='headbar1'>
<b:section class='header' id='HTML81' maxwidgets='2' preferred='yes' showaddelement='yes'>
<b:widget id='HTML101' locked='false' title='' type='HTML'/>
</b:section>
</div>
<div id='headbar2'>
<b:section class='header' id='HTML82' maxwidgets='2' preferred='yes' showaddelement='yes'>
<b:widget id='HTML102' locked='false' title='' type='HTML'/>
</b:section>
</div>
</div>



Now go to Layout > Page Elements
walla, two editable HTML/Javascript Tabs show up side by side in the head area.


[ Supporting files]
[ Socialize This]

Friday, June 5, 2009

Horizontal Navigation Menu Links with submenu For Blogger

I have seen many Horizontal Tab Memu Links in Blogs and ever wonder if I can add some Drop Down Sub Menu Links to each Tab Menu, so that user can navigate through more categories easily.
Now, I find the solution, and share with you guys.
Demo of Horizontal Navigation Menu Links with submenu:- Cyber Jedi (old Blog)

Just Go To Layout > Edit Html

And Search For </b:skin>

Now add these below Css codes before it-




/*add by me for navTab*/
#subnavbar {
background: #90B557;
width: 660px;
height: 24px;
color: #2E4C0B;
margin: 0px;
padding: 0px;
}
#subnav {
margin: 0px;
padding: 0px;
}
#subnav ul {
float: left;
list-style: none;
margin: 0px;
padding: 0px;
}
#subnav li {
float: left;
list-style: none;
margin: 0px;
padding: 0px;
}
#subnav li a, #subnav li a:link, #subnav li a:visited {
color: #2E4C0B;
display: block;
font-size: 10px;
font-weight: bold;
text-transform: uppercase;
margin: 0px 5px 0px 0px;
padding: 6px 13px 6px 13px;
}
#subnav li a:hover, #subnav li a:active {
background: #BED3A0;
color: #3A5C04;
display: block;
text-decoration: none;
margin: 0px 5px 0px 0px;
padding: 6px 13px 6px 13px;
}
#subnav li li a, #subnav li li a:link, #subnav li li a:visited {
background: #BED3A0;
width: 140px;
float: none;
margin: 0px;
padding: 6px 10px 6px 10px;
border-bottom: 1px solid #FFFFFF;
border-left: 1px solid #FFFFFF;
border-right: 1px solid #FFFFFF;
}
#subnav li li a:hover, #subnav li li a:active {
background: #FFFFFF;
margin: 0px;
padding: 6px 10px 6px 10px;
}
#subnav li ul {
z-index: 9999;
position: absolute;
left: -999em;
height: auto;
width: 160px;
margin: 0px;
padding: 0px;
}
#subnav li li {
}
#subnav li ul a {
width: 140px;
}
#subnav li ul a:hover, #subnav li ul a:active {
}
#subnav li ul ul {
margin: -25px 0 0 161px;
}
#subnav li:hover ul ul, #subnav li:hover ul ul ul, #subnav li.sfhover ul ul, #subnav li.sfhover ul ul ul {
left: -999em;
}
#subnav li:hover ul, #subnav li li:hover ul, #subnav li li li:hover ul, #subnav li.sfhover ul, #subnav li li.sfhover ul, #subnav li li li.sfhover ul {
left: auto;
}
#subnav li:hover, #subnav li.sfhover {
position: static;
}

/*add by me for navTab*/


Please edit the width of the above codes in red to adjust to the width of the navigation menu to adjust it to yours template width.You can change the color and design of above css also if you are capable of it.
Now Search for below codes-

<div id="'header-wrapper'">
<b:section class="'header'" id="'header'" maxwidgets="'1'" showaddelement="'no'">
<b:widget id="'Header1'" locked="'true'" title="'Testing" type="'Header'/">
</b:section>
</div>

And add the below codes after the above codes:-



<!--add by me for navTab-->
<div id='subnavbar'>
<ul id='subnav'>
<li>
<a href='http://cyberjedizen.blogspot.com/'>Technology</a>
<ul>
<li>
<a href='http://cyberjedizen.blogspot.com/'>News</a>
</li>
<li>
<a href='http://cyberjedizen.blogspot.com/'>Events</a>
</li>
<li>
<a href='http://cyberjedizen.blogspot.com/'>Robotics</a>

</li>
<li>
<a href='http://cyberjedizen.blogspot.com/'>Projects</a>
</li>
<li>
<a href='http://cyberjedizen.blogspot.com/'>Tips</a>
</li>
</ul>
</li>
<li>
</li>
<li>
<a href='http://cyberjedizen.blogspot.com/'>Science</a>
<ul>

<li>
<a href='http://cyberjedizen.blogspot.com/'>Physics</a>
</li>
<li>
<a href='http://cyberjedizen.blogspot.com/'>Environment</a>
</li>
<li>
<a href='http://cyberjedizen.blogspot.com/'>Space Tech</a>
</li>
<li>
<a href='http://cyberjedizen.blogspot.com/'>Innovations</a>
</li>
<li>

<a href='http://cyberjedizen.blogspot.com/'>Breakthroughs</a>
</li>
</ul>
</li>
<li>
<a href='http://cyberjedizen.blogspot.com/'>Web 2.0</a>
<ul>
<li>
<a href='http://cyberjedizen.blogspot.com/'>Wanna be?</a>
</li>
<li>
<a href='http://cyberjedizen.blogspot.com/'>Latest news</a>
</li>

<li>
<a href='http://cyberjedizen.blogspot.com/'>Web Development</a>
</li>
<li>
<a href='http://cyberjedizen.blogspot.com/'>Geek Events</a>
</li>
<li>
<a href='http://cyberjedizen.blogspot.com/'>2nd Opinions</a>
</li>
</ul>
</li>
<li>
<a href='http://cyberjedizen.blogspot.com/'>Design</a>

<ul>
<li>
<a href='http://cyberjedizen.blogspot.com/'>Photoshop</a>
</li>
<li>
<a href='#'>Web 3.0</a>
</li>
<li>
<a href='http://cyberjedizen.blogspot.com/'>Freelance</a>
</li>
<li>
<a href='http://cyberjedizen.blogspot.com/'>Tips and tricks</a>
</li>

</ul>
</li>
<li>
<a href='http://cyberjedizen.blogspot.com/'>Blogger</a>
<ul>
<li>
<a href='http://cyberjedizen.blogspot.com/'>templates</a>
</li>
<li>
<a href='http://cyberjedizen.blogspot.com/'>enhancements</a>
</li>
<li>
<a href='http://cyberjedizen.blogspot.com/'>tips and tricks</a>

</li>
</ul>
</li>
</ul>
</div>

<!--add by me for navTab-->



[ Supporting files]
[ Socialize This]

Thursday, June 4, 2009

Model fighter game UI with Swing (SINGLETON design pattern) - Part 2

In Model fighter game UI with Swing - Part 1, I have created the JFrame for fighters' detail view, before I create the main view which shows the thumbnails of all fighters, I need to figure out how to switch between them.


Once switch button clicked in the MainView frame, MainView should call set itself invisible, then get an instance of DetailView and set it visible. The problem is how to get an instance of DetailView. Calling DetailView's constructor directly is problematic, because at anytime, I don't want to create more than one instance of the DetailView. What I want is a getter method, if the DetailView has not been created, then create it and return it to me; otherwise, just return the existing instance to me.
The SINGLETON design pattern is the perfect solution here. By declaring the constructor DetailView() to be private, I can be assured that the only way of creating new instance is by calling getSingleton() method. In getSingleton(), we only call constructor at the first time, which guarantees only one instance is created.
(notice for thread safety, a little bit more complexed singleton pattern will be used instead.)

MultipleFramesExample.java



/*MultipleFramesExample.java*/
package FrameViews;
import java.awt.*;
import javax.swing.*;
public class MultipleFramesExample {
public MultipleFramesExample() {
MainView.getSingleton().setVisible(true);
DetailView.getSingleton().setVisible(false);
}

public static void main(String[] args) {
new MultipleFramesExample();
}
}


MaiView.java


/*MainView.java*/
package FrameViews;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class MainView extends JFrame implements ActionListener {
private static MainView theHandel;

private MainView() {
super("Main View");
super.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
super.setLocationRelativeTo(null);
super.setLocation(300, 400);
JPanel frame1 = (JPanel)super.getContentPane();
setSize(150,100);
frame1.setVisible(true);
JButton button1 = new JButton("Click for Detail View");
frame1.add(button1);
button1.addActionListener(this);
pack();
}

public static MainView getSingleton() {
if (theHandel == null) {
theHandel = new MainView();
}
return theHandel;
}

public void actionPerformed(ActionEvent event) {
theHandel.setVisible(false);
DetailView.getSingleton().setVisible(true);

}
}


DetailView.java


/*DetailView.java*/
package FrameViews;
import java.awt.event.*;

import javax.swing.*;
public class DetailView extends JFrame implements ActionListener {
private static DetailView theHandel;

private DetailView() {
super("Detail View");
super.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
super.setLocation(300, 500);
JPanel frame1 = (JPanel)super.getContentPane();
setSize(150,100);
frame1.setVisible(true);
JButton button1 = new JButton("Click for Main View");
frame1.add(button1);
button1.addActionListener(this);
pack();
}

public static DetailView getSingleton() {
if (theHandel == null) {
theHandel = new DetailView();
}
return theHandel;
}

public void actionPerformed(ActionEvent event) {
theHandel.setVisible(false);
MainView.getSingleton().setVisible(true);

}
}


Wednesday, June 3, 2009

How to embed a google search engine in your blog

How?

Step 1:
Click Customize -> Layout -> Page Elements -> add a Gadget
Step 2:
Selet the "HTML/Javascript", in the textarea copy and paste either the "code for radio style search box" or "code for checkbox style search box" listed below.
Step 3:
Change the following fields accordingly:
<input type="radio" name="sitesearch" value="YOURSITE" checked />YOUR SITE<br />

<input type="checkbox" name="sitesearch" value="YOURSITE" checked /> only search YOUR SITE<br />

Step 4:
Save the change and Done.




only search Cyber Jedi


code for radio style search box:

<form method="get" action="http://www.google.com/search" target="_blank">
<input type="text" name="q" size="25" maxlength="255" value="" />
<input type="submit" value="Google Search" />
<input type="checkbox" name="sitesearch" value="cyberjedizen.blogspot.com" checked /> only search Cyber Jedi<br />
</form>





The Web Cyber Jedi


code for checkbox style search box:

<form method="get" action="http://www.google.com/search" target="_blank">
<input type="text" name="q" size="31" maxlength="255" value="" />
<input type="submit" value="Google Search" />
<input type="radio" name="sitesearch" value="" /> The Web<input type="radio" name="sitesearch" value="cyberjedizen.blogspot.com" checked /> Cyber Jedi<br />
</form>

Why?
The basic technique involved here is to be able to manipulate one of the variables handed to the Google search engine, a variable called sitesearch. Set it to a null value and you're searching the entire World Wide Web, but set it to a specific domain and it's constrained to to the domain.

You can either use radio button or check box for the sitesearch field. Notice the target="_blank" in the <form> tab, which create a pop up window instead of let the user clicking away from your site.


[ Supporting files]
[ Socialize This]

How to embed a visitor map in your blog

You can embed the following visitor map in your blog.

Locations of visitors to this page


Step 1:
Click Customize -> Layout -> Page Elements -> add a Gadget
Step 2:
Selet the "HTML/Javascript", in the textarea copy and paste code listed below.
Step 3:
Change the <img src="http://www3.clustrmaps.com/counter/index2.php?url=http://YOURSITE"
Step 4:
Save the change and Done.




<a href="http://www3.clustrmaps.com/counter/maps.php?url=http://cyberjedizen.blogspot.com" id="clustrMapsLink"><img src="http://www3.clustrmaps.com/counter/index2.php?url=http://cyberjedizen.blogspot.com" style="border:0px;" alt="Locations of visitors to this page" title="Locations of visitors to this page" id="clustrMapsImg" onerror="this.onerror=null; this.src='http://www2.clustrmaps.com/images/clustrmaps-back-soon.jpg'; document.getElementById('clustrMapsLink').href='http://www2.clustrmaps.com';" />
</a>




[ Supporting files]
[ Socialize This]

How to promote your blog for search engine by adding the meta description and keyword entries.

<meta> tag is the html tag only visible for search engines. There are two very import meta tags:
Meta Keywords. The Keywords tell the search engines which terms or topics are most important in your blog; they are the words which generate the hits. This gets your blog listed in a search hit list.
Meta Description. The Description describes the contents of the blog; it is what is displayed in a search hit list entry. This is what gets the visitor to click to your blog, when your blog is presented in a search hit list.Both entries are essential. You want clicks. Without list entries, there will be no clicks.

If you view your page source (how?), you will find that blogger didn't include these two import meta tag by default. You can fix this, though, by little effort.

Press:
Customize -> Layout -> Edit HTML
The first several lines shoul look like this:





<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html expr:dir='data:blog.languageDirection' xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr'>
<head>
<b:include data='blog' name='all-head-content'/>
<title><data:blog.pageTitle/></title>
<b:skin><![CDATA[/*
-----------------------------------------------





Now add
<meta content="'whatever" name="'description'/">
<meta content="'Blogger,Blog, other keys..." name="'keywords'/">
right before the line
<b:skin><![CDATA[/*
so that your HTML looks like the following:




<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html expr:dir='data:blog.languageDirection' xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr'>
<head>
<b:include data='blog' name='all-head-content'/>
<title><data:blog.pageTitle/></title>
<meta content='Programmer, Hardware Engineer, Biologist, martial artist, ever think of adding them together?' name='description'/>
<meta content='Blogger, Blogspot, blogger.com, blogspot.com, Java, C, C++, C#, HTML, CSS, Programming, applet, swing, cyber, jedi, martial art, hardware, software,electronics, computer hardware, wireless, reverse engine, operation system, networking, digital arts, music, open source, driver, virus, information security, cyber martial arts, internet, worm, software, E-commerce, botnet, web, phishing, worm, ftp, p2p, email, social network, blog, search engine' name='keywords'/>
<b:skin><![CDATA[/*
-----------------------------------------------





Now take a look at your page's source code, the meta description and keyword entries show up.



[ Supporting files]
[ Socialize This]

Why I stopped publishing blog posts as information provider

Now the AI can generate content. Does that mean the web publishing industry reaches the end? ChatGPT said: ChatGPT Not at all. While AI can ...