Tuesday, April 12, 2011

Some Sisters are very proud

Today is the starting of Sisters week, updated my FB status
Sister's week!!!!! If u have a sister who has made u laugh, wiped your tears,hugged u tight, watched u succeed, made u mad, cheered u up and made u strong..... Copy n paste dis on to your status.. I did cos i have world's best sister :)
and i love her too.....♥♥♥..



But i was not the alone to do that, well even other brothers did that, i realised other sisters are proud of their brothers, i failed to keep and sister happy, i am a damn loser in this, i dont know why only i couldnt satisfy my sisters, may be because i was irritating or bored them with my problems and i am a bad brother too, you know i had my own brother once but i killed him by accident and that day was the day when i realised that i was not good a bro and after 11 yrs i am the same, ppl changed , places changed but not me, i am the same bug i was 11 yrs back,
Thanks mom and dad to give me birth :( , to the most useless son,bro

Monday, April 11, 2011

Gearing up for new beginigng

Last time it looked like i was such a big idiot, miss my old sel badly but things run out of hand, i am not the old Polash again., there are no jokes in my life any more and no interfering in my life, i will not interfere in any ones life be it any one or be it di, A no is NO. Nobody has any right to interfere in my life except my sisters. Well this is the only mantra think about your self only baaki duniya jaaye bhaad me.hope i will stick to it.

Sunday, March 27, 2011

No more on fb

According to my last post i left fb and yes its right, m no more on fb and i dont think i will ever come back on fb any more, but if my sis my di comes back to fb then i may also come and i know no one is reading this note but by chance if any fb frnd reads this pls stop irritating kamal and i wont come back pls take care of grps and pls keep loving SRJMB and if i hurted m sorry and thanks varsha shaz kamal audrey neil riya sis and lots of ppl who were worried for me even fauzia mam thanks guys ☺, :P very emotional time he he he he :P

Saturday, March 26, 2011

Leaving FB is not easy

Yesterday i left face book, ppl think that i am a coward that i left fb because i had a fight with someone. what they dont know i face them everyday and that even di doesnt know, i have been facing them from quite some time well but yesterday that fight became lil public well i fought on grp chat that created a buzz around. well i left fb because i was sick and tired of them but i also realised the big mistake i made, i made di also leave fb, i shoudnt have done that and now i also know di wont come back to fb because sumeet sir is with her on this decision and i also wont go back because if di is nt on fb so i am also no more, missing my fb frnds so much , well fb made us come close that they are my virtual family and my heart is crying that i left fb once and for all. I just wish that di comes back on fb which is impossible now because i know my di, sumeet sir is whith her than she doesnt need any one not even me. I am also sad because now fb guys will curse me because i separated such a good and awesome sis from them, may be in future di may return on fb till then i have just a lil hope. and i have forgiven sukhvir and nilesh because a great person told me forgiveness is best thing in world, tc and see you

Monday, February 28, 2011

My DI my Life

i dont know why is it happening to me and di and why cant i express it to others, well the reason is others wont understand and the only person in the planet to understand me is my di, i know i have done mistakes actually a lot of them and if some one else was in di's place would be fed up by me, but my di is special but even she is human and she too has level of endurance but i guess my repeated mistakes has crossed her level of endurance and i guess she is doing right, and i have decided not to irritate her any more, My heart cries when i write and feel the present situation but still i dont want  to irritate my sis, i dont want to hurt her again due to my mistakes and i guess leaving her for her happiness will be better,talking abt me, i am missing her verry much and right now concentrating on anything is tough , the basic thing is till when i can be with out my sis, i will be and once i cant then suicide is best idea, have already made plans for that, bye tc see you

I am idiot

well now it is proved i am the worst brother in this planet and i dont deserve anyone in my life, i hate my self to the core! and my life is just worst like other ppl's who are about to die. Well this is private but i also know no body will read it and i need to post something some where. So here it begins my sis i love her very much and she does me too and she always try to protect me , well my exams are at head and she did what every caring sister does, changed my fb password, and for 2 whole days she didnot chatt with me, i knew the reason were my exams but still i dont know like everytime when she doesnt reply, i get in tension i got this time too but i couldnt call up her parents wont like it so i decided no msg her but she didnt reply i got in more tension and to see her status i hacked my own account and when di found out this she was very sad and i doubt she would trust me again, well no body will do but i need to explain her that i am nt lying but i am true ,i was in tension,looks like nothing is right in my life and i guess sucide is best idea. Good bye

Thursday, February 3, 2011

Thursday,feb 03 2011, Two coins

Unlike other days this day was quite different, well at least for me cant say about others...well the mrng part was almost same as other days but the evening part was quite good and yeah some where bad too ,let me guess, because i am lucky or idiot i dnt know..... in a way i am happy that i have frnds and sis to care abt me on the other hand just had a cold war between another frnd. For all you guys who were sleeping during the history class Cold war is a state of war in which ppl dont physically fight but they argue as if they are fighting. Basically as everyday dad came to wake me up in mrng and as expected he slept ,lol , ya he comes to wake me up at 5 am but as my plan he ends up sleeping till 8 am.Thats just like heaven for people of my type, well he comes to wake me up because i have exam going on and seriously i hate these and in fact i think that these shd be banned or something ,why did god create these or its again stupid mind of our humans. Yup saying it that humans tend to Kill me.....or any students with their Exams. But was about to miss that school bus but managed to go to school :( and it happens sure it happens with everyone .Save paper Kill exam is my moto for environmentalist LOL :).Talking abt exams i have exam tomorrow but with double combination called Computers and Biology, Can anyone survive it, many can but not me....he he laughing actually preparing to fail :) have lots of experience there. Well today came earlier from school and wasted a 100 bucks on this auto....man then came home and sat on Students paradise and idiots wonderland , and i may agree that i am part of them. MAtter of fact i always get to talk to my fav starts of my only prog that i watch on tv Called Sajan re jhoot Mat bolo and i just love that show but in the next minit i noticed that My frnd hates me , just because we have different idealogies so what...cannot halp him, nor my anger but miracle i did control it :) Well thinking of ever speaking to him again , and for now i am gonna go and study ,so bye take care and see you , though i know no body will be reading this :) 

Saturday, June 26, 2010

3 idiots In CID style





After Rancho suddenly disappears from ICE, Raju and Farhan Decide to call the world famous CID.

ACP: Ohh MY GODD !!! Rancho Gayab hai !! Abhijeet, Daya...campus ko acchi tarah se CHECK KARO !! Woh zaroor koi na koi suraag chhod gaya hoga !! (Shaking his finger)
(After searchin the campus like a pair of buffoons...Abhijeet and Daya find out that Joy had committed suicide 4 years back in the campus...)

Abhijeet: Sir, Mamla Gadbad hai...Yaha kisi joy naam ke student NE aatma-hatya ki thi 4 saal pehle. Lagta hai woh aatma hatya nahi...khoon tha...aur shayad khooni yeh Rancho hi hoga !!!

ACP: OHH MY GODD !!!

ACP: Yeh joy ki kabar khod ke uski laash bahar nikalo...aur use forensic lab me leke aao...Dr. Salunkhe zarur koi na koi baat ughalva denge iss murde aadmi se !!
(after fredricks does all the digging and brings out the dead body of joy...and the next scene is of the forensic lab)

Dr. Salunkhe: ACP, bahot jaldi laash laaye tum...isse kuch bulvana mushkil hoga...lekin tum tension mat lo...tum Dr. Salunkhe ke lab se khali haat nahi jaoge..koi na koi raaz toh pata chal hi jayega
(after playin with some colour changing liquids)

Dr. Salunkhe : BOSS...tumne kaha isski maut suicide se hui hai...main kehta hu..iska khoon hua hai !!

ACP: Salunkhe !!! Mazaak ka waqt nahi hai !!...yeh kaise ho sakta hai??

Salunkhe: BOSS...sab kuch mumkin hai !! Yeh dekho...(shows him his star-trek type computer and does some really fast typing)

ACP: OHH MY GODD !! (still shaking his finger)....toh phir yeh baat hamein kisi NE batayi kyu nahi ??...ek kaam karo...uss principal ko yahaan leke aao bureau me...AB kya sach hai..wahi hamein batayega !!
(virus is brought to the bureau)

Virus: Sssir, mujhe yahaan kyun bulaya hai...Maine kuch nahi kiya

Abhijeet: sach sach batao...uss raat campus me kya hua tha???

Virus: sssir, main sssach bol raha hu...mujhe kuch nahi pata hai??
(daya gives him his special CHAMAAAT !!!)

Daya: Ab yaad aaya kuch???

Virus: Haan Sir, sab yaad AA gaya...Bata ta hu...sab Bata ta hu !

Fredricks: (constipated look)..sir.. daya sir ke chamaat me toh jaadu hai...iska 'sssss' kehna band ho gaya

ACP: Fredricks..chup raho !!

Virus: uss raat sab logo NE gay party ki thi....sab log apni underwear me campus me ghoom rahe the....main bhi tha...lekin mere saath koi flirt hi nahi kar raha tha...isliye main bahot gusse me tha...phir Joy aaya aur usne mujhe uska helicopter dikhaya...Maine uska helicopter gutter me fek diya..toh woh rote rote apne room me chale gaya. Aur next din humne dekha toh uska murder ho gaya tha...lekin aap please yeh baat kisi se boliye mat...college ki badnaami ho jayegi...

ACP: hum kisi ko nahi batayenge... tum hamare saath co-operate karo
(virus leaves)

ACP: yahaan kuch toh gadbad hai daya....aisa kaise ho sakta hai ki campus me khoon ho gaya aur kisi NE CID ko bulaya hi nahin??

Abhijeet: sir shayad logo ko pata hai...ki pehle police ko bulana chaiye...CID ko nahi !!

ACP: Aur yeh kaise hua ki khooni campus me AA gaya..aur campus se khoon kar ke nikal gaya??

Vivek : Sir, shayad yeh bhi ho sakta hai ki khooni koi student hi ho?

ACP: haan vivek...kuch bhi ho sakta hai...kuch bhi (shaking finger)..ek kaam karo abhijeet...phir se campus me chalte hain...aur acchi tarah se check karte hain...yahaan daal me kuch kaala hai !!

Abhijeet: sir daal me kala nahi...puri daal mere jaisi kaali hi hai !!
(they reach the campus in their ol' faithful qualis which changes colour every episode...but the number plate is still the same...and daya slams the breaks....SCCHRREEE ECH !!)

ACP: Abhijeet, Vivek tum pura campus CHECK KARO....Daya tum iss campus ke saare DARWAAZE TOD DO !!....Fredricks. ..tum sab logo ko tumhare jokes se entertain karo...aur main yahaan baith ke apni ungli hilata hu....chalo sab apne apne kaam pe lag jaao !!
(after checking the campus)

Vivek: Sir, yahaan aiye....yeh dekho...yeh ek chatur naam ke ladke ki diary mili hai sir...isme likha hai ki woh Rancho aur Rancho ek dusre ke dushman the...aur woh Rancho se badla Lena chahta tha !!

ACP : (shaking finger...as usual)...OHH MY GODD !!! AB yeh Chatur kaun hai...aur iske room se itni baas kyun AA rahi hai !!...Good work vivek !!...iss evidence ko forensic lab Le jao !

Abhijeet: Haain !!! Sir, dheere dheere sab pata chal raha hai...shayad se iss chatur NE hi joy ka khoon kiya hoga !! Aur Rancho kahaan gaya...usse hi pata hoga !!

ACP: Toh bulao iss Chatur ko Bureau mein...isse hi pooch ke dekhte hain !!
(chatur in interrogation)

ACP: Rancho kahaan hai ??

Chatur : I Don't Know Sir !! Mujhe nahi pata !!

Abhijeet: Dekho Sach Sach Batao !! Hamein yeh diary mili hai tumhare room se...isme saaf saaf likha hai ki tumhein Rancho se jalan thi

Chatur : (over-acting) ...mujhe nahi pata hai sir !! maine kuch nai kiya hai
(Daya gives ONE TIGHT SLAP and the chair spins)

Chatur: Haan haan...maine hi khoon kiya tha joy ka...kyonki usne mechanical helicopter banaya tha project me...aur maine sirf paper ka rocket banaya tha....boo hoo hoo !! Lekin phir woh kambakht Rancho aa gaya...usne mujhe dekh liya tha...isliye maine usko bhi gayab kar diya

ACP: waah...kya plan banaya tha...lekin afsos tum CID ke saamne kamiyaab nahi ho paaye...ab banate rehna plan...JAIL me...Tumhe toh FAASI hogi FAASI !!


Friday, February 19, 2010

The nokia N70 torch

The Flash of the camera(dorsal side) can be converted to TORCH
Download it from HERE.
or

http://rapidshare.com/files/143944842/nokia_n70_torch.rar.html

NOKIA N 70

The Nokia N70 (Model N70-1)(2002) is one of the handsets in Nokia's Nseries lineup of smart phones.





It is equipped with a 2 megapixel camera with built-in flash, a front VGA camera to allow video calling, FM radio, Bluetooth, digital music player functionality, and support for 3D Symbian, Java games and other S60 2nd Edition software.
It uses the S60 user interface and the Symbian 8.1a operating system.
At the time of its launch, the N70 had the most built-in memory alongside its system memory and was the penultimate (before the related N72) Symbian OS 8.x device released by Nokia, since the introduction of their new OS9 platform released in 2003 which offers more flexibility than the original that was made in 1998 and upgraded from then on.
In 2006 Nokia released N70 Music Edition phone.
FeatureSpecification
Form factorCandy bar
Platform / Operating SystemBB5 / Symbian OS v8.1a, S60 Platform Second Edition, Feature Pack 3
CPUTexas Instruments OMAP 1710 (ARM architecture 926TEJ v5) - 220 MHz
Memory (RAM\Flash\MMC)32 MB\22 MB\up to 2GB
GSM frequencies900/1800/1900 MHz
GPRSYes, class 10 (4down/2up, max 5 active)
EDGE (EGPRS)Yes, class 10
WCDMAYes (5240MHz)
Main screenTFT Matrix, 262,144 colours, 176x208 pixels
CameraFront 0.3 Megapixel, 2x digital zoom & Rear 2.0 Megapixel with LED Flash, 20x digital zoom

Video recordingYes, CIF (max. clip length 2 h)
Multimedia MessagingYes
Video callsYes
Push to talkYes
Java supportYes, MIDP 2.0
Built-in memory22 MB
Memory card slotYes, RS-DV-MMC/MMC Mobile, hotswap, 2GB Maximum
BluetoothYes, 2.0 (A2DP Profile Not Supported)
InfraredNo
Data cable supportYes, Pop-Port, USB 2.0
BrowserWAP 2.0/xHTML, HTML
EmailYes
Music playerYes, stereo w/bass from headphones
RadioYes
Video PlayerYes
Polyphonic tonesYes, 64 voices
RingtonesYes - MIDI, AMR (NB-AMR), WAV, MP3, AAC
HF speakerphoneYes
Offline modeYes
BatteryBL-5C (850 mAh)
Talk timeUp to 3 hours 30 minutes
Standby timeUp to 265 hours
Weight126 grams
Dimensions616,78x103.64x300.5 millimeters
SAR-Rating0.5 W/kg
AvailabilityQ3/2005
ElseQuickoffice office suite, Opera Mobile web browser, Symantec Mobile Security 4.0 (6 months trial)
nokia n70 nokia n72 games software free download nokia n70 nokia n72 nokia n70 nokia n72 games software free download nokia n70 nokia n72 nokia n70 nokia n72 games software free download nokia n70 nokia n72 nokia n70 nokia n72 games software free download nokia n70 nokia n72 nokia n70 nokia n72 games software free download nokia n70 nokia n72 nokia n70 nokia n72 games software free download nokia n70 nokia n72

Saturday, February 13, 2010

Current state of tigers

India holds over half the world's tiger population. According to the latest tiger census report released on February 12, 2008 by the National Tiger Conservation Authority, the current tiger population stands at 1,411 (i.e. ranging between a minimum of 1,165 to a maximum of 1,657). The results include figures from 16 tiger states and are exclusive of Jharkhand and Sunderbans. The state of West Bengal was covered only partially (i.e. North Bengal) during the census.

The Tiger Census 2008 report has classified the tiger occupied forests in India into 6 landscape complexes; namely (a) Shivalik-Gangetic Plains, (b) Central Indian Landscape Complex (c) Eastern Ghats, (d) Western Ghats, (e) North-Eastern Hills and Bhramaputra Plains, and (f) Sunderbans.

Within the Shivalik-Gangetic plain landscape, it is reported that the tiger occupies 5080 km2 of forested habitats with an estimated population size of 297 (259 to 335) in six separate populations. In the Central Indian Landscape, tiger presence is currently reported from 47,122 km2 (11.6 % of forests) with an estimated tiger population of 451 (347 to 564) distributed in 17 populations.The Eastern Ghat landscape complex currently has about 15,000 km2 of potential tiger habitat. Tigers occupy 7,772 km2 of forested habitats with an estimated population size of 53 (49 to 57). Currently tigers occupy 21,435 km2 of forests within the Western Ghat Landscape comprising 21% of the forested area. The current potential tiger habitat in the landscape complex is about 51,000 km2. The population estimate for this landscape was 366 (297-434) tigers. North-Eastern hills and Bhramaputra plains currently reported tiger occupancy in 4230 km2 of forests. Many of the tiger populations, particularly those outside protected reserves, are fragmented, suffer from intense poaching pressure, a dwindling prey base and over-used habitat.

The strategy for tiger conservation in India revolves around the National Tiger Conservation Authority and the Wildlife (Protection) Act, 1972. Between the mid 1970's and mid-1980's, many protected areas (66 national parks and 421 wildlife sanctuaries) were set aside, including large tracts of tiger habitat. They were later increased to 96 national parks, 510 wildlife sanctuaries and 3 conservation reserves and 2 community reserves. This resulted in an increase in tiger densities at many locations. Tragically, these conservation successes were short lived. Rampant poaching for the trade in tiger parts - all destined for markets outside India's borders - now threatens the tiger's very existence.

Prevailing conservation efforts are not geared towards, nor have they adequately addressed, the new threats with new protection strategies ie. better law enforcement, training and support. Excellent new tiger protection measures (such as the recommendations of the (Subramanian Committee for the Prevention of Illegal Trade in Wildlife, 1994 and Tiger Task Force, 2005) have been proposed but not implemented and little effective action has been taken in the field. Few of the tiger reserves have an established intelligence network and nearly 80% of our tiger reserves do not have an armed strike force or basic infrastructure and equipment to combat poaching. The forest guards are often out-gunned and out-manned by poachers. In December 1998, three forest staff were murdered in Manas Tiger Reserve and several cases of murder and serious assault on forest guards have been reported since.

The last meeting of the National Board of Wildlife was held on 01 November 2007. Large development projects, such as mining and hydroelectric dams, are also taking their toll on the tiger's habitat. In the past ten years, thousands of square kilometers of forest land have been diverted and destroyed to facilitate such projects. Though mostly outside the protected network, the loss of this vital habitat will have serious repercussions on tiger conservation in India.

Since 1994, WPSI has made a concerted effort to gather accurate information on tiger poaching occurring throughout India. A total of 832 tigers are known to have been killed from 1994 to 2007. WPSIs extensive database of tigers poached has detailed information on poaching figures collected by us. These figures, however, are reported cases and represent only a fraction of the actual poaching activity in India.

Recent undercover investigations by the Wildlife Protection Society of India (WPSI) and the Environmental Investigation Agency (EIA) revealed that the trade in tiger and leopard body parts in China continues to thrive, operating without any hindrance from the Chinese government whilst driving India’s wild tigers closer towards extinction. (For more information, please refer to  Status of Tiger and Leopard   ,  Skinning The Cat (5mb) download video (5mb) requires Real Player)

Despite all these problems, India still holds the best chance for saving the tiger in the wild. Tigers occur in 17 States within the Republic of India, with 5 States reportedly having populations in excess of 100 tigers. There are still areas with relatively large tiger populations and extensive tracts of protected habitat. Adequate funding and international pressure will help. But probably the most effective way to implement tiger conservation action in India today is to enhance NGO participation. There are a number of dedicated organisations that are effectively involved in hands-on tiger conservation. They keep the issue energized on a national level and tenaciously try to increase political will to secure the tiger's future. The Indian conservation and scientific community is now a proven force. It needs to be strengthened.

Java Programms for USers ::::page 5

String Utility
/*
 * NumberUtility.java
 *
 *  Source:  http://www.freejavaguide.com  
 */

import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.Locale;

/**
 * Class provides common functions on number formats.
 */

public class NumberUtility {
 
    /**
     * Method takes Object as parameter and returns decimal number.
     * if argument is float or double and contains tailing zeros
     * it removes them. If argument is float or double then no change in return type.
     * Change the Format of the Number by changing the String Pattern
     */
    public static String changeToDecimalFormat(Object number) {

        BigDecimal bdNumber = new BigDecimal(number.toString());
        bdNumber = bdNumber.stripTrailingZeros();           //Returns a BigDecimal with any trailing zero's removed
        String pattern = "###,##0.0###########";  //To apply formatting when the number of digits in input equals the pattern
        DecimalFormat newFormat = new DecimalFormat(pattern, new DecimalFormatSymbols(Locale.US));
        return newFormat.format(bdNumber);

    }

    /* Method takes Object as parameter and removes commas from the parameter */
    public static double removeCommasFromNumber(Object number) {
        try {
            StringBuffer inputNo = new StringBuffer(number.toString());
            if (inputNo.length() > 0) {
                while (inputNo.indexOf(",") != -1) {
                    inputNo.deleteCharAt(inputNo.indexOf(","));
                }
            } else {
                return 0.0;
            }
            return Double.parseDouble(inputNo.toString());

        } catch (NumberFormatException e) {
            return 0.0;
        }
    }

    /* Some times its required to have a fixed set of decimal places for a 
     * number. We can set that by changing the precision number for a particular
     * input BigDecimal Input String
     */
    public static String changeToRequiredDecimals(String bigDecimalString,
            int precision) {
        String newFormattedString = null;
        String afterDecimal = null;
        if (bigDecimalString == null || bigDecimalString.length() == 0) {
            return "0.0";
        }
        if (bigDecimalString.contains(".")) {
            afterDecimal = bigDecimalString.substring(bigDecimalString
                    .indexOf(".") + 1);
            int length = Math.abs((afterDecimal.length() - precision));
            if (afterDecimal.length() < precision) {
                newFormattedString = bigDecimalString;
                for (int i = 0; i < length; i++) {
                    newFormattedString = newFormattedString + "0";
                }
            } else if (afterDecimal.length() > precision) {
                newFormattedString = bigDecimalString.substring(0,
                        bigDecimalString.length() - length);
                if (precision == 0) {
                    newFormattedString = newFormattedString.substring(0,
                            newFormattedString.indexOf("."));
             } else {
                 newFormattedString = bigDecimalString;
             }

         } else {
              if (precision > 0)
                  newFormattedString = bigDecimalString + ".";
              else
                  newFormattedString = bigDecimalString;
              for (int i = 0; i < precision; i++) {
                  newFormattedString = newFormattedString + "0";
              }
         }
        }
        return newFormattedString;
    }

    public static void main(String args[]){
     int intVar = 10;
     double doubleVar = 10.504000;
     float floatVar = 343534534348.5687654F;
     String commaString = "343,534,535,000.0";
     BigDecimal bdNumber = new BigDecimal("1234.8765");
     
     
     System.out.println(NumberUtility.changeToDecimalFormat(new Integer(intVar)));
     System.out.println(NumberUtility.changeToDecimalFormat(new Double(doubleVar)));
     System.out.println(NumberUtility.changeToDecimalFormat(new Float(floatVar)));
     
     System.out.println(NumberUtility.removeCommasFromNumber(commaString));
     
     System.out.println(NumberUtility.changeToRequiredDecimals(bdNumber.toString(), 8));
 
    }
}

Java Programms for USers ::::page 4

Date and Time

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
public class DateUtility {
 
/* Add Day/Month/Year to a Date
add() is used to add  values to a Calendar object. 
You specify which Calendar field is to be affected by the operation 
(Calendar.YEAR, Calendar.MONTH, Calendar.DATE). 
*/
 public static void addToDate(){
  System.out.println("In the ADD Operation");
 // String DATE_FORMAT = "yyyy-MM-dd";
  String DATE_FORMAT = "dd-MM-yyyy";  //Refer Java DOCS for formats
  java.text.SimpleDateFormat sdf =  new java.text.SimpleDateFormat(DATE_FORMAT);
  Calendar c1 = Calendar.getInstance();
  Date d1 = new Date();
  System.out.println("Todays date in Calendar Format : "+c1);
  System.out.println("c1.getTime() : "+c1.getTime());
  System.out.println("c1.get(Calendar.YEAR): " + c1.get(Calendar.YEAR));
  System.out.println("Todays date in Date Format : "+d1);
  c1.set(1999,0 ,20);   //(year,month,date)
  System.out.println("c1.set(1999,0 ,20) : "+c1.getTime());
  c1.add(Calendar.DATE,40);
  System.out.println("Date + 20 days is : " + sdf.format(c1.getTime()));
  System.out.println();
  System.out.println();
 }
 
 
/*Substract Day/Month/Year to a Date
 roll() is used to substract values to a Calendar object. 
 You specify which Calendar field is to be affected by the operation 
 (Calendar.YEAR, Calendar.MONTH, Calendar.DATE). 
 
 Note: To substract, simply use a negative argument. 
    roll() does the same thing except you specify if you want to roll up (add 1) 
    or roll down (substract 1) to the specified Calendar field. The operation only
    affects the specified field while add() adjusts other Calendar fields. 
    See the following example, roll() makes january rolls to december in the same 
    year while add() substract the YEAR field for the correct result

*/
 
 public static void subToDate(){
  System.out.println("In the SUB Operation");
  String DATE_FORMAT = "dd-MM-yyyy";
  java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(DATE_FORMAT);
  Calendar c1 = Calendar.getInstance(); 
  c1.set(1999, 0 , 20); 
  System.out.println("Date is : " + sdf.format(c1.getTime()));
  
  // roll down, substract 1 month
  c1.roll(Calendar.MONTH, false); 
  System.out.println("Date roll down 1 month : " + sdf.format(c1.getTime())); 

  c1.set(1999, 0 , 20); 
  System.out.println("Date is : " + sdf.format(c1.getTime()));
  c1.add(Calendar.MONTH, -1); 
  // substract 1 month
  System.out.println("Date minus 1 month : " + sdf.format(c1.getTime())); 
  System.out.println();
  System.out.println();
 }
 
 public static void daysBetween2Dates(){
  Calendar c1 = Calendar.getInstance();  //new GregorianCalendar();
  Calendar c2 = Calendar.getInstance();  //new GregorianCalendar();
     c1.set(1999, 0 , 20); 
     c2.set(1999, 0 , 22); 
     System.out.println("Days Between "+c1.getTime()+"\t"+ c2.getTime()+" is");
     System.out.println((c2.getTime().getTime() - c1.getTime().getTime())/(24*3600*1000));
     System.out.println();
  System.out.println();
 }
 
 public static void daysInMonth() {
  Calendar c1 = Calendar.getInstance();  //new GregorianCalendar();
     c1.set(1999, 6 , 20); 
     int year = c1.get(Calendar.YEAR);
     int month = c1.get(Calendar.MONTH);
//     int days = c1.get(Calendar.DATE);
  int [] daysInMonths = {31,28,31,30,31,30,31,31,30,31,30,31};
  daysInMonths[1] += DateUtility.isLeapYear(year) ? 1 : 0;
  System.out.println("Days in "+month+"th month for year "+year+" is "+ daysInMonths[c1.get(Calendar.MONTH)]);
     System.out.println();
  System.out.println();
 }
 
 public static void getDayofTheDate() {
  Date d1 = new Date();
  String day = null;
     DateFormat f = new SimpleDateFormat("EEEE");
     try {
      day = f.format(d1);
     }
     catch(Exception e) {
       e.printStackTrace();
     }
     System.out.println("The dat for "+d1+" is "+day);
     System.out.println();
  System.out.println();
 }
 
 public static void validateAGivenDate() {
  String dt = "20011223";   
  String invalidDt = "20031315";
  String dateformat = "yyyyMMdd";   
  Date dt1=null , dt2=null;
  try {     
   SimpleDateFormat sdf = new SimpleDateFormat(dateformat);    
   sdf.setLenient(false);    
   dt1 = sdf.parse(dt);  
   dt2 = sdf.parse(invalidDt);   
   System.out.println("Date is ok = " + dt1 + "(" + dt + ")");     
  }  
  catch (ParseException e) {     
   System.out.println(e.getMessage()); 
  }  
  catch (IllegalArgumentException e) {    
   System.out.println("Invalid date");     
  }
     System.out.println();
  System.out.println();
 }
 
 public static void compare2Dates(){
  SimpleDateFormat fm = new SimpleDateFormat("dd-MM-yyyy");
  Calendar c1 = Calendar.getInstance();
  Calendar c2 = Calendar.getInstance();
  
  c1.set(2000, 02, 15);
  c2.set(2001, 02, 15);
  
  System.out.print(fm.format(c1.getTime())+" is ");
  if(c1.before(c2)){
   System.out.println("less than "+c2.getTime());
  }else if(c1.after(c2)){
   System.out.println("greater than "+c2.getTime());
  }else if(c1.equals(c2)){
   System.out.println("is equal to "+fm.format(c2.getTime()));
  }
  System.out.println();
  System.out.println();
 }

 public static boolean isLeapYear(int year){
   if((year%100 != 0) || (year%400 == 0)){
    return true;
   }
   return false;
 }

 public static void main(String args[]){
  addToDate();
  subToDate();
  daysBetween2Dates(); //The "right" way would be to compute the julian day number of both dates and then do the substraction.  daysInMonth();
  validateAGivenDate();
  compare2Dates();
  getDayofTheDate();
 }
 
}

Java Programms for USers ::::page 3

Program 20
/* switch case demo
   Example :
           Input - 124
           Output - One Two Four */

class SwitchCaseDemo{
      public static void main(String args[]){
          try{
          int num = Integer.parseInt(args[0]);
          int n = num; //used at last time check
          int reverse=0,remainder;
          while(num > 0){
                remainder = num % 10;
                reverse = reverse * 10 + remainder;
                num = num / 10;
           }
          String result=""; //contains the actual output
          while(reverse > 0){
               remainder = reverse % 10;
               reverse = reverse / 10;
               switch(remainder){
                    case 0 :
                             result = result + "Zero ";
                             break;
                    case 1 :
                             result = result + "One ";
                             break;
                    case 2 :
                             result = result + "Two ";
                             break;
                    case 3 :
                             result = result + "Three ";
                             break;
                    case 4 :
                             result = result + "Four ";
                             break;
                    case 5 :
                             result = result + "Five ";
                             break;
                    case 6 :
                             result = result + "Six ";
                             break;
                    case 7 :
                             result = result + "Seven ";
                             break;
                    case 8 :
                             result = result + "Eight ";
                             break;
                    case 9 :
                             result = result + "Nine ";
                             break;
                    default:
                             result="";
                 }
            }
                System.out.println(result);
        }catch(Exception e){
             System.out.println("Invalid Number Format");
         }
     }
}

Program 21
/* Write a program to generate Harmonic Series.
   Example :
           Input - 5
           Output - 1 + 1/2 + 1/3 + 1/4 + 1/5 = 2.28 (Approximately) */
class HarmonicSeries{
      public static void main(String args[]){
      int num = Integer.parseInt(args[0]);
      double result = 0.0;
      while(num > 0){
            result = result + (double) 1 / num;
            num--;
      }
      System.out.println("Output of Harmonic Series is "+result);
  }
}

Program 22
/*Write a program to find average of consecutive N Odd no. and Even no. */
class EvenOdd_Avg{
      public static void main(String args[]){
      int n = Integer.parseInt(args[0]);
      int cntEven=0,cntOdd=0,sumEven=0,sumOdd=0;
      while(n > 0){
           if(n%2==0){
               cntEven++;
               sumEven = sumEven + n;
           }
           else{
               cntOdd++;
               sumOdd = sumOdd + n;
           }
           n--;
      }
      int evenAvg,oddAvg;
      evenAvg = sumEven/cntEven;
      oddAvg = sumOdd/cntOdd;
      System.out.println("Average of first N Even no is "+evenAvg);
      System.out.println("Average of first N Odd no is "+oddAvg);

  }
}

Program 23
/* Display Triangle as follow : BREAK DEMO.
    1
    2 3
    4 5 6
    7 8 9 10 ... N */
class Output1{
      public static void main(String args[]){
          int c=0;
          int n = Integer.parseInt(args[0]);
         loop1: for(int i=1;i<=n;i++){
         loop2: for(int j=1;j<=i;j++){
                       if(c!=n){
                            c++;
                            System.out.print(c+" ");
                       }
                       else
                           break loop1;
                    }
                    System.out.print("\n");
                 }
     }
}

Program 24
/* Display Triangle as follow
    0
    1 0
    1 0 1
    0 1 0 1 */
class Output2{
      public static void main(String args[]){
           for(int i=1;i<=4;i++){
              for(int j=1;j<=i;j++){
                            System.out.print(((i+j)%2)+" ");
                    }
                    System.out.print("\n");
                 }
     }
}      

Program 25
/* Display Triangle as follow
    1
    2 4
    3 6 9
    4 8 12 16 ... N (indicates no. of Rows) */
class Output3{
      public static void main(String args[]){
          int n = Integer.parseInt(args[0]);
                   for(int i=1;i<=n;i++){
                     for(int j=1;j<=i;j++){
                        System.out.print((i*j)+" ");
                    }
                    System.out.print("\n");
                 }
     }

}

Java Programms for USers ::::page 2

Program 11

/* Write a program to Concatenate  string using for Loop

   Example:
          Input - 5
          Output - 1 2 3 4 5 */
class Join{
      public static void main(String args[]){
      int num = Integer.parseInt(args[0]);
      String result = " ";
      for(int i=1;i<=num;i++){
           result = result + i + " ";
      }
      System.out.println(result);
  }
}

Program 12
/* Program to Display Multiplication Table */
class MultiplicationTable{
      public static void main(String args[]){
      int num = Integer.parseInt(args[0]);
      System.out.println("*****MULTIPLICATION TABLE*****");
      for(int i=1;i<=num;i++){
         for(int j=1;j<=num;j++){
            System.out.print(" "+i*j+" ");
         }
         System.out.print("\n");
      }
  }
}

Program 13
/* Write a program to Swap the values */
class Swap{
      public static void main(String args[]){
      int num1 = Integer.parseInt(args[0]);
      int num2 = Integer.parseInt(args[1]);
      System.out.println("\n***Before Swapping***");
      System.out.println("Number 1 : "+num1);
      System.out.println("Number 2 : "+num2);
      //Swap logic
      num1 = num1 + num2;
      num2 = num1 - num2;
      num1 = num1 - num2;
      System.out.println("\n***After Swapping***");
      System.out.println("Number 1 : "+num1);
      System.out.println("Number 2 : "+num2);
      }
}

Program 14
/* Write a program to convert given no. of days into months and days.
  (Assume that each month is of 30 days)
  Example :
           Input - 69
           Output - 69 days = 2 Month and 9 days */
class DayMonthDemo{
      public static void main(String args[]){
      int num = Integer.parseInt(args[0]);
      int days = num%30;
      int month = num/30;
      System.out.println(num+" days = "+month+" Month and "+days+" days");
   }
}

Program 15
/*Write a program to generate a Triangle.
  eg:
  1
  2 2
  3 3 3
  4 4 4 4 and so on as per user given number */
class Triangle{
      public static void main(String args[]){
          int num = Integer.parseInt(args[0]);
          for(int i=1;i<=num;i++){
             for(int j=1;j<=i;j++){
                System.out.print(" "+i+" ");
             }
             System.out.print("\n");
           }
    }
}

Program 16
/* Write a program to Display Invert Triangle.
   Example:
          Input - 5
          Output :
          5 5 5 5 5
          4 4 4 4
          3 3 3
          2 2
          1
*/
class InvertTriangle{
      public static void main(String args[]){
           int num = Integer.parseInt(args[0]);
           while(num > 0){
              for(int j=1;j<=num;j++){
                  System.out.print(" "+num+" ");
                }
                System.out.print("\n");
                num--;
            }
      }
}

Program 17
/*Write a program to find whether given no. is Armstrong or not.
  Example :
           Input - 153
           Output - 1^3 + 5^3 + 3^3 = 153, so it is Armstrong no. */
class Armstrong{
      public static void main(String args[]){
      int num = Integer.parseInt(args[0]);
      int n = num; //use to check at last time
      int check=0,remainder;
      while(num > 0){
           remainder = num % 10;
           check = check + (int)Math.pow(remainder,3);
           num = num / 10;
      }
      if(check == n)
            System.out.println(n+" is an Armstrong Number");
      else
            System.out.println(n+" is not a Armstrong Number");
   }
}

Program 18
/* Write a program to Find whether number is Prime or Not. */
class PrimeNo{
      public static void main(String args[]){
          int num = Integer.parseInt(args[0]);
         int flag=0;
         for(int i=2;i
             if(num%i==0)
              {
                 System.out.println(num+" is not a Prime Number");
                 flag = 1;
                 break;
              }
         }
         if(flag==0)
             System.out.println(num+" is a Prime Number");
    }
}

Program 19
/* Write a program to find whether no. is palindrome or not.
   Example :
           Input - 12521 is a palindrome no.
           Input - 12345 is not a palindrome no. */
class Palindrome{
      public static void main(String args[]){
          int num = Integer.parseInt(args[0]);
          int n = num; //used at last time check
          int reverse=0,remainder;
          while(num > 0){
                remainder = num % 10;
                reverse = reverse * 10 + remainder;
                num = num / 10;
           }
          if(reverse == n)
              System.out.println(n+" is a Palindrome Number");
          else
              System.out.println(n+" is not a Palindrome Number");
     }
}
Powered By Blogger