<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>Follow me to the dark side - of programming and other geekeries</description><title>Live From Code Noob Central</title><generator>Tumblr (3.0; @codenoobcentral)</generator><link>http://codenoobcentral.tumblr.com/</link><item><title>It's been a while!</title><description>&lt;p&gt;Well I was really busy actually - finding a job, moving countries, dealing with movers, insurance claims, doctors, flat hunting and all that on top of a really challenging new job (no worries, I am surviving!).&lt;/p&gt;
&lt;p&gt;So here I am, finally tackling something new! Blame the bookshop Foyles, where I found this Visual C# programming book by Jonathan S. Harbour and immediately started playing with WindowsForms. It took me a while, as the book clearly forgets to tell you how to actually open new projects (good thing author has a forum!!)&lt;/p&gt;
&lt;p&gt;Anyway, the first project is familiarizing yourself with drawing shapes and bitmaps with GDI+. The structure of the code is fairly easy once you&amp;#8217;ve understood it, even if you have never looked at C# before.&lt;/p&gt;
&lt;p&gt;The code is divided in easily identified categories.&lt;/p&gt;
&lt;p&gt;At the top you have your global statements, where you create your main objects.&lt;/p&gt;
&lt;p&gt;This is followed by the Form1_Load section, which allows you to define the settings of your Form. In this case, the author uses the PictureBox control to blend with the Form1 frame and define the canvas. It is in the section as well that the settings for the Bitmap surface and the graphics device, as well as the random generator.&lt;/p&gt;
&lt;p&gt;Think of the Bitmap as a polaroid taken after each change. It is independent from the PictureBox and can be saved. The graphics device is defined as the tool that will impact on the bitmap surface. &lt;/p&gt;
&lt;p&gt;After the Form1_Load, it is time to work on the graphics device function, which gets its own section. This first project proposes to draw lines in random colours and widths. The colour of the line is defined by randomly assigning values to each segment the ARGB scale. A Pen object is used to gather the coordinates defining the beginning and end of the line. &lt;/p&gt;
&lt;p&gt;A Timer object is also used in this particular instance. It defines the interval at which a new line is drawn. This object is also part of the Form1_Load section.&lt;/p&gt;
&lt;p&gt;And finally, the code closes with a &amp;#8220;free memory&amp;#8221; object. This object basically throws away the data stored regarding the graphics device, the surface and the timer and is good practice when running code that uses a lot of memory.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m not pasting the whole code here but I thought the section on creating the graphics device was the most interesting:&lt;/p&gt;
&lt;p&gt;&lt;img height="449" src="http://img.photobucket.com/albums/v235/Arranz/graphics_device.jpg" width="799"/&gt;&lt;/p&gt;</description><link>http://codenoobcentral.tumblr.com/post/27785331981</link><guid>http://codenoobcentral.tumblr.com/post/27785331981</guid><pubDate>Sun, 22 Jul 2012 23:29:37 +0200</pubDate></item><item><title>Meet Arnold</title><description>&lt;p&gt;You&amp;#8217;re going to ask&amp;#8230; who&amp;#8217;s Arnold?&lt;/p&gt;
&lt;p&gt;Well, to tame beasts and others, I give them pet names. There is a spider on my kitchen wall who currently answers to the sweet name of Bert. The dead pixel on my old laptop is called Matt. Giving it a name, helped me accept that obnoxious red dot in the middle of my screen (I lie, it&amp;#8217;s in a corner)&lt;/p&gt;
&lt;p&gt;&lt;img align="right" height="280" src="http://img.photobucket.com/albums/v235/Arranz/r2d2.jpg" width="280"/&gt;So, for you not to feel stalked in your every move&amp;#8230; meet Arnold. My personal spybot. Tracking you, stalking you&amp;#8230; it KNOWS you and what you are doing here&amp;#8230;.&lt;/p&gt;
&lt;p&gt;&amp;#8230;&lt;/p&gt;
&lt;p&gt;Ok, I&amp;#8217;m mentally challenged today and I have delusions of grandeur. All this to say, I&amp;#8217;ve hooked my blog up with Google analytics. More statistics, more numbers! Turns out the person who wrote the html of this particular theme was even kind enough to include a Google Analytics meta. No pasting scripts, just had to paste my ID. thank you tumblr!&lt;/p&gt;
&lt;p&gt;So keep visiting me&amp;#8230; Arnold would really truly miss you otherwise. (yes, in my head, Arnold looks like r2d2&amp;#8230; what&amp;#8217;s wrong with that?)&lt;/p&gt;</description><link>http://codenoobcentral.tumblr.com/post/21261726978</link><guid>http://codenoobcentral.tumblr.com/post/21261726978</guid><pubDate>Tue, 17 Apr 2012 11:26:54 +0200</pubDate></item><item><title>Decking the cards part 1</title><description>&lt;p&gt;Coffee breaks are generally good but this one was particularly productive as I talked some more about my little blackjack game with a couple colleagues and I think we have pretty much sorted a way to limit the randomization to one deck of cards.&lt;/p&gt;
&lt;p&gt;&lt;img align="left" height="132" src="http://img.photobucket.com/albums/v235/Arranz/ath1337net.jpg" width="300"/&gt;I have to work on this but I thought I&amp;#8217;d lay down the theory before playing around with the technical side. So theorically, we want all cards to belong to one deck (52 cards). The goal is therefore to create the deck using nested arrays. Each card should get a unique value between 0 and 51 and the function deal() will therefore only need to use one Math.random on 52 values instead of two on suits and numbers respectively. &lt;/p&gt;
&lt;p&gt;Adding a third property to each card will permit to know if the card has already been distributed or not and a simple recursion should run deal() until the card selected by the Math.random has not been distributed before. Or while loop, haven&amp;#8217;t decided yet. I also have to create a method that changes the distributed property when the card is pulled by the deal() function. &lt;/p&gt;
&lt;p&gt;I haven&amp;#8217;t decided yet on what to do when the deck runs out. I should probably check what happens in an actual blackjack game  before doing so.&lt;/p&gt;
&lt;p&gt;Thanks for the input, colleagues!&lt;/p&gt;
&lt;p&gt;&lt;em&gt;photography credit: &lt;a href="http://www.ath1337.net/jeux-gratuit/blackjack/strategie-blackjack-bases-34/"&gt;&lt;a href="http://www.ath1337.net"&gt;http://www.ath1337.net&lt;/a&gt;&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;</description><link>http://codenoobcentral.tumblr.com/post/21261336839</link><guid>http://codenoobcentral.tumblr.com/post/21261336839</guid><pubDate>Tue, 17 Apr 2012 11:00:00 +0200</pubDate></item><item><title>Stroll through the Games industry</title><description>&lt;p&gt;Let&amp;#8217;s deviate from our programming babble to take a little stroll through the Games industry. Why? Well, because I take an interest in it and this is my blog, deal with it. Why? Actively seeking jobs, it seems games industry recruiters are quite interested in my profile. Don&amp;#8217;t ask me why, it must be classified information.&lt;/p&gt;
&lt;p&gt;At any rate, I&amp;#8217;ve been applying to a few positions in the Games industry and I&amp;#8217;ve observed various side-effects: my mother freaked out (but she does that whenever I apply to something that looks &amp;#8220;not serious&amp;#8221;), my brother started talking to me (let&amp;#8217;s not go crazy, only when he really cannot play Starcraft because he&amp;#8217;s shoving food in his mouth) and people have started asking me for my opinion when they can&amp;#8217;t pick which video game to play (how am I supposed to pick between Oblivion and Left 4 Dead, I do not really know. I just give random answers). But the most interesting was one of my friends saying &amp;#8220;Really&amp;#8230; Isn&amp;#8217;t it a bit nerdy to work in the video games industry?&amp;#8221;&lt;/p&gt;
&lt;p&gt;&lt;img align="right" height="300" src="http://img.photobucket.com/albums/v235/Arranz/tomsguidefr.jpg" width="400"/&gt;Well ok, I can understand that the perks I got in the fashion industry were much more interesting to her. Which woman in their right mind doesn&amp;#8217;t know how to take advantage of half price designer shoes and handbags? But funnily enough, the processes behind creativity is what interested me in fashion and it is also what interests me in video games. &lt;/p&gt;
&lt;p&gt;Sure I like playing. It&amp;#8217;s fun to be actively involved in the adventure rather than just watch it. But really what I find fascinating is the design, the creativity. How lines of codes build these worlds, how complex algorithms engineer the game and how your characters actions influence the scenario. I want to dig deep behind the wonderful graphics and dissect everything, understand all the processes, the behaviour of the game, the behaviour of the people who play the game. &lt;/p&gt;
&lt;p&gt;That does sound a bit nerdy, doesn&amp;#8217;t it? I can live with that. I can be a nerd with designer handbags (or not, I&amp;#8217;m trying to sell them) who spends hours dissecting processes or building little JavaScript text-based games. &lt;/p&gt;
&lt;p&gt;This time of job hunting is hardly a walk in the park. Every rejection stings. But I think I have learnt a lot. About myself, about my interests and about various industries. I wanted to write a little bit about this one because working on my little Blackjack game made me think about the incredible work done by game studios. &lt;/p&gt;

&lt;p&gt;And just to conclude: if you do not know what to get me for my birthday, feel free to look up that great tetris lamp! (source: tomsguide.fr)&lt;/p&gt;</description><link>http://codenoobcentral.tumblr.com/post/21079777367</link><guid>http://codenoobcentral.tumblr.com/post/21079777367</guid><pubDate>Sat, 14 Apr 2012 14:53:50 +0200</pubDate></item><item><title>The Blackjack deal</title><description>&lt;p&gt;Tonight, I am proud to post that I have successfully finished my JavaScript Blackjack game challenge on codeacademy.com! Of course there&amp;#8217;s always room for improvement but give me a break, I have a NEARLY fully functionning blackjack game, which now only requires pulling cards from a deck to avoid generating the same card twice.&lt;/p&gt;
&lt;p&gt;One challenge a day though! My challenge for today was to make the actual game more &amp;#8220;readable&amp;#8221;. &lt;/p&gt;
&lt;p&gt;The original code does not include creating suit names, or clearly identifying face cards, which makes it difficult to read when your output resembles: &amp;#8220;you have card 7 of suit 2 and card 1 of suit 4 and dealer has card 4 of suit 1 and card 13 of suit 1&amp;#8221;.&lt;/p&gt;
&lt;p&gt;Not exactly user friendly. &lt;/p&gt;
&lt;p&gt;Codeacademy proposes to include the information mentionned above using switch statements. I have decided to take another route and used arrays. I created two new methods in my Card constructor, one to get the suit name and one to get the card number or face.&lt;/p&gt;
&lt;p&gt;&lt;img height="189" src="http://img.photobucket.com/albums/v235/Arranz/blackjack1.jpg" width="612"/&gt;&lt;/p&gt;
&lt;p&gt;When the card is randomly generated using the deal function here below, thevariables s and n are only numbers. Suit goes from 0 to 3 (four suits) and card number goes from 0 to 13 (fourteen cards). &lt;/p&gt;
&lt;p&gt;&lt;img height="110" src="http://img.photobucket.com/albums/v235/Arranz/blackjack2.jpg" width="510"/&gt;&lt;/p&gt;
&lt;p&gt;The two methods getNumberLab and getSuitLab are then called when printing the hand, transforming the numeric variables, which correspond to positions in the suitName and numName arrays into actual cards and suits. &lt;/p&gt;
&lt;p&gt;&lt;img height="147" src="http://img.photobucket.com/albums/v235/Arranz/blackjack3.jpg" width="671"/&gt;&lt;/p&gt;
&lt;p&gt;Easy right?&lt;/p&gt;
&lt;p&gt;You can find my complete code here: &lt;a href="http://pastebin.com/fLmp0THi"&gt;&lt;a href="http://pastebin.com/fLmp0THi"&gt;http://pastebin.com/fLmp0THi&lt;/a&gt;&lt;/a&gt; - all credit to codeacademy.&lt;/p&gt;</description><link>http://codenoobcentral.tumblr.com/post/21042156474</link><guid>http://codenoobcentral.tumblr.com/post/21042156474</guid><pubDate>Fri, 13 Apr 2012 23:18:00 +0200</pubDate></item><item><title>Image Credit: by zari 906

So you remember inception and the...</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_m25yrm7UDH1r1p3lxo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Image Credit: by zari 906&lt;/p&gt;

&lt;p&gt;So you remember inception and the dream within the dream within the dream and ooooh Leonardo di Caprio. Got distracted, sorry.&lt;/p&gt;
&lt;p&gt;Well in programming (and math), there’s the nightmare within the nightmare within the nightmare. Also known as… recursion. Just typing the word makes me shudder although let me tell you, I am doing my best to tame this beast. &lt;/p&gt;
&lt;p&gt;So if I got this well…. Recursion = calling a function inside itself until the certain conditions (base case) are met. There’s also a termination condition, in case your input is really off its rocker. It’s supposed to keep your program from going all Nyan cat on you, in infinity and beyond. &lt;/p&gt;
&lt;p&gt;Anyway, recursion… It’s my first real programming pet-peeve, if you don’t count OOP, which I just forget. The information just slides out of my ear and drowns into a puddle before I can do anything about it. &lt;/p&gt;
&lt;p&gt;Stop ranting, it’s time to go beat up recursion. Oh yes.&lt;/p&gt;</description><link>http://codenoobcentral.tumblr.com/post/20712369240</link><guid>http://codenoobcentral.tumblr.com/post/20712369240</guid><pubDate>Sun, 08 Apr 2012 15:57:22 +0200</pubDate></item><item><title>Introduction to Madness</title><description>&lt;p&gt;Welcome to my new blog&amp;#8230; Where you will be able to follow my adventures in the terrifying, dark-side-cookie, globally crazy world of programming. That&amp;#8217;s right people, contrary to all normal people who suddenly wake up with the urge to write a blog about cooking (I love those blogs, by the way), I woke up with the urge to share my nerdy experience with you.&lt;/p&gt;
&lt;p&gt;So you&amp;#8217;re going to ask, who in their right mind suddenly decides to take up programming at the sweet and old age of 27. Well, first of, this project has been growing in my little brain for quite some time. To be perfectly honest, I bought my first geeky book a few years ago. It was HTML. The will died after 5 weeks. &lt;/p&gt;
&lt;p&gt;In 2011, I made a new investment&amp;#8230; book introducing two programming languages, to build a game. I thought, there&amp;#8217;s a winner! Two languages, and a real project! Oh boy. After an afternoon of trying to understand how they were trying to make me use cmd, I gave up.&lt;/p&gt;
&lt;p&gt;My life changed very beginning of 2012, when someone introduced me to the magic of codeyear.com - interactive, little modules, new materials every week. Quite proudly, I can now say I&amp;#8217;ve been studying JavaScript with them for 3 months.&lt;/p&gt;
&lt;p&gt;That&amp;#8217;s right, three whole months! Quite a feat for someone with the attention span of a teaspoon and let me tell you, it&amp;#8217;s not rosy everyday.&lt;/p&gt;
&lt;p&gt;In conclusion, why this blog? Well, in time, I hope to show you that programming, and the dark side of the IT industry (there is no light side but let&amp;#8217;s lull ourselves in a false sense of security for a while) are not that scary. Maybe&amp;#8230; ^_^&lt;/p&gt;</description><link>http://codenoobcentral.tumblr.com/post/20706648797</link><guid>http://codenoobcentral.tumblr.com/post/20706648797</guid><pubDate>Sun, 08 Apr 2012 11:56:40 +0200</pubDate></item></channel></rss>
