<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-8141999130858933537</atom:id><lastBuildDate>Wed, 16 Jun 2010 08:08:08 +0000</lastBuildDate><title>Modern Programming</title><description /><link>http://blog.systemcoder.com/</link><managingEditor>noreply@blogger.com (m0nkeymafia)</managingEditor><generator>Blogger</generator><openSearch:totalResults>20</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/ModernProgramming" /><feedburner:info uri="modernprogramming" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8141999130858933537.post-5998964659050408286</guid><pubDate>Fri, 13 Apr 2007 12:08:00 +0000</pubDate><atom:updated>2007-04-13T11:07:20.160Z</atom:updated><category domain="http://www.blogger.com/atom/ns#">C++</category><title>Visual C++: A bright future</title><description>Many of you out there that use Visual C++ on a day to day basis may have started to become dismayed by the way it seems to be lagging behind the likes of Visual Basic and Visual C#. Well people there is some good news. I was recently watching an interview with the &lt;a href="http://channel9.msdn.com/Showpost.aspx?postid=281987"&gt;Visual C++ team on channel 9&lt;/a&gt;, and it seems that they have seen the error of there ways and are working hard on pulling Visual C++ up to the standard of the rest of the Visual Studio suite.&lt;br /&gt;&lt;br /&gt;Now for the bad news. Unfortunately not all of these cool new features will be ready in time for the next release of Visual Studio (Orcas), however we will be getting an updated version of MFC that will have all the common controls updated so they work correctly with themes etc, this in itself will be nice to have.&lt;br /&gt;&lt;br /&gt;By the sounds of it the coolest features are going to take a while due to the fact that the Visual C++ compiler front end is still based around a 20 year old piece of software. It looks like in the the next version of Visual C++ they will have re-written a huge amount of code to give the compiler front end more flexibility to allow it to keep up with the likes of Visual C#.&lt;br /&gt;&lt;br /&gt;Another good point I noticed was they are now starting to ease back a little from .NET as they have noticed that most of their customers have massive code bases, ranging in the millions of lines of code and expecting them to move over to .NET would be impossible. Instead they are going to introduce better interop libraries to allow for example .NET WPF front ends to better interact with native C++ back ends.&lt;br /&gt;&lt;br /&gt;It'll be interesting to see what new tools we end up with. It's just a shame it's going to take so long.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8141999130858933537-5998964659050408286?l=blog.systemcoder.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ModernProgramming/~4/_FalyaKqmTM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/ModernProgramming/~3/_FalyaKqmTM/visual-c-bright-future.html</link><author>noreply@blogger.com (Darren Steadman)</author><thr:total>0</thr:total><feedburner:origLink>http://blog.systemcoder.com/2007/04/visual-c-bright-future.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8141999130858933537.post-7858702426820666225</guid><pubDate>Tue, 20 Feb 2007 22:16:00 +0000</pubDate><atom:updated>2007-02-20T22:16:18.577Z</atom:updated><category domain="http://www.blogger.com/atom/ns#">WPF</category><category domain="http://www.blogger.com/atom/ns#">Software Development</category><category domain="http://www.blogger.com/atom/ns#">Windows Presentation Foundation</category><category domain="http://www.blogger.com/atom/ns#">.NET 3.0</category><category domain="http://www.blogger.com/atom/ns#">Vista</category><category domain="http://www.blogger.com/atom/ns#">Software Engineering</category><title>WPF: It's going to change everything</title><description>Today I watched this &lt;a href="http://streamstudio.world-television.com/CCUIv3/frameset.aspx?ticket=1-605-4702&amp;target=en-default-&amp;amp;status=ondemand&amp;browser=ie-11-10-0-9&amp;amp;stream=wm-video-200"&gt;Microsoft developers launch event &lt;/a&gt;web cast, and I was well and truly amazed by what I saw. The web cast at its core is basically about the new things that will be possible using such things as Vista and the new Visual Studio integration with office 2007. This was all the usual Microsoft evangelism, however towards the end of the presentation they bring on a group of developers from The London Underground, and at this point things start to really heat up.&lt;br /&gt;&lt;br /&gt;They start off by showing some of the features of Excel 2007 that allow them to pull data straight from a web service and manipulate it in the usual way in which you can in Excel. While this is nothing amazing it does show the power of web services when they are combined with analytical tools.&lt;br /&gt;&lt;br /&gt;The real fun starts when they bring out their latest &lt;a href="http://msdn2.microsoft.com/en-us/netframework/aa663326.aspx"&gt;WPF &lt;/a&gt;based app. This thing is amazing, for a start it's running completely within a web browser and the responsiveness of it is instant. Fair enough the data source may be on the same machine but this thing is super smooth and extremely heavy on the graphics, in fact there are even full 3D sections.&lt;br /&gt;&lt;br /&gt;It's just the way that they managed to combine so many different web service data streams and collate them together to give virtually every piece of information you could want to know about the underground at any given time. Not only this, but the use of &lt;a href="http://msdn2.microsoft.com/en-us/netframework/aa663326.aspx"&gt;WPF&lt;/a&gt; has allowed them to make a highly flexible interface that allows the data to be viewed in as many ways as you would want.&lt;br /&gt;&lt;br /&gt;It's this kind of presentation that gets me excited about development again. The possibilities are mind blowing. I predict that in the next 6 months or so the web is going to become a very different place.&lt;br /&gt;&lt;br /&gt;If you want to skip straight to the demo then just click on the fourth slide from the end of the presentation and you'll be in about the right place.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8141999130858933537-7858702426820666225?l=blog.systemcoder.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ModernProgramming/~4/SzVy9vzAVc8" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/ModernProgramming/~3/SzVy9vzAVc8/wpf-its-going-to-change-everything.html</link><author>noreply@blogger.com (Darren Steadman)</author><thr:total>0</thr:total><feedburner:origLink>http://blog.systemcoder.com/2007/02/wpf-its-going-to-change-everything.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8141999130858933537.post-9140655952500728802</guid><pubDate>Mon, 19 Feb 2007 01:50:00 +0000</pubDate><atom:updated>2007-02-19T02:01:58.048Z</atom:updated><title>Increase Adsense Revenue Legitimately</title><description>AdSense is one of the most popular CPC advertising networks on the planet.  It is context based meaning you do not choose the genre of adverts displayed... &lt;span style="font-weight: bold;"&gt;Google does&lt;/span&gt;!&lt;br /&gt;&lt;br /&gt;When you have a Google advert on your page Google tries to best match its list of advertisements to what it &lt;span style="font-style: italic;"&gt;thinks&lt;/span&gt; your page content is about.  It uses an eBay style auction system internally to decide what ads to place on your site.  It tries to get the best value for publishers and advertisers.  It is a complex system that really is the subject for another article.&lt;br /&gt;&lt;br /&gt;As we all know certain markets, keywords etc are more competitive than others.  For example loans and finance adverts normally reap MUCH higher payments per click than say football adverts.  Simply because there are more people trying to advertise loans and finance options to you.  Note there are other reasons, but again are out of the scope of this article.&lt;br /&gt;&lt;br /&gt;So you may find that your site may get thousands of visitors, but you end up only getting a few cents / pence per click.  This may be because your site is targeting the wrong keywords.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Google AdWords Keyword Tool&lt;/span&gt;&lt;br /&gt;You can use the &lt;a href="https://adwords.google.com/select/KeywordToolExternal"&gt;Google AdWords Keyword Tool&lt;/a&gt; to not only find other related keywords, but to measure the &lt;span style="font-style: italic;"&gt;estimated&lt;/span&gt; cost to the advertiser for that keyword.  This will allow you to, by simply tweaking a few phrases in your content, title and meta tags, to significantly increase your CPC.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Made for AdSense Websites&lt;/span&gt;&lt;br /&gt;Another reason for getting low CPC is &lt;span style="font-style: italic;"&gt;made for AdSense websites&lt;/span&gt;, certain websites target a broad range of keywords with a very low CPC in order to get you on their site.  They then have much higher paying adverts on their site.  So they pay you 4 cents to get a visitor on their site, then they get paid $1 for them to leave.  Good deal for them, bad deal for you!&lt;br /&gt;&lt;br /&gt;There is another great little site out there called &lt;a href="http://www.adsblacklist.com/"&gt;adsblacklist&lt;/a&gt; that basically generates a list of well known &lt;span style="font-style: italic;"&gt;made for AdSense websites&lt;/span&gt; which you can place in your competitive sites filter option within AdSense making sure they do not get displayed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8141999130858933537-9140655952500728802?l=blog.systemcoder.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ModernProgramming/~4/QoLgVhW-Uuc" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/ModernProgramming/~3/QoLgVhW-Uuc/increase-adsense-revenue-legitimately.html</link><author>noreply@blogger.com (m0nkeymafia)</author><thr:total>1</thr:total><feedburner:origLink>http://blog.systemcoder.com/2007/02/increase-adsense-revenue-legitimately.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8141999130858933537.post-1882903619111210102</guid><pubDate>Fri, 16 Feb 2007 21:00:00 +0000</pubDate><atom:updated>2007-02-16T20:59:49.127Z</atom:updated><category domain="http://www.blogger.com/atom/ns#">Email</category><category domain="http://www.blogger.com/atom/ns#">Domains</category><category domain="http://www.blogger.com/atom/ns#">Spam Prevention</category><title>Help fight SPAM using SPF records</title><description>I've been using a certain domain now for years for my email and I recently decided to move it to googles new &lt;a href="http://www.google.co.uk/a/"&gt;apps for domains&lt;/a&gt;. Basically if you haven't already seen it, google are now offering a service where you can get customised gmail accounts and calenders along with a few other bits and bobs for your own domains.&lt;br /&gt;&lt;br /&gt;To use the service you need to have a domain provider that allows you to control the DNS settings of your domain. For this I choose to move my domains over to &lt;a href="http://www.123-reg.co.uk/affiliate2.cgi?id=AF145298"&gt;123-reg.co.uk&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;After moving my email over to google I noticed that my catchall address was starting to get a lot of spam. After a further investigation it turned out that someone was sending spam messages and were using an email address on my domain as the reply address.&lt;br /&gt;&lt;br /&gt;Obviously I don't want my domain getting onto any spam black lists, so I decided to see if there was anything I could do about it. The initial information I found was not good news, because of the way current email protocols work, it is perfectly valid for someone to put anything they like as the reply address in an email.&lt;br /&gt;&lt;br /&gt;Slightly dismayed I carried on looking around to see if there was a way of at least cutting down some of the spam, and that's when I came across &lt;a href="http://www.openspf.org/"&gt;Sender Policy Framework (SPF)&lt;/a&gt;. SPF is an open standard that attempts to stop the type of spam I was receiving. The way it works is you create a SPF record and put it in a TXT record in the DNS settings of your domain. This information dictates where email from your domain is allowed to come from.&lt;br /&gt;&lt;br /&gt;Basically SPF can be used by email servers to check to see if the email it just got was sent from a valid source. If it was then all is fine, where as if it isn't the message is dumped.&lt;br /&gt;&lt;br /&gt;The &lt;a href="http://www.openspf.org/RFC_4408"&gt;SPF protocol &lt;/a&gt;is very flexible and offers a huge range of options when it comes to filtering the mail. After setting up my SPF record my spam has gone from around 400 messages a day to around 20, and is still falling.&lt;br /&gt;&lt;br /&gt;The only disadvantage I can see with SPF at the moment is the fact that not all email servers on the net use it. Also it only stops messages that make it look like your domain is spamming people. This in itself is a good thing though as it's likely to keep you off spam black lists.&lt;br /&gt;&lt;br /&gt;If you are using &lt;a href="http://www.google.co.uk/a/"&gt;google apps for domains &lt;/a&gt;already then there is a &lt;a href="http://www.google.com/support/a/bin/answer.py?answer=33786&amp;query=spf&amp;amp;amp;topic=&amp;amp;type="&gt;section in their help &lt;/a&gt;that tells you what you need to set your SPF record to. Otherwise check out the &lt;a href="http://www.openspf.org/"&gt;main SPF web site &lt;/a&gt;and see if you too can help keep spam at bay.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8141999130858933537-1882903619111210102?l=blog.systemcoder.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ModernProgramming/~4/G-o2gH32CWk" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/ModernProgramming/~3/G-o2gH32CWk/help-fight-spam-using-spf-records.html</link><author>noreply@blogger.com (Darren Steadman)</author><thr:total>1</thr:total><feedburner:origLink>http://blog.systemcoder.com/2007/02/help-fight-spam-using-spf-records.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8141999130858933537.post-1896629263467364432</guid><pubDate>Mon, 12 Feb 2007 14:06:00 +0000</pubDate><atom:updated>2007-02-09T20:31:23.069Z</atom:updated><category domain="http://www.blogger.com/atom/ns#">Software Development</category><category domain="http://www.blogger.com/atom/ns#">Software Engineering</category><title>Top 5 Optimisation Techniques</title><description>This post is aimed at Engineers who, along the way, forgot how to effectively optimise. I am not claiming to be the oracle of optimisation but after working with several different platforms, including CE [argh], I have picked up a number of quick and easy tips to help speed up your program. Most of the optimisation techniques I talk about aren't language specific so you can apply them to any project your are working on.&lt;br /&gt;&lt;br /&gt;So anyway here is my top 5 methods to optimise code in any language:&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;1. Remove unnecessary code.&lt;/span&gt;&lt;br /&gt;If the code isn't needed, then lose it. Use only the code you &lt;span style="FONT-STYLE: italic"&gt;need&lt;/span&gt; to use to get the job done. If you have re-written a function or class then make sure you remove all the old code fully as it will just slow your program down.&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;2. Move code out of loops&lt;/span&gt;&lt;br /&gt;Another big drain on CPU is having code within tight loops. By tight I mean loops with many iterations. This can include everything from variable declarations to pre-processing values outside the loop. Every little can help especially when speed is essential. Remember to also look at function calls within tight loops. The function call itself can have a slight overhead, but the main importance is to make sure the function itself isn't bloated. For more information regarding tight loop optimisation check out our post on &lt;a href="http://systemcoder.blogspot.com/2007/01/tight-loop-optimization-in-c.html"&gt;Duff's Device&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;3. Pass objects by reference rather than value&lt;/span&gt;&lt;br /&gt;Passing around objects can be very costly as they are copied every time another function or class uses them. To get around this pass objects by &lt;a href="http://systemcoder.blogspot.com/2006/12/know-thy-language-c-references_18.html"&gt;reference&lt;/a&gt; or pointer where possible and the memory copied will be reduced to the size of your pointer [4-8bytes].&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;4. Pre Allocate memory&lt;/span&gt;&lt;br /&gt;Memory allocation, and manipulation, is one of the slowest operations you can do as a programmer. To avoid unnecessary hold ups try allocate memory before you need it. It is also advisable to block allocate memory rather than allocate little bits at a time as it is more efficient in both allocation and subsequent referencing.&lt;br /&gt;&lt;br /&gt;An example of this would be to use an array rather than a list [standard library]. A list allocates memory as and when it needs it so the memory allocated for a particular object in the list is not guaranteed to be adjacent to the previous object. So pre allocate your array [maybe at start up] so you have no slowdowns later on.&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;5. Minimise and optimise disk access&lt;/span&gt;&lt;br /&gt;Another hog on you application is disk access. Hard disks, or flash drives are a LOT slower than manipulating data in memory so care should be taken when writing out files. You will find that writing a bytes at a time is slower than just flushing through a lot of data. This depends on the disk medium you are writing to but generally writing out in bigger chunks [e.h 64k] is much more efficient. It is best to experiment on your particular platform when writing out data to avoid other bottle necks [write buffers for one can slow you down].&lt;br /&gt;&lt;br /&gt;So there you go, 5 little tips that you already knew but probably forgot. Bear these in mind next time you are wondering why your next masterpiece is running a little sluggish.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8141999130858933537-1896629263467364432?l=blog.systemcoder.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ModernProgramming/~4/C-jqKQd3TJw" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/ModernProgramming/~3/C-jqKQd3TJw/top-5-optimisation-techniques.html</link><author>noreply@blogger.com (m0nkeymafia)</author><thr:total>3</thr:total><feedburner:origLink>http://blog.systemcoder.com/2007/02/top-5-optimisation-techniques.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8141999130858933537.post-3886809299999930151</guid><pubDate>Thu, 08 Feb 2007 13:25:00 +0000</pubDate><atom:updated>2007-02-08T13:50:40.940Z</atom:updated><category domain="http://www.blogger.com/atom/ns#">Software Development</category><category domain="http://www.blogger.com/atom/ns#">Software Engineering</category><category domain="http://www.blogger.com/atom/ns#">C++</category><title>How to use the const keyword to make your C++ better</title><description>As the title suggests, I firmly believe that the correct usage of const can make many aspects of your C++ program, and indeed programming style, "better". By "better" I mean &lt;span style="font-style: italic;"&gt;smaller&lt;/span&gt; &lt;span style="font-style: italic;"&gt;executables&lt;/span&gt;, &lt;span style="font-style: italic;"&gt;more robust&lt;/span&gt;, &lt;span style="font-style: italic;"&gt;faster&lt;/span&gt;, &lt;span style="font-style: italic;"&gt;safer&lt;/span&gt;, &lt;span style="font-weight: bold; font-style: italic;"&gt;sexy&lt;/span&gt;, OK so I lied about it being sexy but the rest is true.&lt;br /&gt;&lt;br /&gt;Const is a keyword that many C++ programmers don't use, they either forget to use it, don't know how, or they think its "easier" to program without it. Const is there for a reason and using it will bring many advantages to your programs, from design through to development and debugging.&lt;br /&gt;&lt;br /&gt;It is quite hard to define what &lt;span style="font-weight: bold;"&gt;const&lt;/span&gt; is.  This is because it is a contextual keyword whose meaning changes depending on where it is used in your code. In general terms it means that the object it refers to cannot be modified after its original creation.&lt;br /&gt;&lt;br /&gt;So why would anyone want to use const at all? The simplest case of const is where you have a method that returns a pointer to a const object.  In this use it will ensure that no one [or class] can modify the object that was returned. This re-enforces good design and can also have positive effects on your code.&lt;br /&gt;&lt;br /&gt;OK so &lt;span style="font-style: italic;"&gt;how&lt;/span&gt; do you use const? As I mentioned earlier it can be a little tricky to understand how const works in all situations, especially if your new to the keyword. Here are a few examples of how and when to use const, and what the desired effect is:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;//#define MAX_SIZE 100&lt;br /&gt;const int MAX_SIZE = 100;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Here I use a const int to replace a #define. You should generally try to use const objects rather than #defines for one very good reason. #define does not use type checking, const [object] does, which immediately improves your ability to debug code as the compiler will flag up any type issues at compile time.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;MyObject *MyClass::GetMyObject() const&lt;br /&gt;{&lt;br /&gt;return &amp;m_MyObject;&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;One of the main uses of const is its use within function declarations. The following code snippet shows how you can append const to a function declaration to show that the function does not change anything [outside of its own scope]. The benefit of this is that the compiler can create leaner, more efficient, code for that function as well as those calling the function since it knows it will never modify any member variables or objects outside of its own scope. Member functions that are declared const also have the added feature of being the only functions that can be called from a const object. This makes sure that a const object can not modify its contents.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;p&gt;void AnotherClass::Foo(const MyClass &amp;obj)&lt;br /&gt;{&lt;br /&gt;obj.GetMyObject();&lt;br /&gt;}&lt;br /&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;br /&gt;Above shows another method of using the const keyword, this time as a function argument. Because obj is a const reference to a MyClass object it means that only const member functions of MyClass can be called. If obj had been a pointer then the same would apply.&lt;br /&gt;&lt;blockquote&gt;&lt;p&gt;&lt;br /&gt;void AnotherClass::Foo(const MyClass *obj)&lt;br /&gt;{&lt;br /&gt;obj-&gt;GetMyObject();&lt;br /&gt;}&lt;br /&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;If you want to use pointers and you want the pointer itself to be const I.E you can not modify what the pointer points to then you would need to move the const as below.&lt;br /&gt;&lt;/p&gt;&lt;blockquote&gt;void AnotherClass::Foo(MyClass* const obj)&lt;br /&gt;{&lt;br /&gt;obj-&gt;SetSomething(10);&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;br /&gt;This means that you can call non const member functions of obj but you can't change what it points to. If you want it so you can only call const member funtions and you can't change what the pointer points to then you would need the following&lt;br /&gt;&lt;/p&gt;&lt;blockquote&gt;void AnotherClass::Foo(const MyClass* const obj)&lt;br /&gt;{&lt;br /&gt;obj-&gt;GetMyObject();&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;br /&gt;This is essentially the same as a const reference and if this is what you require a const reference should be used instead of a pointer. (To find out more about references see &lt;a href="http://systemcoder.blogspot.com/2006/12/know-thy-language-c-references_18.html"&gt;Know thy language c++ references&lt;/a&gt;).&lt;/p&gt;&lt;p&gt;All of the above also applies to return values from functions. Returning a const object means that it can only be allocated to another const object when it is initialised.....&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;const MyClass &amp;test = someobject.GiveMeConstObject();&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;or a copy of it can be made if it is allocated to a variable on the stack&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;MyClass test = someobject.GiveMeConstObject();&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;br /&gt;Well that's about it for the use of the const keyword. Remember that const doesn't just tell the compiler what is happening in your code it also tells other people using your code what happens. In the real world the use of const is a must, it provides the compiler with a way of flagging to the user when something is wrong with the code and it allows the developer to protect data.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8141999130858933537-3886809299999930151?l=blog.systemcoder.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ModernProgramming/~4/YEWFmD5o3wA" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/ModernProgramming/~3/YEWFmD5o3wA/how-to-use-const-keyword-to-make-your-c.html</link><author>noreply@blogger.com (m0nkeymafia)</author><thr:total>1</thr:total><feedburner:origLink>http://blog.systemcoder.com/2007/02/how-to-use-const-keyword-to-make-your-c.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8141999130858933537.post-1988727818874714589</guid><pubDate>Mon, 15 Jan 2007 20:42:00 +0000</pubDate><atom:updated>2007-01-15T20:41:21.795Z</atom:updated><category domain="http://www.blogger.com/atom/ns#">Software Development</category><category domain="http://www.blogger.com/atom/ns#">Design Patterns</category><category domain="http://www.blogger.com/atom/ns#">Software Engineering</category><category domain="http://www.blogger.com/atom/ns#">Book Review</category><category domain="http://www.blogger.com/atom/ns#">Design</category><title>Book Review: Design Patterns</title><description>&lt;iframe style="WIDTH: 120px; HEIGHT: 240px" align="left" marginwidth="0" marginheight="0" src="http://rcm-uk.amazon.co.uk/e/cm?t=modernprogra-21&amp;o=2&amp;amp;p=8&amp;l=as1&amp;amp;asins=0201633612&amp;fc1=000000&amp;amp;IS2=1&amp;lt1=_blank&amp;amp;amp;amp;lc1=0000FF&amp;bc1=FFFFFF&amp;amp;bg1=FFFFFF&amp;f=ifr" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;Design Patterns or &lt;a href="http://www.amazon.co.uk/gp/product/0201633612?ie=UTF8&amp;amp;tag=modernprogra-21&amp;linkCode=as2&amp;amp;amp;amp;camp=1634&amp;creative=6738&amp;amp;creativeASIN=0201633612"&gt;Design patterns : elements of reusable object-oriented software&lt;/a&gt;&lt;img style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; MARGIN: 0px; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none" height="1" alt="" src="http://www.assoc-amazon.co.uk/e/ir?t=modernprogra-21&amp;l=as2&amp;amp;amp;amp;amp;amp;amp;amp;o=2&amp;amp;a=0201633612" width="1" border="0" /&gt; to give it, its full title is one of those books that anyone who is using an OO language should read. Although most of the example code is written in C++ it is easy to see how the patterns themselves could be translated to other OO languages such as Java and C#.&lt;br /&gt;&lt;br /&gt;This is the original book on design patterns, often referred to as the GOF or gang of four book (refers to its authors) it offers a wealth of knowledge accumulated from years of experience in designing software.&lt;br /&gt;&lt;br /&gt;The book is split into two main sections the second of which is broken down further into another three sections.&lt;br /&gt;&lt;br /&gt;The first main section is an introduction to design patterns, what they are and how they can benefit the user. This section then walks the reader through a case study designing a document editor emphasising the use of design patterns throughout. This is where the real world meets the theory and as the case study progresses you can see how by using design patterns flexibility can be added to software. It also highlights ways of recognising when a design problem can be broken down into patterns and the way at which to go about it.&lt;br /&gt;&lt;br /&gt;The second main section of the book acts as a reference to the patterns. It is broken down into three smaller sections dedicated to each type of pattern, be it creational, structural or behavioral.&lt;br /&gt;&lt;br /&gt;Each pattern is explained fully, giving information about how the pattern would be applied as well as where and when it would be used. Consequences of using the pattern are explained and an example implementation written in C++ is provided, this is then wrapped up by stating software that is known to use the pattern as well as listing other patterns that would accompany the selected pattern well.&lt;br /&gt;&lt;br /&gt;With this book you are really getting two books for the price of one. First you are getting a good quality tutorial introducing the use of design patterns in a real world example and secondly you are getting a reference that you can easily use to look for a specific type of pattern when it's needed.&lt;br /&gt;&lt;br /&gt;Once again as in my &lt;a href="http://systemcoder.blogspot.com/2007/01/book-review-modern-c-design.html"&gt;Modern C++ Design&lt;/a&gt; book review I would highly recommend this book to any serious programmer, it's a must have on your book shelf even if you only ever use it as a reference, and even though all of the examples are in C++ the UML diagrams included should make it easy for any OO developer to use the patterns across languages.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8141999130858933537-1988727818874714589?l=blog.systemcoder.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ModernProgramming/~4/PeK86B3hvaE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/ModernProgramming/~3/PeK86B3hvaE/book-review-design-patterns.html</link><author>noreply@blogger.com (Darren Steadman)</author><thr:total>0</thr:total><feedburner:origLink>http://blog.systemcoder.com/2007/01/book-review-design-patterns.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8141999130858933537.post-4019502018930684865</guid><pubDate>Sun, 14 Jan 2007 18:10:00 +0000</pubDate><atom:updated>2007-01-14T18:09:07.621Z</atom:updated><category domain="http://www.blogger.com/atom/ns#">ARM</category><category domain="http://www.blogger.com/atom/ns#">Software Development</category><category domain="http://www.blogger.com/atom/ns#">JTAG</category><category domain="http://www.blogger.com/atom/ns#">Open Source</category><category domain="http://www.blogger.com/atom/ns#">Software Engineering</category><category domain="http://www.blogger.com/atom/ns#">C++</category><category domain="http://www.blogger.com/atom/ns#">Embedded</category><title>Embedded: ARM development on the cheap. Part 1</title><description>Welcome to the first part of what will probably turn out to be a three part series all about using a combination of cheap and completely free tools to do embedded development on the &lt;a href="http://www.arm.com/"&gt;ARM&lt;/a&gt; series of micro processors.&lt;br /&gt;&lt;br /&gt;Embedded development for many years has been a bit of a black art as far as the hobbyist is concerned. Due to the large amount of money involved to buy specialist software development tools any type of embedded development has been restricted to companies making products or to those willing and able to fork out the money. Well that time has come to an end. Affordable hardware debuggers are now available and the open source community have brought us the relevant tools required to drive the hardware.&lt;br /&gt;&lt;br /&gt;This series is aimed specifically at the &lt;a href="http://www.nxp.com/pip/LPC2119.html"&gt;Philips LPC2129&lt;/a&gt; ARM7 based chip, as this is what I have been developing on myself. While the board I'm using was specially built by the hardware department in the company I work for, everything in this series will be transferable to other development boards based on ARM7 processors. Most of the time it will only require a small number of settings to be changed to get things up and working.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Tools that will be required.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Development board&lt;/li&gt;&lt;li&gt;JTAG&lt;/li&gt;&lt;li&gt;Compiler tool chain (including debugger)&lt;/li&gt;&lt;li&gt;IDE&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;strong&gt;Development board&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;As I stated above just about any &lt;a href="http://www.olimex.com/dev/index.html"&gt;ARM7 development&lt;/a&gt; board should work OK with this series. Just to make sure though it would be best to get something based on the &lt;a href="http://www.nxp.com/products/microcontrollers/"&gt;Philips LPC2xxx&lt;/a&gt; series of CPUs. The development board will also require a JTAG header to be present.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;JTAG&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A &lt;a href="http://en.wikipedia.org/wiki/Jtag"&gt;JTAG&lt;/a&gt; is a piece of hardware that connects your PC to the development board. It can then be used to upload code into the memory or flash of the device and debug the applications running. It is this piece of equipment that originally used to make embedded development cost so much. Now however there are companies offering cheap JTAGs that can be used with open source software. The JTAG we will be using is from a company called &lt;a href="http://www.olimex.com/"&gt;olimex&lt;/a&gt;, and is a simple parallel port model. While they also do &lt;a href="http://www.olimex.com/dev/arm-usb-ocd.html"&gt;USB&lt;/a&gt; based models which are much faster at uploading code to the device they are relatively new and more &lt;a href="http://www.olimex.com/dev/pricelist.html"&gt;expensive&lt;/a&gt; than the &lt;a href="http://www.olimex.com/dev/arm-jtag.html"&gt;parallel port&lt;/a&gt; version.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Compiler tool chain (including debugger)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Thanks to the open source community all the tools required to build and debug the applications you want to make are available for free. I have been using &lt;a href="http://www.gnuarm.com/"&gt;GNUARM&lt;/a&gt; for building my applications, which also handily comes with a debugger. The only other piece of software used is &lt;a href="http://openocd.berlios.de/web/"&gt;OpenOCD&lt;/a&gt;. This is a debug server daemon that allows communication between the JTAG and the debugger being used. In true open source style both of these tools can be found for most operating systems available, so you don't have to be running Windows.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;IDE&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;I decided to use a copy of &lt;a href="http://msdn2.microsoft.com/en-us/visualc/default.aspx"&gt;Visual C++ 2005&lt;/a&gt; that I use at work for Windows development to also do the embedded development. This can be done by using a make file project. You can use any IDE you like or no IDE at all it's up to you. All of the builds will be managed by make files so as long as you have something that can edit text with you'll be OK. I've used &lt;a href="http://msdn2.microsoft.com/en-us/visualc/default.aspx"&gt;Visual C++ 2005&lt;/a&gt; because I find it nice to work with, I can arrange my files etc into projects and it integrates nicely with our source control system. To keep with the theme of doing things for free, the &lt;a href="http://msdn.microsoft.com/vstudio/express/visualc/"&gt;Express edition of Visual C++ 2005 &lt;/a&gt;also supports make file projects so that can be used.&lt;br /&gt;&lt;br /&gt;So that's basically it for this edition. In the next part of the series I will be going through setting up the compiler and getting it working with &lt;a href="http://msdn2.microsoft.com/en-us/visualc/default.aspx"&gt;Visual C++ 2005&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8141999130858933537-4019502018930684865?l=blog.systemcoder.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ModernProgramming/~4/ZxJMjcpaPO4" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/ModernProgramming/~3/ZxJMjcpaPO4/embedded-arm-development-on-cheap-part.html</link><author>noreply@blogger.com (Darren Steadman)</author><thr:total>4</thr:total><feedburner:origLink>http://blog.systemcoder.com/2007/01/embedded-arm-development-on-cheap-part.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8141999130858933537.post-5695288267846999005</guid><pubDate>Sun, 07 Jan 2007 22:17:00 +0000</pubDate><atom:updated>2007-01-07T22:19:10.272Z</atom:updated><category domain="http://www.blogger.com/atom/ns#">Templates</category><category domain="http://www.blogger.com/atom/ns#">Software Development</category><category domain="http://www.blogger.com/atom/ns#">Software Engineering</category><category domain="http://www.blogger.com/atom/ns#">C++</category><title>Calculations with templates in C++</title><description>This is a quick post designed to show you how you can use templates for &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;pre&lt;/span&gt;-calculations for optimisation or simply ease of use / design.&lt;br /&gt;&lt;br /&gt;Let me give an example; imagine you have a class that has a buffer of size T, that stores information for use later, perhaps to return temporal statistics.  The buffer size may rely on two parameters that define the size as X to the power of Y.&lt;br /&gt;&lt;br /&gt;There doesn't exist a define to calculate powers at compile time, so normally you would have to have allocate the memory at run time.  This can be useful but sometimes you want the memory to be allocated at compile time as it can make certain things easier and faster.&lt;br /&gt;&lt;br /&gt;Firstly the power calculation isn't done at run time saving time there, it also means you know the exact size of the class before you create it, helping you keep tabs on your programs memory usage.  It also means the memory is always there and you do not have to worry about checking pointer / memory validity.  Now I know the time to calculate the power of a number is nominal however there will come a point where you need this solution.  Trust me.&lt;br /&gt;&lt;br /&gt;Right onto the code.  You should have at least a basic understanding of templates to get the most out of this, so if you do not I suggest you look it up as there are lots of resources on &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-corrected" id="SPELLING_ERROR_1"&gt;Google&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;This first template class is the guts of the system, it defines the power template that will do the calculation. It works iteratively.&lt;br /&gt;template &amp;lt;int base, int N&amp;gt;&lt;br /&gt;&lt;blockquote&gt;  class &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;MyPow&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;  &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;enum&lt;/span&gt; { result = base * &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;MyPow&lt;/span&gt;&amp;lt;base, N-1&amp;gt; ::result };&lt;br /&gt;};&lt;/blockquote&gt;&lt;br /&gt;Next is the template specialisation for &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;MyPow&lt;/span&gt; which defines result as 1 should the base reach 0.&lt;br /&gt;&lt;blockquote&gt;template &amp;lt;int base&amp;gt;&lt;br /&gt;class &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;MyPow&lt;/span&gt;&amp;lt;base,0&amp;gt;&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;  &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;enum&lt;/span&gt; { result = 1 };&lt;br /&gt;};&lt;/blockquote&gt;&lt;br /&gt;And here is how you could use it within your class, m_&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;MaxDataPoints&lt;/span&gt; is defined as T_Base to the power of T_Power.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;template &amp;lt;int T_Base, int T_Power&amp;gt;   class &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;MyClass&lt;/span&gt;&lt;int&gt;&lt;br /&gt;{&lt;br /&gt;...&lt;br /&gt;&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;const&lt;/span&gt; int m_&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;MaxDataPoints&lt;/span&gt; = &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;MyPow&lt;/span&gt;&lt;/int&gt;&amp;lt;&lt;int&gt;T_Base, T_&lt;/int&gt;Power&amp;gt; &lt;int&gt;::result+1;&lt;br /&gt;...&lt;br /&gt;}&lt;/int&gt;&lt;/blockquote&gt;&lt;int&gt;So in just 3 simple steps you can now perform power calculations at compile time.  You can also extend these principals to create templates for different uses.&lt;br /&gt;&lt;br /&gt;&lt;/int&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8141999130858933537-5695288267846999005?l=blog.systemcoder.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ModernProgramming/~4/Ba7I-ufJF80" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/ModernProgramming/~3/Ba7I-ufJF80/calculations-with-templates-in-c.html</link><author>noreply@blogger.com (m0nkeymafia)</author><thr:total>0</thr:total><feedburner:origLink>http://blog.systemcoder.com/2007/01/calculations-with-templates-in-c.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8141999130858933537.post-8407493979189016119</guid><pubDate>Wed, 03 Jan 2007 14:22:00 +0000</pubDate><atom:updated>2007-01-03T14:25:39.663Z</atom:updated><category domain="http://www.blogger.com/atom/ns#">Software Development</category><category domain="http://www.blogger.com/atom/ns#">Software Engineering</category><category domain="http://www.blogger.com/atom/ns#">C++</category><title>Tight loop optimization in C++</title><description>&lt;a href="http://en.wikipedia.org/wiki/Duff%27s_device"&gt;Duff's Device&lt;/a&gt; is a fairly well known technique used for optimizing small loops.  It uses &lt;a href="http://en.wikipedia.org/wiki/Switch_statement"&gt;switch&lt;/a&gt; case statement fall through that [when compiled] mimicks loop unrolling but is generally much faster and cleaner to use than standard loop unrolling.  This is a breif article on the usage and speed benefits of using Duff's Device for optimizing tight loops.&lt;br /&gt;&lt;br /&gt;I first used Duff's Device whilst developing a cross platform graphics library from which the examples given are drawn from. They may not be perfect but definately indicate correct usage of the device.&lt;br /&gt;&lt;br /&gt;Firstly here is the C++ implementation of Duffs Device, in the form of a #define. This #define takes care of all the operation of the device, all you need to do it use the right parameters with it.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;    #define DUFF_DEVICE_8(aCount, aAction) \&lt;br /&gt;{ \&lt;br /&gt; int count_ = (aCount); \&lt;br /&gt; int times_ = (count_ + 7) &gt;&gt; 3; \&lt;br /&gt; switch (count_ &amp; 7){ \&lt;br /&gt;     case 0: do { aAction; \&lt;br /&gt;     case 7: aAction; \&lt;br /&gt;     case 6: aAction; \&lt;br /&gt;     case 5: aAction; \&lt;br /&gt;     case 4: aAction; \&lt;br /&gt;     case 3: aAction; \&lt;br /&gt;     case 2: aAction; \&lt;br /&gt;     case 1: aAction; \&lt;br /&gt;     } while (--times_ &gt; 0); \&lt;br /&gt; } \&lt;br /&gt;}&lt;/blockquote&gt;&lt;br /&gt;Before I go on to discuss the device itself there are a few hidden optimizations in the code [which you could take not of and employ elsewhere in your code].&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Firstly you will notice that a shift has been done rather than a division, shifts are much faster than multiplications and divisions when dealing with powers of 2, so where possible you should use shifts.&lt;/li&gt;&lt;li&gt;Secondly the while condition contains --times_ rather than times_--.  Pre-decrement [and increment] is faster than post decrement / increment.  This is because post operations require a copy of the variable to be made.  Obviously this overhead is minimal, but if speed is of the essense small savings count.&lt;/li&gt;&lt;li&gt;Also in the while condition you can see the comparison is against zero [counts down] rather than against aCount [counts up].  This is beacause a comparison against 0 is much faster than any other number.&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-style: italic;"&gt;N.b. many compilers will replace perform these optimisations on compile time so they are not always needed. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;So how can you use Duff's Device in your code?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You simply use it like a normal define, taking care to finish each line with a semi colon.&lt;br /&gt;&lt;blockquote&gt;void Bitmap::Blank(COLORREF colour)&lt;br /&gt;{&lt;br /&gt;unsigned long *blitPtr     = m_BitmapData;&lt;br /&gt;unsigned long *blitEnd     = blitPtr + (m_Width*m_Height);&lt;br /&gt;unsigned int index=0;&lt;br /&gt;&lt;br /&gt;int numPixels = static_cast&amp;lt;int&amp;gt;(blitEnd-blitPtr);&lt;br /&gt;if (numPixels &gt; 0)&lt;br /&gt;{&lt;br /&gt;DUFF_DEVICE_8(&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;numPixels&lt;/span&gt;, &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;blitPtr&lt;/span&gt;[index++] = colour;);&lt;br /&gt;}&lt;br /&gt;}&lt;/blockquote&gt;&lt;int&gt;&lt;br /&gt;&lt;br /&gt;This code is designed to &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;simly&lt;/span&gt; fill my bitmap with a certain colour defines by &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;COLORREF&lt;/span&gt; [simply a &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;DWORD&lt;/span&gt; aka long which is 4 bytes on most machines].&lt;br /&gt;The first operation I do is to get the pointer to the start of my array [i.e. the start of the bitmap] and then get the end of my array using some pointer arithmetic.&lt;br /&gt;&lt;br /&gt;Onto the usage of the Duff Device itself; as you can see &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;numPixels&lt;/span&gt; is passed as the count parameter and "&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;blitPtr&lt;/span&gt;[index++] = colour;" is passed as the code to run in each iteration.  Notice the trailing ; inside the statement which is required as it is text replacement and not a function.&lt;br /&gt;&lt;br /&gt;Quite simply it iterates through each pixel [long] in our m_&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;BitmapData&lt;/span&gt; array and assigns the colour to it.&lt;br /&gt;&lt;br /&gt;In tests on my machine Duff's Device, in this instance, is faster than a &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;memcpy&lt;/span&gt;.  This is not to say that it will always be faster, but in this instance it was.  The point is that no matter how efficient a certain algorithm or piece of code is, the generic algorithms / hardware accelerated variations will usually be faster for most instances.&lt;br /&gt;&lt;br /&gt;So if you do have a very tight loop that requires speeding up then why not look to Duff's Device to see if it could improve the efficiency of the loop.&lt;br /&gt;&lt;br /&gt;It is worth pointing out that more obvious optimisations should be made before looking to a novel solution such as this.  i.e. remove allocations or any code that doesn't need to be in the loop - simple!&lt;br /&gt;&lt;br /&gt;&lt;/int&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8141999130858933537-8407493979189016119?l=blog.systemcoder.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ModernProgramming/~4/eypBY1cHg6A" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/ModernProgramming/~3/eypBY1cHg6A/tight-loop-optimization-in-c.html</link><author>noreply@blogger.com (m0nkeymafia)</author><thr:total>3</thr:total><feedburner:origLink>http://blog.systemcoder.com/2007/01/tight-loop-optimization-in-c.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8141999130858933537.post-1490721536740941971</guid><pubDate>Tue, 02 Jan 2007 21:56:00 +0000</pubDate><atom:updated>2007-01-07T22:28:34.108Z</atom:updated><category domain="http://www.blogger.com/atom/ns#">Templates</category><category domain="http://www.blogger.com/atom/ns#">Software Development</category><category domain="http://www.blogger.com/atom/ns#">Design Patterns</category><category domain="http://www.blogger.com/atom/ns#">Software Engineering</category><category domain="http://www.blogger.com/atom/ns#">Book Review</category><category domain="http://www.blogger.com/atom/ns#">C++</category><category domain="http://www.blogger.com/atom/ns#">Design</category><title>Book Review: Modern C++ Design</title><description>&lt;div align="left"&gt;&lt;iframe style="WIDTH: 120px; HEIGHT: 240px" align="left" marginwidth="0" marginheight="0" src="http://rcm-uk.amazon.co.uk/e/cm?t=modernprogra-21&amp;o=2&amp;amp;p=8&amp;l=as1&amp;amp;asins=0201704315&amp;fc1=000000&amp;amp;IS2=1&amp;lt1=_blank&amp;amp;amp;amp;lc1=0000FF&amp;bc1=FFFFFF&amp;amp;bg1=FFFFFF&amp;amp;f=ifr" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;Weighing in at just over 300 pages, this book might not initially seem like it has much to offer. However this couldn't be more wrong. Andrei has packed a wealth of knowledge into every page of this book making it an invaluable tool.&lt;/div&gt;&lt;br /&gt;When I first read this book I was in my first year at University and to be honest it meant nothing to me. If you had asked me then if I would have recommended it to anyone I would have said no. It's only since reading it again recently after writing real world C++ code, that it really starts to make sense.&lt;br /&gt;&lt;br /&gt;This is really not a book for someone just learning C++. It tackles some of the more advance topics of C++, mostly revolving around templates and there use as a design tool. It does not teach templates themselves and assumes the reader has a good grasp of C++, so if you've been coding C++ for a couple of years at a reasonable level then this will be a good book for you.&lt;br /&gt;&lt;br /&gt;The main focus of the book is taking common design patterns and creating generic implementations using templates that allow you to easily customise behaviour using different policies, which are provided in the form of small easily maintainable classes that implement very specific features in a generic fashion.&lt;br /&gt;&lt;br /&gt;The start of the book introduces the concept of policy based class design along with techniques to allow you to recognise and extract policies from existing classes.&lt;br /&gt;&lt;br /&gt;The book then moves on to explaining techniques to control the allocation of memory and typelists. Typelists are both elegant and breath taking, they really show the power of template meta programming to create code for you at compile time.&lt;br /&gt;&lt;br /&gt;The above ideas and techniques are then used throughout the second section of the book, which takes commonly used design patterns and shows ways of extending there functionality easily using templates and policies, as well as introducing a high level of flexibility.&lt;br /&gt;&lt;br /&gt;When dealing with the design patterns, Andrei first begins with pointing out the problems with the current pattern and then proceeds to set out a plan to improve it. This way instead of just being given a set of step by step operations to implement a certain design pattern, he points out the pitfalls of using the patterns and attempts to offer a solution to the problem, educating the reader rather than just holding their hand.&lt;br /&gt;&lt;br /&gt;A lot of the code presented in this book is aimed at library writers. It attempts to create a flexible library of code that could be used along side the standard library to make common design tasks easier to implement. This however should not put you off if this is not your area of coding as there is still a lot to be learnt from this book even if you don't use it every day.&lt;br /&gt;&lt;br /&gt;I would highly recommend this book to anyone who wants to be a serious C++ developer.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8141999130858933537-1490721536740941971?l=blog.systemcoder.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ModernProgramming/~4/K_vgJgungkE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/ModernProgramming/~3/K_vgJgungkE/book-review-modern-c-design.html</link><author>noreply@blogger.com (Darren Steadman)</author><thr:total>0</thr:total><feedburner:origLink>http://blog.systemcoder.com/2007/01/book-review-modern-c-design.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8141999130858933537.post-6675542931450849652</guid><pubDate>Mon, 18 Dec 2006 22:22:00 +0000</pubDate><atom:updated>2006-12-18T22:22:25.521Z</atom:updated><category domain="http://www.blogger.com/atom/ns#">Software Development</category><category domain="http://www.blogger.com/atom/ns#">Software Engineering</category><category domain="http://www.blogger.com/atom/ns#">C++</category><title>Know Thy Language: C++ References</title><description>&lt;p&gt;As a C++ programmer I find that a lot of people moving over from plain C to C++, as well as people beginning to learn C++ seem to learn the vast majority of differences but for some reason miss references.&lt;br /&gt;&lt;br /&gt;I think that many people read the section of their C++ book on references that says they are a bit like pointers, then decide that they have got on with pointers fine in the past and according to the book there isn't much difference so they won't bother going any further with them. It's such a shame really because references are so much more than pointers. In some ways they can even be used to promote safer code and design rules for software.&lt;br /&gt;&lt;br /&gt;In this article I will be going through the list below explaining references and there relationship with pointers, potential pitfalls and use as a design tool.&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Relationship with pointers &lt;/li&gt;&lt;li&gt;Things to remember when using references &lt;/li&gt;&lt;li&gt;References as a design tool &lt;/li&gt;&lt;li&gt;Advantages of references &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;Relationship with pointers&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A pointer can be used in two ways, it can be used to move around in memory changing the location it is pointing to using pointer arithmetic or it can be used to access the actual data at the memory address (de-referencing). References however can only be used like de-referenced pointers, they are assigned an area of memory on creation and that's the only location they are allowed to point to. Once the assignment has taken place the reference will behave as if it is the data it is pointing to.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A reference can never be null itself like a pointer can, however the area of memory it points to could be invalid. How exactly this happens and how to avoid it are explained in the next section.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;Things to remember when using references&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;References should be used when you can guarantee the life time of the object the reference is pointing to. If you can do this then the reference should never become invalid. The major reasons for references becoming invalid are for them to be assigned to memory that has been newed and the life time of that memory can not be guaranteed. When ever you assign anything to a reference you are making a contract with yourself and any code that uses your code that what ever the reference is pointing to will be in existence for the duration of its use.&lt;br /&gt;&lt;br /&gt;Quite often if a crash occurs inside a function that uses references as its parameters its usually the fault of the function that called it not checking to make sure its data is valid. If the variables being passed in are allocated on the stack then this should never be a problem as they have guaranteed life time, however if it is passed data from the heap it could be null. As a general rule of thumb a null pointer should never be de-referenced and assigned to anything, this is very dangerous and can cause all kinds of crashes. It is also about the only way you would cause a reference to point to invalid memory. Threading can also cause an issue if the memory the reference was allocated to gets deleted by one thread while it's in use in another. However if situations like this occur it's more than likely that there is a more deep routed problem with the code as situations like that shouldn't occur with proper locking in place.&lt;br /&gt;&lt;br /&gt;As a general rule, if the object you are passing around has a guaranteed life time then use a reference, otherwise use a pointer.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;References as a design tool&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;References are a very powerful design tool. If a function you have made returns a reference then other programmers will know that they shouldn't have to worry about the contents of that reference all of a sudden disappearing. They will also know that the function will always return them some form of valid data, as a reference can not be null. If you use references as parameters to a function it lets the programmer using it know that they have to take responsibility to make sure that the data passed in is valid, and will stay valid for the duration of the function call.&lt;br /&gt;&lt;br /&gt;References can be used to add more safety to code as well. For example you can pass an array of objects to a function via a pointer and you don't have to specify how big the array is. This could cause buffer overflows if you try and go too far through the array. References won't let you do this. If you want a function to take an array as a reference you have to specify the size of the array in the function declaration. This has the disadvantage of having to know exactly how big the array will be when writing the code, but it has the advantage of allowing the compiler to tell you if the array being passed to the function is the wrong size, instead of the program crashing.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;Advantages of references&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;References share the majority of the same advantages as pointers. They are much more efficient to be passes around as parameters to functions especially if the object they point to is large, as references like pointers will not incur the copy overhead that would happen when passing by value. They have the extra advantage over pointers of; if it is used as a parameter it can be used within the function as if it was passed by value. This usually means that code can be kept cleaner and easier to read, as sometimes lots of pointer notation and de-referencing can look messy.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;While this has been a quick overview of the features of references as well as some of the things to look out for when using them I hope it encourages people who have been putting off using them for one reason or another to start using them now. I will probably post some more short articles on using references in certain situations in the future. All comments are welcome.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8141999130858933537-6675542931450849652?l=blog.systemcoder.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ModernProgramming/~4/dN3tBYH0qxo" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/ModernProgramming/~3/dN3tBYH0qxo/know-thy-language-c-references_18.html</link><author>noreply@blogger.com (Darren Steadman)</author><thr:total>1</thr:total><feedburner:origLink>http://blog.systemcoder.com/2006/12/know-thy-language-c-references_18.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8141999130858933537.post-376964818933819279</guid><pubDate>Thu, 14 Dec 2006 06:39:00 +0000</pubDate><atom:updated>2006-12-14T06:41:01.377Z</atom:updated><category domain="http://www.blogger.com/atom/ns#">JavaScript</category><category domain="http://www.blogger.com/atom/ns#">innerHTML</category><category domain="http://www.blogger.com/atom/ns#">XHTML</category><category domain="http://www.blogger.com/atom/ns#">AJAX</category><category domain="http://www.blogger.com/atom/ns#">XSL</category><category domain="http://www.blogger.com/atom/ns#">Memory Leaks</category><category domain="http://www.blogger.com/atom/ns#">XML</category><category domain="http://www.blogger.com/atom/ns#">IE6</category><title>Why innerHTML can ruin your AJAX applications</title><description>The reason I am writing this article is because of some work I have been doing recently.  My client wants a persistent AJAX application to work in IE6+.  This means the web page will be left running for days/weeks on end without being refreshed or the browser being closed.  This means it cannot have ANY memory leaks. &lt;br /&gt;&lt;br /&gt;I currently process incoming XML using an XSL document - which works very well.  However when done under IE6 the XSL transformation is output as plain text [please let me know if there is a DOM alternative] which means the only way to insert my newly transformed code is to use innerHTML.  This seems to leak memory like a biatch! Note that the leak doesn't occur in FireFox.&lt;br /&gt;&lt;br /&gt;So why does innerHTML leak? Well after some digging I found out a few interesting facts - lets look at the who, where, why and how...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Where did innerHTML come from?&lt;/span&gt;&lt;br /&gt;innerHTML is not a standard, it is a proprietary format by Microsoft.  Given Microsoft's huge installed base and popularity other browsers included innerHTML for the sake of compatibility.  It was never in the w3c specification.  It subsequently isn't future proof and isn't designed for xhtml [xml mime type].&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Why is innerHTML used?&lt;/span&gt;&lt;br /&gt;innerHTML is used as a cheap and easy way to write objects to a container element like a span or DIV.  It tends to be faster than traditional DOM methods and takes substantially less time to write.  For example you can quickly write a table structure into a DIV container using innerHTML like so:&lt;br /&gt;&lt;blockquote&gt;var myDiv = document.getElementById('myDivId');&lt;br /&gt;myDiv.innerHTML = "&amp;lt;table&gt;&lt;br /&gt;                                           &amp;lt;tr&amp;gt;&amp;lt;th&amp;gt;Title&amp;lt;/th&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;                                           &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Mr&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;                                       &amp;lt;/table&amp;gt;";&lt;/blockquote&gt;&lt;br /&gt;The equivalent code using DOM methods would take up considerably more time and lines of code to accomplish.  So for lazy coders or new guys innerHTML provides a great way into the world of JavaScript.  To be fair to innerHTML, it works very well for the most part, yes its ugly, its not "right" but if your in a rush and don't have the requirements my client has then it can work very well.  You should try, where possible, to avoid it though as it can have unpredictable results and its a bad habit to rely on innerHTML to change or update your web page.  DOM methods, in the long run, will serve you better.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;So why / how does innerHTML leak memory?&lt;/span&gt;&lt;br /&gt;The specific answer to this I do not know but we can theorize a solution.  Firstly, as previously discussed, innerHTML is not designed to work with xhtml documents, meaning that it can incorrectly interpret the string you pass to it.  This means it doesn't actually render exactly what you ask it to - basically it adds things you never asked for.  If you parse the html later on using DOM methods you may run into errors or bugs where the DOM hierarchy isn't as you expected.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Is there a solution?&lt;/span&gt;&lt;br /&gt;Yes! Simply don't use innerHTML.  I don't think you'll ever find an article, and there are quite a few, that puts in in good light [aside from its obvious benefits].  However if you are in my position and are forced to use it then, apparently, there are a few things you can try doing.&lt;br /&gt;&lt;br /&gt;Firstly as the memory leak may be coming from its incompatibility with xhtml it is well worth re-writing your code to accommodate this, or by re-structuring your xhtml in a different way.  Unfortunately it's quite hard to know exactly what innerHTML is doing so its a bit of guess work.&lt;br /&gt;&lt;br /&gt;If you wish to use DOM methods to replace your existing innerHTML code then please look at this very good article on &lt;a href="http://slayeroffice.com/articles/innerHTML_alternatives/"&gt;innerHTML alternatives&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;As I said at the start, if anyone reading this is thinking "what a muppet I know the answer" then please leave a comment as I'm sure it would help me, and anyone reading this!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8141999130858933537-376964818933819279?l=blog.systemcoder.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ModernProgramming/~4/7kDVc8OY3nk" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/ModernProgramming/~3/7kDVc8OY3nk/why-innerhtml-can-ruin-your-ajax.html</link><author>noreply@blogger.com (m0nkeymafia)</author><thr:total>8</thr:total><feedburner:origLink>http://blog.systemcoder.com/2006/12/why-innerhtml-can-ruin-your-ajax.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8141999130858933537.post-2051629839293043654</guid><pubDate>Tue, 12 Dec 2006 08:17:00 +0000</pubDate><atom:updated>2006-12-12T08:58:10.190Z</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP</category><category domain="http://www.blogger.com/atom/ns#">image</category><category domain="http://www.blogger.com/atom/ns#">resize</category><title>How to resize pictures in PHP</title><description>The web nowadays requires a level of interactivity never seen before.  People love commenting and building communities, and a huge part of that is putting a face to your online presence.  To this effect there is a big demand for image processing techniques using web based languages.  My web language of choice is PHP and so here is a short walkthrough, including code, on how to create a picture resizing function.&lt;br /&gt;&lt;br /&gt;This function can both keep the aspect ratio of the picture, or force the picture to fit the new dimensions.  It is designed for jpeg pictures but can easily be extended to cater for gif and png.&lt;br /&gt;&lt;br /&gt;The first thing you need to do is create your form in your web page.  This basically requires you to set a flag in the form tag like so:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&amp;lt;form name="myForm" action="uploadpic.php" method="post" enctype="multipart/form-data" /&amp;gt;&lt;/blockquote&gt;&lt;br /&gt;The enctype flag basically tells the browser to break the form objects down and send in chunks.  This is transparent to the user, and to the PHP script receiving the data.  But is useful to know.&lt;br /&gt;&lt;br /&gt;You will then need a form element with type  "File" which will give you the typical input box with a browse button to allow your users to search for the file they want to upload.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&amp;lt;input name="userfile" type="file" size="40" /&amp;gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Now we need a PHP file to receive the file, we are assuming you have a file called uploadpic.php, within your form handling code you should have something like this to call the function we are about to write:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;if (@is_uploaded_file($_FILES["userfile"]["tmp_name"]))&lt;br /&gt;{&lt;br /&gt;$img_name = resizePic("player","userfile","../picupload/",150,150,0,"destination_name.jpg");&lt;br /&gt;}&lt;/blockquote&gt;&lt;br /&gt;$_FILES is a server variable containing an array of the uploaded files, note that "userfile" is the name of the form element we specified earlier, the tmp_name is the temporary name given to the object when its uploaded.  The first line basically confirms the file was uploaded ok.  The second line calls our function resizePic and stores the contents into a variable called $img_name.  The return value of the function is discussed later.&lt;br /&gt;&lt;br /&gt;OK now onto our function definition, we saw the variables passed to it in the previous section of code, now we can see what each parameter does.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;function uploadPic($prefix,$formSrc,$dDir,$maxWidth,$maxHeight,$resizeFlag,$tempName) ;&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;ul&gt;&lt;li&gt;The $prefix parameter defines the prefix for all images uploaded, if left blank no prefix is given.  This is so we could have all our images renamed to news_00001.jpg etc.&lt;/li&gt;&lt;li&gt;The $formSrc parameter simply passes the name of our form element to the function, so it can find the file we uploaded.&lt;/li&gt;&lt;li&gt;$dDir is the destination directory for the image&lt;/li&gt;&lt;li&gt;$maxWidth is obviously the maximum width the picture can have&lt;/li&gt;&lt;li&gt;$maxHeight performs similarily&lt;/li&gt;&lt;li&gt;$resizeFlag defines whether the image should keep its original aspect ratio&lt;/li&gt;&lt;li&gt;And finally $tempName defines the name of the image&lt;/li&gt;&lt;/ul&gt;OK now to flesh out our function.  Our first job is copy the temporary image so that we can work on it without fear of it getting deleted as it is currently held in a temporary folder on the server.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;if (!copy($_FILES[$formSrc]["tmp_name"],$dDir.$_FILES[$formSrc]["name"])) {&lt;br /&gt;print ("failed to copy $file...&lt;br /&gt;\n");&lt;br /&gt;}&lt;/blockquote&gt;&lt;br /&gt;This code will copy the file, with its current file name, to our destination folder.&lt;br /&gt;&lt;br /&gt;If no $tempName was given we want to create a random name for the image, we do this simply by concatonating the prefix and a random number like so:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;if ($tempName == "") { $tempName = $prefix."_".mt_rand().".jpg"; }&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Next we need to create a few variables to store the location and names of our source image, and the eventual location of our finished image.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;//hard copy of picture&lt;br /&gt;$src_img = $dDir.$_FILES[$formSrc]["name"];&lt;br /&gt;&lt;br /&gt;//destination&lt;br /&gt;$dest = $dDir.$tempName;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;We now need to get a little information about our file, confirm its an image, and find out its current dimensions.  This is done easily with a function call to one of the PHP GD APIs.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;//get source dimentions&lt;br /&gt;$src_dims = getImageSize($src_img);&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Now we have our image information we need to then create a temporary image in memory and deal with each image type seperately, for the sake of this tutorial I am simply going to concentrate on jpeg only, the case statements for other types are left in though and it will only take a small amount of work to alter the function to work with all image types.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;//create appropriate temp image&lt;br /&gt;switch ($src_dims[2]) {&lt;br /&gt;case 1: //GIF&lt;br /&gt;break;&lt;br /&gt;&lt;br /&gt;case 2: //JPEG&lt;br /&gt;$srcImage = imageCreateFromJpeg($src_img);&lt;br /&gt;break;&lt;br /&gt;&lt;br /&gt;case 3: //PNG&lt;br /&gt;break;&lt;br /&gt;&lt;br /&gt;default:&lt;br /&gt;return false;&lt;br /&gt;break;&lt;br /&gt;}&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Next we need to find out if we want to keep the aspect ratio, if so resize using a divisor, else just force the image to the correct dimensions.  This is done by finding out how the image dimensions compare to our desired dimensions then dividing or multiplying accordingly.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;$srcRatio  = $src_dims[0]/$src_dims[1]; // width/height ratio&lt;br /&gt;$destRatio = $maxWidth/$maxHeight;&lt;br /&gt;&lt;br /&gt;if ($destRatio &gt; $&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;srcRatio&lt;/span&gt;) {&lt;br /&gt;$&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;destSize&lt;/span&gt;[1] = $&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;maxHeight&lt;/span&gt;;&lt;br /&gt;$&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;destSize&lt;/span&gt;[0] = $&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;maxHeight&lt;/span&gt;*$&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;srcRatio&lt;/span&gt;;&lt;br /&gt;}&lt;br /&gt;else {&lt;br /&gt;$&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;destSize&lt;/span&gt;[0] = $&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;maxWidth&lt;/span&gt;;&lt;br /&gt;$&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;destSize&lt;/span&gt;[1] = $&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;maxWidth&lt;/span&gt;/$&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;srcRatio&lt;/span&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//if set image dimensions are required:&lt;br /&gt;if ($&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;resizeFlag&lt;/span&gt; == 1) {&lt;br /&gt;$&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;destSize&lt;/span&gt;[0] = $&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;maxWidth&lt;/span&gt;;&lt;br /&gt;$&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;destSize&lt;/span&gt;[1] = $&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;maxHeight&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;}&lt;/blockquote&gt;&lt;br /&gt;As you can see we now have an array called $&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;destSize&lt;/span&gt; which contains the final height and width of our image. All we have to do now is create a new image in memory to the correct dimensions, then copy our source image into that new placeholder.  We will use a function called &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;imageCopyResampled&lt;/span&gt; to achieve this which usually gives the best results when resizing.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;$thumb_w = $&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;destSize&lt;/span&gt;[0];&lt;br /&gt;$thumb_h = $&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;destSize&lt;/span&gt;[1];&lt;br /&gt;$&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_20"&gt;dst&lt;/span&gt;_&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;img&lt;/span&gt; = &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;imageCreateTrueColor&lt;/span&gt;($thumb_w,$thumb_h);&lt;br /&gt;&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;imageCopyResampled&lt;/span&gt;($&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_24"&gt;dst&lt;/span&gt;_&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_25"&gt;img&lt;/span&gt;,$&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_26"&gt;srcImage&lt;/span&gt;,0,0,0,0,$thumb_w,$thumb_h,$&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_27"&gt;src&lt;/span&gt;_dims[0],$&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_28"&gt;src&lt;/span&gt;_dims[1]);&lt;/blockquote&gt;&lt;br /&gt;Our image is almost done, all we need to do now is save our image to the destination folder and delete any temporary images we created along the way.  We then return with our final image name so that the calling function knows the exact name of the image.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;switch ($&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_29"&gt;src&lt;/span&gt;_dims[2]) {&lt;br /&gt; case 1:&lt;br /&gt; break;&lt;br /&gt; case 2:&lt;br /&gt; &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_30"&gt;imageJpeg&lt;/span&gt;($&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_31"&gt;dst&lt;/span&gt;_&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_32"&gt;img&lt;/span&gt;, $&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_33"&gt;dest&lt;/span&gt;, 75);  //75 denotes image quality / compression ratio&lt;br /&gt; break;&lt;br /&gt;&lt;br /&gt; case 3:&lt;br /&gt; break;&lt;br /&gt;}&lt;br /&gt;//$y++;&lt;br /&gt;unlink($&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_34"&gt;src&lt;/span&gt;_&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_35"&gt;img&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;return $&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_36"&gt;tempName&lt;/span&gt;;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;And that is it, you now have a function capable of resizing uploaded images, if you are a basic user this will suit your needs perfectly well.  However if you will be doing a vast number of &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_37"&gt;resizes&lt;/span&gt; then this code may be slightly slow for your needs and it may well be worth looking into other &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_38"&gt;resize&lt;/span&gt; methods that give lower accuracy.&lt;br /&gt;&lt;br /&gt;On a final note with regards to performance it is generally much better to &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_39"&gt;resize&lt;/span&gt; on upload rather than dynamically when a page is generated.  It is a trade off between space and processing time, but if your site is popular then dynamically create each image on the fly can cost a lot in processing time and make your site slow.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8141999130858933537-2051629839293043654?l=blog.systemcoder.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ModernProgramming/~4/XVFjVFGjb4E" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/ModernProgramming/~3/XVFjVFGjb4E/how-to-resize-pictures-in-php.html</link><author>noreply@blogger.com (m0nkeymafia)</author><thr:total>17</thr:total><feedburner:origLink>http://blog.systemcoder.com/2006/12/how-to-resize-pictures-in-php.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8141999130858933537.post-8902712091072820680</guid><pubDate>Mon, 04 Dec 2006 15:49:00 +0000</pubDate><atom:updated>2006-12-05T14:27:30.161Z</atom:updated><category domain="http://www.blogger.com/atom/ns#">Humour</category><title>Klingon Programmer Humor</title><description>I found this article too amusing to pass up, its a list of the &lt;a href="http://www.mikefullerton.com/blog/2006/01/10/the+Klingon+Programmer.aspx"&gt;Top 20 things likely to be overheard if you had a Klingon Programmer&lt;/a&gt; and is very amusing, here are a couple of my favourites:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;      What is this talk of 'release'? &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;Klingons&lt;/span&gt; do not make software 'releases'. Our software&lt;br /&gt;     'escapes' leaving a bloody trail of designers and quality assurance people in its&lt;br /&gt;     wake.&lt;/li&gt;&lt;li&gt;      Klingon function calls do not have 'parameters' - they have 'arguments' -- and they ALWAYS WIN THEM.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;      Debugging? &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;Klingons&lt;/span&gt; do not debug. Our software does not coddle the weak. Bugs are&lt;br /&gt;     good for building character in the user.&lt;/li&gt;&lt;/ul&gt;Quality stuff.&lt;br /&gt;Hope you enjoy&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8141999130858933537-8902712091072820680?l=blog.systemcoder.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ModernProgramming/~4/Ax8FWOB9Fug" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/ModernProgramming/~3/Ax8FWOB9Fug/klingon-programmer-humor.html</link><author>noreply@blogger.com (m0nkeymafia)</author><thr:total>0</thr:total><feedburner:origLink>http://blog.systemcoder.com/2006/12/klingon-programmer-humor.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8141999130858933537.post-3948681694701691786</guid><pubDate>Sat, 02 Dec 2006 21:27:00 +0000</pubDate><atom:updated>2006-12-02T21:36:49.789Z</atom:updated><category domain="http://www.blogger.com/atom/ns#">Software Development</category><category domain="http://www.blogger.com/atom/ns#">CE</category><category domain="http://www.blogger.com/atom/ns#">Software Engineering</category><category domain="http://www.blogger.com/atom/ns#">NT</category><category domain="http://www.blogger.com/atom/ns#">C++</category><title>Who is Coding Grasshopper?</title><description>Well beings as m0nkeymafia has introduced himself I thought I better do the same.&lt;br /&gt;&lt;br /&gt;I work for the same company as m0nkeymafia doing a whole range of different development type work. I mostly program in C++ on Windows of varying types, as well as currently some embedded stuff on ARM processors.&lt;br /&gt;&lt;br /&gt;As well as the usual Windows NT based stuff I also do development for CE. My main job on CE has been getting a platform up and running which basically involves many painful hours battling with platform builder and different quirks of hardware and software.&lt;br /&gt;&lt;br /&gt;I've also done development on Linux. I spent a reasonable amount of time getting a platform up and running on a Blackfin processor based board.&lt;br /&gt;&lt;br /&gt;There's plenty of other stuff I'm into as well, which hopefully will come across as I write articles for this blog.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8141999130858933537-3948681694701691786?l=blog.systemcoder.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ModernProgramming/~4/NZF3rUT-icQ" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/ModernProgramming/~3/NZF3rUT-icQ/who-is-coding-grasshopper.html</link><author>noreply@blogger.com (Darren Steadman)</author><thr:total>0</thr:total><feedburner:origLink>http://blog.systemcoder.com/2006/12/who-is-coding-grasshopper.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8141999130858933537.post-1563588642949715708</guid><pubDate>Sat, 02 Dec 2006 21:19:00 +0000</pubDate><atom:updated>2006-12-02T21:25:43.398Z</atom:updated><category domain="http://www.blogger.com/atom/ns#">Pet Projects</category><title>Congratulations m0nkeymafia</title><description>Just like to put out some congratulations to m0nkeymafia for getting one of his &lt;a href="http://www.backofthenet.info"&gt;"pet projects"&lt;/a&gt; featured in official xbox magazine as, and I quote "The ultimate PES site". PES for all that don't know is Pro Evo Soccer.&lt;br /&gt;&lt;br /&gt;So well done m0nkeymafia. Keep up the good work, and I can't wait to see what arrives next from the m0nkeymafia house of web.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8141999130858933537-1563588642949715708?l=blog.systemcoder.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ModernProgramming/~4/6CblYgxekG0" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/ModernProgramming/~3/6CblYgxekG0/congratulations-m0nkeymafia.html</link><author>noreply@blogger.com (Darren Steadman)</author><thr:total>0</thr:total><feedburner:origLink>http://blog.systemcoder.com/2006/12/congratulations-m0nkeymafia.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8141999130858933537.post-2670759180587960524</guid><pubDate>Wed, 29 Nov 2006 15:12:00 +0000</pubDate><atom:updated>2006-11-29T15:12:32.482Z</atom:updated><category domain="http://www.blogger.com/atom/ns#">Traffic</category><category domain="http://www.blogger.com/atom/ns#">Page Rank</category><category domain="http://www.blogger.com/atom/ns#">SEO</category><category domain="http://www.blogger.com/atom/ns#">Mod ReWrite</category><category domain="http://www.blogger.com/atom/ns#">Pet Projects</category><category domain="http://www.blogger.com/atom/ns#">Search Engine Optimisation</category><title>Using Apache's rewrite module to aid Search Engine Optimization</title><description>Just recently I have been dabbling with the effects of various &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;Search Engine Optimisation (SEO)&lt;/span&gt; techniques and thought I would report on one that I have found particularily effective.  I will also attempt to keep this post focussed on the theory, and as such will not contain much related technical information.&lt;br /&gt;&lt;br /&gt;The Apache Web Server contains a very useful module called Mod &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-corrected" id="SPELLING_ERROR_1"&gt;Rewrite&lt;/span&gt;, and is one method I use to help the visibility of my sites within Search Engines and  I will be using one of my sites as a live example of how this method works.&lt;br /&gt;&lt;br /&gt;One of my sites is a &lt;a href="http://www.backofthenet.info/"&gt;Pro Evolution Soccer League and Community&lt;/a&gt; site that I created over a year ago.  Since then it has had many overhauls, the most recent changes have included the use of the Apache rewrite module.&lt;br /&gt;&lt;br /&gt;The site was developed with a &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;PHP&lt;/span&gt; &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-corrected" id="SPELLING_ERROR_4"&gt;back end&lt;/span&gt; meaning that a lot of pages had nasty looking URLs, an example of this is the league pages:&lt;br /&gt;&lt;blockquote style="font-style: italic;"&gt; /leagues.&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;php&lt;/span&gt;?&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;viewLeagueId&lt;/span&gt;=546&lt;/blockquote&gt;&lt;br /&gt;I have since updated them, with the help of Apache Mod Rewrite, to look like this:&lt;br /&gt;&lt;blockquote style="font-style: italic;"&gt;/Leagues/Euro-Leagues/Euro-League-3/546/&lt;/blockquote&gt;&lt;br /&gt;Now not only does the new URL look nicer to any user, it also looks good to Search Engines.  To prove how this works check out the following &lt;a href="http://www.google.co.uk/search?hl=en&amp;q=euro+league&amp;amp;btnG=Search&amp;meta="&gt;google search&lt;/a&gt; and you will notice that my site [&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;Backofthenet&lt;/span&gt;] is &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-corrected" id="SPELLING_ERROR_8"&gt;ranked&lt;/span&gt; 3rd or 4&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-corrected" id="SPELLING_ERROR_9"&gt;th&lt;/span&gt; from the top for "Euro League".&lt;br /&gt;&lt;br /&gt;If you look at the google entry for it you will see it highlights the search terms you used in the URL, approximately half of the URL is in bold meaning it ranked highly for that search.  You should try do this for anything you want people to be able to search for.&lt;br /&gt;&lt;br /&gt;The general aim is the same for all sites, whether you create static files or use mod rewrite to achieve the same thing, your URLs should always contain keywords related to the page.&lt;br /&gt;&lt;br /&gt;Mod rewrite uses regular expressions to invoke rules that you create.  You write a condition [using regular expressions] and then a rule.  It's similar to and if block, where you only trigger the code inside the if block, if the test passes.  I won't get into regular expressions, but here is an example of how your re-write rule should be written:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;#www.mysite.com/profilename&lt;br /&gt;RewriteRule ^([A-Za-z0-9-]+)$ /profile.php?viewProfile=$1&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;The line beginning with # is a comment line, if you have a number of rules you should comment them.&lt;br /&gt;The second line catches all URL requests where letters, dashes and numbers follow the domain like the comment suggests, it then passes that to profile.php as an argument.&lt;br /&gt;&lt;br /&gt;You will also notice I use hyphens [dashes] instead of spaces in the URL.  If you use spaces in your URLs then any browser viewing the link will encode it into a hexadecimal reprasentationturning any space into %20.  This does not look good, and some Search Engines cannot index such links, or at best prefer not to. Most Search Engines interpret a hyphen as a space, so by replacing all spaces in your URL with hyphens you can seperate your keywords without any of the drawbacks of using a space.&lt;br /&gt;&lt;br /&gt;To replace spaces with hyphens in your URL you can simply use the following code:&lt;br /&gt;&lt;blockquote&gt;str_replace(" ", "-", $string);&lt;/blockquote&gt;&lt;br /&gt;As mentioned at the start there isn't a great deal of technical help here, but here are some links in case you are having problems with the &lt;a href="http://www.google.co.uk/search?hl=en&amp;q=mod+rewrite+rules+tutorial&amp;amp;btnG=Search&amp;amp;meta="&gt;mod rewrite&lt;/a&gt; and &lt;a href="http://uk.php.net/str_replace"&gt;str_replace&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8141999130858933537-2670759180587960524?l=blog.systemcoder.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ModernProgramming/~4/b0KrSWXJl30" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/ModernProgramming/~3/b0KrSWXJl30/using-apaches-rewrite-module-to-aid.html</link><author>noreply@blogger.com (m0nkeymafia)</author><thr:total>0</thr:total><feedburner:origLink>http://blog.systemcoder.com/2006/11/using-apaches-rewrite-module-to-aid.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8141999130858933537.post-4623591508962427830</guid><pubDate>Tue, 28 Nov 2006 13:42:00 +0000</pubDate><atom:updated>2006-11-28T16:19:07.236Z</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP</category><category domain="http://www.blogger.com/atom/ns#">CE</category><category domain="http://www.blogger.com/atom/ns#">AJAX</category><category domain="http://www.blogger.com/atom/ns#">IR</category><category domain="http://www.blogger.com/atom/ns#">XP</category><category domain="http://www.blogger.com/atom/ns#">Pet Projects</category><category domain="http://www.blogger.com/atom/ns#">CSS</category><category domain="http://www.blogger.com/atom/ns#">CMS</category><category domain="http://www.blogger.com/atom/ns#">NT</category><title>Who is m0nkeymafia?</title><description>As this is my first post I thought I would start by giving a small introduction to who I was, and what I do.&lt;br /&gt;&lt;br /&gt;My day job is primarily as a C++ programmer for Windows based machines, NT based and CE [Compact Edition - It's a nightmare ask Darren].  As the company I work for hasn't got a comparitvely large software department most people have to do a varying range of jobs from GUI design to algorithm development and optimization.  I find my job very interesting and it usually throws up quite a few problems on a day to day basis which is one of the reasons behind this blog.  Darren and I often cannot find solutions to problems we have on the Internet, if we find a forum about a problem we are having the poster generally hasn't posted the fix.  We intend to document our programming lives with the fixes and results to help other people.&lt;br /&gt;&lt;br /&gt;In my spare time I take a great interest in Internet Technologies such as PHP, AJAX, CSS etc.  I have a number of, what I like to call "Pet Projects" that I generally use as testing grounds for new technologies.  I also work freelance as a Web Developer and Designer and am especially skilled in the design, development and deployment of Content Management Systems (CMS).&lt;br /&gt;&lt;br /&gt;Finally I would like to encourage anybody to start discussion or to request an article on a related subject via the Comments section on each post.&lt;br /&gt;&lt;br /&gt;Thankyou&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8141999130858933537-4623591508962427830?l=blog.systemcoder.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ModernProgramming/~4/1HpQV8TeMs0" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/ModernProgramming/~3/1HpQV8TeMs0/who-is-m0nkeymafia.html</link><author>noreply@blogger.com (m0nkeymafia)</author><thr:total>0</thr:total><feedburner:origLink>http://blog.systemcoder.com/2006/11/who-is-m0nkeymafia.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8141999130858933537.post-2640998556195082472</guid><pubDate>Mon, 27 Nov 2006 14:38:00 +0000</pubDate><atom:updated>2006-11-27T14:48:08.186Z</atom:updated><category domain="http://www.blogger.com/atom/ns#">Systemcoder</category><title>Welcome to the home of Systemcoder</title><description>We are a couple of software engineers working for a UK company writing software for many different platforms and devices. Currently we do embedded work on several different processors, Windows work on both desktop Windows and Windows CE, a bit of embedded Linux, and recently quite a lot of web based stuff.&lt;br /&gt;&lt;br /&gt;We plan on making this blog a series of articles about some of the joys and pains of modern software development. It will include general articles about different bits of technology etc, as well as articles about problems we have come across while developing systems and how we eventually got round them.&lt;br /&gt;&lt;br /&gt;It's this section that we see as probably being the most valuable as, as we have tried to solve these problems over time we have often found lots of other people on the net with the same problems and no one with the answers, so we hope this will become a repository of annoying little problems and there solutions, as well as a rich collection of other software engineering tips and tricks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8141999130858933537-2640998556195082472?l=blog.systemcoder.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ModernProgramming/~4/cmEm_s8CHh0" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/ModernProgramming/~3/cmEm_s8CHh0/welcome-to-home-of-systemcoder.html</link><author>noreply@blogger.com (Darren Steadman)</author><thr:total>0</thr:total><feedburner:origLink>http://blog.systemcoder.com/2006/11/welcome-to-home-of-systemcoder.html</feedburner:origLink></item></channel></rss>
