<?xml version="1.0"?><rss version="2.0"><channel><title>Jacks_Depression</title><link>http://www.jacksdepression.com</link><description>Jacks Blog</description><language>en-us</language><lastBuildDate>2012-04-15 13:30:55</lastBuildDate><item><title>Jacks_Twisted Web Subprocess</title><link>http://www.jacksdepression.com/post/26</link><description><![CDATA[<p>One of the things I like about the Twisted framework is it's wide variety of functionality. You can serve web pages, have cron jobs and run processes all from the same reactor without any of them blocking. I've been using twisted mainly for serving webpages but recently I threw together a website for showcasing my photos. I decided to cut a lot of corners by running image processing programs directly on the operating system rather then hooking into python libraries.</p>
<p>The conversions worked pretty easy, mostly because they where fire and forget. Anything that needed to be converted was added to a queue. And when the conversion was done, the file was placed where it needed to be. Errors where logged. Pretty simple.</p>
<p>Then I started looking into the idea of having a pre-conversion thumbnail. So I could tag it  before it was generated. In this case though, I did not want this thumbnail written to disk. The less files to manage the better.</p>
<p>This was more tricky for two reasons.</p>
<ul>
<li>The way twisted's web library handles requests, it all comes down to a single function call and it expects a result.</li>
<li>I could not find a program on the operating system that would generate the thumbnail I wanted in a single command.</li>
</ul>
<p>The first problem actually wasn't that hard to solve. Thankfully the smart people working on the Twisted project built in the functionality I wanted just by simply returning the number 1.</p>
<span style="font-style:italic;">Open post to see code</span>
<p>This puts the burden on you to write the data yourself and close the connection when done. So here is a good example of how that would be done.</p>

<span style="font-style:italic;">Open post to see code</span>
<p>This way, you can wait on what ever you need while the differed call takes its time.</p>
<br />
<p>The other problem was that I could not find a single program to produce the output I wanted. However, I could pipe one into another program that would give me what I needed. And since I don't see any built in piping functions in Twisted, I had to do the pipe myself. The desired functionality would look something like this.</p>
<span style="font-style:italic;">Open post to see code</span>
<p>The `dcraw' program would extract the thumbnail from my raw file (cr2) using the `-e' option. And it would write it to standard output using the `-c' option.</p>
<p>The `convert' program would then take that input represented by the `-' argument. It would then resize it and write it in jpeg format to the standard output represented by the `jpg:-' argument.</p>
<p>Here is the final example of how it all goes down. Be sure to close your standard input to the second program, or it won't know when to start processing the image.</p>
<span style="font-style:italic;">Open post to see code</span>
]]></description><pubDate>2012-04-15 13:30:55</pubDate></item><item><title>Jacks_Air Wall</title><link>http://www.jacksdepression.com/post/25</link><description><![CDATA[<p>Just a quick hint to help anyone else with the following problems.</p>
<p>I had clients reporting the following error with an Adobe Air / Flex application I wrote.</p>
<span style="font-style:italic;">Open post to see code</span>

<p>This error is caused by a firewall blocking outgoing connections. See documentation for your firewall software as to how to fix. Here is a sample app I wrote to test network connections.</p>

<h3>index.mxml</h3>
<span style="font-style:italic;">Open post to see code</span>

<h3>scripting.as</h3>
<span style="font-style:italic;">Open post to see code</span>
<p>Of course, I replaced the domain of my server with google.com. Test it like thus or on your own server.</p>]]></description><pubDate>2010-09-03 16:30:47</pubDate></item><item><title>Jacks_Bad Air</title><link>http://www.jacksdepression.com/post/24</link><description><![CDATA[<p>I am a <a href="http://www.ubuntu.com/">Ubuntu</a> user, this is public information. I used 64 bit version of Ubuntu of course, as any serious Linux user does.</p>
<p>I also have had a <a href="http://www.pandora.com/">Pandora</a> account since 2006 and I'm a subscriber. As such I use the desktop based <a href="http://pandora.com/pandora_one">Pandora One</a> on Adobe's Air framework.</p>
<p>While upgrading to the never version of Ubuntu (10.04) I came across this error when trying to install Pandora One in air:</p>

<span style="font-style:italic;">Open post to see code</span>

<p>Long story short, you need to install Java. OpenJDk wont cut it.</p>
<p>This is a problem though, because Canonical decided to deprecate Java. Probably because it is not released under an open source license.</p>
<p>So just follow their instructions and it should work just fine...</p>
<p><a href="http://www.ubuntu.com/getubuntu/releasenotes/1004#Sun%20Java%20moved%20to%20the%20Partner%20repository">Ubuntu Release 10.04, Java</a></p>
<br />
<p>Or my version:</p>
<span style="font-style:italic;">Open post to see code</span>
<p>And it works just fine. Hope I helped.</p>
]]></description><pubDate>2010-05-22 03:02:06</pubDate></item><item><title>Jacks_Url Mapping</title><link>http://www.jacksdepression.com/post/23</link><description><![CDATA[<p>As website development continues to change. The <a href="http://en.wikipedia.org/wiki/Representational_State_Transfer#Guiding_principles_of_a_REST_interface">RESTful</a> ideal is catching on. And a large part of that is making urls easier to understand. Most common servers delegate the folder structure to the website, that is simple from a programming prospective but way outdated. Web servers like WEBrick, <a href="http://www.zope.org/">Zope</a> and <a href="http://twistedmatrix.com/trac/">Twisted Web</a> have much better tools to accomplish this new goal. They all seems to fall back to regular expressions or hard coded trees though. No matter what tool I have used, managing urls has never been intuitive enough. Especially when creating APIs. I always let my APIs evolve to what the end user finds most convenient. Which means changing and renaming urls often. And even after you have the url going to the right object, you have to examine it again for validation. I think there should be a much better way of accomplishing this.</p>
<p>What I propose is an xml based url map. Here is an example of one I would use for this blog...</p>
<span style="font-style:italic;">Open post to see code</span>
<p>This of course it purely conceptual at this point. It wouldn't been too hard to add validation, then deiced which object will then handle valid and invalid parameters. More to come on this soon.</p>
]]></description><pubDate>2010-02-26 17:45:56</pubDate></item><item><title>Jacks_Purpose</title><link>http://www.jacksdepression.com/post/22</link><description><![CDATA[<p>I've been talking to recruiters for years now. Occasionally I am asked the question "Ideally, what are you looking for in your next job?". Without too much thought I respond with something like "A job that challenges me". That alone is nothing worth noting. But a couple of recruiters casually offered me a moment of insight. One of them interjected while I was thinking of my answer. They said "It is acceptable to say you just want money". And in the other instance they guy said he hoped I had gotten the job because I asked for something more than just a paycheck.</p>
<p>So I wonder to my self, how many applicants do these companies get that really have no passion for their work? From what I have noticed, it seems to be the vast majority. Most of the jobs I get called about only ask for someone who can vomit code. If you know anything about me, you know how much I would hate those kind of positions. But everyone has their place, some people want to work those kind of jobs.</p>
<p>Recently I have been reading Good to Great (by Jim Collins) recently and been letting some of those ideas float around in my brain. And it goes in great length to explain that great companies have people who really care about what they are doing. And I clearly fall into that category. Even with the last job I did. I was getting paid crap but my heart and soul was in the project. The end result was just a glorified prototype but I am damn proud of it.</p>
<p>I would be a very valuable employee when put in the right place. So why doesn't anyone see that? Why do I keep hearing about these crappy jobs?</p>]]></description><pubDate>2010-02-12 17:06:16</pubDate></item><item><title>Jacks_Software Good</title><link>http://www.jacksdepression.com/post/21</link><description><![CDATA[<p>These are dark days for software programming. The masses scream for  stability, ease of use and features. The business heads demand AJAX, JavaScript affects and quick development. Computer repair has turned into snake oil. And worst of all, people are scared to do anything on their computer outside of the normal routine. Thus guaranteeing that they never learn more.</p>
<p>Software and computers in general continue to make great strides regularly. But nothing is perfect yet. So I pose the question: "As a software programmer, what is the greatest good you can do?" This is an effort to find possible solutions. Lets begin.</p>
<br />
<p>The number of Windows users is clearly falling, and the number of MAC users is now the highest I have seen in my professional career. So what is causing this trend? You can go into usability benefits, stability benefits, or even the simplicity in purchasing an MAC. Personally, I think it is Windows it self thats finally driving people away. MAC did not get better, Windows got worse. Microsoft spent many years coming up with a successor  to Xp and people did not like it. Issues inside the company at the time is most likely the culprit. But when they realized they made a mistake, they did the classic Microsoft move of putting a band-aid on it and moving on. Sometimes thats enough to keep going but I think this band-aid wont last. I still see Xp underneath.</p>
<p>Digging a little deeper now, lets point out likely reasons for the conversion from Windows to MAC.</p>
<p>1) New user interface</p>
<p>Learning something new is not a favorite past time of Windows users. To make the upgrade from Xp to the Vista/7 family you needed to learn what a whole bunch of new icons did and where to find things. If people are already going to learn something new, why not learn a new OS with better usability.</p>
<p>2) Additional complexity</p>
<p>The bulk of Windows users do not like to explore features or extra menus. This is similar to the user interface problem. This is what is so appealing to most people about MACs. Generally there is one way to do something and it is only a single button.</p>
<p>Based on these findings it seems like the people moving to MAC are simply not Microsoft's target market. So who is Microsoft targeting? The most obvious answer is business. But first, lets digress a little more into operating systems.</p>
<br />
<p>I usually don't mind fixing computers for friends and family. I have the knowledge and I am not going take advantage of them like mainstream computer repair companies (more on that later). Somewhere along the process though, I get asked why it can't be easier. And that is a completely legitimate question. Why can't computers be simple?</p>
<p>Originally, the benefit from computers came in their flexibility. The more it can handle, the more valuable it became. These days though, I am coming across more and more people who only use two or three programs on their computer. These people don't need to change their font size, theme colors, window decoration, folder locations, or map network drives. You can remove functionality for these people and they wont be affected at all. Then there is the problem of hardware failure. The common computer user does not know the symptoms of a hardware failure. And the computer isn't too keen on informing them either. So why are they using the same operating system as the more advanced users? Because there is no operating system out there for the masses like this. Computers are not for the common people, no matter what Microsoft or MAC tries to tell you.</p>
<br />
<p>Cell phones have been a booming market for a while now. Evolving from the intelligence of a calculator to full operating systems. Ever since I had my first cell phone I wanted to write my own programs for it. Today thats not only possible but has become a major marketing point for newer cell phones. Many companies are competing for this ground: Microsoft, Palm, Apple, and Google. The most successful currently is Apple. Why is that? </p>
<p>I think it was a perfect storm of hardware, usability, simplicity and features. The iPhone was the right product at the right time. Is there anything we can learn from this? Yes, or else I would not of brought it up. Software is not a hopeless cause. Occasionally I hear some complaint about the iPhone but that is insignificant to how many people are happy with theirs.</p>
<br />
<p>The most effective use of computers these days is in the realm of business. It always has been. And the addition of the personal computer only served to strengthen that hold. In general business is good for advancing society. However  there is one consent problem that never seems to go away with business. In the end it is all about money. This has lead to things such as: adding lead to paint, or putting Chlorofluorocarbon (CFC) in products, or selling parasites as weight loss or even selling cars with minor flaws that kill people. In this case, business is at fault for poorly written software. This is why Windows is commonly referred to as unstable. Microsoft could of used it's resources to make it stable, but having it work most of the time is a lot cheaper then having it work all the time. In my opinion, this is where most people's frustration with computers comes from. The best software these days is open source. Because most people who work on it are not looking for a paycheck, they are looking for something useful.</p>
<p>Then you flip that coin around, and look at all the people who put their heart and soul into a piece of software and only got 4 months of pay out of it. The software is now making wealthy fat men more wealthy and fat. And the author of this software is looking for work again. I can't think of an artist or author who does not see the fruit of their labor.</p>
<p>And it gets worse when you look at people who fix computers for a living. I have hear numerous stories of how people have put computer repair companies to the test and they failed miserably. Some of the simplest problems are declared unsolvable or the most long drawn out process is used to ultimately accomplish nothing.</p>
<p>In the end, I think most business are not helping when it comes to the greatest good and software.</p>
<br />
<p>What can be concluded from all this? From my observations, software is too complex for you average user. And a business is not going to come up with a solution.</p>
<p>Now we come full circle to the question which I intend to answer: "As a software programmer, what is the greatest good you can do?". There is a need right now. A need for software to satisfy the masses. Is filling that need the greatest good though?</p>]]></description><pubDate>2009-12-19 22:50:06</pubDate></item><item><title>Jacks_Flex-able DataGrid</title><link>http://www.jacksdepression.com/post/20</link><description><![CDATA[<p>When it comes to UI programming and business, nothing it more scared than the DataGrid. Back in the dark days when I used to use .Net, if you did not know everything about the DataGrid, you would be ostracized. And thus I ate many lunches alone. When I was learning the language, I never really needed to use a DataGrid. I never really needed to use one, and the consent seems so simple. Why would I waste my time on it when I could probably just figure it out as I go? So when the time came that I needed to use one in a Flex application, I approached it like it where nothing. I gave time estimates that sounded reasonable.<p>
<p>But then I got to thinking to my self. This is flex. Its pretty much the cream of the crop right now for visually appealing UI. Why not make the data more appealing? Why not go above and beyond? So, I decide to display percentages in bar graph form and boolean values as images. Not only that, but I was determined to put a button at the end of the column to remove it.</p>
<p>When I got into the code though, I realized it was not going to be as easy as I had hoped. It turns out that the only thing the DataGrid was built to display was text. However, I have challenged my self and I will be victorious. We will start by demonstrating the problem.</p>
<br />

<p>index.mxml</p>
<span style="font-style:italic;">Open post to see code</span>

<p>SomeObject.as</p>
<span style="font-style:italic;">Open post to see code</span>

<p>Here we have a basic DataGrid. The dataProvider is comprised of a simple object. Three of this object to be exact. And for starters, we have three columns. Two of them are the provided "DataGridColumn" class. And the 3rd is a custom column. </p>

<img src="http://www.jacksdepression.com/post/20/files/datagrid-1.png" width="852" height="399" alt="" />

<p>There are no problems with the first two columns. They work out of the box as advertised. Lets focus on the custom column.</p>

<p>BarColumn.as</p>
<span style="font-style:italic;">Open post to see code</span>

<p>So the question is: how do we convert this number value into code execution? The column uses a factory pattern to create each cell on the grid. It is stored as "<a href="http://livedocs.adobe.com/flex/3/langref/mx/controls/dataGridClasses/DataGridColumn.html#itemRenderer">itemRenderer</a>" as an IFactory type. A little more digging finds "ClassFactory" to be the only implantation of the IFactory interface. So, lets add this to our code.</p>

<p>BarColumn.as</p>
<span style="font-style:italic;">Open post to see code</span>

<p>BarRenderer.as</p>
<span style="font-style:italic;">Open post to see code</span>

<p>Now we have the basics needed to really start making ground. But there is a bit of bad news. If you look at the inheritance of the "<a href="http://livedocs.adobe.com/flex/3/langref/mx/controls/dataGridClasses/DataGridItemRenderer.html">itemRenderer</a>", you will see that its only contains text based functions. It has no "graphics" property, and you can't add children to it. So now I must wonder, why did Adobe go this path? Why are they making it so hard to add anything in the DataGrid but text? Not only that, but it is still uncertain where how to redraw when the number changes.</p>
<p>Good thing you came to my blog though, because I have done all the research for you. Just implement the "IdataRenderer" interface and your pretty much golden. I chose to simply make my "Render" a "Box", and it all works.</p>

<p>BarRenderer.as</p>
<span style="font-style:italic;">Open post to see code</span>

<p>It is important to note that the object that is "set" is the whole "SomeObject" object. You'll have to tell it specifically what property to read or store. Now, lets turn it into a our bar render.</p>

<p>BarRenderer.as</p>
<span style="font-style:italic;">Open post to see code</span>

<img src="http://www.jacksdepression.com/post/20/files/datagrid-2.png" width="853" height="403" alt="" />

<p>There is your solution in a nut shell.</p>
]]></description><pubDate>2009-10-30 03:29:41</pubDate></item><item><title>Jacks_3rd Point</title><link>http://www.jacksdepression.com/post/19</link><description><![CDATA[<p>Now that I have them means, I am going to try and explain in further detail the concept in the <a href="http://www.jacksdepression.com/post/9">Vestigial Appendage post</a>.</p>
<p>Imagine that your looking at a wall in front of you. The point on the wall directly in front of you, we'll call the center. Probably something like this.</p>
<img src="http://www.jacksdepression.com/post/19/files/layered-explained-0.png" width="800" height="556" alt="" />
<p>Now we are going to add objects to this wall.</p>
<img src="http://www.jacksdepression.com/post/19/files/layered-explained-1.png" width="800" height="556" alt="" />
<p>If you ever see something that looks exactly like that on your wall, your probably not well. In fact, I hope you don't even see want to see an X and Y axis on your wall. The point is, shapes on your wall will never look this perfect. It is quite unnatural. What your going to see actually looks more like this.</p>
<img src="http://www.jacksdepression.com/post/19/files/layered-explained-2.png" width="800" height="556" alt="" />
<p>We live in a 3D world and pure 2D shapes don't look natural to us. To make it look more real, depth is needed. Still this image is not exactly accurate. The depths have been exaggerated a little too much. This is the equivalent of using a wide angle lens on a camera. Its true that the further away something is on this plane the more of the side you will see. However, this one doesn't quite hit the nail on the head either. The check mark is the only shape I think has proper depth in this image. So if I where to use this method of displaying objects I would have to make every depth as minor as the check mark's.</p>
<p>And that explains why I abandoned the idea. Simply that the little amount of depth that is added will take a lot of calculations and make it look only slightly better. It was not worth slowing the game down in my opinion. I only hope that the person who ends up deigning the units is good at making things appear to have depth.</p>
<br />
<p>Now lets dig into how I accomplished this. Here are all the keywords for everything I will be using for this explanation: Flex, Flash, ActionScript, CaRMetal, Transformation Matrix.</p>
<p>When starting on this test, I had two unknowns.</p>
<ol>
<li>How to transform a bitmap in ActionScript.</li>
<li>How to calculate the visible length of the depth.</li>
</ol>
<p>First question was answered by research. I ended up finding this library thanks to <a href="http://flashandmath.com/">http://flashandmath.com/</a> that will do all the transforms I need.</p>
<p><a href="http://www.flashandmath.com/advanced/menu3d/transformer.html">The BitmapTransformer Class</a></p>
<p>From here, we get to work on the object we will display. I started by caching the location of each corner. If you know your ActionScript, this wont be a hard task for you. For this example, we are going to store our point clockwise starting from the upper left: [(3,4), (4,4), (3,2), (4,2)]</p>
<span style="font-style:italic;">Open post to see code</span>
<p>This image was generated by CaRMetal. (My new favorite toy)</p>
<img src="http://www.jacksdepression.com/post/19/files/layered-explained-2.png" width="800" height="556" alt="" />
<p>I had deigned my test to work with any number of points but we will keep it simple with a four sided figure. Each side will also have four points. Two of them will be from our recorded points. The other two will have to be generated from the distance to the center (0,0) and the angle. My solution was to loop through all the points and do each side based on the next point.</p>
<span style="font-style:italic;">Open post to see code</span>
<p>This code is to be run every time the shape moves. Put it in your main loop. First we start with main point for this side of the object. Which will be point "i" (you can also call it side "i"). Then we need the next point on the object which will be point "j" (this is still side "i" though). These are quickly resolved into points 1 and 2. So, now we have two points of the four we need to draw a side.</p>
<p>Next thing the code does is to call a utility function that will give us the slope of a line based on two points. In this case, we want the slope of an imaginary line drawn between the center of the object and the center of the stage. This would also be the location for the imaginary lens we are trying to recreate. Assuming we are currently calculating the 4th side (green). We do not need to think about any other sides (brown). And remember, since we sored our points in a clockwise fashion, we label the bottom left point as point1 (or point "i") and top left as point2 (or point "j").</p>
<img src="http://www.jacksdepression.com/post/19/files/layered-explained-4.png" width="800" height="556" alt="" />
<p>Now every side point knows which direction the center is in and can be drawn properly. Continuing with the code above; points 3 and 4 are then calculated and the side is drawn. Which would look something like this.</p>
<img src="http://www.jacksdepression.com/post/19/files/layered-explained-5.png" width="800" height="556" alt="" />
<p>And thats the basic idea. The final part of this problem is to find out the magic that was done to find those last two points. The "CalculatePointVector" function.</p>
<span style="font-style:italic;">Open post to see code</span>
<p>Now that does not look to complex at all. In this function we have: the point want to base the new point off of, the direction the slope was pointing in radians and some variables to help me control how much depth you see. Speed and time are really distance in this calculation.</p>
<p>Even so, there is a much easier way to calculate all this. Its called a Transformation Matrix. I took it upon my self to re-invent the wheel for my own knowledge. Although ActionScript has its own tools to help you with this.</p>
<p><a href="http://livedocs.adobe.com/flex/3/langref/flash/geom/Matrix.html">http://livedocs.adobe.com/flex/3/langref/flash/geom/Matrix.html</a></p>
<p>Basically you add up from left to right and you get the new position of your point. Sadly, its not very clear how to do that with a single point. I don't know much how they work any way. All I know is that I was looking for a way to rotate a single point and found this did the job. Thus why I shared my code with you! Hope it helped or you learned something.</p>
]]></description><pubDate>2009-10-18 02:52:41</pubDate></item><item><title>Jacks_Smart Loop</title><link>http://www.jacksdepression.com/post/18</link><description><![CDATA[<p>A year or so ago I read an interesting article about the many different approaches to a main loop. I wish I could share it with you but it seems I lost it. Either way, its no relevant to this post. I just happened to be on my mind a lot as I was coming up with the movement engine for Smart Defense. That right, another post on Smart Defense. Majority of the traffic to my blog is interested in this little side project of mine. But who would not be interested in an open source flex/flash strategy game.</p>
<p>I am back to work on it since everything else has dried up and I hope explain it while I am working on it. That way, when finishing the project up, I don't have to write a ton of documentation. In this post, I want to cover how all "movable" objects get from A to B and beyond. Starting with my main loop...</p>
<p>Flex and Flash will not cooperate nicely if you attempted a formal Main loop.</p>
<span style="font-style:italic;">Open post to see code</span>
<p>Thats not how it was designed. Flash is intended to take the nitty gritty out of animation, and as its success shows, it is doing a damn good job. As such, you do not need to worry about is frame rates, swap buffers, and graphic languages. Except, that brings a whole now can of worms into the picture. If Flash is managing all that on its own, where are you supposed to put all your game-like code? Well, thankfully, their main loop fires off an event on every cycle, so you can tack you code on to it. That would be, the well known onEnterFrame.</p>
<span style="font-style:italic;">Open post to see code</span>
<p>The concept of an idle event is also something well known in game programming. The Idle event is called repeatedly, without end. This is the same concept as a main loop, just doing it through an event rather than the loop it self.</p>
<p>So then I ask the question that earns me the big bucks: I know Flash/Flex runs on a fixed frame rate. What happens when the execution of rendering the frame takes longer then the gap between frames? Simply, the frame rate slows down. So the fixed frame rate is not fixed at all. It just is given an upper limit. It renders as fast as it can without going over that number.</p>
<p>What does this mean for Smart Defense? It means that having the game move slow is out of the question. I assume things will get rather hectic on the battle field. I am assuming that half the people who play this game will not meet the upper limit of the frame rate. </p>
<p>If I thought every person who played this game would be making at the same frame rate, then I would of simply made each "movable" sprite move a fixed distance every frame. This would be a lot easier to program. But since I have higher standard than that, I have done things a little different. Graced with the knowledge of the true meaning of vectors, I decided to put them into action. The term "Vector" is tossed around a lot these days for things I would not deem appropriate. From hence forth, if I  use the term vector, I am referring to this definition: A formula that will return a point on an axis given other axises. For instance, in Smart Defense, I calculate a "movable" sprite's X and Y location based on time. A lot of other data points come into play. But that is the basis of the vectors I am using.</p>
<p>So, lets jump a little more into the code.</p>
<span style="font-style:italic;">Open post to see code</span>
<p>So far, pretty easy. On every frame the list of "runners" is gone through and updated in no particular order. I will spare you the "runner" management code. Its pretty simple. I will assume you can do that much on your own. Also, "runners" are not the only things that are "moveable" to I gave them a common "moveable" subclass.</p>
<span style="font-style:italic;">Open post to see code</span>
<p>Much more complicated now. First we get the number of seconds elapsed since it was placed in the world. Then to get the units (or distance) the "moveable" object has traveled. The movement speed is stored as units (pixels in this instance) per second. For instance, a movement speed of 5 pixels per second is stored as a 5. Then we calculate the vector.</p>
<p>Think for a second the number of possibilities we have already opened up. Time is not constrained. In fact, time is not even a factor in the vector function. With this you can have a game where you rewind, fast forward and pause all game activity. So, the game is mostly independent of time.</p>
<span style="font-style:italic;">Open post to see code</span>
<p>This is just to get the seconds elapsed since last frame, so we can make up for slower computers. Now finally, the vector function you have been waiting for.</p>
<span style="font-style:italic;">Open post to see code</span>
<p>In my version, I have the "moveable" sprite going through way-points. The information for each is cached within the sprite. So, we simply find how far along its journey it has traveled, then we place it there with some Flash magic. See the documentation on <a href="http://livedocs.adobe.com/flex/3/langref/flash/geom/Point.html#interpolate()">Point.interpolate</a> if you wanna know more about how it works. You have the basics for moving sprites around in Flash/Flex completely independent of frame rate.</p>
<p>My next challenge is to see if I can move a sprite along a curved vector.</p>
<p>More in Smart Defense soon.</p>
]]></description><pubDate>2009-10-03 11:25:21</pubDate></item><item><title>Jacks_Searching Advantage</title><link>http://www.jacksdepression.com/post/17</link><description><![CDATA[<p>Why has <a href="http://en.wikipedia.org/wiki/Search_Engine_Optimization">Search Engine Optimization</a> be come a big deal? Why do people call them selfs experts in a field that has that is not held accountable for its results? Why do I get spam asking me to increase the Search Engine Optimization of a site that has really high results? Lets ponder these problems, shall we...</p>
<p>Search engines where created to help make since of things on the Internet. An "Internet phonebook" if you will. You know what you want but you don't know how to find it. So clearly, you turn to a search engine. Many very smart people have put their heads together to find the best way to bridge that gap from seeking person to website. Our friends at Google came up with their page rank and linking system that has by far proven to be the best method. So when you search Google, you're trusting Google to return the best possible results. After all that is Google's job. They work hard to make you happy.</p>
<p>Enter egoistical person or company we will call "Mr. Me". Mr. Me wants more traffic on his website. Mr. Me makes his living through his website and  he knows that the more people who visit his website, the more likely that someone will end up sending some money his way. So one way or another, Mr. Me hears about something called Search Engine Optimization (hence to be called SEO). So he hires some guy who says he knows a lot about SEO. He says that he has been certified so, he must know what he is doing. Mr. Me. works with website developers, or takes charge of the website him self. He starts throwing around all these weird words but he is trusted to do his job. A lot of money later, Mr. Me's CEO expert leaves.</p>
<p>So what is the result? Probably nothing. See <a href="http://www.amazon.com/Black-Swan-Impact-Highly-Improbable/dp/1400063515/">Nassim Nicholas Taleb's "The Black Swan"</a>. It talks a bit about professions that have no experts. Evaluate the track record of a SEO expert, I am willing to bet that most of the time, there is no change. Lets assume that there is a result after the SEO expert is done. And lets pretend that you got exactly what you wanted: more people willing to give Mr. Me more money. Thats the propose of marketing. If that where the case, your CEO expert is in the wrong profession. I'm pretty sure Marketing Expert is higher up on the pay scale ladder than a CEO expert, so we shall rule out this unlikely scenario. (<a href="http://www.google.com/search?q=salary+guide">Search "salary guide"</a> and see how many of them are trying to sell you something)</p>
<p>I ask again, what did the SEO expert do? If he did his job as defined by what he is selling him self as. He increased the amount of people coming to Mr. Me's website. Visitors are no longer coming to the site from the set of keywords the search engine has deemed relevant to your website, but other keywords that are likely to be misleading. He increased your <a href="http://en.wikipedia.org/wiki/Bounce_rate">bounce rate</a>. A hight bounce rate is just a waste of bandwidth or worthless traffic. On the other hand, if the bounce rate is decreased, if you get more leads. You have stepped outside the realm of SEO. What your doing now is marketing. Your bridging the right people to what they want. This is a very similar goal of our search engine pals like Google. The only one not helping is the SEO expert. (And Mr. Me for paying him)</p>
<p>What harm has been done I ask you? Personally, I think a lot of harm has been done. Now, your search engine results are not what your looking for. Its become even harder to bridge people to what they want. It is Mr. Me trying to sell you something you don't want and have no interest in, not what you have been looking for. Then the search engines have to fight all these bogus search results to combat the work done by our CEO expert. For example,  search for information on a product you have. Without going through the manufactures website, try to find information or a review of it. Chances are, you'll end up with a list of sites that want to sell it to you. I bet if Google had their way, they would rather websites don't try to improve their rank. Just be yourself.</p>
<p>Being one who has a couple high ranking keywords throughout my sites, I end up getting spam on some of my contact forms. These emails tell me that they can improve my search rank if I give them money. The problem is, I am already in the first 10 results of every keyword I think is reliant. So, why don't they focus on other fools? I think these people might be as dumb as their clients.</p>
<br />
<p>My SEO advice: Follow <a href="http://www.w3.org/TR/WCAG10/">accessibility guidelines</a> and you'll be just fine.</p>]]></description><pubDate>2009-09-29 11:16:36</pubDate></item></channel></rss>
