tag:blogger.com,1999:blog-25288660898154064472024-03-19T03:01:05.476-07:00Code KetchupMade By Nayana AdassuriyaUnknownnoreply@blogger.comBlogger31125tag:blogger.com,1999:blog-2528866089815406447.post-3835653257958117872018-04-25T23:52:00.002-07:002018-04-25T23:54:34.252-07:00How to add project level Preprocessor Definitions to a C# project<div class="separator" style="clear: both; text-align: center;">
</div>
<h2>
Using GUI</h2>
<br />
<ol>
<li>Open the project in Visual Studio</li>
<li>Right-Click on the project file in the solution explorer go to properties</li>
<li>Go to<span style="color: #999999;"> <i>Build tab</i></span> and Make sure you select the <span style="color: #999999;"><i>All Configurations</i></span> in the configuration drop down</li>
<li>Make sure selected the <span style="color: #999999;"><i>All Platforms</i></span> in Platform drop-down</li>
<li>Type the <span style="color: #999999;"><i>Preprocessor Definitions</i></span> you want in the Conditional Compilation Symbols text box separated by semicolon </li>
</ol>
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUNu95V3Z-TQDkdVRw02QG3yNvK25t1eJ28sSgtJ6uwwpfuobVSZNB9REpy2XO7xvMRoNfajd2F6GA0aqlfvaxQAk5sQRqzHmTaOw5TEiGLPgxCb4ks8uzWmgOVMwOdzt4y3an04Dh32om/s1600/Untitled.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="181" data-original-width="686" height="168" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUNu95V3Z-TQDkdVRw02QG3yNvK25t1eJ28sSgtJ6uwwpfuobVSZNB9REpy2XO7xvMRoNfajd2F6GA0aqlfvaxQAk5sQRqzHmTaOw5TEiGLPgxCb4ks8uzWmgOVMwOdzt4y3an04Dh32om/s640/Untitled.jpg" width="640" /></a><br />
<br /><br />
<h2>
Directly in to Project file</h2>
<br />
<ol>
<li>Open the project file in a Text Editor </li>
<li>Copy and paste this code to end of existing PropertyGroup</li>
<span style="color: #999999;"><i> <PropertyGroup Condition="'$(VariableName)'=='VarableValue'"> <DefineConstants>PDEF1;PDEF2;PDEF3</DefineConstants> </PropertyGroup> </i></span><br />
<li>If you not required to add a condition, delete the Condition="'$(VariableName)'=='VarableValue'" part</li>
<li>Save the project file and open from Visual Studio</li>
</ol>
Unknownnoreply@blogger.com6tag:blogger.com,1999:blog-2528866089815406447.post-33167071892760268152016-05-04T20:52:00.002-07:002016-05-04T20:53:36.943-07:00How to clean and reset Jenkins build historyWhen you working with Jenkins while building your solution, definitely you have to run your project multiple times. It will result to a long Build History list that looks ugly and unnecessary for your production environment.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhH_WIYsP8jdEOsenlxgxOCc_h2zXPdJKlcKjt4L4vqzJnMPaGdpdJqpJ5G4_DuMSBdbcaVx22ivVFj0vu0vwR9IBH1arspgpyhZPWTpmh752L0mo-jmLm1OGw-HVDC1JdJf3qJCSgDnPF0/s1600/j_1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhH_WIYsP8jdEOsenlxgxOCc_h2zXPdJKlcKjt4L4vqzJnMPaGdpdJqpJ5G4_DuMSBdbcaVx22ivVFj0vu0vwR9IBH1arspgpyhZPWTpmh752L0mo-jmLm1OGw-HVDC1JdJf3qJCSgDnPF0/s400/j_1.jpg" width="251" /></a></div>
If you need to clean this Build History, and reset the build number, you can run a simple script in Jenkins Script Console. Here are the steps to do so.<br />
<br />
<span style="font-size: large;">1. Go to `Jenkins Script Console`</span><br />
Go to your Jenkins home page > Manage Jenkins > Script Console<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4usD3VDk5n2ZQmixwTfdI494OOq1xNaCDQx_LLmVYMeIoVfFVIkDYg8g591IYJla7CMZ0OQyFFHckkUcSK0lnT7TZswGkwmYlUpqmVWTHTSsHBWSEcuWxH7Dw3Uh0yp5LvuLa0MPBT_Vm/s1600/j_2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="472" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4usD3VDk5n2ZQmixwTfdI494OOq1xNaCDQx_LLmVYMeIoVfFVIkDYg8g591IYJla7CMZ0OQyFFHckkUcSK0lnT7TZswGkwmYlUpqmVWTHTSsHBWSEcuWxH7Dw3Uh0yp5LvuLa0MPBT_Vm/s640/j_2.jpg" width="640" /></a></div>
<br />
<span style="font-size: large;">2. Run the script to clean and reset</span><br />
<br />
Copy and paste this script to your Console Script text area and change the "copy_folder" to project name that you need to clean the history. Then click the "Run button". <br />
<br />
<br />
<pre class="prettyprint">def jobName = "copy_folder"
def job = Jenkins.instance.getItem(jobName)
job.getBuilds().each { it.delete() }
job.nextBuildNumber = 1
job.save()
</pre>
<p>Now check your Build History for the particular project, Wow!, it's clean now!</p>
Unknownnoreply@blogger.com45tag:blogger.com,1999:blog-2528866089815406447.post-24541389971563748762016-03-10T04:42:00.003-08:002016-03-10T17:53:36.938-08:00How to setup RAID 0 with SSD, Step by step giudeAs you know in the computer hardware world reading and writing to the storage disk is the bottleneck for the data transfer. Even though processors an memory chips getting faster and faster, Hard disk reading and writing technologies did not meet the requirement that industry expected. But, recently after SSD (Solid State Drive) reached to the market, Users got quite comfort because of the data read and write speed if they ignore the risk of lost data.<br />
<br />
You may need more and more speed to read and write data to the storage because of these kind of applications. <br />
<ul>
<li>Compile large source code base</li>
<li>Video editing & rendering</li>
<li>Working with large CAD files or plans</li>
<li>Search in large set of data (Big Data)</li>
<li>Search in large databases (Geographical Map Data)</li>
<li>Playing Computer Games</li>
</ul>
If so best solution for you is setting up <a href="https://en.wikipedia.org/wiki/Standard_RAID_levels#RAID_0">RAID 0</a> with multiple SSDs. So here is the step by step guide how to setup "RAID 0" with two SSDs.<br />
<br />
<br />
<span style="font-size: x-large;">1.</span> <span style="font-size: large;">Backup all the data in your computer and you might need to reinstall the OS.</span><br />
<br />
After setting the RAID all of the data in SSD will lost. So if you need the data in SSDs please backup all of those. By right other drivers should not affect by setting RAID on newly added SSDs. But in my case my Windows 10 OS corrupted after setting RAID. So be prepare or trust the God. I suggest you to back up all the things in the Desktop, bookmarks etc.. <br />
<br />
<br />
<span style="font-size: x-large;">2.</span> <span style="font-size: large;">Prepare the necessary hardware.</span><br />
<ul>
<li>Your motherboard should support to configure RAID (Check motherboard details or BIOS setting) and should have two free SATA slots.</li>
</ul>
<div style="text-align: center;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjX4jVBpSokj8zs6rvVmHUsJszxnkHC87MJUFb0hTcc-M2454TQ24KzO-UA1HbsbT4n6U25bw212cRyBYjLRCfK_yZ5qMXN9XqcRtKdVao8tA_OX6BIscaIgvI13ziAy1fngBULRO7ipE_M/s1600/sata-slot-motherboard.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjX4jVBpSokj8zs6rvVmHUsJszxnkHC87MJUFb0hTcc-M2454TQ24KzO-UA1HbsbT4n6U25bw212cRyBYjLRCfK_yZ5qMXN9XqcRtKdVao8tA_OX6BIscaIgvI13ziAy1fngBULRO7ipE_M/s200/sata-slot-motherboard.jpg" width="178" /></a></div>
</div>
<ul>
</ul>
<ul>
<li>Two (or more) SSDs <span style="color: red;">with same capacity</span> (In my case I have two 1TB SSDs)</li>
</ul>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRnXnQKjrQ7fdefDG-Hnc-GXAaFwbnRX5rMkjb8fRpt-Z54yTXkEIvDFKS55Yiay3htAPcGRam_LtdJ7xdg7Fgv6qiy3Np1Z80xKaL1moEDGQ6bMFlCRTnRSo4cR4_yTbOtZDDYMZCW0st/s1600/20160222_110017.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="145" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRnXnQKjrQ7fdefDG-Hnc-GXAaFwbnRX5rMkjb8fRpt-Z54yTXkEIvDFKS55Yiay3htAPcGRam_LtdJ7xdg7Fgv6qiy3Np1Z80xKaL1moEDGQ6bMFlCRTnRSo4cR4_yTbOtZDDYMZCW0st/s400/20160222_110017.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<ul>
<li>Two SATA cables to connect SSD to mother board</li>
</ul>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhblu_F3mEMPfAkSH9IdVImtgWZAu66sef1W7J9EFqxYIF8ptPaUKsEWHudn6bKDFXYk1rOSIB_LfT8sxO3fe6IuJn5rt_EgUnpL8RhbhlKDXogE8PgEEcpCddzex7d29pOxn7J8nI-sNw5/s1600/1.jpg" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"></a> </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhblu_F3mEMPfAkSH9IdVImtgWZAu66sef1W7J9EFqxYIF8ptPaUKsEWHudn6bKDFXYk1rOSIB_LfT8sxO3fe6IuJn5rt_EgUnpL8RhbhlKDXogE8PgEEcpCddzex7d29pOxn7J8nI-sNw5/s1600/1.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="152" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhblu_F3mEMPfAkSH9IdVImtgWZAu66sef1W7J9EFqxYIF8ptPaUKsEWHudn6bKDFXYk1rOSIB_LfT8sxO3fe6IuJn5rt_EgUnpL8RhbhlKDXogE8PgEEcpCddzex7d29pOxn7J8nI-sNw5/s200/1.jpg" width="200" /></a></div>
<br />
<ul>
<li>SATA power cable splitters(T cable) in case if your casing doesn't have extra two power slots. (In my case, casing has one extra power slot, So I bought one splitter)</li>
</ul>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJxzp2KBGM1kfGpFas6hYj-6Q_j0s4ZR_V2S4CWNLlw9XEN7Y0Yf8B-6TEDgX8azafZ-ENfyRgvZWYodItwy643bePbjNh3RLiw36V79vphDjfqDkcYaQ7Q-jVOxfCwlIRefQ2yzgzG67k/s1600/3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="162" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJxzp2KBGM1kfGpFas6hYj-6Q_j0s4ZR_V2S4CWNLlw9XEN7Y0Yf8B-6TEDgX8azafZ-ENfyRgvZWYodItwy643bePbjNh3RLiw36V79vphDjfqDkcYaQ7Q-jVOxfCwlIRefQ2yzgzG67k/s320/3.jpg" width="320" /></a></div>
<br />
<span style="font-size: x-large;">3.</span> <span style="font-size: large;">Connect the SSD to motherboard.</span><br />
Connect the two SSDs to the motherboard using two SATA cable and power splitter. If you have more than two SSDs, Those must be same capacity and connect all SSDs to the motherboard. Usually SATA cable in motherboard named like STA1, SATA2, STA3 etc.. But if you can see some other names, You should give priority to port named with SATA1,SATA2 etc... I have tried other ports. even though the cable can be plug, SSDs ware not recognize by the motherboard. Make sure to provide power to the SSDs. <br />
<br />
<br />
<span style="font-size: x-large;">4.</span> <span style="font-size: large;">Turn on RAID from BIOS.</span><br />
Turn on the computer and go in to BIOS setting by pressing the necessary key. Find how to turn on the RAID feature. Different BIOS interfaces giving different way to turn on the RAID feature. In my case I'm using Dell Tower workstation. So Here is how I turn on the RAID feature using BIOS interface.<br />
<div class="separator" style="clear: both; text-align: center;">
<span style="font-size: large;"><span style="font-size: small;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdCFoM4ToeG_bB92rVHq2EqVo8i33HSSM9rO2mzIsnRIl5YnFre1dLRu-ZLgHC90NJw0SGUgARhYZ7HgKECarFSpLr4U87AEPW_i2P0Iq5vrUCYeC0LgggVDwS-X2NtCSNt4eAAFgv7TDV/s1600/20160222_110246.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="227" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdCFoM4ToeG_bB92rVHq2EqVo8i33HSSM9rO2mzIsnRIl5YnFre1dLRu-ZLgHC90NJw0SGUgARhYZ7HgKECarFSpLr4U87AEPW_i2P0Iq5vrUCYeC0LgggVDwS-X2NtCSNt4eAAFgv7TDV/s640/20160222_110246.jpg" width="640" /></a></span></span></div>
<br />
<br />
<br />
<span style="font-size: x-large;">5. Create RAID 0 using RAID Interface</span><br />
<br />
<span style="font-size: large;"><span style="font-size: small;"> </span></span><span style="font-size: small;"><span style="font-size: large;">5.1.</span> </span><br />
After RAID feature on, Save and exit from the BIOS the your computer will restart and it will show up a new interface line this.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhx9b3kSgwbkLxYy6EtBMYNvztCzwwauYwEMoTObcAbI0QSzpkWWBB3tqAZoyPYhhLcWUX9vJD72QwN0roVCrveP4ZXiHmG4gMTO7ISkLgVpnOXC_N25qiaGcuycfiKjcgPicXRnTmYlW52/s1600/20160222_110404.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="324" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhx9b3kSgwbkLxYy6EtBMYNvztCzwwauYwEMoTObcAbI0QSzpkWWBB3tqAZoyPYhhLcWUX9vJD72QwN0roVCrveP4ZXiHmG4gMTO7ISkLgVpnOXC_N25qiaGcuycfiKjcgPicXRnTmYlW52/s640/20160222_110404.jpg" width="640" /></a></div>
<br />
<span style="font-size: large;"><span style="font-size: small;"><span style="font-size: large;">5.2.</span> </span></span><br />
It is asking to go press CTRL+I keys to go to RAID setup interface. So please press control and I keys together. Then it will forward you to a this kind of interface.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr81cX9zFs36Qb3vKAexROhO_1_5-YJxeUT3_lYNPK-JOooU77NRyt_ND3ON2aQwuPv8NPcLksS6nWtYx3vDQVhMwrc8pWSe8pjFsznwVrLty8s23YLpEH-MU0Jer1_FaUbzjO1ux7Mv92/s1600/20160222_110436.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="332" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr81cX9zFs36Qb3vKAexROhO_1_5-YJxeUT3_lYNPK-JOooU77NRyt_ND3ON2aQwuPv8NPcLksS6nWtYx3vDQVhMwrc8pWSe8pjFsznwVrLty8s23YLpEH-MU0Jer1_FaUbzjO1ux7Mv92/s640/20160222_110436.jpg" width="640" /></a></div>
<span style="font-size: large;"><span style="font-size: x-small;"><br /></span></span><span style="font-size: large;">
</span><span style="font-size: large;"><span style="font-size: small;"><span style="font-size: large;">5.3. </span></span></span><br />
This is RAID setup interface. Use the arrow keys in the keyboard and select Create RAID Volume and press Enter. This you will see this screen.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCnAn6gCb1rybgfhlT3iu8Dfr_256yuf13KM6nf09nYfivA9J5ZfZSQMp3mvSzKPEsY3aXrNauPvrr6653KFFSRafi3koNHUG8CTBcf8UKwmbQXZR2cDwpji1ImLXa8kmNICeb2i9wCiTd/s1600/20160222_111644.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="246" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCnAn6gCb1rybgfhlT3iu8Dfr_256yuf13KM6nf09nYfivA9J5ZfZSQMp3mvSzKPEsY3aXrNauPvrr6653KFFSRafi3koNHUG8CTBcf8UKwmbQXZR2cDwpji1ImLXa8kmNICeb2i9wCiTd/s400/20160222_111644.jpg" width="400" /></a></div>
<br />
<span style="font-size: large;"><span style="font-size: small;"><span style="font-size: large;">5.4.</span> </span></span><br />
This is the RAID Volume setting interface. Type a suitable name (I typed Voloume0), <b>Select RAID0 as RAID Level</b>, Keep other things as default. In my case above screen shows the settings I have choose. Use arrow key and go to Create Volume, then press Enter. Then you can see this screen.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMpzBrOj2BfY9RxJ3blFOlRvT3FFneeQL0ojSShD0i4xNgX5CtjeMl6vCCeuWvWnf9PYMnhnv_C6QihiYJpPQiIFDyZXJ_QfIwlcjNDsdH2oUppFSUsAeEGX-hjLBB2_6hYngxVXTiI6Wf/s1600/20160222_111417.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="257" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMpzBrOj2BfY9RxJ3blFOlRvT3FFneeQL0ojSShD0i4xNgX5CtjeMl6vCCeuWvWnf9PYMnhnv_C6QihiYJpPQiIFDyZXJ_QfIwlcjNDsdH2oUppFSUsAeEGX-hjLBB2_6hYngxVXTiI6Wf/s640/20160222_111417.jpg" width="640" /></a></div>
<span style="font-size: large;"><span style="font-size: x-small;"><br /></span></span><span style="font-size: large;">
</span><span style="font-size: large;"><span style="font-size: small;"><span style="font-size: large;">5.5.</span> </span></span><br />
This interface allow you to select what the the SSDs you choose to include in to the new RAID0 drive named "Voloum0" In my case I have selected my newly added two 1TB Samsung SSDs. I have one more 256GB space SSD, that uses to install the operating system. And also a hard drive I uses to store data before buying SSDs. You can use space bar to select the SSDs and press Enter after selecting.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfrWZNXQSO0KaQtW3IWq05GkczaaiGJkAQwRk9i6wNo5hLY-MYXLnH3W-a6EodL8pEab5vidQPYbn3KtXXozPRmsI6iyER5HaNm__KsRRto3C63SWciXF7tQ6rLGtynAOvWP7YhJLQ7nZM/s1600/20160222_111658.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="308" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfrWZNXQSO0KaQtW3IWq05GkczaaiGJkAQwRk9i6wNo5hLY-MYXLnH3W-a6EodL8pEab5vidQPYbn3KtXXozPRmsI6iyER5HaNm__KsRRto3C63SWciXF7tQ6rLGtynAOvWP7YhJLQ7nZM/s640/20160222_111658.jpg" width="640" /></a></div>
<span style="font-size: large;"><span style="font-size: small;"><br /></span></span>
<span style="font-size: large;"><span style="font-size: small;"><span style="font-size: large;">5.6.</span> </span></span><br />
Then it will ask your confirmation. Press Enter to Confirm and then exit from the RAID setting interface by confirming below dialog..<br />
<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTHsojjh6Zc2pKoD-kR0MwvwTUDGscfWivXw08xnEc-JtaOT8dKHz0XjQZ_Bw6lR7WaLq0nUYEDwg3-sHOxIFgooL3zxwQD5CwU284fJG3cb39bSNpkzr2hw1sJk5uQOTukraxDK4N3ZM5/s1600/20160222_111728.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="228" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTHsojjh6Zc2pKoD-kR0MwvwTUDGscfWivXw08xnEc-JtaOT8dKHz0XjQZ_Bw6lR7WaLq0nUYEDwg3-sHOxIFgooL3zxwQD5CwU284fJG3cb39bSNpkzr2hw1sJk5uQOTukraxDK4N3ZM5/s640/20160222_111728.jpg" width="640" /></a><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTHsojjh6Zc2pKoD-kR0MwvwTUDGscfWivXw08xnEc-JtaOT8dKHz0XjQZ_Bw6lR7WaLq0nUYEDwg3-sHOxIFgooL3zxwQD5CwU284fJG3cb39bSNpkzr2hw1sJk5uQOTukraxDK4N3ZM5/s1600/20160222_111728.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br /></a></div>
<span style="font-size: large;"><span style="font-size: small;"></span></span><br />
<span style="font-size: large;"><span style="font-size: small;"><br /></span></span>
<span style="font-size: large;"><span style="font-size: small;"> </span></span><span style="font-size: large;"><span style="font-size: small;"><span style="font-size: x-large;">6. Restart the computer and enjoy lightning faster data read and write.</span></span></span><br />
After exit, it will restart the computer automatically, Even though it shows the RAID setup enter interface we saw in 5.1 don't do anything this time. If you are lucky, your computer will boot without issue. otherwise you have to reinstall the operating system. In my case I had to install Operating system again.<br />
After boot the computer, Right click on the My computer (ThisPC in Windows 10) > Go to "Manage" > Go to "Disk Management" Then you can see the new drive as a new one disk.
Im my case I have 1769.77 GB one disk. You can this this is just a hard drive and create partition as you like from this space.<br />
<br />
In my case I will create two partitions as shown in below image.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJPfQmG_TQD3r7SwKx6ndFAAAez5c0iANo7jSJpvEqGkbi6PLIvTGXCoNIg_QI8xpFO6tMFe6o6CwBiLmPGcOECMeRInG8-PDJJv3NdmSAWOoGbFRbLKCphwGTcs-xz8lCJ_3MSRCChda2/s1600/Untitled.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="192" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJPfQmG_TQD3r7SwKx6ndFAAAez5c0iANo7jSJpvEqGkbi6PLIvTGXCoNIg_QI8xpFO6tMFe6o6CwBiLmPGcOECMeRInG8-PDJJv3NdmSAWOoGbFRbLKCphwGTcs-xz8lCJ_3MSRCChda2/s640/Untitled.jpg" width="640" /></a></div>
<span style="font-size: large;"><span style="font-size: small;"><br /></span></span>
<span style="font-size: large;"><span style="font-size: small;"><br /></span></span>
<br />
<ul>
</ul>
Unknownnoreply@blogger.com37tag:blogger.com,1999:blog-2528866089815406447.post-33865592849060619412015-12-26T21:20:00.002-08:002016-03-09T18:46:04.255-08:00How to Install Broadcom drivers in Fedora 22/23<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwleDCfR8CrRle0zutQYmUusXnYkeFaMw5_o-8HLWzERsWqDFHE44P9fBXXGACgJNeyMFnE_vCLqNf-22myM1P-yk6bHm0oa5wyHND2ST-Dpp49nn9DsVq8qCLIo-fhZ8a7hoGhJ1plmmj/s1600/2807100863_4878e36d73_z.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="212" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwleDCfR8CrRle0zutQYmUusXnYkeFaMw5_o-8HLWzERsWqDFHE44P9fBXXGACgJNeyMFnE_vCLqNf-22myM1P-yk6bHm0oa5wyHND2ST-Dpp49nn9DsVq8qCLIo-fhZ8a7hoGhJ1plmmj/s320/2807100863_4878e36d73_z.jpg" width="320" /></a></div>
<br />
You may face issues while accessing internet via Wifi after installing fedora 22 or 23. Basically issue could be the Linux default chip-set drivers not support Broadcom chip-set. So we have to install correct drivers from the vendor to fix this issue.<br />
<br />
<br />
<br />
<br />
<br />
<b>Symptoms </b><br />
<ul>
<li>Wifi was working fine. But after updating fedora, Wifi does not work</li>
<li>Wifi not works at all. But wired connection works fine.</li>
<li>Wifi works, but after sometime, data rate starts to decrease and finally connection terminates.</li>
<li>Wifi suddenly disconnects, But If I manually connect again, everything works fine for a short time.</li>
</ul>
<ol>
</ol>
If you facing any of these issue, this article is for you. Here is the steps how to install Broad-com chip-set drivers.<br />
<br />
1. First you have to verify your wireless card is Broadcom. So run this command as super user.<br />
<pre class="prettyprint">lspci | grep -i broadcom</pre>
Expected outcome something like<br />
<pre class="prettyprint">12:00.0 Network controller: Broadcom Corporation BCM4313 802.11bgn Wireless Network Adapter (rev 01)</pre>
<br />
<span style="color: #3d85c6;">If you are not getting any result that means your wireless card is not Broadcome and you have to stop reading this article.</span><br />
<br />
2.You have to use 3G dongle or Wired connections to connect to the internet.<br />
<br />
3. Install <a href="http://rpmfusion.org/">RPMFusions</a> free and non free versions using these two commands. Change version number (22) according to your version. My installed fedora version is 22.<br />
<br />
<pre class="prettyprint">rpmkeys --import "http://rpmfusion.org/keys?action=AttachFile&do=get&target=RPM-GPG-KEY-rpmfusion-free-fedora-22" "http://rpmfusion.org/keys?action=AttachFile&do=get&target=RPM-GPG-KEY-rpmfusion-nonfree-fedora-22"</pre>
<br />
Then<br />
<pre class="prettyprint">dnf install http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-22.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-22.noarch.rpm</pre>
<br />
<br />
4. Now your *.rpms are ready. Lets continue to install the drivers. Run below command to install the necessary packages.<br />
<pre class="prettyprint"> dnf install kmod-wl akmod.wl kernel-devel</pre>
You may get some error message like<br />
<pre class="prettyprint">No package akmod.wl available.
No package kernel-devel available.</pre>
If so, Search the akmod.wl packages available using this this command<br />
<pre class="prettyprint">dnf list "*-wl"</pre>
Then find the exact name from the search result. In my case exact name is akmod-wl.x86_64. So install the package using exact name<br />
<pre class="prettyprint">dnf install akmod-wl.x86_64</pre>
For kernal_devel search using this command<br />
<pre class="prettyprint">dnf lnstall "*kernel*"</pre>
Then find the exact name from the search result list. In my case exact name is kernel-devel.x86_64. Install the package using this command.<br />
<pre class="prettyprint">dnf install kernel-devel.x86_64</pre>
<br />
5. Now restart the computer using <i>reboot</i> command.<br />
6. Enjoy the wireless internet.<br />
<br />Unknownnoreply@blogger.com15tag:blogger.com,1999:blog-2528866089815406447.post-90199251972786423542015-11-02T20:44:00.000-08:002015-12-29T18:29:45.843-08:00How to install .Net Framework 3.5 on Windows 10 and fix Error Code 0x0800F081F step by step<br />
<div style="text-align: left;">
1. Type "turn windows feature on or off" in the search box in the task bar<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiK8jH8gy_z3XNT8UeHn7vmdzuEfqYKaAYPWZdyRP8AMq2VM5U-dazM4L7JJSd0SKXVhjtQt4jqbTn80PhYJln5RiDucGbmYkhMqfl0leq3inkc2j-RaPvNkMOfpTfa95QrHaMGL7zLF2pM/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiK8jH8gy_z3XNT8UeHn7vmdzuEfqYKaAYPWZdyRP8AMq2VM5U-dazM4L7JJSd0SKXVhjtQt4jqbTn80PhYJln5RiDucGbmYkhMqfl0leq3inkc2j-RaPvNkMOfpTfa95QrHaMGL7zLF2pM/s400/1.png" width="370" /> </a><br />
<br />
2. Select the "Turn Windows feature on or off" that appears in the best match list. Then it will open up below window.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgI5tRiTdXiYNhK5_FFMZZ6jKOCJcMdUA3mYznOcAJwYFpsjD4IB67vm_8bTa5EegIoltMLLY4xljSqDe78QOIWQH1pVtfbEI3j-ob3_cz_vjNCAnkocVKdwXC60-HiAXcxYbJyZA0x1SXw/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="283" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgI5tRiTdXiYNhK5_FFMZZ6jKOCJcMdUA3mYznOcAJwYFpsjD4IB67vm_8bTa5EegIoltMLLY4xljSqDe78QOIWQH1pVtfbEI3j-ob3_cz_vjNCAnkocVKdwXC60-HiAXcxYbJyZA0x1SXw/s320/2.png" width="320" /> </a><br />
<br />
3. Check the first entry ".NET Framework 3.5 (Include .NET 2.0 and 3.0 )" and click "OK" button. Then you will see below window.<br />
<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg10AwxELIyVU3QYJlDIhYhSwfyzyNT8LOwc28TbYLFzsCQ5CJ4_tnQJeg0PDFSz0AisA3-WceBS85z71l-Ow4boqQb_dloc6ITuANakYFEM4XN2Y7tcznSti63XV1KxXupZuxMRQvNUnro/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="465" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg10AwxELIyVU3QYJlDIhYhSwfyzyNT8LOwc28TbYLFzsCQ5CJ4_tnQJeg0PDFSz0AisA3-WceBS85z71l-Ow4boqQb_dloc6ITuANakYFEM4XN2Y7tcznSti63XV1KxXupZuxMRQvNUnro/s640/3.png" width="640" /> </a><br />
<br />
4. Select "Download files from Windows Update". It will start to search in the internet and try download the .NET framework 3.5, If everything working correctly.<br />
<br />
But most of the times, Download process end up with this error.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLzLAJ_KRgLMSgMY2rS12paJQV8aWitWy-dIqZxMqMg08f6OZvdha1MNSuSeFYRlAgXQBrt5SSUS4nJGS7YZ09NJeRH9bucdhLic5Qj5ctio7aJ_XI4Sfdrlele_DXhtEgFzGsRcA1ITyH/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="465" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLzLAJ_KRgLMSgMY2rS12paJQV8aWitWy-dIqZxMqMg08f6OZvdha1MNSuSeFYRlAgXQBrt5SSUS4nJGS7YZ09NJeRH9bucdhLic5Qj5ctio7aJ_XI4Sfdrlele_DXhtEgFzGsRcA1ITyH/s640/4.png" width="640" /> </a><br />
<br />
5. So Simply it means, system not capable to install .NET 3.5 from the internet. But we cant give up. Then let's install .NET framework 3.5 from installation DVD or ISO file.<br />
<br />
If you have installation DVD just insert it in to DVD drive. Otherwise, you have to follow the steps form 6 to 11. Users who has installation DVD, Please directly go to the step 12.<br />
<br />
6. Go in to this URL <a href="https://www.microsoft.com/en-us/software-download/windows10">https://www.microsoft.com/en-us/software-download/windows10 </a> .You can see two buttons in the web page like this image. Use one of the button and download the ISO file, either 64 bit or 32 bit depends on your system. <br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtngUH20FF8Ox-Mk6QZXLwlJOdEpOt3HG8jqXV64DoFgRSUGoRBtRGR8gyTe7wsMynaZtfh5seIGEXQDQz4WCDx10NGdtszqPGNm5Mpq5-A_J3zjcn1tNbjqIsdUxDlNAEFlmvTIJ_WZbZ/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtngUH20FF8Ox-Mk6QZXLwlJOdEpOt3HG8jqXV64DoFgRSUGoRBtRGR8gyTe7wsMynaZtfh5seIGEXQDQz4WCDx10NGdtszqPGNm5Mpq5-A_J3zjcn1tNbjqIsdUxDlNAEFlmvTIJ_WZbZ/s1600/5.png" /></a><br />
<br />
7. Now you have to download and install some 3rd party tool to open the ISO file downloaded in above step. So lets install "Virtual Clone Drive "<br />
<br />
Go to this URL <a href="http://www.slysoft.com/en/download.html">http://www.slysoft.com/en/download.html</a> and download "Virtual Clone Drive (Freeware)"<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfz4eXrJT6m89VK6ie5K22c58UAZB9Z2RHWPkxZqDoOmPQY-O1Ib_RCxKlZC0ftnIi7QLi-Lqrd4AFWMkI9jVU8437TxUwG-feVr8BX2QX2JBGa5hLvOmnr74pTE3nW1sF_adexwiMh1tU/s1600/6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfz4eXrJT6m89VK6ie5K22c58UAZB9Z2RHWPkxZqDoOmPQY-O1Ib_RCxKlZC0ftnIi7QLi-Lqrd4AFWMkI9jVU8437TxUwG-feVr8BX2QX2JBGa5hLvOmnr74pTE3nW1sF_adexwiMh1tU/s1600/6.png" /></a><br />
<br />
<br />
8. Double click the downloaded file and Install the "Virtual Clone Drive". While installing, it will pop up a dialog and ask permission to install device drivers. Click 'Install"<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKRymvY7kLu1Ip6PWquTt8VIPdArxZjGfGRd3_FCxFE7QuoHnI3BUUx3D8SdBPsbjqjrA6SiOi44FxB-0oDW-uShb_rt0G9oYaFqYJx9a1eCit1wKpMrAdayRUE8ydF4Am7mExJOnJDO8d/s1600/7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKRymvY7kLu1Ip6PWquTt8VIPdArxZjGfGRd3_FCxFE7QuoHnI3BUUx3D8SdBPsbjqjrA6SiOi44FxB-0oDW-uShb_rt0G9oYaFqYJx9a1eCit1wKpMrAdayRUE8ydF4Am7mExJOnJDO8d/s1600/7.png" /> </a><br />
<br />
9. After installation complete, click "Close button"<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXNPN2AXkmUCcjic2dDpsn0Eb5Jo0B4JTwpAwj4i_YEeS4yZz8tnawRupPllCe4JRuAsBV2mItqAB0WDIylxFAF70xNEEB5Pj6R_lOuu1YhgoEu0VOMvdZssapjD4oxOrYpLwQTysa41M0/s1600/8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXNPN2AXkmUCcjic2dDpsn0Eb5Jo0B4JTwpAwj4i_YEeS4yZz8tnawRupPllCe4JRuAsBV2mItqAB0WDIylxFAF70xNEEB5Pj6R_lOuu1YhgoEu0VOMvdZssapjD4oxOrYpLwQTysa41M0/s1600/8.png" /></a><br />
<br />
<br />
<br />
10. Now, right click on the ISO file you have downloaded in the Step 5 and go to "Open With" then you can see "Mount Files with Virtual CloneDrive". Click on that.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjY0faiXrkjaDde5IIhncj3Q2xgWrcNWOVOZIFhLhfOglXNbSLqiq3fIDwQoF4AK25kcp4TCIJRjRwmzdBjRC_Sn8XXkaDF1Dic29sN4GleaPRySPUKnoPQJ9e3xsKfv37CdIVtJ2EN-FwU/s1600/9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjY0faiXrkjaDde5IIhncj3Q2xgWrcNWOVOZIFhLhfOglXNbSLqiq3fIDwQoF4AK25kcp4TCIJRjRwmzdBjRC_Sn8XXkaDF1Dic29sN4GleaPRySPUKnoPQJ9e3xsKfv37CdIVtJ2EN-FwU/s1600/9.png" /></a><br />
11. Now open the "This PC" and you can see new driver appears there. In this case, drive latter is "E". In your computer drive latter can be different. Anyway, remember the driver latter. In my case I will remember "E"<br />
<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOCcptTK03jP1kvrW9nVojm3aCvO9GSUzLbd0DyHBR2gYe2OGKLpqOpkqvkTLQYh8Puyo9NLrnJwSdf8wTzo1XbZvIR2I5APMIasIt2rNAPdaDNObF2xiNd1H1whjlfKkPfnswEAsA9hMS/s1600/10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="230" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOCcptTK03jP1kvrW9nVojm3aCvO9GSUzLbd0DyHBR2gYe2OGKLpqOpkqvkTLQYh8Puyo9NLrnJwSdf8wTzo1XbZvIR2I5APMIasIt2rNAPdaDNObF2xiNd1H1whjlfKkPfnswEAsA9hMS/s640/10.png" width="640" /></a><br />
<br />
<br />
12. Go to search box in the task bar again, and type "cmd", then you will see "Command prompt" in the best match list. right click on the command prompt and select ''Run as administrator"<br />
<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjji0CIjHKPxEEL4a-cd31PqGxXvLe_NlicVbQ8P5hxZVtzGjr-4YM7FlRNfePlImKrqTbdH6G3zM8cJ0nOBpDfWlJV8PsM_um-eGZHY8GR2M0d_rarIAB7CHtVBG9kKWAqjh4wj_787P0P/s1600/12.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjji0CIjHKPxEEL4a-cd31PqGxXvLe_NlicVbQ8P5hxZVtzGjr-4YM7FlRNfePlImKrqTbdH6G3zM8cJ0nOBpDfWlJV8PsM_um-eGZHY8GR2M0d_rarIAB7CHtVBG9kKWAqjh4wj_787P0P/s1600/12.png" /></a><br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<a href="https://www.blogger.com/blogger.g?blogID=2528866089815406447" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><br />
13. Then type this command in the command prompt and change latter "D" to the latter you have remember in last step. Users who use Installation DVD, Just use the DVD drive latter. <br />
<a href="https://www.blogger.com/blogger.g?blogID=2528866089815406447" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"></a>
<pre class="prettyprint">Dism /online /enable-feature /featurename:NetFX3 /All /Source:D:\sources\sxs /LimitAccess</pre>
If .NET framework installed successfully, you can see this output in the command prompt. <br />
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfCuj2fdT0BNadhvfLV-cn5DRlBZyz1bhCSB3hTZ9kz8cQ4l7uGasHoLhEx81J977btypgeToHB_7mNjawPnHvwxkVkJRCJ5Q1A5oDfBrKPA7xAU4hYY6OD4IkZ9j7qRQwKRuFBpLR5Vfx/s1600/13.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfCuj2fdT0BNadhvfLV-cn5DRlBZyz1bhCSB3hTZ9kz8cQ4l7uGasHoLhEx81J977btypgeToHB_7mNjawPnHvwxkVkJRCJ5Q1A5oDfBrKPA7xAU4hYY6OD4IkZ9j7qRQwKRuFBpLR5Vfx/s1600/13.png" /></a></div>
<br />
<br />
14. <span style="color: red;">If your command prompt hang without any response, It means Some windows updates are installing is in progress. So wait some time, restart the computer and try again.</span><br />
<br />
15. Now go back to "Turn Windows feature on or off" window. Now, you can see .NET framework 3.5 is installed.<br />
<br />
<div class="separator" style="clear: both; text-align: left;">
<a href="https://www.blogger.com/blogger.g?blogID=2528866089815406447" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEga__p5jIcEMPwSrDZ9GHf3Q5xMSXtO02IWJUq2xVa7_vOfIMDibpF_Fodlfw99vDZ5JmStRqsi3-1e_YcMLiP419-X2HT4dJpvhbbuBRiEbIOy8009rW9TPWaQ4iVlmFmSq_0Oxk3bZkRZ/s1600/14.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEga__p5jIcEMPwSrDZ9GHf3Q5xMSXtO02IWJUq2xVa7_vOfIMDibpF_Fodlfw99vDZ5JmStRqsi3-1e_YcMLiP419-X2HT4dJpvhbbuBRiEbIOy8009rW9TPWaQ4iVlmFmSq_0Oxk3bZkRZ/s1600/14.png" /></a></div>
<br />
16. You have done it. have a rest with a cold beer :)</div>
Unknownnoreply@blogger.com150tag:blogger.com,1999:blog-2528866089815406447.post-37128722605146486052014-07-27T18:19:00.000-07:002014-08-03T21:48:00.359-07:00How to fix curl: (6) Could not resolve host in Fedora <div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhb4YhSV0mlC5V7f9bRE3QNooRoNmWJifE9d7gZQPITxfB7xBCZrp1ahD6N-ZLkEFFpmvmledezQK4K7WEH7UTAW1PnkoUAy_Kr_2p9hB6W5rVlye5QaKnFGk8fprb4qnVR6vtlWx1E8lvk/s1600/data-encryption.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhb4YhSV0mlC5V7f9bRE3QNooRoNmWJifE9d7gZQPITxfB7xBCZrp1ahD6N-ZLkEFFpmvmledezQK4K7WEH7UTAW1PnkoUAy_Kr_2p9hB6W5rVlye5QaKnFGk8fprb4qnVR6vtlWx1E8lvk/s1600/data-encryption.jpg" /></a></div>
After you installed Fedora, you may face this issue while updating the system or a any specific application. Any also while try to install new application using Terminal. There are few things you have to do to fedora before you start to work otherwise it will trouble you always.<br />
<br />
<br />
<br />
<br />
<br />
<br />
Today I'm going to treat for these symptoms<br />
1. <span style="color: #38761d; font-family: Courier New, Courier, monospace;">curl: (6) Could not resolve host</span><br />
2. <span style="color: #38761d; font-family: Courier New, Courier, monospace;">curl: (6) Could not resolve host: google.com; Name or service not known</span><br />
3. <span style="color: #38761d; font-family: Courier New, Courier, monospace;">nolookup</span> not working<br />
4. Firefox doesn't have internet<br />
5.<span style="font-family: Courier New, Courier, monospace;"> <span style="color: #38761d;">Couldn't resolve host</span></span> when installing/updating yum packages<br />
6. Very Slow DNS Lookup<br />
7. Very slow to load web pages in web browser.<br />
<br />
Here is the step by step solution.<br />
<br />
1. Most of the issues occur because of the IPV6 internet connection in the Fedora. So first we have to disable IPV6 totally. here what you have to do<br />
<br />
<br />
<ul>
<li>Open Terminal</li>
<li>Type <span style="color: #38761d;"><span style="font-family: Courier New, Courier, monospace;">su</span> </span>and enter to log in as the super user</li>
<li>Enter the root password</li>
<li><span style="font-family: inherit;">Type<span style="color: #38761d;"> </span></span><span style="color: #38761d; font-family: Courier New, Courier, monospace;">cd /etc/modprobe.d/</span><span style="font-family: inherit;"> to change directory to </span><span style="color: #38761d; font-family: Courier New, Courier, monospace;">/etc/modprobe.d/</span></li>
<li><span style="font-family: inherit;">Type </span><span style="color: #38761d; font-family: Courier New, Courier, monospace;">vi disableipv6.conf</span><span style="font-family: inherit;"> to create a new file there</span></li>
<li>Press <span style="font-family: Courier New, Courier, monospace;"><span style="color: #38761d;">Esc + i</span> </span>for insert data to file</li>
<li>Type <span style="color: #38761d; font-family: Courier New, Courier, monospace;">install ipv6 /bin/true</span> on the file to avoid loading IPV6 related modules</li>
<li>Type <span style="font-family: Courier New, Courier, monospace;"><span style="color: #38761d;">Esc + :</span> </span>and then <span style="color: #38761d; font-family: Courier New, Courier, monospace;">wq</span> for save and exit</li>
<li>Type<span style="font-family: Courier New, Courier, monospace;"> <span style="color: #38761d;">reboot</span> </span>to restart fedora</li>
<li>After reboot open terminal and type <span style="color: #38761d;"><span style="font-family: Courier New, Courier, monospace;">lsmod | grep ipv6</span> </span></li>
<li>If no result, it means you properly disabled IPV6</li>
</ul>
<div>
2. Then you have to disable the IPV6 DNS look-up in your Firefox browser. For that you have to go true one of my step by step tutorial. below I mention the link. But remember to comeback here to continue rest of the tasks.</div>
<div>
<br /></div>
<div>
<ul>
<li>Go to How to <a href="http://codeketchup.blogspot.sg/2014/01/no-internet-in-firefox-after-installing.html">NO INTERNET IN THE FIREFOX AFTER INSTALLING FEDORA 20</a> Tutorial for fix the Firefox. this is not only for Fedora 20. works in most of the other versions too.</li>
</ul>
<div>
<br /></div>
</div>
<div>
3. Now your Firefox ready t surf internet but one more issue there. Fedora may user your ADSL router or Modem as the DNS server. In other way Fedora may uses some less powerful DNS server for look-up. So your DNS look-up will be slow and wrong most of the time. This will cause to Curl errors and slow loading errors. So we have to set some powerful DNS server for look-up purpose in Fedora. Here is the steps.</div>
<div>
<br /></div>
<div>
<ul>
<li>Open Terminal</li>
<li>Type <span style="color: #38761d; font-family: Courier New, Courier, monospace;">su</span> and enter to log in as the super user</li>
<li>Enter the root password</li>
<li><span style="font-family: inherit;">Type<span style="color: #38761d;"> </span></span><span style="color: #38761d; font-family: Courier New, Courier, monospace;">cat /etc/resolv.conf</span><span style="font-family: inherit;"> to check what DNS server your Fedora using. Mostly this will be your Modem IP address.</span></li>
<li><span style="font-family: inherit;">Now we have to Find a </span>powerful<span style="font-family: inherit;"> DNS server. </span>Luckily there is a open DNS server maintain by Google.</li>
<li><span style="font-family: inherit;">Go to </span><a href="https://developers.google.com/speed/public-dns/docs/using" style="font-family: inherit;">this page</a><span style="font-family: inherit;"> and find out what are the "</span>Google Public DNS IP addresses"</li>
<li>Today those are <span style="color: #38761d;">8.8.8.8</span> and<span style="color: #38761d;"> 8.8.4.4</span>. But in future those may change.</li>
<li>Type <span style="color: #38761d; font-family: Courier New, Courier, monospace;">vi </span><span style="font-family: 'Courier New', Courier, monospace;"><span style="color: #38761d;">/etc/resolv.conf</span> </span><span style="font-family: inherit;">to edit the </span><span style="font-family: 'Courier New', Courier, monospace;"><span style="color: #38761d;">resolv.conf</span> </span><span style="font-family: inherit;">file</span></li>
<li>Press <span style="font-family: Courier New, Courier, monospace;"><span style="color: #6aa84f;">Esc + i</span> </span>for insert data to file</li>
<li>Comment all the things in the file by inserting <span style="font-family: Courier New, Courier, monospace;">#</span> at the begin of the each line. Do not delete anything because can be useful in future.</li>
<li>Type below two lines in the file</li>
</ul>
<div>
<br /></div>
<pre class="prettyprint">nameserver 8.8.8.8
nameserver 8.8.4.4</pre>
<br />
<div>
<ul>
<li>Type <span style="font-family: Courier New, Courier, monospace;"><span style="color: #38761d;">Esc + :</span> </span>and then <span style="color: #38761d; font-family: Courier New, Courier, monospace;">wq</span> for save and exit</li>
<li>Now you are done and everything works fine (Not necessary to restart).</li>
<li><span style="color: red;">But every time when you restart the computer your <span style="font-family: 'Courier New', Courier, monospace;">/etc/resolv.conf </span></span><span style="font-family: inherit;"><span style="color: red;">will be replaced by default. So I'm let you find a way to avoid that</span>.</span><span style="font-family: 'Courier New', Courier, monospace;"> </span></li>
</ul>
</div>
<h1 itemprop="name" style="background: rgb(255, 255, 255); border: 0px; font-family: 'Trebuchet MS', 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 23px; line-height: 1.3; margin: 0px 0px 7px; padding: 0px; vertical-align: baseline;">
</h1>
</div>
Unknownnoreply@blogger.com18tag:blogger.com,1999:blog-2528866089815406447.post-45678824328232303102014-03-17T18:46:00.001-07:002014-03-18T00:36:53.885-07:00How to use Eclipse with Fiddler step by step (for JAVA)<b><span style="font-size: large;">Background:</span></b><br />
<b><br /></b>
<a href="https://www.eclipse.org/downloads/">Eclipse</a> is a nice IDE that popular among JAVA programmers. Recently I have involve with few java base project and that mostly with notwork programming stuff such as HTTP request sending, POST submit, GET request. I used my favorite http/https traffic recording tool "<a href="http://www.telerik.com/fiddler">Fiddelr</a>" to use with Eclipse.<br />
<br />
So here is the my simple JAVA program that send a http post request to the server. Here I uses<a href="http://hc.apache.org/index.html"> Apache HTTPClient</a> (JAVA http implementation) for easy coding.<br />
<br />
<pre class="prettyprint">import java.io.IOException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.HttpResponse;
public class HTTPRequest{
String base_url = "https://destination-server.com";
public static void main(String[] args) {
HttpClient wf_client = HttpClients();
HttpGet get_request = new HttpGet(base_url);
try {
HttpResponse login_responce = wf_client.execute(get_request);
}catch (IOException e) {
System.out.println(e);
}
}
}
</pre>
<br />
<br />
Previously when I work with C++ network programming Visual Studion IDE. I could use Fiddler to capture http and https traffic without any extra configuration. But this time when I compile and run this program in Eclipse, Fiddler does not show any http traffic. So i had to spend few hours to figure out, how to use Eclipse with Fiddler.<br />
<br />
<b><span style="font-size: large;">Let's try step by step:</span></b><br />
<br />
<b>Step - 1: </b> Go to http://www.telerik.com/fiddler and click on [Free Download] button to download Fiddler and install in to your PC.<br />
<br />
<b>Step - 2: </b>If you installed Fiddler properly, when you load a web page in your web browser, you can see the http and https traffic in the Fiddler window as below<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiQJ42ofg1g0ybplVyZaJI7v4l4Ue84bHVyK9-K3gsYfS6MQC_hdU2FiyCWgqdpK9_Egw4eYClkG3sbrB5owUbNvwvpggs2h-6xagPKky-pH8z8BPNQHYbN7HJsdI28eS4Fapg6l9R75sb/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiQJ42ofg1g0ybplVyZaJI7v4l4Ue84bHVyK9-K3gsYfS6MQC_hdU2FiyCWgqdpK9_Egw4eYClkG3sbrB5owUbNvwvpggs2h-6xagPKky-pH8z8BPNQHYbN7HJsdI28eS4Fapg6l9R75sb/s1600/1.png" /></a></div>
<br />
<b>Step - 3: </b>Go to Filter tab in the right side of the windows and add filter to show only traffic to your destination host. and click [Action] button to save<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyB3mcz1E2_iQsGNDdFwnFsgD0eW4JtnY4GWWW4qtH75agG3cTlGzxh2DK0Vi2-bTUcFY9IM3bYdjX1AFNZ-qvcE3Bph_wKC4cBxfC5dyMR_luQhLMXf_HvmsxSYfE8u57aV_ydAMjT9QN/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyB3mcz1E2_iQsGNDdFwnFsgD0eW4JtnY4GWWW4qtH75agG3cTlGzxh2DK0Vi2-bTUcFY9IM3bYdjX1AFNZ-qvcE3Bph_wKC4cBxfC5dyMR_luQhLMXf_HvmsxSYfE8u57aV_ydAMjT9QN/s1600/2.png" /></a></div>
<br />
<b>Step - 4: </b>click [Remove all] to clear up all the previous recorded traffic.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvLC9IilkK3XtSbwSjotTagFQXARjxkXVkUUapIJml8kWgJAE0-QarLIjK2zQW0E-Km_Cjjsps9Jjz2LuR4-bSLzJw_KZozq-L98QdnT-ioAlrEugh9PFAYB7A51_gnuRFIbmZvQ9x7lkI/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvLC9IilkK3XtSbwSjotTagFQXARjxkXVkUUapIJml8kWgJAE0-QarLIjK2zQW0E-Km_Cjjsps9Jjz2LuR4-bSLzJw_KZozq-L98QdnT-ioAlrEugh9PFAYB7A51_gnuRFIbmZvQ9x7lkI/s1600/3.png" /></a></div>
<br />
<b>Step - 5: </b>Then go in to Eclipse and build and run your program that sending HTTP requests to the remote host. If the Fiddler showing the request, no issue you can continue works. But if the Fiddler doesn't record the requests here is the way to figure-out.<br />
<br />
<b>Step - 6: </b>For record the http/http request you have to send the request trough the Fiddler. So go to 'Tools' -> Fiddler Option -> 'Connection' tab and check the port specify there.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8fmdwFwOj_fI512vwzryM74qjkBQmKz0okegrdVrGQVuz_N7blFxb-uKlQwBk9s37jfiGcmaBkHGcXOdimIuKJjW1WD3kPJRWqsalaFgkBBpDf9T1ugpplNdchWVGFAcRwOL1lB-aMKWe/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8fmdwFwOj_fI512vwzryM74qjkBQmKz0okegrdVrGQVuz_N7blFxb-uKlQwBk9s37jfiGcmaBkHGcXOdimIuKJjW1WD3kPJRWqsalaFgkBBpDf9T1ugpplNdchWVGFAcRwOL1lB-aMKWe/s1600/4.png" /></a></div>
<br />
<b>Step - 7: </b>So here is my case, it's automatically configured to port 8888. After identifying the port your have to add your localhost and above port as proxy to your connection. look at the example below.<br />
<br />
<pre class="prettyprint">public static void main(String[] args) {
HttpHost proxy = new HttpHost("localhost", 8888);
HttpClients wf_client = HttpClients.custom().setProxy(proxy).build();
HttpGet get_request = new HttpGet(base_url);
try {
HttpResponse login_responce = wf_client.execute(get_request);
}catch (IOException e) {
System.out.println(e);
}
}
</pre>
<br />
<b>Step - 8:</b>If you sending just http requests now your fiddler works fine and you can see the sending and receiving requests and the details of those. But if you are sending http<b>s</b> requests now your program shows this run-time error.<br />
<br />
<br />
<pre class="prettyprint">Unexpected errorjavax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
</pre>
<br />
<br />
<b>Step - 9: </b>To get rid from this exception go to 'Tools' -> 'Fiddler Options' -> 'Https' tab and click Export 'Root Certificate ti Desktop'<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYshd1QnQoQgd2lJc3gcMW5wkiTGHOTkWQR9BH6Oruq2W3FXM_Cxnb3lnI3xmKb0b-ivy-LBHtvMt5yWbOrEL_xH9x2VQb1CavpaWaL0hoDc4997DmEfGmYsq9P8IiltCliBvD64mxqJvZ/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYshd1QnQoQgd2lJc3gcMW5wkiTGHOTkWQR9BH6Oruq2W3FXM_Cxnb3lnI3xmKb0b-ivy-LBHtvMt5yWbOrEL_xH9x2VQb1CavpaWaL0hoDc4997DmEfGmYsq9P8IiltCliBvD64mxqJvZ/s1600/5.png" /></a></div>
<br />
<b>Step - 10: </b>Now we have to install the exported certificate to JAVA. for that open 'command prompt' as administrator and run below command<br />
<br />
<br />
<pre class="prettyprint">C:\Windows\system32>keytool.exe -import -file [path the exported file] -keyst
ore [name for keystre] -alias [alias name for certificate]
</pre>
<br />
As a example, In my PC command is like this
<br />
<br />
<pre class="prettyprint">C:\Windows\system32>keytool.exe -import -file C:\Users\nayanaa\Desktop\FiddlerRoot.cer -keyst
ore FiddlerKeystore -alias Fiddler
</pre>
<br />
<b>Step - 11: </b>Then the system will ask you to enter a password to access certificate. Please enter a whatever a password and confirm the password. Please be careful to remember entered password.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkXZl7AY_DYtfqShEWzFn-wyA1Alc7r2O7zs_GQOMonOmYqRnLjGvtzo-vWqmMpcp1f_YTOzEKrhwfK0B4r8j-ytLYkdyzvScMXTNDdGQSl-zwdqlJeMFcG2Bu9rvjpmZVhHZC_EpSllnl/s1600/6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkXZl7AY_DYtfqShEWzFn-wyA1Alc7r2O7zs_GQOMonOmYqRnLjGvtzo-vWqmMpcp1f_YTOzEKrhwfK0B4r8j-ytLYkdyzvScMXTNDdGQSl-zwdqlJeMFcG2Bu9rvjpmZVhHZC_EpSllnl/s1600/6.png" /></a></div>
<br />
<b>Step - 12: </b>Then the system will ask are you trusting this certificate. enter 'Y' and press enter. Then it will show "certificate added successfully" message.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjd_6ISD_HHsZ7O0w91ZgiQtIDRg2sBzm3EQZsqEPdbRWNEN0omg5erF0iTHO8uuPgJzJzQ31gl7h3WwxykaNTL_vXyfoIxq0J0zH1mrtEiAK4OJwEhcRQGoCB-x9AsBGiYdgPSrY73ySoG/s1600/7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjd_6ISD_HHsZ7O0w91ZgiQtIDRg2sBzm3EQZsqEPdbRWNEN0omg5erF0iTHO8uuPgJzJzQ31gl7h3WwxykaNTL_vXyfoIxq0J0zH1mrtEiAK4OJwEhcRQGoCB-x9AsBGiYdgPSrY73ySoG/s1600/7.png" /></a></div>
<br />
<b>Step - 13: </b> Then go yo your 'Java Home' -> Jre[x] ->bin. There you can see a file named FiddlerKeystore. move that file to 'Java Home' -> Jre[x] -> lib ->security<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC-e3QVxXavsr_knI7FxIV4Oz5lTRBUSfzkOFcwh_XgqmWAqV-MkQCSkogWxy5Q0X8CKYwaZm9TzExCmcgxe8xDg63g81kwSvU6EZ6mv2mmCWEclvtIE8w2ZH-flOy6KXPEZQb-aQts3RW/s1600/8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC-e3QVxXavsr_knI7FxIV4Oz5lTRBUSfzkOFcwh_XgqmWAqV-MkQCSkogWxy5Q0X8CKYwaZm9TzExCmcgxe8xDg63g81kwSvU6EZ6mv2mmCWEclvtIE8w2ZH-flOy6KXPEZQb-aQts3RW/s1600/8.png" /></a></div>
<br />
<b>Step - 14: </b> Now you installed the certificate to use Fiddler as a proxy server for https requests. Simply now you can send https requests trough fiddler. for this you have to add two lines to your program to speciify truestore and truestore password. Here you have to specify the path to FiddlerKeystore file in 'Java Home' -> Jre[x] -> lib ->security and the password you enter while installing the certificate.<br />
<br />
<br />
<pre class="prettyprint">public static void main(String[] args) {
System.setProperty("javax.net.ssl.trustStore", "C:\\Program Files (x86)\\Java\\jre7\\lib\\security\\FiddlerKeystore");
System.setProperty("javax.net.ssl.trustStorePassword", "my#password");
HttpHost proxy = new HttpHost("localhost", 8888);
HttpClients wf_client = HttpClients.custom().setProxy(proxy).build();
HttpGet get_request = new HttpGet(base_url);
try {
HttpResponse login_responce = wf_client.execute(get_request);
}catch (IOException e) {
System.out.println(e);
}
}
</pre>
<br />
<b>Step - 15: </b>Now everything completed. you can track and record all the http and https traffic sending by eclipse. Unknownnoreply@blogger.com139tag:blogger.com,1999:blog-2528866089815406447.post-56336918611763603232014-01-11T02:37:00.001-08:002014-03-23T19:09:00.022-07:00No internet in the Firefox after installing Fedora 20This is mostly because of the default IPV6 DNS enables of the Firefox.<br />
So you have to disable this if your service provider does not support IPV6 DNS.<br />
<br />
1. Open Firefox and type <span style="color: #3d85c6; font-family: Courier New, Courier, monospace;"><i>about:config</i></span> in the address bar.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgImyZiVr7iK0gGxEyXauc-w7L0shGo85jDT4UySzCsbR1nTSLf6vFifpcbUXpH7bJVxX6lSdPO09tyl8wY5uvcXNfJYEgwVzGCrRsPobmiZy7JLrf613QnQTuH8Ix2c5kTwYrBfaOc1Vv/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgImyZiVr7iK0gGxEyXauc-w7L0shGo85jDT4UySzCsbR1nTSLf6vFifpcbUXpH7bJVxX6lSdPO09tyl8wY5uvcXNfJYEgwVzGCrRsPobmiZy7JLrf613QnQTuH8Ix2c5kTwYrBfaOc1Vv/s1600/1.png" /></a></div>
<br />
2. Press the [ <span style="font-family: Courier New, Courier, monospace;">I will be careful, I, Promise </span>] button.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwh-wgLwvzZ0R5mZ7ESlhI_M-H28RJUDh10uN5kTDbJfQey4_MEJOPupUpUC7iKfGoxD_CuTZXcM9cCJlP1LJ1eNJrxDmkK3jWR7lRlunMGuct9Ge1SqTyzUaWZjm-Pyl50_6V6AnV4eac/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwh-wgLwvzZ0R5mZ7ESlhI_M-H28RJUDh10uN5kTDbJfQey4_MEJOPupUpUC7iKfGoxD_CuTZXcM9cCJlP1LJ1eNJrxDmkK3jWR7lRlunMGuct9Ge1SqTyzUaWZjm-Pyl50_6V6AnV4eac/s1600/3.png" height="192" width="640" /></a></div>
<br />
3. Type <i><span style="color: #3d85c6; font-family: Courier New, Courier, monospace;">Network.dns</span></i> in the search text box.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiU3lfWxSPn-p28K6xl4LlmLR_meK52W1Cy_cj-1IGKm6zC6-LwCwAAnNkPYXs83hJj_gUAaKYPs5MPQU4Pxnv9w2ADy2M0-DQdlxucJCCcy80YsEm2msfqk1bcIEJBImN_GAKmT4YauI0R/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiU3lfWxSPn-p28K6xl4LlmLR_meK52W1Cy_cj-1IGKm6zC6-LwCwAAnNkPYXs83hJj_gUAaKYPs5MPQU4Pxnv9w2ADy2M0-DQdlxucJCCcy80YsEm2msfqk1bcIEJBImN_GAKmT4YauI0R/s1600/2.png" height="188" width="640" /></a></div>
<br />
4. You will see<i><span style="font-family: Courier New, Courier, monospace;"> <span style="color: #3d85c6;">network.dns.disableIPv6</span></span></i> entry in the searched list.<br />
<br />
5. Double click on the above entry to change value column to <span style="color: #3d85c6; font-family: Courier New, Courier, monospace;"><i>True</i></span>.<br />
<br />
6. Restart the Firefox.<br />
<br />
7. Now your internet is ready.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2528866089815406447.post-88321428826295801782014-01-10T23:58:00.000-08:002014-01-11T00:01:22.285-08:00 How to fix Cannot retrieve metalink for repository: fedora/20/x86_64. Please verify its path and try againWhen you try to run follow two command there can be this error showing in the Terminal.<br />
<br />
<span style="color: blue;"><span style="font-family: "Courier New",Courier,monospace;">yum update</span></span><br />
<span style="color: blue;"><span style="font-family: "Courier New",Courier,monospace;">yum check-update</span></span><br />
<br />
<ol>
<li>First you check if the Network connection and Internet works fine.</li>
<li>Run yum clean all command and try to clean the corrupted repository data </li>
<li>Try to run the command in the debug mode as below. The you can get the details error message. If it says some URL cannot be acess then try to access that URL from your web browser and check if the URL work <span style="color: blue;"><span style="font-family: "Courier New",Courier,monospace;">URLGRABBER_DEBUG=1 yum update</span> </span></li>
<li>If your network environment uses proxy, then check your Linux version configured with correct proxy.</li>
<li>Check your system date is correct.
</li>
</ol>
Unknownnoreply@blogger.com14tag:blogger.com,1999:blog-2528866089815406447.post-25872602473263568482013-12-10T00:30:00.003-08:002014-01-07T17:20:17.859-08:00C# Encryption Decryption Class AES<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcs19-_P8k7B2uilfYK5M0PuuysgbBht14JnwO0n_3BAL3lfKZUKC53E1HuDAzWtWGu0mxJWpoWCvd6uNiy53pj4UOsJQpAf4Q8fBhechAfvq-0fS24KBoBDlcj05niFgRwFe0EwHQWSPu/s1600/data-encryption.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcs19-_P8k7B2uilfYK5M0PuuysgbBht14JnwO0n_3BAL3lfKZUKC53E1HuDAzWtWGu0mxJWpoWCvd6uNiy53pj4UOsJQpAf4Q8fBhechAfvq-0fS24KBoBDlcj05niFgRwFe0EwHQWSPu/s320/data-encryption.jpg" height="212" width="320" /></a>Sometimes you may need to use encryption and decryption class in your C# project. Here is a simple class you can use for above purpose feel free to use it and feedback with improvement. This class use Advance Encryption Standers. and RijndaelManaged method.<br />
<br />
<br />
<br />
<br />
<br />
<pre class="prettyprint" style="font-size: 10px; line-height: 100%;">
/*******************************************************************
File: Crypter.cs
Author: Nayana Adassuriya
Description: Uses to encrypt or decrypt any string by symettric way (AES,RijndaelManaged)
Language: C#
Limitations: Encription key genaration hashes are hardcoded in the class.
If some one knows these hashes, they can crate programe to decript the encripted strings.
Thread Safe: no
Extendable: yes
Platform Depend: Windows,.NET 3.5
Project: None
*******************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
using System.IO;
namespace StorageService
{
internal class Crypter
{
//Data members
private static byte[] m_salt = Encoding.ASCII.GetBytes("41fb5b5ae4d57c5ee528adb00e5e8e74");
private static string m_encrypt_key = "200911381f7899d2482ab61fe8d15684469b17fc690";
/************************************************************************
Purpose : This is the method uses to encrypt plan strings.
Parameters : plan_test: text that need to be encrypted
Returns : encrypted string
Exception : If any exception while getting values from xml, pass to the upper level
Algorithm : C# manage code
Output : None
Notes : User can encrypt multiple times recursively if more security needs. If that
need to decrypt same number of rounds accordingly
*************************************************************************/
internal static string aesEncrypt(string plan_test)
{
string output = null;
RijndaelManaged aes_alg = null;
try
{
Rfc2898DeriveBytes key = new Rfc2898DeriveBytes(m_encrypt_key, m_salt);
aes_alg = new RijndaelManaged();
aes_alg.Key = key.GetBytes(aes_alg.KeySize / 8);
ICryptoTransform encryptor = aes_alg.CreateEncryptor(aes_alg.Key, aes_alg.IV);
using (MemoryStream encrypt_ms = new MemoryStream())
{
encrypt_ms.Write(BitConverter.GetBytes(aes_alg.IV.Length), 0, sizeof(int));
encrypt_ms.Write(aes_alg.IV, 0, aes_alg.IV.Length);
using (CryptoStream encrypt_cs = new CryptoStream(encrypt_ms, encryptor, CryptoStreamMode.Write))
{
using (StreamWriter encrypt_sw = new StreamWriter(encrypt_cs))
{
encrypt_sw.Write(plan_test);
}
}
output = Convert.ToBase64String(encrypt_ms.ToArray());
}
}
catch (Exception e)
{
throw e;
}
finally
{
if (aes_alg != null)
{
aes_alg.Clear();
}
}
return output;
}
/************************************************************************
Purpose : This is the method uses to decrypt the encrypted strings.
Parameters : cipher_text: decrypted string need to decrypt to plan text
Returns : Plan text after decrypted
Exception : If any exception while getting values from xml, pass to the upper level
Algorithm : C# manage code
Output : None
Notes : User can encrypt multiple times recursively if more security needs. If
that need to decrypt same number of rounds accordingly.
*************************************************************************/
internal static string aesDecrypt(string cipher_text)
{
RijndaelManaged aes_alg = null;
string plain_text = null;
try
{
Rfc2898DeriveBytes key = new Rfc2898DeriveBytes(m_encrypt_key, m_salt);
byte[] bytes = Convert.FromBase64String(cipher_text);
using (MemoryStream decrypt_ms = new MemoryStream(bytes))
{
aes_alg = new RijndaelManaged();
aes_alg.Key = key.GetBytes(aes_alg.KeySize / 8);
aes_alg.IV = ReadByteArray(decrypt_ms);
ICryptoTransform decryptor = aes_alg.CreateDecryptor(aes_alg.Key, aes_alg.IV);
using (CryptoStream decrypt_cs = new CryptoStream(decrypt_ms, decryptor, CryptoStreamMode.Read))
{
using (StreamReader decrypt_sr = new StreamReader(decrypt_cs))
plain_text = decrypt_sr.ReadToEnd();
}
}
}
catch (Exception e)
{
throw e;
}
finally
{
if (aes_alg != null)
aes_alg.Clear();
}
return plain_text;
}
/************************************************************************
Purpose : Use to read first few bytes from cipher string( this helps to generate
the same key used in encrypt method again)
Parameters : stream: stream that use to read the cipher text bytes from memory.
Returns : return byte array filled with first few bytes of the cipher string.
Exception : If any exception while getting values from xml, pass to the upper level
Algorithm : C# manage code
Output : None
Notes : None
*************************************************************************/
private static byte[] ReadByteArray(Stream stream)
{
byte[] buffer;
byte[] row_length = new byte[sizeof(int)];
try
{
if (stream.Read(row_length, 0, row_length.Length) != row_length.Length)
{
throw new SystemException("encrypted string not contain properly formatted byte array");
}
int temp = BitConverter.ToInt32(row_length, 0);
buffer = new byte[temp];
if (stream.Read(buffer, 0, buffer.Length) != buffer.Length)
{
throw new SystemException("Did not read encrypted string properly");
}
}
catch (Exception e)
{
throw e;
}
return buffer;
}
}
}
</pre>
Unknownnoreply@blogger.com11tag:blogger.com,1999:blog-2528866089815406447.post-42846964278054313622013-08-06T18:53:00.002-07:002013-08-06T21:37:39.522-07:00Step by step guide to fix "The request filtering module is configured to deny a request that exceeds the request content length" IIS error<span style="color: #3d85c6; font-family: Georgia, Times New Roman, serif; font-size: large;">Issue</span><br />
If you are using IIS Web server for hosting your application, Sometimes these kind of error can be trigger when try to upload a large file using your application.<br />
<ul>
<li><span style="font-family: 'Courier New', Courier, monospace;"><span style="color: red;">"The request filtering module is configured to deny a request that exceeds the request content length."</span></span></li>
<li><span style="font-family: 'Courier New', Courier, monospace;"><span style="color: red;">"System.Web.HttpException: Maximum request length exceeded."</span></span></li>
</ul>
<div>
<span style="color: #3d85c6; font-family: Georgia, Times New Roman, serif; font-size: large;">Reason</span></div>
<div>
Default IIS settings only allow to upload up to <b>4Mb</b> large files. Rest are filtered and shows the one of above error.</div>
<div>
<br /></div>
<div>
<span style="color: #3d85c6;"><span style="font-family: Georgia, Times New Roman, serif; font-size: large;">Solution</span></span></div>
<div>
Solution is you need to increase default max allow file size to what ever you want size. This can be do in two levels</div>
<div>
<ol>
<li>Application level</li>
<li>Server level</li>
</ol>
<div>
Lets see how to do each. first we are going to look at "Application Level" configuration changes.<br />
<br /></div>
</div>
<div>
<span style="color: #3d85c6; font-family: Georgia, Times New Roman, serif; font-size: large;">1. Application Level</span></div>
<div>
<b>Step1:</b></div>
<div>
Go to "Control Panel" -> "Administrative Tools" ->" Internet Information Services (IIS) Manager"</div>
<div>
<br /></div>
<div>
<b>Step2:</b> </div>
<div>
Expand the connection explorer and double click on the site you working on.</div>
<div>
<br /></div>
<div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXTcNNghtKGc6OtQs9hqrg99Zk0g3ARGpXY-3-upkeH1OiiAVuP8Lt0FvNZoUn0iXdaz5tVsdWH9CA3_e6nhK271jexkkVl1UAcr2gbEV4OCd3S0zzUiWk46zkWGfKStwZeGzqJLAsb4f7/s1600/1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="524" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXTcNNghtKGc6OtQs9hqrg99Zk0g3ARGpXY-3-upkeH1OiiAVuP8Lt0FvNZoUn0iXdaz5tVsdWH9CA3_e6nhK271jexkkVl1UAcr2gbEV4OCd3S0zzUiWk46zkWGfKStwZeGzqJLAsb4f7/s640/1.png" width="640" /></a><b>Step 3:</b></div>
<div>
In the right hand panel, you can see the set of icons under few categories, Go to category Management and double click on the "configuration editor icon". </div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgNOtBiJu2qkX6XxloobMC_vXRpl7ulYQgsEdG6rzEPEXiD3JaFwIzCNkmyYjmiqW1Uq5TWhpp5hK3NdR2Irzbn3I1GxK3F2il1aqA6KXA4OuDwRC5KXt3H6J4GDUkbkDroOu50aI63e-y/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgNOtBiJu2qkX6XxloobMC_vXRpl7ulYQgsEdG6rzEPEXiD3JaFwIzCNkmyYjmiqW1Uq5TWhpp5hK3NdR2Irzbn3I1GxK3F2il1aqA6KXA4OuDwRC5KXt3H6J4GDUkbkDroOu50aI63e-y/s1600/2.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b>Step 4:</b></div>
<div class="separator" style="clear: both; text-align: left;">
Then the configuration editor window will appear and you have to click the link "Search Configuration" at right hand side pane.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhSZQoqcythbLRa4Yub26OlfOWMQjuUB-HaSF-uJpk_G6Ur5EG1iVuNL1l8Ms7NQql5Bn8Z91pJ74i6ZVYWjhCR9A7PUqXSLPs-lgHe5M6tJhQIWhDVK6K-LvR8jS7gER842EZsdnyYrNP/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="346" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhSZQoqcythbLRa4Yub26OlfOWMQjuUB-HaSF-uJpk_G6Ur5EG1iVuNL1l8Ms7NQql5Bn8Z91pJ74i6ZVYWjhCR9A7PUqXSLPs-lgHe5M6tJhQIWhDVK6K-LvR8jS7gER842EZsdnyYrNP/s640/3.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div>
<b>Step 5:</b> </div>
<div>
Then "Configuration Search" dialog will appear and first you have to select the "web.config" file and then click the link on right bottom of the dialog.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5CIiXfzW4Owq4PO1FTUrwZriiKsOtfHrKo8NjmJR508z6kifymFO5qaxItuX3HKOJqd8SlOMQRiVhL-nxfe47mUBURKOIoasghL2Yqu-f8cafKc5sCU_lzzoK8LiJu1WB89qKwaJqN781/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5CIiXfzW4Owq4PO1FTUrwZriiKsOtfHrKo8NjmJR508z6kifymFO5qaxItuX3HKOJqd8SlOMQRiVhL-nxfe47mUBURKOIoasghL2Yqu-f8cafKc5sCU_lzzoK8LiJu1WB89qKwaJqN781/s1600/4.png" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>Step 6:</b></div>
<div>
Then "web.config" file will open in your default XML editor and it shows all the configuration that applicable to particular web site. So now we are going to add default upload limit configuration to MySite01, to override default server configuration.Here I need to allow file upload until 1GB (<span style="font-family: Courier New, Courier, monospace;">1*1024*124 = 1048576 KB</span>) size. So what i need to do is just copy and paste following piece of code to the "web.config" file just after start the <span style="font-family: Courier New, Courier, monospace;"><configuration></span> tag.</div>
<div>
<br /></div>
<div>
<pre class="prettyprint"><system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2147483648"/>
</requestFiltering>
</security>
</system.webServer>
<system.web>
<httpRuntime maxRequestLength="1048576" />
</system.web>
</pre>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHo7NV9TUv3ncCQVg2u3iv9g695undOI7t_ZSE8wYXBR_nMrpGoo_RBV5ZDOKiJzGNUDlQ6bXhUcYFpHnLnKKdkHPGqxNAovjr8HDvl5PJsJoDJPg3-2Jn51JBxEB3H-jTs-tBAdmGltC2/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="453" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHo7NV9TUv3ncCQVg2u3iv9g695undOI7t_ZSE8wYXBR_nMrpGoo_RBV5ZDOKiJzGNUDlQ6bXhUcYFpHnLnKKdkHPGqxNAovjr8HDvl5PJsJoDJPg3-2Jn51JBxEB3H-jTs-tBAdmGltC2/s640/5.png" width="640" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>Step 6: </b></div>
<div>
Then your file should looks like this. Be careful someone may be previously added the same configuration to this file. At that situation you have to edit the values instead of newly adding.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfME-dtwVpSCHwKB4F0MCDRXXfK7VDvfIq7fdYOZPF-57hAPTzk4t9PONsnPDWV9gn22EZc9rQ9HA1orwnmkYV8SlIrAbtTJuDYRz4ra1Nf1v_EJgBYmQxW92EpcXfHs48nmreDTyiPndL/s1600/7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="594" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfME-dtwVpSCHwKB4F0MCDRXXfK7VDvfIq7fdYOZPF-57hAPTzk4t9PONsnPDWV9gn22EZc9rQ9HA1orwnmkYV8SlIrAbtTJuDYRz4ra1Nf1v_EJgBYmQxW92EpcXfHs48nmreDTyiPndL/s640/7.png" width="640" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>Step7:</b> </div>
<div>
Now you edit the configuration. But to apply these configurations you have to restart the IIS server. To do so run the command prompt as Administrator (click start button-> type cmd in search box -> once you see the command prompt icon -> right click and select "Run as administrator"). Type <span style="font-family: Courier New, Courier, monospace;">iisreset </span><span style="font-family: inherit;">and press enter.</span></div>
<div>
<span style="font-family: inherit;"><br /></span></div>
<div>
<span style="font-family: inherit;"><br /></span></div>
<div>
<span style="color: #3d85c6; font-family: Georgia, Times New Roman, serif; font-size: large;">2. Server Level</span></div>
<div>
<br /></div>
<div>
<b>Setp 1:</b></div>
<div>
Open the command prompt as administrator (click start button-> type cmd in search box -> once you see the command prompt icon -> right click and select "Run as administrator") and go to <span style="font-family: Courier New, Courier, monospace;">c:\Windows\System32\inetsrv</span> directory</div>
<div>
<br /></div>
<div>
<b>Step 2:</b><br />
<b></b> Type the following command and press enter</div>
<div>
<br /></div>
<pre class="prettyprint">appcmd.exe unlock config -section:system.webServer/security/requestFiltering</pre>
<div>
<br /></div>
<div>
<b>Step 3:</b></div>
<div>
If your command is correct and worked properly you can see a result like following window. Actually here disabling the file size validation. But not, increasing the allowed max file size.</div>
<div>
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIX4rS8bltVTVn3vagsG2pc7FBtPuPn-ImGSDwNh7Ymwup1uMxqeG5Ljs2WktVgY2LflkZUay_S8jkNXPmo2Myl5UoD0kPxaGPZ_NDQhLWGv68R8uhJDSLbck3Q5ZVZURaLVhyFm1w6_Tq/s1600/8.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="114" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIX4rS8bltVTVn3vagsG2pc7FBtPuPn-ImGSDwNh7Ymwup1uMxqeG5Ljs2WktVgY2LflkZUay_S8jkNXPmo2Myl5UoD0kPxaGPZ_NDQhLWGv68R8uhJDSLbck3Q5ZVZURaLVhyFm1w6_Tq/s640/8.png" width="640" /></a><b>Step 4:</b><br />
Now you edit the configuration. But to apply these configurations you have to restart the IIS server. Type <span style="font-family: Courier New, Courier, monospace;">iisreset </span>and press enter.</div>
<div>
</div>
Unknownnoreply@blogger.com24tag:blogger.com,1999:blog-2528866089815406447.post-56350226161749140852013-07-16T03:25:00.000-07:002013-07-18T00:06:50.694-07:00What is C++ Name Mangling<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgU4gVmFvcw42kJfmgQHxPRwOetZnbKni0eIzhUqL8VZaXp8DSvXAp6AZwBlyfhQmTnj-BbJbJk3GtCn7CiP-ymS1I1GA8x5T85t6aFQvS4lhjyqpswwjMKvoWgA58-GyVW_CQ4URKYiZ_q/s1600/man_walking_dog2.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgU4gVmFvcw42kJfmgQHxPRwOetZnbKni0eIzhUqL8VZaXp8DSvXAp6AZwBlyfhQmTnj-BbJbJk3GtCn7CiP-ymS1I1GA8x5T85t6aFQvS4lhjyqpswwjMKvoWgA58-GyVW_CQ4URKYiZ_q/s1600/man_walking_dog2.jpg" /></a><b>What is Name Mangling</b><br />
<div>
Modern programming languages consist with user friendly and function rich features like overloading, overriding, namespace, class etc.. Also most of the OOP languages allow programmer to do logical grouping of coding than writing the whole code in one global space. So when modern programming languages need to support to features like above mentions, compile makers get trouble and the compiling and validation logic may get more complex. As examples Different classes can be have functions/member variables with same name</div>
<div>
Same class can be have same function name with different arguments(function overloading)</div>
<div>
Base class and child can have same function name (function overriding)</div>
<div>
Different Namespaces can have same name for function, structure, class or another datatype.</div>
<div>
<br /></div>
<div>
So when compiler processing the situation not like old structural language, naming is quite complex. So there should be a way to make above each names unique. Then linker can uniquely identify the correct function and call it. </div>
<div>
<br /></div>
<div>
So because of the above reason and few of other reason compiler makers introduce a concept call "Name Mangling" what here doing is make a function name by adding some prefix or post-fix to the function name when compiling the program. as example</div>
<div>
<br /></div>
<pre class="prettyprint">class Test()
{
int add(int a, int b);
int add(int a, int b, int c);
}
</pre>
<div>
Here is two functions with same name in same class, but number of argument is different. So If I make my own compiler I can purpose a Name Mangling style </div>
<div>
<br /></div>
<pre class="prettyprint">_functionName@numberOfArguments@FirstCharactorOfArgumentsType
</pre>
<div>
<br /></div>
<div>
This is my own Name Mangling (unique function name generation) style (No real style like this). So the above two function Name Mangling will be </div>
<div>
<br /></div>
<pre class="prettyprint">_add@2@i
_add@3@i
</pre>
<br />
<div>
So the linker can differentiate the function now and both functions have unique names. This is looks like decorating the function names. So Name Mangling also called as "Name Decoration".</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>Other Than Name Decoration</b></div>
<div>
Other than name decoration, Name Mangling use to pass some information from compiler to linker, such as argument type, length of the argument, calling conventions. Because the Mangling name can be consist with some information other than function name. So this also a extra benefit of Name Mangling. in our abouve example linker can extract the number of argument ( two or three) and argument type (integer) from the unique function name. So even the languages like C that doesn't exist function overloading and overriding kind of advance features, also using Name Mangling for pass these extra information from compiler to linker or platform. </div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>C++ Name Mangling</b> </div>
<div>
Various C++ compilers also implemented their own Name Mangling styles. So compiler to compiler generated name for same function would be different. Some time version to version of same compiler also may be use different Name Mangling styles. So As you can understand the object code compiled by different compilers could not be link together because of their different Name Mangling. But Some of the compilers vendors fallow the same Name Mangling styles. But we cannot expect 100% those will be same.</div>
<div>
Actually C++ having quite complex features like template, operator overloading. So the Name Mangling styles of C++ compilers are more complex than other languages.</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>Stranded for C++ Name Mangling</b></div>
<div>
There is not a standers for C++ Name Mangling. If there is a standers for Name Mangling, the object code compiled by different compilers could be link together using one linker. But when we come to linker story, Name of the function is not only the matter for compatibility there are some few things need to consider when linking the functions object codes together such as exception handling, virtual table structure etc... These binary interfaces are called Application Binary Interfaces. So Name of the function (Name Mangling) is only one ABI. there are few more. So if there is a standers Name Mangling for C++, that would not be enough for link the different compiler binaries together. And also If there is a slandered for Name Mangling it would be a limitation for the compiler vendors too. Other than that C++ standers encourage to keep different Name Mangling sachems to prevent linking with incompatible codes just only because of their same names . </div>
<div>
</div>
<div>
<br /></div>
<div>
<br /></div>
Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-2528866089815406447.post-74003524189237908052013-06-12T02:53:00.000-07:002013-06-16T18:58:10.330-07:00How to fix, "Deployment and application do not have matching security zones" error<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQUlWvqHUiCm-Hn1TGohkaGpQl4ECgZLuQA-jahUFdIeL13MS8-fKI59UdIS9MJXUQPlhrgXu3AMvL3tAoMWYA0m4IG4spzn1ilTJEnBZT7sLvaYpYI0yiSumeG6H8UC0SRa71mLXChPhl/s1600/man.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQUlWvqHUiCm-Hn1TGohkaGpQl4ECgZLuQA-jahUFdIeL13MS8-fKI59UdIS9MJXUQPlhrgXu3AMvL3tAoMWYA0m4IG4spzn1ilTJEnBZT7sLvaYpYI0yiSumeG6H8UC0SRa71mLXChPhl/s1600/man.jpg" /></a></div>
<br />
When you try to install C# application in windows environment you may gets a error message "Application cannot be started contact the application vendor". Look at the error dialog shows below.<br />
<br />
Then if you click on the details button, A text file opens with the details of the error and it shows lot more details about the issue.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0NG2i6lJrpR2rKgevA6SsWGQ_6F1W6p3jwykZGoPLKfwT3pdTneIi5Mes-dCWwPKhTnBupTkUAG2D9upArlS24POdTxZ_QbNfuRvLSHc0IxYQ__t3amt7y9CKYM1I4Boxoi44ebGJ6Tmw/s1600/download.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0NG2i6lJrpR2rKgevA6SsWGQ_6F1W6p3jwykZGoPLKfwT3pdTneIi5Mes-dCWwPKhTnBupTkUAG2D9upArlS24POdTxZ_QbNfuRvLSHc0IxYQ__t3amt7y9CKYM1I4Boxoi44ebGJ6Tmw/s1600/download.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
If the "<span style="font-family: Courier New, Courier, monospace;">ERROR SUMMARY</span>" may be as below.
<br />
<br />
<pre class="prettyprint">Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of C:\application_path\application_name.application resulted in exception. Following failure messages were detected:
+ Deployment and application do not have matching security zones.
</pre>
<br />
And also<span style="font-family: Courier New, Courier, monospace;"> "ERROR DETAILS"</span> can be shown as below<br />
<br />
<pre class="prettyprint">Following errors were detected during this operation.
* [date and time] System.Deployment.Application.InvalidDeploymentException (Zone)
- Deployment and application do not have matching security zones.
- Source: System.Deployment
- Stack trace:
</pre>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: inherit;">If you faced above situation and looking for a </span>solution,<span style="font-family: inherit;"> Here is the correct place you need to stay and read. below few steps may help you to fix the issue if you fortunate enough. There can be few reasons for this issue and here explains how to fix each of those by doing some simple steps. Normally this issue </span>happens when you try to install a application using <b>OneClick</b> method that support by .NET framework.<span style="font-family: inherit;"> </span><span style="font-family: 'Courier New', Courier, monospace;"> </span><br />
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span>
<br />
<ul>
<li>Before publish your application make sure to go to project properties->"Security tab" and select "This is fully trusted application"</li>
<li>And go to project properties->"Publish tab" and select "This application available offline as well".</li>
<li>And make sure to at-least sign your application by test certification.</li>
</ul>
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span>
<span style="font-family: inherit;"><b>1. Corruption of previous installation file: </b></span><br />
If you install same application previously in the same computer, remaining file or signatures may troubling you<br />
<span style="font-family: inherit;">Solution: Uninstall all the previous versions and try to install the application again.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;"><b>2. Corruption of oneClick cache:</b></span><br />
If you try to install this application several time or if it fails one time or because of other application cache this error trigger at the situation.<br />
<span style="font-family: inherit;">Solution: Clear the oneClick cache and try to install the application again. </span><span style="font-family: inherit;">Here is the way to clear oneClick cache</span><br />
<pre class="prettyprint">From command line run: rundll32 dfshim CleanOnlineAppCache
If it doesn’t work, delete the real folder:
Windows Vista/7/8
C:\users\[username]\AppData\Local\Apps\2.0\
Windows XP/2003
C:\Documents and Settings\username\LocalSettings\Apps\2.0\
</pre>
<br />
<span style="font-family: inherit;"><b>3. Corruption or missing of setup files:</b></span><br />
<span style="font-family: inherit;">Solution: Download the release files from originally hosted location and try to install it again.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;"><b>4. If user click on a URL and select “Run” method to install the application:</b></span><br />
<span style="font-family: inherit;">Solution: Use Internet Explorer, If you are directly install from an URL. </span><span style="font-family: inherit;"> Add setup file hosted domain name to “</span><a href="http://windows.microsoft.com/en-us/windows-vista/security-zones-adding-or-removing-websites" style="font-family: inherit;">Trusted sites</a><span style="font-family: inherit;">” in Internet Explorer.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;"><b>5. Antivirus program blocking setup files:</b></span><br />
<span style="font-family: inherit;">Solution: Disable if any the antivirus program install in your computer temporary and try to install the application. </span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;"><b>6. Corruption of the registry:</b></span><br />
<span style="font-family: inherit;">Solution: Use Some trusted third party tool (<a href="http://www.piriform.com/ccleaner">CCleaner</a>) to clean the registry and try to</span><br />
<span style="font-family: inherit;"><br /></span>Unknownnoreply@blogger.com65tag:blogger.com,1999:blog-2528866089815406447.post-7709439812906344002013-05-09T02:28:00.001-07:002013-06-06T18:23:30.918-07:00Simple and Basic C++ Coding Conventions <h2>
1. Introduction</h2>
<div>
<br /></div>
<div>
<br /></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzHT9H7XIAe7SSGkIzqOVxSnt-ScP9hJUtzVDLllSBawq3O1D4YlR2CSi62YOnAK0v28tHyDAPkdmfdXBnYZnmKcGgZzgg7enoZKk79AmW-p3MDo1wjWBVSgWrHtBAKvygnfYVbpnCatBc/s1600/man_walking_dog2.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzHT9H7XIAe7SSGkIzqOVxSnt-ScP9hJUtzVDLllSBawq3O1D4YlR2CSi62YOnAK0v28tHyDAPkdmfdXBnYZnmKcGgZzgg7enoZKk79AmW-p3MDo1wjWBVSgWrHtBAKvygnfYVbpnCatBc/s1600/man_walking_dog2.jpg" /></a>Most basic concept of C++ style rule is Use common sense and always be consistence inside the project.
Most common logic of software development is that 10% of the cost of a project goes into writing code, while more than 50% is spent on maintaining it.
<br />
Think about the trade-offs between ease-of-programming now vs. ease-of-maintenance for the next 5 to 10 years when you consider the recommendations presented here.<br />
The establishment of a common style will facilitate understanding and maintaining code developed by more than one programmer as well as making it easier for several people to cooperate in the development of the same program. The point of having style guidelines is to have a common vocabulary of coding so people can concentrate on what you are saying, rather than on how you are saying it. This document present global style rules here so people know the vocabulary. But local style is also important. If code you add to a file looks drastically different from the existing code around it, the discontinuity throws readers out of their rhythm when they go to read it. Try to avoid this. If you are editing code, take a few minutes to look at the code around you and determine its style.
<br />
<br />
<br />
<h2>
2. Coding conventions</h2>
<div>
<br /></div>
<h3>
2.1. Files</h3>
<ol>
<li>There should be one include class declare header file for each source code file.</li>
<li>Each include file should describe a single class or tightly integrated set of classes.</li>
<li>The name of the file should be the name of the class contained in the file without the leading "C". And file names should begin with lower case letters.</li>
<li>File names should limited up to 30 characters.</li>
<li>File names and directory paths should not contain blanks, parentheses "(", or crazy characters</li>
<li>File header comments shall be placed at the top of each file stating the name of the file and comments on the file contents [Appendix 01].</li>
<li>Do not use filenames that already exist in STL
Fine names should be lowercase and words separate by underscore sign. </li>
<li>Each project should have a readme.txt file</li>
</ol>
<div>
<br /></div>
<h4>
2.1.1. Header Files(.hpp)</h4>
<ol>
<li>Header files should only to contain definitions and NOT instantiations. Thus the include file can be used in multiple files.</li>
<li>All header files should have <span style="color: #0b5394; font-family: Courier New, Courier, monospace;">#define</span> guards to prevent multiple inclusions.</li>
<li>The format of the symbol name should be <span style="color: #0b5394; font-family: Courier New, Courier, monospace;">FILENAME</span><file><span style="color: #0b5394; font-family: Courier New, Courier, monospace;">_H_</span>. </file></li>
<li>Do not use <span style="color: #0b5394; font-family: Courier New, Courier, monospace;">#pragma once</span>.</li>
<li>If a class in a header file does not need to know the size of a data member class or does not need to use the class's members then forward declare the class instead of including the file.</li>
<li>When including use standard order for readability and to avoid hidden dependencies: C library, C++ library, other libraries' <span style="color: #0b5394; font-family: Courier New, Courier, monospace;">.hpp</span>, your project's <span style="color: #0b5394; font-family: Courier New, Courier, monospace;">.hpp</span>.</li>
<li>Within each section, includes should be ordered alphabetically.</li>
<li>Do not include files with full path.
Include statements should be documented, telling the user why a particular file was included.</li>
<li>If the file includes a class used by the class then it's useful to specify a class relationship.</li>
<li>C++ header files often use the suffix "<span style="color: #0b5394; font-family: Courier New, Courier, monospace;">.hpp</span>" while "C" header files use "<span style="color: #0b5394; font-family: Courier New, Courier, monospace;">.h</span>" suffix.</li>
<li>Avoid the use of "namespace" in the "<span style="color: #0b5394; font-family: Courier New, Courier, monospace;">.hpp</span>" include file.</li>
</ol>
<div>
<br /></div>
<h4>
2.1.2. Source file(.cpp)</h4>
<br />
<ol>
<li>C++ source files should have a<span style="color: #0b5394; font-family: Courier New, Courier, monospace;"> .cpp</span> extension. Each source file should always have a header file with same name and a <span style="color: #0b5394; font-family: Courier New, Courier, monospace;">.hpp</span> extension.</li>
<li>The source file defines code and It instantiates definitions defined in the include file.</li>
</ol>
<div>
<br /></div>
<h3>
2.1. Namespace</h3>
<br />
<ol>
<li>Unnamed namespaces in <span style="color: #0b5394; font-family: Courier New, Courier, monospace;">.cpp</span> files are encouraged.</li>
<li>Do not use a using-directive outside the classes in <span style="color: #0b5394; font-family: Courier New, Courier, monospace;">.hpp</span> files.</li>
<li>You may use a using-declaration anywhere in a <span style="color: #0b5394; font-family: Courier New, Courier, monospace;">.cpp</span> file, and in functions, methods or classes in <span style="color: #0b5394; font-family: Courier New, Courier, monospace;">.hpp</span> files.</li>
<li>Do not use unnamed namespaces in <span style="color: #0b5394; font-family: Courier New, Courier, monospace;">.hpp</span> files.</li>
<li>Namespaces wrap the entire source file after includes, definitions/declarations, and forward declarations of classes from other namespaces.</li>
<li>Do not use namespace aliases are outside of the named namespace in<span style="color: #0b5394; font-family: Courier New, Courier, monospace;"> .hpp</span>.</li>
<li>Namespace names should be all lower-case.</li>
</ol>
<div>
<br /></div>
<h3>
2.2. Class and structures</h3>
<ol>
<li>Be sure to add virtual to the base class destructors.</li>
<li>Access modifier sequence should be <span style="color: #0b5394; font-family: Courier New, Courier, monospace;">public, protected</span> then<span style="color: #0b5394; font-family: Courier New, Courier, monospace;"> private</span> and the declaration order should be
<ul>
<li>Typedefs and Enums </li>
<li>Constants (static const data members)</li>
<li>Constructors </li>
<li>Destructor </li>
<li>Methods, including static methods</li>
<li>Data Members (except static const data members)</li>
</ul>
</li>
<li>Avoid doing complex initialization in constructors (in particular, initialization that can fail or that requires virtual method calls). </li>
<li>When redefining an inherited virtual function, explicitly declare it virtual in the declaration of the derived class</li>
<li>If class doesn’t have other constructors you must define a default constructor (one that takes no arguments) and use to initialize the members.</li>
<li>Use the keyword explicit for constructors with one argument except copy constructor.</li>
<li>Do not overload operators except in rare, special circumstances</li>
</ol>
<div>
<br /></div>
<h3>
2.3. Functions</h3>
<ol>
<li>Define functions inline only when they are small, say, 10 lines or less.</li>
<li>Try to keep function short and simple (around 40 lines).</li>
<li>When defining a function, parameter order is: inputs, then outputs.</li>
<li>Write some descriptive comments before every function, telling the user what you did and why.</li>
<li>Use completely global functions rarely and put nonmember functions in a namespace avoid polluting the global namespace.</li>
<li>Place a function's variables in the narrowest scope possible, and initialize variables in the declaration.</li>
<li>Function names should be descriptive; eschew unknown abbreviation, should be "command" verbs.</li>
<li>Regular functions name should start with a capital letter and have a capital letter for each new word. No underscores.</li>
<li>Accessors and mutators (get and set functions) should match the name of the variable they are getting and setting</li>
</ol>
<br />
<div>
<br /></div>
<h3>
2.4. Variables </h3>
<div>
<div>
<ol>
<li>Variable names should be descriptive; eschew unknown abbreviation types and should be nouns.</li>
<li>Name should be lowercase and use underscore to combine nouns (<span style="color: #0b5394; font-family: Courier New, Courier, monospace;">my_variable</span>) </li>
<li>Class member variables have trailing underscores (<span style="color: #0b5394; font-family: Courier New, Courier, monospace;">my_variable_</span>)</li>
<li>Declare object variable used in a loop outside that loop.</li>
<li>Variables are to be declared with the smallest possible scope.</li>
<li>Avoid local variable definitions that override (hide) variables defined at higher levels.</li>
<li>Try not to use Static or global variables of class type.</li>
<li>Consider to use const in possible locations.</li>
<li>Try not use variable length arrays, use vectors instead.</li>
<li>Data members in structs should be named like regular variables without the trailing underscores that data members in classes have.</li>
<li>Use prefix <span style="color: #0b5394; font-family: Courier New, Courier, monospace;">g_ </span>with global variables. But discourage to use global variables.</li>
<li>Use prefix <span style="color: #0b5394; font-family: Courier New, Courier, monospace;">c_</span> for constants variables.</li>
<li>Do not use Hungarian notation</li>
<li>A global variable would be instantiated in the "<span style="color: #0b5394; font-family: Courier New, Courier, monospace;">.cpp</span>" file and NOT the "<span style="color: #0b5394; font-family: Courier New, Courier, monospace;">.hpp</span>" file</li>
</ol>
</div>
</div>
<div>
<br /></div>
<h3>
2.5. Comments </h3>
<div>
<div>
<ol>
<li>When writing your comments, write for your audience: the next contributor who will need to understand your code. Be generous.</li>
<li>Start each file with license boilerplate, followed by a description of its contents with header comments.</li>
<li>Do not duplicate comments in both the <span style="color: #0b5394; font-family: Courier New, Courier, monospace;">.hpp</span> and the <span style="color: #0b5394; font-family: Courier New, Courier, monospace;">.cpp</span>.</li>
<li>Every class definition should have an accompanying comment that describes what it is for and how it should be used.</li>
<li>Every function declaration should have comments immediately preceding it that describe what the function does and how to use it.</li>
<li>What the inputs and outputs are should comment in function definition.</li>
<li>If there ant special things to mention about the function, It should comment above the function definitions (How it does the job).</li>
<li>Each class data member (also called an instance variable or member variable) and global variables should have a comment describing what it is used for.</li>
<li>In your implementation you should have comments in tricky, non-obvious, interesting, or important parts of your code. But not everywhere.</li>
<li>Note that you should never describe the code itself. Assume that the person reading the code knows C++.</li>
<li>Use <span style="color: #0b5394; font-family: Courier New, Courier, monospace;">TODO</span> comments with your email for code that is temporary, a short-term solution, or good-enough but not perfect. (<span style="color: #0b5394; font-family: Courier New, Courier, monospace;">TODO(kl@gmail.com): Need to implement thread safe.</span>)</li>
</ol>
</div>
<div>
<br />
<br />
<h3>
2.6. Formatting</h3>
<h4>
2.6.1. Function declaration and definition</h4>
<ol>
<li>
Simple function<br />
<pre class="prettyprint">ReturnType ClassName::FunctionName(Type par_1, Type par_2){
DoSomething();
...
}</pre>
</li>
<li>With long argument list.<br />
<pre class="prettyprint">ReturnType LongClassName::ReallyReallyReallyLongFunctionName(
Type par_1
Type par_2,
Type par_3){
DoSomething();
...
}
</pre>
</li>
<li>The return type is always on the same line as the function name.</li>
<li>The open parenthesis is always on the same line as the function name.</li>
<li>There is never a space between the function name and the open parenthesis.</li>
<li>There is never a space between the parentheses and the parameters.</li>
<li>The open curly brace is always at the end of the same line as the last parameter.</li>
<li>The close curly brace is either on the last line by itself or on the same line as the open curly brace.</li>
<li>All parameters should be named, with identical names in the declaration and implementation.</li>
<li>All parameters should be aligned if possible.</li>
<li>If some parameters are unused, comment out the variable name in the function definition for future use.</li>
</ol>
<br />
<br />
<h4>
2.6.2. Function call</h4>
<ol>
<li>Simple function call<br />
<pre class="prettyprint">bool retval = DoSomething(argument1, argument2, argument3);</pre>
</li>
<li>If the function has many arguments, consider having one per line if this makes the code more readable.<br />
<pre class="prettyprint">bool retval = DoSomething(argument1,
argument2,
argument3,
argument4);
</pre>
</li>
</ol>
<h4>
2.6.3. Conditionals</h4>
<ol>
<li>Simple condition.<br />
<pre class="prettyprint">if(condition){
...
}else if(...){
...
}else{
...
}</pre>
</li>
<li>Short conditional statements may be written on one line if this enhances readability.<br />
<pre class="prettyprint">if (x == kFoo) return new Foo();
if (x == kBar) return new Bar();
</pre>
<br />
</li>
<li>Do not write short conditional statement when the “if” statement has an “else”.<br />
<pre class="prettyprint">if (x == kFoo){
return new Foo();
}else{
return new Bar();
}
</pre>
<br />
</li>
<li>
When you have a Boolean expression that is longer than the standard line length, break up to the lines.<br />
<pre class="prettyprint">if (this_one_thing > this_other_thing &&
a_third_thing == a_fourth_thing &&
yet_another && last_one) {
...
}</pre>
<br />
</li>
</ol>
<h4>
2.6.4. Loops and switch statements</h4>
<ol>
<li>Simple switch always should have default and break.<br />
<pre class="prettyprint">switch (var){
case 0:
...
break;
case 1:
...
break;
default:
assert(false);
}</pre>
<br />
</li>
<li>If the content of the cases are too long should use curly brackets.<br />
<pre class="prettyprint">switch (var){
case 0:{
...
...
...
...
break;
}
default: {
assert(false);
}
}
</pre>
</li>
<li>Simple while loop.<br />
<pre class="prettyprint">while(condition){
...
}</pre>
</li>
<li>Simple for loop.<br />
<pre class="prettyprint">for(int i=0; i<10; ++i){
...
}</pre>
<br />
</li>
<li>Empty body loops should use “continue” or “{}”, but not single semicolon.<br />
<pre class="prettyprint">while(condition){} not <span style="color: red;">while(condition);</span>
</pre>
</li>
</ol>
<h4>
2.6.5. Pointer and Reference Expressions</h4>
<ol>
<li>When declaring a pointer variable or argument, you may place the asterisk adjacent to the variable name.<br />
<pre class="prettyprint">char *a;
const string &str;
</pre>
</li>
</ol>
<h4>
2.6.6. Preprocessor Directives and Macros</h4>
<ol>
<li>Preprocessor directives are within the body of indented code or begin of the file; the directives should start at the beginning of the line.</li>
<li>Macro names should name with all uppercase and underscores.</li>
</ol>
<h4>
2.6.7. Class</h4>
<ol>
<li>Any base class name should be on the same line as the subclass name, subject to the 80-column limit.<br />
<pre class="prettyprint">class MyClass : public OtherClass {
...
...
};</pre>
<br />
</li>
<li>Type names (for classes, structs, typedefs, and enums) start with a capital letter and have a capital letter for each new word, with no underscores: MyExcitingClass.<br />
</li>
<li>Constructor initializer lists can be all on one line or with subsequent lines if there are more things to initialize.
<pre class="prettyprint">MyClass::MyClass(int var) : var_(var), var2_(var + 1) {}
MyClass::MyClass(int var)
: var_(var),
var2_(var + 1),
var3_(var + 2) {}</pre>
<br />
</li>
<li>The contents of namespaces are should not indented.<br />
<br />
<pre class="prettyprint">namespace {
void foo() {
...
...
}
}</pre>
<br />
</li>
</ol>
<h4>
2.6.8. Horizontal Whitespace</h4>
<ol>
<li>Keep white spaces both sides of operator like =, +, -, / , && according to the place it uses.<br />
<pre class="prettyprint">x = 0;
x = -5;
++x;
if (x && !y)
v = w*x + y/z;
v = w * (x + z);
</pre>
<br />
</li>
<li>Keep space after each semicolon or colon exist before the line end.<br />
<pre class="prettyprint">for ( ; i < 5 ; ++i)
for (auto x : counts) {)
</pre>
</li>
</ol>
<h4>
2.6.9. Vertical Whitespace</h4>
<ol>
<li>Do not waste new lines.</li>
<li>Put one blank line between functions.</li>
<li>Do not leave blank lines at the beginning or end of a function.</li>
</ol>
<h3>
2.7. Other</h3>
</div>
</div>
<div>
<div>
<ol>
<li>Use C++ casts like<span style="color: #0b5394; font-family: Courier New, Courier, monospace;"> static_cast<>()</span>. Do not use other cast formats like int <span style="color: #0b5394; font-family: Courier New, Courier, monospace;">y = (int)x;</span> or int <span style="color: #0b5394; font-family: Courier New, Courier, monospace;">y = int(x);</span></li>
<li>Use prefix form (<span style="color: #0b5394; font-family: Courier New, Courier, monospace;">++i</span>) of the increment and decrements operators with iterators and other template objects.</li>
<li>Use const whenever it makes sense and consider making data members const whenever they do not need to be modified after construction.</li>
<li>Try not to use unsigned integers.</li>
<li>Use 0 for integers, 0.0 for reals, <span style="color: #0b5394; font-family: Courier New, Courier, monospace;">NULL</span> for pointers, and<span style="color: #0b5394; font-family: Courier New, Courier, monospace;"> '\0'</span> for chars when necessary.</li>
<li>Use <span style="color: #0b5394; font-family: Courier New, Courier, monospace;">sizeof(variable)</span> instead of <span style="color: #0b5394; font-family: Courier New, Courier, monospace;">sizeof(type)</span> when you need to get the size of a variable.</li>
<li>Each line of text in your code should be at most 80 characters long.</li>
<li>Avoid the use of numeric values or hardcode values in code; use symbolic values instead.</li>
<li>Do not allocate memory and expect that users will de-allocate it later.</li>
</ol>
<h2>
3. Appendix -01 </h2>
<pre class="prettyprint">/*******************************************************************
File: filename.ext
Author: Author Name
E-Mail: author@yourcompaney.com
Description: Here is the area that should describe what is the usage of this class and what is the functionality of the class and the important things that need to mentions.
Language: C++
Version: 1.0
Limitations: none/some (i.e: limitations such as file size string lengths etc..)
Copyright: Your Companey
Thread Safe: yes/no
Extendable: yes/no
Platform Depend:none/some (i.e.: Linux/Intel, Windows/Intel, Solaris/SPARC)
Change History:
--------------------------------------------------------------------
Date Author Description
YYYY-MM-DD Author Name What is the improvement or change have done because of which reason
*******************************************************************/
</pre>
<br /></div>
</div>
<div>
<br /></div>
<div>
<div>
<br /></div>
<h2>
Referance </h2>
<ol>
<li>The C++ Programming Language, By Bjarne Stroustrup
<br />Publication Date: June 30, 1997 | ISBN-10: 0201327554 | ISBN-13: 978-0201889543 | Edition: 3</li>
<li>C++ Coding Standards: 101 Rules, Guidelines, and Best Practices, By Herb Sutter and Andrei Alexandrescu
<br />
Publication Date: November 4, 2004 | ISBN-10: 0321113586 | ISBN-13: 978-0321113580 | Edition: 1</li>
<li>http://cpp.capibara.com</li>
<li>http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml</li>
<li>http://www.yolinux.com/TUTORIALS/LinuxTutorialC++CodingStyle.html</li>
</ol>
</div>
Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-2528866089815406447.post-59203382584524793362013-03-28T02:41:00.002-07:002013-06-06T18:23:34.882-07:00Types of constant pointers in C++<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEim0uBjWP1Gr2i_1k9hHr6hZEIQOVvr7P_8E3orWOA5bG5SgHnOrrX1iAs1x9ifslqUgUsRBFqsC9mlxX7FGOdnoSO6oiVWxCEomCTdQIbkJHp_j5_2qh_IyQtyvqOVm7PA3W0AUfb9LEwv/s1600/man_walking_dog.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 2em;"><img border="0" height="207" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEim0uBjWP1Gr2i_1k9hHr6hZEIQOVvr7P_8E3orWOA5bG5SgHnOrrX1iAs1x9ifslqUgUsRBFqsC9mlxX7FGOdnoSO6oiVWxCEomCTdQIbkJHp_j5_2qh_IyQtyvqOVm7PA3W0AUfb9LEwv/s320/man_walking_dog.jpg" width="320" /></a></div>
<br />
<br />
In C++ there are basic three types of constant pointers exist.<br />
<ol>
<li>Pointer that pointed to some constant data.</li>
<li>Pointer that constantly pointed to some memory location.</li>
<li>Pointer that constantly pointed to some constant data.</li>
</ol>
<br />
<h3>
Pointer that pointed to some constant data.</h3>
<pre class="prettyprint">const datatype * pointerName;
dataType const * pointerName
</pre>
<br />
Here the pointer is pointing to some constant data. That means the data pointed by pointer cannot edit using the pointer. As example if pointer "p" pointing to some string "This is a constant string", The pointer "p" cannot use to edit the content "This is a constant string"
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6HVDWzAG0xThksCCs-k2E1rxlp8xbyq7G1agkBSZFG6mpscGWQRsdIqQMPjYeNJ2ylaZ6z2OHL7-Wv2VtMhM4KeaT2hGC-PgPA3dCFlLItgaOH8wcLU8KQAoamzSoP3RLx8BAGBTFrnZp/s1600/constent.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="23" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6HVDWzAG0xThksCCs-k2E1rxlp8xbyq7G1agkBSZFG6mpscGWQRsdIqQMPjYeNJ2ylaZ6z2OHL7-Wv2VtMhM4KeaT2hGC-PgPA3dCFlLItgaOH8wcLU8KQAoamzSoP3RLx8BAGBTFrnZp/s320/constent.png" width="320" /></a></div>
<br />
Example:If you try with this peace of code<br />
<br />
<pre class="prettyprint">#include <iostream>
using namespace std;
int main(){
const char * const_data_pointer_1 = NULL;
const_data_pointer_1 = "This is a constant string";
const_data_pointer_1[10] = 'A';
return 0;
}
</pre>
<br />
C++ compiler shows error like<br />
<br />
<pre class="prettyprint">error C3892: 'const_data_pointer_1' : you cannot assign to a variable that is const
</pre>
<br />
<br />
<h3>
Pointer that constantly pointed to some memory location.</h3>
<pre class="prettyprint">dataType * const pointerName
</pre>
<br />
Here the pointer behave a content, It means once initialize the pointer it cannot change the memory location it pointing to. In previous type, the content pointed by pointer behave as constant. by here the content pointed by pointer allow the edit but the memory location pointed by the pointer cannot change.<br />
<br />
Example:If you try with this peace of code.<br />
<br />
<br />
<pre class="prettyprint">#include <iostream>
using namespace std;
int main(){
char * const cont_pointer = "This is not a constant string";
cont_pointer = "This new memory location not allow to point";
system("pause");
return 0;
}
</pre>
<br />
C++ compiler shows error like<br />
<br />
<pre class="prettyprint">error C3892: 'cont_pointer' : you cannot assign to a variable that is const
</pre>
<br />
<br />
<h3>
Pointer that constantly pointed to some constant data.</h3>
<pre class="prettyprint">const dataType * const pointerName;
dataType const * const pointerName;
</pre>
<br />
This type pointer also a constant pointer, It means cannot change the memory location pointed by this pointer. And also the content pointed by the pointer also constant, It means the content pointed by the pointer also not allow the alter. <br />
<br />
Example:If you try with this peace of code.<br />
<br />
<pre class="prettyprint">#include <iostream>
using namespace std;
int main(){
char const * const cont_pointer = "This is not a constant string";
cont_pointer[10] = 'A';
cont_pointer = "This new memory location not allow to point";
system("pause");
return 0;
}
</pre>
<br />
C++ compiler shows error like.
<br />
<pre class="prettyprint">error C3892: 'cont_pointer' : you cannot assign to a variable that is const
error C3892: 'cont_pointer' : you cannot assign to a variable that is const
</pre>
Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-2528866089815406447.post-37827335448671607432012-12-06T22:58:00.001-08:002013-06-06T18:23:36.717-07:00Unit test for unmanaged C++ in Visual Studio<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTfx2prEBBXCktfwjbtPQzXeL71N_dwwV1SGylgEFuX-3vHUQfda311lVPJ2QK5Ce2E62sT2f2Tc-QEozm5CvVrsYDeTRu36iKUrad0bna2KZvgmj698K-6qn8LcEl5tYPJIf4BQ0yxOva/s1600/invasion_insects_macro_bugs_desktop_1920x1080_hd-wallpaper-841473.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="266" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTfx2prEBBXCktfwjbtPQzXeL71N_dwwV1SGylgEFuX-3vHUQfda311lVPJ2QK5Ce2E62sT2f2Tc-QEozm5CvVrsYDeTRu36iKUrad0bna2KZvgmj698K-6qn8LcEl5tYPJIf4BQ0yxOva/s320/invasion_insects_macro_bugs_desktop_1920x1080_hd-wallpaper-841473.jpg" width="320" /></a></div>
Bugs free software is a dream of every person who involve in software development process. But with the today complex software systems and even more featured requirements , it is quite a challenge to overcome this specific expectation.<br />
There are number of methodologies and tools for bug tracking, debugging, error tracing and various level to testing. But as the developers unit testing and integrated testing are the most important kind of testing that require to implement a bug free software. So in this article I'm going to show you some tips and methodologies of unit testing. As C++ developers knows unit testing for unmanaged C++ is a quit cumbersome and there is no standers way to do the unit testing for development environment. Normally expert developers prefers the TDD (Test driven development) for error less software and as a confident development method that support to maintain and extend the already developed software.<br />
<br />
Most of the Unmanaged C++ developers developers mostly use some kind of third party Unit Test frame-works such as 'Boost Test', 'Google Test' or 'cppUnit' even they works on windows environment. Actually these unit testing frameworks have some unique features and capabilities than .NET unit testing framework, such as object mocking and various Assert rules. But when you are working with Visual Studio IDE, using .NET unit testing framework may easy to use and compatible than other unit testing frameworks. But even some developers uses .NET unit testing capability for MFC or ATL projects (Manage C++), Most of them don't have idea how to use it with unmanaged C++ development. But If you are involving in DLL or LIB development using C++ it is easy to do unit testing by adding the static or dynamic library as reference to the testing project.<br />
<br />
But in this article I'm going to introduce you how the set-up unit testing for for Win32 console application (Unmanaged C++) (But even this is possible with Win32 windows applications) in Visual Studio 2010 with Windows operation system. Even I describing this for Visual Studio 2010, It may applicable with other versions such as 2012,2008 or 2005. So lets start as step by step guide from here.<br />
<br />
Today I'm going to develop a simple calculator with unit testing for the functionality.<br />
<br />
<b><span style="font-size: large;">Add Main Project</span></b><br />
<br />
1. Open visual studio 2010 and Create a new project by using 'File' -> 'New'<br />
2. In new project window go to right hand side panel -> select Visual C++ -> select Win32<br />
3. In the Right hand side panel select 'Win32 Console Application'<br />
4. Type 'calculator' in Name text field bellow and select the location as you need.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyWW8GOwBpfgk-BMaLgixQRJ_ykZJY1OyEBODsbrVpAWcc1jLfkJj1v26UBBHhvml5FBeD9Tsq-six_0l94t1O4CbgqxQvHv2BbpsfDWu07Fs_CbdxgMRMVQcn6Be8J5v9GPBHQ1Dd2YLk/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="441" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyWW8GOwBpfgk-BMaLgixQRJ_ykZJY1OyEBODsbrVpAWcc1jLfkJj1v26UBBHhvml5FBeD9Tsq-six_0l94t1O4CbgqxQvHv2BbpsfDWu07Fs_CbdxgMRMVQcn6Be8J5v9GPBHQ1Dd2YLk/s640/1.png" width="640" /></a></div>
<br />
5. Then next window (Win32 Application Wizard) just click next<br />
6. Then next window select 'Empty Project' and keep setting as this image. then click finish<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp_ErDsOuZVxoU84m7wcEv356r4pCFa5jgQEk4GMw8LF8vIkdafm6jI2R_ySPgK-OORzi_rda7iIzqv6SZllvQwTxKB3SNV4JOrj9ETShFiIfIZj5dcX2NsC8lxyA6uZLTs9lunCkadVW0/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="538" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp_ErDsOuZVxoU84m7wcEv356r4pCFa5jgQEk4GMw8LF8vIkdafm6jI2R_ySPgK-OORzi_rda7iIzqv6SZllvQwTxKB3SNV4JOrj9ETShFiIfIZj5dcX2NsC8lxyA6uZLTs9lunCkadVW0/s640/2.png" width="640" /></a><br />
<br />
So this is our main project and main method should be in this project for initiate the application.<br />
<br />
7. In the Solution explorer expand calculator -> right click on 'Source File' -> 'Add' -> 'New Item' -> select 'C++ File (.cpp)'<br />
8. Type the name 'main' in Name text box and click add<br />
<br />
<br />
<b><span style="font-size: large;">Add Lib Project</span></b><br />
<b><span style="font-size: large;"><br /></span></b>
1. Right click Solution in 'Solution explorer' and select 'Add' -> 'New Project'<br />
2. Next window in left pane select Win32 and in right pane select 'Win 32 Console Application'<br />
3. Type 'calculator_lib' in Name text box and click ok.<br />
4. In next window just click next<br />
5. In next window select Static library and keep other setting as image. Then click finish.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjN5j1F2hSCNAqGlgIGyHgmGLYB612mYS1He_8TbN36s-LBehOhkf3IydX9t6HFLAWwOuY5m1a4f4tRgKqs4yh1PGB-w3SrVHnHQ3RPsj1-6Vc5u-1k7j1RflnWxK45uJgMmBlZyq3oICDa/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="538" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjN5j1F2hSCNAqGlgIGyHgmGLYB612mYS1He_8TbN36s-LBehOhkf3IydX9t6HFLAWwOuY5m1a4f4tRgKqs4yh1PGB-w3SrVHnHQ3RPsj1-6Vc5u-1k7j1RflnWxK45uJgMmBlZyq3oICDa/s640/3.png" width="640" /></a></div>
<br />
<br />
<br />
<b><span style="font-size: large;">Add Test Project</span></b><br />
<br />
1. Same as above right click Solution in 'Solution explorer' and select 'Add' -> 'New Project'<br />
2. Next window left hand panel select 'Visual C++'->'Test'<br />
3. Type calculator_test in Name text box<br />
4. Click OK<br />
<br />
Now your solution explorer should have three project and It should looks like this image<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjHd9XQs6cnJkXUykM-zrgNDiwm1ll_WV4gdOTsaiNGZDNsmJdohEsMh6s-iYqXLb8gqrjT8ki7SIsmhUw2a7dz_UukjwBY_yLvs2Y-W9WItO3S9yVdCB49lZmM44_GjgPGhaDlHZQ7sNt/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjHd9XQs6cnJkXUykM-zrgNDiwm1ll_WV4gdOTsaiNGZDNsmJdohEsMh6s-iYqXLb8gqrjT8ki7SIsmhUw2a7dz_UukjwBY_yLvs2Y-W9WItO3S9yVdCB49lZmM44_GjgPGhaDlHZQ7sNt/s640/4.png" width="328" /></a></div>
<br />
<b><span style="font-size: large;">Configurations Test Project </span></b><br />
<b><span style="font-size: large;"><br /></span></b>
1. Right click calculator_test project and select properties'<br />
2. In left hand panel select 'Common Properties' -> 'Framework and Referance'<br />
3. In right side panel click 'Add New Reference' button at bottom<br />
4. Select 'Project' tab then select 'calculator_lib' and click OK<br />
5. Left side panel select 'Configuration Properties' then 'General'<br />
6. In top left combo box select 'All Configurations<br />
7. Change the Target Name from 'DefaultTest' to 'CalculatorTest'<br />
8. Then expand 'C/C++' and select 'Genaral' in left hand panel<br />
9. In right hand panel there is a entry 'Additional Include Directories' paste the bellow text there<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">$(SolutionDir)\calculator_lib;%(AdditionalIncludeDirectories)</span><br />
<br />
10. change 'Common Language Run Time Support' as 'Common Language RunTime Support (/clr)' in Right side panel and click OK<br />
<br />
<b><span style="font-size: large;">Configurations Main Project </span></b><br />
<b><span style="font-size: large;"><br /></span></b>
1. Right click on calculator project and select properties.<br />
2. In top left combo box select 'All Configurations<br />
3. In left hand panel select 'Common Properties' -> 'Framework and Referance'<br />
4. In right side panel click 'Add New Reference' button at bottom<br />
5. Select 'Project' tab then select 'calculator_lib' and click OK<br />
6. Then expand 'C/C++' and select 'Genaral' in left hand panel<br />
7. In right hand panel there is a entry 'Additional Include Directories' paste the bellow text there<br />
<br />
<span style="font-family: 'Courier New', Courier, monospace;">$(SolutionDir)\calculator_lib;%(AdditionalIncludeDirectories)</span><br />
<br />
8. Click OK<br />
<br />
<br />
<b><span style="font-size: large;">C++ Coding</span></b><br />
<b><span style="font-size: large;"><br /></span></b>
1. Go to solution explorer and expand the calculator project<br />
2. open the 'main.cpp' file and paste the following code on it.<br />
<br />
<pre class="prettyprint">#include <iostream>
using namespace std;
int main()
{
cout << "This is my first Unit Test for unmanaged C++ application";
return 0;
}
</pre>
3. Click Ctl+F7 to build the solution and solution should build with three projects as bellow image.
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHXLVaQqv03nkqsvS8ssV_l3QVL8r7RQO-UcVd8pzlKZ9X0YLtsbhH-_VbApncSTDYiaH9XvBy-WTuBqji_ryi7mgNqFw1fulBMRhDy9s_JTBHlv1ncl6aFt-jTlbstzdZDUynDq7BJxe4/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="324" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHXLVaQqv03nkqsvS8ssV_l3QVL8r7RQO-UcVd8pzlKZ9X0YLtsbhH-_VbApncSTDYiaH9XvBy-WTuBqji_ryi7mgNqFw1fulBMRhDy9s_JTBHlv1ncl6aFt-jTlbstzdZDUynDq7BJxe4/s640/5.png" width="640" /></a></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
4. Right click the 'calculator_lib' project in solution explorer and click 'Add'-> 'Class'<br />
5. Select 'C++ Class' from right panel in next window and click add.<br />
6. In next window add 'basic_calculator' in 'Class name' text box and click finish.
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5TLZHIxyCSSi3GbjQn9hT6zhuV9fF0Z9k7j3Of1DZdLq9sp5T8oDjQucbQmr_zMlnb2WrCphodhc0FrfrL5SuofmH7kMVDkB6_lAXzWNuz1njyB6TJuj76o4P9yBem0xswCwpZXHX5zX_/s1600/6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="537" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5TLZHIxyCSSi3GbjQn9hT6zhuV9fF0Z9k7j3Of1DZdLq9sp5T8oDjQucbQmr_zMlnb2WrCphodhc0FrfrL5SuofmH7kMVDkB6_lAXzWNuz1njyB6TJuj76o4P9yBem0xswCwpZXHX5zX_/s640/6.png" width="640" /></a></div>
<br />
7. Open' basic_calculator.h' file and replace the following code in to it
<br />
<pre class="prettyprint">#pragma once
class basic_calculator
{
public:
basic_calculator(void);
~basic_calculator(void);
int add(int a,int b);
int minus(int a,int b);
int multiply(int a,int b);
int devid(int a,int b);
};</pre>
<br />
8. Open 'basic_calculator.cpp' file and replace the fallowing code in to it<br />
<br />
<br />
<pre class="prettyprint">#include "StdAfx.h"
#include "basic_calculator.h"
basic_calculator::basic_calculator(void)
{
}
basic_calculator::~basic_calculator(void)
{
}
int basic_calculator::add(int a,int b)
{
return a+b;
}
int basic_calculator::minus(int a,int b)
{
return a-b;
}
int basic_calculator::multiply(int a,int b)
{
return a*b;
}
int basic_calculator::devid(int a,int b)
{
return a/b;
}
</pre>
<br />
<b><span style="font-size: large;">Adding test case
</span></b><br />
1. Right click the calculator_test project and click 'Add' then 'New Test'<br />
2. In next window select 'UnitTest' and add 'basic_calculator_test' for 'Test Name' text field and click OK<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBXu5N5Tywgl8Wi2DKInChbB5gAMXcyWV5qtBkM2yvT0kQrcmwQL4MYAkUNZLZK_0tcxX6X-0FyrAW0KZa8wDkusn96ECu34rBUGuAlQY_mrd5JJaI74k-QAWweoSKz2jZhpEYyXzwDN_H/s1600/7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="540" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBXu5N5Tywgl8Wi2DKInChbB5gAMXcyWV5qtBkM2yvT0kQrcmwQL4MYAkUNZLZK_0tcxX6X-0FyrAW0KZa8wDkusn96ECu34rBUGuAlQY_mrd5JJaI74k-QAWweoSKz2jZhpEYyXzwDN_H/s640/7.png" width="640" /></a></div>
<br />
3. Open basic_calculator_test.cpp file and clear unawareness comment, include 'basic_calculator.h' file and create a pointer 'by basic_calculator' class<br />
<br />
<b>Note: Actually here I'm showing how to write vary basic few test cases for your start. Later you can find your own journey in unmanaged C++ unit testing.</b><br />
<br />
<br />
4. Change test method name to addTest and write a test case for 'add' functionality using assert<br />
5. Same as this add another three test cases for remaining functionality also.<br />
6. So finally your 'basic_calculator_test' should be like this<br />
<br />
<span style="color: red;">Note: Mostly IntelliSense not supporting for C++ Test project in Visual Studio 2010</span><br />
<br />
<pre class="prettyprint">#include "stdafx.h"
#include "basic_calculator.h"
using namespace System;
using namespace System::Text;
using namespace System::Collections::Generic;
using namespace Microsoft::VisualStudio::TestTools::UnitTesting;
namespace calculator_test
{
[TestClass]
public ref class basic_calculator_test
{
private:
TestContext^ testContextInstance;
basic_calculator* test_calculator;
public:
property Microsoft::VisualStudio::TestTools::UnitTesting::TestContext^ TestContext
{
Microsoft::VisualStudio::TestTools::UnitTesting::TestContext^ get()
{
return testContextInstance;
}
System::Void set(Microsoft::VisualStudio::TestTools::UnitTesting::TestContext^ value)
{
testContextInstance = value;
}
};
[TestMethod]
void addTest(){Assert::AreEqual<int>(6, test_calculator->add(4,2));};
[TestMethod]
void minusTest(){Assert::AreEqual<int>(2, test_calculator->minus(4,2));};
[TestMethod]
void multiplyTest(){Assert::AreEqual<int>(8, test_calculator->multiply(4,2));};
[TestMethod]
void devidTest(){Assert::AreEqual<int>(2, test_calculator->devid(4,2));};
[TestMethod]
void addTestForFail(){Assert::AreEqual<int>(5, test_calculator->add(3,3));};
};
}
</pre>
7. Now you finish creating test cases for your basic_calculator.<br />
8. Right click on "Soloution 'calculator'" in project explorer and click properties<br />
9. Next window select calculator_test as 'Single startup project' and click ok<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGZcdEY-228LQLP6x8C5OHI2XWBfBTN4zS2O32CecYMwtThnh9zOoHYJ0NSnWk7AVbu98d-Ob4HelNp3s2SFLwJD53utwPg6V7EC4tfHLtgCYmcRubtuDK4RZTHYGGBwHUSlNSlTW1Qahk/s1600/8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="390" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGZcdEY-228LQLP6x8C5OHI2XWBfBTN4zS2O32CecYMwtThnh9zOoHYJ0NSnWk7AVbu98d-Ob4HelNp3s2SFLwJD53utwPg6V7EC4tfHLtgCYmcRubtuDK4RZTHYGGBwHUSlNSlTW1Qahk/s640/8.png" width="640" /></a></div>
<br />
10. Then press Ctl+F7 to build the project and then F5 to run.<br />
11. You will see your Unit test are running in the bottom and you can see the result in 'Test Result' Window<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggLMncE9NbwcnOdVTzxQ4v3RnO6neuQj6iUil6QzLEz90qJoHBI7VgGoVisva1pA1OFuloGdNyANwL0HAYw5YIKCXz-XeVBf4b64nOT0LUTFCBgnMtqK5enN6hSwD6e3Py_Ti8u0Pwiwzv/s1600/9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="232" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggLMncE9NbwcnOdVTzxQ4v3RnO6neuQj6iUil6QzLEz90qJoHBI7VgGoVisva1pA1OFuloGdNyANwL0HAYw5YIKCXz-XeVBf4b64nOT0LUTFCBgnMtqK5enN6hSwD6e3Py_Ti8u0Pwiwzv/s640/9.png" width="640" /></a></div>
12. So as we expected four of our unit test passed and one failed you can write more advance test cases by improving your knowledge and reading about Assert functions.<br />
<br />
<b>Building Application</b><br />
1. Open main file under 'calculator' project and replace with fallowing code.<br />
<br />
<br />
<pre class="prettyprint">#include <iostream>
#include "basic_calculator.h"
using namespace std;
int main()
{
cout << "This is my first Unit Test for unmanaged C++ application" << endl;
basic_calculator* my_calculator = new basic_calculator();
cout << "4 + 2 =" << my_calculator->add(4,2) << endl;
cout << "4 - 2 =" << my_calculator->minus(4,2) << endl;
cout << "4 * 2 =" << my_calculator->multiply(4,2) << endl;
cout << "4 / 2 =" << my_calculator->devid(4,2) << endl;
system("pause");
return 0;
}
</pre>
2.Right click on "Soloution 'calculator'" in project explorer and click properties again<br />
3. Next window select 'calculator' as 'Single startup project' and click ok<br />
4. Build the project and run then you can see the result<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfh70y6KbR2yspNWsndS0GXxknELOlWugIlUkOVmaJVye5fJ184vkzYb0GPDJQsno7ngqvv3rOA7WCvNPXofSpIDT__LzvNMuLs5fRNfwwws5jnhBNc5N2J0AKnT6kLskcRrG9-rE22yOF/s1600/10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="152" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfh70y6KbR2yspNWsndS0GXxknELOlWugIlUkOVmaJVye5fJ184vkzYb0GPDJQsno7ngqvv3rOA7WCvNPXofSpIDT__LzvNMuLs5fRNfwwws5jnhBNc5N2J0AKnT6kLskcRrG9-rE22yOF/s640/10.png" width="640" /></a></div>
<br />
Congratulations! Now you know how to create unit test for unmanaged C++ applications. So need to do more studies to be a expert Unit test writer. I'm putting her some resource for your referance<br />
<br />
<a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.unittesting.assert.aspx">http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.unittesting.assert.aspx</a><br />
<a href="http://msdn.microsoft.com/en-us/library/te3ecsc8.aspx">http://msdn.microsoft.com/en-us/library/te3ecsc8.aspx</a>Unknownnoreply@blogger.com27tag:blogger.com,1999:blog-2528866089815406447.post-86927866382319530912012-11-18T20:07:00.002-08:002013-06-06T18:23:38.163-07:00Tab key not working in Visual Studio 2010<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnxpMIbpd5NR22ae2DP3XO5bCbNPJm36IwBXapgjGM2VHsSkfCPXicPJfHhJ_PUk2aATrP6JMA_ac6WdvqGSb27NwC-2eYFl_el7Bj2u2n82YAvrf14LE2Ekbf1bsl0Une5CDtJ1GzIISl/s1600/Untitled.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 3em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnxpMIbpd5NR22ae2DP3XO5bCbNPJm36IwBXapgjGM2VHsSkfCPXicPJfHhJ_PUk2aATrP6JMA_ac6WdvqGSb27NwC-2eYFl_el7Bj2u2n82YAvrf14LE2Ekbf1bsl0Une5CDtJ1GzIISl/s1600/Untitled.png" /></a></div>
If you face the not working tab key in the visual studio editor. Here shows how to make Tab key work.
<br />
<ol>
<li>Go to Tools->Options->Text Editor->C/C++->Formatting</li>
<li>Find the "Indentation" group on right side.</li>
<li>Find the Automatic Indentation On Tab.</li>
<li>Make it false.</li>
<li>Enjoy the Tab key :)</li>
</ol>
<div>
<br /></div>
<div>
If you are working with some other language, Then select the appropriate language instead of C/C++</div>
Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-2528866089815406447.post-70657294273076565212012-09-13T19:00:00.002-07:002013-06-06T18:23:39.902-07:00How to solve openscmanager failed error 5<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyJ5whjILm2IHQPYUcHYPMKOa5NSFovZzxoBdxaEdq9FYIDa0T1xUhRp4-c_NuOYoYD5LgIKT2j9bK9UZ2uMzR4onUzv6Fjbvq8J0EcYfBHsNaiiUsL8OUFwsH4J5pMYCJAGRoFpj5J3Vh/s1600/4.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyJ5whjILm2IHQPYUcHYPMKOa5NSFovZzxoBdxaEdq9FYIDa0T1xUhRp4-c_NuOYoYD5LgIKT2j9bK9UZ2uMzR4onUzv6Fjbvq8J0EcYfBHsNaiiUsL8OUFwsH4J5pMYCJAGRoFpj5J3Vh/s1600/4.jpg" /></a>
<br />
<h3>
Situation</h3>
Some times when you working with command prompt, script running, or program installing with winnows environment it may fire fallowing one of error.<br />
<h3 style="margin-top: 120px;">
Error</h3>
<ol>
<li><span style="font-family: 'Courier New', Courier, monospace;"><span style="color: red;">openscmanager failed <error 5></span></span></li>
<li><span style="background-color: #fafafa; font-family: 'Courier New', Courier, monospace;"><span style="color: red;">OpenSCManager failed - Access is denied. (0x5)</span></span></li>
<li><span style="background-color: white; font-family: 'Courier New', Courier, monospace;"><span style="color: red;">[SC] OpenSCManager FAILED 5:</span></span></li>
<li><span style="background-color: white; font-family: 'Courier New', Courier, monospace;"><span style="color: red;">"OpenSCManager()" failed with error code "5"</span></span></li>
</ol>
<h3>
Solution</h3>
<ol>
<li>Program (script. command prompt, software) right click and run as administrator.</li>
<li>If not success, Log-off and login as the administrator and try again</li>
</ol>
Unknownnoreply@blogger.com32tag:blogger.com,1999:blog-2528866089815406447.post-56736253147910436412012-07-05T19:34:00.004-07:002013-06-06T18:23:42.004-07:00How to 'Run As' multiple programs using a script in windowsAs a system engineer or as a developer sometimes you may need to run multiple programs at once as a sequence or, one by one after some intervals. Following is a VB script created for specific purpose.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFq_6YTPoygk8S1-6N-qtvcr1-3oJMp9kuIr7FCOmqtD-nJjuxUDG8G0B1bgtoRmIRyW714QiXOg9ekTQN8BkG_2-q500pUQLoKWM65aGjn6jMeGti89z5WaoL5fK5VMHbcYWT4rjWIA8S/s1600/egfox_windows_7_desktop_2012___omnimo_ui_by_eg_art-d5jpnhk.jpg" imageanchor="1" style="clear: left; float: left; margin: 20px 40px 20px 0px;">
<img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFq_6YTPoygk8S1-6N-qtvcr1-3oJMp9kuIr7FCOmqtD-nJjuxUDG8G0B1bgtoRmIRyW714QiXOg9ekTQN8BkG_2-q500pUQLoKWM65aGjn6jMeGti89z5WaoL5fK5VMHbcYWT4rjWIA8S/s1600/egfox_windows_7_desktop_2012___omnimo_ui_by_eg_art-d5jpnhk.jpg" />
</a>
<br />
<ul>
<li><b>weAdmin\imAdmin -</b> Specific use for "Run As"</li>
<li><b>C:\Test\Test1\Test1.exe -</b> Path and file name</li>
<li><b>admin1234 -</b> Password for the specific user.</li>
<li><b>100 -</b> Some waiting time to initialize 'run as'</li>
<li><b>1000 -</b> waiting time until next program run. (Configure this as you want)</li>
</ul>
<pre class="prettyprint" style="clear: both;">Option explicit
Dim oShell
set oShell= Wscript.CreateObject("WScript.Shell")
oShell.Run "RunAs /noprofile /user:weAdmin\imAdmin ""C:\Test\Test1\Test1.exe"""
WScript.Sleep 100
oShell.Sendkeys "admin1234"
oShell.SendKeys "{ENTER}"
WScript.Sleep 1000
oShell.Run "RunAs /noprofile /user:weAdmin\imAdmin ""C:\Test\Test2\Test2.exe"""
WScript.Sleep 100
oShell.Sendkeys "admin1234"
oShell.SendKeys "{ENTER}"
WScript.Sleep 1000
oShell.Run "RunAs /noprofile /user:weAdmin\imAdmin ""C:\Test\Test3\Test3.exe"""
WScript.Sleep 100
oShell.Sendkeys "admin1234"
oShell.SendKeys "{ENTER}"
WScript.Sleep 1000
oShell.Run "RunAs /noprofile /user:weAdmin\imAdmin ""C:\Test\Test4\Test4.exe"""
WScript.Sleep 100
oShell.Sendkeys "admin1234"
oShell.SendKeys "{ENTER}"
WScript.Sleep 1000
Wscript.Quit
</pre>
Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-2528866089815406447.post-44534518764434668822012-07-05T18:15:00.000-07:002013-06-06T18:23:44.221-07:00How to correct side-by-side configuration error try to run c++ application"The application has failed to start because the side by side configuration is incorrect please see the application event log or use the command line sxstrace.exe tool for more detail"<br />
<br />
After finished the developmental of the application you may move the binaries to the separate windows 2008 serve and try to run. So at the time you may face to a error message box that show the above error message or some error near to that. If that now be ready to correct it.<br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLUtRCCvgVJBaU1LS9enxbk2vp9lFvBD_TPRsUwRNK3fxtq57ryZgr8kBAoKh6hbSwvzjYAYb180IvoV5abkyX7_bS5NpOK-PXd_PA01p78hyphenhyphenxlC3z8sb4Fy7e5gPdzHMtRZ7F0ZRpocD-/s1600/error.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="184" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLUtRCCvgVJBaU1LS9enxbk2vp9lFvBD_TPRsUwRNK3fxtq57ryZgr8kBAoKh6hbSwvzjYAYb180IvoV5abkyX7_bS5NpOK-PXd_PA01p78hyphenhyphenxlC3z8sb4Fy7e5gPdzHMtRZ7F0ZRpocD-/s640/error.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Error Message</td></tr>
</tbody></table>
<br />
<b>SETP : 01</b><br />
<b><br /></b>
1. Click on the Start button<br />
2. Go to control panel<br />
3. Change "View by"(located at right side top op the control panel) to "Large icons"<br />
4. Click on Program and Features.<br />
<br />
<br />
<br />
<b>STEP 02:</b><br />
<b><br /></b>
<b>01.</b> On the "Program and Features" window click on the "Turn windows features on or off"<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuQuMXB6IiVs13FTIxp7Bao8_d4eq_QFVHVp9s-u7SYA8by9tdA7Icgn1fN2i0P8dek-j1QLNpmOOQl_NYE6KrT5KtAJ19K5VnI8Zx7KfPTkaOgK8vxm_V-rTG5ncL2jwtnTK6NKMiBV2N/s1600/1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="361" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuQuMXB6IiVs13FTIxp7Bao8_d4eq_QFVHVp9s-u7SYA8by9tdA7Icgn1fN2i0P8dek-j1QLNpmOOQl_NYE6KrT5KtAJ19K5VnI8Zx7KfPTkaOgK8vxm_V-rTG5ncL2jwtnTK6NKMiBV2N/s640/1.jpg" width="640" /></a></div>
<br />
<br />
<b>02. </b>Then click on the "Features"<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyc8alT35hQbpZ37Mfp_NrbYwSSYI1qazYVBNjFKPZGt2jRCeZLzj9b1ZEyNIyyHlQow9hyphenhyphenx1UEAOytnZNbqOU6Tjv9hyphenhyphen3UbFOtXHUYnCeo_7PBVqKQLx5Zl3Dyb9Ds7CE7cF1hssaJAT_/s1600/2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="470" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyc8alT35hQbpZ37Mfp_NrbYwSSYI1qazYVBNjFKPZGt2jRCeZLzj9b1ZEyNIyyHlQow9hyphenhyphenx1UEAOytnZNbqOU6Tjv9hyphenhyphen3UbFOtXHUYnCeo_7PBVqKQLx5Zl3Dyb9Ds7CE7cF1hssaJAT_/s640/2.jpg" width="640" /></a></div>
<br />
<b>03.</b> Check weather ".NET Frameworks 3.5.1 Features" checked or not if not check it<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFiNcOZwD4STtk475QXXMxEtu2p9SBBIaT5d4v-xXZGR8MS9B9pEMhI44cq5_MPkdwBmoxLDlUKiUpKxDvZ50BfgvWOXM2ksOvhybIhWtUT-iqQddnrpEXAZTfXQg8ro7_XTYWaIfnJorg/s1600/3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="470" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFiNcOZwD4STtk475QXXMxEtu2p9SBBIaT5d4v-xXZGR8MS9B9pEMhI44cq5_MPkdwBmoxLDlUKiUpKxDvZ50BfgvWOXM2ksOvhybIhWtUT-iqQddnrpEXAZTfXQg8ro7_XTYWaIfnJorg/s640/3.jpg" width="640" /></a></div>
<br />
<br />
<b>04. </b> Click "Next" and click on the "Add required Role Services"<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiucXfPKLJw3pz_g40avFL7B8SvxHYKcJFkS1ouk92LSF7sNFNq7VjSHMZUYcBkh6eFl_HSO1-IXw1K__uUb1GFeAJ85B86zU5ID5dUZa-EQ3d81vaVlqLyuc9eaCEkwJrpYtXV9jaaB3qh/s1600/4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="348" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiucXfPKLJw3pz_g40avFL7B8SvxHYKcJFkS1ouk92LSF7sNFNq7VjSHMZUYcBkh6eFl_HSO1-IXw1K__uUb1GFeAJ85B86zU5ID5dUZa-EQ3d81vaVlqLyuc9eaCEkwJrpYtXV9jaaB3qh/s640/4.jpg" width="640" /></a></div>
<br />
<b>05.</b> Click Install<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7iDJ_R0eeJMcwAfDxnCcqVCjU334A12cPFUuDTbJAtFh31iaLyC_6UfsZtjv12fEiQC6UjPwC4_UIQr33wwocSj1BKHMIfA_dUZZotPQ32e1bJZqvFMsxyc1o3WwADzuIL0QNGrPiVbAa/s1600/5.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="470" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7iDJ_R0eeJMcwAfDxnCcqVCjU334A12cPFUuDTbJAtFh31iaLyC_6UfsZtjv12fEiQC6UjPwC4_UIQr33wwocSj1BKHMIfA_dUZZotPQ32e1bJZqvFMsxyc1o3WwADzuIL0QNGrPiVbAa/s640/5.jpg" width="640" /></a></div>
<br />
<br />
<b>06.</b> Click next and next and next and wait wait until installation finished<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbacJigobzIwIQR0v8hxl8NVn73qAb5NZ49wR24VQKvmSNc-VHEzvXCC2zWl5MLTjqjj5fqqMiZ0wLPWT_NUpeqizPxeC8QhVTp4_LG6tcml3fAk7H30l6mDnMVzXVi5m75LDwEytMzBfM/s1600/6.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="470" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbacJigobzIwIQR0v8hxl8NVn73qAb5NZ49wR24VQKvmSNc-VHEzvXCC2zWl5MLTjqjj5fqqMiZ0wLPWT_NUpeqizPxeC8QhVTp4_LG6tcml3fAk7H30l6mDnMVzXVi5m75LDwEytMzBfM/s640/6.jpg" width="640" /></a></div>
<br />
<br />
<b>07. </b>Click next and close<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9yjVo6yDybTwOOA71i3gZ2G0_gdQXMYZGQo4SHWZNfvptVXYmJ8R-fg8NEiNWDrsoKKXwhc_OuL5udtSNSZ3CboMBd0H5K3lxCJNHYuxShw0Ney4Z-HPKPgboqjlGbIcR37kReh5JQ4Rv/s1600/7.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="470" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9yjVo6yDybTwOOA71i3gZ2G0_gdQXMYZGQo4SHWZNfvptVXYmJ8R-fg8NEiNWDrsoKKXwhc_OuL5udtSNSZ3CboMBd0H5K3lxCJNHYuxShw0Ney4Z-HPKPgboqjlGbIcR37kReh5JQ4Rv/s640/7.jpg" width="640" /></a></div>
<br />
<br />
<b>08. </b>Then close everything<br />
<b>09.</b> Right click the "My Computer" > Go the "Manage" > Go to "Event Viewer".<br />
<b>10. </b>Then go to "Windows Logs" > Go to "Applications"<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXJsjyAVArc3W0yCtG-frfoK9pXr4jMesKV_NE2eHiiezJIhDRiV1EH-MUrEH0NW21KsSBQS00MCtdJzp7L7Zd5Ls_nxfSjJEwQLlrzpEG6-BBHIGQyA8BinjHDYkkzKfSE6bTUmxX3EXw/s1600/8.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="374" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXJsjyAVArc3W0yCtG-frfoK9pXr4jMesKV_NE2eHiiezJIhDRiV1EH-MUrEH0NW21KsSBQS00MCtdJzp7L7Zd5Ls_nxfSjJEwQLlrzpEG6-BBHIGQyA8BinjHDYkkzKfSE6bTUmxX3EXw/s640/8.jpg" width="640" /></a></div>
<br />
So you will see this side of side to side errors. If not please try to run your application or program again and then check.<br />
<br />
<br />
<b>11. </b>Right click on the error and go to "Event Properties"<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCnMYL5hMUhDS2F5dW9Rw5rGGE92eAcw5zSFhndvOXhZxNSOx0_q_kWVvTEPT50pwUYS-5CmRn-woUe-aeBPmMbSg6cLCEWz_lpoYmnPrFI2MGbRec9dBDzUFQPm_glSa9W13yqojVdYjN/s1600/9.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="444" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCnMYL5hMUhDS2F5dW9Rw5rGGE92eAcw5zSFhndvOXhZxNSOx0_q_kWVvTEPT50pwUYS-5CmRn-woUe-aeBPmMbSg6cLCEWz_lpoYmnPrFI2MGbRec9dBDzUFQPm_glSa9W13yqojVdYjN/s640/9.jpg" width="640" /></a></div>
<br />
<br />
<b>12.</b> You read the error message and check the "Processor architecture". In this case it is "X86" means 32 bit.<br />
<br />
<b>13. </b>The Check the VC++ version you use to code the application. it may be VS 2005, 2008 or 2010.<br />
<br />
<b>14. </b>So then combine your server computer architecture and developed computer VC++ version and download the C++ re-distributable package. Then install it in the server.<br />
<br />
As examples<br />
<br />
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableLightGridAccent1" style="border-collapse: collapse; border: none; mso-border-alt: solid #4F81BD 1.0pt; mso-border-themecolor: accent1; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr>
<td style="border-bottom: solid #4F81BD 2.25pt; border: solid #4F81BD 1.0pt; mso-border-bottom-themecolor: accent1; mso-border-themecolor: accent1; padding: 0in 5.4pt 0in 5.4pt; width: 1.7in;" valign="top" width="163"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="font-family: Cambria, serif;">Processor
Architecture<o:p></o:p></span></b></div>
</td>
<td style="border-bottom: solid #4F81BD 2.25pt; border-left: none; border-right: solid #4F81BD 1.0pt; border-top: solid #4F81BD 1.0pt; mso-border-bottom-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-top-themecolor: accent1; padding: 0in 5.4pt 0in 5.4pt; width: 76.5pt;" valign="top" width="102"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="font-family: Cambria, serif;">VC++
version<o:p></o:p></span></b></div>
</td>
<td style="border-bottom: solid #4F81BD 2.25pt; border-left: none; border-right: solid #4F81BD 1.0pt; border-top: solid #4F81BD 1.0pt; mso-border-bottom-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-top-themecolor: accent1; padding: 0in 5.4pt 0in 5.4pt; width: 279.9pt;" valign="top" width="373"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="font-family: Cambria, serif;">C++
Redistributable Pacakge<o:p></o:p></span></b></div>
</td>
</tr>
<tr>
<td style="background: #D3DFEE; border-top: none; border: solid #4F81BD 1.0pt; mso-background-themecolor: accent1; mso-background-themetint: 63; mso-border-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-border-top-themecolor: accent1; padding: 0in 5.4pt 0in 5.4pt; width: 1.7in;" valign="top" width="163"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: 10pt;">X86<o:p></o:p></span></div>
</td>
<td style="background: #D3DFEE; border-bottom: solid #4F81BD 1.0pt; border-left: none; border-right: solid #4F81BD 1.0pt; border-top: none; mso-background-themecolor: accent1; mso-background-themetint: 63; mso-border-bottom-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-border-top-themecolor: accent1; padding: 0in 5.4pt 0in 5.4pt; width: 76.5pt;" valign="top" width="102"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: 10pt;">VC++ 2005<o:p></o:p></span></div>
</td>
<td style="background: #D3DFEE; border-bottom: solid #4F81BD 1.0pt; border-left: none; border-right: solid #4F81BD 1.0pt; border-top: none; mso-background-themecolor: accent1; mso-background-themetint: 63; mso-border-bottom-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-border-top-themecolor: accent1; padding: 0in 5.4pt 0in 5.4pt; width: 279.9pt;" valign="top" width="373"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: 10pt;">Microsoft Visual C++ 2005 SP1
Redistributable Package (x86) <o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid #4F81BD 1.0pt; mso-border-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-border-top-themecolor: accent1; padding: 0in 5.4pt 0in 5.4pt; width: 1.7in;" valign="top" width="163"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: 10pt;">X86<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid #4F81BD 1.0pt; border-left: none; border-right: solid #4F81BD 1.0pt; border-top: none; mso-border-bottom-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-border-top-themecolor: accent1; padding: 0in 5.4pt 0in 5.4pt; width: 76.5pt;" valign="top" width="102"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: 10pt;">VC++ 2008<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid #4F81BD 1.0pt; border-left: none; border-right: solid #4F81BD 1.0pt; border-top: none; mso-border-bottom-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-border-top-themecolor: accent1; padding: 0in 5.4pt 0in 5.4pt; width: 279.9pt;" valign="top" width="373"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: 10pt;">Microsoft Visual C++ 2008 SP1
Redistributable Package (x86) <o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="background: #D3DFEE; border-top: none; border: solid #4F81BD 1.0pt; mso-background-themecolor: accent1; mso-background-themetint: 63; mso-border-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-border-top-themecolor: accent1; padding: 0in 5.4pt 0in 5.4pt; width: 1.7in;" valign="top" width="163"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: 10pt;">X64<o:p></o:p></span></div>
</td>
<td style="background: #D3DFEE; border-bottom: solid #4F81BD 1.0pt; border-left: none; border-right: solid #4F81BD 1.0pt; border-top: none; mso-background-themecolor: accent1; mso-background-themetint: 63; mso-border-bottom-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-border-top-themecolor: accent1; padding: 0in 5.4pt 0in 5.4pt; width: 76.5pt;" valign="top" width="102"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: 10pt;">VC++ 2010<o:p></o:p></span></div>
</td>
<td style="background: #D3DFEE; border-bottom: solid #4F81BD 1.0pt; border-left: none; border-right: solid #4F81BD 1.0pt; border-top: none; mso-background-themecolor: accent1; mso-background-themetint: 63; mso-border-bottom-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-border-top-themecolor: accent1; padding: 0in 5.4pt 0in 5.4pt; width: 279.9pt;" valign="top" width="373"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: 10pt;">Microsoft Visual C++ 2010 Redistributable Package (x64) <o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid #4F81BD 1.0pt; mso-border-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-border-top-themecolor: accent1; padding: 0in 5.4pt 0in 5.4pt; width: 1.7in;" valign="top" width="163"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: 10pt;">X64<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid #4F81BD 1.0pt; border-left: none; border-right: solid #4F81BD 1.0pt; border-top: none; mso-border-bottom-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-border-top-themecolor: accent1; padding: 0in 5.4pt 0in 5.4pt; width: 76.5pt;" valign="top" width="102"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: 10pt;">VC++ 2005<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid #4F81BD 1.0pt; border-left: none; border-right: solid #4F81BD 1.0pt; border-top: none; mso-border-bottom-themecolor: accent1; mso-border-left-alt: solid #4F81BD 1.0pt; mso-border-left-themecolor: accent1; mso-border-right-themecolor: accent1; mso-border-top-alt: solid #4F81BD 1.0pt; mso-border-top-themecolor: accent1; padding: 0in 5.4pt 0in 5.4pt; width: 279.9pt;" valign="top" width="373"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: 10pt;">Microsoft Visual C++ 2008 SP1
Redistributable Package (x64) <o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<br />
<b>15. </b>Restart the server and run your program again<br />
<br />
<b>16.</b> If not success you have to Diagnosing SideBySide failures using sxstrace.exe. For more details about this<br />
go to this link.<br />
<a href="http://blogs.msdn.com/b/junfeng/archive/2006/04/14/576314.aspx">http://blogs.msdn.com/b/junfeng/archive/2006/04/14/576314.aspx</a><br />
<br />
<br />
<br />
<br />
<br />
<br />Unknownnoreply@blogger.com94tag:blogger.com,1999:blog-2528866089815406447.post-13690033722424538232012-06-15T02:41:00.000-07:002013-06-06T18:23:45.469-07:00How to read PDF file in black background and green or white textMost of the windows users use Adobe reader to read PDF files. But if you read a PDF file long time. your eyes may blur and pain because of the white colour background and the because of the high contrast and brightness. To get rid of this you can use Adobe Reader colour replace facilities to change the colour of the PDF File.<br />
<br />
<b><span style="font-size: large;">How: </span></b><br />
<b><span style="font-size: large;"><br /></span></b>
<b><span style="font-size: large;">1. Go to Edit </span></b><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQFfvD-vC2bQeh7VMvXpAw1fbkmLXxlXJAcQBLJxnJgPc1HuuusYpkv46aaJSI7yS62ah299GVfNRZJvs_vmfNsKCbXjTjbZ_qQnhGhlvYZ-2AKq9zBiPpEx1MRRJLQQHxJlHZckhIneRo/s1600/edit.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQFfvD-vC2bQeh7VMvXpAw1fbkmLXxlXJAcQBLJxnJgPc1HuuusYpkv46aaJSI7yS62ah299GVfNRZJvs_vmfNsKCbXjTjbZ_qQnhGhlvYZ-2AKq9zBiPpEx1MRRJLQQHxJlHZckhIneRo/s1600/edit.jpg" /></a></div>
<b><span style="font-size: large;"><br /></span></b>
<b><span style="font-size: large;">2. Go to Preferences.., Then Accessibility </span></b><br />
<b><span style="font-size: large;"><br /></span></b>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKC0VIB6rq1acHGDf9mEjNN9l-yMkVdzvIqu5vb795OASd9fnwSUupZ3YDOsdRrCGTdz29OmSW5RCskq4A5Up83sIpYQj06OhLqVpZv0obOdOo51NKvDPOqFoZoavf4vjkgvcc3uqR3MZv/s1600/acc.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="529" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKC0VIB6rq1acHGDf9mEjNN9l-yMkVdzvIqu5vb795OASd9fnwSUupZ3YDOsdRrCGTdz29OmSW5RCskq4A5Up83sIpYQj06OhLqVpZv0obOdOo51NKvDPOqFoZoavf4vjkgvcc3uqR3MZv/s640/acc.jpg" width="640" /></a></div>
<b><span style="font-size: large;"><br /></span></b>
<b><span style="font-size: large;">3. Change the Page Background and Document Text Colors</span></b><br />
<b><span style="font-size: large;"><br /></span></b>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiro_Hdq36t_qt6BWCssQFf4KMKEjNwmU-uX3am-8KLxzVtPR9hAP806rM-AOj58uF7aUNOOH7ubIFD_2VxyPx27MUh9C6Z7e8XLCWMp-F0KdoHnDmgwITq2AtK_XX4gyVHxZm1x8kckAQP/s1600/cng.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiro_Hdq36t_qt6BWCssQFf4KMKEjNwmU-uX3am-8KLxzVtPR9hAP806rM-AOj58uF7aUNOOH7ubIFD_2VxyPx27MUh9C6Z7e8XLCWMp-F0KdoHnDmgwITq2AtK_XX4gyVHxZm1x8kckAQP/s1600/cng.jpg" /></a></div>
<b><span style="font-size: large;"><br /></span></b>
<b><span style="font-size: large;">4. Press OK, close PDF and open again. Then It looks like this.</span></b><br />
<b><span style="font-size: large;"><br /></span></b>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzTyq0gtBI_vWeGlJ300GGtq0j9D-8Vh8IH9yt_UOb8QKxy5ofFaVvnAGN_Nmv4qXbiiGNyym7T1J0dW9Ds3zoRxtNH3iW6ijAabNBpRNVr8wZHy7X-74-D27cwTCL82ewf5bFBOUbb3hK/s1600/final.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="384" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzTyq0gtBI_vWeGlJ300GGtq0j9D-8Vh8IH9yt_UOb8QKxy5ofFaVvnAGN_Nmv4qXbiiGNyym7T1J0dW9Ds3zoRxtNH3iW6ijAabNBpRNVr8wZHy7X-74-D27cwTCL82ewf5bFBOUbb3hK/s640/final.jpg" width="640" /></a></div>
<b><span style="font-size: large;"><br /></span></b>
<b><span style="font-size: large;"><br /></span></b>
<span style="font-size: large;"><b>5. This may help to keep your eye cool when you are reading :)</b></span><br />
<b><span style="font-size: large;"><br /></span></b>Unknownnoreply@blogger.com11tag:blogger.com,1999:blog-2528866089815406447.post-76870292545088292682012-06-14T19:52:00.002-07:002013-06-06T18:23:46.904-07:00Market Orders (MKT)Market Orders are the most basic order type of the share trading. If you need to buy or sell typical shares at the market, what you should do is submit a Market Order.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmgvStxC9pAN189THpqe1PfXOq4iOz4pQeM9B_jsWt9Vwi2QFHaQk2fxZ_VJO-Zm5Nh1Kkj7vKnZhiR6iN9j23_pGhOvuu0jxioZz35M0qXAlrWDSxO-mD4P5J_ukds0GTo0OeSH5PTiYA/s1600/market_orders.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmgvStxC9pAN189THpqe1PfXOq4iOz4pQeM9B_jsWt9Vwi2QFHaQk2fxZ_VJO-Zm5Nh1Kkj7vKnZhiR6iN9j23_pGhOvuu0jxioZz35M0qXAlrWDSxO-mD4P5J_ukds0GTo0OeSH5PTiYA/s1600/market_orders.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Market Order Flow</td></tr>
</tbody></table>
<br />
<br />
<span style="font-size: large;"><b> How:</b></span><br />
But if you expected to execute your order, Need to consider the current market price before you submit the market order. If your order successfully executed, then it call as "Order Filled". If your is related to buy some shares, after order filled these shares updated to your account and relevant amount of money reduce from your trading account. If your order is related to sell some shares, then after order filled reduce this number of shares from your account and update your account with relevant amount of money you received by specific trading.<br />
<br />
<b><span style="font-size: large;">Validity:</span></b><br />
Most of the time submitted market orders valid within the whole day. After market closed for the specific day, all the so far not executed orders will be cancel and and notice to the order submitted users. If you think share may goes up for some particulate counter, you can submit sell orders with higher price that existing price of the market. If price goes up and reach to your submitted price, then there mat be possibility to fill your order. If you willing to buy shares and also you think market price goes down for some specific counter then you can submit buy order with less price then current existing price. If market reached your conditions, then your order may fill.<br />
<br />
<span style="font-size: large;"><b>Partially Filled:</b></span><br />
Some time market orders may reached to the price expectation but the numbers of shares not enough to full-fill the order. In this kind of situations, order execute for the existing number of shares and it call "Partially filled"<br />
<br />
As example:<br />
<br />
Kevin submit sell order with 2000 shares for $225 price for counter AAA<br />
Jhon submit buy order with 900 shares for $225 price for counter AAA<br />
<br />
So here buy order and sell orders are matching by price and quantities are not same. then order executed for 900 shares.<br />
Then<br />
Kevin get notice "Order Partially filled for 900 shares at $225"<br />
Jhon get notice "Order filled for $225"<br />
<br />
<span style="font-size: large;"><b>Risk Management:</b></span><br />
If you use brokerage to submit order to the share market, then they are doing some risk check before submit your orders the the market. This checks can be vary for country by county, market by market or brokerage by brokerage. fallowing are the some factors they are checking.<br />
<br />
1. Trader having enough money to buy the shares.<br />
2. Order quantity is less than to min quantity or higher than the max quantity that can trade for specific counter.<br />
3. Is this order accept the government regulations.<br />
4. Is this market trading hours.<br />
<br />Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-2528866089815406447.post-20533629012961708292012-06-14T01:23:00.001-07:002012-06-14T01:25:55.792-07:00How to kill process running in a remote computer using command promptWindows servers maintaining is not a simple task and most of the time need to log in to servers and kill some running process and some time need to start the processes or applications. So this is a method to kill a process running on a remote computer using dos command in windows environment. You can use this method to kill a process in you local PC too. You can directly run this command in command prompt or also can run as saved bat file.<br />
<br />
<br />
<pre class="vb" name="code">TASKKILL /S system /U username /P password /FI filter /PID processid or /IM imagename /F /T
</pre>
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFeYUog-INrgNY2pdxhtbNxkkCzWTxreHT5jS8OqPuNgFKmwFTjJUwKcUaDE-FiiNU6De2RoKcqPjuK_R0_KEl1FAbxreanGb_s76rg_7PL3D228M-M2ZchGxxx7rfkrcwXc5WzAMGq2RV/s1600/remote_process_close.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFeYUog-INrgNY2pdxhtbNxkkCzWTxreHT5jS8OqPuNgFKmwFTjJUwKcUaDE-FiiNU6De2RoKcqPjuK_R0_KEl1FAbxreanGb_s76rg_7PL3D228M-M2ZchGxxx7rfkrcwXc5WzAMGq2RV/s1600/remote_process_close.jpg" /></a></div>
<br />
<br />
Parameter List:<br />
-----------------------------------------------------------------------------------------------------------<br />
/S system Specifies the remote system to connect to.<br />
<br />
/U [domain\]user Specifies the user context under which<br />
the command should execute.<br />
<br />
/P [password] Specifies the password for the given<br />
user context. Prompts for input if omitted.<br />
<br />
/F Specifies to forcefully terminate<br />
process(es).<br />
<br />
/FI filter Displays a set of tasks that match a<br />
given criteria specified by the filter.<br />
<br />
/PID process id Specifies the PID of the process that<br />
has to be terminated.<br />
<br />
/IM image name Specifies the image name of the process<br />
that has to be terminated. Wildcard '*'<br />
can be used to specify all image names.<br />
<br />
/T Tree kill: terminates the specified process<br />
and any child processes which were started by it.<br />
<br />
/? Displays this help/usage.<br />
<br />
<br />
<br />
Filters:<br />
-----------------------------------------------------------------------------------------------------------<br />
STATUS eq, ne RUNNING | NOT RESPONDING<br />
IMAGENAME eq, ne Image name<br />
PID eq, ne, gt, lt, ge, le PID value<br />
SESSION eq, ne, gt, lt, ge, le Session number.<br />
CPUTIME eq, ne, gt, lt, ge, le CPU time in the format<br />
of hh:mm:ss.<br />
hh - hours,<br />
mm - minutes, ss - seconds<br />
MEMUSAGE eq, ne, gt, lt, ge, le Memory usage in KB<br />
USERNAME eq, ne User name in [domain\]user<br />
format<br />
MODULES eq, ne DLL name<br />
SERVICES eq, ne Service name<br />
WINDOWTITLE eq, ne Window title<br />
<br />
NOTE: Wildcard '*' for the /IM switch is accepted only with filters.<br />
<br />
NOTE: Termination of remote processes will always be done forcefully<br />
irrespective of whether /F option is specified or not.<br />
<br />
Examples:<br />
-----------------------------------------------------------------------------------------------------------<br />
TASKKILL /S system /F /IM notepad.exe /T<br />
TASKKILL /PID 1230 /PID 1241 /PID 1253 /T<br />
TASKKILL /F /IM notepad.exe /IM mspaint.exe<br />
TASKKILL /F /FI "PID ge 1000" /FI "WINDOWTITLE ne untitle*"<br />
TASKKILL /F /FI "USERNAME eq NT AUTHORITY\SYSTEM" /IM notepad.exe<br />
TASKKILL /S system /U domain\username /FI "USERNAME ne NT*" /IM *<br />
TASKKILL /S system /U username /P password /FI "IMAGENAME eq note*"<br />
<br />
<br />
<br />Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-2528866089815406447.post-65886050572010328762012-06-12T21:24:00.000-07:002013-03-27T19:50:27.042-07:00Rounding floating point numbersIf you are an experienced programmer definitely you faced to issues with floating point rounding. Actually this is due to the values keeping format of the floating point data types. In simply float and double like data types storing the numbers in memory as powers. So the value return back may not be the exact value you stored at the variable.<br />
<br />
As example if you store 444.25 555.25 and in float variable it the return back value may be<br />
<br />
444.24999999999999 or 555.25000000000001<br />
<br />
This happens because of the value storing format of the memory you can look in more information about value keeping structure <a href="http://en.wikipedia.org/wiki/Floating_point"><b><span style="font-size: large;">here</span></b></a>.<br />
<br />
The Problem comes when you try to round the value you store in the float variable<br />
As our example<br />
If value store as 444.24999999999999 then round value will be 444.2 for one decimal point<br />
If value store as 555.2500000000001 then round value will be the 555.3 for one decimal point.<br />
<br />
So same kind of values get different kind of result when you round. If you like you can read more about this <a href="http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html"><b><span style="font-size: large;">here</span></b></a><br />
<br />
Ok, what we can do to avoid this rounding issue when you do programming with C++. fallowing is my proposed method to avoid the issue. Don't use the standers rounding functions and use a own rounding function<br />
<br />
<pre class="prettyprint">#include <iostream>
#include <math.h>
using namespace std;
double flaotRound( double dblNumber,int intNoOfDecPoint ){
double dblTemp = pow(10.0,intNoOfDecPoint);
return int(dblNumber*dblTemp + (dblNumber<0? -0.5 : 0.5))/dblTemp;
}
void main(){
//char array for input (to pause programe)
char chrTempInput[100];
double dblValue;
for(int i = 0; i <1000 ; i++){
dblValue = (double)rand()/rand();
cout << dblValue << " - " << flaotRound(dblValue,2) << endl;
}
cin >> chrTempInput;
}
</pre>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2528866089815406447.post-85335728215804235312012-06-04T20:56:00.002-07:002013-03-27T19:51:14.012-07:00How to send a email using VB Script.Some times requirements occurs to send email from Windows environment. it may be due to server monitoring or application monitoring purpose or may be some other need. Lot of third-party applications in the internet and you can try those your own. But most light weight and slandered way to send email from windows environment is the VB script. Using VB Script is very easy and simple. following is the way to send a email using VB Script. this can be help to your script development and system monitoring purpose.<br />
<br />
<br />
<pre class="prettyprint">Dim objMail
Set objMail = CreateObject("CDO.Message")
'sender email address
objMail.From = "Sender <sender@abcmail.com>"
'Receiver email address
objMail.To = "Receiver <receiver@abcmail.com>"
'Email subject
objMail.Subject = "This is the testing email subject"
'Email Body
objMail.Textbody = "This is the my first email send by vb script"
'If you need to attache a file,can do in this way.
objMail.AddAttachment "C:\myphoto.jpg"
'Configure SMTP server
objMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Here you should configure name or IP of the SMTP server
objMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
"192.168.1.23"
' SMTP port need to configure here (Default 25)
objMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
'update the field in message object
objMail.Configuration.Fields.Update
'sending email
objMail.Send
'clear mail object
Set objMail=Nothing
'exit the script
Wscript.Quit</pre>Unknownnoreply@blogger.com