When you load a remote page (a page which is not on your domain) into an IFRAME how do you ensure that the IFRAME expands its height to completely wrap its content, and has no vertical scroll bars (avoids having both the browser scroll bar and an iframe scroll bar), regardless of the content loaded? Well unless you have the willing consent of both domain on which the remote content is stored, you don't. But, if you can all agree to get along, then it is possible to seamlessly load remote content into your page, with no scrollbars, borders, or other visual queues of content being stored elsewhere.
The technique for cross-domain communication is used by Facebook, iGoogle, and Google Maplets, but there doesn't seem to be wide recognition of when and how it can be used.
Works across browsers, including Chrome, Firefox, Opera, Safari, and even Internet Explorer 6/7/8.
Read more...
Google Wave is being developed under the leadership of the same brother team that developed Google Maps (Lars Rasmussen and Jens Rasmussen), and basically re-envisions the 35+ year old email concept, from todays perspective -- really a personal social dashboard. 2 years in development using Google Web Toolkit, Google Wave mashes together and federates a huge number of more recent social and collaborative concepts, from email, IM, file and image sharing, document collaboration, wikis, blogging, and more. Say bye to having to manage 35 different social networks! Wave will consolidate them all into a single interface. Along with every other collaboration and social tool you use. Oh, and it's also a protocol -- more on that later.
And it does this in real-time, within a browser.
Read more...
Thu, 2009-05-28 21:34David Gilbertgoogle
There have been numerous ways to block ads in Google Chrome for a while now. The more popular is Privoxy which has the side effect of being a pain to get running, and affecting all web traffic on your machine. Well, there is finally an 'easy-to-install' way of ad-blocking in Chrome.
Be aware that this version of AdSweep is itself early in development, so there is no UI, nor any auto-update mechanism.
At the moment you need to be running the 2.0 development version of Chrome. Full instructions are here, but in summary:
Read more...
PHP is an atounding language. There are 48 different functions to do things with dates and times. And the one to validate that a given string is a valid date requires you to do your own date parsing.
Here's a simple routine that takes a dd-mm-yyy H:M date string (optionally including a timestamp), or a Unix timestamp, and checks to see that it's a valid date.
Read more...
The end of the world is nigh... Friday the 13th of February, 2009, at exactly 6:31pm and 30 seconds EST to be exact (that would be 2009-02-13 23:31:30 GMT). That's because at that exact time, Unix time will read "1234567890". That's a sign if I ever saw one. Scary times. What we need is a giant ass countdown clock.
Of course, not everywhere in the world is luck enough to experience this particular turnover on Friday the 13th, so for them all will be fine (that would be anyone east of Greenwich). Doom be unto all ye others though. Oh, and all iPhones are pretty much totally out of luck, being based on Unix as they are.
Now you might be sitting there all nice and safe thinking, it's only one second, how bad could it be? Ha. One second is way longer than the 10-37 seconds it took to for the universe to start expanding in the first place. So be afraid.
What it all boils down to is that it's Y2K all over again, except without all the problems. Oh, wait, there were no problems. Yeah, so it's just like Y2K.
Other momentous celebratory occasions have occured in the past, and we all know how that ended up.
- At 01:46:40 UTC on September 9, 2001, the Unix billennium (Unix time number 1000000000) was celebrated.
- At 01:58:31 UTC on March 18, 2005, the Unix time number reached 1111111111.
- At 03:33:20 UTC on May 18, 2033, the second billennium will be celebrated (Unix time number 2000000000).
Of course, on Tuesday 19 January 2038, 03:14:07 UTC all non-64 bit (or greater) Unix systems really will be screwed, as that'll be when time actually rolls over, from 2147483648, back to zero. Now that'll hurt. Ouch.
Find out what time the world ends in your region.
- Perl:
date -d @1234567890
- PHP:
php -r 'echo date("m-d-Y H:i:s", 1234567890)."\n";'
Personally, I shall pass the event downing beverages with nary a care for the consequences. Pah. The world shall end.
Check out this browser based Chess implementation. The site is in French, but it's pretty easy to work your way around.
The first player to the site gets a URL to send to the second player. Once the second player visits the URL, the game is on. Moves made by one player are seen on the other players web-browser immediately. Very smooth. Written in jQuery.
Thu, 2008-12-25 18:24DaveGjquery
I needed a lightweight PHP library to pull images and image data from a public Google Picasa gallery. The result is a PHP class, based on this work, which was then used as a foundation for a PmWiki cookbook pmGallery. PmGallery allows you to pull Picasa based images from public albums into PmWiki, using a simple markup.
If you want full access to Picasa's API you have a choice of client-side libraries, including one for PHP, using the Zend framework. The library itself is pretty big weighing in at 1.5Mb.
Read more...
Recently when I've tried to forward an email, I've been getting a bounced back error: This message has been rejected because it has a potentially executable attachment "xyz" This form of attachment has been used by recent viruses or other malware., or An error occurred while sending mail. The mail server responded: Potentially executable content. If you meant to send this file then please package it up as a zip and try again.
In order to understand what this means you need to realize that:
- When you click Forward the original message is being sent as an attachment.
- The attached original email itself contains an attachment, probably with a
.eml extension. You may not see this atachment, but it's there.
Read more...
Sat, 2008-10-18 12:34DaveGtips
v2.0
PureText solves one of those annoying little problems that is so small and so ingrained that you don't even stop to consider the possiblility that there might even be a solution. Copy a chunk of richly formatted text from one application to another, and all the formatting that existed in the first application is carried over. When I'm copying text, 99% of the time I simply want the text, not all the formatting. Of course applications provide a way of removing the formatting, but jeez, why go through all that hassle? PureText to the rescue!
- A single 13k executable with no installation required
- PureText only removes rich formatting from text
- Unicode support when running on Windows NT/2K/XP/2003/Vista
- User definable hotkeys
- Optionally autostart with Windows
- Just sits quietly in the taskbar, waiting...
Read more...
Matching brackets is an interesting interview puzzle, but only in so far as getting the basic approach down. Once you work out that you need to retain some form of queue of unmatched open brackets, you're done. The rest is all syntax, minutiae, and testing.
So an interview with this question shouldn't really be asking for working code. The basic algorithm, or approach should be enough. Really, you want to see if the person can think. If you're looking for specific language skills, then using this kind of test is going to fail miserably, since it doesn't represent a big enough portion of any language to be valid.
However, it looked fun, so I took this opportunity to learn some PHP. Getting a working solution took 2 hours. Most of that was discovering some weird things about PHP arrays, which was my first implementation, and then some odd things about the PHP functions.
Read more...
Tue, 2008-07-22 16:11DaveGphp