<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MakeUseOf &#187; coding</title>
	<atom:link href="http://www.makeuseof.com/tags/coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.makeuseof.com</link>
	<description>Cool Websites, Software and Internet Tips</description>
	<lastBuildDate>Fri, 10 Feb 2012 15:30:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Retrovision: Enjoy The Old-School Demo Scene On Your Modern PC [Stuff to Watch]</title>
		<link>http://www.makeuseof.com/tag/retrovision-enjoy-oldschool-demo-scene-modern-pc-stuff-watch/</link>
		<comments>http://www.makeuseof.com/tag/retrovision-enjoy-oldschool-demo-scene-modern-pc-stuff-watch/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 22:30:40 +0000</pubDate>
		<dc:creator>Tim Brookes</dc:creator>
				<category><![CDATA[Movies]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[emulation]]></category>
		<category><![CDATA[media]]></category>
		<category><![CDATA[old-school]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[videos]]></category>

		<guid isPermaLink="false">http://www.makeuseof.com/?p=98569</guid>
		<description><![CDATA[The art of creating demos - non-interactive, animated digital bragging rights - has its roots within the cracking subculture of yore. Upon cracking a piece of software, pirates would often add their own intro or “crack screens” which initially were quite plain, eventually evolving into increasingly technical and impressive animations.]]></description>
			<content:encoded><![CDATA[<p><img class="align-right" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/09/stufftowatch_logo.png?323f2c" alt=""/>The art of creating demos &#8211; non-interactive, animated digital bragging rights &#8211; has its roots within the cracking subculture of yore. Upon cracking a piece of software, pirates would often add their own intro or “crack screens” which initially were quite plain, eventually evolving into increasingly technical and impressive animations.</p>
<p>The first crack screens were seen on <a href="http://www.makeuseof.com/tag/7-great-crossplatform-emulators-5-classic-computer-platforms/">the Apple II</a>, and before long groups started to release their demos individually, not just attached to cracked software. Thus, the demo scene was born and has pretty much run riot on every major computer (and console) platform since the 70s.</p>
<p>Thanks to the power of <a href="http://www.makeuseof.com/tags/emulation">emulation</a>, we can enjoy the incredible number of demos produced over the years on our shiny new PCs.</p>
<h2>A Brief History</h2>
<p>Simply put, demos (in this sense) are custom written animations designed to show off programming, modelling, music tracker and drawing skills.</p>
<p>The demoscene is still very much alive, with dedicated groups still regularly meeting up for demo parties and competitions; still celebrating a wide array of platforms to this day. This does of course mean modern creations designed to run on up to date hardware.</p>
<p style="text-align: center;"><iframe width="500" height="375" src="http://www.youtube.com/embed/F110_D9mv2M?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>Restrictions imposed on coders by hardware made up much of the challenge involved in the original demo scene. Some writers would even exploit known hardware errors in order to achieve effects that the system was never meant to deliver.</p>
<p>As these restrictions became a thing of the past (thanks to our speedy modern processors and bucket loads of RAM) many groups simply focused on creating beautiful, real-time artwork &#8211; something which divided the demo scene somewhat.</p>
<p><object width="512" height="404" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.demoscene.tv/mediaplayer.swf?id=3272_6270_14" /><param name="allowfullscreen" value="true" /><param name="pluginspage" value="http://www.macromedia.com/go/getflashplayer" /><embed width="512" height="404" type="application/x-shockwave-flash" src="http://www.demoscene.tv/mediaplayer.swf?id=3272_6270_14" allowfullscreen="true" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object></p>
<p>The traditional scene has lived on however, with many competitions insisting on PC demos of 64Kb or 4Kb (intros) in size and dedicated classes for classic demos from platforms like the Amiga, Atari ST and Commodore 64. Believe me when I say there are a lot of demos in existence, many probably sitting on old floppy disks waiting to be rediscovered.</p>
<h2>Emulation</h2>
<p>In order to enjoy these demos you’re going to be needing a handful of emulators (or Compatibility Mode for Windows demos). I’ve already run through a lot of <a href="http://www.makeuseof.com/tag/10-retro-emulators-play-early-80s-home-consoles-pc-19811986/">different emulators</a> for many of the classic systems featured here in <a href="http://www.makeuseof.com/tag/7-great-crossplatform-emulators-5-classic-computer-platforms/">this article</a>. For quick reference, here are a few you’ll probably want to hand:</p>
<p><strong><a href="http://www.makeuseof.com/tag/dos-computer-games-run-windows-7/">DOSBox</a></strong> (MS-DOS, PC) &#8211; Stupidly simple ready-to-go DOS emulation. simply mount a folder as your “C: drive” with the command ‘mount c: &lt;path&gt;’ and run the executables as you would any other DOS program. <a href="http://crest.untergrund.net/dosbox.html">Here</a> is a fairly detailed look at DOSBox and its use with demos.</p>
<p style="text-align: center;"><iframe width="500" height="375" src="http://www.youtube.com/embed/OLP-poYbfos?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p><strong>Commodore 64</strong> &#8211; There are a variety of emulators, with one of the best Windows emulators being <a href="http://www.hoxs64.net/">Hoxs64</a> but don’t miss <a href="http://frodo.cebix.net/">Frodo</a> if you’re rocking Linux, Mac or UNIX.</p>
<p><strong><a href="http://www.amigaemulator.org/">UAE</a></strong> (Commodore Amiga) &#8211; The only Amiga emulator you’ll ever need. Grab the Windows version at <a href="http://www.winuae.net/">WinUAE</a> and the Mac OS X version at <a href="http://sourceforge.net/projects/maxuae/">MaxUAE</a>. Don’t forget you’ll need a Kickstart ROM for Amiga emulation (Google is your friend here).</p>
<h2>Where To Find Demos</h2>
<p>Unfortunately a lot of websites that were once home to a bounty of demos have since disappeared and the domain squatters have moved in. Luckily there are still a few good resources for all your demo needs.</p>
<h3><a href="http://scene.org/">Scene.org</a></h3>
<p>Featuring a lot of Windows and DOS demos; Scene.org is an easy way to stay up to date with the latest and greatest releases from the demo scene. In addition to the Scene Awards which are held once a year, Scene.org still delivers news updates and a constantly expanding library of demos that are free to download.</p>
<p style="text-align: left;">The archives are huge, there’s a forum and plenty of info about parties and competitions.</p>
<p style="text-align: center;"><iframe width="500" height="281" src="http://www.youtube.com/embed/mxfmxi-boyo?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<h3><a href="http://www.pouet.net/">Pouet.net</a></h3>
<p>Probably an even larger archive than Scene.org, Pouet.net has the added bonus of being sorted and categorised exquisitely. This makes it an absolute cinch to find something particular, either by searching directly or choosing a demo size or platform to peruse.</p>
<p>There are demo files for everything from DOS to the Dreamcast and each demo is given a description, can be rated and often contains a link to an embedded video of the demo on YouTube or similar (should it exist).</p>
<p style="text-align: center;"><iframe width="500" height="375" src="http://www.youtube.com/embed/L-5etyrsg5k?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<h3><a href="http://ada.untergrund.net/">Amiga Demoscene Archive</a></h3>
<p>All your Amiga demo prayers answered in one tasty package. If Amiga demos are your thing then don’t forget to check out the <a href="http://amp.dascene.net/">Amiga Music Preservation</a> website which features thousands of MODs for <a href="http://www.makeuseof.com/tag/discover-chiptune-resources-tools-video-game-music/">chiptune fanatics</a>.</p>
<h3><a href="http://demoscene.tv/">Demoscene.tv</a></h3>
<p>It’s like YouTube but solely for demos. Lots of embedded videos for watching old (and new) demos in your browser, without the need for original hardware or an emulator.</p>
<p style="text-align: center;"><iframe width="500" height="375" src="http://www.youtube.com/embed/JbUmibsKstg?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<h3><a href="http://crest.untergrund.net/download.html">crest.untergrund.net</a></h3>
<p>A surprisingly good collection of outstanding demos from 1996 through to 2007. The site is mainly focused on DOS and Windows, but also features an interesting history, FAQ and other information about the demo scene.</p>
<h2>Conclusion</h2>
<p>I’ve scattered a few personal picks amongst the sea of links here to keep to the usual Stuff to Watch formula, but I’d really recommend you explore the demo scene and find your own favourites. There are so many creations out there that broke new ground, pushed hardware to new limits and have left a lasting impression on many computer users and they still deserve to be seen, shared and appreciated.</p>
<p>Do you have any favourite demos, groups or websites? Have you been to a demo party? Recommend and share links, demos and your thoughts in the box below.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.makeuseof.com/tag/retrovision-enjoy-oldschool-demo-scene-modern-pc-stuff-watch/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>3 Interactive, Fun, Free Ways To Start Learning The Ruby Programming Language</title>
		<link>http://www.makeuseof.com/tag/3-interactive-fun-free-ways-start-learning-ruby-programming-language/</link>
		<comments>http://www.makeuseof.com/tag/3-interactive-fun-free-ways-start-learning-ruby-programming-language/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 23:31:14 +0000</pubDate>
		<dc:creator>Erez Zukerman</dc:creator>
				<category><![CDATA[Web Apps & Internet]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[learn language]]></category>
		<category><![CDATA[learning]]></category>
		<category><![CDATA[programmer tools]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.makeuseof.com/?p=97460</guid>
		<description><![CDATA[Ruby is an expressive, very high-level, scripting language. It is used on the Web mainly as part of the Ruby on Rails web development framework, but also standalone. If you’re curious about what Ruby (not Ruby on Rails) feels like, you don’t necessarily need to pick up a book or go watch a screencast (although those are good ways to learn, too).]]></description>
			<content:encoded><![CDATA[<p><img class="align-right" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2012/01/ruby.jpg?323f2c" alt="ruby language" /><a href="http://www.ruby-lang.org/en/">Ruby</a> is an expressive, very high-level, scripting language. It is used on the Web mainly as part of the <a href="http://rubyonrails.org/">Ruby on Rails</a> web development framework, but also standalone. If you’re curious about what Ruby (not Ruby on Rails) feels like, you don’t necessarily need to pick up a book or go watch a screencast (although those are good ways to learn, too).</p>
<p>Below are three fun, simple ways in which you can try Ruby in your browser, right now, for free, without installing a single file.</p>
<h2>Rubymonk</h2>
<p><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2012/01/ruby3.jpg?323f2c" alt="ruby language" width="580" height="516" border="0" /></p>
<p>Hailing all the way from India, <a href="http://rubymonk.com/">Rubymonk</a> offers a series of over 50 short, interactive Ruby exercises and it saves your progress. Above is what I saw when I went back to Rubymonk after leaving the website (I solved the first couple of exercises).</p>
<p>Let’s look at what a single exercise looks like:</p>
<p><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2012/01/ruby5.jpg?323f2c" alt="ruby programming language" width="590" height="342" border="0" /></p>
<p>The exercise starts with a simple explanation, followed by a snippet of code. If you hit the Run button, the code is immediately evaluated and you get to see its output. Next, you get a simple assignment. Write the code you think is the right answer, and hit Ctrl+Enter to run it (or click the Run button). The Rubymonk now spits out an answer:</p>
<p><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2012/01/ruby7.jpg?323f2c" alt="ruby programming language" width="590" height="253" border="0" /></p>
<p>Once you finish working through some of the exercises, you will be presented with a problem to solve on your own:</p>
<p><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2012/01/image7.png?323f2c" alt="ruby programming language" width="580" height="248" border="0" /></p>
<p>You get an explanation of what you need to solve, some template code to get you started, and you’re on your own. This is great, because it’s much closer to actually coding than filling in one-liners in response to narrow questions.  If you get stuck, you can always click <em>“See the Solution”</em> and the solution will instantly appear in the text box.</p>
<p>Once you’re done with the first problem, you are transported to the table of contents, where you can pick and choose what you want to learn (and whether you want a lesson or a problem). Lessons look like this:</p>
<p><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2012/01/ruby9.jpg?323f2c" alt="ruby programming examples" width="590" height="237" border="0" /></p>
<p>And a problem looks like this:</p>
<p><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2012/01/ruby13.jpg?323f2c" alt="ruby programming examples" width="300" height="360" border="0" /></p>
<p>The tags are lessons which you should work through, in order to acquire the skills you need to solve the problem. The whole thing is very polished, and just generally fun to work with. Highly recommended.</p>
<h2>Ruby Koans</h2>
<p>The <a href="http://koans.heroku.com/">Ruby Koans</a> are hosted over at Heroku, and are even more steeped in mysticism that Rubymonk. Check it out:</p>
<p><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2012/01/ruby17.jpg?323f2c" alt="ruby programming examples" width="580" height="350" border="0" /></p>
<p>Say what you will, but this is definitely not boring. Fill in what you think is the right answer (trivial, in this case), and hit Enter. The snippet will be evaluated, and colored accordingly:</p>
<p><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2012/01/ruby19.jpg?323f2c" alt="ruby[19]" width="580" height="350" border="0" /></p>
<p>The Ruby Koans are a lot of fun, and they seem much more advanced than Rubymonk. They start off with asserts and testing, rather than arrays or other basic concepts. One small niggle is that your progress is not saved between koans, so you’d better bookmark where you stopped for the day. It’s not as AJAXy as Rubymonk, but I think it’s still great, and it’s a project that inspired many imitations, such as the <a href="https://github.com/liammclennan/JavaScript-Koans">JavaScript Koans</a>.</p>
<h2>Try Ruby</h2>
<p><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2012/01/ruby21.jpg?323f2c" alt="ruby[21]" width="590" height="194" border="0" /></p>
<p><a href="http://tryruby.org/">Try Ruby</a> was created as a tribute to <a href="http://www.rubyinside.com/media/poignant-guide.pdf">why&#8217;s (poignant) guide to ruby</a> (link to PDF), one of the craziest programming textbooks I have ever laid eyes on. It’s a great book for the Ruby language, and although the author no longer takes an active role in the Ruby community, I have a feeling he would have approved of the project. The website is built as a large ruby prompt, with instructions on the side:</p>
<p><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2012/01/ruby23.jpg?323f2c" alt="ruby language" width="590" height="268" border="0" /></p>
<p>The text is simple and playful (no mystical references here). You type real Ruby code in the prompt, and work through the simple exercises one by one. The whole thing doesn’t take very long.</p>
<h2>Final Thoughts</h2>
<p>Personally, I feel that learning by doing is one of the best ways to absorb new material. These may not make you into a code ninja, but they will definitely give you a feel for Ruby. If you’re curious about the language, pick the one you like best and take it for a spin! Let us know how it went in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.makeuseof.com/tag/3-interactive-fun-free-ways-start-learning-ruby-programming-language/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The 5 Best Websites To Learn Python Programming</title>
		<link>http://www.makeuseof.com/tag/5-websites-learn-python-programming/</link>
		<comments>http://www.makeuseof.com/tag/5-websites-learn-python-programming/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 21:31:10 +0000</pubDate>
		<dc:creator>Joel Lee</dc:creator>
				<category><![CDATA[Web Apps & Internet]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[learn language]]></category>
		<category><![CDATA[learning]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.makeuseof.com/?p=95195</guid>
		<description><![CDATA[Over the past decade, the Python programming language has exploded in popularity amongst programmers in all areas of coding. From web developers to video game designers to in-house tool creators, many people have fallen in love with the language. Why? Because it’s easy to learn, easy to use, and very powerful. If you’re looking to pick up Python, you’re in luck.]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/12/Python-Intro.png?323f2c" alt="learn to program python" />Over the past decade, the <a title="Python programming language" href="http://www.python.org">Python programming language</a> has exploded in popularity amongst programmers in all areas of coding. From web developers to video game designers to in-house tool creators, many people have fallen in love with the language. Why? Because it’s easy to learn, easy to use, and very powerful.</p>
<p>If you’re looking to pick up Python, you’re in luck. There are lots of web resources for learning the language, and many of them are entirely free. Here are some of the best ones. For optimal results, we recommend that you utilize ALL of these websites as they each have their own great aspects.</p>
<h2>#1 &#8211; <a href="http://openbookproject.net/thinkCSpy/">How To Think Like A Computer Scientist</a></h2>
<p><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/12/How-to-Think-Like-a-Computer-Scientist.png?323f2c" alt="learn to program python" width="404" height="385" /></p>
<p>The most notable aspect of this web Python tutorial series is that not only does it teach you how to use the Python programming language, but it teaches you how to think like programmers think. If this is the first time you’ve ever touched code, then <em>How to Think Like a Computer Scientist</em> will be an invaluable resource for you.</p>
<p>Keep in mind, however, that learning how to <em>think</em> like a computer scientist will require a complete shift in your mental paradigm. Grasping this shift will be easy for some and difficult for others, but as long as you persevere, it will eventually click. And once you&#8217;ve learned how to think like a computer scientist, you&#8217;ll be able to learn languages other than Python with ease!</p>
<h2>#2 &#8211; <a href="http://www.diveintopython.net/toc/index.html">Dive Into Python</a></h2>
<p><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/12/Dive-Into-Python.png?323f2c" alt="learn python" width="550" height="298" /></p>
<p>The <em>Dive Into Python</em> web tutorial series is awesome for those who have little or no experience with programming. The very first part of the tutorial walks you through the steps necessary to set up a Python interpreter on your computer, which can be very difficult for first timers.</p>
<p>There is one drawback to this website: it may try to dive in <em>too</em> quickly. As someone with Python experience under my belt, I can see how newbies might be intimidated by how quickly the author moves through the language. If you can keep up, then <em>Dive Into Python</em> will be a fantastic resource. If you can’t keep up, then visit some of the other websites in this list until you have a better grasp of the language, then come back and try this one again.</p>
<h2>#3 &#8211; <a href="http://docs.python.org/tutorial/">The Official Python Tutorial</a></h2>
<p><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/12/The-Python-Tutorial.png?323f2c" alt="learn python" width="545" height="354" /></p>
<p>What better place to learn Python than on the <em>official</em> Python website? The creators of the language itself have devised a large and helpful guide that will walk you through the basics of the language.</p>
<p>The best part of this web tutorial is that it moves slowly, drilling specific concepts into your head in more than one way to make sure that you understand them. The website formatting is simple and pleasing to the eye, which just makes the whole experience that much easier.</p>
<p>If you have a background in programming, the official Python tutorial may be too slow and boring for you. If you’re a brand newbie, you’ll likely find it to be an invaluable resource in your journey.</p>
<h2>#4 &#8211; <a href="http://www.trypython.org/">TryPython</a></h2>
<p><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/12/Try-Python.png?323f2c" alt="learn python" width="580" height="291" /></p>
<p>Unlike the previously listed Python tutorial sites, TryPython is great in that the website itself has a built-in Python interpreter. This means you can play around with Python coding <em>right on the website</em>, eliminating the need for you to muck around and install interpreters on your system.</p>
<p>Of course, you’ll need to install an interpreter eventually if you plan on getting serious with the language, but TryPython lets you <em>try python</em> before investing too much time in a language that you might end up not using. TryPython&#8217;s tutorial series incorporates the interpreter, allowing you to play around with the code in real-time, making changes and experimenting as you learn. This is the most hands-on Python tutorial you will find outside of a real life classroom.</p>
<p>TryPython requires <a href="http://www.microsoft.com/getsilverlight/">Microsoft Silverlight</a> to be installed for your browser.</p>
<h2>#5 &#8211; <a href="http://www.learnpython.org/">LearnPython</a></h2>
<p><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/12/Learn-Python.png?323f2c" alt="learn python programming" width="550" height="531" /></p>
<p>Like TryPython, LearnPython has a built-in interpreter right on the website as well as a tutorial series to go alongside of it. So what’s the difference between the two? Not a whole lot.</p>
<p>LearnPython is a little more basic, which means newbies will be able to keep up with the lessons and feel less intimidated by the material. And unlike TryPython, LearnPython includes programming exercises at the end of each lesson. These lessons serve to solidify the knowledge you gain and make sure that you truly understand what you’ve learned.</p>
<h2>BONUS &#8211; <a href="http://www.pygame.org/wiki/about">PyGame</a></h2>
<p><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/12/Pygame.png?323f2c" alt="learn to program python" width="550" height="152" /></p>
<p>For those of you who are learning Python to eventually create video games, this bonus resource will be extremely helpful to you. PyGame is a set of Python libraries that allows you to create graphical applications. Regular Python runs in a console window, which limits you to ASCII text. PyGame provides functionality for displaying images to the screen in a non-console window.</p>
<p>The best part? It’s just as easy to learn and easy to use as the Python language.</p>
<h2>Conclusion</h2>
<p>Though it has a relatively low learning curve, Python is a powerful language that can be utilized in multiple applications. Its popularity has been growing consistently over the past few years and there is no indication that the language will soon disappear. If you want to learn a highly versatile and powerful language, it’s never too late to give Python a shot.</p>
<p>Let us know in the comments what Python resources you use.</p>
<p><small>Image Credit: <a href="http://www.shutterstock.com/pic.mhtml?id=70728256" rel="nofollow">Shutterstock</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.makeuseof.com/tag/5-websites-learn-python-programming/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>How To Make Your Own Basic Internet Browser Using VBA</title>
		<link>http://www.makeuseof.com/tag/basic-internet-browser-vba/</link>
		<comments>http://www.makeuseof.com/tag/basic-internet-browser-vba/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 21:31:10 +0000</pubDate>
		<dc:creator>Ryan Dube</dc:creator>
				<category><![CDATA[How-To Articles]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[browsing tools]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[DIY]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[visual basic]]></category>

		<guid isPermaLink="false">http://www.makeuseof.com/?p=93685</guid>
		<description><![CDATA[When you really stop to think about it, an Internet browser in its simplest form isn't really that impressive an application. I mean, yes, the Internet is amazing by anyone's standards. The concept of linking so many of the world's computers and mobile devices within this massive network, that is epic. But the concept of transferring a text file with special code in it onto a computer screen is not really a big deal.]]></description>
			<content:encoded><![CDATA[<p><img class="align-right" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/12/webbrowser.jpg?323f2c" alt="make your own internet browser" />When you really stop to think about it, an Internet browser in its simplest form isn&#8217;t really that impressive an application. I mean, yes, the Internet is amazing by anyone&#8217;s standards. The concept of linking so many of the world&#8217;s computers and mobile devices within this massive network, that is epic. But the concept of transferring a text file with special code in it, and displaying that transferred text onto the computer screen &#8211; that&#8217;s really not a big deal.</p>
<p>In fact, thanks to the embedded references in applications that use VBA, you can input and output webpages via your own applications. If you&#8217;ve followed our past scripting articles, then you know we love VB script and VBA, like my article on <a href="http://www.makeuseof.com/tag/3-ways-open-applications-windows-maximized-vb-script/">maximizing windows</a>, Paul&#8217;s on <a href="http://www.makeuseof.com/tag/how-to-create-self-updating-excel-charts-in-three-easy-steps/">self-updating charts</a>, and Saikat&#8217;s on sending out <a href="http://www.makeuseof.com/tag/how-to-send-mass-emails-with-a-personal-touch-in-outlook/">mass emails</a>.</p>
<p>Using the approach below, you can use Word, Access or Excel to read HTML documents on the web, alter those documents, and then output whatever you want in a new browser window.</p>
<p>It may sound like something that only an experienced VBA programmer can do, but in this article I&#8217;m going to show you how you can do this yourself, starting with a basic procedure to output data from within your own application to a webpage.</p>
<h2>Enabling Microsoft Internet Controls</h2>
<p>The first step, no matter how you want to make use of the ability to input/output your own HTML via VBA, is to enable the Microsoft Internet Controls reference.</p>
<p>In Excel, you do this by clicking on the &#8220;<em>Developer</em>&#8221; menu item, clicking <em>Design Mode</em>, and then clicking on the &#8220;<em>View Code</em>&#8221; button. This may appear different in older versions of Excel, but essentially you need to find where you can launch the VBA code editor.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/12/vbabrowse1.png?323f2c" alt="make your own internet browser" width="532" height="142" /></p>
<p>In the VBA editor, click on <em>Tools</em>, and then <em>References</em>.</p>
<p style="text-align: center;"><img class="aligncenter" style="border-width: 1px; border-color: black; border-style: solid;" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/12/vbabrowse2.png?323f2c" alt="make an internet browser" width="535" height="266" /></p>
<p>In the References window, scroll all the way down until you see &#8220;<em>Microsoft Internet Controls</em>&#8220;. Check the box and then click &#8220;<em>OK</em>&#8220;.</p>
<p style="text-align: center;"><img class="aligncenter" style="border-width: 1px; border-color: black; border-style: solid;" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/12/vbabrowse3.png?323f2c" alt="make an internet browser" width="449" height="360" /></p>
<p>Now, within your VBA code, you will be able to create objects that can get information off the Internet, and you can output your own HTML documents that the user can view in their own browser.</p>
<h3>Inputting and Outputting HTML</h3>
<p>The first thing that you&#8217;ll want to accomplish here is outputting information to HTML. Think about how much you can do once you can output information to a perfectly formatted HTML webpage. You can extract data from your Excel spreadsheets and output them in a nicely formatted report.</p>
<p style="text-align: center;"><img class="aligncenter" style="border-width: 1px; border-color: black; border-style: solid;" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/12/vbabrowse4.png?323f2c" alt="make an internet browser" width="428" height="318" /></p>
<p>To create this feature, you&#8217;ll need to insert a command button on your sheet. Under the <em>Developer</em> menu, click on <em>Design Mode</em>, and then click the &#8220;<em>Insert</em>&#8221; button. You&#8217;ll see a dropdown of controls that you can add to your sheet.</p>
<p>In this case, click the button control and place it in your sheet. Make sure there&#8217;s some data in the sheet (or any sheet), that you want to output to a report when the button is clicked. Left click on the button to select it and click &#8220;<em>View Code</em>&#8220;.</p>
<p>Enter the following code:</p>
<pre>Sub Button1_Click()</pre>
<pre> Dim objIE As Object</pre>
<pre> Dim HTML As String</pre>
<pre> '----------The HTML CODE GOES FROM HERE AND DOWN----------</pre>
<pre> HTML = "&lt;HTML&gt;&lt;TITLE&gt;HTML Report Page&lt;/TITLE&gt;" &amp; _</pre>
<pre> "&lt;BODY&gt;&lt;FONT COLOR = BLUE&gt;&lt;FONT SIZE = 5&gt;" &amp; _</pre>
<pre> "&lt;B&gt;The Following Are Results From Your Daily Calculation&lt;/B&gt;" &amp; _</pre>
<pre> "&lt;/FONT SIZE&gt;&lt;P&gt;" &amp; _</pre>
<pre> "Daily Production: " &amp; Sheet1.Cells(1, 1) &amp; "&lt;p&gt;" &amp; _</pre>
<pre> "Daily Scrap: " &amp; Sheet1.Cells(1, 2) &amp; "&lt;p&gt;&lt;/BODY&gt;&lt;/HTML&gt;"</pre>
<pre> '----------The HTML CODE GOES HERE AND ABOVE---------</pre>
<pre> On Error GoTo error_handler</pre>
<pre> Set objIE = CreateObject("InternetExplorer.Application")</pre>
<pre> With objIE</pre>
<pre> .Navigate "about:blank"</pre>
<pre> Do While .Busy: DoEvents: Loop</pre>
<pre> Do While .ReadyState &lt;&gt; 4: DoEvents: Loop</pre>
<pre> .Visible = True</pre>
<pre> .Document.Write HTML</pre>
<pre> End With</pre>
<pre> Set objIE = Nothing</pre>
<pre> Exit Sub</pre>
<pre>error_handler:</pre>
<pre> MsgBox ("Unexpected Error, I'm quitting.")</pre>
<pre> objIE.Quit</pre>
<pre> Set objIE = Nothing</pre>
<pre>End Sub</pre>
<p>This code outputs the HTML that you&#8217;ve defined in that output string. As you can see from my example above, you can embed data from any sheet in Excel into your HTML string. Here is the resulting webpage report:</p>
<p style="text-align: center;"><img class="aligncenter" style="border-width: 1px; border-color: black; border-style: solid;" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/12/vbabrowse5.png?323f2c" alt="make your own internet browser" width="580" height="203" /></p>
<p>Now that you have HTML output working, the next step to make your VBA script work virtually like a web browser is to read in HTML from some website, manipulate the data, and then output it into an HTML output page.</p>
<pre>Sub Button1_Click()</pre>
<pre> Dim objIE As Object</pre>
<pre> Dim HTML As String</pre>
<pre> On Error GoTo error_handler</pre>
<pre> Set objIE = CreateObject("InternetExplorer.Application")</pre>
<pre> With objIE</pre>
<pre> .Navigate "http://www.google.com"</pre>
<pre> Do While .Busy: DoEvents: Loop</pre>
<pre> Do While .ReadyState &lt;&gt; 4: DoEvents: Loop</pre>
<pre> .Visible = True</pre>
<pre> HTML = objIE.Document.Body.innerHTML</pre>
<pre> .Document.Write "&lt;html&gt;&lt;title&gt;My Own Google Results!&lt;/title&gt;&lt;body&gt;&lt;h1&gt;This is an Edited Version of the Google Page!&lt;/h1&gt;" &amp; HTML &amp; "&lt;/body&gt;&lt;/html&gt;"</pre>
<pre> End With</pre>
<pre> Set objIE = Nothing</pre>
<pre>Exit Sub</pre>
<pre>error_handler:</pre>
<pre> MsgBox ("Unexpected Error, I'm quitting.")</pre>
<pre> objIE.Quit</pre>
<pre> Set objIE = Nothing</pre>
<pre>End Sub</pre>
<p>What I&#8217;ve done here is used the IE object to read HTML from Google into a text variable in VBA called HTML. I then placed my own HTML output text in the top of the page, and then outputted the same HTML to the VBA HTML output. This is what that looks like:</p>
<p style="text-align: center;"><img class="aligncenter" style="border-width: 1px; border-color: black; border-style: solid;" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/12/vbabrowse6.png?323f2c" alt="" width="503" height="351" /></p>
<p>This is a very basic example of what this is capable of. But if you think about it, once you have the HTML from a webpage loaded into your VBA string variable, you can search for specific lines in the page, look for images, search out email addresses of phone numbers &#8211; or you could rewrite the entire input page into a new, edited version of the same page in whatever format you like and with any modifications you like.</p>
<p>Doing this would require a bit of string manipulation prowess &#8211; but nothing is impossible once you&#8217;ve read in the HTML source from the web.</p>
<p>Do you see any potential for using either HTML input or output in your own applications? Can you think of any cool uses for this script? Share your thoughts in the comments section below.</p>
<p><small>Image credit: <a href="http://image.shutterstock.com/display_pic_with_logo/172762/172762,1245276291,1/stock-photo-www-and-web-browser-in-blue-tone-32231746.jpg" rel="nofollow">Shutterstock</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.makeuseof.com/tag/basic-internet-browser-vba/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Arduino Programming For Beginners: The Traffic Light Controller</title>
		<link>http://www.makeuseof.com/tag/arduino-traffic-light-controller/</link>
		<comments>http://www.makeuseof.com/tag/arduino-traffic-light-controller/#comments</comments>
		<pubDate>Wed, 07 Dec 2011 19:01:44 +0000</pubDate>
		<dc:creator>James Bruce</dc:creator>
				<category><![CDATA[Hardware & Gadgets]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.makeuseof.com/?p=93070</guid>
		<description><![CDATA[Last week, we learnt about the basic structure of an Arduino program and took a closer look at the 'blink' example. Hopefully you took the opportunity to experiment with code, adjusting the timings. This time, we'll be writing something from scratch. In fact, let's make a traffic light.]]></description>
			<content:encoded><![CDATA[<p><img class="align-right" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/11/featured-arduino.jpg?323f2c" alt="traffic light controller" />Last week, we learnt about the basic structure of an Arduino program and took a closer look at the &#8216;blink&#8217; example. Hopefully you took the opportunity to experiment with code, adjusting the timings. This time, we&#8217;ll be writing something from scratch. In fact, let&#8217;s make a traffic light.</p>
<p>Apart from the basic Arduino, you&#8217;ll need:</p>
<ul>
<li>A red, yellow and green LED.</li>
<li>A breadboard.</li>
<li>3 x suitable resistors for the LEDs you have ( probably 220 Ohms is fine).</li>
<li>Connecting wires.</li>
<li>A pushbutton switch.</li>
<li>A high value resistor (10k).</li>
</ul>
<p><strong>Note</strong>: This is the latest in a series of beginner level tutorials for <a href="http://www.makeuseof.com/tags/arduino">Arduino</a>, the open source electronics prototyping platform. Here&#8217;s a list of the previous articles in the series:</p>
<ul>
<li><a title="What Is Arduino &amp; What Can You Do With It? [Technology Explained]" href="http://www.makeuseof.com/tag/arduino-technology-explained/">What Is Arduino &amp; What Can You Do With It</a>?</li>
<li><a title="What’s Included In An Arduino Starter Kit? [MakeUseOf Explains]" href="http://www.makeuseof.com/tag/whats-included-arduino-starter-kit-makeuseof-explains/">What Is An Arduino Starter Kit &amp; What Does It Contain?</a></li>
<li><a href="http://www.makeuseof.com/tag/8-cool-components-arduino-projects/">More Cool Components To Buy With Your Starter Kit</a></li>
<li><a href="http://www.makeuseof.com/tag/started-arduino-starter-kit-installing-drivers-setting-board-port/">Getting Started With Your Arduino Starter Kit – Installing Drivers &amp; Setting Up The Board &amp; Port</a></li>
<li><a href="http://www.makeuseof.com/?p=92432">A Closer Look At The Structure Of An Arduino App &amp; The Example Blink Program</a></li>
</ul>
<p>You may also want to download and install <a href="http://www.makeuseof.com/tag/fritzing-ultimate-tool-sketching-electronics-projects-cross-platform/">Fritzing</a>, the tool I used to draw the wiring diagrams for these projects.</p>
<h2>Wiring</h2>
<p>Here&#8217;s a quick schematic I made up in Fritzing. It&#8217;s very simple &#8211; just the three LEDs wired with resistors to three separate input pins, and all connected to the ground.</p>
<p><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/11/traffic-light-basic.png?323f2c" alt="traffic light controller" width="416" height="553" /></p>
<h2>Programming</h2>
<p>We&#8217;ll start by defining variables so that we can address the lights by name rather than a number. Start a new Arduino project, and begin with these lines:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">int</span> red <span style="color: #339933;">=</span> <span style="color: #0000dd;">13</span><span style="color: #339933;">;</span>
<span style="color: #993333;">int</span> yellow <span style="color: #339933;">=</span> <span style="color: #0000dd;">12</span><span style="color: #339933;">;</span>
<span style="color: #993333;">int</span> green <span style="color: #339933;">=</span> <span style="color: #0000dd;">11</span><span style="color: #339933;">;</span></pre></div></div>

<p>Next, let&#8217;s add the setup function, where&#8217;ll we define the red, yellow and green LEDs to be output mode. Since we&#8217;ve created variables to represent the pin numbers, we can now refer to the pins by names instead.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">void</span> setup<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
pinMode<span style="color: #009900;">&#40;</span>red<span style="color: #339933;">,</span>OUTPUT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
pinMode<span style="color: #009900;">&#40;</span>yellow<span style="color: #339933;">,</span>OUTPUT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
pinMode<span style="color: #009900;">&#40;</span>green<span style="color: #339933;">,</span>OUTPUT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>That was easy. Now for the difficult part &#8211; the actual logic of a traffic light. I&#8217;m going to create a separate function for changing the lights, and you&#8217;ll see why later.</p>
<p>When you first begin programming, the code itself is very rudimentary &#8211; it&#8217;s figuring out the minute logic details that presents the biggest problem. The key to being a good programmer is to be able to look at any process, and break it down into its fundamental steps.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">void</span> loop<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
changeLights<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
delay<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">15000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> changeLights<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">// green off, yellow for 3 seconds</span>
digitalWrite<span style="color: #009900;">&#40;</span>green<span style="color: #339933;">,</span>HIGH<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
digitalWrite<span style="color: #009900;">&#40;</span>yellow<span style="color: #339933;">,</span>LOW<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
delay<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">3000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// turn off yellow, then turn red on for 5 seconds</span>
digitalWrite<span style="color: #009900;">&#40;</span>yellow<span style="color: #339933;">,</span>LOW<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
digitalWrite<span style="color: #009900;">&#40;</span>red<span style="color: #339933;">,</span>HIGH<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
delay<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">5000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// red and yellow on for 2 seconds (red is already on though)</span>
digitalWrite<span style="color: #009900;">&#40;</span>yellow<span style="color: #339933;">,</span>HIGH<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
delay<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">2000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// turn off red and yellow, then turn on green</span>
digitalWrite<span style="color: #009900;">&#40;</span>yellow<span style="color: #339933;">,</span>LOW<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
digitalWrite<span style="color: #009900;">&#40;</span>red<span style="color: #339933;">,</span>LOW<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
digitalWrite<span style="color: #009900;">&#40;</span>green<span style="color: #339933;">,</span>HIGH<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Done! Now, upload and run. You should have a working traffic light that changes every 15 seconds. However, I think it&#8217;s a little basic right now, so let&#8217;s add in a pushbutton for pedestrians to change the light whenever they like. Refer to the updated circuit diagram below:</p>
<p><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/11/traffic-light-with-switch.png?323f2c" alt="traffic light controller" width="550" height="674" /></p>
<p>You&#8217;ll notice that the switch has a high-impedance 10k resistor attached to it, and may be wondering why. This is called a pull down resistor. It&#8217;s a difficult concept to grasp at first, but bear with me.</p>
<p>A switch either lets the current flow, or doesn&#8217;t. This seems simple enough, but in a logic circuit, the current should be always flowing in either a high or low state (remember &#8211; 0 or 1, high or low). You might assume that a pushbutton switch that isn&#8217;t actually being pushed would be defined as being in a low state, but in fact it&#8217;s said to be &#8216;floating&#8217;, because no current is being drawn at all.</p>
<p>In this floating state, it&#8217;s possible that a false reading will occur as it fluctuates with electrical interference. In other words, a floating switch is giving neither a reliable high, nor low state reading. A pull down resistor keeps a small amount of current flowing when the switch is closed, thereby ensuring an accurate low state reading. In other logic circuits, you may find a pull-up resistor instead &#8211; this works on the same principle, but in reverse, making sure that particular logic gate defaults to high.</p>
<p>Now, in the loop part of the code, instead of changing the lights every 15 seconds, we&#8217;re going to read the state of the pushbutton switch instead, and only change the lights when it&#8217;s activated.</p>
<p>Start by adding some new variables to the start of the app:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">int</span> button <span style="color: #339933;">=</span> <span style="color: #0000dd;">2</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// switch is on pin 2</span>
<span style="color: #993333;">int</span> buttonValue <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// switch defaults to 0 or LOW</span></pre></div></div>

<p>Now, in the setup function, add a new line to declare the switch as an input. I&#8217;ve also added a single line to start the traffic lights in the green stage. Without this initial setting, they would be turned off, until the first time a changeLights() was initiated using a function.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">pinMode<span style="color: #009900;">&#40;</span><span style="color: #b1b100;">switch</span><span style="color: #339933;">,</span>INPUT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
digitalWrite<span style="color: #009900;">&#40;</span>green<span style="color: #339933;">,</span>HIGH<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Change the entire loop function to the following instead:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">void</span> loop<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">// read the value of the switch</span>
switchValue <span style="color: #339933;">=</span> digitalRead<span style="color: #009900;">&#40;</span>button<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// if the switch is HIGH, ie. pushed down - change the lights!</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>buttonValue <span style="color: #339933;">==</span> HIGH<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
changeLights<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
delay<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">15000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// wait for 15 seconds</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>That should do it. By waiting inside the &#8220;if&#8221; statement for 15 seconds, we ensure the traffic lights can&#8217;t change for at least that duration. Once 15 seconds is up, the loop restarts. Each restart of the loop, we will read the state of the button again, but if it isn&#8217;t pressed then the &#8220;if&#8221; statement never activates, the lights never change, and it simply restarts again.</p>
<p>That&#8217;s it for this time, so I hope you learnt lots and had fun writing from scratch. You got your hands dirty with a few LEDs and resistors, as well as adding a switch with a pull down resistor &#8211; hopefully you understood why we need one. Play around with the code, adjust it, and most importantly have fun. If you make any additions or changes, why not let us know about it in the comments?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.makeuseof.com/tag/arduino-traffic-light-controller/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>2 Websites &amp; 2 Apps That Can Help When Learning Java Programming</title>
		<link>http://www.makeuseof.com/tag/2-websites-2-applications-learning-java-programming/</link>
		<comments>http://www.makeuseof.com/tag/2-websites-2-applications-learning-java-programming/#comments</comments>
		<pubDate>Sat, 26 Nov 2011 09:31:25 +0000</pubDate>
		<dc:creator>Danny Stieben</dc:creator>
				<category><![CDATA[Cool Software Apps]]></category>
		<category><![CDATA[Web Apps & Internet]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[learn language]]></category>
		<category><![CDATA[learning]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.makeuseof.com/?p=92605</guid>
		<description><![CDATA[There are plenty of people I know who'd like to know how to program, yet they're confused by how to start and what the general ideas of programming are. In addition, there are a large number of programming languages to choose from, so choosing the right one to start out with may be a little difficult for the inexperienced programmer. This article will help you get started with a relatively easy to learn language.]]></description>
			<content:encoded><![CDATA[<p><img class="align-right" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/10/java_logo.jpg?323f2c" alt="learn java programming" />There are plenty of people I know who&#8217;d like to know how to program, yet they&#8217;re confused by how to start and what the general ideas of programming are. In addition, there are a <a href="http://www.makeuseof.com/tag/programming-language-learn-software-development/">large number of programming languages</a> to choose from, so choosing the right one to start out with may be a little difficult for the inexperienced programmer. This article will help you get started with a relatively easy to learn language.</p>
<h2>Why Learn Java Programming?</h2>
<p><a href="http://www.makeuseof.com/tags/java/">Java</a> is my programming language of choice when trying to learn the concepts of programming. This is because Java is very cross-platform, has a fairly readable syntax (compared to other languages), and there are many tools that can make developing in Java a fairly easy task. Before we begin, make sure that you have the <a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">JDK</a> installed, as you won&#8217;t be able to do a thing without it.</p>
<h2>Parts Of Java</h2>
<p>Java programs are separated into classes. Technically each class is its own program, but you can work with numerous classes to make a larger, more complex program while maintaining good code organization. At least one of those classes needs to be the main class, or contain a main method. A method is a chunk of code that executes when you simply call the name of the method. The main method is required as Java looks for this method to start the program. You can pass parameters to other methods if you&#8217;d like, allowing the method to take input and do something with it.</p>
<h3>Variables</h3>
<p>More than likely you&#8217;ll also need to store information at certain points. These are variables, or sometimes called fields, that hold the information. You have to specify the type of variable so that Java knows what you&#8217;re trying to hold. This includes things like true/false (boolean), numbers (int, long, double, etc.), and much more. As Java can support object-oriented programming, you can even hold instances of a class in a variable.</p>
<h3>Example</h3>
<p>As an example, here is a class that would simply print out the number 6 onto the screen:</p>
<pre>public class makeuseof
{
public static void main (String args[])
{
int myNum = 6;
System.out.println(myNum);
}
}</pre>
<h2>2 Recommended Applications</h2>
<p>There are two applications I would recommend that will help you during your programming adventures.</p>
<h3>Greenfoot</h3>
<p><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/06/greenfoot_running.jpg?323f2c" alt="" width="580" height="412" /></p>
<p><a href="http://www.makeuseof.com/tag/learn-write-programs-java-greenfoot/">Greenfoot</a> is a very fun way to get the hang of programming, as you can see any changes you make to the code in a video game setting. Additionally, there is a great community that can give help, ideas, and much more. So if you want a visual programming experience, Greenfoot is a great way to get started.</p>
<h3>Geany</h3>
<p><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/04/geany_open.jpg?323f2c" alt="learning about java programming" width="572" height="502" /></p>
<p>For those who want to have a good enough editor to do the nitty gritty programming, I recommend using <a href="http://www.makeuseof.com/tag/geany-great-lightweight-code-editor-linux/">Geany</a>. It is available for all operating systems, is relatively lightweight, and simply gets the job done. There are indeed <em>lots</em> of other editors that people can choose from, and they&#8217;re welcome to use those instead, but my recommendation stays with Geany.</p>
<h2>2 Recommended Websites</h2>
<p>There are a couple of websites that can help you out if this introduction didn&#8217;t make much sense.</p>
<p><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/11/javanotes_content.jpg?323f2c" alt="learning about java programming" width="580" height="416" /></p>
<p>First is &#8220;<a href="http://math.hws.edu/javanotes/">Javanotes 6.0</a>&#8221; which provides a much more lengthy but complete explanation of basic Java programming concepts. Here you&#8217;ll find loads of information and some programming exercises. If you have the time for it, it&#8217;s a great read.</p>
<p><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/11/howstuffworks_java.jpg?323f2c" alt="learn java programming" width="580" height="433" /></p>
<p>Lastly, you can also check out <a href="http://computer.howstuffworks.com/program.htm">HowStuffWorks&#8217; page</a> on Java. It also includes some information and guides you to making your first program. This is another interesting read, and involves a different first problem than the traditional &#8220;Hello World&#8221; example.</p>
<h2>Conclusion</h2>
<p>Getting started with Java isn&#8217;t as hard as it seems. With some time and practice you&#8217;ll get the hang of it, and from there you can build more complex programs that provides more functionality. Additionally, if you master the programming concepts, it&#8217;ll be easier to learn other programming languages as a large portion of the learning process is simply different syntax.</p>
<p>Let us know what your Java apps and tools are in the comments below.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.makeuseof.com/tag/2-websites-2-applications-learning-java-programming/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>How To Edit Thousands of WordPress Posts With Just One SQL Command</title>
		<link>http://www.makeuseof.com/tag/edit-thousands-wordpress-posts-sql-command/</link>
		<comments>http://www.makeuseof.com/tag/edit-thousands-wordpress-posts-sql-command/#comments</comments>
		<pubDate>Fri, 25 Nov 2011 16:01:09 +0000</pubDate>
		<dc:creator>Ryan Dube</dc:creator>
				<category><![CDATA[Wordpress & Blogging]]></category>
		<category><![CDATA[blogging tips]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[commands]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[webdesign]]></category>
		<category><![CDATA[webmaster tools]]></category>

		<guid isPermaLink="false">http://www.makeuseof.com/?p=92411</guid>
		<description><![CDATA[Growing a blog takes years, and a whole lot of pain and struggle. Then there are the major transitions, when you realize that you have to make some major changes, and it's going to take a whole lot of work. There are a number of major changes I've had to make on my own blog, but one of the most difficult was that I had used a certain manual method to insert Google ads into my blog articles.]]></description>
			<content:encoded><![CDATA[<p><img class="align-right" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/11/database.png?323f2c" alt="how to edit wordpress" />Owning and running a WordPress blog is a lot of fun, especially when you first get started. Designing the site or picking a cool theme, and writing up those first few posts in anticipation of the huge swarm of people that you&#8217;re certain are headed your way. It doesn&#8217;t take long for reality to hit, and before you know it you don&#8217;t like the theme, the visitor flow is no more than a trickle, and you realize that your web host doesn&#8217;t quite have the horsepower you need.</p>
<p>Growing a blog takes years, and a whole lot of pain and struggle &#8211; I&#8217;m sure Aibek would testify to that. Then there are the major transitions, when you realize that you have to make some major changes, and it&#8217;s going to take a whole lot of work.</p>
<p>There are a number of major changes I&#8217;ve had to make on my own blog, but one of the most difficult was due to the fact that I had used a certain manual method to insert Google adverts into my blog articles.</p>
<h2>Changing Posts With A Single SQL Command</h2>
<p>The problem is that after several years of running the blog, I had nearly 1,000 posts with that Google advert manually inserted. If I ever wanted to make a change, that&#8217;s a thousand posts I&#8217;d have to edit.</p>
<p>I wanted to use that cool <a href="http://www.makeuseof.com/tag/insert-template-wordpress-post-inpost-template/">in-post template add-on</a> that I wrote about in 2010.  This would automate the insertion of adverts moving forward, but if I used it without removing all of those existing adverts, I&#8217;d end up with two ads in the old articles.</p>
<p>To remove the old advert , I had to perform a little bit of SQL magic, and I&#8217;m going to share that with you today. The action takes place in phpMyAdmin, and you&#8217;ll need to select the database of your blog from the left menu.</p>
<p style="text-align: center;"><img class="aligncenter" style="border-width: 1px; border-color: black; border-style: solid;" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/11/bulkremove1.png?323f2c" alt="how to edit wordpress" width="579" height="377" /></p>
<p>The code that you&#8217;re going to use to strip sections of your content will be in the SQL tag. What I mean by that is the code I&#8217;m going to show you, you&#8217;ll be able to use to remove any content that exists on multiple blog posts, from 2 to 200 &#8211; or more. The only requirement is that what you want to remove has to have a common start text and an end text &#8211; like a Google advert has a common start tag and an end tag.</p>
<p style="text-align: center;"><img class="aligncenter" style="border-width: 1px; border-color: black; border-style: solid;" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/11/bulkremove2.png?323f2c" alt="wordpress edit page" width="557" height="376" /></p>
<p>This is what my newer blog entries look like, with the ad manually inserted right after the &#8220;more&#8221; tag on every page, aligned on the right.</p>
<p style="text-align: center;"><img class="aligncenter" style="border-width: 1px; border-color: black; border-style: solid;" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/11/bulkremove3.png?323f2c" alt="wordpress edit page" width="480" height="362" /></p>
<p>The way this code is laid out on the page looks like this:</p>
<p><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/11/bulkremove7.png?323f2c" alt="wordpress edit page" width="528" height="224" /></p>
<p>As you can see, I have a &#8220;script type&#8221; start tag that I can use at the start of every advert, and a &#8220;script src&#8221; tag I can use at the end.</p>
<p>So here&#8217;s how it works. You need to tell the SQL &#8220;update&#8221; command that you want to completely wipe out that block of your page. You&#8217;ll need to understand three basic MySQL functions &#8211; <em>replace, substr</em> and <em>locate</em>.</p>
<p>First, use LOCATE to tell the command the locations of the start and end points. In my case, I use the strings at the start and end of the section I want to remove. The start location on the page of the beginning is:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">LOCATE <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'&lt;script type=&quot;text/javascript&quot;&gt;'</span><span style="color: #66cc66;">,</span> post_content<span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>The end location is trickier. Locate gives you the start of the string, so you have to add the number of characters to the very end of the string to get the ending location.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">LOCATE<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'&lt;script src='</span>http:<span style="color: #66cc66;">//</span>pagead2<span style="color: #66cc66;">.</span>googlesyndication<span style="color: #66cc66;">.</span>com<span style="color: #66cc66;">/</span>pagead<span style="color: #66cc66;">/</span>show_ads<span style="color: #66cc66;">.</span>js<span style="color: #ff0000;">&quot; type=&quot;</span>text<span style="color: #66cc66;">/</span>javascript<span style="color: #ff0000;">&quot;&gt;', post_content) + 93</span></pre></div></div>

<p>Next, you&#8217;re going to need to tell the &#8220;REPLACE&#8221; function exactly what text you want to replace. You do this by extracting the actual string out of the post content, using the SUBSTR function. You have to pass it the starting location (which you now have) and the length. The length you need to calculate by subtracting the starting position from the last position (which you also have).</p>
<p>Here is what that looks like, with the code above inserted into the SUBSTR function:</p>
<pre>substr(post_content, locate('&lt;script type="text/javascript"&gt;', post_content), ((locate('&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;', post_content) + 93) - (locate('&lt;script type="text/javascript"&gt;', post_content))))</pre>
<p>Looks crazy right? But if you look carefully, you&#8217;ll see there&#8217;s the three sections embedded &#8211; post content, start location, and length.</p>
<p>Now that you have the exact text that you want to remove from your posts, all you have to do is tell the REPLACE function to replace it with a space. Just copy the code above into the following command:</p>
<pre>UPDATE wp_posts SET post_content = replace(post_content, string_to_replace, replacement_string);</pre>
<p>Like this:</p>
<pre>UPDATE wp_posts SET post_content = REPLACE(post_content, substr(post_content, locate('&lt;script type="text/javascript"&gt;', post_content), ((locate('&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;', post_content) + 93) - (locate('&lt;script type="text/javascript"&gt;', post_content)))), ' ');</pre>
<p>Running the script above, if all of the syntax is properly aligned, you should see the following successful results in phpAdmin.</p>
<p style="text-align: center;"><img class="aligncenter" style="border-width: 1px; border-color: black; border-style: solid;" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/11/bulkremove10.png?323f2c" alt="" width="521" height="236" /></p>
<p>Now, when I reload the posts in my web browser &#8211; voila! The ad has magically been stripped away.</p>
<p style="text-align: center;"><img class="aligncenter" style="border-width: 1px; border-color: black; border-style: solid;" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/11/bulkremove4.png?323f2c" alt="" width="482" height="271" /></p>
<p>Don&#8217;t get me wrong, it didn&#8217;t work on all ads, because I had some older ones that had slightly different formatting on the start and end. Like this page.</p>
<p style="text-align: center;"><img class="aligncenter" style="border-width: 1px; border-color: black; border-style: solid;" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/11/bulkremove5.png?323f2c" alt="" width="487" height="438" /></p>
<p>But with a little bit of tweaking, just changing the precise tags for start/finish, I was able to re-run the SQL and wipe those out as well.</p>
<p style="text-align: center;"><img class="aligncenter" style="border-width: 1px; border-color: black; border-style: solid;" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/11/bulkremove6.png?323f2c" alt="how to edit wordpress" width="475" height="392" /></p>
<p>This technique will work to remove any content at all that is in your WordPress post content. That&#8217;s the beauty of having the posts in a MySQL database, you can simply run SQL commands to manipulate thousands of posts all at once &#8211; saving a tremendous amount of manual work. <strong>Just make sure to back up your database before you start!</strong></p>
<p>Do you have any other neat uses for this SQL command? Give it a shot on your own WordPress database and see how well it works for you. Share your experiences and feedback in the comments section below.</p>
<p><small>Image credits: <a href="http://image.shutterstock.com/display_pic_with_logo/112891/112891,1300420963,2/stock-photo-database-structure-d-background-73381360.jpg" rel="nofollow">Shutterstock</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.makeuseof.com/tag/edit-thousands-wordpress-posts-sql-command/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Which Programming Language Should You Learn For Software Development?</title>
		<link>http://www.makeuseof.com/tag/programming-language-learn-software-development/</link>
		<comments>http://www.makeuseof.com/tag/programming-language-learn-software-development/#comments</comments>
		<pubDate>Fri, 04 Nov 2011 17:01:09 +0000</pubDate>
		<dc:creator>James Bruce</dc:creator>
				<category><![CDATA[MakeUseOf Explains]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[learning]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[study]]></category>

		<guid isPermaLink="false">http://www.makeuseof.com/?p=90452</guid>
		<description><![CDATA[When starting on the path of programming, it’s important you invest your time wisely in choosing to learn something that will both benefit you in the immediate future with visible results on your platform of choice, as well as getting you set up for any future languages. Your choice will depend upon a number of factors, so let’s take a look at their characteristics, ease of learning, and likelihood of earning you a living.]]></description>
			<content:encoded><![CDATA[<p><img class="align-right" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/10/code.jpeg?323f2c" alt="programming languages" />When starting on the path of programming, it’s important you invest your time wisely in choosing to learn something that will both benefit you in the immediate future with visible results on your platform of choice, as well as getting you set up for any future languages. Your choice will depend upon a number of factors, so let’s take a look at their characteristics, ease of learning, and likelihood of earning you a living. I&#8217;ll also show you some code to display &#8220;hello world&#8221;, the first application many people write when learning a new language.</p>
<p>In this first part, we’ll be looking at languages used to program software &#8211; as in applications which run on the computer or mobile devices. Next time we’ll look at the increasingly significant area of web-programming languages, used to create dynamic websites and interactive browser-based user interfaces.</p>
<p>There are two previous articles in this series which discuss some fundamentals of any programming languages, so if you&#8217;re new to programming then be sure to read those too:</p>
<ul>
<li><a title="The Basics Of Computer Programming 101 – Variables And DataTypes" href="http://www.makeuseof.com/tag/basics-of-computer-programming-variables-datatypes/">Variables and Datatypes</a></li>
<li><a href="http://www.makeuseof.com/tag/absolute-basics-programming-beginners-part-2/">Functions, Loops and Decision Making</a></li>
</ul>
<h2>Java</h2>
<p><a href="http://www.java.com">Java</a> is a full object-oriented language, strongly typed, with an extensive feature set focused on networking and cross-platform compatibility. Applications written in Java can run on virtually any OS &#8211; though the performance won’t be as good as something designed to run natively.</p>
<p>It is the language of choice for most Computer Science courses, and consequently almost everyone has at least a little Java programming experience. Android applications are written in Java too, though you can&#8217;t simply run a regular Java app on your Android mobile nor vice-versa.</p>
<p><strong>Likelihood Of Making You Money</strong></p>
<p>If you can make an app worth charging for on the <a href="http://www.makeuseof.com/service/google-android/">Android</a> marketplace, then the world is yours for the taking. There&#8217;s also a lot of enterprise-level Java jobs, but the competition is high and pay low.</p>
<p><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/10/java.png?323f2c" alt="programming languages" width="547" height="95" /></p>
<p>[<em><strong>Note</strong>: Don’t confuse Java with Javascript, which is a completely different language used for web programming - we’ll look at this more next time</em>].</p>
<h2>C/C++</h2>
<p>Though actually separate languages, they are often grouped together, as C++ is basically an enhanced version of C, adding object oriented features. C++ is the serious programmer&#8217;s language of choice, forming the basis of most computer games and most advanced Windows software. It’s high performance, but requires a lot more precision on the programmers part when it comes to memory management and consequently has a steep learning curve. Not recommended for absolute beginners.</p>
<p><strong>Likelihood Of Making You Money</strong></p>
<p>With less competition than Java, C++ programmers will always be in demand and paid well, especially in the games industry.</p>
<p><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/10/c-plus-plus.png?323f2c" alt="computer programming languages" width="228" height="152" /></p>
<h2>C#</h2>
<p>Pronounced <em>C sharp</em>, this is Microsoft’s clone of Java (though the two have since diverged with more pronounced differences) &#8211; a general purpose object-oriented strongly-typed language. Performance is good, though not as fast as C++. Software written in C# requires .Net framework to run and is Windows-only.</p>
<p><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/10/c-sharp.png?323f2c" alt="computer programming languages" width="356" height="149" /></p>
<p><strong>Likelihood Of Making You Money</strong></p>
<p>There’s a good number of corporate C# jobs out there for enterprise solutions, but you’re unlikely to make money on a single piece of software unlike mobile development. Still, it’s a fun language and easy to learn for beginners, certainly I’d recommend it if you’d like to focus on Windows only.</p>
<p>You can download Microsoft <a href="http://www.microsoft.com/visualstudio/en-us/products/2010-editions/express">Visual Studio Express</a> for free, which helps greatly with GUI designing and code completion. You can also use it for Visual Basic and many other Microsoft-branded programming languages.</p>
<h2>Visual Basic</h2>
<p>Another of Microsoft&#8217;s contributions, Visual Basic is an event-driven language focussed on simple GUI-based apps. Event-driven means that the code you write will generally be reacting to what the user does &#8211; what happens when they click that button, for example. It&#8217;s incredibly easy to learn and get a simple app up and running, but ultimately limited and perhaps not the best for actually learning fundamental programming concepts.</p>
<p><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/10/visual-basic.png?323f2c" alt="computer programming languages" width="537" height="79" /></p>
<h2>Objective-C / Cocoa</h2>
<p>This is the Apple Mac language upon which most OSX and iOS applications are built. Technically, Objective-C is an extended version of C with object-oriented features, much like C++, but is nearly always combined with the Cocoa framework for building graphical user interfaces and higher level features on the Mac platform. You must also be careful with memory management.</p>
<p>The syntax and concepts you need to learn are quite complex compared to a language like Java or C#, but on the other hand, Apple provides a comprehensive free development environment (<a href="http://developer.apple.com/xcode/">XCode</a>) and tools which make the process of creating real, useable apps fairly easy. There’s also a wealth of written and video tutorials out there to guide you, so it’s certainly more accessible than C++. It&#8217;s basically your only choice for OSX and iOS development, but you&#8217;ll be able to write for both the Apple desktop and mobile environment with the one language.</p>
<p><img class="aligncenter" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/10/objective-c.png?323f2c" alt="programming languages" width="372" height="97" /></p>
<p><strong>Likelihood Of Making You Money</strong></p>
<p>With a developer account ($99 yearly) and a killer app, you have the potential to make a lot &#8211; Apple has paid out $2 billion so far. App Store developers stand a better chance than Android developers for making money with paid apps, while Android developers tend to see more returns on in-app advertising.</p>
<p>That’s all the languages I’m going to cover today, and they form the majority of real-world software development on PCs, Macs and mobile environments. Before I get blasted in the comments, I&#8217;ve decided to include Python in the web-based list because that seems to be where it&#8217;s used most.</p>
<p>The truth is that once you have the basics down in any language, it’s relatively easy to learn another; just as knowing Chinese kanji makes reading and writing Japanese easier &#8211; programming languages often cross over and borrow from each other, sharing the same set of basic characteristics and syntaxes. Stay tuned for the next article in which I&#8217;ll look at web-based languages such as Javascript and PHP.</p>
<p><em>Hat-tip to Jeffery, an avid commenter here at MakeUseOf and often on-hand to help out in the tech Answers section, who suggested this article and some of the languages it should cover.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.makeuseof.com/tag/programming-language-learn-software-development/feed/</wfw:commentRss>
		<slash:comments>52</slash:comments>
		</item>
		<item>
		<title>The Absolute Basics Of Programming For Beginners (Pt. 2)</title>
		<link>http://www.makeuseof.com/tag/absolute-basics-programming-beginners-part-2/</link>
		<comments>http://www.makeuseof.com/tag/absolute-basics-programming-beginners-part-2/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 17:00:29 +0000</pubDate>
		<dc:creator>James Bruce</dc:creator>
				<category><![CDATA[MakeUseOf Explains]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[learning]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.makeuseof.com/?p=89823</guid>
		<description><![CDATA[In part 2 of our absolute beginners guide to programming, I'll be covering the basics of functions, return values, loops and conditionals. Make sure you’ve read part 1 before tackling this, where I explained the concepts of variables and datatypes. You won't need to do any actual programming yet - this is all still theoretical and language-independent.]]></description>
			<content:encoded><![CDATA[<p><img class="align-right" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/10/programming101.jpg?323f2c" alt="beginner programming" />In part 2 of our absolute beginners guide to programming, I&#8217;ll be covering the basics of <em>functions</em>, <em>return values</em>, <em>loops and conditionals</em>. Make sure <a href="http://www.makeuseof.com/tag/basics-of-computer-programming-variables-datatypes/">you’ve read part 1</a> before tackling this, where I explained the concepts of variables and datatypes. You won&#8217;t need to do any actual programming yet &#8211; this is all still theoretical and language-independent.</p>
<p>Next time, we&#8217;ll start putting all this into practice with some real code. If you&#8217;ve always promised yourself you&#8217;re going to do some programming some day, now is a great time to start.</p>
<p>To quickly recap, last time I explained what variables were and some of the basic types data they can store. You should be able to explain what the following datatypes are:</p>
<ul>
<li>Character</li>
<li>String</li>
<li>Integer</li>
<li>Float</li>
<li>Boolean</li>
<li>Array</li>
</ul>
<p>We also looked at the difference between strongly-typed, and weakly-typed programming languages; and the advantages and disadvantages of each. Lastly, let&#8217;s make sure you know the difference between statements of assignment, and of equality. Which of the following assigns variable B to variable A, and which tests if they have the same value?</p>
<ul>
<li>a = b;</li>
<li>a == b;</li>
</ul>
<p>Great! If you&#8217;ve come this far, that&#8217;s an amazing achievement and you&#8217;re well on your way to making your own software! Let&#8217;s move on today&#8217;s lesson.</p>
<h2>Conditionals and Loops</h2>
<p>There are three structural building blocks of a program that you need to know, and they are almost universally referred to as: IF, FOR, and WHILE.</p>
<p><strong>IF</strong> is one-time test. “<em>IF a is true, then do this</em>”. IF <em>a</em> isn’t true, the program ignores whatever comes next and carries on with the rest of the code. You can also provide an alternative with ELSE. “<em>If a is true, then do this, ELSE do this</em>”. It allows you to make decisions in the program depending on a variable. Remember the test for equality that we learnt about earlier?</p>
<p>That could be used in an IF clause, for example:</p>
<pre>if(a==b)
print “a is equal to b”
else
print “a is not equal to b”
</pre>
<p><strong>FOR</strong> is a way to loop over the same code a set number of times. There is no testing involved &#8211; it just repeats the same block of code however many times we tell it to.</p>
<p><strong>WHILE</strong> is also a loop, but instead of performing the options a pre-determined number of times, it performs a test each time the loop is performed and continues to loop until the test fails. If the test continues to be true, it never stops looping. This can cause problems if you have a bug in your WHILE look, leading to unresponsive programs that crash in an endless loop.</p>
<p><img class="aligncenter" style="border: 0pt none;" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/10/while.jpeg?323f2c" alt="beginner programming" width="500" height="334" /></p>
<p>These 3 basic structures create the traffic lights and road diversions that control the logical flow around an application.</p>
<h2>Functions</h2>
<p>A function is just a group of code that&#8217;s been given a name. By grouping a block of code together and naming it, we can re-use it later and throughout the application without having to rewrite the whole code block again. Not only does it save time and reduces the overall code size of an application, it also means that if there was something wrong, we would only need to change it in one place.</p>
<p>Nearly all programming languages come with a built in set of functions that you can use in your application. For instance, <strong>ECHO</strong> is a function found in many languages that displays some text on screen. There are usually also some functions to deal with reading and writing files, graphical or audible output, keyboard and mouse input, and mathematics. You can use all these built-in functions without knowing how they actually work &#8211; all you need to know is the correct function name, and the parameters it requires. Wait.. <em>parameters</em>?</p>
<h2>Parameters and Return Values</h2>
<p>We often refer to functions as “<em>taking</em>” certain variables and “<em>returning</em>” something back to us. It might help to consider a function as a machine you can’t necessarily see inside of. You can put things into it, and you might get something out again, but you don’t actually have to know what goes on inside the machine. The things you put in are the parameters &#8211; variables of data that the function will work with. The return value is the output of the function &#8211; the data that will be given back to you once it’s finished running through it’s logic.</p>
<p><img class="aligncenter" style="border: 0pt none;" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/10/a-function.png?323f2c" alt="beginner programming" width="509" height="165" /></p>
<p>In the example above, the “signature” of the function is one that accepts two variables (<strong>a</strong> and <strong>b</strong>), and returns one (<strong>c</strong>).</p>
<p>Sometimes functions won’t return any values at all, though it’s common practice in those cases just to return a Boolean value of true or false to show whether it was successful or not. If you called a function to save a file for example, you wouldn’t necessarily want any variables back, but you would like to know if the file was written correctly or if there was an error.</p>
<p>In all applications, variables and data are constantly being “passed around” through thousands of different functions, each of which performs it own distinct purpose in the big scheme of things.</p>
<h2>Check What You Learnt Today</h2>
<p>To recap today&#8217;s points, you should understand what the following do in any programming language, and how they control the flow of the application:</p>
<ul>
<li>IF</li>
<li>FOR</li>
<li>WHILE</li>
</ul>
<p>You should also understand what a function is, and what I mean when I say “<em>this function accepts a string and returns a Boolean</em>”.</p>
<p>That&#8217;s all for this lesson. Next time, we&#8217;ll try to put some of this knowledge into practice using real code to write a small application, though I haven&#8217;t decided which language to tackle first. If you have any requests, then perhaps you could post in the comments. What programming languages do you think are the most important today?</p>
<p><small>Image Credits: <a href="http://www.shutterstock.com/pic.mhtml?id=81916798" rel="nofollow">ShutterStock 1</a>,<a href="http://www.shutterstock.com/pic.mhtml?id=61586563">2</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.makeuseof.com/tag/absolute-basics-programming-beginners-part-2/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>The Basics Of Computer Programming 101 &#8211; Variables And DataTypes</title>
		<link>http://www.makeuseof.com/tag/basics-of-computer-programming-variables-datatypes/</link>
		<comments>http://www.makeuseof.com/tag/basics-of-computer-programming-variables-datatypes/#comments</comments>
		<pubDate>Sun, 23 Oct 2011 17:30:21 +0000</pubDate>
		<dc:creator>James Bruce</dc:creator>
				<category><![CDATA[MakeUseOf Explains]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[datatypes]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[variables]]></category>

		<guid isPermaLink="false">http://www.makeuseof.com/?p=89596</guid>
		<description><![CDATA[Having introduced and talked a little about Object Oriented Programming before and where its namesake comes from, I thought it's time we go through the absolute basics of programming in a non-language specific way. This is the kind of stuff computer science majors learn in the first term, and I’m aiming this at people with absolutely zero experience in programming. ]]></description>
			<content:encoded><![CDATA[<p><img class="align-right" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/10/programming101.jpg?323f2c" alt="basics of computer programming"/>Having introduced and talked a little about <a title="Where Did “Object Oriented” Programming Get Its Name From?" href="http://www.makeuseof.com/tag/object-oriented-programming/">Object Oriented Programming</a> before and where its namesake comes from, I thought it&#8217;s time we go through the absolute basics of computer programming in a non-language specific way. This is the kind of stuff computer science majors learn in the first term, and I’m aiming this at people with absolutely zero experience in programming.</p>
<p>Today, I’ll be covering the most fundamental part of any programming language &#8211; variables and datatypes. We’ll have a few more lessons after this on the fundamentals before we delve into any actual code, so no worries about things getting complicated yet.</p>
<h2>Variable and Datatypes:</h2>
<p>At the core of any program are <em>variables</em>. Variables are where the dynamic information is stored. When you type your name into a web form and send it, your name is a variable.</p>
<p>Not all variables are the same though. In fact, there are many different types of variables that nearly every programming language has. Let’ s look at a small selection of them, as well as their short names if they have one:</p>
<p><strong>Character (char):</strong> This is a single character, like <strong>X</strong>, <strong>£</strong>, <strong>4</strong>, or <strong>*</strong>. You don’t often create single character variables, but they are at the core of the language so you need to know what they are.</p>
<p><strong>String</strong>: This is a “string” of <em>characters</em> (see how they’re at the core?) of any length. In my previous example &#8211; your name on web form &#8211; your name would be stored as a <em>String variable</em>.</p>
<p><strong>Integer (int)</strong>: A whole number &#8211; whole meaning there are no digits after a decimal point. So <em>65</em> would be a valid integer;<em> 65.78</em> would not.</p>
<p><strong>Floating-point number (float)</strong>: A number that may have digits after the decimal place. <em>65.00</em> is technically a floating point number, even though it could be represented just as easily as an integer as <em>65</em>. It takes more memory to store a float, which is why there is a distinction instead of just creating a “number” datatype.</p>
<p><strong>Boolean (bool)</strong>: A variable to represent true or false (or it could also mean 0 or 1, on or off). The simplest datatype and commonly used &#8211; get used to this one!</p>
<p><strong>Array</strong>: These are essentially lists of other variables. There are a variety of array types depending on the language, but basically they’re just a collection of variables in a sequential list. For example: <em>1,2,3,4,5</em> might be stored as an array (of length 5) containing integer variables. Each variable in the array can then be accessed using an index &#8211; but you should know the first item in the list has an index of 0 (yes, that can be be confusing sometimes). By storing them as an array, we make it easy to send a collection of variables around the program and do things with them as a whole &#8211; such as counting how many things are in the array or doing the same thing to each item (which is called an iteration, and we&#8217;ll get to that another time). You should also know that a <strong>string</strong> is actually just an <strong>array</strong> of <strong>characters</strong>.</p>
<p>Phew, I hope that wasn’t too technical. If you need to re-read that, no one would blame you. If you still don’t get it, tell me in the comments.</p>
<p><img class="aligncenter" style="border: 0pt none;" src="http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2011/10/variables.jpeg?323f2c" alt="basics of computer programming" width="580" height="388" /></p>
<h2>Strong and Weak Typed:</h2>
<p>Moving on, programming languages can be divided into those that are strongly-typed, and those that are weakly-typed. A strongly typed language (such as Java) requires that you explicitly declare what type of variable you are creating, and they get very upset if you start trying to do things with them that you shouldn&#8217;t. For example, a strongly typed language would give you errors if you tried to add an <strong>integer</strong> and a <strong>string </strong>together. “<em>How on earth am I supposed to mathematically add together a word and a number?</em>”, it would cry &#8211; even though you as a human clearly understand a <strong>string “5”</strong> is semantically the same as an <strong>integer with the value of 5</strong>.</p>
<p>A weakly typed language on the other hand would just say “<em>whatever</em>”, and give it a shot without complaint &#8211; but the answer could go either way. Perhaps “5+5” = 10, perhaps it’s “55” &#8211; who knows! It might seem at first like weakly-typed languages are easier to write, but they can often result in curious errors and unexpected behavior that take you a while to figure out.</p>
<h2>Assignment and Equality:</h2>
<p>Nothing to do with socialism&#8230;Instead, its a concept that catches out many programming newbies so I wanted to address it now. There is a difference between <strong>assigning</strong> and <strong>testing for equality</strong>. Consider the following, both of which you would probably read as “<em>A is equal to 5</em>”:</p>
<p>A = 5;<br />
A == 5;</p>
<p>Can you tell the difference? The first is known as assignment. It means <strong>assign</strong> <strong>the value of 5</strong> <strong>to variable A</strong>. You are “setting” the variable value. The second statement is one of equality. It’s a test &#8211; so it actually means “<em>is A equal to 5?</em>” &#8211; the answer given back to you would be a <strong>boolean value</strong>, true or false. You’ll see how this can mess up your programs in later lessons.</p>
<p>That’s it for today&#8217;s lesson. Please don’t hesitate to ask questions in the comments if you didn’t understand something, and I’ll be more than happy to re-word it or explain differently. Next time we’ll take a look at <em>functions and return values</em>, before moving onto <em>loops and iteration</em>.</p>
<p><small>Image Credits: <a rel="nofollow" href="http://www.shutterstock.com/pic.mhtml?id=81916798">ShutterStock 1</a>, <a href="http://www.shutterstock.com/pic.mhtml?id=61715305">2</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.makeuseof.com/tag/basics-of-computer-programming-variables-datatypes/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached (Requested URI is rejected)
Database Caching 1/59 queries in 0.264 seconds using apc
Object Caching 687/858 objects using disk: basic
Content Delivery Network via main.makeuseoflimited.netdna-cdn.com

Served from: www.makeuseof.com @ 2012-02-10 15:33:44 -->
