<?xml version="1.0" encoding="UTF-8"?><rss version="2.0">
<channel>
<title>programming</title>
<link>http://www.computersight.com/tags/programming</link>
<description>New posts about programming</description>
<item>
<title>How to Make an Analog Clock for Your Website</title>
<link>http://www.computersight.com/Programming/Java/How-to-Make-an-Analog-Clock-for-Your-Website.283309</link>
<description>
<![CDATA[<p>First you will need to make sure you have Java installed on your computer. If you don't you can download it from <a href="http://www.java.sun.com" target="_blank">http://www.java.sun.com</a>.</p>
<p>1.    Open a text editor. Any simple editor will work, Notepad, TextEdit, whatever. Just make sure when you save, to save it as Plain Text, not Rich Text Format. Save this file as "Clock.java" on your Desktop in a folder called "Clock".</p>
<p>2.    Let's set up an applet. For this tutorial, we will use a JApplet, from Java's Swing library. Type the following code into your text editor (new additions will appear in bold):<br /></p>
<blockquote>import javax.swing.JApplet;<br /></blockquote>
<blockquote>public class Clock extends JApplet {<br /></blockquote>
<p>public void init() {<br /><br /> }<br /> }</p>
<p><br />3.    That&amp;rsquo;s all we need to create a &amp;ldquo;bare bones&amp;rdquo; applet. The import statement at the top tells Java that we will need the JApplet class from the javax.swing library. The next line creates a new Class called Clock, which will be a JApplet (a program that is run within a browser window). The init() method is what the program will do when the program is started.<br /><br />Now let&amp;rsquo;s set this applet up with a Thread. A Thread is a way to perform a set of actions over and over without freezing the rest of the program (in this case, updating the time).<br /><br />import javax.swing.JApplet;<br />import java.awt.*;<br /><br />public class Clock extends JApplet implements Runnable {<br /> public void init() {<br /><br /> }<br /><br /> public void run() {<br /> while (true) {<br /> try {<br /> Thread.sleep(1000);<br /> } catch (Exception e) {<br /> }<br /> }<br /> }<br /> }<br /><br />4.    Let&amp;rsquo;s look at this code. First we imported the java.awt package (the .* extension tell the program to include all of the classes in the library). Next we added &amp;ldquo;implements Runnable&amp;rdquo; to the class declaration, which means that the class will be running a Thread.<br /><br />The next section is the run method. When a Thread is started, this method will be executed. Right now, our run method will loop until the program is exited (while true is equal to true) and each time through the loop it will pause the Thread for 1 second (1000 milliseconds).<br /><br />Now we should set up a Thread. I called my Thread &amp;ldquo;counter&amp;rdquo;, but you can name it whatever you want. These commands are fairly self-explanatory.<br /><br />import javax.swing.JApplet;<br />import java.awt.*;<br /><br />public class Clock extends JApplet implements Runnable {<br /> Thread counter = new Thread(this);<br /><br /> public void init() {<br />counter.start();<br /> }<br /><br /> public void run() {<br /> while (true) {<br /> try {<br /> Thread.sleep(1000);<br /> } catch (Exception e) {<br /> }<br /> }<br /> }<br /> }<br /><br />5.    Now we can get to the actual point of our program, to tell time. First we&amp;rsquo;ll get the GregorianCalendar class and use it to find out the current time in EST. I added variables to the program for hours, minutes, and seconds, to be stored as integers, which are called &amp;ldquo;int&amp;rdquo; in Java. Finally, in our while loop, we will add a long section to increment the time variables. If you don&amp;rsquo;t understand this section it&amp;rsquo;s OK for now.<br /><br />import javax.swing.JApplet;<br />import java.awt.*;<br />import java.util.*;<br /><br />public class Clock extends JApplet implements Runnable {<br /> int hours, minutes, seconds;<br /> Thread counter = new Thread(this);<br /><br /> public void init() {<br />Calendar calendar = new GregorianCalendar(TimeZone.getTimeZone("EST"));<br /> hours = calendar.get(Calendar.HOUR);<br /> minutes = calendar.get(Calendar.MINUTE);<br /> seconds = calendar.get(Calendar.SECOND);<br /> counter.start();<br /> }<br /><br /> public void run() {<br /> while (true) {<br /> if (seconds &amp;lt; 60)<br /> seconds++;<br /> else {<br /> seconds = 0;<br /> if (minutes &amp;lt; 60)<br /> minutes++;<br /> else {<br /> minutes = 0;<br /> if (hours &amp;lt; 12)<br /> hours++;<br /> else<br /> hours = 1;<br /> }<br /> }<br />repaint();<br />try {<br /> Thread.sleep(1000);<br /> } catch (Exception e) {<br /> }<br /> }<br /> }<br /> }<br />6.    Now we have our time program essentially all done. All that needs to be done now is to draw the clock itself. Go to the bottom of your text file and just above the final &amp;lsquo;}&amp;rsquo;, type in this code:<br /><br /> public void paint(Graphics g) {<br /> Graphics2D g2 = (Graphics2D) g;<br /> g2.setColor(Color.white);<br /> g2.fillRect(0, 0, getWidth(), getHeight());<br /> g2.setColor(Color.darkGray);<br /> g2.fillOval(0, 0, getWidth(), getHeight());<br /> g2.setColor(Color.black);<br /> for (int i = 1; i &amp;lt;= 12; i++) {<br /> g.drawString("" + i, getWidth() / 2 + (int)(Math.cos(i * (Math.PI / 6) - Math.PI / 2) * (getWidth() / 2 - 15)), getHeight() / 2 + (int)(Math.sin(i * (Math.PI / 6) - Math.PI / 2) * (getHeight() / 2 - 15)));<br /> }<br /> int radius = getWidth() / 2 - 10;<br /> double divideBy = (30 / Math.PI);<br /> g2.drawLine(getWidth() / 2 + (int)(Math.cos(seconds / divideBy - Math.PI / 2) * radius), getHeight() / 2 + (int)(Math.sin(seconds / divideBy - Math.PI / 2) * radius), getWidth() / 2, getHeight() / 2);<br /> BasicStroke stroke = new BasicStroke(4);<br /> g2.setStroke(stroke);<br /> radius = getWidth() / 2 - 50;<br /> g2.drawLine(getWidth() / 2 + (int)(Math.cos(minutes / divideBy - Math.PI / 2) * radius), getHeight() / 2 + (int)(Math.sin(minutes / divideBy - Math.PI / 2) * radius), getWidth() / 2, getHeight() / 2);<br /> stroke = new BasicStroke(8);<br /> g2.setStroke(stroke);<br /> divideBy = (6 / Math.PI);<br /> radius = getWidth() / 2 - 80;<br /> g2.drawLine(getWidth() / 2 + (int)(Math.cos(hours / divideBy - Math.PI / 2) * radius), getHeight() / 2 + (int)(Math.sin(hours / divideBy - Math.PI / 2) * radius), getWidth() / 2, getHeight() / 2);<br /> g2.fillOval(getWidth() / 2 - 10, getHeight() / 2 - 10, 20, 20);<br /> g2.drawOval(0, 0, getWidth(), getHeight());<br /> }</p>
<p>Now you need to compile the program. Open your command line (Command Prompt on Windows, Terminal on Mac).  Type "cd Desktop/Clock" and hit enter. Note, this is the Mac command; if you are using Windows, switch the '/' to a ''. Next type "javac Clock.java". If your code is copied correctly, it will just go back to prompting for input and there will be a new file in the folder called "Clock.class". Now upload this .class file to wherever your website is, and to embed it in one of your pages, use this code:</p>
<p>There you go. You have a clock applet for your site!</p><a href="http://www.pheedo.com/click.phdo?x=&u=http%3A%2F%2Fwww.computersight.com%2FProgramming%2FJava%2FHow-to-Make-an-Analog-Clock-for-Your-Website.283309"><img src="http://www.pheedo.com/img.phdo?x=&u=http%3A%2F%2Fwww.computersight.com%2FProgramming%2FJava%2FHow-to-Make-an-Analog-Clock-for-Your-Website.283309" border="0"/></a>]]></description>
<pubDate>Fri, 03 Oct 2008 16:14:45 PST</pubDate></item>
<item>
<title>Solidworks Tutorial: How to Draw Circle and Filleted Arc</title>
<link>http://www.computersight.com/Software/Solidworks-Tutorial-How-to-Draw-Circle-and-Filleted-Arc.255169</link>
<description>
<![CDATA[<p>In the first article of my tutorial set, I tought you how to draw linear objects. Those were simply lines and rectangular, that is, the main elements of drawing. In this article, I aim to teach you curves and the simplest closed curve, a circle.</p>
<h3>How to Draw a Circle<br /></h3>
<p>As a mathematical description, circle is a combination of points with the same length from a fixed point. To draw a circle, two things we need. They are the coordinate of center of the circle and radius or diameter of it. Let's now draw our first circle by Solidworks. Let's draw a circle with a center of origin and a radius of 20 mm.</p>
<ol>
<li>Click the sketch button to define a plane on which you will draw. Since our drawing is 2D, any plane can be chosen. I choose top plane as a reference plane.</li>
<li>Click the circle button on the toolbar and choose origin as the center point of the circle. Afterthat, drag the circle to the out of the page.</li>
<li>By clicking "smart dimension" button , dimension the radius of circle. Since the radius is 20 mm, specify diameter as 40 mm.</li>
</ol>
<p><img src="http://images.stanzapub.com/readers/2008/09/15/sw1_2.jpg" alt="" /></p>
<h3>How to Draw Filleted Arcs</h3>
<p>To draw filleted arcs, we first need a corner of two intersecting lines. As an example, we will filet one corner of 40x40 mm square. Lets first draw the square by using rectangular button on the toolbar.</p>
<p><img src="http://images.stanzapub.com/readers/2008/09/15/sw2_1.jpg" alt="" /></p>
<ol>
<li>Click the fillet button on the toolbar.</li>
<li>Enter the radius of fillet as 5 mm into the fillet parameters space.</li>
<li>Choose the corner point which you want to fillet. Be careful here, you should select the point not the sides you want to fillet. After that, Solidworks automatically dimension the filleted arc. Here is the result.</li>
</ol>
<p><img src="http://images.stanzapub.com/readers/2008/09/15/sw3_1.jpg" alt="" /></p>
<p><img src="http://images.stanzapub.com/readers/2008/09/15/sw1_1.jpg" alt="" /></p><a href="http://www.pheedo.com/click.phdo?x=&u=http%3A%2F%2Fwww.computersight.com%2FSoftware%2FSolidworks-Tutorial-How-to-Draw-Circle-and-Filleted-Arc.255169"><img src="http://www.pheedo.com/img.phdo?x=&u=http%3A%2F%2Fwww.computersight.com%2FSoftware%2FSolidworks-Tutorial-How-to-Draw-Circle-and-Filleted-Arc.255169" border="0"/></a>]]></description>
<pubDate>Tue, 16 Sep 2008 03:12:21 PST</pubDate></item>
<item>
<title>Why Solidworks?</title>
<link>http://www.computersight.com/Programming/Why-Solidworks.238675</link>
<description>
<![CDATA[<p>Today, engineers and engineering students use many software programs while designing new constructions, mechanisms and systems. Of all those software programs; Autocad, Solidworks, Unigraphics, Catia and Proengineering are the most popular and preferred programs. Autocad is usually used for 2D design. However, others are for 3D design. I've started using Solidworks after one year experience in Autocad. I realized that Autocad sometimes doesn't meet my requirements. I discovered Solidworks and what I would do with the assistance of this program.<br /><br />Why solidworks? Because it is very easy to use. Eveything is clear in Solidworks. If you know English and have a little computer knowledge and technical information, you can easily learn how to use Solidworks wtihout needing any additional source like books and tutorials. It is very easy to understand the fundementals of SW.<br /><br />Other plausible reason is that there are many Solidworks books in Bookstores. One can find many resources written in different languages. For me, it is easy to find such sources written both in English and my native language Turkish. Solidworks have been given as two-semester course in most of European and American universities. <br /><br />Designing starts with 2D in Solidworks. Above all, you should have a knowledge of drawing in 2D. You should be capable of making 2D sketches. You should be capable of forming the main 2D construction of solid systems. Rest is very simple because it goes on with simple extrusion, hole making, cutting, lofting and revolving processes.<br /><br />Another advantage of Solidworks is that it works well with all versions of Windows operating system. The last version,&amp;nbsp; SW 2008, is installed and worked on Vista after loading Service Pack of Vista. Without Service Pack, it doesn't run on your system.<br /><br />To learn how to use Solidworks and how to design systems or just making drawings for fun, follow my tutorial set. My next article will be about simple 3D drawings. In the next articles, you should learn how to draw cylinders, rectangular prisms and cubes with very different dimensions.<br /><br />In a nutshell, Solidworks is a good way to explain the things in your mind with simple lines and curves.</p><a href="http://www.pheedo.com/click.phdo?x=&u=http%3A%2F%2Fwww.computersight.com%2FProgramming%2FWhy-Solidworks.238675"><img src="http://www.pheedo.com/img.phdo?x=&u=http%3A%2F%2Fwww.computersight.com%2FProgramming%2FWhy-Solidworks.238675" border="0"/></a>]]></description>
<pubDate>Tue, 02 Sep 2008 09:54:10 PST</pubDate></item>
<item>
<title>Debug Buggy Computer Programs Without a Debugger</title>
<link>http://www.computersight.com/Programming/Debug-Buggy-Computer-Programs-Without-a-Debugger.235687</link>
<description>
<![CDATA[<p>I have been programming with C and C++ for over ten years now.  I have used debuggers, but I have always had the problem of not getting them to work.  I have learned how to debug without any debuggers.  That is what I am going to share in this article.</p>
<h3>What's a Bug?</h3>
<p>The first computer literally had a bug on the circuit board.  You know what today's computer bugs are right?  It's where your computer program is not working like it should.  Sometimes it crashes the computer program, or the results do not come out correctly.  Sometimes it's just a situation where it sometimes works right, but then sometimes messes up.  It's not literally a bug (That can happen though).  It's a result of some computer code not written correctly.</p>
<h3>Search And Locate</h3>
<p>The first thing to do is find where the problem is.  To do that we need feed back.  Just for example, I will talk like we are writing a console program.  In C and C++ we have printf, and also cout in libraries.  We can use one of those two functions to locate or problem.  Look at the following code example with comments.</p>
<p>int main(int argc,char** argv)//You do not need to understand engines to see my point.</p>
<p>{</p>
<p>while(EngineRunning())//do loop, while engine running.</p>
<p>{</p>
<p>RunEngine();//do engine runnning logic.</p>
<p>TurnPower();//alternator or generator.</p>
<p>UseFuel ();//Takes fuel to run an engine.</p>
<p>}</p>
<p>return 0;//leave with a good code.</p>
<p>}</p>
<p>This program crashes, and that is all the feed back I have right now.  So What I need to do is find the location of the crash.  Using cout I will locate the problem.  Take a look at the same source code, but with debugging symbols.</p>
<p>int main(int argc,char** argv)//You do not need to understand engines to see my point.</p>
<p>{</p>
<p>cout&amp;lt;&amp;lt;&amp;lt;"Program Started";</p>
<p>cout&amp;lt;&amp;lt;&amp;lt;"Enter While Loop";</p>
<p>while(EngineRunning())//do loop, while engine running.</p>
<p>{</p>
<p>cout&amp;lt;&amp;lt;&amp;lt;"While Loop Pass";</p>
<p>RunEngine();//do engine runnning logic.</p>
<p>cout&amp;lt;&amp;lt;&amp;lt;"After Run Engine";</p>
<p>TurnPower();//alternator or generator.</p>
<p>cout&amp;lt;&amp;lt;&amp;lt;"After Turn Power";</p>
<p>UseFuel ();//Takes fuel to run an engine.</p>
<p>cout&amp;lt;&amp;lt;&amp;lt;"After using fuel";</p>
<p>}</p>
<p>return 0;//leave with a good code.</p>
<p>}</p>
<p>The way this type of debugging works, is as the program advances in the code, it will print out information.  When the program crashes, all the output stops.  The output just before the error message, or the crash message, will show us the location of the problem.  Lets say the console output looked like the following;</p>
<p>Program Stated</p>
<p>Enter While Loop</p>
<p>While Loop Pass</p>
<p>After Run Engine</p>
<p>After Turn Power</p>
<p>Segment Fault:  Program terminated, core dump.</p>
<p>That tells me there is a problem with the "UseFuel()" function call.  I know that because UseFuel() comes right after "cout&amp;lt;&amp;lt;"After Turn Power";"  After printing that message the computer then crashes without another output.  That points to the location of the crash.</p>
<p>The next step that follows, is to debug the function "UseFuel()" like I did the main program.  The following code output shows the exact location, take a look:</p>
<p>void UseFuel()//gets fuel from the gas tank.</p>
<p>{</p>
<p>cout&amp;lt;&amp;lt;&amp;lt;"UseFuel() Entered";</p>
<p>FuelTank.fuel-=10;//take away 10 fuel units.  (gas hogg)</p>
<p>cout&amp;lt;&amp;lt;&amp;lt;"After fuel level down 10";</p>
<p>*Engine.fuelintake+=10;//it's a ten cylindor.</p>
<p>cout&amp;lt;&amp;lt;&amp;lt;"After Fuel given to engine";</p>
<p>cout&amp;lt;&amp;lt;&amp;lt;"Out Function UseFuel";</p>
<p>}</p>
<p>The output on the console with the new added debugging symbols would make the console look like this:</p>
<p>Program Stated</p>
<p>Enter While Loop</p>
<p>While Loop Pass One</p>
<p>After Run Engine</p>
<p>After Turn Power</p>
<p>UseFuel() Entered</p>
<p>After fuel level down 10</p>
<p>Segment Fault:  Program terminated, core dump.</p>
<p>That output tells me that the problem is the line *Engine.fuelintake+=10;.  The member fuelintake of *Engine is the bug.</p>
<h3>Examining The Data</h3>
<p>We know where the problem is, but we do not know why it crashes.  This part of the article will show you a way to find why the program crashes.  Let me explain what the fuelintake variable is.  It's a member of Engine that is an int*.  What I will do is check it's value, and because it's a pointer I will look at it's address.  See the source code:</p>
<p>void UseFuel()//gets fuel from the gas tank.</p>
<p>{</p>
<p>cout&amp;lt;&amp;lt;&amp;lt;"UseFuel() Entered";</p>
<p>FuelTank.fuel-=10;//take away 10 fuel units.  (gas hogg)</p>
<p>cout&amp;lt;&amp;lt;&amp;lt;"After fuel level down 10";</p>
<p>cout&amp;lt;&amp;lt;&amp;lt;"Address fuelintake == ("&amp;lt;&amp;lt;&amp;lt;")";//The Variable Watch.</p>
<p>cout&amp;lt;&amp;lt;&amp;lt;"Value holding == ("&amp;lt;&amp;lt;*Engine.fuelintake"&amp;lt;&amp;lt;")";//The Variable Watch.</p>
<p>*Engine.fuelintake+=10;//it's a ten cylindor.</p>
<p>cout&amp;lt;&amp;lt;&amp;lt;"After Fuel given to engine";</p>
<p>cout&amp;lt;&amp;lt;&amp;lt;"Out Function UseFuel";</p>
<p>}</p>
<p>The output on the console with the new added debugging symbols makes the console look like this:</p>
<p>Program Stated</p>
<p>Enter While Loop</p>
<p>While Loop Pass One</p>
<p>After Run Engine</p>
<p>After Turn Power</p>
<p>UseFuel() Entered</p>
<p>After fuel level down 10</p>
<p>0</p>
<p>Segment Fault:  Program terminated, core dump.</p>
<p>After looking at those variables I have found the problem.  The fuelintake pointer had an allocation error.  When the program did an allocation call, it gave the address zero (0).  That means NULL, and it's an allocation error code.  The pointer fuelintake is pointing at nothing, and to read or write at that address causes a segment fault, or access violation.  That is why it crashed just after checking the address with cout.</p>
<p>What I do after that is look at the allocation program, and also put in some error checking there.  The error checking should have been added there already, but for some reason I missed it.  This bug has made my program better. (Not a real program.)</p>
<h3>No More Bugs</h3>
<p>For a C or C++ console program I used cout or printf().  If I was programming with the Windows API I would have used MessageBox() to locate the problem, and get information about the variables.  Another example I will use is the allegro programming library, I use allegro_message() for my debugger.  What you use to locate and examine with depends on what your programming with.</p>
<p>Something that can be use other then console output, is buffer files.  It depends on the language, but you have to close the file right after writing your debug output.  Other wise you will end up with a empty file after the crash.</p>
<p>That shows you the general idea, I hope this article will help people out there with the debugging of their buggy software.</p><a href="http://www.pheedo.com/click.phdo?x=&u=http%3A%2F%2Fwww.computersight.com%2FProgramming%2FDebug-Buggy-Computer-Programs-Without-a-Debugger.235687"><img src="http://www.pheedo.com/img.phdo?x=&u=http%3A%2F%2Fwww.computersight.com%2FProgramming%2FDebug-Buggy-Computer-Programs-Without-a-Debugger.235687" border="0"/></a>]]></description>
<pubDate>Sun, 31 Aug 2008 04:52:36 PST</pubDate></item>
<item>
<title>Lets Learn C : Printing Strings on to the Screen</title>
<link>http://www.computersight.com/Programming/Lets-Learn-C--Printing-Strings-on-to-the-Screen.225265</link>
<description>
<![CDATA[<p>Here is the first article of my tutorial set. I aim to teach you the basics of C. In this first lesson, I am going to teach you how to output a series of strings on to terminal screen of C program.</p>
<p>Virtually every program code has inputs and outputs. Before compiling a source code, programs generally request an input from the user and then output it to the screen after compiling if the program is well designed and there is no error inside it. Usually, as the program becomes more complicated, error possibility increases. A good software expert easily realizes where the code has faults and corrects it. Since our first code will be very small and very simple, we will not face with any error.</p>
<p>Before starting to write code, we initially have a compiler which is going to evaluate our code. I use Dev C for this. There are many other compilers which run on different platforms like Unix, Linux and Windows.</p>
<p>In this project, we will output the names of  the subprograms of Triond on to C terminal screen. This is the simplest algorithm since there is no input in this example. Let's start writing our code step by step.</p>
<p>Step 1: Open the File from the menu bar of C software and save as the blank page Project1. This yields a file with an extension of cpp.</p>
<p>Step 2: Describe the name and aim of the programs. To do so, we use comments. Comments are ignored by the compiler. For commenting, we use some special scripts like double slash  or  slash-asterisk character .</p>
<p>If we use a single line comment, double slash is enough. However, if our comment is placed more than one line, we use double slash for each line or take the commented part between  slash-asterisk and asterisk-slash characters .</p>
<p>Step 3:  C needs library files which define what the input and output functions are and what they do when they are used in a code. Iostream is the library file of input and output function.</p>
<p>Before the name of library files, we use a special character,  preprocessor directive character. Include is used before the name of every library file and such file names are placed mathematical comparison characters.</p>
<p>Step 4:  Every C code uses functions. The default function is main. Main function is the first function compiled by the programs. This function usually calls other functions. Before the name of function, we specify which type of output our code returns. In our program, we think that it returns to integer and use int. After the function name, we use parantheses. In this example, there will be nothing between parantheses but in more complicated programs, there may be parameter names and it's types or definitions. We place our statements between left brace  and  right brace.</p>
<p>Step 5:  To print on to the screen,we use cout function. We simply place our string inside  double quote  characters. Every statement inside the functions ends with a special semicolon character.</p>
<p>Step 6:  To check the validity, we use return function.In this simple example, it returns to 0.</p>
<p><a href="http://clesson1.blogspot.com/" target="_blank">Click here for the code</a></p><a href="http://www.pheedo.com/click.phdo?x=&u=http%3A%2F%2Fwww.computersight.com%2FProgramming%2FLets-Learn-C--Printing-Strings-on-to-the-Screen.225265"><img src="http://www.pheedo.com/img.phdo?x=&u=http%3A%2F%2Fwww.computersight.com%2FProgramming%2FLets-Learn-C--Printing-Strings-on-to-the-Screen.225265" border="0"/></a>]]></description>
<pubDate>Sun, 24 Aug 2008 10:02:41 PST</pubDate></item>
<item>
<title>The Basics of Java Programming 2</title>
<link>http://www.computersight.com/Programming/Java/The-Basics-of-Java-Programming-2.221003</link>
<description>
<![CDATA[<h3><strong>Last Time...</strong></h3>
<p>Last time we covered the very basic syntax of a Java program and how to print text into a command-line box. Expanding on that this week, you will learn how to use variables which are a VERY important component to a program.</p>
<h3>Variables</h3>
<p>A variable is like a box. You are able to put different objects into a box, just like you can put different data into a variable. You can also change what is in the box at whatever time you want. This is just like a variable. It's data can be changed, even while the program is running.</p>
<p>So to be clear, a variable can hold a piece of data, and only one. If you wanted to store multiple bits of data, you would use an array. We will get to arrays later on, for now, know that variables store data and can be changed.</p>
<p>Now, onto the use of a variable. To declare a variable and set its value, you use the following syntax:</p>
<p><strong>public class Variables {<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static void main(String args[]){<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int thisIsMyVariable = 0;<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }<br />}</strong></p>
<p>This is how you declare an integer variable, which if you remember from the previous tutorial, is a number. To create a string variable, you replace "int" with "String". But be careful when using strings. You must remember to place the whole string in quotation marks or you will return an error.</p>
<p>Now that we have our variable, lets try displaying it in your command-line box:</p>
<p><strong>public class Variables {<br /> &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static void main(String args[]){<br /> &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int thisIsMyVariable = 0;<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(thisIsMyVariable);<br /> &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }<br /> }</strong></p>
<p>You will notice that you do not place quotation marks around the variable name when printing it, if you did, you would get a result of: "thisIsMyVariable" instead of the value the variable contains. Once you've tried this, change the value of the variable to any number you like. Don't make it too large though, try to keep it under 65,000.</p>
<p>As an extra excercise, try changing the datatype of the variable to a String and edit its value.</p>
<h3>Calculations<br /></h3>
<p>Once you've had a bit of a play with that, we can move onto calculations. We can use variables and mathematical signs to add, subtract, multiply and divide numbers. We can also use other symbols to assign values to variables and check for certain things. Here is a list of all the symbols and what they can be used for:</p>
<p>+ &amp;nbsp;&amp;nbsp; Used for adding two values together<br />-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Used for subtracting two values<br />*&amp;nbsp;&amp;nbsp;&amp;nbsp; Used for multiplying two values<br />/&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Used for dividing two values<br />=&amp;nbsp;&amp;nbsp;&amp;nbsp; Used for assigning a value<br />==&amp;nbsp; Used for checking if a value is equal to another value<br />&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Used for checking if a value is greater than another value<br />&amp;lt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Used for checking if a value is less than another value<br />&amp;gt;=&amp;nbsp; Used for checking if a value is greater than or equal to another value<br />&amp;lt;=&amp;nbsp; Used for checking if a value is less than or equal to another value<br />++&amp;nbsp; Used for adding 1 to a value<br />--&amp;nbsp;&amp;nbsp;&amp;nbsp; Used for subtracting 1 from a value</p>
<p>In this next example, I will demonstrate how these can be used in a program. Read through the code and try to follow what is happening:</p>
<p><strong>public class Variables {<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static void main(String args[]) {<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int var1 = 0;<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int var2 = 5;<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int var3 = 10;<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; <br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var1 = (var2 + var3) / var2 * 2;<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(var1);<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var1++;<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(var1);<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var2++;<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var3--;<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var1 = var2 * var3;</strong><strong>&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; <br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(var1);<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }<br />}</strong></p>
<p>I have used some random numbers and used a combination of symbols to do various calculations and print me the result as it goes. Have a go yourself and try changing around the numbers and calculations.</p>
<h3>Next time...</h3>
<p>Now that we've covered variables and performing calculations, we will move onto "if and then" statements, loops and using variables in a more complex and useful way. I hope you enjoyed learning more about Java. Check out the next tutorial for the next lesson.</p><a href="http://www.pheedo.com/click.phdo?x=&u=http%3A%2F%2Fwww.computersight.com%2FProgramming%2FJava%2FThe-Basics-of-Java-Programming-2.221003"><img src="http://www.pheedo.com/img.phdo?x=&u=http%3A%2F%2Fwww.computersight.com%2FProgramming%2FJava%2FThe-Basics-of-Java-Programming-2.221003" border="0"/></a>]]></description>
<pubDate>Thu, 21 Aug 2008 08:38:56 PST</pubDate></item>
<item>
<title>The Basics of Java Programming [1]</title>
<link>http://www.computersight.com/Programming/Java/The-Basics-of-Java-Programming-1.218103</link>
<description>
<![CDATA[<h3>Getting Started</h3>
<p>Before we begin, you are going to need a few things to work with Java. These are:</p>
<ul>
<li><a href="http://java.sun.com/javase/downloads/index.jsp" target="_blank">The Java Development Kit </a><br /></li>
<li><a href="http://www.eclipse.org/downloads/" target="_blank">A Java Integrated Development Environment</a><br /></li>
<li>A ready-to-learn attitude</li>
</ul>
<p>Okay, once you have all these things installed and setup, you can proceed into some java programming.</p>
<p>Note: Any words in italics is one which you should familiarise yourself with. I have included the definitions of these at the end.</p>
<h3>The Basics<strong><br /></strong></h3>
<p>Java is a very easy-to-use language and very user-friendly, especially if you have programmed in other languages before. If you haven't, don't stress, this tutorial will teach you step by step. To begin, lets go over the basic syntax of a java program.</p>
<p>Here is a simple program which prints "Hello World" into a command-line box:</p>
<p><strong>public class HelloWorld {<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static void main(String args[]) {<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println("Hello World");<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }</strong><strong><br />}</strong></p>
<p>Let's look at this step by step. The first line:</p>
<p><strong>public class HelloWorld {</strong></p>
<p>The word "public" refers to the level of access of the program. Public is used to allow other programs and classes to interact with it. "class" begins the definition for a class which we have named "HelloWorld". It isn't important right now to know all about classes, just know our class is created named HelloWorld and is signified by the curly bracket ("{" and "}"). These brackets define where a class, method, function etc begin and end. Lets move onto the next line:</p>
<p><strong>public static void main(String args[]) {</strong></p>
<p>Once again, "public" is used as an access level identifier. "static" methods are used for methods such as computing mathematical equations and other processing in which other objects aren't used. Don't worry yourself too much with this, all you need to know is we are going to use it in our programs. As your Java knowledge expands, you will understand more and more about these types of things. An important thing to know is that all Java programs must have a "main" method. This method is the entry point for your program and will be used to activate other methods required by your program. The main method accepts a single argument: An array of elements of datatype String. Each string in the array is called a command-line arugment which lets users affect the application without recompiling it. Again, do not worry too much about this, just know that this line of code is necessary for Java programs. The last line of code is what actually prints the text "Hello World":</p>
<p><strong>System.out.println("Hello World");</strong></p>
<p>This line of code uses the "System" class from the core library to display the text "Hello World", hence the "out.println" which basically means "Output and Print Line 'Hello World'". Any text within quotation marks (i.e. "Hello World") is a string and can contain letters, numbers and some symbols. You will notice the semi-colon after the bracket, this is tell the computer where that specific line of code ends. This is required after every line of code except those which end in a curly bracket or a few other exceptions which are unimportant for the time being.</p>
<p>Now that you know exactly what this code means, you can try it yourself. Open your IDE (hopefully Eclipse) and start a new java file. Type in or copy and paste the following code and try compiling and running your program.</p>
<p><strong>public class HelloWorld {<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static void main(String args[]) {<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println("Hello World");<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }<br /> }</strong></p>
<p><strong>NOTE: When saving the program, be sure to name it EXACTLY as you've named your class. Otherwise your program will not work. For my program, I would call it: "HelloWorld.java".</strong></p>
<p>Hopefully you receive a black command-line box with the text: "Hello World". If so, congratulations! You have just written your first Java program! My next tutorial will cover variables and simple mathematical operations. I hope you enjoyed learning about the Java language and see my next tutorial for more Java fun.</p>
<h3>Glossary</h3>
<p><strong>Java Development Kit (JDK):</strong> This is a necessary Java kit needed for compiling and running java programs.</p>
<p><strong>Integrated Development Environment (IDE):</strong> This is a text editor which usually has a compiler built into it, used for programming in Java and a range of other languages.</p>
<p><strong>Syntax:</strong> The syntax of a program is the basic "template" or "layout" it requires to understand what you're telling it to do.</p>
<p><strong>Public:</strong> Public refers to the level of access of that class, method etc.</p>
<p><strong>Method:</strong> A method is a set of grouped instructions which can be called to run at any time within the program.</p>
<p><strong>Function:</strong> A function is similar to a method but a function uses values you can send to it to return a different value after doing the appropriate processing or calculations.</p>
<p><strong>Datatype:</strong> Datatype is a word used to define variables etc as a certain type. i.e. A string has a text datatype and can accept letters, numbers and some symbols. An integer on the other hand, can only contain numbers.</p>
<p><strong>String: </strong>A datatype for text, see above.</p><a href="http://www.pheedo.com/click.phdo?x=&u=http%3A%2F%2Fwww.computersight.com%2FProgramming%2FJava%2FThe-Basics-of-Java-Programming-1.218103"><img src="http://www.pheedo.com/img.phdo?x=&u=http%3A%2F%2Fwww.computersight.com%2FProgramming%2FJava%2FThe-Basics-of-Java-Programming-1.218103" border="0"/></a>]]></description>
<pubDate>Wed, 20 Aug 2008 06:03:06 PST</pubDate></item>
<item>
<title>Prohibit Users From Accepting Data in VB and Vb.net</title>
<link>http://www.computersight.com/Programming/Visual-Basic/Prohibit-Users-From-Accepting-Data-in-VB-and-Vbnet.196517</link>
<description>
<![CDATA[<p>I have been developing software for quite sometime.  I got my start about fifteen years ago developing small applications for in house use.  If you are new to development, in house use means programs that are used within the company itself.</p>
<p><img src="http://images.stanzapub.com/readers/computersight/2008/08/05/251757_1.jpg" alt="" /></p>
<p>Once I got enough experience I was assigned to projects that were sold to clients around the world.  Through my many years of developing software one thing holds true and that is the end user &amp;ldquo;will&amp;rdquo; break your software.  Not because they do not know what they are doing and not because they are trying to break your software, and certainly not because you are a bad programmer, but because users will do things with software that make you scratch your head and go &amp;ldquo;huh?&amp;rdquo;</p>
<p>So a technique that I use that goes above just using simple error handling, like the &amp;ldquo;On Error&amp;rdquo; statement in Visual Basic or the &amp;ldquo;Try&amp;hellip;Catch&amp;rdquo; statement in VB.net.  What I like to do is limit the user's ability to actually enter any type of data or perform any type of actions before something else is completed first.</p>
<p>In my example here let's say the user clicks on a button.  This click then loads a window where the user will enter some data to add to the previous screen.</p>
<p>In a module file we declare the form variable as public:</p>
<p>Public frmEnterNewCarrier As New frmNewCarrier</p>
<p>In the button's click routine our .Net could would look like this:</p>
<p>frmEnterNewCarrier = New frmNewCarrier</p>
<p>frmEnterNewCarrier.ShowDialog()</p>
<p>The first line creates a new instance of the window object we are going to use then the second line then displays the window object as a dialog window which in previous versions of VB it used to be called modal.</p>
<p>Now that the window is on the screen in front of the user, the user has to enter some type of data into a textbox.  They also have the choice of clicking an &amp;ldquo;Ok&amp;rdquo; button to accept the data they enter then close the window, or click &amp;ldquo;Cancel&amp;rdquo; to close the window without doing anything.</p>
<p>When the screen loads the cancel button is always enabled.  However I disable the &amp;ldquo;Ok&amp;rdquo; button because there is no data entered.  Sure I could leave it enabled and allow the user to click it without entering anything but why put that extra check in there when you don't have to.</p>
<p>What I do is in the textbox's &amp;ldquo;KeyUp&amp;rdquo; event I enable the &amp;ldquo;Ok&amp;rdquo; button only if there is text in the textbox.  The line of code would look like this:</p>
<p>btnOK.Enabled = (txtNewCarrier.Text.Trim.Length &amp;gt; 0)</p>
<p>What this line says is to set the ok button's enable property to true if there is text in the textbox.  We check on the keyup event because it is the last key event that is executed which is exactly what we need.</p>
<p>You now have code that will prohibit the user from accepting non existent data.  I think it is a very nice check.  Give it a try and let me know what you think.</p><a href="http://www.pheedo.com/click.phdo?x=&u=http%3A%2F%2Fwww.computersight.com%2FProgramming%2FVisual-Basic%2FProhibit-Users-From-Accepting-Data-in-VB-and-Vbnet.196517"><img src="http://www.pheedo.com/img.phdo?x=&u=http%3A%2F%2Fwww.computersight.com%2FProgramming%2FVisual-Basic%2FProhibit-Users-From-Accepting-Data-in-VB-and-Vbnet.196517" border="0"/></a>]]></description>
<pubDate>Tue, 05 Aug 2008 09:02:05 PST</pubDate></item>
<item>
<title>UPL Dreams (Universal Programming Language)</title>
<link>http://www.computersight.com/Programming/UPL-Dreams-Universal-Programming-Language.193265</link>
<description>
<![CDATA[<p>Today there is uncountable number of programming languages. Some are useless and some is a must for any programmer. By time a compatibility problems arise. This leads to an idea of programming language for all programmers and all types of applications on all types of platforms. This idea proposed as Universal Programming Language (Upl).</p>
<p>Programming languages are the only way of communication between programmers and the computer. Each programming language has its own syntax and semantic. The syntax is the sentence structure. The semantic is the meaning of the sentence. Programmers should be able to read, write and manipulate such sentences in order to write a program.</p>
<p>A program is a set of sentences written in some programming language then compiled or interpreted to machine code, in order to be executed.</p>
<p>Upl aims to provide a perfect syntax and semantics. Which are easy to be understand by the programmers and powerful enough to produce high quality programs.</p>
<h3>Analysis</h3>
<p>"Universal":</p>
<p>Universal is an adjective for a noun that is a general for everything.</p>
<p>"Universal language":</p>
<p>Universal language is a language that is used by everyone in everywhere, as a general way of communication.</p>
<p>"Universal programming language":</p>
<p>Universal programming language is a programming language that is can be used by any programmer to write any kind of programs.</p>
<p>Programmers and the language itself:</p>
<p>English as "Universal language":</p>
<p>English is one of most spoken languages in the world. It can be found spoken and written everywhere. This vast spreading of English language makes a big problem for non English peoples. They want their languages to be universal ones. As example, French believe that their language is more powerful, elegant and flexible language and they are trying to make it a universal one.</p>
<p>English as "Universal programming language":</p>
<p>Most of programming languages are written in English characters with respect for English syntax and semantic. This makes programming languages more understandable by programmers.</p>
<p>A problem similar to the previous one has been arising. Programmers want to program in their mother tongue language. Moreover some freaks want to program in their own languages.</p>
<p>Programs that can be written by the language:</p>
<p>Universal programming language must be able to allow programmers to write any type of programs. It must produce system level, web services, real systems, phones, desktop, games, etc &amp;hellip;.</p>
<p>In fact there is no programming language that can do all of those programs. But there are many programming languages to do each type. C and C++ are most programming languages used for operating systems, system level programs and games. Java and Dot Net are both famous at desktop application level. Assembly is unbeatable at real system level. And so on.</p>
<p>Unfortunately, each programming language is designed for specific domains and ranges. Domains are the platforms and ranges are the applications types. So we can not use assembly to create web pages and we can not use html to produce real time systems.</p>
<p>Problems arise:</p>
<ul>
<li> Everybody wants to program in his suitable language</li>
<li> Each Programming language has a domain and a range</li>
</ul>
<p>Implementation:</p>
<p>By the time being there is one simple freaky implementation of the universal programming language. It is called upl_2. It is an enhanced version of upl_1 project. We will discus the original upl project before getting cross upl_2.</p>
<h3>Upl_1</h3>
<p>Latest release is upl_0.1.4 alpha</p>
<p>Available at <a href="http://upl.sourceforge.net" target="_blank">http://upl.sourceforge.net</a></p>
<h4>Definition</h4>
<p>&amp;nbsp;</p>
<p>Universal Programming Language is a platform that helps new comers and children to learn programming.</p>
<p>This platform helps to create programming languages for all languages and all purposes.</p>
<h4>Goals</h4>
<ul>
<li> provide a Multilanguage programming language</li>
<li> language for who do not speak English, non IT major students and school students </li>
</ul>
<h4>Work Method</h4>
<ul>
<li> Language engine load the language definition from language definition file</li>
<li> Language engine spread the language definition for the whole system</li>
<li> Programmer writes his code with respect to loaded language definition</li>
<li> Check engine checks the written code for any errors</li>
<li> Upl compiler will Convert upl language to java</li>
<li> Java compiler will Compile java files to byte code</li>
<li> Jar creator will pack the class files in a jar file </li>
</ul>
<p><img src="http://images.stanzapub.com/readers/computersight/2008/08/03/249373_0.jpg" alt="" /></p>
<h4>Advantages of UPL_1</h4>
<ul>
<li> Programmer can change the programming language keywords for his own keyword</li>
<li> Keywords can be written in any utf-8 supported languages. Such as Arabic, Hebrew, French, etc.</li>
<li> Easy syntax and semantic</li>
<li> Upl and it is output are operating system independent, written using java</li>
</ul>
<h4>Disadvantages of UPL_1</h4>
<ul>
<li> Programmer can not change syntax nor semantic</li>
<li> Output limited to simple desktop applications</li>
<li> Little features comparing to famous high level languages</li>
</ul>
<h4>Conclusion</h4>
<p>Upl_1 is a very promising project. It needs to add a more advanced language engine which allows changing of keywords syntax and semantic. Also more features should be copied from java by extending upl to java compiler. Finally, with more time and effort upl can override the entire disadvantages that it has, Except the application type limitation, where a new design should be adapted.</p>
<h3>Upl_2</h3>
<p>Upl_1 project design is very simple. This makes it difficult to use it for the new generation of upl project. A new replacement was proposed as upl_2. It is an enhanced version of upl_1. It promise to be more stable, powerful, flexible and with no disadvantages.</p>
<p>Upl_2 goal is to be the first complete universal programming language. It aims to fulfill the three main conditions. They are:</p>
<ul>
<li> Written by any language</li>
<li> Produce any application </li>
<li> Run on any platform</li>
</ul>
<h4>Analysis</h4>
<p>To achieve a correct analysis results we must analyze the three main conditions separately. Then make a connection between them.</p>
<h4>Condition 1 _ Any Language</h4>
<p>This part is held in the language engine. So the improvement should be in the language engine and the language definition file.</p>
<p>"Any language" can be divided to two types:</p>
<ol>
<li> Existing programming language</li>
<li> Customized programming language</li>
</ol>
<p>Language engine will deal with the second type. Since the first type can be handled by the available corresponding compilers and interpreters.</p>
<p>In order to deal with customized programming language we will need some tools and methods from the compilers topic such as parsers, lexical analyzers, etc.</p>
<p>There is uncountable number of possible customized programming language. It will be impossible to make a compiler for each language. Possible solution is to make a backbone programming language where any customized programming language must depend on it.</p>
<p>Dynamic parser can be used to create links between the backbone and the customized programming languages. Adding those links to the upl_1 language definition files will be the last step for creating the upl_2 language definition files. In the other side a Dynamic parser should be included in the language engine to work as translator between the backbone and the customized programming languages.</p>
<p>Possible scenario can be like this:</p>
<p>Parser1:	verb,sp+,Keyword,sp+,name,sp+,operand,sp+,value</p>
<p>cpl code1:	declare integer I = 0</p>
<p>Parser2:	verb,sp+,name,sp+,Keyword,sp+,operand,sp+,value</p>
<p>cpl code2:	put  I as int  equal 0</p>
<table border="1" cellpadding="0">
<tbody>
<tr>
<td>backbone language definition</td>
<td>customized language definition</td>
</tr>
<tr>
<td>put</td>
<td>Declare</td>
</tr>
<tr>
<td>Int</td>
<td>Integer</td>
</tr>
<tr>
<td>Equal</td>
<td>=</td>
</tr>
<tr>
<td>Space = { nt}
<p>&amp;nbsp;</p>
<p>Name !={!@#$%^&amp;amp;*()-+/[]{}?&amp;lt;&amp;gt;`'";:,.}</p>
<p>Value ={0-9}+{0{{.}1{}+}1}</p>
<p>Keyword = {as} keyword</p>
</td>
<td>Space = { nt}
<p>&amp;nbsp;</p>
<p>Name !={!@#$%^&amp;amp;*()-+/[]{}?&amp;lt;&amp;gt;`'";:,.}</p>
<p>Value ={0-9}+{0{{.}1{}+}1}</p>
<p>keyword = keyword</p>
</td>
</tr>
</tbody>
</table>
<p>Condition 2 _ any application:</p>
<p>A problem arise that there is no one programming language that can create all type of applications. But Upl_2 designers believe that it is not the end of the dreams.</p>
<p>An imaginary design was proposed as a solution for this problem. They summarized it in one phrase:</p>
<p>&amp;ldquo;If you cannot climb a mountain, still you can walk around it&amp;rdquo;.</p>
<p>Here goes the figure:</p>
<p><img src="http://images.stanzapub.com/readers/computersight/2008/08/03/249373_1.jpg" alt="" /></p>
<p>From the above figure, it is clear that upl engines will work as an intermediate level between the input and output codes. A possible scenario is as following:</p>
<ol>
<li> A code written by c++ in order to produce a java desktop application</li>
<li> Using upl engines, it will be converted to java code. After that the code generated will be used to create the application </li>
</ol>
<p>For such a dream it is a must that we link all available tools together. Let us assume the following condition:</p>
<ol>
<li> There exist a upl to java code convertor (ujc)</li>
<li> There exist a java to c++ code convertor (jcc)</li>
<li> There exist a c++ to c# code convertor (ccc) </li>
</ol>
<p>A programmer who knows how to write in upl code wants to develop a c# program. A life cycle for his code could be as following:</p>
<ol>
<li> Upl code to java (using ujc)</li>
<li> Java code to c++ (using jcc)</li>
<li> C++ code to C#   (using ccc)</li>
<li> The program code is in c# code</li>
</ol>
<p>Such scenario can be repeated in millions of different forms. Still all of them can be solved in the same way.</p>
<h4>Condition 3 _ Any Platform</h4>
<p>An interpreted language as java can be a convenient for this condition. Still most of programming languages are compiled ones. Different version of compilers and interpreters should be linked together in similar way as discussed in condition 2.</p>
<h3>Conclusion</h3>
<p>As the time goes, a lot of updates and enhancement will be add to the available programming language. Upl aim is to link all these programming languages together, which is almost impossible. From the proposed structures and designs, upl will face limitless obstacles. Those obstacles are belonging to time the ideas appear on, available technologies and most of all the desirable benefits will be gained from this project.</p>
<p>In the time being, making a Multilanguage programming language may be a good excuse for working on this project, where the target of the project are students and non it majored people. A more powerful designs and architectures should be proposed, if the project wanted to be continued in future as a real upl.</p><a href="http://www.pheedo.com/click.phdo?x=&u=http%3A%2F%2Fwww.computersight.com%2FProgramming%2FUPL-Dreams-Universal-Programming-Language.193265"><img src="http://www.pheedo.com/img.phdo?x=&u=http%3A%2F%2Fwww.computersight.com%2FProgramming%2FUPL-Dreams-Universal-Programming-Language.193265" border="0"/></a>]]></description>
<pubDate>Sun, 03 Aug 2008 03:20:40 PST</pubDate></item>
<item>
<title>Mac OS X: A Web Developer's Dream</title>
<link>http://www.computersight.com/Operating-Systems/Mac-OS/Mac-OS-X-A-Web-Developers-Dream.186115</link>
<description>
<![CDATA[<p>Web developers often shy away from Mac OS X, because they believe that it is very unsuitable in terms of web development; this is very untrue, and in this article I will talk about Mac OS X and web development, sorting out truth from fiction.</p>
<h3>Myth #1</h3>
<p>You can't do any real web development on Mac OS X, including server scripts such as PHP.</p>
<h4>The Truth</h4>
<p>You can do the same amount of web development on Mac OS X as you can on any Windows machine; in fact, I have found Mac OS X even easier to set up server scripts. Recently I decided to set up PHP on my Mac at home to find out that Mac OS X Leopard actually comes with Apache2 and PHP5 already installed onto it! All it takes is a few configuration steps to set up PHP5 to work on your computer.</p>
<h3>Myth #2</h3>
<p>It is much harder to set up the use of web development languages on Mac OS X than it is on Windows.</p>
<h4>The Truth</h4>
<p>I have actually found it easier to set up different web development languages on my Mac than on my friends Windows computer. A few days after I set up Apache2, PHP5 and MySQL on my Mac I helped a friend do it on his Windows computer. It took at least 3 more hours to get all of them installed on his computer than on mine, and even longer to get MySQL to work because the default configuration file for MySQL on Windows does not have everything needed for it to work.</p>
<h3>Myth #3</h3>
<p>You might be able to do web development on Mac, but you can't get much further than the things you can do with iWeb.</p>
<h4>The Truth</h4>
<p>You can do the same scripting on a Mac as you can do on a Windows machine. Saying that you are confined to iWeb is like saying you are confined to Frontpage on Windows.</p>
<p>There are many more myths regarding Mac OS X and web development, but I think that this will help some of you realize that Mac OS X is just as good for web development as Windows is. In the end, the scripting of languages is the same on both machines because the languages do not change depending on operating systems; the only difference I can find is setting up those scripting languages, which I have found to be much easier on Mac OS X than on Windows.</p><a href="http://www.pheedo.com/click.phdo?x=&u=http%3A%2F%2Fwww.computersight.com%2FOperating-Systems%2FMac-OS%2FMac-OS-X-A-Web-Developers-Dream.186115"><img src="http://www.pheedo.com/img.phdo?x=&u=http%3A%2F%2Fwww.computersight.com%2FOperating-Systems%2FMac-OS%2FMac-OS-X-A-Web-Developers-Dream.186115" border="0"/></a>]]></description>
<pubDate>Mon, 28 Jul 2008 06:16:49 PST</pubDate></item>
</channel>
</rss>
