Broken AC's are no fun.

Avoid the hassle I went through last week and change your filters on the AC once a month. Clogged filters overtime caused a clog in my inner coil which led to a small leak and thus the release of freon overtime. This caused the water in the vents to build up and freeze which restricted airflow and cause the AC to work too hard and then shut off. Just change your filters and you will save yourself $500 in repairs.

Cyber Warfare in Action

I came across a really interested article on Wired's website this morning. Apparently Iran's nuclear operations were the target of a new sophisicated virus that contained several "Zero-Day" threats which left many security experts quite bewildered. Check this out article out, it's long, but a very good read, kind of like a Tom Clancy novel.

http://www.wired.com/threatlevel/2011/07/how-digital-detectives-deciphered-stuxnet/all/1

jQuery Cycle for the best customizable slideshows.

I've been having to build a lot of various slideshows for my job recently and instead of using the Drupal Carousel or Slideshow modules with my View, I just display the view as an unordered list and then create my own slideshow with jQuery Cycle.

Git Repository of my Drupal Distro

I have set up a public git repository for the Drupal distrubtion that I use on my sites. It's a Drupal 6.x platform with several must have contributed modules & themes.

You can access it at http://github.com/dgpalmer/remlap

or directly via the command line with:

git clone git://github.com/dgpalmer/remlap.git

This is how you get your CIS494 Final Project done!

 

 

It's going to be a long night, but I'm ready to rock this Image Gallery out.

Writing a sweet Korn Shell script to build an Image Gallery using sed, awk, m4, & ImageMagick!

 

Top 10 Newly Discovered Albums of 2009

Well 2009 was quite a year of musical exploration for me. Techno & Electro took over my ears this year. I had developed a taste for techno during the past few years, but this taste has blossomed into something big and now I'm obssessed. Deadmau5 & Boys Noize were probably my 2 biggest finds of the year.

If you want to follow my music listening more closely, be sure to check out my last.fm profile and add me as your friend!

Here are the top 10 albums that I discovered in 2009:

DonovanPalmer.net is now up!

Welcome to my new website, donovanpalmer.net! It's just going to basically be a blog where I rant about all the stuff that matters to me. I will be posting all sorts of guides/reviews/rants about various topics including Web Development, Drupal, Computers, basically anything nerdy. I'll also be posting Lakers stories and videos throughout the course of the NBA season. I'll also have reviews of video-games and other gadgets & devices. I hope you enjoy!

Thanks!

Donovan Palmer

Force Browser to Reload .swf's with jQuery

Recently, I ran into an issue with one of the flash apps I built. Since, I'm making changes almostdaily, there is always a new version of the swf, and right now there are users actively using this app and they weren't receiving the newest version unless their cache was cleared. The only option is to force the browser to reload the new .swf and so I searched on Google and this seemed to be those most frequent answer, but certainly not the best.

<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">

And yes it does work great but only if the user doesn't already have the .swf in their cache and it doesn't always work with Internet Explorer.

A co-worker suggested I try to make a javascript snippet that would append x number of random digits after a "?" to the default.swf file in order to trick the browser into thinking it was a new version of the file.

I decided to use the tools available with the jQuery API along with a simple "for" loop that will append a random 24 digit number to the end of the embed's src like this default.swf?8936273541227119153514771. This was relatively simple to set up. I simply use the .attr("src") function from the jQuery API to pull the source from the element of the #css_id being called. Then a for loop generates 24 random digits and creates a string of them and concanets them to the src of the element using the .attr("src", string) function again, but this time there is a 2nd parameter, and it is a string that will replace the current src of that element.

Here is the Javascript:

  1.  <script type="text/javascript">
  2. $(document).ready(function(){
  3.  var temp = $("#css_id").attr('src');
  4.  var rando='';
  5.  for(i=0; i<=24;i++){
  6.   rando = rando +((Math.floor(Math.random()*10))+1);
  7.  }
  8.  $("#css_id").attr('src', temp + '?' + rando);
  9. });
  10. </script>

The #css_id is the id for the embed tag in which you are loading the swf file.

<embed id="css_id" src="sites/default/files/default.swf"></embed>

That should about cover it! Please note though that this is more of a "hack" then an elegant solution. Each time your user visits your site, they will be downloading a new .swf file even if there is no update. If your site has a lot of loyal traffic and users come to your site several times a week or day, they will be downloading a new .swf each time and that can begin to fil up their temporary internet files pretty quickly. This is a good solution is you are updating the .swf frequently and it is of relatively small size.

Now if you add the meta tag I showed above to your &lt;head&gt;, this should keep the browser from storing each .swf in the cache and thus should resolve this issue of storing too many different .swf's for the same file.

If you know of a better way to do this, I would like to hear it! :D

Syndicate content