My city building game, WidgetCity, displays the city as a table, each cell of a table representing one tile.
The tile map is done purely using just CSS, and CSS classes. The map is also scrollable.
How is this all done?
My city building game, WidgetCity, displays the city as a table, each cell of a table representing one tile.
The tile map is done purely using just CSS, and CSS classes. The map is also scrollable.
How is this all done?
Continuing from the unit test introduction, we will now continue and take a look at how to write tests and ways to run the tests.
Today I’d like to point out a bunch of good articles about refactoring – the process of improving code without changing the functionality.
Sameer Borate has written four posts about the topic in his blog, and I encourage you to check them out:
Due to popular demand, I’ll be writing a bunch of posts on unit testing.
In this post I’ll introduce unit testing: What it is, when it’s a good idea and when it might not be. I’ll also discuss a bit about what makes for a good unit test.
Next week I’ll post a followup to this, which will be more about actually writing unit tests with examples.
I haven’t had much ideas to write about lately, so how about this: You, my dear readers, get to tell me your favorite topic that you’d like to read/learn about.
Is there a specific topic you would like me to write about? As long as it’s somewhat relevant to this blog’s past content, post your idea to the comments! – I just might pick your idea and write about it. I even might pick more than one.
It doesn’t matter if it’s a small thing or a large thing. If it’s interesting, it’s good! It can be a general topic, like Zend Framework or design patterns, or some more specific thing like “how to do X”
I’ve been using Subversion for quite a while, and while it has some minor annoyances like complex merging, it never really bothered me.
Then along comes Git, touting that it’s easy and that you’re stupid if you don’t use it. The technical stuff people said about it were impressing, but not enough to actually warrant trying it for me – Afterall, I was quite happy with svn, as it did what I needed.
After a while, I decided I wanted to try Git anyway – just out of curiosity, to see if it actually was so amazingly much better. And in this post I’ll tell you if it was
A relatively common task in today’s Web 2.0 apps is passing values from a server-side script (or through a link) to JavaScript, affecting the client-side script execution.
Not surprisingly, there are a few ways to do that. Let’s look at three and their pros and cons:
If your application is well thought out, you would not want to save any data that isn’t valid. So what do you do, when you need different validation schemes, say for passwords, depending on some special case?
For example: Your user passwords need to be at least 8 characters long and contain upper and lower case letters, a number and a special character, but when one of your users forget their password, you would like to generate a new one which does not have to conform to those conditions.
There are some approaches to this, such as using more than one validation function in your user object, or using some boolean flag to enable or disable the validation. These are kind of clunky, though, and there is a better approach: Using a “policy” – Policies can be used for other things than this too, but let’s look at how to use a policy for managing password validation.
Zend_Forms, models, validation and how they all work together is a tricky topic. There are many opinions and many ways to do it.
This time I’ll show you what I think could be the answer to validating forms without having to duplicate validation code both in a model class and in your form.