Thursday, October 13, 2011

Nullable declaration


A nullable type

using System; 
 
class MainClass{ 
  public static void Main() { 
    int? count = null; 
 
    if(count.HasValue) 
      Console.WriteLine("count has this value: " + count.Value); 
    else  
      Console.WriteLine("count has no value"); 
 
    count = 100; 
 
    if(count.HasValue) 
      Console.WriteLine("count has this value: " + count.Value); 
    else  
      Console.WriteLine("count has no value");     
  } 
}
count has no value
count has this value: 100

Assign value to nullable int

using System; 
 
class MainClass { 
  public static void Main() { 
    int? count = null; 
    int? result = null; 
 
    int incr = 10; 
 
    count = 100; 
    result = count + incr; 
 
    if(result.HasValue) 
      Console.WriteLine("result has this value: " + result.Value); 
    else  
      Console.WriteLine("result has no value");     
 
  } 
}
result has this value: 110

Nullable long

using System;
public class Employee
{
    public Employee( string Name ) {
        this.firstName = firstName;
        this.terminationDate = null;
        this.ssn = default(Nullable<long>);
    }
    public string firstName;
    public Nullable<DateTime> terminationDate;
    public long? ssn; 
}
public class MainClass
{
    static void Main() {
        Employee emp = new Employee( "A");
        emp.ssn = 1234567890;
        Console.WriteLine( "{0} {1}", emp.firstName);
        if( emp.terminationDate.HasValue ) {
            Console.WriteLine( "Start Date: {0}", emp.terminationDate );
        }
        long tempSSN = emp.ssn ?? -1;
        Console.WriteLine( "SSN: {0}", tempSSN );
    }
}

Nullable Struct

using System;
struct Point                                    
{
   public int x;                                   
   public int y;                                   
   public Point(int xVal, int yVal)             
   {
      x = xVal; 
      y = yVal;
   }
}
class MainClass
{
   static void Main()
   {
      Point p = new Point(6, 11);     
      Point? nullablePoint  = new Point(5, 10);     
      Console.WriteLine("p.x: {0}", p.x);
      Console.WriteLine("p.y: {0}", p.y);
      Console.WriteLine("nullablePoint.x: {0}", nullablePoint.Value.x);
      Console.WriteLine("nullablePoint.y: {0}", nullablePoint.Value.y);
   }
}
p.x: 6
p.y: 11
nullablePoint.x: 5
nullablePoint.y: 10

Nullable Types Access: Explicitly use properties

using System;
class MainClass
{
   static void Main()
   {
      int? nullableInteger = 15;
 
      if (nullableInteger.HasValue)
         Console.WriteLine("{0}", nullableInteger.Value);
   }
}
15

Nullable Types Access: shortcut syntax

using System;
class MainClass
{
   static void Main()
   {
      int? nullableInteger = 15;
 
      if (nullableInteger != null)
         Console.WriteLine("{0}", nullableInteger);
   }
}
15

Nullable Types Assignment

using System;
class MainClass
{
   static void Main()
   {
      int? nullableInteger1, nullableInteger2, nullableInteger3;
      nullableInteger1 = 28;
      nullableInteger2 = nullableInteger1;
      nullableInteger3 = null;
      Console.WriteLine("nullableInteger1: {0}, nullableInteger2: {1}", nullableInteger1, nullableInteger2);
      Console.WriteLine("nullableInteger3 {0} null", nullableInteger3 == null ? "is" : "is not");
   }
}
nullableInteger1: 28, nullableInteger2: 28
nullableInteger3 is null

Null Coalescing Operator

using System;
class MainClass
{
   static void Main()
   {
      int? nullableInteger = null;
      Console.WriteLine("nullableInteger: {0}", nullableInteger ?? -1);
      nullableInteger = 10;
      Console.WriteLine("nullableInteger: {0}", nullableInteger ?? -1);
   }
}
nullableInteger: -1
nullableInteger: 10

null unification

using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;
public class MainClass
{
   public static void Main(){
        int? x1 = null;
        int? x2 = new int?();
        int? y1 = 55;
        int? y2 = new int?(55);
        Console.WriteLine("{0}...{1}...{2}...{3}", x1, x2, y1, y2);
        Console.WriteLine("x1 == null? {0}", x1 == null);
        object x1o = x1; 
        Console.WriteLine("x1o == null? {0}", x1o == null);
        Console.WriteLine("{0}...{1}", x1.GetType(), x1o.GetType());
   }
}
......55...55
x1 == null? True
x1o == null? True
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an ob
ject.
   at MainClass.Main()

Use nullable objects in expressions: result contains null, because one operand is null

using System; 
 
class MainClass { 
  public static void Main() { 
    int? count = null; 
    int? result = null; 
 
    int incr = 10; 
 
    result = count + incr; 
 
    if(result.HasValue) 
      Console.WriteLine("result has this value: " + result.Value); 
    else  
      Console.WriteLine("result has no value");     
 
  } 
}
result has no value

Using ??

using System; 
 
class MainClass { 
  static double myMethod() { 
      Console.WriteLine("In myMethod()."); 
      return 0.0; 
  } 
 
  public static void Main() { 
    double? defaultValue = 1.5; 
    double currentBalance; 
 
    currentBalance = defaultValue ?? myMethod(); 
    Console.WriteLine(currentBalance); 
 
    defaultValue = null; 
    currentBalance = defaultValue ?? myMethod(); 
    Console.WriteLine(currentBalance); 
 
  } 
}
1.5
In myMethod().
0

Monday, October 10, 2011

Quotes



To be happy, we must not be too concerned with others.
Albert Camus




When one door of happiness closes, another opens, but often we look so long at the closed door that we do not see the one that has been opened for us.
Helen Keller


Happiness resides not in posessions and not in gold; the feeling of happiness dwells in the soul.
Democritus

People with many interests live, not only longest, but happiest.
George Matthew Allen

Happiness is not achieved by the conscious pursuit of happiness; it is generally the by-product of other activities.
Aldous Huxley

The man is happiest who lives from day to day and asks no more, garnering the simple goodness of life.
Euripides

Happiness consists in activity: such is the constitution of our nature; it is a running stream, and not a stagnant pool.
John M. Good

Happiness is not a state to arrive at, but a manner of traveling. 

Positive Thinking


Jerry was the kind of guy you love to hate. He was always in a good mood and always had something positive to say. When someone would ask him how he was doing, he would reply, “If I were any better, I would be twins!”
He was a unique manager because he had several waiters who had followed him around from restaurant to restaurant. The reason the waiters followed Jerry was because of his attitude. He was a natural motivator. If an employee was having a bad day, Jerry was there telling the employee how to look on the positive side of the situation.
Seeing this style really made me curious, so one day I went up to Jerry and asked him, “I don’t get it! You can’t be a positive person all of the time. How do you do it?” Jerry replied, “Each morning I wake up and say to myself, Jerry, you have two choices today. You can choose to be in a good mood or you can choose to be in a bad mood.’ I choose to be in a good mood. Each time something bad happens, I can choose to be a victim or I can choose to learn from it. I choose to learn from it. Every time someone comes to me complaining, I can choose to accept their complaining or I can point out the positive side of life. I choose the positive side of life.”
“Yeah, right, it’s not that easy,” I protested.
“Yes it is,” Jerry said. “Life is all about choices. When you cut away all the junk, every situation is a choice. You choose how you react to situations. You choose how people will affect your mood. You choose to be in a good mood or bad mood. The bottom line: It’s your choice how you live life.”
I reflected on what Jerry said. Soon thereafter, I left the restaurant industry to start my own business. We lost touch, but often thought about him when I made a choice about life instead of reacting to it. Several years later, I heard that Jerry did something you are never supposed to do in a restaurant business: he left the back door open one morning and was held up at gunpoint by three armed robbers. While trying to open the safe, his hand, shaking from nervousness, slipped off the combination. The robbers panicked and shot him. Luckily, Jerry was found relatively quickly and rushed to the local trauma center. After 18 hours of surgery and weeks of intensive care, Jerry was released from the hospital with fragments of the bullets still in his body. I saw Jerry about six months after the accident. When I asked him how he was, he replied, “If I were any better, I’d be twins. Wanna see my scars?”
I declined to see his wounds, but did ask him what had gone through his mind as the robbery took place. “The first thing that went through my mind was that I should have locked the back door,” Jerry replied. “Then, as I lay on the floor, I remembered that I had two choices: I could choose to live, or I could choose to die. I chose to live.”
“Weren’t you scared? Did you lose consciousness?” I asked. Jerry continued, “The paramedics were great. They kept telling me I was going to be fine. But when they wheeled me into the emergency room and I saw the expressions on the faces of the doctors and nurses, I got really scared. In their eyes, I read, ‘He’s a dead man.’ I knew I needed to take action.”
“What did you do?” I asked.
“Well, there was a big, burly nurse shouting questions at me,” said Jerry. “She asked if I was allergic to anything. ‘Yes,’ I replied. The doctors and nurses stopped working as they waited for my reply… I took a deep breath and yelled, ‘Bullets!’ Over their laughter, I told them, ‘I am choosing to live. Operate on me as if I am alive, not dead.”
Jerry lived thanks to the skill of his doctors, but also because of his amazing attitude. I learned from him that every day we have the choice to live fully. Attitude, after all, is everything.
By Francie Baltazar-Schwartz

Let this really sink in-
then choose how you start your day tomorrow.

“I want you to recognize that this jar represents your life. The rocks are the important things – your family, your partner, your health, your children – things that if everything else was lost and only they remained, your life would still be full.
The pebbles are the other things that matter – like your job, your house, your car.
The sand is everything else. The small stuff.”
“If you put the sand into the jar first,” he continued “there is no room for the pebbles or the rocks. The same goes for your life.
If you spend all your time and energy on the small stuff, you will never have room for the things that are important to you. Pay attention to the things that are critical to your happiness. Play with your children. Take your partner out dancing. There will always be time to go to work, clean the house, give a dinner party and fix the disposal.
Take care of the rocks first – the things that really matter. Set your priorities. The rest is just sand.”


Then, the professor reached under the table and pulled out a bottle of PBR. He poured it in, and it, of course, fit into the gaps between sand particles. “And this, my students, demonstrates that there is ALWAYS room for a little booze in your life.”

Sunday, October 9, 2011

kurta


http://www.learnstitching.com/search/label/BABY%20CHEMISE


STITCH KURTA

Kurta is a north Indian costume which matches to any bottom. Let's see how to stitch a kurta.
Now I,ll instruct you how to stitch a kurta like the one below.



The materials required to stitch a kurta are cloth, pattern , scissors, inch tape , marking chalk and paper. Always it is adviced to prepare a stitching patternbefore going on to the real cloth to be stitched. You will get an exact idea if you prepare a stitching pattern using paper.




Check the churidar post so that you can get an idea of how to prepare a stitching pattern. Next take the cloth to be stitched. Use inch tape to measure yourself.

First fold the cloth breadthwise then fold lengthwise. Always see to that you mark the neck part to the folded part of the cloth and armhole onto the open sides of the cloth as shown in the diagram.

Mark on the cloth using marking chalk. I have cut only the front neck , a V cut. Now cut the cloth as shown in the figure below.



Next cut the sleeve part . If your not interested in attaching the sleeve then you need not cut the sleeve.

Next join the shoulders , then stitch and join the sleeves. The next thing to be done is to stitch the two sides of the kurta. Check the measurement using a sample kurta and then stitch.



Next fold and stitch the bottom. Finally use cross piece and stitch the neck part. The kurta is finally ready . Try and comment.



Actually the above one is recycled from my old night dress. I just cut it to the desired length and made a kurta out of it. You can also try the same using your own old dresses. If your trying for the first time , at the learning stage , its best to use your own old dresses rather than getting new cloths.

i just took about thirty minutes to finish this kurta. Only for the beginners it takes some hours, as you get experience you fasten yourself. Its an beautiful art to stitch your own dress. Try to think creatively and design your own dresses and stitch them.

If your crazy of stitching your own dress , then you can extend still more to become a fashion designer. Always at all period there's scope for fashion . Becoming a fashion designer needs lots of experience. Pleople should like your design and you should become famous. Once you become famous for your design then you can earn a lot through your designs. You can also do regular courses to become a fashion designer in a well reputed universities

churidar stitching


HOW TO STITCH A CHURIDAR


This is the new churidar I stitched. This is a normal churidar but I've cut the churidar into two parts and again joined them. Now measure from the beginning of the shoulder till 13th inch. Cut at the 13th inch horizontally so that you get two different parts, the breast part and the part below breast. [Take a look at the older churidar & salwar post to have a complete idea]

Just take the breast part , now im gonna sitich darts so that cup shape is formed to fit the breast exactly. Now stitch a small dart on the armhole and the main dartstraight to the shoulder. Stitch darts on both sides of the front piece, you can also stitch darts on the back piece. A small dart straight to the shoulder is enough. When you stitch darts on the front piece don’t bring the darts closer so that you don’t get a cone shape.Stitch darts of length 2 inch so that you get a u shape.

Next join the shoulders, stitch the sleeve and then stitch the neck. It will be fine if you give cross piece to neck. After you finish the breast part join it with the bottom part. Fold and stitch the bottoms and sides.

This is the salwar matching to the above one. I’ve stitched a normal salwar with some gatherings so that the hip part is comfortable.


STITCH SALWAR



This is a chudithar pant or salwar that we are gonna learn to stitch. Stitching a pant is easy.
Now let us see the stitching pattern for a chudithar pant(salwar). I have given the readymade measurement. You can try with your ownmeasurement using a sample pant and a inch tape.



MEASUREMENT
  • full length = 100 cm
  • hip = 100 cm
  • bottom = 38 cm
  • a-b = full length = full length - bottom piece = 100 - 4 = 96 cm
  • a -c = (hip/4)-5 = 20 cm
  • b-g = hip/6 = 100/6 = 16.6 cm
  • e-h = (width of cloth/2)-2 = (90/2)-2 = 43 cm
  • h-i = (hip/3)+5 = 20 cm
  • a-f & c-d = (hip/4)-8 = (100/4)-8 = 33 cm
Using the above measurement draw the stitching pattern. Next take the cloth to be stitched. First fold the cloth breadthwise next lengthwise as shown below.



First you have to cut the c-b part , verify the the stitching pattern diagram above. Next keep the stitching pattern and mark the edges of the stitching pattern using marking chalk. Then carefully cut the cloth without disturbing it.
Next fold and stitch the bottom part and then you can join the edges along the side till the end . Do this to both the leg pieces as shown in the figure. Stitch and join the two legs . Keep some gatherings along the waist as shown in the figure. Keep some gatherings so that the c-h part is equal to c-d part , verify the stitching pattern diagram above.



Next cut the a-c part . In the a-c part stitch a small loop for the thread to pass inside the pant , which is usefull to tie the pant. Now attach the c-b part to the a-c part ,verify the stitching pattern above. Stitch them properly so that both diameter becomes equal.


After you stitch them , the complete salwar is ready.

HOW TO CUT AND SEW CHURIDAR



Now let us see how to stitch a churidar like the above. Stitching a chudithar top is easy . Accurate measurements , some practice will help you to stitch anything well.


The above is the stitching pattern for the churidar , I've given the readymade measurement for the above .

READYMADE MEASUREMENT

* full length = 105 cm
* Narrow waist = 39 cm
* Bust level = 25.5 cm
* shoulder = 38 cm
* chest = 92 cm
* Waist = 72 cm
* Hip = 100 cm
* sleve legth = 25 cm

measurements according to the diagram

* 1-2 = full length + 3 cm = 108 cm
* 1-6 = arm hole = (chest/4)-2.5 = (92/4)-2.5 = 20.5 cm
* 6-7 = chest loose = (chest/4)+2.5 = 25.5 cm
* 1-10 = narrow waist = 39 cm
* 2-11 = bottom = (chest/4)+10=33 cm
* 1-3 = neck breadth = chest/12 = 7.6 cm
* 1-5 = front neck = chest/8 = 11.5 cm
* u can keep the same length for back neck else back neck = chest/12 = 7.6 cm
* 3-8 = shoulder = shoulder/2=38/2 = 19 cm

Now using the below pics you can have an idea how to stitch a churidar top. Using the stitching pattern i've drawn the pattern on a chart. If your gonna stitch in your measurement , take your churidar and measure it with a inch tape and draw the stitching pattern.

First take the cloth, fold it breadthwise first , next fold it lengthwise . After that you can place the stitching pattern and mark the edges using marking chalk. The material i've used has a lining material too so first im gonna cut the lining material then the outer material. Beginers never cut both materials together.



After cutting the lining material , next im gonna cut the outer material. Be carefull that you dont disturb the cloth. Then cut the outer material.

Next join the front pieces and back pieces by stitching them throughout the edges. Next you will have seperate front and back piece. Next stitch the neck part using crosspiece or lining using extra cloth. Next stitch the shoulders of both piece together.

Next cut the sleeve part, here i have used 3/4th sleeve and have taken only the outer part so that it will be transparent. Stitch the sleeves to thearmhole. Next join the left and right sides of churidar. Fold and stitch the openings below hip.


After the sleeves are attached the final outcome , the churidar is ready.

measurementsst


Online Shopping - Buy Made-To-Order Salwar Kameez Directly from our Indian Store - Salwar Kameez Measurements, Color Options, Custom Tailoring for All Sizes

Please send us your size details as per the measurement details given below so that your custom outfits can be made as per your size.
Kindly email us the size for the salwar kameez outfit(s) as per the below mentioned details so that we can customize it according to your instructions. It is absolutely necessary that we receive accurate measurements to ensure that the outfit ordered fits you perfectly.
Please provide us the following measurements in inches or cms
Salwar Kameez MeasurementsYour Height :
Top/Kameez Measurements :
1 - Kameez Length
2 - Shoulder to Shoulder (Backside)
3 - Chest / Bust (Round)
4 - Waist (Round)
5 - Hips (Round)
6 - Armhole
7 - Biceps
8 - Sleeves Length (if applicable)
Sleeves Type (Long, Short, Sleeveless or as in picture)
Pants/Salwar Measurements :
11 - Length of Salwar - Outside Leg
12 - Inseam/ Inside Leg
13 - Circumference at the bottom of pants / salwar
14- Thighs (Round)
Also Type of Salwar - whether as shown in the picture or some different style.
To ensure proper fit :
a. Measure yourself just prior to placing the order
b. If possible, have someone else measure you.
c. Do NOT make extra allowances (We'll do it appropriately when we stitch the outfit).
d. Do not pull tape too light
Also indicate your selection of fabric and color as below : 
FABRIC
 : Please see the item description and let us know accordingly. You can also mention "as in pic" if you want the same fabric as pictured. 
COLORS
 : Please provide us the color code number from the chart link given here You can also mention "as in pic" if you want the same color as pictured.
Remember, due to the difference in the colors shown on the web (because of different types of monitors and resolutions on the web etc.), there might be some slight difference in the chosen color. However, we'll do our best to provide you the best match for your chosen color.
Do also mention special instructions (regarding styles or something specific) - If any
Please feel free to let us know in case you need any clarification.