<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>owenSoft.net - Articles</title>
    <link>http://www.owensoft.net/v4/category/23/</link>
    <description>Reviews, previews and more text</description>
    <language>en</language>
    <generator>http://www.owensoft.net</generator>	
	<image>
		<url>http://www.owensoft.net/favicon.ico</url>
		<title>owenSoft.net</title>
		<link>http://www.owensoft.net/</link>
	</image>

<item>
      <title>General Theory on Dreams and why they are always weird (Articles)</title>
      <link>http://www.owensoft.net/v4/item/1354/</link>		
	  <description>&lt;p&gt;&lt;/p&gt; &lt;p&gt;I have always been interested in the inner workings of the brain.  Being a programmer, I spend a great deal of time thinking of ways to create different systems of solving problems.  This article is about a theory I have about dreams and why human need to have them.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
&lt;a rel=&#039;external&#039; href=&#039;http://en.wikipedia.org/wiki/Dreams&#039; title=&#039;Dreams&#039;&gt;Dreams&lt;/a&gt; are a succession of images, thoughts, sounds, or emotions passing through the mind during sleep. The content and purpose of dreams are not fully understood, though they have been a topic of speculation and interest throughout recorded history. The scientific study of dreams is known as oneirology.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Why do we dream?&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
The consensus is that you dreams because you are asleep and you brain needs something to do in its idle time.  Which makes sense because we spend almost half of our lives asleep.  &quot;&lt;a rel=&#039;external&#039; href=&#039;http://en.wikipedia.org/wiki/Sleep&#039; title=&#039;Sleep&#039;&gt;Sleep&lt;/a&gt; in humans, other mammals, and a substantial majority of other animals that have been studied (such as some species of fish, birds, ants, and fruit flies), regular sleep is essential for survival.&quot;&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
the nature of dreaming: that it is regular nightly, rather than occasional, phenomenon, and a high-frequency activity within each sleep period occurring at predictable intervals of approximately every 60–90 minutes in all humans throughout the life span.- wp&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
The Theory&lt;/p&gt;&lt;p&gt;
My theory is that dreaming is not simply &quot;busy work&quot; being done while the body is sleeping but I think the brain is actually running a series of comparison tests across the information it has learnt during the day and in the past.  The brain not only &quot;thinks&quot; at the point when there is a problem to be solved but actually is making up problems to think about when you are asleep.  This is why we dream.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Dreams and learning&lt;/p&gt;&lt;p&gt;
The assumption that the brain is running tests on you during your sleep leads me to imply something else about the brain.  If my hypotheses that dreams are tests is correct and the fact that a dream is mostly a none physical activity, then it leads me to assume that there would be no benefit to running these tests unless it is a very necessary part of learning. &lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
But then again if you are learning while you are awake why would you need to learn while you are asleep.  I think the reason for this is because the brain is not one BIG computer but infact multiple little computers each doing its own thing, constantly changing while you are awake and gathering information.  It would seem that it is while you are asleep that the brain gets a chance to run tests on the information that is gathered during the day.  &lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
These tests maybe some sort of maintence process.  In my own experience my dreams seemed to always be a mishmash unrelated information, people and places. It is as if my brain is comparing scenarios, events, people and things I have learned in unusual ways to see how the &quot;brains&quot; will react to it.  I imagine that nightmare occur when the brain runs a comparison on something that is feared by the person.  It also seems that these comparison tests/processes are not limited to current previous but can involve anything learnt or experienced in a person&#039;s lifetime.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
I can only speculate on how the brain determines when a test is successful or when it has failed.  Though often times a person will find themselves in a &lt;a rel=&#039;external&#039; href=&#039;http://en.wikipedia.org/wiki/Déjà_vu&#039; title=&#039;deja-vu&#039;&gt;deja-vu&lt;/a&gt; situation.  &quot;Déjà_vu is the experience of feeling sure that one has witnessed or experienced a new situation previously (an individual feels as though an event has already happened or has happened in the recent past), although the exact circumstances of the previous encounter are uncertain.&quot;.  Usually a person will only encounter &quot;good&quot; deja-vu scenarios and will seek to avoid any scenario which &quot;feels&quot; wrong or invokes some sort of fear emotion.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
A Comparison Engine&lt;/p&gt;&lt;p&gt;
Maybe there is no right or wrong, true or false scenario.  There is a chance that the brain is in fact not a computer but in fact a complicated comparison engine which is updated during the sleep phase of our live.  This might explain why we spend so much time sleeping.  And further more explain why we have to sleep so frequently.  The brain as a comparison engine would explain why people who are taught the same thing often thing about them in different ways depending on their perspective and previous experiences.  This would mean that if there was a way to raise 2 people, teaching them exactly the same information, then technically they should have the same dreams.  &lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Conclusion&lt;/p&gt;&lt;p&gt;
This Theory has lead me to speculate that the brain is not simply a big computer, running a single big program but infact a series in independent, parallel, micro programs, all learning and changing at the same time without any sort of uniformed synchronization.  There are no consistent rules as to the structure of each program or how it interacts with each other part of the brain.  Apart from the parts of the brain which are hardwired for specific tasks, all the other cognitive parts of the brain must then be running at kernel level, at the same time, independently and yet cooperatively casting votes at the same time. In the sleep state the brain allows the normally independent processes to interact which results in dreams.  Dreams which help to create bonds and links between thoughts and processes which are normally too busy consuming information while the person is awake.  If this is truly the case then computers of the future need not only to think but also to dream.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;by owen ()&lt;/strong&gt;  &lt;a href=&quot;http://www.owensoft.net/v4/item/1354/#comment&quot;&gt;Post your comments on this article&lt;/a&gt;&lt;/p&gt;</description>
	  <pubDate>2010-03-26 15:05:57</pubDate>
 </item>

<item>
      <title>Verbal Diarrhea (Articles)</title>
      <link>http://www.owensoft.net/v4/item/1331/</link>		
	  <description>&lt;p&gt;&lt;/p&gt; &lt;p&gt;Ah, some people just don&#039;t know when to STFU. Seriously.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
This whole John Mayer situation, eerily reminiscent of several Kanye West situations, has me wondering why people just can&#039;t think before they speak. Especially when you&#039;re someone in the public eye.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
In one interview this man:&lt;/p&gt;&lt;p&gt;
- Kiss and told about several famous women he slept with&lt;/p&gt;&lt;p&gt;
- Used a racial slur&lt;/p&gt;&lt;p&gt;
- Admitted his penis was a white supremacist&lt;/p&gt;&lt;p&gt;
- Offended women (black, white, yellow and brown) with his stereotypes&lt;/p&gt;&lt;p&gt;
- Defamed Kerry Washington...&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Do I need to go on? I hope everyone will have an equally long memory for John Mayer&#039;s transgressions as they did for Kanye West&#039;s.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
This is a good assessment of the interview: http://ow.ly/16rBz&lt;/p&gt; &lt;p&gt;&lt;strong&gt;by SE (&lt;a href=&quot;http://memoirsofadater.blogspot.com&quot; rel='external'&gt;memoirsofadater.blogspot.com&lt;/a&gt;)&lt;/strong&gt;  &lt;a href=&quot;http://www.owensoft.net/v4/item/1331/#comment&quot;&gt;Post your comments on this article&lt;/a&gt;&lt;/p&gt;</description>
	  <pubDate>2010-02-12 15:20:04</pubDate>
 </item>

<item>
      <title>Video Games:  Better graphics vs Better Gameplay (Articles)</title>
      <link>http://www.owensoft.net/v4/item/1275/</link>		
	  <description>&lt;p&gt;&lt;/p&gt; &lt;p&gt;In my view the reason we can&#039;t have both is because development resources are always limited.  Probably only the first party companies (sony, nintendo, microsoft) have infinite resources to spend years and pay the most talented and imaginative people to built their games.  Which is why first party games always seem to come out with games that are excellent in all areas.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Now let me list the reasons why normally we can&#039;t have excellent graphics and excellent game play on limited resources;&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Better graphics means; bigger textures, more processing power needed, more assets, more art, more physics, more motion capture, more sound samples, more video&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Better Gameplay means; More options, more NPCs, more characters, more objects to interact with, branching paths and story, more actions, better A.I.&lt;/p&gt;&lt;p&gt;
Now lets try to combine the 2;&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Graphics over gameplay leads to; small maps, Flat A to B stories (most Fps games), limited interactions or Quicktime events, buses crashing into intersections that BLOCK YOUR DAM PATH!(uncharted 2 video)  Big open spaces with nothing to do in them (ala Just Cause).  Enemies that always spawn at the same place.  Switchs.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Gameplay over graphics lead to; Old Games like Mario 1, PacMan, Zelda TTP, Time Splitters.  Because really they had no choice but to make the gameplay solid (old and multiplatform games seem to suffer from this).  I&#039;m finding it really hard to find examples for this nowadays.&lt;/p&gt;&lt;p&gt;
Conclusion&lt;/p&gt;&lt;p&gt;
My examples are limited to what I can remember now.  Either way what is needed is a balance between graphics and game play.  Something like NMH, or FZero Gx (yeah the other racers on the track look shitty but they were 30 of them so it kinda balances out).  Most games nowadays are shitty because the graphics department has more power and is therefore using up too much of the systems resources.  hence forcing the gameplay/stories to be implemented inadequately.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;by owen ()&lt;/strong&gt;  &lt;a href=&quot;http://www.owensoft.net/v4/item/1275/#comment&quot;&gt;Post your comments on this article&lt;/a&gt;&lt;/p&gt;</description>
	  <pubDate>2009-08-03 17:00:56</pubDate>
 </item>

<item>
      <title>Programming: The downsides of Modularity (Articles)</title>
      <link>http://www.owensoft.net/v4/item/1251/</link>		
	  <description>&lt;p&gt;&lt;/p&gt; &lt;p&gt;There is a common misconception that modularity is inherently a good thing.  In fact &lt;a rel=&#039;external&#039; href=&#039;http://en.wikipedia.org/wiki/Modular_design&#039; title=&#039;modular systems are not optimized for performance&#039;&gt;modular systems are not optimized for performance&lt;/a&gt; and are often harder to maintain depending on the extent of the modularization.  It is similar problem as OOP which as a drastic effect on the program as a whole.  Once a modularization technique is chosen it usually affects the entire program permanently crippling it is not properly implemented.   Modularity similar to OOP is a useful tool in the appropriate context. One should not start writing a modular program.  However one should anticipate the areas of the program which will benefit from being modular.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Lets us look at a simple example 1;&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
start program&lt;/p&gt;&lt;p&gt;
	print(&quot;-- Add 2 numbers --&quot;);&lt;/p&gt;&lt;p&gt;
	print(&quot;Enter first Number:&quot;);&lt;/p&gt;&lt;p&gt;
	firstnumber = readkeyboard();&lt;/p&gt;&lt;p&gt;
	print(&quot;Enter second Number:&quot;);&lt;/p&gt;&lt;p&gt;
	secondnumber = readkeyboard();&lt;/p&gt;&lt;p&gt;
	&lt;/p&gt;&lt;p&gt;
	result = firstnumber + secondnumber;&lt;/p&gt;&lt;p&gt;
	&lt;/p&gt;&lt;p&gt;
	print(&quot;Result:&quot; + result);&lt;/p&gt;&lt;p&gt;
end program&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
As you can see the Example 1 is pretty simple and efficient.  What I&#039;m going to do now is redesign the above program in deferent stages of modularity.  What you will notice is that as the program becomes more modular it becomes more complicated and at the same time less efficient.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Lets us look at example 2;&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
function acceptnumber( screenmessage ) &lt;/p&gt;&lt;p&gt;
     print( screenmessage );&lt;/p&gt;&lt;p&gt;
     return readkeyboard();&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
end function&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
start program&lt;/p&gt;&lt;p&gt;
     print(&quot;-- Add 2 numbers --&quot;);&lt;/p&gt;&lt;p&gt;
     firstnumber = acceptnumber(&quot;Enter first Number:&quot;);&lt;/p&gt;&lt;p&gt;
     secondnumber = acceptnumber(&quot;Enter second Number:&quot;);&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
     result = firstnumber + secondnumber;&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
     print(&quot;Result:&quot; + result);&lt;/p&gt;&lt;p&gt;
end program&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
In example 2 we have introduced a function called acceptnumber() which allows us to reduce the amount of lines in the main program by moving the repeat tasks of printing a message on the screen and reading the keyboard from the user.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Lets us look at example 3;&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
function acceptnumber( screenmessage ) &lt;/p&gt;&lt;p&gt;
     print( screenmessage );&lt;/p&gt;&lt;p&gt;
     return readkeyboard();&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
end function&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
function do_addition( num1, num2 )&lt;/p&gt;&lt;p&gt;
     return num1 + num2;&lt;/p&gt;&lt;p&gt;
end function&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
start program&lt;/p&gt;&lt;p&gt;
     print(&quot;-- Add 2 numbers --&quot;);&lt;/p&gt;&lt;p&gt;
     firstnumber = acceptnumber(&quot;Enter first Number:&quot;);&lt;/p&gt;&lt;p&gt;
     secondnumber = acceptnumber(&quot;Enter second Number:&quot;);&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
     print(&quot;Result:&quot; + do_addition( firstnumber, secondnumber ) );&lt;/p&gt;&lt;p&gt;
end program&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
In example 3 I&#039;ve moved the code that does the add calculation into its own function called do_addition.  do_addition accepts the 2 numbers that need to be added and returns the result. I&#039;ve also go ahead and gotten rid of the result variable since its not really used for anything important.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Lets us look at example 4;&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
constants = array (&quot;-- Add 2 numbers --&quot;, &quot;Enter first Number:&quot;, &quot;Enter second Number:&quot;, &quot;Result:&quot;, &quot;addition&quot; );&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
function acceptnumber( screenmessage ) &lt;/p&gt;&lt;p&gt;
     print( screenmessage );&lt;/p&gt;&lt;p&gt;
     return readkeyboard();&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
end function&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
function do_addition( num1, num2 )&lt;/p&gt;&lt;p&gt;
     return num1 + num2;&lt;/p&gt;&lt;p&gt;
end function&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
function get_data_input(settings)&lt;/p&gt;&lt;p&gt;
    print(settings);&lt;/p&gt;&lt;p&gt;
    input1 = acceptnumber(settings);&lt;/p&gt;&lt;p&gt;
    input2 = acceptnumber(settings);&lt;/p&gt;&lt;p&gt;
	return array( input1, input2 );&lt;/p&gt;&lt;p&gt;
end function&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
function get_calculation_output(settings, data_array)&lt;/p&gt;&lt;p&gt;
	if( settings == &quot;addition&quot; ) {&lt;/p&gt;&lt;p&gt;
		return settings + do_addition( data_array, data_array );&lt;/p&gt;&lt;p&gt;
	}&lt;/p&gt;&lt;p&gt;
	return &quot;no work or invalid settings&quot;;&lt;/p&gt;&lt;p&gt;
end function&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
start program&lt;/p&gt;&lt;p&gt;
	data_array = get_data_input(settings);&lt;/p&gt;&lt;p&gt;
	output_text = get_calculation_output(settings, data_array);&lt;/p&gt;&lt;p&gt;
    print(output_text);&lt;/p&gt;&lt;p&gt;
end program&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
In the 4th and final example I when all the way and separated the input of data from the output and calculation.  You maybe able to see various advantages and disadvantages of this method but it was done to demonstrate my final conclusion.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Conclusion&lt;/p&gt;&lt;p&gt;
As you can hopefully see, all four examples do exactly the same thing, except each one becoming increasingly modular, less efficient and more complicated.  I could have done a 5th step and implemented it in OOP but by now you should be able to see my point.  A program can be simple without being modular and on the other be modular but VERY complicated.  A program being modular does not mean that it is simple.  And a modular program is not necessarily more readable that a simple program.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;by owen ()&lt;/strong&gt;  &lt;a href=&quot;http://www.owensoft.net/v4/item/1251/#comment&quot;&gt;Post your comments on this article&lt;/a&gt;&lt;/p&gt;</description>
	  <pubDate>2009-06-04 21:15:37</pubDate>
 </item>

<item>
      <title>Programming Theory: Throwaway Code (Articles)</title>
      <link>http://www.owensoft.net/v4/item/1181/</link>		
	  <description>&lt;p&gt;&lt;/p&gt; &lt;p&gt;In today&#039;s age of new programming languages, frameworks, templates, RAD tools, MVCs and things that pretend not to be MVCs.  A new productivity demon has emerged.  Marketing is promoting easier and easier ways of rapidly creating stable enterprise applications that basically write the code and make your tea at the same time.   At the same time when the adoption rate for the new paradigm is low they seek try desperately to bring over new and old programmers with exciting new buzzwords without offering in really new solutions to old problems.  Programmers are spending an incredible amounts of time writing what I have coined as &quot;Throwaway Code&quot;.  Often referred to as scaffolding though this not directly what I;m referring to in this article.  This article is largely about code lifespan, reuse and its general usefulness in future projects.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
The &quot;Throwaway Code&quot; that I&#039;m referring to is the code that;&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
exists for no other reason except because of some lacking feature in your language. aka The missing feature.&lt;/p&gt;&lt;p&gt;
is tied to a specific framework and will be useless once they find a better way to do it.  aka Framework Hacking.&lt;/p&gt;&lt;p&gt;
is useless design pattern code.  aka Getter Setter&lt;/p&gt;&lt;p&gt;
gets boring fast.  aka Model Boredom&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Now I will explain each of these scenarios.  &lt;/p&gt;&lt;p&gt;
The missing feature&lt;/p&gt;&lt;p&gt;
No programming language is perfect and anybody who says that their programming language is perfect clearly has not written enough code to have a clear understanding of anything.  Each language has their strengths and weakness.  There are often times that you get stuck with a language such as COBOL and you have to write a million lines of code just to print out a table.  When in a different language the same code could be written in 5 lines.  There are times when you can hack your way into the language in order to get what you need but this is not always possible because sometimes the feature you require would need to be well supported at the lowest level of the language.  You will only notice instances like this if you have experience with other languages but it is important to notice.  Time spent casting variables that the compiler has sufficient knowledge about could be spent writing ACTUAL USEFUL NEW CODE.  In time the language will implement the feature and your hacked code will be a memory of times gone by.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Framework Hacking&lt;/p&gt;&lt;p&gt;
I often look back at STRUTS 1 and wonder how could anybody EVER think that that was a good ideal.  Though when you think about it frameworks are written by humans and humans make mistakes from time to time.  Point is all that struts 1 code is now useless.  Besides the things you learn from it, the code itself is useless out of it struts context.  All those lines of code are now replaced by newer, faster and smaller code.  Very little of it can be safely ported into something else.  So basically that code you spent hours carefully putting together is now trash, throwaway code.  Even the sections that you had cleverly custom hacked/coded where all in vain because they were all tightly tied to the framework, solving problems OF the framework rather than problems that evident in the wider scheme of programming.  This is another point to note when it comes to frameworks;  alot of time is spent hacking at the framework,  it cannot really be seen as  programming but more like patching holes in a pot.  Because if the pot was good at the beginning then your time would be spent writing LOGIC CODE as opposed to writing hacking/scaffolding.  Of course&lt;/p&gt;&lt;p&gt;
you may say programming is all about hacking away at useless things for hours on end trying to solve a problem.  However when your hacking away at scaffolding do you really learn anything?  Except maybe the intricacies of a not so perfect framework?&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Getter Setter&lt;/p&gt;&lt;p&gt;
Now the problem of useless design pattern code seems to be popping up ever so often nowadays especially in OOP.  OOP seems to be eating alot of its own dogs food.  I tend to see the programmer writing code for no other reason than to make it easier for the tools that they use, so that the tools can generate more code for the programmer to write.  I&#039;ve mentioned this before. Point is depending on where you are in the evolution of a language/framework there is alot of code that you&#039;ll be writing &quot;just-because&quot;.  I remember concatenating strings in C.  Although ignorance in bliss, there are things that you really don&#039;t need to do.  Having to type the same thing 4 or 5 times in the guise of improving maintenance and extensibility is nonsense, its redundancy.  There is always a better way to do things.  It often evident after the language is replaced with something new.  At this point there is a great enlightenment &quot;omg version 3 is so cool&quot;.  But no one will admit that version 1 sucked all hell - ESPECIALLY when its just out of beta.  Its not even about evolution, certain basic programming paradigms are being ignored or hacked around.  Singletons anybody?  Even auto generated code has crazy drawbacks and redundancies that pop up only during maintenance.  If you &lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Model Boredom&lt;/p&gt;&lt;p&gt;
I&#039;ve only noticed this in one case with one particular language.  It seems that with MVC programmers become obsessed with creating a web of models, deleting them entirely and then re-creating them again.  As if they are never satisfied with the model OR maybe its just too boring to update OR some new feature comes out that requires a total re-thinking OR maybe they are just get sick of it entirely after a year of playing with it.  These model changes are usually not evident because the output is usually not affected.  I will have to look into this more but your opinions on this topic are welcome.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Conclusion&lt;/p&gt;&lt;p&gt;
Programming is becoming more and more abstracted and as a result much of the code written simply exists as scaffolding.  Soon to be replaced by the next big iteration or framework bug fix.  In reality it may be nothing new, a right of passage or growing pains.  But one thing is for sure; the bigger the API - the greater the chance that 90% of your code will end up in the recycle bin or frozen in time.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;by owen ()&lt;/strong&gt;  &lt;a href=&quot;http://www.owensoft.net/v4/item/1181/#comment&quot;&gt;Post your comments on this article&lt;/a&gt;&lt;/p&gt;</description>
	  <pubDate>2008-11-23 23:55:32</pubDate>
 </item>

<item>
      <title>Managing complexity in Software Development (Articles)</title>
      <link>http://www.owensoft.net/v4/item/1148/</link>		
	  <description>&lt;p&gt;&lt;/p&gt; &lt;p&gt;In programming, sooner or later you will come up with a solution to a problem that is somewhat &quot;complex&quot;.  The said solution may be advantageous to the program in various ways.  The thing to note is that you should ensure that his complexity is &quot;contained&quot;.  Far too often software developers let a complex solution to a simple problem seep in to the body of the program itself.  As a result making the entire program unecessarily complex.  Miracle solutions are proposed to increase productivity through various catch words that end with &quot;-ibility&quot;.&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;
For example the index page of my website is probably the most complex page in the entire website.  Yet the website itself is quiet simple.  The index page was not quite as complex as it was now.  Originally it was a series of IF statements that directed the visitor to a requested page based on various parameters.  IF PAGE == ABOUT THEN LOAD ABOUTPAGE.  It was really REALLY simple.  One day I realised that if I could find a uniformed way of determining the next page then I could replace all the IF statement was a controller or MVC (as they call it now a days).  The new solution required careful thought.&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;
As with every line of code or function created there are things to consider;&lt;/p&gt;&lt;p&gt;
How is changing this page going to make the other existing pages BETTER.&lt;/p&gt;&lt;p&gt;
How is changing this page going to make the other existing pages WORST.&lt;/p&gt;&lt;p&gt;
how is changing this page going to affect the quality of code as a whole.&lt;/p&gt;&lt;p&gt;
Will changing this page make the other pages more complex or less complex.&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;
These are important points to consider when dealing with complexity.  You should always beware of things that may unessarily complicate the entire program offering shortterm benefit but long term headache.  If I had suddenly woke up and decided to change the index page to use a random MVC without considering how the actual MVC would affect the complexity of the program itself then I would have made a grave mistake which leads to people discontinuing software a year after it was implemented.&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;
All things must be considered in light of the shortterm and the longterm when developing software.  A piece of software that starts out complex will not get simpler as you develop it.Keep the simple parts simple It will only get more complicated until it collapses under the wieght of its own complexity.  In the same light something very simple can be complicated by a misplaced bottle neck in the &lt;a rel=&#039;external&#039; href=&#039;/v4/item/719/&#039; title=&#039;system&#039;&gt;system&lt;/a&gt; that was implemented on a &quot;whim&quot;.  Implementing features on a &quot;whim&quot; or ad hoc without considering its benefits is the fastest way to complicate what was once a simple program.  Keep your eye on the important parts of the program to ensure that it remains simple and that any complex algorithms and concepts are &quot;Functionalized&quot; away from the program&#039;s core purpose.&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;
In the case of my index page (which loads all the other pages) it may seem to be against what I just said - a very complicated concept deep within the core of the application.  The thing to note is that the index page itself is a FUNCTION.  What it does is completely independent of the program.  It can easily be replaced because the other pages are not affected by it, nor thou or both shall go with him. hmmm. It is a function.  An important function but a function none the less.  The other pages on the site are unaware of its existance and so are not affected by any low level changes that I make to it.  The sub pages behave as if they are in a vacuum, unaffected by the index page.  It is not a typical MVC that seeks to solve a problem by controlling/limiting structure rather than providing a genuine solution to the structure problem.&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;
What I could have done and what most people do is make the index into a class.  And then enslave other pages into a &quot;house of cards&quot; situation.  Now instead of isolating the solution to a problem of IF statements - the programmer ends up complicating the entire program in order to simplify it.  I am not saying that wide spread refractoring is not necessary.  I am saying that the inplementing complex solutions to a problem should not be allowed to complicate the program as a whole.  Find a way to solve the problem without creating thousands of little problems/new workflows in the progress.  Alot of this is explained to more dept in &lt;a rel=&#039;external&#039; href=&#039;http://en.wikipedia.org/wiki/Anti-pattern&#039; title=&#039;software engineering anti-patterns&#039;&gt;software engineering anti-patterns&lt;/a&gt;&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;
Now for the code.&lt;/p&gt;&lt;p&gt;
Here I will list elements that add complexity when writing programs;&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;
IF THEN ELSE Statements:  Avoid having a catch all &quot;else&quot; statement. Usually it leads to logic bugs and poor clean up.&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;
Avoid unecessary class implementations:  There is nothing more annoying than having to do a &quot;new&quot; every single time you want to use a base class.  Its pointless.  If you only need one instance at a time why is it a class?  Make a single function that manages itself.  Always ensure that you know the ;why&quot; behind everything you program so that you can better make it when it needs to change.&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;
Avoid giving yourself future work or more per-module work: Now I understand that some people like the whole &quot;house of cards&quot; thing but really now.  It is easy to copy development documents off the internet and pass then off as your own but hard to implement something that you have no expirence in using.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Avoid doing the same thing over and over with slight per-module changes: This is a another sign of a train wreak waiting to happen. Sooner or later you are going to have to refactor all those slight changes and you will realize that 3 lines at the top of every module was simply there to make you feel productive but added nothing to the program.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Avoid tight coupling of you classes.  This often occurs by using checked exceptions to force calling processes to handle them.  Hence causing every calling program to be tied to a useless/decorative exception tree of choas.&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;
Avoid eating you own dog food:  I cannot stress this enough.&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;
Avoid fragmenting processes: There are times when you may be tempted to create a function for the purpose of simplifing a process.  This usually happens when you have so much code that its difficult to really keep track of what is going on.  In such a case avoid creating singleton functions that look like functions but are infact big GOTO statements.  These singleton functions usually have to be called in a specific order and a specific custom object has to passed to them.  Its better to just keep it all in one function with good documentation.  Ten random singleton functions are neither helpful nor do make the program easier to read/manage.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;
Avoid classes with too many setup functions:  Some may think its a good idea but classes should manage as much of its internal processes as possible.  Avoid;&lt;/p&gt;&lt;p&gt;
c = new calc class;&lt;/p&gt;&lt;p&gt;
c.setid(10);&lt;/p&gt;&lt;p&gt;
c.setname(&#039;test&#039;);&lt;/p&gt;&lt;p&gt;
c.getdata();&lt;/p&gt;&lt;p&gt;
c.getresultset();&lt;/p&gt;&lt;p&gt;
ans = c.calculate();&lt;/p&gt;&lt;p&gt;
Its better to create a function called ans = calculate_test(10, &#039;test&#039;);  Not only do you have less lines of code (per call) but the test calculation process is encapsulated.&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;
Avoid try-catch-throw logic: if a function is boolean it should return true or false.  It shouldn&#039;t throw random exceptions to the calling function.  Try-catchs are often used as a lazy form of IF-ELSE.  Situations like this should be avoided for the same reason as mention before.&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;
Avoid bandaid errors, hiding errors and non-specific error messages.  A system is not secure if its errors need to be a secret.  Having clear error messages allows for quickly identifying problems during the development and testing phase and evening during the life of the system.  Searching through log files for errors that could have been easily displayed to the user is a waste of time.  Critical errors can be missed that are hidden for years in log files and catch statements.  The last thing you want is someone to be calling you in the middle of the night about some program that you wrote 5 years ago.  Assume All errors are fatal!&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;
Assume all errors are fatal.  Often times errors are ignored or logged at lower levels of the program and the program is allowed to continue.  This is often done to prevent the program from crashing.  PROGRAMS CRASH its what they do when something is wrong.  It is more important in program processes to identify WHEN a error occurs as opposed to the order.  Log files are good are error order but poor for edge case event errors.&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;
Conclusion&lt;/p&gt;&lt;p&gt;
If your going down the wrong road it never too late to turn back.  A poorly written program is only good as long as no one knows about it.  You can throw as much RAM or HARDWARE at it as you want.  Sooner or later it will get replaced by a off the shelf software that is probably JUST AS BAD OR WORST THAN your custom developed software.  And the software you wrote will be just another skeleton in your closet. The main difference will be that the off the shelf software has learned to manage its complexity, increase flexibility while meeting user requirements.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Often times there is nothing you can do but to just run with what you have, make as much documentation as you can and pray for the future developers.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;by owen ()&lt;/strong&gt;  &lt;a href=&quot;http://www.owensoft.net/v4/item/1148/#comment&quot;&gt;Post your comments on this article&lt;/a&gt;&lt;/p&gt;</description>
	  <pubDate>2008-09-26 10:56:20</pubDate>
 </item>

<item>
      <title>Hardwiring: programming the design (tech) (Articles)</title>
      <link>http://www.owensoft.net/v4/item/1011/</link>		
	  <description>&lt;p&gt;&lt;/p&gt; &lt;p&gt;There is a tendancy to write your use case directly into the low level design of the code.  This pattern should be avoided as much as possible because it results in extensive &quot;recoding&quot; whenever high level design changes are made to the program.  The highlevel design is not caved in stone and will most likely change as the system evolves but its core design rearly changes.  It is important for the programmer to identify this core design.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
For example an extreme case can be seen when the previous programmers wrote a screen for the 10 department types that are in the system - assuming that there would only be 10.  As you can see hardcoding or hardwiring your use case rules into your code is not a good thing.  The programmer wrote the code on the &quot;business logic&quot; instead of the &quot;&lt;a rel=&#039;external&#039; href=&#039;/v4/item/719/&#039; title=&#039;system layer&#039;&gt;system layer&lt;/a&gt;&quot;.  &lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
It is important to notice that there is a system below the business logic.  This system is what keeps the application simple and stable.  The programer should seek to find the best way to rewrite the highlevel business logic into a stable sub system.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Take for instance the previous example:  you can imagine that the programer got a use-case with 5 rows and 2 column of 10 items.  The programmer looked at the first line of the use case and started coding right away (and in truth and in fact probably coded it in half the time that I would take to code it).  The end result will work and will have the same output but the difference between the 2 approachs to the problem is night and day.  Further down in the project the need MAY arise to add a new type of department.  You should notice that the business logic in the use cases DOES NOT BREAK but the code that was written to implement the use case fails and the blame goes on the programmer even though the programmer did what the use case said should be done.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Another example:  bank type.  You notice that the use cases specify particular actions that occur on certain types of banks.  And these types of banks are hard coded into the system.  Business logic constants are bad design.  This implementation is done like so:&lt;/p&gt;&lt;p&gt;
BANK_TYPE1 = 1&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
SELECT * FROM BANKS, BANK_TYPE WHERE BANK.TYPE_ID =  BANK_TYPE.ID AND TYPE = &lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
IF BANK.TYPE == BANK_TYPE1 THEN &lt;/p&gt;&lt;p&gt;
	DO BUSNIESS LOGIC&lt;/p&gt;&lt;p&gt;
END IF&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
The shortfall of this type of programming is the SAME as the 10 item example above.  If for instance a new bank type is added that implements the same business logic as that of BANK_TYPE1 then the code will have to be CAREFULLY altered to facilitate the change to the design.  Here is the new code:&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
BANK_TYPE1 = 1&lt;/p&gt;&lt;p&gt;
BANK_TYPE_TWO = 3&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
SELECT * FROM BANKS, BANK_TYPE WHERE BANK.TYPE_ID =  BANK_TYPE.ID AND TYPE =  or TYPE = &lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
IF BANK.TYPE == BANK_TYPE1 THEN &lt;/p&gt;&lt;p&gt;
	RETURN (BANK_TYPE1) BUSNIESS_LOGIC1()&lt;/p&gt;&lt;p&gt;
END IF&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
IF BANK.TYPE == BANK_TYPE_TWO THEN &lt;/p&gt;&lt;p&gt;
	RETURN (BANK_TYPE_TWO)  BUSNIESS_LOGIC1()&lt;/p&gt;&lt;p&gt;
END IF&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
In the best case senario the same programmer will be able to remember how the program works and change all the places that need to be changed to fix the problem.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
The solution to this problem requires a system level design change that will protect the code (the programmer) from changes/enhancements to the design.  There are many ways that this can be done and the best way often takes more time and therefore the benefits of such an change must be evaluated during development by the programmer.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
---&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
The point here is that it that the use cases are not low level designs.  The progammer should ( whenever possible ) try to abstract the effects that changes have on the code which is written, by writing it in a way such that it is flexible enough to absorb business logic/design changes that may occur in the future.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;by owen ()&lt;/strong&gt;  &lt;a href=&quot;http://www.owensoft.net/v4/item/1011/#comment&quot;&gt;Post your comments on this article&lt;/a&gt;&lt;/p&gt;</description>
	  <pubDate>2008-03-24 20:22:45</pubDate>
 </item>

<item>
      <title>How to tell if you are an IT person (Articles)</title>
      <link>http://www.owensoft.net/v4/item/924/</link>		
	  <description>&lt;p&gt;&lt;/p&gt; &lt;p&gt;Mesha this is for you.  I will try to keep this simple and to the point because some of us like to argue and some of us don&#039;t.  I will start out by listing the qualifications that either by themselves or combined will result is a person who can call themselves a techie or an IT person.  This article is written because I&#039;ve realized that now in Jamaica since it seems that people have started to call themselves &quot;IT persons&quot; without fully clearing the bits or understanding what it actually means.  By IT I mean &quot;Information Technology&quot; or Computer Science or whatever related field you choose. So here now I start with a list.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
You are and IT person IF;&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
You like lists.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
You like to play games for long hours, develop habits easily and have at some point in your life completed a mario brothers game.  Though not necessarily beat the game but have tried on multiple occasions.  This is however not limited to video games but anything involving a winner and a loser such as card games and games of luck or skill.  You should be able to play many games at least 3 - not just one that somebody taught you.  And be up for playing ANYTHING that looks like a game that you can win.  Games can include mind games, board games, random text messaging.  Solitaire is not a game.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
IT people like to solve problems and hate doing the same thing twice.  If an activity doesn&#039;t solve some kinda problem that will save somebody &quot;work&quot;, time or money then more than likely you are a &quot;packer&quot;.  If you&#039;ve done it before and are still doing it without improvement then you can&#039;t see the rabbit.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
If you are disgusted by the behaviour of IT people and think that they are lazy, selfish and inconsiderate then you are most definitely not an IT person.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Having an IT degree or qualification or working with computers or teaching does not automatically give you the right to call  yourself and IT person.  You merely &quot;associate&quot; with IT people but you haven&#039;t crossed that line where you start avoiding people and not returning calls.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Working at an IT company doesn&#039;t not make you and IT person.  &lt;/p&gt;&lt;p&gt;
If you ever reach to a state where your too busy to brainstorm a solution to a problem or have a concept in your head that is called &quot;work&quot; such as can be compared to farming, manual labour or mining coal - then more than likely you are in it for the money are not an IT person but rather a slave to the money.  Go and follow your dreams.  No matter how far down the wrong road you&#039;ve travelled - its never too late to turn back.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
IT people do not like to use powerpoint or write lengthy essays.  If you like to write multipage essays then chances are you are not an IT person.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Most IT people that I know like what they do, it might not seem that way but its true.  On the other hand if you would rather be flying around the world, teaching kindergarden, or staring in a rock band then chances are you are not an IT person.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
If your monitor is set to 800x600 then I really don&#039;t know what world your living in.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
If you are confused or fail to see why I would list these things are behavioral patterns of IT people then chances are you cannot relate and are NOT AN IT PERSON.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
This list that I have compiled more than likely is not complete and millions of ways could be found to argue around it.  Whether depending on whether you are a woman or a man or your from the country or whatever - it doesn&#039;t really matter because most people either are who they say they are or are pretending to be a doctor.  To each his own.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;by owen ()&lt;/strong&gt;  &lt;a href=&quot;http://www.owensoft.net/v4/item/924/#comment&quot;&gt;Post your comments on this article&lt;/a&gt;&lt;/p&gt;</description>
	  <pubDate>2007-11-25 19:47:55</pubDate>
 </item>

<item>
      <title>Quick: How to setup and run php-apache on win2k sp4 (Articles)</title>
      <link>http://www.owensoft.net/v4/item/782/</link>		
	  <description>&lt;p&gt;&lt;/p&gt; &lt;p&gt;Friday, May 18, 2007, 7:15:29 PM&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
&quot;for people who have installed something before&quot;&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
goto (link)&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
download the last &quot;PHP x.x.x installer&quot;  it should be about 22 mb by now.  Php has 2 streams;  a 4.x stream and a 5.x stream.  Check which version your web host will give you access to.  If your only going to play with it on your machine then just go for the lastest version.  But remember that if you start using features of 5 you might have a little difficulty running it on 4.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Downloading the Apache HTTP Server &lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Go to (link) and download the &quot;HTTP Server&quot;.  Which also has 2 streams but the instructions above still apply.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Start installing&lt;/p&gt;&lt;p&gt;
Install the Http Server&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Install Php&lt;/p&gt;&lt;p&gt;
Run the php Installer.  It might ask you to setup a server for ex appache and select the folder which contains the configuration files ( C:Program FilesApache Software FoundationApache2.2htdocs )&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Do not enable all the php modules, pick the ones that you know you want because sometimes the modules have external requirements that may prevent you from starting,&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Got to Start//Programs//Apache and then search the option to restart your http server.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Installation Done&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Goto&lt;/p&gt;&lt;p&gt;
C:Program Files/Apache Software Foundation/Apache2.2/htdocs&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
create a text file&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
call it &quot;p.php&quot;&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Edit it with a text editor (preferable editplus from (link) )&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
add this code to the file;&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
&lt;?&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
phpinfo();&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
?&gt;&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
save the file.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
OPen you browser and goto;&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
(link)&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
You should see a long purple table with the php logo.  Your good to go.  Setup was successful.  That directory is now your webserver, so can only run php programs from the for now.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
More stuff to do&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
(link)&lt;/p&gt;&lt;p&gt;
►Another problem is that people many times use OLD PHP script that uses &#039;short tags&#039;. That is when the PHP declarative starts with &lt;?. Since at least PHP 4, the default for opening PHP script has been &lt;?php. If you are using script with short tags, then you can do one of two things. Either change ALL of your opening tags to &lt;?php, or edit you PHP.INI file changing short_open_tag to ON. &lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Other&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
You might also want to install a database such as Mysql&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
If you run the Mysql 5 install do not enable &quot;strict mode&quot;.  Its really really really strict.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Might also want to get phpmyadmin&lt;/p&gt; &lt;p&gt;&lt;strong&gt;by owen ()&lt;/strong&gt;  &lt;a href=&quot;http://www.owensoft.net/v4/item/782/#comment&quot;&gt;Post your comments on this article&lt;/a&gt;&lt;/p&gt;</description>
	  <pubDate>2007-07-01 15:17:15</pubDate>
 </item>

<item>
      <title>Gene find triggers baldness hope (Articles)</title>
      <link>http://www.owensoft.net/v4/item/750/</link>		
	  <description>&lt;p&gt;&lt;/p&gt; &lt;p&gt;Hair loss in humans might be reversible, suggest scientists who have helped create new hair cells on the skin of mice.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
It was thought hair follicles, once damaged, could never be replaced.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
But a University of Pennsylvania, US, team, writing in the journal Nature, says hair growth can actually be encouraged using a single gene. &lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Read more &lt;a rel=&#039;external&#039; href=&#039;http://news.bbc.co.uk/2/hi/health/6661849.stm&#039; title=&#039;BBC NEWS | Health | Gene find triggers baldness hope&#039;&gt;BBC NEWS | Health | Gene find triggers baldness hope&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;by mad bull (&lt;a href=&quot;http://www.madbull4.net/&quot; rel='external'&gt;www.madbull4.net/&lt;/a&gt;)&lt;/strong&gt;  &lt;a href=&quot;http://www.owensoft.net/v4/item/750/#comment&quot;&gt;Post your comments on this article&lt;/a&gt;&lt;/p&gt;</description>
	  <pubDate>2007-05-22 06:51:01</pubDate>
 </item>

<item>
      <title>The System Layer (Tech) (Articles)</title>
      <link>http://www.owensoft.net/v4/item/719/</link>		
	  <description>&lt;p&gt;&lt;/p&gt; &lt;p&gt;In this day and age of highly complex business applications, which encompass a wide array of solutions to real world problems, it is essential to note the importance of application logic.  Application logic or The System Layer is the track on which the business logic of any system must be built so that it travels at a constant, steady and predictable pace.  Applications built on business logic are roll-a-coasters of terror.  It is often easy for a software developer to take the &quot;customer is always right&quot; approach to programming software.  And in so doing build applications that are based entirely on the business logic of the client.  This is a common pitfall which although creates wonderful entity relationship diagrams requires an extensive knowledge of the client business logic to maintain, upgrade and optimize.  You end up in a situation where the application becomes a exquisite dish that must be prepared by a Tibetan monk.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
In a client environment where business logic is often mapped to physical tasks that can range from a very simple process to a complex maze of activities, sustainable applications need to be built on a simple, predictable backbone aka a System Layer.  The system layer is akin to how a computer works with 1s and 0s or in genetics with DNA.  If you want to build an application you are essentially putting together some 1s and 0s.  You use 1s and 0s because its a standard, easy to use and relatively simple setup that the computer and other people already understand.  1s and 0s are a part of what I refer to as &quot;the system layer&quot; - the basic rules on which software is built.  The system layer aims to provide a layer of simplicity to an otherwise complex application.  Keep the application simple at its base and complex in specific branches.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Maybe I am being a bit extreme when I chose to use 1s and 0s as an example.  Say for instance a file in an operating system.  A file at its basic level has no business logic - it can be anything at anytime and the operating system would not careless.  This &quot;carefree&quot; attitude is why operating systems are the most widely used type of software.  In operating systems &quot;business logic&quot; is often implemented at the GUI level.  The act of forcing users to create files that consist of names and extensions is enforced In the &quot;file-browser&quot; but never are the core level.  Operating systems provide a system layer in which your application can operate efficiently - you are a &quot;client&quot; of the operating system.  The operating system can maintain its efficiency by maintaining a stable System Layer.  Building an application on business logic is like building the whole operating system again, but your files are not just files - they are whatever the business logic dictates. This creates a situation in which a rabbit is never really a rabbit unless you know that it is a rabbit.  And in most cases the people who &quot;know&quot; and the people who &quot;want to know&quot; aren&#039;t the same people - in said scenario a rabbit might swim or fly depending on a status, type table, or season.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Application Logic or A System Layer aims to improve stability, predictability, extensibility and maintainability of software application by creating a simple set of fundamental rules upon which business logic is implemented.  All Files have a name, meta data and content.  RABBITS DONOT FLY UNLESS TOLD TO FLY.  Developing a system layer does require research and thought; you must be willing to stick with it FOREVER, through thick and thin, rain or storm.  Bypassing the system layer even a little would be blasphemous.  Unless such a time a rises that a piece of business logic should totally destroy your tracks.  Well built tracks last forever, roads develop potholes.  Keep it simple, open and efficient at its base and finding problems will be easier, isolated and less magical in other areas of the system.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;by owen ()&lt;/strong&gt;  &lt;a href=&quot;http://www.owensoft.net/v4/item/719/#comment&quot;&gt;Post your comments on this article&lt;/a&gt;&lt;/p&gt;</description>
	  <pubDate>2007-04-23 21:34:18</pubDate>
 </item>

<item>
      <title>The Sweetest Taboo (Explanation of blog post) (Articles)</title>
      <link>http://www.owensoft.net/v4/item/658/</link>		
	  <description>&lt;p&gt;&lt;/p&gt; &lt;p&gt;This is a sorta explaination of the post &quot;&lt;a rel=&#039;external&#039; href=&#039;/v4/item/655/&#039; title=&#039;The Sweetest taboo&#039;&gt;The Sweetest taboo&lt;/a&gt;&quot; since people didn&#039;t really get it.  You should read that first before venturing off into this.  Most of my posts - well all have 3 paragraphs which often times do not interact.  Avoid trying to make sense of it as a whole.  Sometimes I will make the effort and write a full essay but those times are rare and far between.  Took a couple hours but I&#039;ve managed to link every reference I could find.  I&#039;d like to thank Youtube.com, my mother and all the people who didn&#039;t annoy me.  The notes are * emphased or highlighted in yellow on my site.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
The explanation&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
The sweetest taboo *reference song &lt;a rel=&#039;external&#039; href=&#039;http://youtube.com/watch?v=1WGR2dvA_xQ&#039; title=&#039;The sweetest taboo&#039;&gt;The sweetest taboo&lt;/a&gt; by Sade Adu&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
*Taboo is noun meaning a social or religious custom prohibiting or restricting a particular practice or forbidding association with a particular person, place, or thing.  Its also from one of my favorite artists Sade Adu.  Its off an album called Promise by Sade.  The &quot;Best of Sade Album&quot; was stolen from a roommate in New York in 2001 - I loved it so much.  The album defined my entire trip.  I was in the Bronx with my grandmother.  Then the whole 9/11 thing happened and I came home a week later.  Watched it live because the other public channels stopped working when they too out the tower.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
submitted on 07th Jan 2007 to Logbook  *first post of 2007&lt;/p&gt;&lt;p&gt;
submitted by owen * I are di one&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Its been sometime since we last spoke.  *reference to a song called &quot;&lt;a rel=&#039;external&#039; href=&#039;http://www.youtube.com/watch?v=eiiU-Fky18s&amp;eurl=&#039; title=&#039;Cupid&#039;s Chokehold&#039;&gt;Cupid&#039;s Chokehold&lt;/a&gt;&quot; by the GymClassHeroes.  In which the protagonist writes to his mother about his love life. Very good song and video. &lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
When I was a young boy my momma said to me &quot;There&#039;s only one girl in the world for you and she probably lives in Tahiti &quot;.  *From a song by &lt;a rel=&#039;external&#039; href=&#039;http://www.wrecklesseric.com/&#039; title=&#039;Wreckless Eric&#039;&gt;Wreckless Eric&lt;/a&gt; called &lt;a rel=&#039;external&#039; href=&#039;http://www.wrecklesseric.com/whole_wide_world.htm&#039; title=&#039;Whole Wide World&#039;&gt;Whole Wide World&lt;/a&gt; which I found a &lt;a rel=&#039;external&#039; href=&#039;http://downandoutmusic.wordpress.com/2006/11/09/wreckless-eric-whole-wide-world/&#039; title=&#039;review &amp; mp3&#039;&gt;review &amp; mp3&lt;/a&gt; from the Stranger Than Fiction - Original SoundTrack.  &lt;a rel=&#039;external&#039; href=&#039;http://video.google.com/videoplay?docid=-8068393268110693126&#039; title=&#039;Stranger Than Fiction&#039;&gt;Stranger Than Fiction&lt;/a&gt; is a movie I watched the week before about a Tax auditor who is hearing his life being narrated by a voice in the sky.  Good movie.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Luckily, being as I am, I do not think of it much, illusions of grandeur are not entertained. Only fools rush in. *reference &quot;&lt;a rel=&#039;external&#039; href=&#039;http://youtube.com/watch?v=hmp5mpsDnGc&#039; title=&#039;Can&#039;t help falling in love&#039;&gt;Can&#039;t help falling in love&lt;/a&gt;&quot; by UB40 It is hard to resist like spiked christmas sorrel. It had so much alcohol in it that it didn&#039;t even taste like sorrel. Being red was its only alibi. I poured it half full and attempted to over-power the spirits with ice water like an exorcist. *reference to year&#039;s week post &lt;a rel=&#039;external&#039; href=&#039;http://www.owensoft.net/v4/item/646/&#039; title=&#039;Love is lame&#039;&gt;Love is lame&lt;/a&gt; Little did it do. *Stranger Than Fiction I won&#039;t be your father figure, put your tiny hands in mine.  *reference song &quot;&lt;a rel=&#039;external&#039; href=&#039;http://youtube.com/watch?v=Z64BHHBHT00&#039; title=&#039;Father Figure&#039;&gt;Father Figure&lt;/a&gt;&quot; by George Michaels&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
* The entire second paragraph is about my taboo.  Which ties into the title of the post.  The title of the post usually has nothing to do with the content but this one seemed fitting.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
As I look down in to her eyes and stare. In deep thought about nothing I look fixedly with my eyes wide open until she starts to giggle profusely [] *Something that is profuse is poured out or given freely, often to the point of exaggeration or excess. like a school girl at a fair. A fair that has a bounce-a-bout, merry-go-round and cotton candy. * Refers to Brooks park in Mandeville Jamaica, where I grew up as a child.  You could only get cotton candy at fairs back them  A confused look rolls over her face - trying to fathom my thoughts.  *apparently I confuse people often  At which point I break my silence and move towards her lips, thats all I wanted, its a little bit more than it seems.  *reference to a song  &quot;More Than It Seems&quot; &lt;a rel=&#039;external&#039; href=&#039;http://rcarecords.com/download/cope/morethanitseems.mp3&#039; title=&#039;mp3&#039;&gt;mp3&lt;/a&gt; by &lt;a rel=&#039;external&#039; href=&#039;http://www.google.com/search?hl=en&amp;lr=&amp;safe=off&amp;client=safari&amp;rls=en&amp;q=Citizen+Cope&amp;btnG=Search&#039; title=&#039;Citizen Cope&#039;&gt;Citizen Cope&lt;/a&gt; Sad eyes turn the other way.  * reference &quot;Sad Eyes&quot; by the Bee Gees Let me show you how much I care. *reference &quot;The reasons Unknown&quot; by The Killers As I watch the clock, time slowly drifts *water on, it becomes hard to concentrate.  Something in the way she moves. * reference &quot;&lt;a rel=&#039;external&#039; href=&#039;http://youtube.com/watch?v=wBe85UKa1GQ&#039; title=&#039;Something&#039;&gt;Something&lt;/a&gt;&quot; by the Beatles 1969  Sometimes I find myself lost in the glow of her shiny nose like a meteor drawn dangerously into the earth&#039;s path, emitting light as a result of being heated.  As the separation anxiety *SNES video game with Venom and Spiderman begins to sink in *water, nothing is quite the same but if it makes you happy why are you so sad?  *reference song &quot;&lt;a rel=&#039;external&#039; href=&#039;http://youtube.com/watch?v=Bzn8HbKlAzU&#039; title=&#039;If it makes you happy&#039;&gt;If it makes you happy&lt;/a&gt;&quot; by Sheryll Crow It may take sometime to recover. This has been the worst December ever.  *really  Love me for who I am.  *stop trying to figure me out, I&#039;m not weird&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
It has been a stressful new year. Not counting the people who have been murdered so far. *25 in a week Being murdered I imagine would be more than stressfull. I was just getting accustomed to 2006 when it came to a hard, bitter and infuriating end. No Mavado watch. *christmas present mission influenced by Tash to get myself a watch from a girl for christmas by any means necessary - failed Children killing children while the students rape their teachers. We can&#039;t carry these sins on our back, we gonna swim to the ocean floor, crash to the other shore.  *water *reference &quot;Swim&quot; by Madonna off the Ray Of light Album All we need is love * Beatles and snow * Snow falling in Jamaica would reduce the crime rate - its a theory, I pray for it nightly.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Conclusion&lt;/p&gt;&lt;p&gt;
There you have it, took a while to compile but its done.  Won&#039;t be doing that again.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;by owen ()&lt;/strong&gt;  &lt;a href=&quot;http://www.owensoft.net/v4/item/658/#comment&quot;&gt;Post your comments on this article&lt;/a&gt;&lt;/p&gt;</description>
	  <pubDate>2007-01-14 21:06:00</pubDate>
 </item>

<item>
      <title>The Voting Bathroom Analogy (Articles)</title>
      <link>http://www.owensoft.net/v4/item/621/</link>		
	  <description>&lt;p&gt;&lt;/p&gt; &lt;p&gt;Voting is like washing your hands in the bathroom, there is no &quot;instant&quot; benefit to it and the &quot;I told you so&quot; that you get is often not a direct fault of not washing you hands but is a fault of going to the bathroom.  It would help if you could avoid the bathroom all-together but most people are born into the bathroom.  Being born into a bathroom offers you advantages which you get because people wash their hands.  Some people just like to wash their hands because it makes them feel good, others wash because they get a bad taste in their mouth when they lick their fingers and some don&#039;t wash at all and choose to live like rebels.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
The existence of the bathroom is never really-actually-clearly-significantly defined to those that do not benefit from it.  Worst yet only the people that benefit from the regular use of the bathroom and posses the knowledge of it can efficiently use the bathroom for social gain.  So encouraging others to wash their hands is therefore crucial to these people.  The more people that wash allow the bathroom operates to be in a better position to create social gain from the bathroom.  Because the people who understand the bathroom the most are often the people who built it, they are ever present.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
The importance of the bathroom is not understated but is known to almost half the population.  The inner workings of the bathroom are important but the importance cannot be conveyed to the people who willingly or ignorantly do not was their hands.  Lets say that everybody starts to wash their hands; in such a case it would be apparent that the ill effects of not washing you hands would totally disappear.  If it is not possible for everybody to wash their hands and in fact doesn&#039;t matter if everybody washes their hands then the purpose of washing your hands becomes irrelevant.  The proper use of the bathroom seems to be more important.  Therefore, if the bathroom in used correctly then why wash your hands?&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
The answer to the question is multifaceted.  Apparently either nobody trusts the bathroom or the bathroom is setup in such away that you have to make a choice.  The choices are always limited.  Limiting the choices seems to be a trend that existed since the beginning of the bathroom itself.  Polar choices are setup, choices are often re-shuffled upon each entrance to the bathroom, the choices are or may appear to be different but you still wash your hands the same way.  The choices are often make to seem obvious but have little to do with the actual outcome in the worst cases.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;by owen ()&lt;/strong&gt;  &lt;a href=&quot;http://www.owensoft.net/v4/item/621/#comment&quot;&gt;Post your comments on this article&lt;/a&gt;&lt;/p&gt;</description>
	  <pubDate>2006-11-09 16:13:43</pubDate>
 </item>

<item>
      <title>The Bleach Incident (Articles)</title>
      <link>http://www.owensoft.net/v4/item/485/</link>		
	  <description>&lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt;&lt;p&gt;
NK says: hi&lt;/p&gt;&lt;p&gt;
NK says: you there ?&lt;/p&gt;&lt;p&gt;
owen says: sup?&lt;/p&gt;&lt;p&gt;
NK says: I was hospitalized for 2 days... for the first time in Canada&lt;/p&gt;&lt;p&gt;
NK says: that too... with an Ambulance pickup&lt;/p&gt;&lt;p&gt;
NK says: yesterday, I came out of Hos...&lt;/p&gt;&lt;p&gt;
owen says:  :O&lt;/p&gt;&lt;p&gt;
owen says: man, what happened?&lt;/p&gt;&lt;p&gt;
NK says: I was inhaled strong and punget... smell of bleach / Javex&lt;/p&gt;&lt;p&gt;
NK says: which I was not aware .... when I was doing some cleaning  in the bathroom&lt;/p&gt;&lt;p&gt;
NK says: unfortunately, because of winter all the doors and windows were closed...&lt;/p&gt;&lt;p&gt;
NK says: and I fell short of breath....&lt;/p&gt;&lt;p&gt;
owen says: oh,&lt;/p&gt;&lt;p&gt;
NK says: had to run of the house for air.... in  - 12 centigrade..., snow&lt;/p&gt;&lt;p&gt;
NK says: for 30 - 40 min.&lt;/p&gt;&lt;p&gt;
NK says: and finally ran into Hypothermia&lt;/p&gt;&lt;p&gt;
NK says: next door neighbour called the ambulance&lt;/p&gt;&lt;p&gt;
NK says: to rescue the situation&lt;/p&gt;&lt;p&gt;
owen says: man you almost killed you self!&lt;/p&gt;&lt;p&gt;
NK says: I guess....&lt;/p&gt;&lt;p&gt;
NK says: yes&lt;/p&gt;&lt;p&gt;
NK says: it was very unfortuante situation&lt;/p&gt;&lt;p&gt;
owen says: you doing better now?&lt;/p&gt;&lt;p&gt;
NK says: Yeah... I am &lt;/p&gt;&lt;p&gt;
NK says: I still feel fragile...&lt;/p&gt;&lt;p&gt;
NK says: Luckily,... I have healthcard...&lt;/p&gt;&lt;p&gt;
owen says: you&#039;ll be back up to strength in a couple a days&lt;/p&gt;&lt;p&gt;
NK says: and did not incur and bills&lt;/p&gt;&lt;p&gt;
NK says: yes, you are right&lt;/p&gt;&lt;p&gt;
NK says: that would be fair enough time , i guess&lt;/p&gt;&lt;p&gt;
owen says: just rest&lt;/p&gt;&lt;p&gt;
NK says: I want you to post a message on your site - saying that some smart people have to be alert all the time&lt;/p&gt;&lt;p&gt;
NK says: no matter who they are...&lt;/p&gt;&lt;p&gt;
NK says: Lot of intelectual do know certain circumstances...&lt;/p&gt;&lt;p&gt;
owen says: what doesn&#039;t kill you makes you stronger&lt;/p&gt;&lt;p&gt;
NK says: absolutely&lt;/p&gt;&lt;p&gt;
NK says: post message and hep people by alerting.... once in a life time&lt;/p&gt;&lt;p&gt;
NK says: i think you can do that....&lt;/p&gt;&lt;p&gt;
NK says: a simple bleach can put us ... dangerous situation&lt;/p&gt;&lt;p&gt;
owen says: true&lt;/p&gt;&lt;p&gt;
&lt;/p&gt; &lt;p&gt;&lt;strong&gt;by owen ()&lt;/strong&gt;  &lt;a href=&quot;http://www.owensoft.net/v4/item/485/#comment&quot;&gt;Post your comments on this article&lt;/a&gt;&lt;/p&gt;</description>
	  <pubDate>2006-02-09 19:41:56</pubDate>
 </item>

<item>
      <title>How to build a heirarcy with one query (Articles)</title>
      <link>http://www.owensoft.net/v4/item/451/</link>		
	  <description>&lt;p&gt;&lt;/p&gt; &lt;p&gt;Generating a tree list / heirarcy without a hundred queries is a problem that I have had since way back in 2002 when I started building the &lt;a rel=&#039;external&#039; href=&#039;/repository/messageboard.php&#039; title=&#039;forum&#039;&gt;forum&lt;/a&gt;.  Running a query for every node in the tree seemed malign to all things database.  Even doing it once and caching the result was not something I would consider a &#039;good fix&#039;.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
I discovered how to solve this problem back in August of 2004 using &#039;by reference&#039; pointers.  Using this method a very large tree can be generated using one query, an array, recursion, and some programming kung-fu.  There is a down fall to this method however i.e. the query has to bring back all the nodes in the tree or else you will end up with missing sections.   A enchanced version is implemented in the &lt;a rel=&#039;external&#039; href=&#039;/v4/sitemap/&#039; title=&#039;sitemap&#039;&gt;sitemap&lt;/a&gt; of this website.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
The technique involves a table which has 3 or more columns; id, name, parent.  The &#039;parent&#039; column would be a reference to an id in the same table.  I created the table this way because it makes for simpler queries.  Firstly you run your query and get all your records from the table (downside!).&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
select * from sitemap&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
The second step is to loop through each record while placing each item into a array using the id column as the array key.  The section step is to check the parent value and to add a child array to the parent node.  Then whenever a node which has a parent appears a reference is added to that parent node&#039;s child node.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
The following code is written in php a C like language.  It should be easily portable to most other language.&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
$os-&gt;execsql2(&quot; select * from sitemap &quot;, &#039;CACHE&#039;); &lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
$struct=array();&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
while( $row = $os-&gt;fetch_array() )	{&lt;/p&gt;&lt;p&gt;
   if( !isset( $struct[$row] ) ) {&lt;/p&gt;&lt;p&gt;
	$struct[$row]=array( &#039;id&#039;=&gt;$row, &#039;name&#039;=&gt;$row, &#039;parent&#039;=&gt;$row, &#039;data&#039;=&gt;$row   );&lt;/p&gt;&lt;p&gt;
	   } else {&lt;/p&gt;&lt;p&gt;
		$struct[$row]=$row;&lt;/p&gt;&lt;p&gt;
		$struct[$row]=$row;&lt;/p&gt;&lt;p&gt;
		$struct[$row]=$row;&lt;/p&gt;&lt;p&gt;
		$struct[$row]=$row;&lt;/p&gt;&lt;p&gt;
	   }  &lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
      if( $row != 0 ) {&lt;/p&gt;&lt;p&gt;
	  if( !isset($struct[$row]) ) 	  $struct[$row]=array(&#039;id&#039;=&gt;&#039;undefined&#039;,&#039;name&#039;=&gt;&#039;undefined&#039;,&lt;/p&gt;&lt;p&gt;
&#039;parent&#039;=&gt;&#039;undefined&#039;, &#039;data&#039;=&gt;&#039;undefined&#039;);&lt;/p&gt;&lt;p&gt;
	   if( !isset($struct[$row]) )&lt;/p&gt;&lt;p&gt;
 $struct[$row] = array();&lt;/p&gt;&lt;p&gt;
		   $struct[$row][$row]= &amp;$struct[$row];&lt;/p&gt;&lt;p&gt;
	   }&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
   } &lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
I could do a part 2 of this article but anyway.  Print the results involves looping through nodes which have parent set to 0.  Then printing the child nodes if any.  You need 2 functions;&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
function write_select_struct( $struct, $name ) {&lt;/p&gt;&lt;p&gt;
	print(&#039;&lt;select name=&quot;&#039; . $name . &#039;&quot; &gt;&#039;);&lt;/p&gt;&lt;p&gt;
	foreach ( $struct as $key =&gt; $value) &lt;/p&gt;&lt;p&gt;
		if( $value == 0 ) {&lt;/p&gt;&lt;p&gt;
			print(&#039;&lt;optgroup label=&quot;&amp;nbsp;&quot;&gt;&#039;);&lt;/p&gt;&lt;p&gt;
			write_option_struct($value, &#039;&#039;);&lt;/p&gt;&lt;p&gt;
			print &#039;&lt;/optgroup&gt;&#039;;&lt;/p&gt;&lt;p&gt;
		}&lt;/p&gt;&lt;p&gt;
	print(&#039;&lt;/select&gt;&#039;);&lt;/p&gt;&lt;p&gt;
}&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
function write_option_struct($a, $path) {&lt;/p&gt;&lt;p&gt;
	print(&#039;&lt;option value=&quot;&#039; . $a . &#039;&quot; &gt;&#039;);&lt;/p&gt;&lt;p&gt;
	$path .= $a . &#039; &amp;raquo; &#039; ;&lt;/p&gt;&lt;p&gt;
	print $path . &#039;&lt;/option&gt;&#039;;&lt;/p&gt;&lt;p&gt;
	//$a &lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
	if( isset($a) ) {&lt;/p&gt;&lt;p&gt;
		foreach ( $a as $key =&gt; $value) &lt;/p&gt;&lt;p&gt;
			{ write_option_struct( $value, $path ); }&lt;/p&gt;&lt;p&gt;
	}&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
}&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Finally you simple call the function;&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
write_select_struct( $struct, &#039;category_id&#039; );&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
which prints out you tree in a drop down list which can be modified into a tanle list or whatever you please.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
The original program was implemented in 86 lines total.  Thats it.  Watch your memory.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
DisAdvantages&lt;/p&gt;&lt;p&gt;
In most cases you have to load the entire list in order to biuld the tree.  So very large lists are personally  discouraged if you are using it in real time.&lt;/p&gt;&lt;p&gt;
Missing Parent keys will create undefined links in the tree.&lt;/p&gt;&lt;p&gt;
Multiple functions are annoying.&lt;/p&gt;&lt;p&gt;
The function that initially builds the list is kinda cryptic&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Advantages&lt;/p&gt;&lt;p&gt;
Simple, quick and manageable meaning that once you understand how the code works you can use in varied situations with fewer special attacks.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt; &lt;p&gt;&lt;strong&gt;by owen ()&lt;/strong&gt;  &lt;a href=&quot;http://www.owensoft.net/v4/item/451/#comment&quot;&gt;Post your comments on this article&lt;/a&gt;&lt;/p&gt;</description>
	  <pubDate>2005-11-19 19:41:26</pubDate>
 </item>

  </channel>
</rss>
