ShaShinKi.com - Malaysia's Online Camera Shop!

Friday, December 10, 2010

How do select the best products to purchase online

Nowadays many people prefer to buy online, in order to get the best product items as well as reasonable price of the products, you need to do survey from website.

Try to use Google search to look for your interested products, search for product reviews of the product, from the review sites you get evaluate the product based on product descriptions, specifications as well as customer comments of the product. 

Check out some the the active forum to look for the topics that talk about your products, you can register as a forum member, ask any question about the product, you will get a lot of helpful answer later.

You can also search or answer a question regarding your products from Yahoo Answer. Many Yahoo users actively answering the question that know, you will get an answer in short time.

 

Wednesday, July 30, 2008

Alternative routes help beat the jam

News from The Star (Alternative routes help beat the jam)
This might be helpful for the serdang-to-puchong/usj commuters

Wednesday July 30, 2008

Alternative routes help beat the jam

By THO XIN YI


TRAFFIC jams are a daily ordeal Puchong folks have to go through. With Jalan Puchong and the Damansara Puchong Highway (LDP) as the only main roads connecting to Petaling Jaya and Subang Jaya, Puchong residents have no choice but to face the jam every day.

During peak hours, the said roads would be packed with vehicles inching their way forward.

Motorists either have to learn to live with the jams, or start hunting for alternative routes.

Here, StarMetro identifies three routes motorists can use to avoid the congestion.

Two of these routes are also toll-free, adding to the savings of motorists.

Stuck: A file picture of the jam along the LDP during rush hour.

Alternative Route 1

This route comes in handy when you need to avoid the particular stretch of the LDP from IOI Mall in Bandar Puchong Jaya to the Giant Hypermarket at Bandar Puteri Puchong.

It takes you through three connected residential areas using inner link roads.

Motorists first have to get onto Persiaran Puchong Jaya Selatan, either from the LDP (before Binary University College) or Lebuhraya Sungai Besi-Puchong (after D’Cahaya Apartment).

Turn into Jalan Serindit will lead motorists to the newly-constructed link road connecting Persiaran Wawasan at Pusat Bandar Puchong Jaya.

At the end of the link (where you will see a height barrier), make an immediate left turn and pass by blocks of apartments on the left.

At the T-junction, turn left into Persiaran Indra and SK Pusat Bandar Puchong 2 will be on the left. Go straight until the end of the road and make a right turn.

At the traffic lights, motorists can either turn right into Lebuh Puteri to get back to the LDP, or left to the Taman Industri Pusat Bandar Puchong and connect back to Jalan Puchong.

Alternative Route 1: The alternative route from Bandar Puchong Jaya Selatan to Bandar Puteri Puchong will lead you to this T-junction. Turn right to get to Lebuh Puteri to get back to LDP, or left to Taman Industri Pusat Bandar Puchong, and connect back to Jalan Puchong.

Alternative Route 2

This route will take you to Serdang from Bandar Kinrara, without the need to travel on the LDP.

But be warned, as the road conditions are not perfect as there are quite a number of potholes and uneven patches.

This route might seem complicated at first and it takes almost double the time compared with cruising on the rather straightforward LDP.

From Sungai Besi-Puchong Highway, get onto Jalan Kinrara 6 with the Kinrara Gold Club on the left and the Giant Hypermarket on the right.

Go straight until the end of the road and turn right at the traffic light onto Jalan Puncak Bukit Jalil.

Head on straight and take a left turn into Persiaran Puncak Jalil 1. Go straight and turn right at the T-junction.

The road curves with a sharp left turn. Follow the road and it will lead to a roundabout.

Take the 9 o’clock turn (first left turn) and get onto Persiaran Kota Perdana. Go straight until the traffic light. Bazaar Rakyat PKPS can be seen from the junction.

At the traffic light, turn left to head to Kompleks Pasar Borong Selangor, Equine Park, Serdang Jaya and Taman Bukit Serdang or turn right to connect back to the LDP to head towards Cyberjaya and Putrajaya.

Route 3: Turn right underneath this elevated ramp onto Persiaran Puchong Perdana to get to USJ.

Alternative Route 3

This detour will get you to USJ should the stretch of the LDP before the Puchong Barat Toll Plaza be congested.

Those coming from Bandar Puteri Puchong will pass by Tractors on the left and should head towards the elevated ramp with Taman Puchong Intan on the right.

Go under the ramp and turn right onto Persiaran Puchong Perdana at the traffic light. Head towards the 12 o’clock direction (go straight) at the first roundabout.

Take the 3 o’clock turn (third left turn) at the next roundabout and follow the road until the end.

This narrow road will lead you through some village houses and at the end of the road, turn left and to get back on the LDP, heading towards Putra Heights and USJ.

Sunday, July 27, 2008

XML Serialization in C#

Acticle from XML Serialization in C#

XML Serialization in C# [ printer friendly ]
Stats
Rating: 4.64 out of 5 by 33 users
Submitted: 09/19/02
Andrew Ma (ajmaonline@hotmail.com)


Object serialization is an important topic which is quite powerful if used correctly. Serialization allows programms to persist objects by storing then in files. In the case of this tutorial, into XML files. XML has become the standard for storage in the recent years and its good to see that with XML serialization built into the .NET framework, it will be very simple to build applications which can interop well with any other software, Microsoft or not.
This tutorial assumes a basic knowledge of programming. One thing that people may not be familiar with is the concept of attributes which is used heavily in this tutorial.

XML Serialization Attributes
First we'll start with a code sample of our class which we will serialize and then go on to explain what it does:
using System;
using System.Collections;
using System.IO;
using System.Xml;
using System.Xml.Serialization;

// Shopping list class which will be serialized
[XmlRoot("shoppingList")]
public class ShoppingList {
private ArrayList listShopping;

public ShoppingList() {
listShopping = new ArrayList();
}

[XmlElement("item")]
public Item[] Items {
get {
Item[] items = new Item[ listShopping.Count ];
listShopping.CopyTo( items );
return items;
}
set {
if( value == null ) return;
Item[] items = (Item[])value;
listShopping.Clear();
foreach( Item item in items )
listShopping.Add( item );
}
}

public int AddItem( Item item ) {
return listShopping.Add( item );
}
}

// Items in the shopping list
public class Item {
[XmlAttribute("name")] public string name;
[XmlAttribute("price")] public double price;

public Item() {
}

public Item( string Name, string Price ) {
name = Name;
price = Price;
}
}


On first glance, this class appears to be a normal class without anything out of the ordinary in the code, but when we look at the method signatures, we see that there are attributes around it such as [XmlRoot], [XmlElement] and [XmlAttribute]These are necessary for any class that will be serialized. This is the magic which allows us to specify how the class will be serialized and what will be elements or attributes and how everything will be named.
Some other useful attributes are:
[XmlIgnore] - this will cause the serializer to ignore the property during serialization. This will exclude it from the XML.

Serialzation
Now here's the cool part. This is how serialization works:
ShoppingList myList = new ShoppingList();
myList.AddItem( new Item( "eggs",1.49 ) );
myList.AddItem( new Item( "ground beef",3.69 ) );
myList.AddItem( new Item( "bread",0.89 ) );

// Serialization
XmlSerializer s = new XmlSerializer( typeof( ShoppingList ) );
TextWriter w = new StreamWriter( @"c:\list.xml" );
s.Serialize( w, myList );
w.Close();

// Deserialization
ShoppingList newList;
TextReader r = new StreamReader( "list.xml" );
newList = (ShoppingList)s.Deserialize( r );
r.Close();


The first chunk of code is simply creating an instance of the ShoppingList class and populating it. After that, we have the serialization part. Here is where the object gets converted into XML. As you can see, all it requires is the use of the XmlSerializer class which is set to serialize anything of type ShoppingList (look at the constructor). The serializer does its work when the Serialize method is called and will output XML to any stream. In this case, we have it output to a file.
Next there is the deserialization part. Here we use the same serializer (since it's set to the right type) and we read in an XML file and the Deserialize method will create the appropriate ShoppingList class object. This code sample shows serialization from a file, but you could just as easily do it from an http stream.

xsd.exe
Now I want to highlight the a useful utility. xsd.exe is a utility to generate schema or class files from given source. It is included with the .NET Framework. There are three main uses for xsd.exe.

First, xsd.exe <schema>.xsd which will create source code for the appropriate class to de-serialize your object.

Second, xsd.exe <assembly>.dll|.exe is used to read the code and generate a schema (.xsd) file for you.

Finally, xsd.exe <instance>.xml|.xdr which will try to infer an .xsd file which you can then use to create an appropriate class.

From a command prompt, type: "xsd.exe" to get more help information.

Conclusion
So there you have it. XML Serialization in C#. This is an incredibly useful way for application developers to persist objects by storing them in a file. It makes it really simple for any programmer to save configuration settings into XML files or application documents as well.

Tips:
- only typed arrays can be serialized and deserialized. If you have any collections such as an ArrayList, you will have to convert it an array.

Return to Browsing Tutorials

Email this Tutorial to a Friend


Rate this Content:
low quality 1 2 3 4 5 high quality

Reader's Comments Post a Comment
Another very useful attribute I forgot to mention is the [XmlText] attribute. It will cause the field to become the text between an xml element.
-- Andrew Ma, September 25, 2002
Very nice... I've been storing application setting in xml files (and the system registry) lately, but I've been doing it the hard way! Thanks for enlightening me!
-- Philip Lanier, September 25, 2002
For application setting, you should storing your things in the .config file (ie. if you app is called myapplication.exe, the config file is called myapplication.exe.config).
This way, you don't even need to do the serialization and deserialization. You can just get your settings using ConfigurationSettings.AppSettings["keyname"]. You can find more about it in the MSDN docs. It's pretty simple and straightforward.
-- Andrew Ma, September 25, 2002
That's really cool. It will save me tons of time and headaches, thanks.
-- Brent Bishop, September 27, 2002
And one should never be storing their application settings in the registry with .NET applications: let the past go, man! :-)
-- Heath Stewart, September 29, 2002
Great syntax very helpful, saves me time from figuring it out.
-- Sean Fitzgerald, October 01, 2002
Good example, but there's a small error in the Item class definition:

public class Item {
[XmlAttribute("name")] public string name;
[XmlAttribute("price")] public double price;
...
public Item( string Name, string Price ) {

should be

public Item( string Name, double Price ) {


No big deal, but thought it was worth bringing up if anyone wanted to try the code through copy and paste...
-- Ben Andrews, October 04, 2002
Thanks Andrew, exactly what I was looking for.
-- Luke Walker, April 19, 2003
I think that the tip section in the article might be partially wrong. I have ArrayList which is automatically serialized. Though I have to define the element type.

[XmlElement("party", typeof(Party))]
public ArrayList parties = new ArrayList();

-- N S, July 03, 2003
i know its not related w this subject, but happened when trying to run this example. when executing the line:

TextWriter w = new StreamWriter( @"c:\\list.xml" );

i get an exception:

An unhandled exception of type 'System.Security.SecurityException' occurred in mscorlib.dll

Additional information: Request for the permission of type System.Security.Permissions.FileIOPermission, mscorlib, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.

what is nonsense to me, since ASPNET user have full access to C:\...
-- Daniel Marreco, August 01, 2003
Very nice information..

Daniel.. as for your problem, I'm not exactly sure what the problem is, but I noticed this.. @"c:\\list.xml"

the @ sign means that the text is literal and doesn't have to be escaped.

which means you can use @"C:\list.xml" and it should work fine. If you want to do it the old way with "c:\\list.xml" then leave off the @ sign.
-- Drakier Dominaeus, August 27, 2003
More useful would be to continue the code to the logical endng of deserialization and showing the data was recovered by printing it to the console..... Educational non-the-less!
-- Henry VanderLeest, October 30, 2006
Though I can't live without XML serialization now, I really don't like XSD.exe. I've been using http://www.bonesoft.com/SkeletonCrew/Default.aspx for a while now, which produces C# or VB (among other outputs) from sample XML or XSD (among other inputs). The code it produces is much cleaner and is customizable.
-- Bone Head, July 06, 2007