tag:blogger.com,1999:blog-35544469779920917962024-03-12T18:12:30.129-07:00Ck a techie...I like programming!Anonymoushttp://www.blogger.com/profile/03241484392555987029noreply@blogger.comBlogger62125tag:blogger.com,1999:blog-3554446977992091796.post-90752576433194991882017-06-26T13:25:00.001-07:002017-06-26T13:25:46.394-07:00Repair SQL Server with status (Recovery Pending)<b>you can repair the issue using this script (this script is not mine)<br /><br /><br />Use [master]<br /><br />EXEC sp_resetstatus <span style="color: yellow;">RecoveryPendingModeDB</span><br /><br />ALTER DATABASE <span style="color: yellow;">RecoveryPendingModeDB </span>SET EMERGENCY DBCC checkdb('<span style="color: yellow;">RecoveryPendingModeDB</span>')<br /><br />ALTER DATABASE <span style="color: yellow;">RecoveryPendingModeDB </span>SET SINGLE_USER WITH ROLLBACK IMMEDIATE<br /><br />DBCC CheckDB('<span style="color: yellow;">RecoveryPendingModeDB</span>',REPAIR_ALLOW_DATA_LOSS)<br /><br />ALTER DATABASE <span style="color: yellow;">RecoveryPendingModeDB</span> SET MULTI_USER<br /><br />EXEC sp_resetstatus <span style="color: yellow;">'RecoveryPendingModeDB</span>'<br /><br /><br /><br /><br />Replace <span style="color: yellow;">RecoveryPendingModeDB</span> with your actual database name with status 'Recovery Pending'. <br /><br /><br /><br />You can read in detail here: <span style="color: #6aa84f;">https://www.zubairalexander.com/blog/how-to-fix-sql-server-databases-in-suspect-or-recovery-pending-mode/ </span> </b>Anonymoushttp://www.blogger.com/profile/03241484392555987029noreply@blogger.com2tag:blogger.com,1999:blog-3554446977992091796.post-19712377969837387212017-05-22T08:29:00.000-07:002017-05-22T11:28:36.864-07:00Words of the day<b>Permeate</b> /pərmēˌāt/ (v)<br />
= spread through out something.<br />
= pervade.<br />
<br />
Ex:<br />
- Women have yet to <b>permeate</b> the world's top military roles.<br />
- The virtual world appears to be a part of our society that is here to stay, and will more than likely continue to increase. It will <b>permeate</b> more of our children’s lives as they grow up, much more than ours. Remember that it is okay to monitor what your child does on the computer or smart phone.<br />
<br />
<b>Unleash</b> /ˌənˈlēSH/ (v)<br />
= release, free<br />
<br />
Ex:<br />
- The Air Force Still Hasn't Unleashed the Full Potential of the F-35 (Yet)<br />
- R1bn (R1 billion) fine for unleashed dogs ‘not amusing’<br />
While a municipal sign threatening to issue people with a R1-billion fine if they walk their animals without a leash on Sardinia Bay beach has raised a few laughs, the Nelson Mandela Bay municipality was not amused by the gaffe.<br />
(Note: R1 is South Africa Rand currency)<br />
<br />
<b>Condense</b> /kənˈdens/ (v)<br />
= make something denser or more concentrated.<br />
= change or cause to change from a gas or vapor to a liquid.<br />
<br />
<b>Render </b>/ˈrendər/ (v)<br />
= provide, give (a service, a help, etc.)<br />
= submit, present, hand over, deliver for inspection or consideration<br />
= make<br />
= represent artistically<br />
= translate<br />
= perform<br />
<br />
Ex;<br />
- Money serves as a reward for a service rendered.<br />
- He will render his tax return at the end of the year.<br />
- The rain rendered his escape impossible.<br />
- The eyes and cheeks are exceptionally rendered.<br />
- The phrase was rendered into English.<br />
- The character are vividly rendered.<br />
<br />
<br />Anonymoushttp://www.blogger.com/profile/03241484392555987029noreply@blogger.com0tag:blogger.com,1999:blog-3554446977992091796.post-77642063705134956722014-01-27T08:49:00.003-08:002014-01-27T09:07:11.131-08:00A handy linq ForEach on List collection<a href="http://chankevinouk.blogspot.com/2014/01/to-access-each-element-in-list-for.html">http://chankevinouk.blogspot.com/2014/01/to-access-each-element-in-list-for.html</a>Anonymoushttp://www.blogger.com/profile/03241484392555987029noreply@blogger.com0tag:blogger.com,1999:blog-3554446977992091796.post-55473138166278198412013-09-09T13:36:00.000-07:002013-09-09T13:56:45.772-07:00Have you ever used MsBuild with Multi-core supported to boost the build speed of your projects (probably more than 100) to improve your productivity?<br />
Have you ever used MsBuild with Multi-core supported to boost the build time of your projects (probably more than 100) to improve your productivity?<br />
<br />
We can either build the whole solution or just specific project from Visual Studio using MsBuidl with Multi-Core supported.<br />
I have used it for a while now I think already more than a year and happy with it.<br />
We can print the output to VS's Build Output or print to console (I prefer the console.)<br />
Using MsBuild to build our stuffs we can use Visual Studio at ease I knew that some environment that has less RAM might probably encounter an issue that when you build your projects/solution<br />
from Visual Studio it just halted (or even the text/codes/tabs are mixed up when you are debugging) and you might really hate it! I do.<br />
So using MsBuild I am happy with that so far. My productivity is better. I feel less stress when building a huge solution consisting more than 170 projects :).<br />
<br />
To be continued, I will write a step by step on how to do MsBuild from VS.<br />
Peace Out!Anonymoushttp://www.blogger.com/profile/03241484392555987029noreply@blogger.com0tag:blogger.com,1999:blog-3554446977992091796.post-43457977645259541102013-09-09T08:45:00.004-07:002013-09-09T08:50:36.815-07:00RENAME SQL SERVER database name in Multiple user mode with killing all users' session (FORCE RENAME))*Note: it has to be run against database master (select on master -> new query or add use master)<br />
<br />
<br />
<div class="MsoNormal" style="text-autospace: none;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt;">DECLARE</span><span style="font-family: "Courier New"; font-size: 10.0pt;"> @ID <span style="color: blue;">INT<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-autospace: none;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt;">DECLARE</span><span style="font-family: "Courier New"; font-size: 10.0pt;"> @MSG <span style="color: blue;">CHAR</span><span style="color: grey;">(</span>8<span style="color: grey;">)</span></span></div>
<div class="MsoNormal" style="text-autospace: none;">
<br /></div>
<div class="MsoNormal" style="text-autospace: none;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt;">While</span><span style="font-family: "Courier New"; font-size: 10.0pt;"> 1 <span style="color: grey;">=</span> 1<o:p></o:p></span></div>
<div class="MsoNormal" style="text-autospace: none;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt;">BEGIN<o:p></o:p></span></div>
<div class="MsoNormal" style="text-autospace: none;">
<span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: blue;">Set</span>
<span style="color: blue;">RowCount</span> 1<o:p></o:p></span></div>
<div class="MsoNormal" style="text-autospace: none;">
<br /></div>
<div class="MsoNormal" style="text-autospace: none;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt;">SELECT<o:p></o:p></span></div>
<div class="MsoNormal" style="text-autospace: none;">
<span style="font-family: "Courier New"; font-size: 10.0pt;"> @id <span style="color: grey;">=</span> spid<o:p></o:p></span></div>
<div class="MsoNormal" style="text-autospace: none;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt;">FROM<o:p></o:p></span></div>
<div class="MsoNormal" style="text-autospace: none;">
<span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: blue;">Master</span><span style="color: grey;">..</span><span style="color: green;">Sysprocesses</span> P<span style="color: grey;">,<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-autospace: none;">
<span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: blue;">Master</span><span style="color: grey;">..</span><span style="color: green;">Sysdatabases</span> D<o:p></o:p></span></div>
<div class="MsoNormal" style="text-autospace: none;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt;">WHERE<o:p></o:p></span></div>
<div class="MsoNormal" style="text-autospace: none;">
<span style="font-family: "Courier New"; font-size: 10.0pt;"> D<span style="color: grey;">.</span>Name<span style="color: grey;">=</span> <span style="color: red;">N'MYDATABASE'<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-autospace: none;">
<span style="color: grey; font-family: "Courier New"; font-size: 10.0pt;">AND<o:p></o:p></span></div>
<div class="MsoNormal" style="text-autospace: none;">
<span style="font-family: "Courier New"; font-size: 10.0pt;"> D<span style="color: grey;">.</span><span style="color: blue;">dbid</span> <span style="color: grey;">=</span> P<span style="color: grey;">.</span><span style="color: blue;">dbid<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-autospace: none;">
<br /></div>
<div class="MsoNormal" style="text-autospace: none;">
<br /></div>
<div class="MsoNormal" style="text-autospace: none;">
<span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: blue;">IF</span>
<span style="color: magenta;">@@rowcount</span> <span style="color: grey;">=</span>
0<o:p></o:p></span></div>
<div class="MsoNormal" style="text-autospace: none;">
<span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: blue;">break<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-autospace: none;">
<br /></div>
<div class="MsoNormal" style="text-autospace: none;">
<span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: blue;">SELECT</span>
@msg <span style="color: grey;">=</span> <span style="color: red;">'KILL '</span> <span style="color: grey;">+</span> <span style="color: magenta;">convert</span><span style="color: grey;">(</span><span style="color: blue;">char</span><span style="color: grey;">(</span>8<span style="color: grey;">)</span> <span style="color: grey;">,</span>@ID<span style="color: grey;">)</span> <o:p></o:p></span></div>
<div class="MsoNormal" style="text-autospace: none;">
<span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: blue;">Print</span>
@msg<o:p></o:p></span></div>
<div class="MsoNormal" style="text-autospace: none;">
<span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: blue;">EXEC</span><span style="color: grey;">(</span> @msg<span style="color: grey;">)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-autospace: none;">
<span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: green;">--break<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-autospace: none;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt;">END<o:p></o:p></span></div>
<div class="MsoNormal" style="text-autospace: none;">
<br /></div>
<div class="MsoNormal" style="text-autospace: none;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt;">GO<o:p></o:p></span></div>
<div class="MsoNormal" style="text-autospace: none;">
<br /></div>
<div class="MsoNormal" style="text-autospace: none;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt;">Alter</span><span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: blue;">database</span> <o:p></o:p></span><span class="Apple-style-span" style="color: red; font-family: 'Courier New'; font-size: 13px;">MYDATABASE</span></div>
<div class="MsoNormal" style="text-autospace: none;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt;">set</span><span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: blue;">MULTI_USER<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-autospace: none;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt;">with</span><span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: blue;">rollback</span> <span style="color: blue;">immediate<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-autospace: none;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt;">exec</span><span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: maroon;">sp_renamedb</span><span style="color: blue;"> </span><span style="color: red;">N'</span></span><span class="Apple-style-span" style="color: red; font-family: 'Courier New'; font-size: 13px;">MYDATABASE</span><span style="font-family: "Courier New"; font-size: 10.0pt;"><span style="color: red;">'</span><span style="color: grey;">,</span><span style="color: red;">N'</span></span><span class="Apple-style-span" style="color: red; font-family: 'Courier New'; font-size: 13px;">MYDATABASE</span><span style="font-family: "Courier New"; font-size: 10.0pt;"><span style="color: red;">_STH_ELSE'<o:p></o:p></span></span></div>
Anonymoushttp://www.blogger.com/profile/03241484392555987029noreply@blogger.com0tag:blogger.com,1999:blog-3554446977992091796.post-45771156588550574642013-09-09T07:44:00.001-07:002013-09-09T07:51:00.208-07:00To run Batch Script as Administrator can be a little challenge.Sometimes you need batch script to run as administrator:<br />
<br />
There is 2 alternatives:<br />
1- Convert your batch script to exe and make exe run as administrator:<br />
<br />
<div class="MsoNormal">
<a href="http://www.f2ko.de/programs.php?lang=en&pid=b2e">http://www.f2ko.de/programs.php?lang=en&pid=b2e</a><o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
2- Add another batch script to open your batch script as administrator:</div>
<div class="MsoNormal">
<br />
For example:<br />
<br /></div>
<div class="MsoNormal">
ExecuteDBBlank.bat will execute DBBlankExecution.bat as administrator but it requires you to enter password administrator:</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span class="Apple-style-span" style="color: red;">ExecuteDBBlank.bat</span></div>
<div class="MsoNormal">
<span class="Apple-style-span" style="background-color: yellow;"><span class="Apple-style-span" style="color: blue;">runas /noprofile /user:PC_NAME\Administrator C:\Users\COUK\Desktop\</span><span class="Apple-style-span" style="color: red;">DBBlankExecution.bat</span></span><br />
<br />
Where PC_NAME is your PC name and your main execution batch file can be located at any directory please update yours accordingly.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
If we click on ExecuteDBBlank.bat it will ask you for Administrator password if you enter correctly DBBlankExecution.bat will be executed:</div>
<div class="MsoNormal">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-eymTy7p5Uiw/Ui3evxmuKkI/AAAAAAAAAXA/d2_uHV7wfgI/s1600/Capture.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="85" src="http://1.bp.blogspot.com/-eymTy7p5Uiw/Ui3evxmuKkI/AAAAAAAAAXA/d2_uHV7wfgI/s400/Capture.JPG" width="400" /></a></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
Anonymoushttp://www.blogger.com/profile/03241484392555987029noreply@blogger.com0tag:blogger.com,1999:blog-3554446977992091796.post-68940184961086304102013-09-09T07:19:00.000-07:002013-09-09T07:37:06.440-07:00If you sometimes have to write some batch script (I do mainly for automation stuff) here is a very good complete DOS tutorial <a href="http://www.dostips.com/">http://www.dostips.com/</a><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-dkNXnFHSVXw/Ui3YxcLAz5I/AAAAAAAAAWo/PkkrgyrEoeQ/s1600/Capture.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="312" src="http://1.bp.blogspot.com/-dkNXnFHSVXw/Ui3YxcLAz5I/AAAAAAAAAWo/PkkrgyrEoeQ/s640/Capture.JPG" width="640" /></a></div>
<br />Anonymoushttp://www.blogger.com/profile/03241484392555987029noreply@blogger.com1tag:blogger.com,1999:blog-3554446977992091796.post-18456191762717164252013-09-09T07:14:00.002-07:002013-09-09T07:14:18.372-07:00If you are a fan of building Robot or maybe a fan of Arduino (I am.)<a href="http://www.robotshop.com/blog/en/how-to-make-a-robot-lesson-1-3707">http://www.robotshop.com/blog/en/how-to-make-a-robot-lesson-1-3707</a><br />
<a href="http://www.robotshop.com/blog/en/arduino-5-minute-tutorials-lesson-1-software-3640">http://www.robotshop.com/blog/en/arduino-5-minute-tutorials-lesson-1-software-3640</a><br />
<br />
I recommended<br />
<h1 style="-webkit-text-stroke-width: 0px; background-color: white; color: #333333; font-family: 'Lucida Sans', Lucida, Verdana, sans-serif; font-style: normal; font-variant: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<a href="http://arduino.cc/en/Main/ArduinoStarterKit">The Arduino Starter Kit</a></h1>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://farm9.staticflickr.com/8050/8093226454_136f049919_z.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://farm9.staticflickr.com/8050/8093226454_136f049919_z.jpg" /></a></div>
<br />Anonymoushttp://www.blogger.com/profile/03241484392555987029noreply@blogger.com0tag:blogger.com,1999:blog-3554446977992091796.post-19443421955384440512013-09-09T07:08:00.002-07:002013-09-09T07:29:33.547-07:00Checking specific process listening on specific port- Microsoft Start button + R<br />
- Type CMD<br />
- n<span class="Apple-style-span" style="font-family: monospace; font-size: 13px;">etstat -aon | findstr
0.0:PORT_NUM</span><br />
<span class="Apple-style-span" style="font-family: monospace; font-size: 13px;"><br /></span>
<span class="Apple-style-span" style="font-family: monospace; font-size: 13px;">*PORT_NUM is your port number.</span><br />
<span class="Apple-style-span" style="font-family: monospace; font-size: 13px;"><br /></span>
<span class="Apple-style-span" style="font-family: monospace; font-size: 13px;">Ex: </span>n<span class="Apple-style-span" style="font-family: monospace; font-size: 13px;">etstat -aon | findstr 0.0:8080</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-9eTvs32Dbew/Ui3bFzMSvEI/AAAAAAAAAW0/upQWLIkUd3A/s1600/Capture.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="48" src="http://4.bp.blogspot.com/-9eTvs32Dbew/Ui3bFzMSvEI/AAAAAAAAAW0/upQWLIkUd3A/s640/Capture.JPG" width="640" /></a></div>
<span class="Apple-style-span" style="font-family: monospace; font-size: 13px;"><br /></span>Anonymoushttp://www.blogger.com/profile/03241484392555987029noreply@blogger.com0tag:blogger.com,1999:blog-3554446977992091796.post-58312178786577503772013-09-09T07:01:00.001-07:002013-09-09T07:01:58.578-07:00Curently to activate license for monotouch per IMAC, you have to install later version of Xamarin which probably will come with Xamarin.IOS Framework that your existing IOS application is not supported<br />
Curently to activate license for monotouch per IMAC, you have to install later version of Xamarin which probably will come with Xamarin.IOS Framework that your existing IOS application is not supported.<br />
So how to activate license for monotuch per IMAC without having to install Xamarin.<br />
<br />
Here is the work around (so-called Offline Activation http://docs.xamarin.com/guides/ios/getting_started/installation/offline_activation):<br />
<br />
1-<span class="Apple-tab-span" style="white-space: pre;"> </span>Install Xamrin and activate the IMAC<br />
2- Go to Finder and Hold down Ctrl Key on Go Menu in Finder and you will see Library<br />
3- Click on Library and go to Library\Monotouch\ And back up License.v2<br />
4-<span class="Apple-tab-span" style="white-space: pre;"> </span>Erase HD, Redownload Lion OS, Re-install, and Clone Co-worker’s HD using Migration/Assistance tool so that you do not have to re-install<br />
all the applications again<br />
(tip: http://www.youtube.com/watch?v=OtUw-vo606w)<br />
-<span class="Apple-tab-span" style="white-space: pre;"> </span>Then past the back up of License.v2 under Library\Monotouch\ and It compliles successfully now.<br />
There you go! try to compile your project now.<br />
<br />
Remark of the issues that leads to the solution above:<br />
- If we do not activate the monotouch per IMAC we will get error - mtouch exited with code 98<br />
that means you have not activated your monotouch on your MAC system.<br />
http://www.gregoryvarghese.com/index.php/mtouch-exited-with-code-98/<br />
- If you add reference to dll Microsoft.Synchronization.Data.dll in your project mainly for client/server database Synchronization:<br />
after you install later version of Xamarin to activate your IMAC you might get errors "is marked as an override but no suitable method found to override" on Methdo ApplyChange(...) which is an abstract method<br />
on Base class ClientSynProvider<br />
public abstract SyncContext ApplyChanges (<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>SyncGroupMetadata groupMetadata,<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>DataSet dataSet,<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>SyncSession syncSession<br />
)<br />
<br />
Following the solution I have mentioned got rid of these issues.<br />
Anonymoushttp://www.blogger.com/profile/03241484392555987029noreply@blogger.com0tag:blogger.com,1999:blog-3554446977992091796.post-17472718373028133882013-07-05T15:23:00.000-07:002013-07-05T15:23:13.089-07:00Fixing Bugs vs Working on Product FeaturesBeing a software engineering, we always wish to be part in a challenging projects balancing with bug fixing. Fixing bugs on daily basis will at least improve software's engineering knowledge but if compared to software engineering working mainly on production features; of course, they will learn a lots more than just fixing bugs.<br />
However, the positive points of SE got from working on fixing the bugs are:<br />
- Improve patient.<br />
- Improve their judgment (a good SE in fixing bug, he or she is not immediately starting to debug he or she will first try to understand the flow of the code and then judge and debug.)<br />
- Improve their understanding about the productions' functionality much more because he or she will have fixed bugs in various areas of the application with in turn help them understanding in those areas.<br />
Fixing bugs somehow SE will run into a feature-like bugs but as said working with features is more interesting , exciting, self-improvement and last but not least gains a vast of knowledge.Anonymoushttp://www.blogger.com/profile/03241484392555987029noreply@blogger.com0tag:blogger.com,1999:blog-3554446977992091796.post-40426187112435530302013-07-02T06:42:00.000-07:002013-07-02T13:51:24.336-07:00Word of the day<span style="color: red;"><span style="background-color: yellow;"><b>1- Bees Knees (adj):</b></span></span><br />
In Eng: very good, the best...<br />
In Khmer: ល្អណាស់, ល្អជាងគេ<br />
Ex:<br />
The pants you are wearing are the bee's knees.<br />
That jazz band is the bees knees.<br />
Her cooking is the bees knees.<br />
<br />
Reason of the creation of this word: <br />
"When bees flit from flower to flower the nectar sticks to their legs.
The phrase "bee's knees" means sweet and good, because the knees of the
bee are where all the sweet, good stuff is collected."<br />
<br />
ហេតុផលនៃការបង្កើតពាក្យនេះ:<br />
"នៅពេលឃ្មុំហើរយ៉ាងលឿនពីកន្លែងមួយទៅកន្លែងមួយទឹកដមផ្កាស្អិតជាប់ជើងរបស់ពួកេវា។ឃ្លា"bee's knees(ជង្គង់ឃ្មុំ)មានន័យថាផ្អែមហើយល្អពីព្រោះជង្គង់ឃ្មុំគឺជាទីកន្លែងជាតិផ្អែមនឹងរបស់ល្អៗត្រូវបានប្រមូល"<br />
<br />
<span style="color: red;"><span style="background-color: yellow;"><b>2- Nectar (n):</b></span></span><br />
In Eng: A sugary fluid secreted by plants, esp. within flowers to encourage pollination by insects and collected by bees to make honey. <br />
In Khmer: <br />
វត្ថុរាវដែលមានជាតិស្ករផ្អែមផលិតចេញពីរុក្ខជាតិជាពិសេសនៅក្នុងផ្ការដើម្បីទាក់ទាញការពង្រាយលំអងផ្ការពីពពួកសត្វល្អិតនឹងប្រមូលពីពពួកឃ្មុំដើម្បីបង្កើតជាទឹកឃ្មុំ។<br />
;ទឹកដមផ្កា<br />
<br />
<br />Anonymoushttp://www.blogger.com/profile/03241484392555987029noreply@blogger.com0tag:blogger.com,1999:blog-3554446977992091796.post-74780784594333396352012-12-02T20:06:00.002-08:002013-07-05T15:34:43.239-07:00Resolve Ubuntu 12.04 stuck at installing VMware ToolRecently I tried to install Ubuntu 12.04 on my new laptop HP Envy 17 and It always stuck at Installing Vmware Tool like following:<br />
<br />
<pre><code>******************************************************************
******************************************************************
Vmware Easy Install
PLEASE WAIT! VMware Tools is currently being
installed on your system. Depending on the
version of Ubuntu you are installing, you may
log in below and use the system during
intallation. Otherwise, please wait for the
graphical environment to launch. Thank you.
******************************************************************
******************************************************************
ubuntu login:_</code></pre>
<pre><code> </code></pre>
<pre><code>To resolve the issue:</code></pre>
<pre><code> </code></pre>
<div class="post-text">
<b>Follow the 3 Steps ...</b><br />
<ol>
<li>Restore the <code>/etc/issue</code> file:<br />
<code>sudo mv /etc/issue.backup /etc/issue</code></li>
<li>Restore the <code>/etc/rc.local</code> file:<br />
<code>sudo mv /etc/rc.local.backup /etc/rc.local</code></li>
<li>Restore the <code>/etc/init/lightdm.conf</code> file:<br />
<code>sudo mv /opt/vmware-tools-installer/lightdm.conf /etc/init</code></li>
</ol>
Then reboot.<br />
<br />
Also after reboot even I did full screen from VMware Player the Ubuntu screen is still small so what I have to do is just go to setting icon and go to Displays.... like following picture and try to change resolution till you find the best one:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-irP7nBgrkZI/ULwqsBfiKvI/AAAAAAAAAMk/xcAxBmqJfdI/s1600/Capture.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="344" src="http://1.bp.blogspot.com/-irP7nBgrkZI/ULwqsBfiKvI/AAAAAAAAAMk/xcAxBmqJfdI/s640/Capture.JPG" width="640" /></a></div>
<br />
<br />
Then you will be asked to login to your system graphically and everything is fine.<br />
Hope it helps!<br />
Vic </div>
<pre><code> </code></pre>
Anonymoushttp://www.blogger.com/profile/03241484392555987029noreply@blogger.com0tag:blogger.com,1999:blog-3554446977992091796.post-28837674311934250112012-09-24T21:52:00.000-07:002012-09-24T21:52:52.093-07:00Ubuntu on my PC!I am successfully running Ubuntu on my VM player.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-_E9g05PtE5o/UGE2BAwukFI/AAAAAAAAAMA/QqnP9s1A910/s1600/VicUbantus.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="480" src="http://3.bp.blogspot.com/-_E9g05PtE5o/UGE2BAwukFI/AAAAAAAAAMA/QqnP9s1A910/s640/VicUbantus.JPG" width="640" /></a></div>
<br />Anonymoushttp://www.blogger.com/profile/03241484392555987029noreply@blogger.com0tag:blogger.com,1999:blog-3554446977992091796.post-43976715148191859212012-09-23T16:49:00.001-07:002012-09-23T17:00:06.846-07:00Words of the daySloppy (adj) = careless.<br />
Ex: You are such a sloppy guy. = You are such a careless guy.<br />
Ex: Software Engineer should have a mentality of always writing the best code not the sloppy code.<br />
<br />
<span style="font-family: sans-serif; font-size: x-small;"><span style="line-height: 19.200000762939453px;">everything but the kitchen sink = it is an idiom which means everything that can be possible</span></span><br />
<span style="font-family: sans-serif; font-size: x-small;"><span style="line-height: 19.200000762939453px;">Ex: Shellie is moving out to a new place and she takes everything but the kitchen sink to her new place.</span></span><br />
<span style="font-family: sans-serif; font-size: x-small;"><span style="line-height: 19.200000762939453px;">= Shellie is moving out to a new place and she takes everything that she can possible take them with her to her new places.</span></span><br />
<br />Anonymoushttp://www.blogger.com/profile/03241484392555987029noreply@blogger.com0tag:blogger.com,1999:blog-3554446977992091796.post-87012910522974032972012-09-21T10:33:00.002-07:002012-09-21T10:33:28.115-07:00What is a Column Vector?a <b>column vector</b> or <b>column matrix</b> is an <i>m</i> × 1 <a href="http://en.wikipedia.org/wiki/Matrix_%28mathematics%29" title="Matrix (mathematics)">matrix</a>, i.e. a matrix consisting of a single column of <i>m</i> elements.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://upload.wikimedia.org/math/e/6/c/e6c726a43f7f1bcb400bb1f12b60aa7b.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://upload.wikimedia.org/math/e/6/c/e6c726a43f7f1bcb400bb1f12b60aa7b.png" /></a></div>
Anonymoushttp://www.blogger.com/profile/03241484392555987029noreply@blogger.com0tag:blogger.com,1999:blog-3554446977992091796.post-45342069519471653722012-09-21T08:01:00.001-07:002012-09-21T10:24:42.667-07:00What is orthogonal, esp in Computer Science?In geometry, orthogonal means "involving right angles" (from Greek ortho, meaning right, and gon meaning angled). The term has been extended to general use, meaning the characteristic of being independent (relative to something else). It also can mean: non-redundant, non-overlapping, or irrelevant. In computer terminology, something - such as a programming language or a data object - is orthogonal if it can be used without consideration as to how its use will affect something else.<br />
<br />
In itself, a programming language is orthogonal if its features can be used without thinking about how that usage will affect other features. Pascal is sometimes considered to be an orthogonal language, while C++ is considered to be a non-orthogonal language.<br />
<br />
Features of a program that is compatible with its own earlier versions - this is called backward compatible - have an orthogonal relationship with the features of the earlier version, because they are mutually independent; you don't have to worry about how the use of one version's features will cause an unintended effect because of an interaction with those of the other version. Both the features and the programs can be said to be mutually orthogonal.<br />
<br />
The length of time data is kept in storage in a computer system is known as its persistence. Orthogonal persistence is the quality of a programming system that allows a programmer to treat data similarly without regard to the length of time the data is kept in storage. Data is stored for varying lengths of time; some is stored very briefly and some is stored relatively permanently. Frequently, a programmer must use different approaches and separate coding to access data depending on whether it is stored for a long time or a short time. Using a programming system with orthogonal data persistence allows the programmer to treat data the same way regardless of its persistence characteristic, saving programming time and making it easier to enforce referential integrity (a type of constraint applied to ensure correct data validity).<br />
<br />
In short:<br />
----------------------------------------------------------------------------------------------------------<br />
<b style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: sans-serif; font-size: 13px; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: 19.200000762939453px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Orthogonality</b><span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19.200000762939453px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-converted-space"> </span>comes from the<span class="Apple-converted-space"> </span></span><a href="http://en.wikipedia.org/wiki/Greek_language" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; background-image: none; background-position: initial initial; background-repeat: initial initial; color: #0b0080; font-family: sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19.200000762939453px; orphans: 2; text-align: start; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" title="Greek language">Greek</a><span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19.200000762939453px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-converted-space"> </span></span><i style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: sans-serif; font-size: 13px; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19.200000762939453px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">orthos</i><span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19.200000762939453px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">, meaning "straight", and<span class="Apple-converted-space"> </span></span><i style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: sans-serif; font-size: 13px; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19.200000762939453px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">gonia</i><span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19.200000762939453px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">, meaning "angle". It has somewhat different meanings depending on the context, but <span style="background-color: yellow;"><span style="color: red;"><b>most involve the idea of<span class="Apple-converted-space"> </span></b></span></span></span><span style="background-color: yellow;"><span style="color: red;"><b><a href="http://en.wikipedia.org/wiki/Perpendicular" style="background-image: none; font-family: sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19.2px; orphans: 2; text-align: start; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" title="Perpendicular">perpendicular</a><span style="display: inline ! important; float: none; font-family: sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19.2px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">, non-overlapping, or uncorrelated.</span></b></span></span><br />
<br />
<span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19.200000762939453px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Ex: Below Line Segment AB is orthogonal to line Segment CD. </span><br />
<br />
<span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19.200000762939453px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Two<span class="Apple-converted-space"> </span></span><a href="http://en.wikipedia.org/wiki/Vector_(mathematics_and_physics)" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; background-image: none; background-position: initial initial; background-repeat: initial initial; color: #0b0080; font-family: sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19.200000762939453px; orphans: 2; text-align: start; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" title="Vector (mathematics and physics)">vectors</a><span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19.200000762939453px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-converted-space"> </span>are orthogonal<span class="Apple-converted-space"> </span></span><a href="http://en.wikipedia.org/wiki/If_and_only_if" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; background-image: none; background-position: initial initial; background-repeat: initial initial; color: #0b0080; font-family: sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19.200000762939453px; orphans: 2; text-align: start; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" title="If and only if">if and only if</a><span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19.200000762939453px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-converted-space"> </span>their</span><a href="http://en.wikipedia.org/wiki/Dot_product" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; background-image: none; background-position: initial initial; background-repeat: initial initial; color: #0b0080; font-family: sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19.200000762939453px; orphans: 2; text-align: start; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" title="Dot product">dot product</a><span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19.200000762939453px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-converted-space"> </span>is zero</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://upload.wikimedia.org/wikipedia/commons/8/84/Perpendicular-coloured.svg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="276" src="http://upload.wikimedia.org/wikipedia/commons/8/84/Perpendicular-coloured.svg" width="400" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19.200000762939453px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Orthogonal = perpendicular:</span><br />
<br />
<h3 class="r g0">
<span style="padding-bottom: 14px; padding-right: 15px;"><em>per·pen·dic·u·lar</em></span><span style="font: smaller 'Doulos SIL','Gentum','TITUS Cyberbit Basic','Junicode','Aborigonal Serif','Arial Unicode MS','Lucida Sans Unicode','Chrysanthi Unicode'; padding-bottom: 7px;">/ˌpərpənˈdikyələr/</span><span class="speaker-icon-listen-off" id="speaker_icon" style="margin-left: .7em; margin: 0;"></span></h3>
<table class="ts"><tbody>
<tr><td style="color: #666666; padding-bottom: 5px; padding-top: 5px;" valign="top" width="80px">Adjective:</td><td style="padding-bottom: 5px; padding-top: 5px;" valign="top"><table class="ts"><tbody>
<tr><td>At an angle of 90° to a given line, plane, or surface.</td></tr>
</tbody></table>
</td></tr>
<tr bgcolor="#ddd" height="1px"><td colspan="2" height="1px"><br /></td></tr>
<tr><td style="color: #666666; padding-bottom: 5px; padding-top: 5px;" valign="top" width="80px">Noun:</td><td style="padding-bottom: 5px; padding-top: 5px;" valign="top"><table class="ts"><tbody>
<tr><td><span style="background-color: yellow;"><span style="color: red;">A straight line at an angle of 90° to a given line, plane, or surface.</span></span></td></tr>
</tbody></table>
</td></tr>
<tr bgcolor="#ddd" height="1px"><td colspan="2" height="1px"><br /></td></tr>
<tr><td style="color: #666666; padding-bottom: 5px; padding-top: 5px;" valign="top" width="80px">Synonyms:</td><td style="padding-bottom: 5px; padding-top: 5px;" valign="top"><div>
<span style="color: #666666;"><i>adjective</i>. </span><span style="background-color: yellow;"><span style="color: red;">vertical - upright</span></span></div>
</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.mathsisfun.com/images/perpendicular-also.gif" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="269" src="http://www.mathsisfun.com/images/perpendicular-also.gif" width="320" /></a></div>
<span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19.200000762939453px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"> </span> Anonymoushttp://www.blogger.com/profile/03241484392555987029noreply@blogger.com0tag:blogger.com,1999:blog-3554446977992091796.post-90294399169666870642012-09-20T23:42:00.001-07:002012-09-21T11:39:55.879-07:00First hand-on OpenGL with Visual C++First we have setup OpenGL in Windows:<br />
2 steps below need to be taken care of:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-BpSIuH3sU94/UFwHs5pVnzI/AAAAAAAAALM/hDfDECQIyhI/s1600/OpenGL_Setup.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="137" src="http://2.bp.blogspot.com/-BpSIuH3sU94/UFwHs5pVnzI/AAAAAAAAALM/hDfDECQIyhI/s640/OpenGL_Setup.JPG" width="640" /></a></div>
<br />
<br />
Step 1:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-NSnIYo8MC9E/UFwIPTFADQI/AAAAAAAAALU/46oQrCCEI_g/s1600/OpenGL2+exe.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="384" src="http://2.bp.blogspot.com/-NSnIYo8MC9E/UFwIPTFADQI/AAAAAAAAALU/46oQrCCEI_g/s640/OpenGL2+exe.JPG" width="640" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Step 2:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-AU31GO1Li9Q/UFwIwMZjg-I/AAAAAAAAALc/SlNHlUo6gIw/s1600/glut+bin.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="410" src="http://4.bp.blogspot.com/-AU31GO1Li9Q/UFwIwMZjg-I/AAAAAAAAALc/SlNHlUo6gIw/s640/glut+bin.JPG" width="640" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Open Visual Studio 2008:<br />
<br />
File -> New Project -> Visual C++ -> General -> Empty Project<br />
<br />
Right Click on Source Files -> New Item... -> C++ file (.cpp)<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-lgIw0e4cg6I/UFwJ1PYeP5I/AAAAAAAAALk/AGkWvYt6NoI/s1600/Create+C++++pro.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="400" src="http://1.bp.blogspot.com/-lgIw0e4cg6I/UFwJ1PYeP5I/AAAAAAAAALk/AGkWvYt6NoI/s400/Create+C++++pro.JPG" width="378" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Write code below:<br />
<br />
<span style="color: lime;">[Code]</span><br />
<span style="color: lime;"><br /></span>
<span style="color: lime;">// @Author: Vic<br />// @Date: 9/21/2012 2:38AM<br />#include "stdafx.h"<br />#include <gl glut.h="glut.h"> // this include also gl.h and glu.h<br /><br />void init(void)<br />{<br /> glClearColor(1.0 , 1.0 ,1.0 , 0.0); // Set display-window color to white<br /><br /> glMatrixMode(GL_PROJECTION); // Set projection parameter<br /> gluOrtho2D(0.0,200.0,0.0,150.0); // <br /><br />}<br /><br />void lineSegment(void){<br /> glClear(GL_COLOR_BUFFER_BIT); // Clear display window.<br /><br /> glColor3f(1.0, 0.0, 0.0); // Set line segment color to red (R,G,B) <br /> glBegin(GL_LINES);<br /> glVertex2i(180,15); // Specify line-segment geometry x1,y1 ; x2,y2<br /> glVertex2i(10,145);<br /> glEnd();<br /><br /> glFlush(); // Profess all OpenGL routines as quickly as possible.<br />}<br /><br />void main(int argc, char** argv)<br />{<br /> glutInit(&argc, argv); // Initialize GLUT dll that we copy it in c:\windows\System32<br /> glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB); // set display mode<br /> glutInitWindowPosition (50,100); // set top-left display window position<br /> glutInitWindowSize(400,300); // set display window width / height<br /> glutCreateWindow("An Example OpenGL Program"); // Create display window title.<br /><br /> init(); // Execute initialization procedure<br /> glutDisplayFunc(lineSegment); // Send graphics to display window. our function above main<br /> glutMainLoop(); // Display everything and wait.<br />}</gl></span><br />
<span style="color: lime;"><br /></span>
<span style="color: lime;">[/Code]</span><br />
<br />
Run it:<br />
Output:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-RBhJcpgqV38/UFwMCJN7XiI/AAAAAAAAALs/wcuh3EdkqC0/s1600/Output.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="472" src="http://4.bp.blogspot.com/-RBhJcpgqV38/UFwMCJN7XiI/AAAAAAAAALs/wcuh3EdkqC0/s640/Output.JPG" width="640" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Congratulation you have run your first C++ OpenGL.<br />
Vic,<br />
<br />
Correction for the header files I have made a mistake while commenting and accidentally delete the Glut header file declaration you would find the correction below:<br />
<br />
<span style="color: lime;">#include "stdafx.h"<br />#include "GL/glut.h"<gl glut.h="glut.h">// this include also gl.h and glu.h </gl></span>Anonymoushttp://www.blogger.com/profile/03241484392555987029noreply@blogger.com0tag:blogger.com,1999:blog-3554446977992091796.post-73575628845425041902012-09-09T23:21:00.002-07:002012-09-09T23:21:35.052-07:00Wisdom for today 10th of September 2012<h4 style="color: red;">
twenty-one words from Thomas Carlyle. </h4>
<h3 style="background-color: yellow; color: blue;">
"Our main<br />business is not to see what lies dimly at a distance, but to do what lies clearly at hand."</h3>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://photoquoto.com/wp-content/uploads/2011/10/111023.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="426" src="http://photoquoto.com/wp-content/uploads/2011/10/111023.jpg" width="640" /></a></div>
<br />Anonymoushttp://www.blogger.com/profile/03241484392555987029noreply@blogger.com0tag:blogger.com,1999:blog-3554446977992091796.post-47988166818630747392012-09-06T16:38:00.000-07:002012-09-07T13:46:46.420-07:00Windows is suck! Graphics.h is not supported!I want to run Cohen-Sutherland using C++ from Wikipedia Link:<br />
<a href="http://en.wikipedia.org/wiki/Cohen%E2%80%93Sutherland">http://en.wikipedia.org/wiki/Cohen%E2%80%93Sutherland</a>
<br />
Using Turbo C++ but still got an issue that we cannot run application with header file Graphics.h because it is mainly supported only in Unix: So probably I will have to converted it to Java Applet tonight!<br />
<br />
<span style="color: lime;">[Code]</span><br />
<span style="color: lime;"><br /></span>
<br />
<span style="color: lime;">const int INSIDE = 0; // 0000</span><br />
<span style="color: lime;">const int LEFT = 1; // 0001</span><br />
<span style="color: lime;">const int RIGHT = 2; // 0010</span><br />
<span style="color: lime;">const int BOTTOM = 4; // 0100</span><br />
<span style="color: lime;">const int TOP = 8; // 1000</span><br />
<span style="color: lime;"><br /></span>
<span style="color: lime;">OutCode ComputeOutCode(double x, double y)</span><br />
<span style="color: lime;">{</span><br />
<span style="color: lime;"> OutCode code;</span><br />
<br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> code = INSIDE; // initialised as being inside of clip window</span><br />
<br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> if (x < xmin) // to the left of clip window</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> code |= LEFT;</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> else if (x > xmax) // to the right of clip window</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> code |= RIGHT;</span><br />
<span style="color: lime;"> if (y < ymin) // below the clip window</span><br />
<span style="color: lime;"> code |= BOTTOM;</span><br />
<span style="color: lime;"> else if (y > ymax) // above the clip window</span><br />
<span style="color: lime;"> code |= TOP;</span><br />
<span style="color: lime;"><br /></span>
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> return code;</span><br />
<span style="color: lime;">}</span><br />
<span style="color: lime;">void CohenSutherlandLineClipAndDraw(double x0, double y0, double x1, double y1)</span><br />
<span style="color: lime;">{ </span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> OutCode outcode0 = ComputeOutCode(x0, y0);</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> OutCode outcode1 = ComputeOutCode(x1, y1);</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> bool accept = false;</span><br />
<span style="color: lime;"><br /></span>
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> while (true) {</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> if (!(outcode0 | outcode1)) {//Bitwise OR is 0. Trivially accept and get out of loop</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>accept = true;</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>break;</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> } else if (outcode0 & outcode1) {//Bitwise AND is not 0. Trivially reject and get out of loop</span><br />
<span style="color: lime;"> break;</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> }</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> else {</span><br />
<span style="color: lime;"><br /></span>
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>double x, y;</span><br />
<span style="color: lime;"><br /></span>
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>OutCode outcodeOut = outcode0? outcode0 : outcode1;</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>if (outcodeOut&TOP){ // point is above the clip rectangle</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> x = x0 + (x1-x0)*(ymax-y0)/(y1-y0);</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> y = ymax;</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>} else if(outcodeOut & BOTTOM) { // point is below the clip rectangle</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> x = x0 + (x1 - x0) * (ymin - y0) / (y1 - y0);</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> y = ymin;</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>} else if (outcodeOut & RIGHT) { // point is to the right of clip rectangle</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> y = y0 + (y1 - y0) * (xmax - x0) / (x1 - x0);</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> x = xmax;</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>} else if (outcodeOut & LEFT) { // point is to the left of clip rectangle</span><br />
<span style="color: lime;"> y = y0 + (y1 - y0) * (xmin - x0) / (x1 - x0);</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> x = xmin;</span><br />
<span style="color: lime;"> }</span><br />
<span style="color: lime;"><br /></span>
<span style="color: lime;"> if (outcodeOut == outcode0) {</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> x0 = x;</span><br />
<span style="color: lime;"> y0 = y;</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> outcode0 = ComputeOutCode(x0, y0);</span><br />
<span style="color: lime;"> } else {</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> x1 = x;</span><br />
<span style="color: lime;"> y1 = y;</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> outcode1 = ComputeOutCode(x1, y1);</span><br />
<span style="color: lime;"> }</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> }</span><br />
<span style="color: lime;"> rectangle(xmin, ymin, xmax, ymax);</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> line(x0, y0, x1, y1);</span><br />
<span style="color: lime;"> getch();</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// cleardevice();</span><br />
<span style="color: lime;"> }</span><br />
<span style="color: lime;"><br /></span>
<span style="color: lime;"> if(accept) {</span><br />
<span style="color: lime;"><br /></span>
<span style="color: lime;"> rectangle(xmin, ymin, xmax, ymax);</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>line(x0, y0, x1, y1);</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>printf("\n\tpoints p0=(%d,%d) p1=(%d,%d)",(int)x0,(int)y0,(int)x1,(int)y1);</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> }</span><br />
<span style="color: lime;">}</span><br />
<span style="color: lime;"><br /></span>
<span style="color: lime;">int main(int argc, char** argv)</span><br />
<span style="color: lime;">{</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> int gd=DETECT,gm;</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> initgraph(&gd,&gm,NULL);</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> outtextxy(300,10,"BEFORE LINE CLIPPING");</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> rectangle(xmin,ymin,xmax,ymax);</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> line(10,200,350,300);</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> getch();</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> cleardevice();</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> outtextxy(300,10,"AFTER LINE CLIPPING");</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> CohenSutherlandLineClipAndDraw(10,200,350,300);</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> getch();</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> closegraph();</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> return 0;</span><br />
<span style="color: lime;">}</span><br />
<br />
<br />
<span style="color: lime;">[/Code]</span><br />
<span style="color: lime;"><br /></span>
<span style="color: lime;"><br /></span>
Finally I have converted it to Applet application below and the algorithm is exactly like the one from C++ above I like the way it is implemented and I made slightly modification to make people really can understand Cohen-Sutherland by just reading the code implementation below (the differences are just adding mouseListener event MousePressed for capturing coordinates of both endpoints the rest algorithm are almost exactly the same) like I have mentioned before this version was converted from above as we cannot run above C++ within Windows because only Unix OS support Graphics.h:<br />
<span style="color: lime;"><br /></span>
<span style="color: lime;">[Code]</span><br />
<span style="color: lime;"><br /></span>
<span style="color: lime;"></span><br />
<span style="color: lime;">/**</span><br />
<span style="color: lime;"> * @author VIC</span><br />
<span style="color: lime;">* @date 9-6-2012</span><br />
<span style="color: lime;"> * Cohen-SutherLand implementation in steps below in Applet</span><br />
<span style="color: lime;"> * 1- Init add MouseLister for Call back</span><br />
<span style="color: lime;"> * When there is event mousePressed is received</span><br />
<span style="color: lime;"> * 2- when received capture x,y from Applet windows</span><br />
<span style="color: lime;"> * for first Coordinate and Last Coordinate</span><br />
<span style="color: lime;"> * 3- And start painting once we get both</span><br />
<span style="color: lime;"> * first and last point</span><br />
<span style="color: lime;"> * 4- we will always repaint our rectangle</span><br />
<span style="color: lime;"> * and paint line against Cohen-Sutherland</span><br />
<span style="color: lime;"> * LineClipping Algorithm</span><br />
<span style="color: lime;"> * 5- Cohen-Sutherland LineClipping</span><br />
<span style="color: lime;"> * a- Computer OutCode for first Coordinate </span><br />
<span style="color: lime;"> * b- Computer OutCode for Last Coordinate</span><br />
<span style="color: lime;"> * d- In life time While loop [While(true)]</span><br />
<span style="color: lime;"> * d-1- Check if both outCode first Coordinate</span><br />
<span style="color: lime;"> * And outCode Last Coordinate == 0</span><br />
<span style="color: lime;"> * => It is a trivial accepted (both points are</span><br />
<span style="color: lime;"> * inside rectangle)</span><br />
<span style="color: lime;"> * so just return true and draw it </span><br />
<span style="color: lime;"> * as usual</span><br />
<span style="color: lime;"> * d-2- Check if outCode 1st Coo. AND 2nd Coo.</span><br />
<span style="color: lime;"> * != 1 </span><br />
<span style="color: lime;"> * => it is trivial rejected (both points are</span><br />
<span style="color: lime;"> * outSide rectangle)</span><br />
<span style="color: lime;"> * so just return false and don't draw it</span><br />
<span style="color: lime;"> * d-3- In case above 2 cases are not true</span><br />
<span style="color: lime;"> * that mean LineClipping or at least one coordinate</span><br />
<span style="color: lime;"> * pair is outside rectangle</span><br />
<span style="color: lime;"> * => Calculate the outer end point against </span><br />
<span style="color: lime;"> * Top,Bottom,Right,Left to check if the outer point</span><br />
<span style="color: lime;"> * is in those area</span><br />
<span style="color: lime;"> * d-4- Move to the intersection point</span><br />
<span style="color: lime;"> * => Keeping checking it till trivial</span><br />
<span style="color: lime;"> * Accept or Trivial Reject</span><br />
<span style="color: lime;"> * And that is it. </span><br />
<span style="color: lime;"> * </span><br />
<span style="color: lime;"> */</span><br />
<span style="color: lime;"><br /></span>
<span style="color: lime;"><br /></span>
<span style="color: lime;">import java.awt.*;</span><br />
<span style="color: lime;">import java.applet.Applet;</span><br />
<span style="color: lime;">import java.awt.event.*;</span><br />
<span style="color: lime;"><br /></span>
<span style="color: lime;">//just a simple class to store our coordinate x, y Ex: x1,y1 or x2,y2</span><br />
<span style="color: lime;">class Coordinate {</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>double x, y;</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// Constuctor</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>Coordinate(double thisx, double thisy) {</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>x = thisx;</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>y = thisy;</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span style="color: lime;">}</span><br />
<span style="color: lime;"><br /></span>
<span style="color: lime;">// Main Class linceClipper extends Applet (we use Awt not swing if it is swing</span><br />
<span style="color: lime;">// It should have been JApplet)</span><br />
<span style="color: lime;">public class lineClipperCohenSutherland extends Applet {</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>/**</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> * </span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> */</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// ignore this it is generated by Eclipse IDE</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>private static final long serialVersionUID = -6235793678072658006L;</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// Constance variables</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// Define Top, Bottom, Right, Left Codes</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// 1000, 0100, 0010, 0001 </span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>final static int INSIDE = 0; // 0000</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>final static int LEFT = 1; // 0001</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>final static int RIGHT = 2; // 0010</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>final static int BOTTOM = 4; // 0100</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>final static int TOP = 8; // 1000</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// Ignore these it is just the maximum</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// Width and Height of Applet Windows</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// They have nothing to do with </span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// Cohen-Sutherland Algorithm</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>final int xMax = 500, yMax = 400;</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// These are used to store coordinate the two points</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// which will be got from Applet MouseListener of MouseAdapter</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// Event mousePressed(MouseEvent evt)</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// we initialize firstZeroLastOne with 0</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// Because when mouse pressed we track that if it is 0 that </span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// means it is the first coordinate</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// and increase it by one</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// else when pressed the second times => firstZeroLastOne == 1</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// will be true and we reset firstZeroLastOne to 0 </span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// for the next straight line</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>private int firstX, firstY, lastX, lastY, firstZeroLastOne = 0;</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// Our rectangle area or we can say our viewport area or visible area</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>static double xLeft = 100.0, xRight = 400.0, yBottom = 100.0, yTop = 300.0;</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// dimensions of rectangle to clip against</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>Coordinate C0, C1;</span><br />
<span style="color: lime;"><br /></span>
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// init() is the starting point</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// of Awt applet</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>public void init() {</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>resize(xMax, yMax);</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>this.addMouseListener(new MouseAdapter() {</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>public void mousePressed(MouseEvent evt) {</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>if (firstZeroLastOne == 0) {</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>firstX = evt.getX();</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>firstY = evt.getY();</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>firstZeroLastOne++; // increase by one so that </span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> // we will know the next </span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span> // press is the last point</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>} else if (firstZeroLastOne == 1) {</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>lastX = evt.getX();</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>lastY = evt.getY();</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>firstZeroLastOne = 0; // reset it to Zero for the next line</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// Now we got both point0 and Point1</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// Or we can say we got first point and last point.</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>C0 = new Coordinate((double) firstX, (double) firstY);</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>C1 = new Coordinate((double) lastX, (double) lastY);</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// so start painting it:</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// we will always paint our rectangle</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// but before we draw line we have to</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// check it against Cohen-Sutherland algorithm</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// for line clipping</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>paint(getGraphics());</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>});<span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>public void paint(Graphics g) {</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// Always repaint our rectangle area</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>g.drawRect((int) xLeft, (int) yBottom, (int) (xRight - xLeft),</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>(int) (yTop - yBottom));</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// Before drawing any line check it against </span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>if (lineClippingCohenSutherland2D(C0, C1))</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>g.drawLine((int) C0.x, (int) C0.y, (int) C1.x, (int) C1.y);</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span style="color: lime;"><br /></span>
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>private static int outCodesCompute(Coordinate C) {<span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>int code;</span><br />
<span style="color: lime;"><br /></span>
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>code = INSIDE; // initialised as being inside of clip window</span><br />
<span style="color: lime;"><br /></span>
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>if (C.x < xLeft) // to the left of clip window</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>code |= LEFT;</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>else if (C.x > xRight) // to the right of clip window</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>code |= RIGHT;</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>if (C.y < yBottom) // below the clip window</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>code |= BOTTOM;</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>else if (C.y > yTop) // above the clip window</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>code |= TOP;</span><br />
<span style="color: lime;"><br /></span>
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>return code;</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>static boolean lineClippingCohenSutherland2D(Coordinate C0, Coordinate C1) {</span><br />
<span style="color: lime;"><br /></span>
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>if (C0 == null && C1 == null) {</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>return false;</span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}<span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// compute outcodes for C0, C1, and whatever point lies outside the clip rectangle</span><br />
<span style="color: lime;"> int outcode0 = outCodesCompute(C0);</span><br />
<span style="color: lime;"> int outcode1 = outCodesCompute(C1);</span><br />
<br />
<span style="color: lime;"> while (true) {</span><br />
<span style="color: lime;"> if (outcode0 == 0 && outcode1 == 0) { // Bitwise OR is 0. Trivially accept and get out of loop</span><br />
<span style="color: lime;"> return true;</span><br />
<span style="color: lime;"> } else if ((outcode0 & outcode1) != 0) { // Bitwise AND is not 0. Trivially reject and get out of loop</span><br />
<span style="color: lime;"> return false;</span><br />
<span style="color: lime;"> } else {</span><br />
<span style="color: lime;"> // failed both tests, so calculate the line segment to clip</span><br />
<span style="color: lime;"> // from an outside point/coordinate to an intersection with clip edge</span><br />
<span style="color: lime;"> double x =0, y = 0;</span><br />
<br />
<span style="color: lime;"> // At least one end point/coordinate is outside the clip rectangle; pick it.</span><br />
<span style="color: lime;"> int outcodeOut = outcode0!=0? outcode0 : outcode1;</span><br />
<br />
<span style="color: lime;"> // Now find the intersection point;</span><br />
<span style="color: lime;"> // use formulas y = y0 + slope * (x - x0), </span><br />
<span style="color: lime;"> // Where x can be xRight or xLeft</span><br />
<span style="color: lime;"> // x = x0 + (1 / slope) * (y - y0)</span><br />
<span style="color: lime;"> // Where y can be yTop or yBottom</span><br />
<span style="color: lime;"> </span><br />
<span style="color: lime;"> // Slope calculation </span><br />
<span style="color: lime;"> double slope = (C1.y - C0.y)/(C1.x - C0.x);</span><br />
<span style="color: lime;"> </span><br />
<span style="color: lime;"> if ((outcodeOut & TOP) != 0) { // point is above the clip rectangle</span><br />
<span style="color: lime;"> x = C0.x + (1/slope)*(yTop - C0.y) ;</span><br />
<span style="color: lime;"> y = yTop;</span><br />
<span style="color: lime;"> } else if ((outcodeOut & BOTTOM) != 0) { // point is below the clip rectangle</span><br />
<span style="color: lime;"> x = C0.x + (1/slope)*(yBottom - C0.y);</span><br />
<span style="color: lime;"> y = yBottom;</span><br />
<span style="color: lime;"> } else if ((outcodeOut & RIGHT) != 0) { // point is to the right of clip rectangle</span><br />
<span style="color: lime;"> y = C0.y + slope*(xRight - C0.x) ;</span><br />
<span style="color: lime;"> x = xRight;</span><br />
<span style="color: lime;"> } else{ /*if ((outcodeOut & LEFT) != 0) {*/ // point is to the left of clip rectangle</span><br />
<span style="color: lime;"> y = C0.y + slope*(xLeft - C0.x);</span><br />
<span style="color: lime;"> x = xLeft;</span><br />
<span style="color: lime;"> }</span><br />
<br />
<span style="color: lime;"> // Now we move outside point to intersection point to clip</span><br />
<span style="color: lime;"> // and get ready for next pass.</span><br />
<span style="color: lime;"> if (outcodeOut == outcode0) {</span><br />
<span style="color: lime;"> C0.x = x;</span><br />
<span style="color: lime;"> C0.y = y;</span><br />
<span style="color: lime;"> outcode0 = outCodesCompute(C0);</span><br />
<span style="color: lime;"> } else {</span><br />
<span style="color: lime;"> C1.x = x;</span><br />
<span style="color: lime;"> C1.y = y;</span><br />
<span style="color: lime;"> outcode1 = outCodesCompute(C1);</span><br />
<span style="color: lime;"> }</span><br />
<span style="color: lime;"> }</span><br />
<span style="color: lime;"> }<span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span style="color: lime;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span style="color: lime;">}</span><br />
<br />
<span style="color: lime;"><br /></span>
<span style="color: lime;">[/Code]</span><br />
<span style="color: lime;"><br /></span>
Also please be aware that Applet Coordinate is little different than our perspective for:<br />
Y is from Top to Down and<br />
X is from Left to Right<br />
Like following picture:<br />
<span style="color: lime;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-MsGi5Zdg7AA/UEpWeUOgYnI/AAAAAAAAAKg/iClXMHzraFw/s1600/Applet+Coordinate.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="260" src="http://3.bp.blogspot.com/-MsGi5Zdg7AA/UEpWeUOgYnI/AAAAAAAAAKg/iClXMHzraFw/s400/Applet+Coordinate.jpg" width="400" /></a></div>
<span style="color: lime;"><br /></span>
<span style="color: lime;"><br /></span>
<span style="color: lime;"><br /></span>
<span style="color: lime;"><br /></span>
<span style="color: lime;"><br /></span>
<span style="color: lime;"><br /></span>
<span style="color: lime;"><br /></span>
<span style="color: lime;"><br /></span>
<span style="color: lime;"><br /></span>
<span style="color: lime;"><br /></span>
<br />
<br />
<br />
<br />
This drives me nut yesterday because I click on area 1000 which is Top but it returns that it is in Below and It does return correct that it is below the boundary of Y Axis because we check that if it is less than yBottom that mean it is below bottom of Rectangle Area so it is bottom and that is because Applet Coordinate calculate the Axis Y Top to below.
<span style="color: lime;"><br /></span>
<br />
<br />
9 viewports:<br />
<span style="color: lime;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/--8dRAglFNLc/UEpZFxmTkMI/AAAAAAAAAK0/ZVbT8bPB0Gw/s1600/9AreasOutCodeFromLecture.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/--8dRAglFNLc/UEpZFxmTkMI/AAAAAAAAAK0/ZVbT8bPB0Gw/s1600/9AreasOutCodeFromLecture.JPG" /></a></div>
<span style="color: lime;"><br /></span>Anonymoushttp://www.blogger.com/profile/03241484392555987029noreply@blogger.com0tag:blogger.com,1999:blog-3554446977992091796.post-32814479116126738362012-09-05T16:18:00.000-07:002012-09-05T16:18:07.123-07:00My trip to Ocean city with my folksI currently live in Columbia, MD and luckily we came up with an idea to celebrate my friend Birthday there!<br />
We all have fun even though Saturday it kept raining like cat and dog but Sunday was really good. Since it was raining it took us like 3 hours and a half to arrive there from Columbia but as usually in Google Map it showed that it would take only 3 hours.<br />
We went to eat Crabs, checked some pubs and we thought that we probably checked the night club there but unfortunately we all fell asleep and missed it :D<br />
We also did a sea rocket and a 800 fit paracell above the sea:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-hpqRPC3MwfE/UEfYDKM4FoI/AAAAAAAAAIc/hClTet4SklE/s1600/IMG_0785.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="300" src="http://3.bp.blogspot.com/-hpqRPC3MwfE/UEfYDKM4FoI/AAAAAAAAAIc/hClTet4SklE/s400/IMG_0785.JPG" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-NJ1E3H7yZLY/UEfZGAtnCZI/AAAAAAAAAIk/t_MXQHDkTgk/s1600/IMG_0780.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="300" src="http://1.bp.blogspot.com/-NJ1E3H7yZLY/UEfZGAtnCZI/AAAAAAAAAIk/t_MXQHDkTgk/s400/IMG_0780.JPG" width="400" /></a></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-VFgmdOW7qSE/UEfZVOaJUUI/AAAAAAAAAIs/dsOdBKxApKM/s1600/IMG_0782.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="300" src="http://2.bp.blogspot.com/-VFgmdOW7qSE/UEfZVOaJUUI/AAAAAAAAAIs/dsOdBKxApKM/s400/IMG_0782.JPG" width="400" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Hooper's Crab house is the best place for eating crabs.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-k5SNdKVsgnQ/UEfZnU-lzQI/AAAAAAAAAI0/J3EM28eOOU8/s1600/IMG_0779.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="300" src="http://1.bp.blogspot.com/-k5SNdKVsgnQ/UEfZnU-lzQI/AAAAAAAAAI0/J3EM28eOOU8/s400/IMG_0779.JPG" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-H-GrdOAhyug/UEfZzmLWNyI/AAAAAAAAAI8/U_WPJ9tr8Eg/s1600/IMG_0799.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="300" src="http://4.bp.blogspot.com/-H-GrdOAhyug/UEfZzmLWNyI/AAAAAAAAAI8/U_WPJ9tr8Eg/s400/IMG_0799.JPG" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-YRpG6t99iRY/UEfZ9-W3S6I/AAAAAAAAAJE/e3Qd0tv2Ybk/s1600/IMG_0803.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="300" src="http://4.bp.blogspot.com/-YRpG6t99iRY/UEfZ9-W3S6I/AAAAAAAAAJE/e3Qd0tv2Ybk/s400/IMG_0803.JPG" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-TAYfbrJcKcw/UEfaLGisC6I/AAAAAAAAAJM/Uj51q7M0P1g/s1600/IMG_0791.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="300" src="http://1.bp.blogspot.com/-TAYfbrJcKcw/UEfaLGisC6I/AAAAAAAAAJM/Uj51q7M0P1g/s400/IMG_0791.JPG" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-rXmZoDeVApU/UEfaPSMG79I/AAAAAAAAAJU/IaCUaQrEfFQ/s1600/IMG_0794.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="300" src="http://1.bp.blogspot.com/-rXmZoDeVApU/UEfaPSMG79I/AAAAAAAAAJU/IaCUaQrEfFQ/s400/IMG_0794.JPG" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-PrUCdN1LfU4/UEfaTpSj2CI/AAAAAAAAAJc/qp2dey7jGEk/s1600/IMG_0800.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="300" src="http://4.bp.blogspot.com/-PrUCdN1LfU4/UEfaTpSj2CI/AAAAAAAAAJc/qp2dey7jGEk/s400/IMG_0800.JPG" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-zVkIX8b-jvs/UEfaZD-VbrI/AAAAAAAAAJk/0prfYMtdSn8/s1600/IMG_0812.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="300" src="http://2.bp.blogspot.com/-zVkIX8b-jvs/UEfaZD-VbrI/AAAAAAAAAJk/0prfYMtdSn8/s400/IMG_0812.JPG" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-A93CC46b070/UEfboICEfCI/AAAAAAAAAJs/tmjmpLLmUi8/s1600/218376_4389276887622_1513303114_o.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="300" src="http://2.bp.blogspot.com/-A93CC46b070/UEfboICEfCI/AAAAAAAAAJs/tmjmpLLmUi8/s400/218376_4389276887622_1513303114_o.jpg" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-baMTJqvSKXs/UEfbo2JymPI/AAAAAAAAAJ0/BNOcZDSnS5I/s1600/255964_4389275527588_1164166533_o.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="300" src="http://4.bp.blogspot.com/-baMTJqvSKXs/UEfbo2JymPI/AAAAAAAAAJ0/BNOcZDSnS5I/s400/255964_4389275527588_1164166533_o.jpg" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-6j0esUD-CS0/UEfbpVRlJ-I/AAAAAAAAAJ8/McqmktL7lvM/s1600/416592_4389275007575_1651748413_o.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="300" src="http://1.bp.blogspot.com/-6j0esUD-CS0/UEfbpVRlJ-I/AAAAAAAAAJ8/McqmktL7lvM/s400/416592_4389275007575_1651748413_o.jpg" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-aCpwdEmEHng/UEfbqBFUvGI/AAAAAAAAAKE/NiBcvbU9_Zg/s1600/416681_4389274087552_1434443510_o.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="300" src="http://1.bp.blogspot.com/-aCpwdEmEHng/UEfbqBFUvGI/AAAAAAAAAKE/NiBcvbU9_Zg/s400/416681_4389274087552_1434443510_o.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-YWVDVHQmjzQ/UEfdE7JG0xI/AAAAAAAAAKM/U3lZYymBpgg/s1600/Paracel.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="290" src="http://2.bp.blogspot.com/-YWVDVHQmjzQ/UEfdE7JG0xI/AAAAAAAAAKM/U3lZYymBpgg/s400/Paracel.JPG" width="400" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
We did it 800 fit above the sea and we can see a new view of the island.<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
Anonymoushttp://www.blogger.com/profile/03241484392555987029noreply@blogger.com0tag:blogger.com,1999:blog-3554446977992091796.post-88188854530699303562012-09-05T15:30:00.000-07:002012-09-05T15:37:59.432-07:00Slop mathematically proof of the formula division of raise by runAs you might have probably knew that the formula to calculate a slope between two points (a line) is below:<br />
m = raise / run where raise = y2 - y1 and run = x2 - x1 like following picture:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://upload.wikimedia.org/wikipedia/commons/7/7d/Slope_picture.svg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://upload.wikimedia.org/wikipedia/commons/7/7d/Slope_picture.svg" /></a></div>
<br />
So have you wondered why we have to do it like that I mean<br />
raise divide by run and why not run divide by raise or why not raise multiply by run something like that so in short do we have any mathematically proof that we have to divide raise by run?<br />
The answer yes it has a mathematically proof in following link which usually if we just scan through it we probably miss the exact spot that it proof this division formula of the slope.<br />
Here is the link:<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<b><span style="color: red;">http://en.wikipedia.org/wiki/Slope</span></b><br />
<br />
Here is the exact spot to proof the division:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-N6AtxybhDzs/UEfRVpK_WjI/AAAAAAAAAII/tkVo1P9Rhcg/s1600/slop+proof.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="505" src="http://4.bp.blogspot.com/-N6AtxybhDzs/UEfRVpK_WjI/AAAAAAAAAII/tkVo1P9Rhcg/s640/slop+proof.png" width="640" /></a></div>
Click on the image to have a complete view:<br />
<br />
And as we observer the formula came up like that because slop = tan of Angle and as we have studied math in high school tan of Angle = Opposite divide by Adjacent where Opposite is the raise (y2 - y1) and Adjacent is the run (x2 - x1) so that is it.<br />
<br />
And finally to calculate the equation of y by x its formula is below:<br />
y = m*x + b where b is the constant from zero points to x and y or x1, y1 as we can say.<br />
<br />
So that is it.<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />Anonymoushttp://www.blogger.com/profile/03241484392555987029noreply@blogger.com0tag:blogger.com,1999:blog-3554446977992091796.post-61159835489803307312012-09-04T00:25:00.001-07:002012-09-04T00:29:42.838-07:00Tech Pics of the day-4th of September 2012<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.blogcdn.com/www.engadget.com/media/2012/09/bmwmouse.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://www.blogcdn.com/www.engadget.com/media/2012/09/bmwmouse.jpg" /></a></div>
100$ BMW gaming mouse with 5 programmable keys.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.blogcdn.com/www.engadget.com/media/2012/09/kisaizone.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://www.blogcdn.com/www.engadget.com/media/2012/09/kisaizone.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
Tokyoflash Kisai Zone watch tells time in hexagons <span style="background-color: white; color: #444444; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px;">introductory price of $99, which then jumps to $139</span><br />
<span style="background-color: white; color: #444444; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px;"><br /></span>
<span style="background-color: white; color: #444444; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px;">To be continued...</span>Anonymoushttp://www.blogger.com/profile/03241484392555987029noreply@blogger.com0tag:blogger.com,1999:blog-3554446977992091796.post-44438003253027645362012-09-04T00:10:00.001-07:002012-09-04T00:15:10.786-07:00I am waiting for Iphone 5 to be released around September 25th 2012I heard my friend said that the Iphone 5 is expecting to be announced around 10th of September 2012 and to be released to the market around 25th of September 2012 whereas Iphone 4's price is dropping sharply. Some of Iphone 4 users have had their iphone 4 sold on ebay.com and some auction sites already to await for the iphone 5.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://t3.gstatic.com/images?q=tbn:ANd9GcSLiAduxHolSd6CpPYjFFV5F_uO1eZaoTsmFOjGLlSH5MiQTnWbnA&t=1" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://t3.gstatic.com/images?q=tbn:ANd9GcSLiAduxHolSd6CpPYjFFV5F_uO1eZaoTsmFOjGLlSH5MiQTnWbnA&t=1" /></a></div>
<br />
<br />
<br />Anonymoushttp://www.blogger.com/profile/03241484392555987029noreply@blogger.com0tag:blogger.com,1999:blog-3554446977992091796.post-9812708966295675112012-09-04T00:01:00.001-07:002012-09-04T00:02:31.662-07:00All other smartphone devices have big screen so does Iphone 5 but not as big as others.Here is just graph toward what activities people are doing with their smartphone screen size:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://tctechcrunch2011.files.wordpress.com/2012/09/kantar-web.png?w=640" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://tctechcrunch2011.files.wordpress.com/2012/09/kantar-web.png?w=640" /></a></div>
<br />Anonymoushttp://www.blogger.com/profile/03241484392555987029noreply@blogger.com0