tag:blogger.com,1999:blog-12676720267076537632024-03-20T02:45:08.856+05:30// Nadun's Weblog/* Everything from technical stuff, cricket, politics,
traveling to general life.
*/Nadun Herathhttp://www.blogger.com/profile/17165120693130686126noreply@blogger.comBlogger37125tag:blogger.com,1999:blog-1267672026707653763.post-86622404947197950342017-01-12T16:45:00.001+05:302017-01-16T11:39:53.903+05:30BCS Post Graduate Diploma in IT Project ReportBCS Post Graduate Diploma in IT has a IT project which student should complete. Below is the project report which my wife has done. This can be use as a reference to do the BCS project report<br />
<br />
<a href="https://drive.google.com/file/d/0B372kJol271WS1N3bDZiM29mRmM/view?usp=sharing" target="_blank">BCS Post Graduate Project Report</a>Nadun Herathhttp://www.blogger.com/profile/17165120693130686126noreply@blogger.com0tag:blogger.com,1999:blog-1267672026707653763.post-57091431792069567022016-12-09T12:51:00.001+05:302016-12-09T12:53:11.986+05:30How to create Multi Valued Optional Parameters Report with Telerik Reporting <div>
Some times we may need to implement reports which has the ability to pick multiple parameters. If no parameter is selected it should run for all the values. Let's see how this can be achieved using Telerik Reporting. As an example let's consider a system which has banks and branches. Banks have many branches (One to many relationship). In this example banks are parameters. It's multi value. </div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNjpNt5XsvdcmPC-gkxVfUcO0orQc5FyaIYDgQpGMdjYGYYclxdGZEhf8b7IBH7eZaf2D6xb9Ny7me7G_Ues6yqAC41aNMoN8vVV6QAo0UDcHfu_AheAFColBGgdIJtk_qNOUW5_FXiLw/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="192" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNjpNt5XsvdcmPC-gkxVfUcO0orQc5FyaIYDgQpGMdjYGYYclxdGZEhf8b7IBH7eZaf2D6xb9Ny7me7G_Ues6yqAC41aNMoN8vVV6QAo0UDcHfu_AheAFColBGgdIJtk_qNOUW5_FXiLw/s400/3.png" width="400" /></a></div>
<div>
<br /></div>
<div>
Fig 1</div>
<div>
<br /></div>
<div>
If you take the Fig 1 User has run the report by selecting two banks. Then report will be generate for 2 banks. </div>
<div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyvrt9PZuLjG6DkVFgNOEv9dcdgSYLdTzUjqYaa_8SE_hvt1Lzgto8r5P5kdyKJJ1mNOcsPrH0Ltvddxxz9c9mwvHsX4PKtnCKc9aL7TztaD7420uFqCCD2COArRJBWYNB9ZuduiDz3HM/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="236" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyvrt9PZuLjG6DkVFgNOEv9dcdgSYLdTzUjqYaa_8SE_hvt1Lzgto8r5P5kdyKJJ1mNOcsPrH0Ltvddxxz9c9mwvHsX4PKtnCKc9aL7TztaD7420uFqCCD2COArRJBWYNB9ZuduiDz3HM/s400/4.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Fig 2</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
If you take the Fig 2 User has run the report without selecting any banks.Then report will be generated for all the banks. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Let's see how we can achieve this kind of functionality using telerik reporting. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
After creating a new telerik report we have to add data source. In this example we will add Sql Data Source. To achieve this multy value parameter scenario we can't use stored procedures. We have to define SQL Statement in the report it self. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Here is the Sql statement to achieve this functionality. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both;">
<b>SELECT B.BankName,B.ChequeNumberFormat,B.Active, BB.BranchName,BB.BranchCountry,BB.BranchSortCode</b></div>
<div class="separator" style="clear: both;">
<b> FROM dbo.Bank B INNER JOIN dbo.BankBranch BB ON B.BankID = BB.BankID</b></div>
<div class="separator" style="clear: both;">
<b> AND ((B.BankID IN (@bankIds)) or COALESCE(@bankIds,null) is NULL) </b></div>
<div class="separator" style="clear: both;">
<b><br /></b></div>
<div class="separator" style="clear: both;">
We have to define the parameter as <b>B.BankID IN @bankIds. </b>When parameter is not selected by user to display records for all the banks, we have to add <b>COALESCE(@bankIds,null) is NULL.</b></div>
<div class="separator" style="clear: both;">
This part is not much documented in Telerik reporting documentation. </div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiL07_Mmo7V6W0SJx7xLcseYslz507SWGVZR9wnPUtdiiD45-iqo1vu5MW-cgyPnU-I8g3KtSsP7SeLtm-pBw9Lyd-tv8b9TYn2c-WXRBz6Ob291hKz0kJVz_W7Yz6CFIlXrBiYQSWRTJI/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="290" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiL07_Mmo7V6W0SJx7xLcseYslz507SWGVZR9wnPUtdiiD45-iqo1vu5MW-cgyPnU-I8g3KtSsP7SeLtm-pBw9Lyd-tv8b9TYn2c-WXRBz6Ob291hKz0kJVz_W7Yz6CFIlXrBiYQSWRTJI/s400/1.png" width="400" /></a></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
Fig 3</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
And it's really important to define parameters MultiValue property as True during the setting Data source operation. Otherwise you will get an error. </div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
This can be achieved using Entity frame work data Sources as well. I hope to publish a post how to implement this scenario using Entity framework in the future. Please comment if you have anything to say regarding this. </div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
Nadun Herathhttp://www.blogger.com/profile/17165120693130686126noreply@blogger.com0tag:blogger.com,1999:blog-1267672026707653763.post-6672947513647631052013-09-07T15:57:00.001+05:302014-01-01T12:30:25.630+05:30Convert List to a ObservableCollection<span class="GINGER_SOFATWARE_correct" ginger_sofatware_markguid="f4e3ac25-5967-4085-a490-523ef411c0a0" ginger_sofatware_uiphraseguid="d6d94f8e-2179-4e7b-909a-f2e25fbae40f" grcontextid="Extention:0">Observable Collections are heavily used in Silverlight, WPF Applications instead of Lists. Observable Collection works essentially like a regular collection but it implements INotifyCollectionChanged and INotifyPropertyChanged interfaces. Because of that you can get to know when <span class="GINGER_SOFTWARE_mark" ginger_software_uiphraseguid="2d9cdf8e-0980-4971-ac88-1019de609135" id="38be3988-dfee-4dc4-9ad4-14facd883959">Collection</span> is changed. <span class="GINGER_SOFTWARE_mark" ginger_software_uiphraseguid="517f216a-5fc7-478e-8833-975e51accd20" id="44c28d75-e378-4c3f-a21a-630ac3ac62f6">ObservableCollection</span> are optimized for <span class="GINGER_SOFTWARE_mark" ginger_software_uiphraseguid="517f216a-5fc7-478e-8833-975e51accd20" id="e7e2228c-e234-44a6-8093-31fc1831fa7f">databinding</span> purposes.</span><br />
<span class="GINGER_SOFATWARE_correct" ginger_sofatware_markguid="f4e3ac25-5967-4085-a490-523ef411c0a0" ginger_sofatware_uiphraseguid="d6d94f8e-2179-4e7b-909a-f2e25fbae40f" grcontextid="Extention:0"><br /></span>
<span class="GINGER_SOFATWARE_correct" ginger_sofatware_markguid="f4e3ac25-5967-4085-a490-523ef411c0a0" ginger_sofatware_uiphraseguid="d6d94f8e-2179-4e7b-909a-f2e25fbae40f" grcontextid="Extention:0">Sometimes you will need to convert your list to an ObservableCollection. This Extension method enables that. </span><br />
<br />
<span class="GINGER_SOFATWARE_correct" ginger_sofatware_markguid="1e33a1a7-9425-4fa1-a1b6-ca16df8d279a" ginger_sofatware_uiphraseguid="4c42a6e9-e658-41fa-a3e0-b7c8559f297c" grcontextid="public:0"><span class="GINGER_SOFTWARE_mark" ginger_software_uiphraseguid="3d3a161e-476a-441a-9199-9b1e0a17948c" id="d4730f35-260f-4213-bfe9-c7dded0f7b92">public</span></span> static class CollectionExtensions<br />
{<br />
<span class="GINGER_SOFATWARE_correct" ginger_sofatware_markguid="e0f6f6d5-ebb1-4d9b-a8e3-d02da8317c19" ginger_sofatware_uiphraseguid="d8bd80f7-0ed7-4d9f-b4c9-480f156e5eab" grcontextid="public:0"><span class="GINGER_SOFTWARE_mark" ginger_software_uiphraseguid="7ca01685-eaaf-4d10-a50f-1763ab2de396" id="7a4f7fbc-b027-4522-b8e5-df51ad7fd18d">public</span></span> static ObservableCollection<t> ToObservableCollection<t><span class="GINGER_SOFTWARE_mark" ginger_software_uiphraseguid="7ca01685-eaaf-4d10-a50f-1763ab2de396" id="8b8e1f51-9b73-470b-bda7-88e7d6fb6288">(</span>this IEnumerable<t> <span class="GINGER_SOFATWARE_correct" ginger_sofatware_markguid="e05feb53-12cd-4e00-84ae-7a320ea01693" ginger_sofatware_uiphraseguid="d8bd80f7-0ed7-4d9f-b4c9-480f156e5eab" grcontextid="coll:1"><span class="GINGER_SOFTWARE_mark" ginger_software_uiphraseguid="7ca01685-eaaf-4d10-a50f-1763ab2de396" id="2d021b41-2d81-4d20-bc22-6c1d88239f6c">coll</span></span>)</t></t></t><br />
{<br />
<span class="GINGER_SOFATWARE_correct" ginger_sofatware_markguid="4dbe0157-38c4-4855-909d-38ed6f037db7" ginger_sofatware_uiphraseguid="13fd2994-b62b-476b-abf4-afd253938d98" grcontextid="var:0"><span class="GINGER_SOFTWARE_mark" ginger_software_uiphraseguid="ca71d209-6f0e-4d64-8a36-9187b0529836" id="e7de591c-c3ee-472f-87cf-1818ef5ec11b">var</span></span> c = new ObservableCollection<t><span class="GINGER_SOFTWARE_mark" ginger_software_uiphraseguid="ca71d209-6f0e-4d64-8a36-9187b0529836" id="a92d6918-97e8-4f46-9f97-6c7555ca983f">(</span>);</t><br />
<span class="GINGER_SOFATWARE_correct" ginger_sofatware_markguid="058b2732-4c58-4d5b-b250-e48abffb8642" ginger_sofatware_uiphraseguid="41d575d3-0008-4989-b1c9-088c2368ecba" grcontextid="foreach:0"><span class="GINGER_SOFTWARE_mark" ginger_software_uiphraseguid="8fd7ed73-274e-4407-86e2-02074e204667" id="8f28ccb1-00bb-47e5-8058-65d77762a59e">foreach</span></span> (<span class="GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct" ginger_sofatware_markguid="3143c8a9-0bbd-453e-a49d-4108be7f5c6b" ginger_sofatware_uiphraseguid="41d575d3-0008-4989-b1c9-088c2368ecba" grcontextid="var:1"><span class="GINGER_SOFTWARE_mark" ginger_software_uiphraseguid="8fd7ed73-274e-4407-86e2-02074e204667" id="41782da9-05e1-417a-bd4c-6c861f735a04">var</span></span> e in <span class="GINGER_SOFATWARE_correct" ginger_sofatware_markguid="9048947e-3c03-46f4-be4c-bf09fda255e9" ginger_sofatware_uiphraseguid="41d575d3-0008-4989-b1c9-088c2368ecba" grcontextid="coll:2"><span class="GINGER_SOFTWARE_mark" ginger_software_uiphraseguid="8fd7ed73-274e-4407-86e2-02074e204667" id="c680cb8b-b81c-4878-834f-9d4c0e267c1a">coll</span></span>)<br />
<span class="GINGER_SOFATWARE_correct" ginger_sofatware_markguid="3ced0f34-dd8a-4d57-b612-ced068a0f187" ginger_sofatware_uiphraseguid="024ba55a-01f0-48a3-93ef-2ba554a7e485" grcontextid="c.:0"><span class="GINGER_SOFTWARE_mark" ginger_software_uiphraseguid="12203ed8-7a75-4866-b4a8-08b17ce023b6" id="36822fdd-1e47-4ce6-bab2-76521f116cb2">c.</span></span>Add<span class="GINGER_SOFATWARE_correct" ginger_sofatware_markguid="e4890093-8e05-43ed-98a1-0af62175ff06" ginger_sofatware_uiphraseguid="024ba55a-01f0-48a3-93ef-2ba554a7e485" grcontextid="(:1"><span class="GINGER_SOFTWARE_mark" ginger_software_uiphraseguid="12203ed8-7a75-4866-b4a8-08b17ce023b6" id="f9bdfb03-ab1f-4fb1-996a-f1cdf547833a">(</span></span><span class="GINGER_SOFATWARE_correct" ginger_sofatware_markguid="bdf1b23a-5427-46bf-af7d-19e3066d2a6d" ginger_sofatware_uiphraseguid="024ba55a-01f0-48a3-93ef-2ba554a7e485" grcontextid="e:2"><span class="GINGER_SOFTWARE_mark" ginger_software_uiphraseguid="12203ed8-7a75-4866-b4a8-08b17ce023b6" id="745ace0e-5a70-44fa-9d81-3ca7f95c3755">e</span></span>);<br />
<span class="GINGER_SOFATWARE_correct" ginger_sofatware_markguid="caa4eab8-9adc-43f5-a356-be2e6200ac05" ginger_sofatware_uiphraseguid="e35b3304-a9b4-49e9-a0f6-2d62106c7557" grcontextid="return:0"><span class="GINGER_SOFTWARE_mark" ginger_software_uiphraseguid="d7a549dc-64f0-4845-a999-b6233ee420a1" id="6e4e3d56-c3aa-430e-b9c6-e6adfc33b53f">return</span></span> c;<br />
}<br />
}<br />
<div>
<br /></div>
Nadun Herathhttp://www.blogger.com/profile/17165120693130686126noreply@blogger.com0tag:blogger.com,1999:blog-1267672026707653763.post-23484989551530383802012-12-29T14:03:00.002+05:302012-12-29T14:03:37.885+05:30Happiness - 2<br />
<br />
<ul>
<li>Happiness is my birthright.</li>
</ul>
<br />
<br />
<ul>
<li>I forgive myself for all of my mistakes--and celebrate the lessons they let me learn.</li>
</ul>
<br />
<br />
<ul>
<li>I am enough. </li>
</ul>
<br />
<br />
<ul>
<li>What other people think of me is none of my business.</li>
</ul>
<br />
<br />
<ul>
<li>When in doubt, breathe.</li>
</ul>
<div>
Source <a href="http://spoiledyogi.blogspot.com/">http://spoiledyogi.blogspot.com/</a></div>
<br />
Nadun Herathhttp://www.blogger.com/profile/17165120693130686126noreply@blogger.com0tag:blogger.com,1999:blog-1267672026707653763.post-59290015358125922632012-12-29T14:01:00.004+05:302012-12-29T14:01:49.414+05:30Happiness - 1<br />
<br />
The yamas for a happy, better life :)<br />
<br />
<ul>
<li>Truthfulness</li>
<li>Non-harming</li>
<li>Non-stealing</li>
<li>Greadlessness</li>
<li>Sexual Responsibility</li>
</ul>
<div>
source - <a href="http://spoiledyogi.blogspot.com/">http://spoiledyogi.blogspot.com/</a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<br />
Nadun Herathhttp://www.blogger.com/profile/17165120693130686126noreply@blogger.com0tag:blogger.com,1999:blog-1267672026707653763.post-65328031730330758442012-12-29T13:55:00.000+05:302012-12-29T13:55:07.659+05:30Dealing with Tragedy<a href="http://blogs.yogajournal.com/goodlife/archives/2012/12/dealing-with-tragedy.html" target="_blank">Dealing with Tragedy</a> - Really good, valuable blog post from Spoiled Yogi.(http://spoiledyogi.blogspot.com/) This teaches us many things about the life.<br />
<br />
<br />
<div style="background-color: white; color: #494949; font-family: arial, helvetica; font-size: 12px; line-height: 18px;">
I watched the news coverage in horror last week. Like most of the country, I was stunned and confused. How could anyone harm children as young as the victims in the school shooting in Connecticut? My mind raced as the reporters painted an all-too-real picture of the events that had taken place. I imagined how scared those children must have been—both the victims and the survivors. I thought about the teachers in the school that day, and I wondered how I would have handled being in that situation. I thought about the parents getting an email notifying them that their child’s school was on lock down. I felt the grief of the first responders. I felt sad for the shooter’s family and imagined how they must be feeling as the media painted their loved one as a monster. It was almost too much to bear. I turned off my TV.</div>
<div style="background-color: white; color: #494949; font-family: arial, helvetica; font-size: 12px; line-height: 18px;">
I asked myself: Could feelings of such overwhelming sadness and hurt in my heart do more harm than good? Is it healthy to dwell on the bad things in the world? I realized that sitting in front of the TV with my mouth open didn’t do anything but leave me feeling melancholy and hopeless. And, frankly, in this situation the last thing the world needs is more darkness.</div>
<div style="background-color: white; color: #494949; font-family: arial, helvetica; font-size: 12px; line-height: 18px;">
After such a tragic event, it’s hard to feel positive about the world we live in. But through my yoga practice, I’ve found that it is possible to maintain a hopeful optimism for the future. While I know I can’t control the world around me, I have some control over my own feelings and actions. I can’t stop bad things from happening, or undo the bad things that have already happened, I but can do my small part to bring about change. I remind myself of how the tiny changes in alignment (those little shifts that aren’t even noticeable to the untrained eye) can totally change the way I experience a pose over time. And I know that the little things we each do to support each other every day can have the same type of effect on the world.</div>
<div style="background-color: white; color: #494949; font-family: arial, helvetica; font-size: 12px; line-height: 18px;">
Bad things happen. Sometimes they hit closer to home than others. We can look at it as a sign that the world is a bad place, unsafe for our children. We can get angry. Or we can use it to motivate us all to be kinder, more generous, and more loving so that the world will be better for all.</div>
<div style="background-color: white; color: #494949; font-family: arial, helvetica; font-size: 12px; line-height: 18px;">
With that in mind, I unroll my mat. I breathe. I feel. I hope for peace.</div>
<br />
Nadun Herathhttp://www.blogger.com/profile/17165120693130686126noreply@blogger.com0tag:blogger.com,1999:blog-1267672026707653763.post-84413877779633024072012-11-25T22:15:00.000+05:302012-11-25T22:15:24.280+05:30How to Install a Magento Extension Using FTPI had to install a magento extension using FTP recently. These 2 blog posts helped me immensely regarding that.<br />
<br />
http://www.aschroder.com/2010/05/installing-a-magento-extension-manually-via-ftp-or-ssh/<br />
<br />
http://www.groovecommerce.com/ecommerce-blog/magento/developer-toolbox-a-guide-for-installing-magento-extensions/<br />
<br />
If you refer these two blogs I am sure you would be able to manually install an extension manually even though you are not a hardcore magento guy.<br />
<br />
Magento extensions are normally developed to install through magento connect. But sometimes you will have to install the extension manually using either FTP or SSH. It is said that it's not good to install too many extenions using Magento Connect. Your magento Site could crash.<br />
<br />
Magento extensions come up with file structure. You have to upload to the correct location of your magento site installation.<br />
<br />
Important things to consider when manually installing a magento extension.<br />
<br />
1.) Don't install the extension without testing that in a testing site. Don't install the extension in a live site without testing. Results of the badly design extension could be catastrophic.<br />
<br />
2.) Disable the cache prior to the installation.<br />
<span style="background-color: white; color: #595959; font-family: Verdana, Geneva, sans-serif; font-size: 12px; line-height: 18px;"> (System->Cache Management), selecting all caches, clicking ‘disable’ from the drop-down menu, and submitting the change.</span><br />
<br />
3.) Disable the compilation mode.Nadun Herathhttp://www.blogger.com/profile/17165120693130686126noreply@blogger.com2tag:blogger.com,1999:blog-1267672026707653763.post-48345059164422527592012-08-27T17:47:00.006+05:302012-09-17T18:54:57.159+05:30Issues you might face when Setting Up Magento in GoDaddy Shared Hosting<span style="font-family:Georgia, serif;"><span style="font-size:100%;">Magento is a powerful open-source ecommerce web application. Recently I hosted magento in a Godaddy. While setting up magento in godaddy I ran into various issues. Here are some of the issues I faced and How I resolved them </span></span><div style="font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; "><br /></div><div style="font-style: normal; font-variant: normal; font-weight: normal; "><span style=" line-height: normal; font-family:Georgia, serif;font-size:100%;">1.) When site is installed you get the message "No input file specified" </span></div><div style="font-style: normal; font-variant: normal; font-weight: normal; "><span style="font-family:Arial, Helvetica, sans-serif;color:#3d3d3d;"><span style=" line-height: 15px;font-size:12px;"><span class="Apple-tab-span" style="white-space:pre"> </span></span></span><span style=" ;font-family:Georgia, serif;font-size:16px;">To resolve that you should renam php.ini file in web directory to php5.ini. And you should put cgi.fix_pathinfo = 1 top of the php5.ini file. If you are still getting the error add this "Options -Multivies" to the top of .htaccess .</span></div><div style="font-style: normal; font-variant: normal; font-weight: normal; "><span style="font-family:Arial, Helvetica, sans-serif;color:#3d3d3d;"><span style=" line-height: 15px;font-size:12px;"><br /></span></span></div><div style="font-style: normal; font-variant: normal; font-weight: normal; "><span style=" ;font-family:Georgia, serif;font-size:100%;">2.) Added products are not displayed in the front end of the site</span></div><div style="font-style: normal; font-variant: normal; font-weight: normal; "><span style=" ;font-family:Georgia, serif;font-size:100%;"><span class="Apple-tab-span" style="white-space:pre"> </span> Most possible cause can be when adding the product setting Stock availability option to "Out of Stock" in inventory section</span></div><div style="font-style: normal; font-variant: normal; font-weight: normal; "><span style=" ;font-family:Georgia, serif;font-size:100%;"><br /></span></div><div style="font-style: normal; font-variant: normal; font-weight: normal; "><span style=" ;font-family:Georgia, serif;font-size:100%;">3.) Added Images are not displayed in the front end</span></div><div style="font-style: normal; font-variant: normal; font-weight: normal; "><span style=" ;font-family:Georgia, serif;font-size:100%;"><span class="Apple-tab-span" style="white-space:pre"> </span> Image size should be around very lower(less than 40kb). You should remove .htaccess file </span></div><div style="font-style: normal; font-variant: normal; font-weight: normal; "><span style=" ;font-family:Georgia, serif;font-size:100%;">located in the media folder.</span></div><div style="font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; "><br /></div><div><span style="font-family:Georgia, serif;"><span style="font-size:100%;">4.) When you try to access the site or admin panel you get the message "The Server is temporarily unable to service your request" </span></span><br /><div><span class="Apple-tab-span" style=" font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; white-space: pre; font-family:Georgia, serif;font-size:100%;"> </span><span style="font-family:Georgia, serif;"><span style="font-size:100%;">This happens when your store has been put to </span>maintenance<span style="font-size:100%;"> mode. To resolve this you have to delete maintenance.flag in the root directory. </span></span></div><div style="font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; "><br /></div><div style="font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; ">5.) If you want to install Sample data from Magento run that script from phpmysql admin first of all. If you install sample data later you might end up with various errors. </div><div style="font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; "><br /></div><div style="font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; "> </div><div style="font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; "><br /></div><div style="font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; "><br /></div><div style="font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; "><br /></div><div style="font-style: normal; font-variant: normal; font-weight: normal; "><span style="font-family:arial, sans-serif;font-size:85%;color:#222222;"><span style="line-height: 15px;"> </span></span></div></div>Nadun Herathhttp://www.blogger.com/profile/17165120693130686126noreply@blogger.com0tag:blogger.com,1999:blog-1267672026707653763.post-105326558994967542012-06-23T15:10:00.002+05:302012-06-23T16:24:23.408+05:30Date Selector - Silverlight Custom Control<span style="color: rgb(37, 51, 64); font-family: 'Segoe UI', Tahoma, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; text-align: -webkit-auto; ">I have created a silverlight custom control which can be used to select date in a user friendly way. It is similar to date selector control available to set birth date in facebook registration. Standard date picker control in silverlight and WPF is not user friendly and user has to perform several clicks to select a date. This control is skinable. I have open source it and hosted in codeplex. Hope to add localizations very soon. Contributions and ideas are Welcome :). </span><br style="color: rgb(37, 51, 64); font-family: 'Segoe UI', Tahoma, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; text-align: -webkit-auto; "><div style="text-align: -webkit-auto; "><span ><span style="line-height: 19px;"> http://sldateselector.codeplex.com</span></span></div>Nadun Herathhttp://www.blogger.com/profile/17165120693130686126noreply@blogger.com0tag:blogger.com,1999:blog-1267672026707653763.post-79639624441912077712011-07-27T10:30:00.003+05:302011-07-27T14:46:09.701+05:30Encryption in Silverlight and .NET ApplicationsI wanted to encrypt some sensitive data in a Silverlight application and decry pt that in the server. Sergey Barskiy's has written a good post about that. Here is the code. <div><br /></div><div>Encryption functionality<br /><div><br /><div><span class="Apple-style-span" style="color: rgb(136, 136, 136); font-family: 'Lucida Grande', sans-serif; font-size: 11px; "> </span><span class="Apple-style-span" style="color: rgb(68, 68, 68); font-family: 'Lucida Grande', sans-serif; font-size: 14px; "><span style="font-family: consolas; color: blue; font-size: 10pt; ">using</span><span style="font-family: consolas; font-size: 10pt; "> System; </span></span></div><span style="font-family: consolas; font-size: 10pt; color: blue; ">using</span><span class="Apple-style-span" > System.Text; </span><br /><span style="font-family: consolas; font-size: 10pt; color: blue; ">using</span><span class="Apple-style-span" > System.Security.Cryptography; </span><br /><span style="font-family: consolas; font-size: 10pt; color: blue; ">using</span><span class="Apple-style-span" > System.IO; </span><br /><span style="color: rgb(68, 68, 68); font-family: consolas; font-size: 10pt; "> </span><span class="Apple-style-span" > </span><br /><span style="font-family: consolas; font-size: 10pt; color: blue; ">namespace</span><span class="Apple-style-span" > Encryption </span><br /><span class="Apple-style-span" >{ </span><br /><span class="Apple-style-span" > </span><span style="font-family: consolas; font-size: 10pt; color: blue; ">public</span><span class="Apple-style-span" > </span><span style="font-family: consolas; font-size: 10pt; color: blue; ">static</span><span class="Apple-style-span" > </span><span style="font-family: consolas; font-size: 10pt; color: blue; ">class</span><span class="Apple-style-span" > </span><span style="font-family: consolas; font-size: 10pt; color: rgb(43, 145, 175); ">EncryptionUtility</span><span class="Apple-style-span" > </span><br /><span class="Apple-style-span" > { </span><br /><span style="color: rgb(68, 68, 68); font-family: consolas; font-size: 10pt; "> </span><span class="Apple-style-span" > </span><br /><span class="Apple-style-span" > </span><span style="font-family: consolas; font-size: 10pt; color: gray; ">///</span><span style="font-family: consolas; font-size: 10pt; color: green; "> </span><span style="font-family: consolas; font-size: 10pt; color: gray; "><summary><span class="Apple-style-span" > </span><br /><span class="Apple-style-span" > </span><span style="font-family: consolas; font-size: 10pt; color: gray; ">///</span><span style="font-family: consolas; font-size: 10pt; color: green; "> Encrypt the data</span><span class="Apple-style-span" > </span><br /><span class="Apple-style-span" > </span><span style="font-family: consolas; font-size: 10pt; color: gray; ">///</span><span style="font-family: consolas; font-size: 10pt; color: green; "> </span><span style="font-family: consolas; font-size: 10pt; color: gray; "></span></summary></span><span class="Apple-style-span" > </span><br /><span class="Apple-style-span" > </span><span style="font-family: consolas; font-size: 10pt; color: gray; ">///</span><span style="font-family: consolas; font-size: 10pt; color: green; "> </span><span style="font-family: consolas; font-size: 10pt; color: gray; "><param name="input"></span><span style="font-family: consolas; font-size: 10pt; color: green; ">String to encrypt</span><span style="font-family: consolas; font-size: 10pt; color: gray; "></span><span class="Apple-style-span" > </span><br /><span class="Apple-style-span" > </span><span style="font-family: consolas; font-size: 10pt; color: gray; ">///</span><span style="font-family: consolas; font-size: 10pt; color: green; "> </span><span style="font-family: consolas; font-size: 10pt; color: gray; "><returns></returns></span><span style="font-family: consolas; font-size: 10pt; color: green; ">Encrypted string</span><span style="font-family: consolas; font-size: 10pt; color: gray; "></span><span class="Apple-style-span" > </span><br /><span class="Apple-style-span" > </span><span style="font-family: consolas; font-size: 10pt; color: blue; ">public</span><span class="Apple-style-span" > </span><span style="font-family: consolas; font-size: 10pt; color: blue; ">static</span><span class="Apple-style-span" > </span><span style="font-family: consolas; font-size: 10pt; color: blue; ">string</span><span class="Apple-style-span" > Encrypt(</span><span style="font-family: consolas; font-size: 10pt; color: blue; ">string</span><span class="Apple-style-span" > input, </span><span style="font-family: consolas; font-size: 10pt; color: blue; ">string</span><span class="Apple-style-span" > password) </span><br /><span class="Apple-style-span" > { </span><br /><span style="color: rgb(68, 68, 68); font-family: consolas; font-size: 10pt; "> </span><span class="Apple-style-span" > </span><br /><span class="Apple-style-span" > </span><span style="font-family: consolas; font-size: 10pt; color: blue; ">byte</span><span class="Apple-style-span" >[] utfData = </span><span style="font-family: consolas; font-size: 10pt; color: rgb(43, 145, 175); ">UTF8Encoding</span><span class="Apple-style-span" >.UTF8.GetBytes(input); </span><br /><span class="Apple-style-span" > </span><span style="font-family: consolas; font-size: 10pt; color: blue; ">byte</span><span class="Apple-style-span" >[] saltBytes = </span><span style="font-family: consolas; font-size: 10pt; color: rgb(43, 145, 175); ">Encoding</span><span class="Apple-style-span" >.UTF8.GetBytes(password); </span><br /><span class="Apple-style-span" > </span><span style="font-family: consolas; font-size: 10pt; color: blue; ">string</span><span class="Apple-style-span" > encryptedString = </span><span style="font-family: consolas; font-size: 10pt; color: blue; ">string</span><span class="Apple-style-span" >.Empty; </span><br /><span class="Apple-style-span" > </span><span style="font-family: consolas; font-size: 10pt; color: blue; ">using</span><span class="Apple-style-span" > (</span><span style="font-family: consolas; font-size: 10pt; color: rgb(43, 145, 175); ">AesManaged</span><span class="Apple-style-span" > aes = </span><span style="font-family: consolas; font-size: 10pt; color: blue; ">new</span><span class="Apple-style-span" > </span><span style="font-family: consolas; font-size: 10pt; color: rgb(43, 145, 175); ">AesManaged</span><span class="Apple-style-span" >()) </span><br /><span class="Apple-style-span" > { </span><br /><span class="Apple-style-span" > </span><span style="font-family: consolas; font-size: 10pt; color: rgb(43, 145, 175); ">Rfc2898DeriveBytes</span><span class="Apple-style-span" > rfc = </span><span style="font-family: consolas; font-size: 10pt; color: blue; ">new</span><span class="Apple-style-span" > </span><span style="font-family: consolas; font-size: 10pt; color: rgb(43, 145, 175); ">Rfc2898DeriveBytes</span><span class="Apple-style-span" >(password, saltBytes); </span><br /><span style="color: rgb(68, 68, 68); font-family: consolas; font-size: 10pt; "> </span><span class="Apple-style-span" > </span><br /><span class="Apple-style-span" > aes.BlockSize = aes.LegalBlockSizes[0].MaxSize; </span><br /><span class="Apple-style-span" > aes.KeySize = aes.LegalKeySizes[0].MaxSize; </span><br /><span class="Apple-style-span" > aes.Key = rfc.GetBytes(aes.KeySize / 8); </span><br /><span class="Apple-style-span" > aes.IV = rfc.GetBytes(aes.BlockSize / 8); </span><br /><span style="color: rgb(68, 68, 68); font-family: consolas; font-size: 10pt; "> </span><span class="Apple-style-span" > </span><br /><span class="Apple-style-span" > </span><span style="font-family: consolas; font-size: 10pt; color: blue; ">using</span><span class="Apple-style-span" > (</span><span style="font-family: consolas; font-size: 10pt; color: rgb(43, 145, 175); ">ICryptoTransform</span><span class="Apple-style-span" > encryptTransform = aes.CreateEncryptor()) </span><br /><span class="Apple-style-span" > { </span><br /><span class="Apple-style-span" > </span><span style="font-family: consolas; font-size: 10pt; color: blue; ">using</span><span class="Apple-style-span" > (</span><span style="font-family: consolas; font-size: 10pt; color: rgb(43, 145, 175); ">MemoryStream</span><span class="Apple-style-span" > encryptedStream = </span><span style="font-family: consolas; font-size: 10pt; color: blue; ">new</span><span class="Apple-style-span" > </span><span style="font-family: consolas; font-size: 10pt; color: rgb(43, 145, 175); ">MemoryStream</span><span class="Apple-style-span" >()) </span><br /><span class="Apple-style-span" > { </span><br /><span class="Apple-style-span" > </span><span style="font-family: consolas; font-size: 10pt; color: blue; ">using</span><span class="Apple-style-span" > (</span><span style="font-family: consolas; font-size: 10pt; color: rgb(43, 145, 175); ">CryptoStream</span><span class="Apple-style-span" > encryptor = </span><br /><span class="Apple-style-span" > </span><span style="font-family: consolas; font-size: 10pt; color: blue; ">new</span><span class="Apple-style-span" > </span><span style="font-family: consolas; font-size: 10pt; color: rgb(43, 145, 175); ">CryptoStream</span><span class="Apple-style-span" >(encryptedStream, encryptTransform,</span><span style="font-family: consolas; font-size: 10pt; color: rgb(43, 145, 175); ">CryptoStreamMode</span><span class="Apple-style-span" >.Write)) </span><br /><span class="Apple-style-span" > { </span><br /><span class="Apple-style-span" > encryptor.Write(utfData, 0, utfData.Length); </span><br /><span class="Apple-style-span" > encryptor.Flush(); </span><br /><span class="Apple-style-span" > encryptor.Close(); </span><br /><span style="color: rgb(68, 68, 68); font-family: consolas; font-size: 10pt; "> </span><span class="Apple-style-span" > </span><br /><span class="Apple-style-span" > </span><span style="font-family: consolas; font-size: 10pt; color: blue; ">byte</span><span class="Apple-style-span" >[] encryptBytes = encryptedStream.ToArray(); </span><br /><span class="Apple-style-span" > encryptedString = </span><span style="font-family: consolas; font-size: 10pt; color: rgb(43, 145, 175); ">Convert</span><span class="Apple-style-span" >.ToBase64String(encryptBytes); </span><br /><span class="Apple-style-span" > } </span><br /><span class="Apple-style-span" > } </span><br /><span class="Apple-style-span" > } </span><br /><span class="Apple-style-span" > } </span><br /><span class="Apple-style-span" > </span><span style="font-family: consolas; font-size: 10pt; color: blue; ">return</span><span class="Apple-style-span" > encryptedString; </span><br /><div><span class="Apple-style-span" style="color: rgb(68, 68, 68); font-family: consolas; font-size: small; "> } </span><span class="Apple-style-span" style="color: rgb(136, 136, 136); font-family: 'Lucida Grande', sans-serif; font-size: 11px; "> </span></div></div></div><div><span class="Apple-style-span" style="color: rgb(136, 136, 136); font-family: 'Lucida Grande', sans-serif; font-size: 11px; "><br /></span></div><div>Decryption functionality<br /></div><div><span class="Apple-style-span" ><span class="Apple-style-span" style="line-height: 16px;"><br /></span></span></div><div><span class="Apple-style-span" style="color: rgb(68, 68, 68); font-family: consolas; font-size: 13px; "><span style="color: gray; ">///</span><span style="color: green; "> </span><span style="color: gray; "><summary><br /> <span style="color: gray; ">///</span><span style="color: green; "> Decrypt a string</span><br /> <span style="color: gray; ">///</span><span style="color: green; "> </span><span style="color: gray; "></span></summary></span><br /> <span style="color: gray; ">///</span><span style="color: green; "> </span><span style="color: gray; "><param name="input"></span><span style="color: green; ">Input string in base 64 format</span><span style="color: gray; "></span><br /> <span style="color: gray; ">///</span><span style="color: green; "> </span><span style="color: gray; "><returns></returns></span><span style="color: green; ">Decrypted string</span><span style="color: gray; "></span><br /> <span style="color: blue; ">public</span> <span style="color: blue; ">static</span> <span style="color: blue; ">string</span> Decrypt(<span style="color: blue; ">string</span> input, <span style="color: blue; ">string</span> password)<br /> {</span><span class="Apple-style-span" style="color: rgb(68, 68, 68); font-family: consolas; font-size: 13px; "><br /><span> </span> <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><br /> </span><span class="Apple-style-span" style="color: rgb(49, 60, 70); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 16px; ">input = input.Replace(" ","+");</span></div><div><span class="Apple-style-span" style="color: rgb(68, 68, 68); font-family: consolas; font-size: 13px; "> <span style="color: blue; ">byte</span>[] encryptedBytes = <span style="color: rgb(43, 145, 175); ">Convert</span>.FromBase64String(input);<br /> <span style="color: blue; ">byte</span>[] saltBytes = <span style="color: rgb(43, 145, 175); ">Encoding</span>.UTF8.GetBytes(password);<br /> <span style="color: blue; ">string</span> decryptedString = <span style="color: blue; ">string</span>.Empty;<br /> <span style="color: blue; ">using</span> (<span style="color: blue; ">var</span> aes = <span style="color: blue; ">new</span> <span style="color: rgb(43, 145, 175); ">AesManaged</span>())<br /> {<br /> <span style="color: rgb(43, 145, 175); ">Rfc2898DeriveBytes</span> rfc = <span style="color: blue; ">new</span> <span style="color: rgb(43, 145, 175); ">Rfc2898DeriveBytes</span>(password, saltBytes);<br /> aes.BlockSize = aes.LegalBlockSizes[0].MaxSize;<br /> aes.KeySize = aes.LegalKeySizes[0].MaxSize;<br /> aes.Key = rfc.GetBytes(aes.KeySize / 8);<br /> aes.IV = rfc.GetBytes(aes.BlockSize / 8);<br /><span> </span><br /> <span style="color: blue; ">using</span> (<span style="color: rgb(43, 145, 175); ">ICryptoTransform</span> decryptTransform = aes.CreateDecryptor())<br /> {<br /> <span style="color: blue; ">using</span> (<span style="color: rgb(43, 145, 175); ">MemoryStream</span> decryptedStream = <span style="color: blue; ">new</span> <span style="color: rgb(43, 145, 175); ">MemoryStream</span>())<br /> {<br /> <span style="color: rgb(43, 145, 175); ">CryptoStream</span> decryptor = <br /> <span style="color: blue; ">new</span> <span style="color: rgb(43, 145, 175); ">CryptoStream</span>(decryptedStream, decryptTransform,<span style="color: rgb(43, 145, 175); ">CryptoStreamMode</span>.Write);<br /> decryptor.Write(encryptedBytes, 0, encryptedBytes.Length);<br /> decryptor.Flush();<br /> decryptor.Close();<br /><span> </span><br /> <span style="color: blue; ">byte</span>[] decryptBytes = decryptedStream.ToArray();<br /> decryptedString = <br /> <span style="color: rgb(43, 145, 175); ">UTF8Encoding</span>.UTF8.GetString(decryptBytes, 0, decryptBytes.Length);<br /> }<br /> }<br /> }<br /><span> </span><br /> <span style="color: blue; ">return</span> decryptedString;<br /> }<br /> }<br />}</span></div><div></div><div></div><div><span class="Apple-style-span" style="font-size: 13px; "> </span></div><div></div><div><span class="Apple-style-span" style="color: rgb(68, 68, 68); font-family: consolas; font-size: 13px; ">In the decrpting part I had to include the line </span><span class="Apple-style-span" style="color: rgb(49, 60, 70); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 16px; "> input = input.Replace(" ","+");</span></div><div><span class="Apple-style-span" >It seems 64-bic encoding does not work with spaces. Plus sign will be interpreted as a space when you call the </span><span class="Apple-style-span" style="color: rgb(49, 60, 70); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 16px; ">FromBase64String method. </span></div><div><span class="Apple-style-span" style="color: rgb(49, 60, 70); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 16px; "><br /></span></div><div><span class="Apple-style-span" style="color: rgb(49, 60, 70); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 16px; "> </span></div><div><span class="Apple-style-span" ><br /></span></div><div><span class="Apple-style-span" style="color: rgb(49, 60, 70); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 16px; "><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 13px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "><br /></p></span></div><div><br /></div><div><span class="Apple-style-span" ><span class="Apple-style-span" style="font-size: 11px;"><br /></span></span></div>Nadun Herathhttp://www.blogger.com/profile/17165120693130686126noreply@blogger.com0tag:blogger.com,1999:blog-1267672026707653763.post-80137846953127948712011-03-19T16:12:00.003+05:302011-03-19T16:55:08.033+05:30HTML Parser - Java Library to extract html Elements<div style="text-align: center;"><span class="Apple-style-span" ><u> </u></span><a href="http://htmlparser.sourceforge.net/">HTML Parser - HTML Parser</a></div><div><br /></div><div>HTML Parser is a very cool java library which can be used to extract values in a html page.</div><div><br /></div><div>Let's take the URL - http://www.google.ca/finance?q=BMO</div><div><br /></div><div><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEht69y88e8ofMPMbF2X9H8uHtc3fzYL550wQCccmu3DHGTLoRtJFLfPBr9dZDxxgIb3fsuA0_ylvz6c81023A5JOHUVD9cyQGR__B3uGHnrt4nb6m4nYcoiqlk6_TH6i0PjrhLx0ft-teA/s1600/htmlparser.jpg"><img style="text-align: left;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; cursor: pointer; width: 320px; height: 200px; " src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEht69y88e8ofMPMbF2X9H8uHtc3fzYL550wQCccmu3DHGTLoRtJFLfPBr9dZDxxgIb3fsuA0_ylvz6c81023A5JOHUVD9cyQGR__B3uGHnrt4nb6m4nYcoiqlk6_TH6i0PjrhLx0ft-teA/s320/htmlparser.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5585740995649132690" /></a><br /><div>Let's say we want to extract the value of the span tag - ( Mar 18 - Close.)</div><div><br /></div><div>Here is the code</div><div><br /></div><div><div><div>import java.io.IOException;</div><div>import java.net.MalformedURLException;</div><div>import java.net.URL;</div><div>import java.net.URLConnection;</div><div>import org.htmlparser.Node;</div><div>import org.htmlparser.Parser;</div><div>import org.htmlparser.filters.CssSelectorNodeFilter;</div><div>import org.htmlparser.util.NodeList;</div><div>import org.htmlparser.util.ParserException;</div><div><br /></div><div>public class test {</div><div><br /></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>/**</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> * @param args</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> */</div><div><br /></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>public static void main(String[] args) {</div><div><br /></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>String URL = "http://www.google.ca/finance?q=BMO";</div><div><br /></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>try {</div><div><br /></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>URL url = new URL(URL);</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>URLConnection urlcon;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>urlcon = url.openConnection();</div><div><br /></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Parser parser = new Parser(urlcon); // creating of HTML parser</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>// object</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>CssSelectorNodeFilter cssFilter = new CssSelectorNodeFilter(</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>"SPAN.nwp");</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>NodeList nodes = parser.parse(cssFilter); // getting nodes of</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> // span.nwp. Only NodeList created with one value</div><div><br /></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Node node = nodes.elementAt(0); //getting the first value of the nodes list</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>System.out.println(nodes.size());</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>String value = node.getFirstChild().getText(); //getting the value of the node</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>System.out.println(value);</div><div><br /></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>} catch (MalformedURLException e) {</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>System.out.println("Malformed Exception :" + e.getMessage());</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>} catch (IOException e) {</div><div><br /></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>e.printStackTrace();</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>} catch (ParserException e) {</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>e.printStackTrace();</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>}</div><div><br /></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>}</div><div>}</div></div></div><div><br /></div><div><br /></div><div><br /></div><div><br /></div></div>Nadun Herathhttp://www.blogger.com/profile/17165120693130686126noreply@blogger.com1tag:blogger.com,1999:blog-1267672026707653763.post-26046904951405951822011-01-23T08:31:00.000+05:302011-01-23T08:34:06.095+05:30YouTube - Sri Lanka<a href="http://www.youtube.com/watch?v=N7jE5I3lx5I&feature=player_embedded">YouTube - Sri Lanka</a>Nadun Herathhttp://www.blogger.com/profile/17165120693130686126noreply@blogger.com0tag:blogger.com,1999:blog-1267672026707653763.post-17341684868143876692010-12-04T17:16:00.005+05:302010-12-04T17:29:16.767+05:30MySQL - Having reserved key word as a column name<div style="text-align: justify;">In MySql you will run into trouble when you try to execute a query if you have a reserved keyword as a column name. As an example let's take "update google_mapping set Open_Market='N' where Group='Taiwan';. Group is a reserved keyword in MySql. Solution is to surround keyword with ``. So in the above example you have to modify the query like this.</div><div style="text-align: justify;">"update google_mapping set Open_Market='N' where `Group`='Taiwan'";</div>Nadun Herathhttp://www.blogger.com/profile/17165120693130686126noreply@blogger.com2tag:blogger.com,1999:blog-1267672026707653763.post-81696837968186178282010-10-30T15:16:00.000+05:302010-10-30T15:16:06.071+05:30Esoteric programming language<a href="http://en.wikipedia.org/wiki/Esoteric_programming_language#Examples">Esoteric programming language - Wikipedia, the free encyclopedia</a><div><br /></div><div>Escoteric programming languages! Well I heard about them today for the first time. These programming languages are not used in real world programming. They have mainly used to test the boundaries of computer programming language design, as a joke and as a prof of concept by hackers and hobbyists . You can find great deal about them in this wiki article. </div>Nadun Herathhttp://www.blogger.com/profile/17165120693130686126noreply@blogger.com0tag:blogger.com,1999:blog-1267672026707653763.post-3597880712453246752010-10-20T18:02:00.000+05:302010-10-20T18:02:04.215+05:30David Parnas - Father of the Software Engineering<a href="http://en.wikipedia.org/wiki/David_Parnas">David Parnas - Wikipedia, the free encyclopedia</a><div><br /></div><div>Recently I heard that David Parnas is considered as the father of modern day Software Engineering. . Geez, I am in the Software Engineering field </div><div>all these years with out knowing the father of Software Engineering. ;) He has published many papers regarding Software Architecture. </div>Nadun Herathhttp://www.blogger.com/profile/17165120693130686126noreply@blogger.com0tag:blogger.com,1999:blog-1267672026707653763.post-90206500536668143452010-10-15T11:04:00.004+05:302010-10-17T16:08:26.837+05:30Brief Introduction to Object Oriented Programming FundamentalsMain Fundamental concepts of Object Oriented Programming are<div><br /><div><span class="Apple-tab-span" style="white-space:pre"> </span>1. Data Abstraction</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>2. Encapsulation</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>3. Polymorphism</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>4. Inheritance</div><div><br /></div><div>1. Data Abstraction - Process of Grouping together fields and methods and defining classes. </div><div><br /></div><div>2.Data Encapsulation - Hiding the implementation details. Provides a barrier to prevent misuse. </div><div><br /></div><div>3.Inheritance - Receiving responsibility of parents. </div><div><br /></div><div>4. Polymorphism - Ability to substitute a one type for another type at runtime. It's also called <span class="Apple-tab-span" style="white-space:pre"> </span> dynamic binding and late binding. Overriding is directly related to this. </div></div>Nadun Herathhttp://www.blogger.com/profile/17165120693130686126noreply@blogger.com0tag:blogger.com,1999:blog-1267672026707653763.post-53777684010215274022010-08-27T12:51:00.007+05:302010-10-15T11:27:45.507+05:30Huawei E220, the device has been disconnected or is unavailable<div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); line-height: 20px; "><span class="Apple-style-span" style="font-family:'times new roman';"><span class="Apple-style-span" style="font-size:medium;">Huawei USB modem didn't work in my Windows Vista laptop. </span></span><a href="http://www.mobilebroadbandrocks.com/device/huawei-e220"><span class="Apple-style-span" style="font-family:'times new roman';"><span class="Apple-style-span" style="font-size:medium;">my2cent </span></span></a><span class="Apple-style-span" style="font-family:'times new roman';"><span class="Apple-style-span" style="font-size:medium;">blog helped me to resolve the issue. :)</span></span></span></div><div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); line-height: 20px; "><span class="Apple-style-span" style="font-family:'times new roman';"><span class="Apple-style-span" style="font-size:medium;">You can download Huawei E220 Vista Firmware (v11.110.05.00.00) from the link below.</span></span></span></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); line-height: 20px; font-family:Arial, Helvetica, sans-serif;font-size:12px;"></span><a href="http://www.mobilebroadbandrocks.com/download/huawei-e220-vista-firmware-v11110050000">http://www.mobilebroadbandrocks.com/download/huawei-e220-vista-firmware-v11110050000</a><span class="Apple-style-span" style="color: rgb(51, 51, 51); line-height: 20px; font-family:Arial, Helvetica, sans-serif;font-size:12px;"></span></div></div></div><div><br /></div><div>As in the screen shot below shows Device manager should list Huawei in the Modems section if the device has been correctly install in the machine.<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: rgb(51, 51, 51); line-height: 20px; "> </span></div><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzUuAABdbSDu1wdZCmpUTQWh1eEOzrYFiVUnDCFawTj4nVhN6qXj8BBnLYGzeuA8aVLhaP6nLcSzEDA4N4ZGGxi766IL4VlxAUJ_y8xGO2s8ZOCuah9tquZjTZONs1omtCgdaKZnA3TTM/s1600/Untitled.jpg"><img style="cursor:pointer; cursor:hand;width: 320px; height: 200px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzUuAABdbSDu1wdZCmpUTQWh1eEOzrYFiVUnDCFawTj4nVhN6qXj8BBnLYGzeuA8aVLhaP6nLcSzEDA4N4ZGGxi766IL4VlxAUJ_y8xGO2s8ZOCuah9tquZjTZONs1omtCgdaKZnA3TTM/s320/Untitled.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5509990781429452690" /></a><br /><div><span class="Apple-style-span" style="font-family:Arial, Helvetica, sans-serif;color:#333333;"><span class="Apple-style-span" style="line-height: 20px; font-size: -webkit-xxx-large;"><span class="Apple-style-span" style="font-family:'times new roman';font-size:130%;"><span class="Apple-style-span" style="font-size: 16px;"><br /></span></span></span></span></div><div><span class="Apple-style-span" style="font-family:Arial, Helvetica, sans-serif;color:#333333;"><span class="Apple-style-span" style="line-height: 20px; font-size: -webkit-xxx-large;"><span class="Apple-style-span" style="font-family:'times new roman';font-size:130%;"><span class="Apple-style-span" style="font-size: 16px;"><br /></span></span></span></span></div><div><span class="Apple-style-span"><span class="Apple-style-span" style="line-height: 20px;">Few days after writing this blog post I dicovered what is causing me this problem. It's VMWare. I uninstall that and now device works fine. :)</span></span></div><div><span class="Apple-style-span" style="font-family:Arial, Helvetica, sans-serif;color:#333333;"><span class="Apple-style-span" style="line-height: 20px; font-size: -webkit-xxx-large;"><span class="Apple-style-span" style="font-family:'times new roman';font-size:130%;"><span class="Apple-style-span" style="font-size: 16px;"><br /></span></span></span></span></div><div><div><span class="Apple-style-span" style="font-family:Arial, Helvetica, sans-serif;color:#333333;"><span class="Apple-style-span" style="line-height: 20px; font-size:small;"><br /></span></span></div></div>Nadun Herathhttp://www.blogger.com/profile/17165120693130686126noreply@blogger.com1tag:blogger.com,1999:blog-1267672026707653763.post-4653694705735498122010-04-27T09:45:00.004+05:302010-04-27T10:15:21.996+05:30Flowers<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhO4-PCTU381aVObVEEW0VmKpORaZKZnVMqlWla5-D7jLzD5IobTAxbx6XUqGQULnaGpUCR1KeEY1JG5fv9TJ3kIBV2ChHTjiOfMQjNyogOCu7C6Oyx5E4iOET2Yo9C-6C2PrYXjVNvu-0/s1600/22042010287.jpg"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhO4-PCTU381aVObVEEW0VmKpORaZKZnVMqlWla5-D7jLzD5IobTAxbx6XUqGQULnaGpUCR1KeEY1JG5fv9TJ3kIBV2ChHTjiOfMQjNyogOCu7C6Oyx5E4iOET2Yo9C-6C2PrYXjVNvu-0/s320/22042010287.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5464673642301908402" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMBsBhdt7uA6bLHIKRagqaadq-bb0Izxj0t7c3IlbuBg2CmDn-JKi_Ij-uEdvV9n0iL_rNPaO_fzBTDoleHSWMUPsC-g4SrHTSXnqzcmXjAf3w9C7ScNiebBHiKf7PATbz1ylACsZW1fE/s1600/13042010266.jpg"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMBsBhdt7uA6bLHIKRagqaadq-bb0Izxj0t7c3IlbuBg2CmDn-JKi_Ij-uEdvV9n0iL_rNPaO_fzBTDoleHSWMUPsC-g4SrHTSXnqzcmXjAf3w9C7ScNiebBHiKf7PATbz1ylACsZW1fE/s320/13042010266.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5464673383404885746" /></a>Nadun Herathhttp://www.blogger.com/profile/17165120693130686126noreply@blogger.com1tag:blogger.com,1999:blog-1267672026707653763.post-60305232516768006962010-04-27T09:35:00.004+05:302010-04-27T09:44:30.465+05:30How to view .bin and .cue media files<span class="Apple-style-span" style="font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 14px; color: rgb(17, 17, 17); line-height: 22px; "><div><span class="Apple-style-span" style="font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 14px; color: rgb(17, 17, 17); line-height: 22px; ">I used powerISO and it was easy. You can find more info regarding this</span></div><div><span class="Apple-style-span" style="font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 14px; color: rgb(17, 17, 17); line-height: 22px; "><a href="http://theos.in/windows-vista/howto-play-bin-movie-dvd-file/">Watch .bin movie file with Windows VLC player</a></span></div><div><br /></div><div>Tried to use Demon Pro too. It didn't work out well. Maybe you might be lucky. ;)</div><div><a href="http://netforbeginners.about.com/od/peersharing/ss/playingbinfiles.htm">How to play .bin, .cue, .dat and .rar movie file</a></div><div><span class="Apple-style-span" style="font-family:Arial;font-size:6;color:#3E3E3E;"><span class="Apple-style-span" style="font-size: 22px; line-height: 26px;"><br /></span></span></div></span>Nadun Herathhttp://www.blogger.com/profile/17165120693130686126noreply@blogger.com0tag:blogger.com,1999:blog-1267672026707653763.post-66621994084213332892010-04-16T23:44:00.005+05:302010-04-17T11:07:46.009+05:30Advance Google Searching<div>Google is the leader when it comes to search engines. With the google search engine here are some techniques to get various kind of usual information. </div><div><br /></div><div><br /></div># (site:) - Domain restricted search. Shows how many URLs are indexed by Google from a directory including all the sub domains. Also shows sites of specific top level domain. <div> <span class="Apple-tab-span" style="white-space:pre"> </span>e.g; site:www.google.com, site: google.com, site: lk<br /><br /><div># (inurl:) -Narrows the search to urls with the given word.<br /><span class="Apple-tab-span" style="white-space:pre"> </span>e.g: inurl:cricket This gives urls which contain word cricket</div><div><br /># (intitle:)- Narrows the seach to urls where title of the page contains the given parameter<br /><span class="Apple-tab-span" style="white-space:pre"> </span>e.g intitle:seo - This gives search results which contain seo in the title</div><div><br /># (inanchor:) -Narrows the seach to urls most powerful backlinks which contain the the given parameter<br /><span class="Apple-tab-span" style="white-space:pre"> </span>e.g inanchor:srilanka<span class="Apple-tab-span" style="white-space:pre"> </span></div><div><span class="Apple-tab-span" style="white-space:pre"><br /></span></div><div><span class="Apple-tab-span" style="white-space:pre"></span># <span class="Apple-tab-span" style="white-space:pre">(</span>intext:) - Find the pages with most optimized relevant body text. </div><div><span class="Apple-tab-span" style="white-space:pre"> </span>e.g intext:seo</div><div><br /></div><div># (ext:)/(filetype:) - Seaches pages that ends with given extension</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>e.g ext:py , filetype:py</div><div><br /></div><div># (related:) - Gives similar sites which they are linked to. </div><div><span class="Apple-tab-span" style="white-space:pre"> </span>e.g related:www.cricinfo.com</div><div><br /></div><div># (info:) - Gives information about a site such as web pages that are similar, web pages that link to the site, web pages that contain the given term etc. </div><div><span class="Apple-tab-span" style="white-space:pre"> </span> e.g info:www.example.com</div><div><br /></div><div># (cache:) - See what the page looks like when google crawls it.</div><div><br /></div><div># ~keyword - Show key words that google think are related</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>e.g ~car ~rentals - Will give results that related to zoo car and rentals </div><div><br /></div><div># "" - Gives results with the exact words withing the quotes.</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>e.g "I love my country" <span class="Apple-tab-span" style="white-space:pre"> </span></div><div><span class="Apple-tab-span" style="white-space:pre"><br /></span></div></div>Nadun Herathhttp://www.blogger.com/profile/17165120693130686126noreply@blogger.com1tag:blogger.com,1999:blog-1267672026707653763.post-48665090745605638812010-04-15T10:10:00.002+05:302010-04-15T10:25:10.778+05:30How to block a web site in Windows Vista<span class="Apple-style-span" style="font-family:'times new roman';">Sometimes you may need to block web site. You can easily achieve this by using Windows Hosts file. Hosts file is located in </span><span class="Apple-style-span" style="font-size: 14px; line-height: 24px; "><span class="Apple-style-span" style="font-family:'times new roman';">C:\WINDOWS\SYSTEM32\DRIVERS\ETC. Open that in Notepad. As an exaple if you want to block the site www.example.com include this lines at the bottom of the file.</span></span><div><span class="Apple-style-span" style="font-family:'times new roman';font-size:130%;"><span class="Apple-style-span" style="font-size: 14px; line-height: 24px;"><br /></span></span><div><span class="Apple-style-span" style="font-size: 14px; line-height: 24px; "><span class="Apple-style-span" style="font-family:'times new roman';">127.0.0.1 example.com<br />127.0.0.1 www.example.com</span></span></div><div><span class="Apple-style-span" style="font-family: Arial, Helvetica; font-size: 14px; line-height: 24px; "><br /></span></div><div><span class="Apple-style-span" style="font-family: Arial, Helvetica; font-size: 14px; line-height: 24px; ">You can find more information regarding this in <a href="http://www.gohacking.com/2008/01/how-to-block-website.html">gohacking </a></span></div></div>Nadun Herathhttp://www.blogger.com/profile/17165120693130686126noreply@blogger.com0tag:blogger.com,1999:blog-1267672026707653763.post-50718191627548352082010-04-06T16:41:00.003+05:302010-04-06T16:47:14.281+05:30Importance of Software Testing<p class="topmargin"><a name="FAQ1_3">Don't ever take software testing for granted. </a></p><p class="topmargin"><a name="FAQ1_3"><b></b></a><b><a href="http://www.softwareqatest.com/qatfaq1.html#FAQ1_3">Source</a> -http://www.softwareqatest.com/</b></p><p class="topmargin"><a name="FAQ1_3"><b><span class="Apple-style-span" style="font-weight: normal; "></span></b></a><b><a name="FAQ1_3"><b><span class="Apple-style-span" style="font-weight: normal; "></span></b></a><b><a name="FAQ1_3"><b> some recent major computer system failures caused by software bugs?</b></a></b><b></b></b></p><ul><li>It was reported in August 2009 that a large suburban school district introduced a new computer system that was 'plagued with bugs' and resulted in many students starting the school year without schedules or with incorrect schedules, and many problems with grades. Upset students and parents started a social networking site for sharing complaints.</li> <li> In February of 2009 users of a major search engine site were prevented from clicking through to sites listed in search results for part of a day. It was reportedly due to software that did not effectively handle a mistakenly-placed "/" in an internal ancillary reference file that was frequently updated for use by the search engine. Users, instead of being able to click thru to listed sites, were instead redirected to an intermediary site which, as a result of the suddenly enormous load, was rendered unusable.</li> <li> A large health insurance company was reportedly banned by regulators from selling certain types of insurance policies in January of 2009 due to ongoing computer system problems that resulted in denial of coverage for needed medications and mistaken overcharging or cancelation of benefits. The regulatory agency was quoted as stating that the problems were posing "a serious threat to the health and safety" of beneficiaries.</li> <li> A news report in January 2009 indicated that a major IT and management consulting company was still battling years of problems in implementing its own internal accounting systems, including a 2005 implementation that reportedly "was attempted without adequate testing".</li> <li> In August of 2008 it was reported that more than 600 U.S. airline flights were significantly delayed due to a software glitch in the U.S. FAA air traffic control system. The problem was claimed to be a 'packet switch' that 'failed due to a database mismatch', and occurred in the part of the system that handles required flight plans. </li> <li> Software system problems at a large health insurance company in August 2008 were the cause of a privacy breach of personal health information for several hundred thousand customers, according to news reports. It was claimed that the problem was due to software that 'was not comprehensively tested'. </li> <li> A major clothing retailer was reportedly hit with significant software and system problems when attempting to upgrade their online retailing systems in June 2008. Problems remained ongoing for some time. When the company made their public quarterly financial report, the software and system problems were claimed as the cause of the poor financial results.</li> <li> Software problems in the automated baggage sorting system of a major airport in February 2008 prevented thousands of passengers from checking baggage for their flights. It was reported that the breakdown occurred during a software upgrade, despite pre-testing of the software. The system continued to have problems in subsequent months.</li> <li> News reports in December of 2007 indicated that significant software problems were continuing to occur in a new ERP payroll system for a large urban school system. It was believed that more than one third of employees had received incorrect paychecks at various times since the new system went live the preceding January, resulting in overpayments of $53 million, as well as underpayments. An employees' union brought a lawsuit against the school system, the cost of the ERP system was expected to rise by 40%, and the non-payroll part of the ERP system was delayed. Inadequate testing reportedly contributed to the problems. The school system was still working on cleaning up the aftermath of the problems in December 2009, going so far as to bring lawsuits against some employees to get them to return overpayments. </li> <li> In November of 2007 a regional government reportedly brought a multi-million dollar lawsuit against a software services vendor, claiming that the vendor 'minimized quality' in delivering software for a large criminal justice information system and the system did not meet requirements. The vendor also sued its subcontractor on the project.</li> <li> In June of 2007 news reports claimed that software flaws in a popular online stock-picking contest could be used to gain an unfair advantage in pursuit of the game's large cash prizes. Outside investigators were called in and in July the contest winner was announced. Reportedly the winner had previously been in 6th place, indicating that the top 5 contestants may have been disqualified.</li> <li> A software problem contributed to a rail car fire in a major underground metro system in April of 2007 according to newspaper accounts. The software reportedly failed to perform as expected in detecting and preventing excess power usage in equipment on new passenger rail cars, resulting in overheating and fire in the rail car, and evacuation and shutdown of part of the system.</li> <li> Tens of thousands of medical devices were recalled in March of 2007 to correct a software bug. According to news reports, the software would not reliably indicate when available power to the device was too low.</li> <li> A September 2006 news report indicated problems with software utilized in a state government's primary election, resulting in periodic unexpected rebooting of voter checkin machines, which were separate from the electronic voting machines, and resulted in confusion and delays at voting sites. The problem was reportedly due to insufficient testing.</li> <li> In August of 2006 a U.S. government student loan service erroneously made public the personal data of as many as 21,000 borrowers on it's web site, due to a software error. The bug was fixed and the government department subsequently offered to arrange for free credit monitoring services for those affected.</li> <li> A software error reportedly resulted in overbilling of up to several thousand dollars to each of 11,000 customers of a major telecommunications company in June of 2006. It was reported that the software bug was fixed within days, but that correcting the billing errors would take much longer.</li> <li> News reports in May of 2006 described a multi-million dollar lawsuit settlement paid by a healthcare software vendor to one of its customers. It was reported that the customer claimed there were problems with the software they had contracted for, including poor integration of software modules, and problems that resulted in missing or incorrect data used by medical personnel.</li> <li> In early 2006 problems in a government's financial monitoring software resulted in incorrect election candidate financial reports being made available to the public. The government's election finance reporting web site had to be shut down until the software was repaired.</li> <li> Trading on a major Asian stock exchange was brought to a halt in November of 2005, reportedly due to an error in a system software upgrade. The problem was rectified and trading resumed later the same day.</li> <li> A May 2005 newspaper article reported that a major hybrid car manufacturer had to install a software fix on 20,000 vehicles due to problems with invalid engine warning lights and occasional stalling. In the article, an automotive software specialist indicated that the automobile industry spends $2 billion to $3 billion per year fixing software problems.</li> <li> Media reports in January of 2005 detailed severe problems with a $170 million high-profile U.S. government IT systems project. Software testing was one of the five major problem areas according to a report of the commission reviewing the project. In March of 2005 it was decided to scrap the entire project.</li> <li> In July 2004 newspapers reported that a new government welfare management system in Canada costing several hundred million dollars was unable to handle a simple benefits rate increase after being put into live operation. Reportedly the original contract allowed for only 6 weeks of acceptance testing and the system was never tested for its ability to handle a rate increase.</li> <li> Millions of bank accounts were impacted by errors due to installation of inadequately tested software code in the transaction processing system of a major North American bank, according to mid-2004 news reports. Articles about the incident stated that it took two weeks to fix all the resulting errors, that additional problems resulted when the incident drew a large number of e-mail phishing attacks against the bank's customers, and that the total cost of the incident could exceed $100 million.</li> <li> A bug in site management software utilized by companies with a significant percentage of worldwide web traffic was reported in May of 2004. The bug resulted in performance problems for many of the sites simultaneously and required disabling of the software until the bug was fixed.</li> <li> According to news reports in April of 2004, a software bug was determined to be a major contributor to the 2003 Northeast blackout, the worst power system failure in North American history. The failure involved loss of electrical power to 50 million customers, forced shutdown of 100 power plants, and economic losses estimated at $6 billion. The bug was reportedly in one utility company's vendor-supplied power monitoring and management system, which was unable to correctly handle and report on an unusual confluence of initially localized events. The error was found and corrected after examining millions of lines of code. </li> <li> In early 2004, news reports revealed the intentional use of a software bug as a counter-espionage tool. According to the report, in the early 1980's one nation surreptitiously allowed a hostile nation's espionage service to steal a version of sophisticated industrial software that had intentionally-added flaws. This eventually resulted in major industrial disruption in the country that used the stolen flawed software.</li> <li> A major U.S. retailer was reportedly hit with a large government fine in October of 2003 due to web site errors that enabled customers to view one anothers' online orders.</li> <li> News stories in the fall of 2003 stated that a manufacturing company recalled all their transportation products in order to fix a software problem causing instability in certain circumstances. The company found and reported the bug itself and initiated the recall procedure in which a software upgrade fixed the problems.</li> <li> In August of 2003 a U.S. court ruled that a lawsuit against a large online brokerage company could proceed; the lawsuit reportedly involved claims that the company was not fixing system problems that sometimes resulted in failed stock trades, based on the experiences of 4 plaintiffs during an 8-month period. A previous lower court's ruling that "...six miscues out of more than 400 trades does not indicate negligence." was invalidated. </li> <li> In April of 2003 it was announced that a large student loan company in the U.S. made a software error in calculating the monthly payments on 800,000 loans. Although borrowers were to be notified of an increase in their required payments, the company will still reportedly lose $8 million in interest. The error was uncovered when borrowers began reporting inconsistencies in their bills.</li> <li> News reports in February of 2003 revealed that the U.S. Treasury Department mailed 50,000 Social Security checks without any beneficiary names. A spokesperson indicated that the missing names were due to an error in a software change. Replacement checks were subsequently mailed out with the problem corrected, and recipients were then able to cash their Social Security checks.</li> <li> In March of 2002 it was reported that software bugs in Britain's national tax system resulted in more than 100,000 erroneous tax overcharges. The problem was partly attributed to the difficulty of testing the integration of multiple systems.</li> <li> A newspaper columnist reported in July 2001 that a serious flaw was found in off-the-shelf software that had long been used in systems for tracking certain U.S. nuclear materials. The same software had been recently donated to another country to be used in tracking their own nuclear materials, and it was not until scientists in that country discovered the problem, and shared the information, that U.S. officials became aware of the problems.</li> <li> According to newspaper stories in mid-2001, a major systems development contractor was fired and sued over problems with a large retirement plan management system. According to the reports, the client claimed that system deliveries were late, the software had excessive defects, and it caused other systems to crash. </li> <li> In January of 2001 newspapers reported that a major European railroad was hit by the aftereffects of the Y2K bug. The company found that many of their newer trains would not run due to their inability to recognize the date '31/12/2000'; the trains were started by altering the control system's date settings.</li> <li> News reports in September of 2000 told of a software vendor settling a lawsuit with a large mortgage lender; the vendor had reportedly delivered an online mortgage processing system that did not meet specifications, was delivered late, and didn't work.</li> <li> In early 2000, major problems were reported with a new computer system in a large suburban U.S. public school district with 100,000+ students; problems included 10,000 erroneous report cards and students left stranded by failed class registration systems; the district's CIO was fired. The school district decided to reinstate it's original 25-year old system for at least a year until the bugs were worked out of the new system by the software vendors.</li> <li> A review board concluded that the NASA Mars Polar Lander failed in December 1999 due to software problems that caused improper functioning of retro rockets utilized by the Lander as it entered the Martian atmosphere.</li> <li> In October of 1999 the $125 million NASA Mars Climate Orbiter spacecraft was believed to be lost in space due to a simple data conversion error. It was determined that spacecraft software used certain data in English units that should have been in metric units. Among other tasks, the orbiter was to serve as a communications relay for the Mars Polar Lander mission, which failed for unknown reasons in December 1999. Several investigating panels were convened to determine the process failures that allowed the error to go undetected.</li> <li> Bugs in software supporting a large commercial high-speed data network affected 70,000 business customers over a period of 8 days in August of 1999. Among those affected was the electronic trading system of the largest U.S. futures exchange, which was shut down for most of a week as a result of the outages.</li> <li> In April of 1999 a software bug caused the failure of a $1.2 billion U.S. military satellite launch, the costliest unmanned accident in the history of Cape Canaveral launches. The failure was the latest in a string of launch failures, triggering a complete military and industry review of U.S. space launch programs, including software integration and testing processes. Congressional oversight hearings were requested.</li> <li> A small town in Illinois in the U.S. received an unusually large monthly electric bill of $7 million in March of 1999. This was about 700 times larger than its normal bill. It turned out to be due to bugs in new software that had been purchased by the local power company to deal with Y2K software issues.</li> <li> In early 1999 a major computer game company recalled all copies of a popular new product due to software problems. The company made a public apology for releasing a product before it was ready.</li> <li> The computer system of a major online U.S. stock trading service failed during trading hours several times over a period of days in February of 1999 according to nationwide news reports. The problem was reportedly due to bugs in a software upgrade intended to speed online trade confirmations. </li> <li>In April of 1998 a major U.S. data communications network failed for 24 hours, crippling a large part of some U.S. credit card transaction authorization systems as well as other large U.S. bank, retail, and government data systems. The cause was eventually traced to a software bug.</li> <li>January 1998 news reports told of software problems at a major U.S. telecommunications company that resulted in no charges for long distance calls for a month for 400,000 customers. The problem went undetected until customers called up with questions about their bills.</li> <li>In November of 1997 the stock of a major health industry company dropped 60% due to reports of failures in computer billing systems, problems with a large database conversion, and inadequate software testing. It was reported that more than $100,000,000 in receivables had to be written off and that multi-million dollar fines were levied on the company by government agencies.</li> <li>A retail store chain filed suit in August of 1997 against a transaction processing system vendor (not a credit card company) due to the software's inability to handle credit cards with year 2000 expiration dates.</li> <li>In August of 1997 one of the leading consumer credit reporting companies reportedly shut down their new public web site after less than two days of operation due to software problems. The new site allowed web site visitors instant access, for a small fee, to their personal credit reports. However, a number of initial users ended up viewing each others' reports instead of their own, resulting in irate customers and nationwide publicity. The problem was attributed to "...unexpectedly high demand from consumers and faulty software that routed the files to the wrong computers."</li> <li>In November of 1996, newspapers reported that software bugs caused the 411 telephone information system of one of the U.S. RBOC's to fail for most of a day. Most of the 2000 operators had to search through phone books instead of using their 13,000,000-listing database. The bugs were introduced by new software modifications and the problem software had been installed on both the production and backup systems. A spokesman for the software vendor reportedly stated that 'It had nothing to do with the integrity of the software. It was human error.'</li> <li> On June 4 1996 the first flight of the European Space Agency's new Ariane 5 rocket failed shortly after launching, resulting in an estimated uninsured loss of a half billion dollars. It was reportedly due to the lack of exception handling of a floating-point error in a conversion from a 64-bit integer to a 16-bit signed integer.</li> <li>Software bugs caused the bank accounts of 823 customers of a major U.S. bank to be credited with $924,844,208.32 each in May of 1996, according to newspaper reports. The American Bankers Association claimed it was the largest such error in banking history. A bank spokesman said the programming errors were corrected and all funds were recovered.</li> <li> In August 1991 the concrete base structure for a North Sea oil platform imploded and sank off the coast of Norway, reportedly due to errors in initially-used design software. The enormous structure, on hitting the seabed, reportedly was detected as a magnitude 3.0 seismic event and resulted in a loss of $700 million. The base structure was eventually redesigned and the full platform was completed two years later, and was still in use as of 2008.</li> <li> On January 1 1984 all computers produced by one of the leading minicomputer makers of the time reportedly failed worldwide. The cause was claimed to be a leap year bug in a date handling function utilized in deletion of temporary operating system files. Technicians throughout the world worked for several days to clear up the problem. It was also reported that the same bug affected many of the same computers four years later. </li> <li>Software bugs in a Soviet early-warning monitoring system nearly brought on nuclear war in 1983, according to news reports in early 1999. The software was supposed to filter out false missile detections caused by Soviet satellites picking up sunlight reflections off cloud-tops, but failed to do so. Disaster was averted when a Soviet commander, based on what he said was a '...funny feeling in my gut', decided the apparent missile attack was a false alarm. The filtering software code was rewritten.</li></ul>Nadun Herathhttp://www.blogger.com/profile/17165120693130686126noreply@blogger.com7tag:blogger.com,1999:blog-1267672026707653763.post-47705341479792764852010-03-29T16:38:00.002+05:302010-03-29T16:41:47.989+05:30.NET Threads<a href="http://msdn.microsoft.com/en-us/library/1c9txz50.aspx">http://msdn.microsoft.com/en-us/library/1c9txz50.aspx</a> - Threads best practices<div><br /></div><div><a href="http://msdn.microsoft.com/en-us/library/8xs8549b.aspx">http://msdn.microsoft.com/en-us/library/8xs8549b.aspx</a> - BackGroundWorker</div>Nadun Herathhttp://www.blogger.com/profile/17165120693130686126noreply@blogger.com0tag:blogger.com,1999:blog-1267672026707653763.post-37038687373244463932010-03-23T14:04:00.000+05:302010-03-23T14:06:02.754+05:30.NET Programming Standards and Naming Conventions<div><br /></div> <a href="http://www.irritatedvowel.com/Programming/Standards.aspx">http://www.irritatedvowel.com/Programming/Standards.aspx</a>Nadun Herathhttp://www.blogger.com/profile/17165120693130686126noreply@blogger.com0tag:blogger.com,1999:blog-1267672026707653763.post-5082528767007448112010-03-10T19:08:00.003+05:302010-03-10T19:28:32.921+05:30Garu Emathituma ! ගරු ඈමතිතුමා<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj84iExRiVA6UFs8EHR0h06jt-I8NIAxp2IS7fWvNl83cLmjlsapf-5zsp586ku6Erh9hTfsdUq2bdMT913MH8LujrFwwaN1gMTlR4xm69RQ08Vp0C5OIH6PGx8R7ubzIHpJd9770PFf6g/s1600-h/26138_110037239010685_100000132289576_244214_3234972_n.jpg"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 232px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj84iExRiVA6UFs8EHR0h06jt-I8NIAxp2IS7fWvNl83cLmjlsapf-5zsp586ku6Erh9hTfsdUq2bdMT913MH8LujrFwwaN1gMTlR4xm69RQ08Vp0C5OIH6PGx8R7ubzIHpJd9770PFf6g/s320/26138_110037239010685_100000132289576_244214_3234972_n.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5446999366152157938" /></a><br /><div><span class="Apple-tab-span" style="white-space:pre"> </span>In my opinion Sanath is hitting below the belt by deciding continue to play cricket while contesting in the election. This move is really disastrous to Sri Lankan Cricket. First time in the history, game loved by all Sri Lankans is politicized. In my opinion is Sanath is the most selfish cricketer ever to play for Sri Lanka. After playing 20 years why can't he make up his mind to retire gracefully and give chances to talented youngsters. Adding salt to the wound he is not consistence at all these days. If he played for an another country he must have dropped long time ago. Knowing Sanath I think he will try to play in the 2015 world cup too. He will be an automatic choice for the team cause he has political backing. Selectors will be powerless. Sad state of affairs. Who is to be blamed.? Sanath or politics.?</div>Nadun Herathhttp://www.blogger.com/profile/17165120693130686126noreply@blogger.com0