Force a wmv to download instead of opening in browser

I recently needed to force a WMV to download using Apache. The default behaviour for most browsers is to try to open the movie inside the browser itself. This works fine if the person has the plugin otherwise we just gonna have a blank page. Also for huge WMV is easier to download the file for later viewing. So just place this on your .htaccess on the root of your website....

October 30, 2009 · 1 min · 95 words · David Amador

How to make a clickable div

Making a clickable text or image is easy, just add the <a> tag surrounding it. But this doesn’t work with divs and sometimes we need a whole div to be clickable and not just text. The following code is for JQuery but switching it to your favorite JS framework should be very easy. First start by adding this to your div <div class="clickable"> </div> Now a little css to simulate the pointer on that div...

October 25, 2009 · 1 min · 108 words · David Amador

PHP Optimization Tips

As most languages PHP allows many ways to solve a problem. Some are faster then others. Here are a few ways to improve your PHP code. Loop At some point your program will require a loop. And loop is considered as efficiency killer if you have many nested loop (means loop in a loop) as one loop will required to run ‘n’ times and if you have 1 nested loop, this means your program will have to run n2 times....

October 22, 2009 · 3 min · 506 words · David Amador

Search and Replace in MySQL

I found something very handy today, search and replace on Mysql databases. You can do it on phpmyadmin or make a php script with this. After moving a wordpress site from server I discovered that all image links were broken because they are placed directly inside each post. They were still linking to the old server. Changing it manually would be a nightmare. Luckily MySql is your friend. To search and replace a text string, start up phpMyAdmin, and click on your database name that you want to run the search and replace through....

October 22, 2009 · 1 min · 123 words · David Amador

Test your website on multiple browsers

One of the most painful tasks of a web developer/designer is to ensure that his website is compatible with the majority of the popular browsers. Nowadays this includes Firefox 2.0 and 3.0, Internet Explorer 6, 7 and 8, Opera, and the newest Chrome. Well, you can have firefox, IE and Chrome all on the same system, but what about multiple versions? Most people still use IE6 (they should be shame by the way)....

October 21, 2009 · 1 min · 106 words · David Amador

How to style a blockquote with CSS

Blockquotes are an easy way to make your website stand out, by indicating that you are quoting someone you give a more professional approach to you website. You can do this by using <blockquote> Im quoting someone else</blockquote> But it still needs a little touch, so on your css file add this. blockquote { background:transparent url(blockquote.gif) no-repeat scroll 0 0; font-family:Georgia,"Times New Roman",Times,serif; font-size:1em; margin:15px 0; min-height:32px; padding:0 50px; } Save this image : and watch the result....

October 21, 2009 · 1 min · 89 words · David Amador

Cloning Objects in C#

After trying to manually clone some classes, but making a sort of copy constructor I was always ending up with lot’s of code and worse, if I add another variable to my class I would sometimes forgot to also clone it. Luckily and after a search I discovered that C# has a cool thing, Reflection. So you can do something like this: using System.Reflection; class MyClass { public int a; public float x; MyClass() { // default constructor } MyClass (MyClass my) { FieldInfo[] fields = typeof(MyClass)....

October 12, 2009 · 1 min · 146 words · David Amador

The amazing lands of C++

I’m sure every programmer will like this

October 5, 2009 · 1 min · 7 words · David Amador

Master Web Developer

I decided to take a course on Master Web Developer. It’s a 6 months course covering PHP, actionscrip, HTML, JavaScript, Ajax and more. Hopefully I’m going to fill all my gaps on web development and possibly get more and better works in this area. Also this way I can give better credibility to Different Pixel.

September 25, 2009 · 1 min · 55 words · David Amador

Xna 2d Engine

Lately whenever I’m off work and I have the time I’ve been working on a 2d Engine in XNA. We named it Basalt. Cool hum? lol I have almost everything done, since sprites, to sprite animations, scenes, layers, resolution independent engine, game state and a lot of other cool things. On a recent post I’ve showed a 4 split screen prototype, that was made in Basalt. Also I’ve been working, even though on a slower pace on Shappire, the editor and a sprite sheet editor, for the animations etc....

August 14, 2009 · 1 min · 98 words · David Amador

DBP deadline is over, maybe next year.

Dream Build Play submission deadline is over. Unfortunatly I didn’t had the time to put my prototype working. Maybe next year. I always had the impression I would finish it on time cause the main goal was always IGF. Meanwhile I’ve been busy making the arrangements for The Indie Bay 48 hour game development competition. The idea is for every entrant to make a game in 48 hours using a given theme or topic....

August 6, 2009 · 1 min · 110 words · David Amador

-moz-opacity removed from Firefox 3.5

Well i just found out that Mozzila removed -moz-opacity from Firefox 3.5. It’s been deprecated for a long time and you can how replace it for the standard css property opacity. So something like -moz-opacity: 0.4 is now opacity: 0.4;

July 2, 2009 · 1 min · 40 words · David Amador