2010
03.03

This problem manifested itself in both the new Opera and Google Chrome browsers. The pac file worked perfectly in Firefox and IE, but refused to work at all in Opera and Chrome.

This is what the original pac file looked like:

function FindProxyForURL(url, host)
{
  if (isInNet(myIpAddress(), "10.200.0.0", "255.255.0.0"))
    return "PROXY 10.100.0.99:8080; SOCKS 10.100.0.99:1080";
  else
    return "DIRECT";
}



This code is in a “myproxy.pac” file hosted on a web server on my PC. I then reference the url of the file in my browser’s pac file setting: “http://localhost/myproxy.pac”.

The solution was simply to remove the leading spaces for the lines in the function, like so:

function FindProxyForURL(url, host)
{
if (isInNet(myIpAddress(), "10.200.0.0", "255.255.0.0"))
return "PROXY 10.100.0.99:8080; SOCKS 10.100.0.99:1080";
else
return "DIRECT";
}



And now it works!

So, my assumption is that Opera and Chrome prefer messy code.

2010
02.08

I’m planning on buying an iPad and this may or may not be a foolhardy thing to do. Having made up my mind to lay out cash the next step in my plan is to figure out how much cash I will need.

For this little exercise let us compare the US prices of some Apple products to their South African prices on the ZAStore. To make it fair, let’s not forget to remove the VAT from our prices as the US prices don’t have their sales tax added. Just for interest the sales tax in Los Angeles is quite high (for America) at 9.75%.

Apple.com prices

Product Listed Price (USD) Converted to Rands
iPod Touch 8GB $199 R1,545
iPod Touch 32GB $299 R2,322
MacBook $999 R7,757

zastore.co.za prices for the same items:

Product Listed Price (ZAR) Without VAT
iPod Touch 8GB R2,699.00 R2,367.54
iPod Touch 32GB R3,999.00 R3,507.89
MacBook R10,999.00 R9,648.25

Percentage mark-up at zastore.co.za:

Product Calculation Percentage mark-up
iPod Touch 8GB (2367.54 – 1545) / 1545 * 100 53.24%
iPod Touch 32GB (3507.89 – 2322) / 2322 * 100 51.01%
MacBook (9648.25 – 7757) / 7757 * 100 24.38%

So, we can deduce, based on current pricing that the iPad ($499 –> R3874.74) with markup and VAT should cost between R5,494.12 (24.38% mark-up) and R6768.92 (53.24% mark-up.)

Finally

I can say with 95% confidence that the iPad 16GB with WiFi will cost between R5500 and R7000 when it becomes available in South Africa. My prediction though is around the R6000 mark.

2009
11.02

When I was studying Information Technology I was taught the classic Systems Development Life Cycle. Since then I have been exposed to many more development models and strategies and have come to the conclusion that each project is different and will require a different approach.

It is also easy to see when the development process is being done wrong. At least I think it is easy to see, but that could be hindsight as it is always trickier to get your foresight to work. Let me tell you about the development cycle at a local outsourcing firm that I am unfortunately being exposed to.

The development models in use

At its heart the development models in use are the Iterative model, Evolutionary Prototyping , and a bit of Verification and Validation. None of these are wrong or bad, but the project is still struggling due in part to how these models are being managed and a large part to how the project was started.

The problems

The system’s presumed function and audience has changed dramatically during the first few months of development and all of the original coding was done by a junior programmer. I know he is a junior programmer as I can see novice mistakes in the code. His mistakes include not understanding how Object Oriented programming should work, his user interface design, and his approach to handling data for a web based interface. They all scream inexperience and haste. If this was to be a throw-away prototype, a once-off proof of concept, then it would be fine. It could even be a growth experience for the junior programmer as someone more experienced could criticize the code and everyone would learn. That was not the development model that was chosen though.

Remember the Evolutionary Prototyping model in use for this project? Well its aim is “to build a very robust prototype in a structured manner and constantly refine it.” Which means that this pile of amateurish code is now the foundation for all iterations of development. There is also no convincing the boss that a rewrite is in order as the client has already paid a lot of money and they can’t be expected to pay again.

The end result is that any change to the system – new feature, bug fix or performance enhancement – is very likely to break another part of the system. This makes maintenance tricky and deliverables difficult to promise.

How could this mess have been avoided? (mostly anyway)

The original system could have been thrown away and the client’s requirements could have shaped the next version.
More experienced developers should have been brought on when the client was sold the idea.
User requirements should have been managed more clearly and in a formal manner (this is a whole other problem that I didn’t even raise in this post.)

Will these lessons be learned?

I hope so.

2009
09.09

Something I have long believed in, is that, as developers, we should be concentrating on one job at a time. I have often been put in the situation where I need to work on multiple tasks during a working day. This not only creates stress, but also leads to increased delivery time and potentially poor delivery for all of the projects.

It might be nice to be able to say to each customer: “Yes, your project is currently being worked on…” – but, I think it would be far better to be able to say to the customer: “Your project will be completed in 2 week’s time”. The second statement may not be exactly what that customer wants to hear, however, it will result in a better product and a lower overall cost (not only for the current development phase, but also future maintenance cost due to having a better product delivered).

While I understand that many customers simply want a product delivered in the shortest time possible, the long term benefits must surely be to retain a greater customer loyalty due to a better product being delivered.

With reference to: http://codemonkeyism.com/high-cost-overhead-working-parallel/

2009
06.16

If you have a Nokia S60 5th edition phone with an accelerometer then you can easily create widgets that read the device data. Why would you want to know how your phone is oriented in 3d space? I can think of a few pretty cool user experience reasons such as tilt-to-scroll (ala Instapaper’s iPhone app) and as the control mechanism for games. Unfairly though, widgets are not especially geared towards performance so gaming may be out of the question. In fact if you run my demo you will realise just how badly a JavaScript and HTML widget can perform – if you want nice animation in a widget you will be forced to use Flash lite.

In my rather simplistic demo I have a small block on screen that slides around depending on which way the phone is tilted. There is a bug though – a very big bug on my 5800 with v20 software: it eventually slows down and then crashes with a memory full error. You see there is a memory leak somewhere and, after rewriting my code many times, I have to assume it is in the phone’s handling of the sensor data interface for widgets.

Perhaps if you try out my demo you would let me know if it works for a prolonged period of time (>10 minutes) or not on your phone either by commenting here or via twitter (@perelson). Oh, and I know I said S60 5th edition, but if your version of S60 runs WRT widgets and has an accelerometer then it may just work for you as well.

Download the demo: blockmover.wgz. It installs as “Sensor BlockMover” in the Applications folder on your phone.

Warning: If this demo causes a memory full error, your phone may just stop some of the running programs. All I’m saying is don’t blame me if another application gets closed and you lose something important.

2009
05.25

I just read about Violet’s Mir:ror product on Read Write Web (rww). The Mir:ror is simply a RFID reader that, together with some software, can do a variety of different tasks when presented with various RFID tags. You could program it to record when you feed the dog presumably by tagging and then swiping the dog’s bowl whenever you feed the dog. Some intelligent software would then monitor this data and could then inform you when it is time to buy some more dog food. Or, you could keep track of objects in a storeroom, or even perform other actions, like twittering whenever you swipe some tagged object. Swipe your umbrella over the Mir:ror and you could be automatically whining on twitter about the weather again.

Of course, the RWW article mentions quite a few shortcomings that all boil down to humans being lazy. If the Mir:ror reader isn’t where you need it then forget it. You also have to set up all the tags individually for each object and you have to create the action that will be performed when the object gets swiped over the reader! Never, I’m far too lazy for that to last any meaningful amount of time.

I was thinking though that the ability to track certain objects and their usage is quite a nifty one. Why can’t we get rid of the RFID tags and replace them with barcodes? You can print barcodes out on any standard printer so they can be extremely cheap to produce and many objects have barcodes already. Don’t have a barcode reader? Well, what about your mobile phone… doesn’t it have a camera? In fact, my phone is a smart phone and I’ll bet I can make some software that can read the barcode, interface to a web service and retrieve the details of the product and based on what the product is guide me through the default types of actions I might want to perform with the object. It could even upload the generated data to a cloud service for storage, analysis, events, and reports.

It would be useful even at the basic level of just being able to scan a barcode and the software telling me how many times and when that barcode was scanned. You see, if I am scanning dog food then I know I am scanning dog food and I can make my own rules as I see fit. In this case I would be able to see how many times I have fed my dog and that I have not skipped a meal. Rules and actions can be added later – in fact everything else could be done through a web interface to work with the stored data.

I can’t tell, is this a good idea?

2009
02.10

There is a small development office comprised of eight developers out there. They crank out code to support the financial decision makers at the company they are contracted to and over the years their database schemas have grown. Bottom line was they were spending more and more of their time maintaining the databases and less on providing services for their clients.

Enter the Database Administrator

They felt like they needed someone to provide support when it came to maintaining the databases. This person would help when they needed to produce a complex query and would guide them to better design choices. Someone who would ensure backups ran and would document the databases. Someone who would support the developers by ensuring the database would continue working at its peak by monitoring indexes, statistics, and files.

What they got was an academic theorist who is formalizing everything possible into a best practice nightmare. They got an academic theorist who doesn’t know how to maintain the database, but does know what other people have written about database design and techniques. What the developers are getting are rules to follow – the Database Administrator is supervising their projects more than administering the database.

Now don’t get me wrong, I like standards and I agree that it is important to put these policies into effect. It just would have been nice for the developers to be able to spend more time writing software. Instead they still end up doing all the work a bona fide database administrator should be doing and they lose a little morale every time they have to do the Database Administrator’s job.

The developers in that team know that they can only rely upon themselves in the event of a critical database failure and not the Database Administrator.

2009
01.13

I didn’t want to disable commenting on our blog, however the proportion of spam to legitimate comments was horrendous. In order solve this problem and take the burden of self managing the commenting system away from us we have implemented the Disqus commenting service.

So let those comments flow safe in the knowledge that the trolls won’t hide your voice. We might, but they won’t.

UPDATE: Due to an upgrade we kind of lost the link to Disqus and we are not in too much of a hurry to re-enable it.

2008
04.21

Comments on comments

There’s a lot of maintenance of code on my current project.  The code is not always of a very high standard (ok, so that’s being nice!).  One of the things that annoys me is where code comments are pointless, and are glibly added without any thought to their purpose.

Here’s an example of a poor comment:

  //function function will call the various functions depending on the selection that was made
  addProgrammes( ctlFlexTable, xaxisf.AsString() );

Of course, and to be fair, there are slightly more useful comments:

  // — Add a total row —
  row = new MIS.Tables.Rows.TotalRow( ctlFlexTable );

On the whole, I feel that comments should be used in source code to highlight the purpose of a piece of code, where that purpose is not immediately apparent.  Also, comments can be used to explain functionality where that functionality is not obvious.

Andrew.

2008
04.20

Welcome

This is the Metaflex developer’s blog. We will be writing about scenarios, cases, projects, happenings, fun facts, not so fun facts, and anything else we find interesting enough to share.

Your authors are Andrew Perelson and Stephen Perelson – brothers who share a love for software development. Together we have over 30 years of experience working in the IT industry locally and internationally and we hope you will gain positively from our blog.