Upgrade to Symfony 1.2: Have your layouts stopped working?

I had a Symfony 1.0 app and I finally decided to make the leap to 1.2. Lo and behold, this mysterious error cropped up:

Notice: Undefined variable: site in /path/to/myproject/apps/site/templates/layout.php on line 10

If you’re upgrading from 1.0, you may suddenly notice that you get these “undefined variable” errors. That’s because global variables are deprecated in layouts as of Symfony 1.1, to be replaced with slots. Generally, a wise idea. More info here: http://trac.symfony-project.org/wiki/Symfony11LayoutUpgrade

Posted in Technology | Leave a comment

RubyOnRails.org Parked

Remember to pay your domain fees, folks:

RubyOnRails.org actually showed this for a good few hours. TechCrunch has the full story.

Posted in Funny, Technology | Leave a comment

Symfony, Doctrine, preSave and postSave

My new Symfony app calls a remote web service as part of the user creation process. Since this is intimately linked with the model (I want this behavior executed for my fixtures, too) it makes no sense to call the web service from the controller.

Like Ruby on Rails, Doctrine has some handy built-in hooks to execute code before and after saving a record. Here’s what my updated model looks like:

class sfGuardUser extends PluginsfGuardUser {
 public function preSave($obj){
  some_voodoo_magic($this->get('id'));
 }

 public function postSave($obj){
  call_my_special_webservice($this->get(’id’));
 }

}

Posted in Technology | 1 Comment

Trouble with MySQL Foreign Keys?

There I was, coding up a fresh Doctrine schema for a Symfony app, when my plans to implement foreign keys were repeatedly foiled:

SQLSTATE[HY000]: General error: 1005 Can’t create table ‘./mydb/#sql-xxxx.frm’ (errno: 150). Failing Query: ALTER TABLE cow ADD FOREIGN KEY (barn_id) REFERENCES barn(id)

I was using InnoDB, both tables were there, both columns were there, what else could MySQL want? Why didn’t it work?

Apparently, you must use the same data type for both columns. My cows.barn_id was an INT, while barns.id was a SMALLINT. This didn’t fly. Changing both to SMALLINT did the trick.

Hint: if you’re using Symfony with Doctrine, like I am, use “integer(4)” to get the MySQL INT datatype, or “integer(2)” for a SMALLINT data type. Plain old “integer” converts to BIGINT.

Posted in Angry Development Tips, Technology | Leave a comment

Newspapers Unite Against IE6!

A Norwegian client just told me to stop testing their product in IE6, words I could hardly believe I was hearing. That’s because a month ago, a handful of Norway’s major newspapers and other websites posted a warning telling their IE6 readers to suck it. And since most web-wired Norwegians read those newspapers online, it seems to have worked. IE6 is hereby and forever banished from Norway.

So how ’bout it, newspapers elsewhere? New York Times, Telegraph, anybody? To help it sink in, may I suggest one of Joe Lifrieri’s lovely “Overly Judgmental IE6 Splash Pages“?

This one is my personal favorite:

Overly Judgmental IE6 Splash Page

Overly Judgmental IE6 Splash Page

Thanks, Joe. Keep up the good work.

Posted in Funny, Technology | Leave a comment

Drop Shadow for Text with CSS

My distinguished colleagues at A List Apart already took care of building box-shaped drop shadows. But what if you want the text to have a shadow under every letter? Here are the results of my experiment, which I loathe for two reasons:

  1. You have to repeat the shadowed text when it’s completely unnecessary from a content perspective, and
  2. The div height and font size are hardcoded
But it kind of works.
But it kind of works.

Without further ado, the markup:

<div id='mydiv'>
<div class='shadowed'>The quick brown fox did something or other</div>
<div class='shadow'>The quick brown fox did something or other</div>
</div>

The CSS:

.shadowed {
position: relative;
overflow: hidden;
z-index: 2; }

.shadow {
position: relative;
overflow: hidden;
z-index: 1;
left: 1px; }

#mydiv {
height: 20px;
overflow: hidden;
font-size: 16px;
}

#mydiv .shadow {
color: grey;
top: -19px; }

Does anyone have a less hackish way of doing this? I’d love to hear about it.

Posted in Technology | Leave a comment

Subdomains & Sharing Now Enabled for cvPow.com

You can now access your CV/tag cloud at YOU.cvpow.com, and share links to your resume with dozens of social networks. Mine is at mariya.cvpow.com.

I’m looking for feedback: how would YOU like to use your CV data? Export it as an RSS feed? Export to Word so you can send it to old-fashioned headhunters? If I get enough requests for a feature I’ll add it.

Posted in Entrepreneurship, Technology | Leave a comment

Your CV as a Tag Cloud

Hi all! Besides a fresh look for Robozen.com, I’ve got a shiny new app for you to play with: cvPow.com. Ever wonder what your CV looks like as a tag cloud? Sign up and see for yourself.

I hammered the app out during this weekend after more than a year(!) of procrastinating on updating my CV. To prevent such further procrastinations, I created this little utility so I can always keep it up to date and shiny.

Subdomain accounts aren’t quite functional yet, but by next week I promise you your very own YOU.cvpow.com. So get the usernames while they’re hot, kids. And check out my own cvPow here: http://www.mariya.biz.

In news of somewhat less importance, I caved in and joined Twitter. I must admit, as dumb as I’ve always thought the idea was, I’m hooked and currently ill with a terrible case of Twitterrhea. Catch me there: http://twitter.com/quodestveritas.

Posted in Entrepreneurship, Technology | Leave a comment

How to Pressure Programmers for Fun and Profit

Last year, I wrote about one secret of successful project managers: strategic lying. If your programmer tells you a task will be done in three days, it will be done in a week, and you should tell your client it will be done in two weeks, to be safe. Conversely, if your customer tells you they need something in a week, tell your programmer it is due tomorrow.

Here’s an addendum: pressure programmers with only one task at a time. For example, if you have a project with three critical tasks and a week to do them, do not assign all three tasks to a single programmer, and give him next week as a deadline. Instead, assign the first task with a one-day deadline, pressure him to get it delivered, and repeat with the other two.

If they are assigned three “critical” tasks at the same time, many programmers will stop being productive. Some are simply so overwhelmed and stressed that productivity drops. Some feel that if “everything is critical”, nothing really is. And if you prod them about task X, they can always say, “but I’m working on Y and Z!” and they’ll probably be right.

But put one item on their plate as “critical” and “due today!”, and they feel motivated to get it done. They’re pressured, yes, but they can actually think about what they’re doing instead of worrying about the two other hovering deadlines. And should they fail to finish that one task, without a good reason, you can reasonably chew them out for missing deadlines.

Of course, it is your job as a project manager to decide on a reasonable implementation timeframe for each task (That’s if you’re familiar with the code; if not, you have to talk to your progammers instead of guessing, and remember to pad the estimates!). It’s also your job to shield the programmers from management, which will otherwise undoubtedly swing by to check in on tasks U, V and W.

Posted in Entrepreneurship, Project Management & Productivity, Technology | 3 Comments