Main Contents
December 9, 2009
Being an open source supporter I usually opt to use applications such as FireFox over IE, OpenOffice over Microsoft Office, Thunderbird over Outlook. However there will be features that will be missed once you choose this path. At lease for the initial part. Thanks to the open source community these features will no longer be missed as more and more member of the community adds support one piece at a time.
One such feature the was missed but now supported is the vCalendar support in Thunderbird. For some time I’ve had a hard time coordinating with the people in my company since the meetings are always done using the vCalendar. They even though I’m not interested in intending those scheduled events since I don’t reply to them. How could I? I couldn’t easy read the raw vCalendar format and reply to them. Installing Lightning in Thunderbird will enable you to read vCalendar format. It will a calendar application that is useful in tracking events.
Here are the steps:
- Download the plug-in from https://addons.mozilla.org/en-US/thunderbird/addon/2313
- On Thunderbird go to Tools->Add-ons.
- This will open a new dialog. Click on install.
- Locate the downloaded xpi file and click open. Make sure you selected the file type to display all types.
- Restart Thunderbird. You’ll then be able to view vCalendar’s and either opt to attend, not attend, or confirm later.
Reference: http://blog.andrewbeacock.com/2007/07/viewing-outlook-vcalendar-meeting.html
Filed under: General |
Comments (0)
Related Links:
March 20, 2009
This is just a demo of a lightbox implementation in Flash. The code was developed by Jeff Garczewski and the original codes could be found here (http://www.huddletogether.com/projects/lightbox/).
Easy to integrate. All you need is to link the javascript and css files in your html and include the following lines on your Flash ActionScript.
on(release) {
getURL("javascript:flashLightbox('path/to/imagejpg','Your Caption');");
}
You will need to add a wmode parameter when embedding the Flash media so that it won’t display on top of the Lightbox. For some reason though this doesn’t work on Firefox in Ubuntu.
<object type="application/x-shockwave-flash"
data="myMovie.swf"
width="400"
height="400">
<param name="movie" value="myMovie.swf" />
<!-- Your MUST add the 'wmode' paramater or your flash will appear
over top of your lightbox images! -->
<param name="wmode" value="transparent" />
</object>
Click the link above to see the demo.
Filed under: General |
Comments (1)
Related Links:
March 19, 2009
This was a proof of concept we sent to our client requesting dynamic content for Flash media plus a web based editor for the content.
At first glance it seems as if they are asking for something that could take months to develop. However, it’s actually simple enough that could be done by patching one component from another. Done with one cup of coffee.
Flash supports HTML. But don’t get too excited. Flash only supports some basic tags. All you need then is to be able to push data to it. You could do this with several methods. One would be using LoadVars. Another one is the good old FlashVars and lastly through XML.
With this example we’re using LoadVars. Below are the only lines of codes you need to do a simple CMS.
// Simple just declare a text area contains an HTML markup
_root.content.html = true;
// Load the content
var contentVars = new LoadVars();
contentVars.onLoad = function(ok) {
if (ok) {
_root.content.htmlText = contentVars.flash_content;
}
};
// load the file (use .php extension to avoid browsers from caching the content)
// no worries cause the content is encoded and no php script
// could be executed with this process
contentVars.load("flash_content.php");
// this is just to keep flash from running away
stop();
You might wonder why not just use Flash XML feature instead of LoadVars. Well that could be done also. It’s just what I felt doing at the time. Also since I was using php as my file extension XML might not be the right choice as it exposes some security holes.
Next step is the What-You-See-Is-What-You-Get editor (WYSIWYG). There are lots available in the net. For this example I used TinyMCE. You would need to configure or do some hack to make the editor only use the tags supported by Flash. List of supported tags could be found in http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_14808.
Once you get that done next step is to push the content of the editor to Flash. This is where PHP plays its role. Of course you could use other server side scripting in place of it.
The result would be something like this (Flash CMS sample). Go ahead and try it. You may also download the source files to modify and maybe improve it.
Filed under: ActionScript, Flash, General, PHP |
Comments (0)
Related Links:
December 24, 2008
Usually when creating a scraper or a simple parser we encounter data that are usually not as clean as we expected it to be. For example We should be parsing only the sale price but the label gets in the way. These codes could be useful for the purpose of filtering out unwanted characters.
Integers:
$dirty_data = 'You\'re now 26 years old';
$clean_integer = ereg_replace("[^0-9]", "", $dirty_data);
// $clean_integer = '26';
Decimals:
$dirty_data = 'Sale price : $12.45';
$clean_dec = ereg_replace("[^0-9.]", "", $dirty_data);
// $clean_dec = '12.45';
This would also do good on prefomating a phone number if you only want numbers but your users adds dashes or spaces in between.
Filed under: PHP, PHP & MySQL |
Comments (0)
Related Links:
September 9, 2008
I often forget even simple syntax that makes MySQL operation easy. I’m just adding this basically for personal reference.
Using INSERT statement combined with the SELECT statement you could actually add records from one table to another table. Adding a WHERE clause could enable you to filter the records to copy. Below is the syntax.
INSERT INTO table_destination SELECT * FROM table_source [WHERE condition];
However this generic statement only works if the two tables have the same order of columns and has compatible data types. If that is not the case you would need to specify the columns like the following syntax:
INSERT INTO table_destination (column_1, column_2, column_3)
SELECT column_1, column_2, column_3 FROM table_source [WHERE condition];
Filed under: MySQL |
Comments (0)
Related Links:
September 5, 2008
Problem:
You’re probably wondering why the following query doesn’t work on some mySQL databases
SELECT * FROM table1 WHERE NOT id IN (1, 2, 3)
works on mySQL v5.0.51a
doesn’t work on mySQL v4.1.21
Solution: (more…)
Filed under: MySQL |
Comments (0)
Related Links:
August 16, 2008

There are basically three parts you need to be concerned about when generating an RSS v1.0:
- The RSS related data
- The feeds
- The search information
RSS related data
These will be the data that are specific to the whole feed or to the website. These would include the following:
- title
- link
- description
- image
Feed Items
These will be items you would want to put on the RSS Feed. Each Item would include the following:
- title of the article, news, or any other item depending on the use.
- description or summary
- link to the item page on your website
Search information (optional)
Some RSS readers supports search feature for RSS items. You could utilize this by setting up a search script on your host. This would need the following information:
- URL of the search script
- title
- description
- parameter name of the search string variable
See demo here (sample_rss_v1.0).
Attached is a simple template that could be used in any application. Like most of my sample template, all the data are hardcoded. They could easily be replaced with data coming from different sources like a database or a scraped html content.
Specified header might not be needed but the following could be used:
header("Content-Type: application/xml; charset=ISO-8859-1");
I’m Planning to post another using RSS v2.0.
Attachments:
sample_rss_v1.0.zip
Reference:
http://en.wikipedia.org/wiki/RSS_(file_format)#RSS_1.0
This is the first of many sample templates that I’ll be posting here. I usually just browse through the web to find templates / sample scripts for different web technologies but sometimes good articles disappear and could never be found. Most of the time clients will ask for added features like RSS feeds, integration to payment gateway, email form, etc. The problem is that is no script available to use that is easy enough to modify.
My plan here is to have a repository of simple scripts that could easily be copied and pasted to anywhere. I usually put the code part first and the template part next, so expect it on most of the sample scripts posted here.
Filed under: PHP, Samples |
Comments (0)
Related Links:
January 5, 2008
Problem:
I’ve been using Ubuntu in quite a while. I missed the windows tiling capability that is available in Windoze OS. This doesn’t come easy in Ubuntu. You would have to download a deb package from http://freshmeat.net/projects/wmtile/ or http://ostatic.com/wmtile and install tile into your system. It’s a command line tool that allows tilling of all unmaximized and unminimized X windows either vertically or horizontally. A simple command used in Ubuntu would be similar to this:
tile -w
Just create a launcher somewhere that is easily accessible and you’re good to go.
Not quite yet! This doesn’t work well in Ubuntu with the default X window manager, Metacity, yet. It keeps on tilling all the wrong X windows. Even the panel is being tiled.
In Ubuntu tile stores its settings in two files found in /usr/share/tile/. The “rc” file would be the one important for our discussion. This file stores the X windows to be avoided by the tile program. To exclude certain X window, include codes similar to this:
avoid WM_NAME Bottom Panel
avoid WM_NAME Desktop
avoid WM_NAME gkrellm
avoid WM_NAME gbuffy
avoid WM_CLASS FrontPanel
However, I have no idea how to get this informations. I hated this as tile command messes up my desktop. It moves around my top panel and Avant Window Navigator which is a huge deal cause this renders the tile command useless.
Solution: (more…)
Filed under: Ubuntu |
Comments (0)
Related Links:
November 7, 2007
Problem:
Switching between Flash versions could sometimes be tricky. We needed to check the compiled Flash application in an older version which is Flash Player v6. The problem is that once you installed the latest version it’s hard to revert back to the previous version.
Solution:
(more…)
Filed under: Flash |
Comments (0)
Related Links:
November 6, 2007
Problem:
We were developing a specialized application for a client. This application should be able to take an image template and allow users to customize (move/crop pictures, add message, etc.). To produce a good enough resolution acceptable for printing the application needs to handle templates as large as 2138×3038 pixels. Adobe Flash limits developers from creating BitmapData with width or height larger than 2880 pixels. Bad news. Try creating a Bitmap greater than the specified limit and you’ll get this error:
ArgumentError: Error #2015: Invalid BitmapData.
This will work:
var ValidBitmapData:BitmapData = new BitmapData(2880, 2880);
This won’t:
var InvalidBitmapData:BitmapData = new BitmapData(3000, 3000);
According to www.adobe.com:
The maximum dimensions of a bitmap in Flash Player is limited to 2880 pixels in either direction (width or height). If you attempt to create a BitmapData instance that is larger than this restriction, the Bitmap will not be created. This limit is in place to keep people from creating Flash movies that gobble up the client’s RAM. A bitmap that is 2880 x 2880 pixels, will use roughly 32MB of RAM.
This restriction becomes more and more useless as computer hardware becomes more and more capable.
Solution:
(more…)
Filed under: ActionScript |
Comments (16)
Related Links: