Coding Clean and Semantic Template

If you are the guy who uses <div> tag for everything, this post is for you. It focuses on how you can write clean HTML code by using semantic markups and minimize the use of <div> tag. Have you ever edited someone’s templates, don’t those messy tags drive you crazy? Not only writing clean templates can benefit yourself, but your team as well. It will save you time when you have to debug and edit (particularly the large projects).

1. Remove The Unnecessary <div> Tags

I’ve seen a lot of people wrap a <div> tag around the <form> or <ul> menu list. Why create an extra <div> tag that you don’t need? You can achieve the same result by applying the CSS rules to the selector.

Example 1:

The example below shows how you can drop the <div> tag and declare the styling to the form selector.

div form

Example 2:

Sometimes we wrap the content with an extra <div> tag strictly for spacing purposes. The example on the left uses a <div> to create margin space in between the boxes. But if each box has a heading (ie. <h4>), we can simply apply the margin space to the h4 selector and drop the extra <div> tag.

div sidebar

2. Use Semantic Markups

You should always use semantic markups to code HTML documents (ie. <h1> for headings, <p> for paragraph text, and <ul> for list items). So, even when the CSS is not presented nor supported, your document still makes sense.

Example:

The image below compares the rendering differences between <div> markups and semantic markups with no css supported.

semantic markups

3. Minimize The Use of <div> Tags

Have you seen the messy templates where <div> tags are everywhere and they drive you crazy? Have you ever missed a closing </div> tag or have an extra opening <div> tag messing up the entire layout? I’m sure most developers have experienced it before. So, you should always minimize the use of <div> tag if possible. It will make debugging and editing easier.

Example 1:

Instead of using <div> tag for breadcrumb navigation, it makes more sense to use <p> tag.

breadcrumb

Example 2:

The following example shows how I can use CSS to cut down two <div> tags by replacing with one <span> tag. They both produce the same layout.

blog date

4. Format (Indent) Your Code

You should always format your source code (ie. indent your nested elements) so it is easier to read and debug. If you have Adobe Dreamweaver, you can easily format the code by using the Commands > Apply Source Formatting (from the application menu).

code formatting

5. Comment The Closing </div> Tags

When coding for platform templates (ie. WordPress themes), the template is most likely splitted into several files: index.php, header.php, sidebar.php, and footer.php. Hence, you should always make a comment for the closing </div> tags so you won’t get lost. For example, when I see </div><!-- /wrapper -->, I know it is the closing tag for <div id="wrapper">.

Example:

I usually insert a HTML comment tag right after the closing </div> tag. I use the forward slash to indicate it is the closing tag.

comment closing tag

Nokia N900 vs. Motorola Droid

2 Linux Smart Phones: Nokia N900 Motorola Milestone (Droid)
Promo
Availability in Europe November 30, 2009 November 16, 2009
Retail Price 599 Euro 499 Euro
OS Maemo 5 Android 2.0
CPU ARM Cortex A8 600 MHz ARM Cortex A8 550MHz
Operating Frequency GSM 850/900/1800/1900

WCDMA/
900/1700/2100
GSM 850/900/1800/1900

WCDMA/
900/2100
Flight Mode Yes Yes
Dimension 110,9 x 59,8 x 18 (19,55) mm 115.8 x 60 x 13.7 mm
Weight 181 g (with battery) 165g
Display 3.5 3.7
Resolution 800×400pixel 480 x 854 pixel 16:9 widescreen; PPI 267
Touch Screen Yes Yes
Autorotate Yes Yes
Ambient Light Sensor Yes Yes
Haptic Feedback Yes Yes
Multitouch No Yes
Proximity Sensor Yes Yes
Graphics PowerVR SGX 530 GPU

3G Graphics acceleration

support for OpenGL ES
2.0
PowerVR SGX
Virtual Keyboard Yes Yes
qwerty keyboard Yes Yes
Backlit Keyboard Yes Yes
Word Prediction Yes Yes
Pen Input with Stylus Yes No
Voice Commands No Yes
MMS No Yes
Internal Memory 256MB RAM 256MB RAM
Storage 32 GB eMMC (2GB /home,768MB /swap)

External Memory MicroSD
16GB (max.)
512MB Flash memory, MicroSD 8GB preinstalled
(The stock Android operating system restricts applications from being installed outside of onboard memory, in this case limiting application and OS size to a total maximum size of 512MB.)

MicroSD
32GB (max.)
GPRS Class A, multislot class 32 max.107/64.2 kbps Class 12
EDGE Class A, multislot class 32 max.296/177.6 kbps Class 12
WCDMA max. 384/384 KBit/s ?
HSPA Down 10 MBit/s, Up 2 MBit/s ?
WLAN WLAN IEEE 802.11b/g WLAN IEEE 802.11 b/g
Web Browser Mozilla Webkit HTML5
Flash Support Adobe Flash Player 9.4 Flash Player 10.1 Ready (not yet released)
AJAX support JavaScript 1.8, XML ?
Bluetooth v2.1. HFP, HSP, A2DP, AVRCP, FTP, OPP v2.1 + EDR.HFP, HSP, A2DP, AVRCP, OPP, PBAP
Infrared Yes No
UPnP Support via WLAN Yes No
Headphone Jack 3.5 mm 3.5 mm
Integreated Stereo Speaker Yes Yes
TV Out Nokia Video Connectivity Cable No
USB microUSB v2.0 microUSB v2.0
USB Charging Yes Yes
Back Camera 5 megapixel Carl Zeiss autofocus camera with dual LED flash (4:3 and 16:9 ratio) 5 megapixel, dual LED flash
Autofocus Yes Yes
Digital Zoom 3X 4X
Camera Image Format JPEG/EXIF ?
Video Recording 800 x 480 pixels/25fps (max.)(mp4: MPEG4, AAC) 720×480 pixels /24fps (max.)
Video Playback Format mp4, .avi, .wmv, .3gp; codecs: H.264, MPEG-4, Xvid, WMV, H.263 H.263, H.264, MPEG-4, WMV9
Video Streaming H.264, MPEG-4, Xvid, WMV, H.263 in .avi, .mp4, .wmv, .asf and .3gp containers Yes
Front Camera 0.3 megapixel, 640×480 pixels No
Music Playback Format MP3, WMA, AAC, M4A, WAV AAC, AMR, eAAC, MIDI, MP3, OGG, WAV, WMA, WMA9
Max. Bit Rate 320 bps ?
Ringtone Format Wav, MP3, AAC, eAAC eAAC+, MP3, AAC+, eAAC, AAC, OGG
FM Radio requires headset to be attached No
GPS Integrated A-GPS receiver A-GPS, S-GPS
Java No No
Battery BL-5J 1320 mAh battery 1400 mAh removable lithium-ion battery
Standby ? up to 350 hours

USB 3.0

1. What is USB 3.0 (aka. SuperSpeed USB)?

USB 3.0 is the next major revision of the ubiquitous Universal Serial Bus, created in 1996 by a consortium of companies led by Intel to dramatically simplify the connection between host computer and peripheral devices. Fast forwarding to 2009, USB 2.0 has been firmly entrenched as the de-facto interface standard in the PC world for years (with about 6 billion devices sold), and yet still the need for more speed by ever faster computing hardware and ever greater bandwidth demands again drive us to where a couple of hundred megabits per second is just not fast enough.

In 2007, Intel demonstrated SuperSpeed USB at the Intel Developer Forum. Version 1.0 of the USB 3.0 (confusing, isn’t it?) specification was completed on November 17, 2008. As such, the USB Implementers Forum (USB-IF) has taken over managing the specifications and publishes the relevant technical documents necessary to allow the world of developers and hardware manufacturers to begin to develop products around the USB 3.0 protocol.

In a nutshell, USB 3.0 promises the following:

  • Higher transfer rates (up to 4.8 Gbps)
  • Increased maximum bus power and increased device current draw to better accommodate power-hungry devices
  • New power management features
  • Full-duplex data transfers and support for new transfer types
  • New connectors and cables for higher speed data transfer…although they are backwards compatible with USB 2.0 devices and computers (more on this later)

2. Isn’t USB 2.0 fast enough?
Well, yes and no. USB 2.0 for many applications provides sufficient bandwidth for a variety of devices and hubs to be connected to one host computer. However, with today’s ever increasing demands placed on data transfers with high-definition video content, terrabyte storage devices, high megapixel count digital cameras, and multi-gigabyte mobile phones and portable media players, 480Mbps is not really fast anymore. Furthermore, no USB 2.0 connection could ever come close to the 480Mbps theoretical maximum throughput, making data transfer at around 320 Mbps – the actual real-world maximum. Similarly, USB 3.0 connections will never achieve 4.8 Gbps, but even 50% of that in practice is almost a 10x improvement over USB 2.0.

3. How does USB 3.0 achieve the extra performance?
USB 3.0 achieves the much higher performance by way of a number of technical changes. Perhaps the most obvious change is an additional physical bus that is added in parallel with the existing USB 2.0 bus. This means that where USB 2.0 previously had 4 wires (power, ground, and a pair for differential data), USB 3.0 adds 4 more for two pairs of differential signals (receive and transmit) for a combined total of 8 connections in the connectors and cabling. These extra two pairs were necessary to support the SuperSpeed USB target bandwidth requirements, because the two wire differential signals of USB 2.0 were not enough.

Furthermore, the signaling method, while still host-directed, is now asynchronous instead of polling. USB 3.0 utilizes a bi-directional data interface rather than USB 2.0‘s half-duplex arrangement, where data can only flow in one direction at a time. Without getting into any more technical mumbo jumbo, this all combines to give a ten-fold increase in theoretical bandwidth, and a welcome improvement noticeable by anyone when SuperSpeed USB products hit the market.

4. What other improvements does USB 3.0 provide?
The enhancements to SuperSpeed USB are not just for higher data rates, but for improving the interaction between device and host computer. While the core architectural elements are inherited from before, several changes were made to support the dual bus arrangement, and several more are notable for how users can experience the improvement that USB 3.0 makes over USB 2.0:

  • More power when needed
    • 50% more power is provided for unconfigured or suspended devices (150 mA up from 100 mA), and 80% more power is available for configured devices (900 mA up from 500 mA). This means that more power-hungry devices could be bus powered, and battery powered devices that previously charged using bus power could potentially charge more quickly.
    • A new Powered-B receptable is defined with two extra contacts that enable a devices to provide up to 1000 mA to another device, such as a Wireless USB adapter. This eliminates the need for a power supply to accompany the wireless adapter…coming just a bit closer to the ideal system of a wireless link without wires (not even for power). In regular wired USB connections to a host or hub, these 2 extra contacts are not used.
  • Less power when it’s not needed
    Power efficiency was a key objective in the move to USB 3.0. Some examples of more efficient use of power are:

     

    • Link level power management, which means either the host computer or the device can initiate a power savings state when idle
    • The ability for links to enter progressively lower power management states when the link partners are idle
    • Continuous device polling is eliminated
    • Broadcast packet transmission through hubs is eliminated
    • Device and individual function level suspend capabilities allow devices to remove power from all, or portions of their circuitry not in use
  • Streaming for bulk transfers is supported for faster performance
  • Isochronous transfers allows devices to enter low power link states between service intervals
  • Devices can communicate new information such as their latency tolerance to the host, which allows better power performance

To paint an accurate picture, not everything in USB 3.0 is a clear improvement. Cable length, for one, is expected to have a significant limitation when used in applications demanding the highest possible throughput. Although maximum cable length is not specified in the USB 3.0 specification, the electrical properties of the cable and signal quality limitations may limit the practical length to around 3 metres when multi-gigabit transfer rates are desired. This length, of course, can be extended through the use of hubs.

Additionally, some SuperSpeed USB hardware, such as hubs, may always be more expensive than their USB 2.0 counterparts. This is because by definition, a SuperSpeed hub contains 2 hubs: one that enumerates as a SuperSpeed hub, and a second one that enumerates as a regular high-speed hub. Until the USB hub silicon becomes an integrated SuperSpeed USB + Hi-Speed USB part, there may always be a significant price difference.

Some unofficial discussion has surfaced on the web with respect to fiber-optic cabling for longer cable length with USB 3.0. The specification makes no mention of optical cabling, so we conclude that this will be defined in a future spec revision, or left to 3rd party companies to implement cable extension solutions for SuperSpeed USB.

Google Chrome OS overview video

Google Chrome OS overview:

Google Chrome OS fast-boot:

Google Chrome OS security:

Google Chrome OS & Open Source:

How to Update Your Facebook Status with Twitter

Did you know that it is possible to have Twitter automatically update your Facebook page? It’s actually very simple. In fact, I haven’t manually updated my Facebook status in months.

twitter logo with arrow pointing to facebook pages

To get this process working, follow these six simple steps. It shouldn’t take you more than five minutes, max. These instructions assume that you already have both a Facebook account and a Twitter account.

  1. Make sure you are logged into Facebook. Now go to the Facebook’s Twitter application page. Now click on the Go to Application button. It looks like this:
    how-to-update-your-facebook-status-wiith-twitter-01.jpg
  2. The application will now ask you to confirm that Twitter can access your Facebook information. Click on the Allow button.
    how-to-update-your-facebook-status-wiith-twitter-02
  3. Now log into your Twitter account by entering your Twitter username and password. The screen looks similar to this:
    how-to-update-your-facebook-status-wiith-twitter-03

    Click on the Login button.
  4. You can now actually use Twitter from within Facebook. The screen looks like this:
    how-to-update-your-facebook-status-wiith-twitter-04

    Personally, I never use this. I want the reverse of this. I want to update my Facebook status from Twitter. Therefore, click on the Allow Twitter to Update Your Facebook Status button in the upper-right of the screen.
  5. You should get a confirmation screen that looks similar to this:
    how-to-update-your-facebook-status-wiith-twitter-05

    Now confirm that you are willing to let Twitter update your Facebook status by clicking the Allow Status Updates button.
  6. After you click this button, you will go to the Twitter application. Don’t Twitter anything from here. Instead, go to your Facebook Home page, by clicking the Home link on the Facebook menu.Now you can test the connection by going to your favorite Twitter application or the Twitter web page and entering a tweet. Wait a minute or two and go back to your Facebook home page and refreshing it. Your most recent tweet should be displayed as your Facebook status. This is how my status looked:how-to-update-your-facebook-status-wiith-twitter-06

That’s all there is to it. Now every time you Twitter something, your Facebook status will be automatically updated.

Update: If you don’t want to send every one of your tweets to Facebook, then check out Selective Twitter Status. It allows you to designate the tweets you want to appear on Facebook by end a tweet with the #fb “hashtag” in your post. Only those tweets with the hash tag at the end will be posted on Facebook.

Find me on Twitter

This is how an Intel processor is manifactured -Ans

very interesting.. hope every one enjoy!

cid:image029.jpg@01CA377C.FDDF6970

Sand. Made up of 25 percent silicon, is, after oxygen, the second most abundant chemical element that’s in the earth’s crust. Sand, especially quartz, has high percentages of silicon in the form of silicon dioxide (SiO2) and is the base ingredient for semiconductor manufacturing.

cid:image030.jpg@01CA377C.FDDF6970

After procuring raw sand and separating the silicon, the excess material is disposed of and the silicon is purified in multiple steps to finally reach semiconductor manufacturing quality which is called electronic grade silicon. The resulting purity is so great that electronic grade silicon may only have one alien atom for every one billion silicon atoms. After the purification process, the silicon enters the melting phase. In this picture you can see how one big crystal is grown from the purified silicon melt. The resulting mono-crystal is called an ingot.

cid:image031.jpg@01CA377C.FDDF6970

A mono-crystal ingot is produced from electronic grade silicon. One ingot weighs approximately 100 kilograms (or 220 pounds) and has a silicon purity of 99.9999 percent.

cid:image032.jpg@01CA377C.FDDF6970

The ingot is then moved onto the slicing phase where individual silicon discs, called wafers, are sliced thin. Some ingots can stand higher than five feet. Several different diameters of ingots exist depending on the required wafer size. Today, CPUs are commonly made on 300 mm wafers.

cid:image033.jpg@01CA377C.FDDF6970

Once cut, the wafers are polished until they have flawless, mirror-smooth surfaces. Intel doesn’t produce its own ingots and wafers, and instead purchases manufacturing-ready wafers from third-party companies. Intel’s advanced 45 nm High-K/Metal Gate process uses wafers with a diameter of 300 mm (or 12-inches). When Intel first began making chips, it printed circuits on 50 mm (2-inches) wafers. These days, Intel uses 300 mm wafers, resulting in decreased costs per chip.

cid:image034.jpg@01CA377C.FDDF6970

The blue liquid, depicted above, is a photo resist finish similar to those used in film for photography. The wafer spins during this step to allow an evenly-distributed coating that’s smooth and also very thin.

cid:image035.jpg@01CA377C.FDDF6970

At this stage, the photo-resistant finish is exposed to ultra violet (UV) light. The chemical reaction triggered by the UV light is similar to what happens to film material in a camera the moment you press the shutter button.

Areas of the resist on the wafer that have been exposed to UV light will become soluble. The exposure is done using masks that act like stencils. When used with UV light, masks create the various circuit patterns. The building of a CPU essentially repeats this process over and over until multiple layers are stacked on top of each other.

A lens (middle) reduces the mask’s image to a small focal point. The resulting "print" on the wafer is typically four times smaller, linearly, than the mask’s pattern.

cid:image036.jpg@01CA377C.FDDF6970

In the picture we have a representation of what a single transistor would appear like if we could see it with the naked eye. A transistor acts as a switch, controlling the flow of electrical current in a computer chip. Intel researchers have developed transistors so small that they claim roughly 30 million of them could fit on the head of a pin.

cid:image037.jpg@01CA377C.FDDF6970

After being exposed to UV light, the exposed blue photo resist areas are completely dissolved by a solvent. This reveals a pattern of photo resist made by the mask. The beginnings of transistors, interconnects, and other electrical contacts begin to grow from this point.

cid:image038.jpg@01CA377C.FDDF6970

The photo resist layer protects wafer material that should not be etched away. Areas that were exposed will be etched away with chemicals.

cid:image039.jpg@01CA377C.FDDF6970

After the etching, the photo resist is removed and the desired shape becomes visible.

cid:image040.jpg@01CA377C.FDDF6970

More photo resist (blue) is applied and then re-exposed to UV light. Exposed photo resist is then washed off again before the next step, which is called ion doping. This is the step where ion particles are exposed to the wafer, allowing the silicon to change its chemical properties in a way that allows the CPU to control the flow of electricity.

cid:image041.jpg@01CA377C.FDDF6970

Through a process called ion implantation (one form of a process called doping) the exposed areas of the silicon wafer are bombarded with ions. Ions are implanted in the silicon wafer to alter the way silicon?i these areas conduct electricity. Ions are propelled onto the surface of the wafer at very high velocities. An electrical field accelerates the ions to a speed of over 300,000 km/hour (roughly 185,000 mph)

cid:image042.jpg@01CA377C.FDDF6970

After the ion implantation, the photo resist will be removed and the material that should have been doped (green) now has alien atoms implanted.

cid:image043.jpg@01CA377C.FDDF6970

This transistor is close to being finished. Three holes have been etched into the insulation layer (magenta color) above the transistor. These three holes will be filled with copper, which will make up the connections to other transistors.

cid:image044.jpg@01CA377C.FDDF6970

The wafers are put into a copper sulphate solution at this stage. Copper ions are deposited onto the transistor through a process called electroplating. The copper ions travel from the positive terminal (anode) to the negative terminal (cathode) which is represented by the wafer.

cid:image045.jpg@01CA377C.FDDF6970

The copper ions settle as a thin layer on the wafer surface.

cid:image046.jpg@01CA377C.FDDF6970

The excess material is polished off leaving a very thin layer of copper.

cid:image047.jpg@01CA377C.FDDF6970

Multiple metal layers are created to interconnects (think wires) in between the various transistors. How these connections have to be “wired” is determined by the architecture and design teams that develop the functionality of the respective processor (for example, Intel’s Core i7 processor). While computer chips look extremely flat, they may actually have over 20 layers to form complex circuitry. If you look at a magnified view of a chip, you will see an intricate network of circuit lines and transistors that look like a futuristic, multi-layered highway system.

cid:image048.jpg@01CA377C.FDDF6970

This fraction of a ready wafer is being put through a first functionality test. In this stage test patterns are fed into every single chip and the response from the chip monitored and compared to "the right answer."

cid:image049.jpg@01CA377C.FDDF6970

After tests determine that the wafer has a good yield of functioning processor units, the wafer is cut into pieces (called dies).

cid:image050.jpg@01CA377C.FDDF6970

The dies that responded with the right answer to the test pattern will be put forward for the next step (packaging). Bad dies are discarded. Several years ago, Intel made key chains out of bad CPU dies.

cid:image051.jpg@01CA377C.FDDF6970

This is an individual die, which has been cut out in the previous step (slicing). The die shown here is a die of an Intel Core i7 processor.

cid:image052.jpg@01CA377C.FDDF6970

The substrate, the die, and the heatspreader are put together to form a completed processor. The green substrate builds the electrical and mechanical interface for the processor to interact with the rest of the PC system. The silver heatspreader is a thermal interface where a cooling solution will be applied. This will keep the processor cool during operation.

cid:image053.jpg@01CA377C.FDDF6970

A microprocessor is the most complex manufactured product on earth. In fact, it takes hundreds of steps and only the most important ones have been visualized in this picture story.

cid:image054.jpg@01CA377C.FDDF6970

During this final test the processors will be tested for their key characteristics (among the tested characteristics are power dissipation and maximum frequency).

cid:image055.jpg@01CA377C.FDDF6970

Based on the test result of class testing processors with the same capabilities are put into the same transporting trays. This process is called "binning". Binning determines the maximum operating frequency of a processor, and batches are divided and sold according to stable specifications.

cid:image056.jpg@01CA377C.FDDF6970

The manufactured and tested processors (again Intel Core i7 processor is shown here) either go to system manufacturers in trays or into retail stores in a box. Many thanks to Intel for supplying the text and photos in this picture story. Check out Intel’s site for full size images of this entire process.

Please do not print this email unless it is absolutely necessary.

Firefox 3.6 beta released

Help test the future of Firefox!

The latest beta version of Firefox is now available as a preview release. Take it for a test drive and let us know what you think!

Free Download 3.6b2 for
Windows
English (US) (7.7MB)

Yahoo Joins Social Network Group, as Google Gives Up Control

Yahoo Joins Social Network Group, as Google Gives Up Control


By Miguel Helft

As anticipated, Yahoo is joining the Google-led OpenSocial alliance, which is developing a common set of standards for programmers to create applications that can run on social networks and other sites.

Yahoo has considered joining the alliance for months, according to people familiar with the company’s plans. But Yahoo executives fretted that Google might exert too much control over the evolution of OpenSocial and over any intellectual property created by the group, these people said. Yahoo raised those concerns with Google. Now, Google has agreed to give up control over OpenSocial.

In announcing Yahoo’s entry into the alliance, the companies said that the programming standard would now be in the hands of the OpenSocial Foundation, a non-profit group whose founding members will include Google, Yahoo and MySpace, another large backer of OpenSocial. The foundation, which will be created within 90 days, will “ensure the neutrality and longevity of OpenSocial as an open, community-governed specification for building social applications across the Web,” the companies said.

In a conference call with reporters, Google and Yahoo executives dismissed the idea that the foundation was created in response to Yahoo’s concerns. Joe Kraus, director of product management at Google, said the foundation represented “more an evolution of where OpenSocial is heading” than a response to concerns raised by any one member. And Wade Chambers, vice president of platforms at Yahoo, praised Google’s stewardship of the standard so far.

Yahoo’s participation brings to OpenSocial developers the potential to distribute their applications to a large base of new users. The alliance was formed last fall as a counterweight to Facebook, which has successfully courted thousands of application developers. The creators of many of the most popular Facebook applications have said they plan to adapt their programs to make them compatible with the OpenSocial standard.

Yahoo provided no details about when or how it would carry out the OpenSocial standard. So far, only MySpace and Orkut, Google’s social network, have introduced OpenSocial on their sites, Mr. Kraus said. Other members of the alliance include Bebo, LinkedIn and Plaxo.

Follow

Get every new post delivered to your Inbox.