Sunday, November 26, 2017

How to iterate Object Array with custom data type.

I went through an interview and interviewer asked what will print if I have loop through the object array, where this array contains 3 values  in first index array[0] it has string then arr[1] integer and third arr[2] is class type value.

Let me give you an example with c# console application program.




As you have noticed the output for third array is like "NamespaceName.ClassName".
Here you won't be able to get the id or name from that object. If you want to get the name from that object in this  case please see below example.

public static class PracticalExample1 {
    public static void Method1() {
    var obj = new object[3];
    obj[0] = 1;
    obj[1] = "Ramesh";
    obj[2] = new Employee {
                 Name = "Vijay"
             };
    foreach (var o in obj) {
       Console.WriteLine(o);
    }
 } }

public class Employee {
     public int Id { get; set; }
     public string Name { get; set; }
 
     // By default you can override 3 method in any custom class named ( 1. Equals() 2. GetHasCode() and 3. ToString() )
     // I have to use override the ToString() method to get the name from this class.
     public override string ToString() {
         return this.Name;
     }
 }


Now well be able to fetch the name from the custom class object (Employee class).


Garbage Collector Undestanding

In this article I have shared some points related to .NET Garbage Collector as follows.. 1. Destructor 2. Idisposable interface and Pattern 3. Using block 4. Dispose vs Finalize 5. GC (Garbage Collector) Some key points to remember about GC. 1. GC is a.net framework thread, which run in background. 2. GC check for all the objects which has destructor, if found then it will place them in another list named as Finalization List. 3. GC create two thread, The first thread:
  1. Which are reachable list (All reachable object are clared one after one from the heap list and this it reclaim the memory)
  2. Another which are not (which are not reachable is known as finalization list)
In 2nd thread,
  1. which reads the finalization lists and calls, the each object finalized in separate object.
How does GC Runs when:
  • Gen 0 Object reach ~256KB keep
  • Gen 1 objects reach ~2Meg
  • Gen 2 objects reach ~10meg
  • System memory is low.
What is managed and unmanaged code?
  1. .NET c#,vb Classes are known as Managed Object. All those which has been created using .net language, gc treated as a managed code.
  2. (vb6, com ,windows, connection, files) all these type of code or we can say non .net developed code are known as unmanaged code.
What is finalize method? Note: If your classes is using unmanaged code then start implement finalise method. If your classes is not using unmanaged code then forget about Finalize method call, don't do this at all because it's not required. How garbage collector call the Finalize method. As we all know that we have 3 gen where memory got collected. GC frequently check the Generation-0 bucket.
  1. Checking frequency in the Finalize queue is very less as compare to gen (0,1,2,)      bucket.
  2. By defining the destructor you can define the finalize method.
  3. When Code is complied the distructor will convert into the finalize    automatiocally.  gc treat this as a finalize, Moreover, in .net reflector you can see that after compilation the destructor convert into finalize method.
  4. We can not call directly finalize method because developer don't have any access to finalize .
  5. Only GC has the rights and facility to call the finalize method.
Advantages of using the GC. (Suppose a application uses a costly external resources, then a way to explicitly release the resource before the garbage collector frees the object.  a ->  Define a method to release allocated resources. (mscorlib.dll) Characteristics of Destructor
  1. Destructors (~) cannot be defined in Structs.
  2. Destructors (~) are only used with classes.
  3. Destructor cannot be inherited or overloaded.
  4. Destructor does not take modifiers or have parameters.
  5. Destructor cannot be called. They are invoked automatically.
  6. An instance becomes eligible for destruction when it is no longer possible for any code to use the instance.
  7. The Programmer has no control over when destructor is called because this is determined by Garbage Collector.
  8. Destructor is called when program exits.
  9. Execution of the destructor for the instance may occur at any time after the instance becomes eligible for destruction.
  10. Destructor implicitly calls Finalize on the base class of object.
  I have taken some references from c-sharpcorner.com, stackoverflow, codeproject, pluralsight and through some youtube videos.

Tuesday, October 10, 2017

Don't take bike on rent online from any website of Delhi (www.wheelstreet.com) TrueConnect

                         Don't rent bike from Delhi specially from WheelStreet. 

Reason to not let the bike

1. No good quality Helmet.
2. No good services
3. Fail on commitments/Promises.
4. They don't have latest bullets models.
5. They will not refund your token amount even if they fail to provide you bike.
6. No Guarantee to get back your deposit amount because they will make some nonsense excuses. 

Note: If you want to rent bike then first inspect bike by your own and make sure that you have new engine oil because they are very good in making fake promises.

If you want to know the reason for this then go through my bellow experience with them. Remember, You will be called wise if you learn from other mistakes else no one would be able to help you to get fooled.

We are 6 friends who decided to take 3 bike on rent online with token amount of 5 k prior 15 days to Ladakh trip from one of the disgraced company named  https://www.wheelstreet.com/. When we reached Delhi one day before the trip, We went to their office and said we have advanced booking for 3 bullets (350 cc with the latest model-2017).

See the below conversation with them.

Customer Care: Go to our shop and asked for the bike they will give you 3 bullet with latest model-2017.

Us: We Reached to shop asked for the bike one day before our Ladakh trip.

Vendor: We have only one bike which is 2013 model.

Us:  Now what to do with whom we gonna talk. We need 3 bike and it's your responsibilities to provide bikes for what we have paid.

Vendor : Talk to customer we can't help you out.

CC: They said, We have only one bike available for other two you have to wait.

Us: We said we are struggling from last 2 hours now we want our money back we don't  want to avail service from you, it's your failure not our so give it back but they refuse to give back and finally after 4 hours they said we have arranged two more bike and asked to go another location near in () and again we got 2013 model bullet one is 350 and another is 500 cc). We asked them to give 2017 as what we deal for.

CC: They said we don't have bike now you can manage by your own, we can't provide you 2017 model and also the token amount.

We all were angry , said and help less because we have only two option either accept those bike or lose your token amount.

This is not the end yet, Now I said 2013 model bike's battery is not good at all please change the battery else it will create problem in hills(Ladakh,Jammu kashmir and all) bcz of temperature.

They refuse to change the battery. So, we have to accept it.. This is not the end of our problem.

When we reached to Ambala we halt for 30 minutes after that my bike (500cc) was not starting, some how we manage got one local bullet mechanic and he said the battery is been discharged completely. Secondly, the engine oil is very less how could you go to Ladakh with this much of engine oil, your engine will bust or damage due to insufficient oil.

When we reached Jammu after night halt again same battery problem and that day due to Eid no shops were open we roaming around the jammu to get battery and due to this shit whole day got waste.

Still this is not end yet.
When we came back to Delhi and giving back to vendor they asked the royal en-field mechanic for inspections and annoyingly they said bike need service ,engine got bust have to repair bike and it will cost 20 k. They know that we have flight on same day and we can't wait for longer they were not talking to use nicely, they know that we are outsiders and we can't even touch their hair.

And Earlier manager of wheelstreet said pay from your pocket and when we will back he will reclaim the charges but he final output was we have to let our 15 k deposit and 3 k battery and all extra expenses on bike we paid from our pocket.


As per our experience I will suggest everyone to not led the bike online from any website. Just go to shop one day before your trip and take bike accordingly else you will be always in loss.




Thursday, August 3, 2017

My Ladakh Experience

Nature is truly mesmerizing and magic is spread everywhere. You just have to gaze the nature and what you can only do is believe.
Had not seen a clearer sky, water more blue, hills so majestic and snow so white. Seems like one of the places straight out of your dreams, Ladhak is truly a beauty with nature in its most raw and untouched forms. 
If you think paradise does not exists, pay a visit to Ladakh once which speaks for itself. You cannot realize its enchanting beauty until you see it for yourself.

#Glimpse #Nature #Ladakh #Road #Trip #From#Delhi#to#Ladakh

























 

Wednesday, November 2, 2016

12 Best Google Chrome Extensions

1. Adblock Plus
2. uBlock Origin
3. Blur
4. Hola Better Internet
5. LastPass
6. WOT
7. Click & Clean
8. Save to Pocket
9. Awesome Screenshot
10.Chrome Remote Desktop
11.StayFocused
12.Pixlr Editor

Friday, July 18, 2014

How to use GCM android notificaiton using c#...

Hello All now i m going to tell you all about how to send GCM notification..

Saturday, September 7, 2013

Top 10 Hackers in World






Vladimir Leonidovitch Levin is a Russian-born Jewish individual famed for his involvement in the attempt to fraudulently transfer US$10.7 million via Citibank's computers. Wikipedia
Born: Russia











Albert Gonzalez is a computer hacker and computer criminal who is accused of masterminding the combined credit card theft and subsequent reselling of more than 170 million card and ATM numbers from 2005 through 2007—the biggest such fraud in history. Gonzalez’s team used SQL injection techniques to create malware backdoors on several corporate systems in order to launch packet-sniffing (specifically, ARP Spoofing) attacks, allowing him to steal computer data from internal corporate networks









AKA Kevin Lee Poulsen
Born: 1965
Birthplace: Pasadena, CA
Gender: Male
Race or Ethnicity: White
Sexual orientation: Straight
Occupation: Hacker, Journalist
Nationality: United States
Executive summary: Hacker and journalist
When Kevin Poulsen was 17, he used his primitive TRS-80 "color computer" to hack into the US Department of Defense's Arpanet, the predecessor of the Internet. He wasn't prosecuted. He was later a computer programmer at SRI and Sun Microsystems, and worked as a consultant testing Pentagon computer security.



Robert Tappan Morris (born November 8, 1965) is an American computer scientist, best known for creating the Morris Worm in  1988, considered the first computer Worm on the Internet and subsequently becoming the first person convicted under the Computer Fraud and Abused
He went on to co-found the online store Viaweb, one of the first web-based applications, and later the funding firm Y combinator —both with Paul Graham. He is a tenured  professor in the department of Electrical Engineering and Computer Science at the Masschussetts Institute of Technology.
His father was the late Robert Morris,a coauthor of UNIX and the former chief scientist at the National Computer Security Center, a division of the National Security Agency
(NSA).





MafiaBoy was the Internet alias of Michael Demon Calce, a high school student from West Island, Quebec, who launched a series of highly publicized denial-of-service attacks in February 2000 against large commercial websites including Yahoo!, Fifa.com, Amazon.com, Dell, Inc., E*TRADE, eBay, and CNN.[1] He also launched a series of failed simultaneous attacks against 9 of the 13 root name servers








Kevin Mitnick, the world’s most famous (former) hacker will be the keynote guest speaker at Voxeo’s Customer Summit, June 21-23 at the Hard Rock Hotel at Universal Resorts Orlando.

Kevin drew headlines and a prison sentence in the summer of 1999 related to a 2-year computer hacking spree in which he gained unauthorized access to computer systems at some of the largest corporations on the planet and penetrated some of the most resilient computer systems ever developed. Today, he has his own consulting firm, and is one of the world’s most sought out experts in exposing the vulnerabilities of complex operating systems and telecommunications devices.
Mitnick gained unauthorized access to his first computer network in 1979, at 16, when a friend gave him the phone number for the Ark, the computer system Digital Equipment Corporation (DEC) used for developing their RSTS/E operating system software. He broke into DEC’s computer network and copied their software, a crime he was charged with and convicted of in 1988. According to the U.S. Department of Justice, Mitnick gained unauthorized access to dozens of computer networks while he was a fugitive. He used cloned cellular phones to hide his location and, among other things, copied valuable proprietary software from some of the country’s largest cellular telephone and computer companies




George Francis Hotz (born October 2, 1989), alias geohot, is an American hacker known for unlocking the iPhone, allowing the phone to be used with other wireless carriers, contrary to AT&T and Apple's intent.[1][2] Additionally, he developed the limera1n jailbreak tool, which used his limera1n bootrom exploit. He is also noted for hacking the PlayStation 3 and subsequently being sued by and settling with Sony.





Adrian Lamo is a Colombian-American threat analyst and hacker. He used coffee shops, libraries and internet cafés as his locations for hacking. Apart from being the homeless hacker, Lamo is widely-known for breaking into a series of high-profile computer networks, which include The New York Times, Microsoft, Yahoo!, and MCI WorldCom. In 2002, he added his name to the The New York Times’ internal database of expert sources and utilized LexisNexis account to conduct research on high-profile subjects.
For his intrusion at The New York Times, Lamo was ordered to pay approximately $65,000 in damages and was sentenced to six months house arrest at his parents’ home, with an additional two years of probation. In June 2010, Lamo disclosed the name of Bradley Manning to U.S. Army authorities as the source of the July 12, 2007 Baghdad airstrike video leak to Wikileaks. Lamo is presently working as a threat analyst and donates his time and skills to a Sacramento-based nonprofit organization.





In 2002, an exceptionally odd message appeared on a US Army computer screen: “Your security system is crap,” it read. “I am Solo. I will continue to disrupt at the highest levels.” It was later identified as the work of Scottish systems administrator, Gary McKinnon, who was accused of perpetrating the “biggest military computer hack of all time”. He is accused of hacking into 97 United States military and NASA computers over a 13-month period between, using the name ‘Solo’.
The US authorities claim he deleted critical files from operating systems, which shut down the United States Army’s Military District of Washington network of 2,000 computers for 24 hours. After the September 11 attacks in 2001, he deleted weapons logs at the Earle Naval Weapons Station, rendering its network of 300 computers inoperable and paralyzing munitions supply deliveries for the US Navy’s Atlantic Fleet. He is also accused of copying data, account files and passwords onto his own computer.
In November 2002, McKinnon was indicted by a federal grand jury in the Eastern District of Virginia. The indictment contained seven counts of computer-related crime, each of which carried a potential ten-year jail sentence. The court had recommended that McKinnon be apprehended to the United States to face charges of illegally accessing 97 computers, causing a total of $700,000 in damage. Even more interesting are McKinnon’s motives for the large scale hackings, which he claims were in search of information on UFOs. He believed the US government was hiding such information in its military computers.




16-year-old black hat hacker Jonathan James, became the first juvenile imprisoned for cybercrime. James gained his notoriety by implementing a series of successful intrusions into various systems. In an anonymous PBS interview, he professes, “I was just looking around, playing around. What was fun for me was a challenge to see what I could pull off.”
James’ major intrusions targeted high-profile organizations such as NASA and the Department of Defense. He cracked into NASA computers, stealing software worth approximately $1.7 million. He also hacked into the Defense Threat Reduction Agency and intercepted over 3,000 highly secretive messages passing to and from the DTRA employees, while collecting many usernames and passwords.
Also known as “c0mrade,” James committed suicide using a gun, On May 18, 2008, at the age of 25. His suicide was apparently motivated by the belief that he would be prosecuted for crimes he had not committed. “I honestly, honestly had nothing to do with TJX,” James wrote in his suicide note, “I have no faith in the ‘justice’ system. Perhaps my actions today, and this letter, will send a stronger message to the public. Either way, I have lost control over this situation, and this is my only way to regain control.”

world’s 86 old female gymnast

Friday, August 2, 2013

Fruits In Shape Of Women!!!

Fruit which is known as Nareepol....



he Nariphon , also known as Makaliphon is a tree in Buddhist mythology which bears fruit in the shape of young female creatures. The maidens grow attached by their head from the tree branches.This tree grows at the Himaphan, a mythical forest where the female fruits are enjoyed by the Gandharvas who cut the fruits and take them away.
The Nariphon is also mentioned in the Vessantara Jataka in which Indra placed these trees around the grove where the Bodhisattva Vessantara meditated.


Sunday, June 23, 2013

How to install Android for your PC




1       install VMware Player.
2     Download this file  android-x86-vm-20120130.iso.gz file and extract on your computer.
3    Create a virtual machine and give a path for above file location
4      Now you can set disk location to save
a.       Android os partition take near about 250mb of disk space.
5     Once completed the task...you boot to a GRUB menu. Select the installation link to get start.
a.       Select (Installation – install android-x86 to hard disk)


6     Create?modify partitions:
          a.       Select  {New}
          b.      Choose {primary}
          c.       Accept default
          d.      Select {Bootable} to add the “Boot” flag to the partition.
          e.      Select {Write} and  complete partition setup.
7     Now finally quit the editor.
8    In the “Partition Choose” window. There an option like “Install android to sda1Linux”. Then press enter
9     Select ext3 in “Choose filesystem” window. If it ask for format then confirm it and move to further step
10   If you want to leave the drive as read-only. Accept the default and select no when it ask you if wnt to set as read only.
11.   Reboot the vmware player
12.   Now you finally see the android screen. It will take some time to start
13.  No click on “I finished Installing” rigth down side...


If you like then plz comment and if you face any problem then also plz share!!

Tuesday, May 28, 2013

Tips for men for a healthy life!!!



  • Eat healthy. Healthy foods give you energy and let you away from certain diseases. Focus on fruits and vegetables, grains, and low-fat or fat-free milk products.
  • Stay at a healthy weight. Being overweight can raise your risk of diabetes, high blood pressure, heart disease, and stroke.
  • Get Exercise. Regular exercise is one of the most important things you can do for your health.
  • Be smoke-free. Smoking is a way to many of the leading causes of death, including cancer, lung disease, and stroke. If you smoke, quit today! Also, avoid secondhand smoke.
  • Take any medications you need. Many deaths could be prevented each year by taking medications properly. follow doctor's instructions for all medications, including those that help to control conditions like high blood pressure and diabetes.
  • Avoid heavy drinking. Heavy drinking can lead to many problems, including high blood pressure, various cancers, psychological problems, and accidents. For men 65 and younger, drinking in moderation means no more than two drinks per day. Men older than 65 should have no more than one drink a day.
  • Manage stress. Balancing work and family obligations can be challenging. But it's important to protect your mental and physical health.
  • Get enough sleep. Not getting enough sleep can affect your mood and your health.
  • Know your risks. Learn how your lifestyle affects your risk of health problems. and men who have sex with men should talk with their doctors about particular concerns. 
  • Stay safe. Safety means many things, like wearing seatbelts and helmets, having working smoke detectors, and following safety rules at work. It also means using condoms, washing your hands, taking care of your teeth, and wearing sunscreen.

Sunday, May 19, 2013

IPL 6 Records Stats

  1. At Now Totals Sixes in IPL6 2013 - 605 Sixes
  2. At Now Totals fours in IPL6 2013 - 11 138  runs from  boundary (fours)
  3. At  Wickets IPL6 2013 - 795  Wickets  
  4. At Now total Dot Balls IPL6 2013 -6164 Dot Balls (Most Dot Balls thrown by DALE STAN )
  5. At Now total Fifties in IPL6 2013 - 88  Fifties
  6. At Now total Hunreds in IPL6 2013 - 4 Hunreds (Shane Watson, Chris Gayle, suresh raina, David Miller)
  7. At Now Fastest Ball in IPL6 2013    - 153.48 KPH ,  KPH DALE STAN (SH)  ,
  8. At Now Totals Runs  in IPL6 2013  - 17,994 Runs
  9. at now IPL  first highest individual runs by batsmen:Chris Gayle(RCB) 175 Runs Notout,66 Balls,13 Fours,17 sixes,265.15 Strike Rate
  10. At now IPL 6 Largest Victory by Wickets Match No 11-Kings XI Punjab 138 vs  Chennai Super Kings 139/0 (17.2/20 ov)
    Chennai Super Kings won by 10 wickets 
  11. Team highest Runs- In this Pepsi IPL6 2013, Made  highest Runs Mumbai Indians team  209/5 against Delhi Daredevils Team (10th match 09-04-2013)
  12. At now Totals Super Over : 2Mtach (RCB vs sh) and (RCB vs DD)
  13. At now Totals Hat Trick-  2 times 3 continuous Wickets 
  14. At Longest Six :119  M (Hitting by Chris Gayle)
  15. At Now Fastest Fifty: 50Runs/17 balls (Hitting by Chris Gayle)
  16. At Now 6 overs :67/0 (By CSK) against KKR
  17. At now Team Lowest score: Chennai Super Kings 79/10 15.2 ov)  05-05-2013
  18. maiden over IPL 2013    - Bowling  Thrown 23  Maiden  Overs
(A)1st maiden over 1st match in this  ipl 2013 goes to Irfan Pathan (2overs 1 maiden 15 runs) against Kolkata Knight Riders
(B)2nd maiden over 10th match  again goes to  Irfan Pathan against Mumbai indian).
 
 

Tuesday, April 9, 2013

World's Richest Person In 2013!!!

 
  • Charlos slim Helu $74B

                                                                           Bill Gates $56B

Warren Buffette $50B














 


                                                               


                                                          Bernard Arnault $41B




  



Larry Ellission $39.5B





                                                     



                                                                        Lakshi Mittal $39.1B













Amancia Ortego $31B











                                                                 Eike Batista $30B










Mukesh Ambani $27B








                                               Christy Welton & family $26.5 B

Popular Posts