My name is Edward Tanguay. I am a web developer in Berlin, Germany. I learn everything I can and record it on this site. Other things you might be looking for: My Ubuntu Tutorial My Datapod Project My Blog Feed:  | | Most Recent Items
|
WORD VBA CODE EXAMPLE
- added on March 13, 2007
When you replace text in Word VBA it doesn't replace text in the headers and footers. Here's how to search AND search in headers and footers.
| post comment or questionpost comment or question |
|
|
|
ANDROID TUTORIAL - updated on November 14, 2007
|
|
3 D F L E X D O S E S S I O N
Installed on another computer with Flex 2 and got the same flash problem as last time, found fix, but now have Papervision specific problems.
| post comment or questionpost comment or question |
|
|
|
3 D F L E X D O S E S S I O N
Was able to download files with Tortoise but (a) I still get a black screen and (b) there seems to be something wrong with my flash player for debugging.
| post comment or questionpost comment or question |
|
|
|
3 D F L E X D O S E S S I O N
Got things set up but there were a number of issues that need to be cleared up.
| post comment or questionpost comment or question |
|
|
|
PHP TUTORIAL - updated on February 9, 2011
|
|
JAVA TUTORIAL - updated on August 4, 2007
|
|
LINUX TUTORIAL - updated on July 4, 2007
|
|
PHP TUTORIAL - updated on August 29, 2007
|
|
LINUX TUTORIAL - updated on June 21, 2007
|
|
DATAPOD TUTORIAL - updated on August 31, 2007
|
|
LINUX TUTORIAL - updated on August 30, 2007
|
|
RAILS TUTORIAL - updated on January 13, 2008
|
|
3 D F L E X D O S E S S I O N
Got right project this time but it can't find c:\Papervision.
| post comment or questionpost comment or question |
|
|
|
PERL TUTORIAL - updated on July 20, 2007
|
|
PHP CODE EXAMPLE
- added on November 18, 2008
This file runs through the input filters codes and shows how e.g. filter_var($value, FILTER_SANITIZE_STRING) and filter_input($value, FILTER_SANITIZE_STRING) will alter strings. You can see an example this here..
| post comment or questionpost comment or question |
|
|
|
PHP CODE EXAMPLE
- added on November 18, 2008
Nusoap is convenient because you don't have to make any changes on the server, just download and copy the library files to a sub-directory. Nusoap also creates a WSDL file automatically for you. These examples show how to return an array of values so that you could, e.g. return 20 fields of information about a user, for instance. Not that on the nusoap examples I turn the cache off since when you have it on while you are developing and add a method to your soap server, your client doesn't recognize the changes. First download nusoap, then copy the files to a sub-directory on your web called "nusoap".
| post comment or questionpost comment or question |
|
|
|
PHP CODE EXAMPLE
- added on November 13, 2008
Stumbled across this use of define() today, nice for HTML tag and newline shortcuts etc.
| post comment or questionpost comment or question |
|
|
|
FLEX CODE EXAMPLE
- added on November 8, 2008
The following instructions show you the exact steps to set up a free development environment on windows which allows you to develop Flex applications with ActionScript 3. You won't have the nice step-through debugging or the design view of Adobe's FlexBuilder but this code shows you how to create a two-line MXML file which allows you to do all your programming back in ActionScript 3 classes anyway so you just kind of use the MXML file as a tunnel to be able use the rich Flex libraries. FlashDevelop has very nice code-completion and other features, and with traces you can do decent debugging. The code helps you get up to speed with event handlers which are a bit different than web scripting if that is all you have been doing so far. You can view a running example of this appliction here.
| post comment or questionpost comment or question |
|
|
|
This works much better than my previous example since it enables FlashDevelop to do its nice code-completion on Flex objects such as "button". In FlashDevelop, new project, Flex, Flex 3 Project, then replace MXML code, then create a class and put in the ActionScript3 code.
| post comment or questionpost comment or question |
|
|
|
In FlashDevelop, new project, Flex, Flex 3 Project, then replace MXML code, then create a class and put in the ActionScript3 code. Unfortunately it doesn't seem to have the nice code complete completion for e.g. the button object.
| post comment or questionpost comment or question |
|
|
|
In FlashDevelop, New Project, AS3 Project, (check Create directory for project), (Project/Properties/Text Movie/Play in popup), then open up Main.as and replace it with this code.
| post comment or questionpost comment or question |
|
|
 tip
|
WINDOWS TIP - added on October 13, 2008
I wanted to install Visual C# 2008 Express but knew I wanted to try out the Visual Basic and Visual Web Developer as well, so instead of doing three downloads from the web, I downloaded the .ISO file with all four of them on it, then downloaded the free Virtual Clone Drive which after you install it looks like you added a DVD drive to your system, right-click it and select Virtual CloneDrive and Mount, then navigate to and select the .iso file and it is as if you are loading from a DVD, nice, much smoother solution then one I was using back in 2002 -- it just works.
| post comment or questionpost comment or question |
|
|
 tip
|
ECLIPSE TIP - added on October 9, 2008
Create hotkey macros in Eclipse
I've been using Eclipse for a long time and just found out that you can create a hotkey to perform all kinds of mundane tasks, e.g. if you find yourself committing a file every minute or so to check minute changes, go to Preferences | General | Keys and set up a e.g. CTRL-ALT-SHIFT-C to commit your file, explore this for awhile and save some time in the long run.
| post comment or questionpost comment or question |
|
|
 tip
|
PHP TIP - added on September 19, 2008
Tired of editing long lines extending out to the right in Eclipse? This plugin solves the problem, install as any plugin in Eclipse, restart, then right click and word wrap, simple as that.
| post comment or questionpost comment or question |
|
|
|
PHP CODE EXAMPLE
- added on September 18, 2008
If you need to write a quick PHP script that accesses a MySQL database, just copy in or include this class and you can do all your reads and writes with one-line satements.
| post comment or questionpost comment or question |
|
|
 tip
|
GENERAL TIP - added on September 15, 2008
Stackoverflow just launched publically today after being in beta for about two months. Last week I posted about 8 questions about vim and Perl and each question was answered by multiple people within 10 minutes. The site has a system of badges and reputation points you can earn for various things which turns people into hungry dogs waiting to answer your question first. You get to read the answers and mark them up and down based on their helpfulness and then select one that best answers your question. This site is truly unique, new, fresh, ajaxy in the right places, and very efficient, try it out.
| post comment or questionpost comment or question |
|
|
 tip
|
PERL TIP - added on September 12, 2008
Always put "my" in front of variables inside functions
In Perl, if you define a variable inside a function without the word "my" (e.g. @record = ...), then that variable is treated as a global variable (wow!). Hence, always define function variables thusly: "my @records = ...." inside a function so that they do not change values outside the function, e.g. if you have too recordsets and you use the same variable name "@records" to loop through them.
| post comment or questionpost comment or question |
|
|
|
PERL CODE EXAMPLE
- added on September 10, 2008
Was on a Perl project where the code had 5 lines of database connection code for each time it needed to get data from the database, so I wrote these functions which allow you to get records, record, value or execute a command with one-liners. Records are an array of hashes and included the code to call the functions since figuring out what syntax you need to access the objects through pointers/references can be time-consuming. End result is: if you just need to use Perl quick to read and write to a MySQL database, this code will get you up to speed fast.
| post comment or questionpost comment or question |
|
|
|
PERL CODE EXAMPLE
- added on September 2, 2008
If you need to do something quick and useful in Perl, this will get you reading and writing in databases and text files. If you are a PHP programmer getting into Perl then look up the "eq" operator first.
| post comment or questionpost comment or question |
|
|
|
CSS CODE EXAMPLE
- added on August 12, 2008
Many times you want to have a menu with A elements as the links instead of e.g. LI elements. Here is an example with large buttons. See example here.
| post comment or questionpost comment or question |
|
|
|
PHP CODE EXAMPLE
- added on July 17, 2008
This function checks if an IP address is between two others, not that ip2long has a problem by itself so you need the sprintf("%u") function as well. Also it returns false if any of the IP addresses are invalid as to avoid tampering.
patryksharks: shouldn't it be preg matches?
greetings post comment or questionpost comment or question |
|
|
 tip
|
FIREFOX TIP - added on July 6, 2008
I installed Firefox 3 today and instantly found the search-history-in-the-URL-bar to be indispensible. All the more to my horror did I realize that Firebug was no longer installed because it was not compatible with Firefox 3. Luckily there is a beta being built that IS compatible and it works just like the old one. The SQLite Manager and Web Developer bar still work in Firefox 3 and so with these three, no reason not to upgrade! Enjoy.
| post comment or questionpost comment or question |
|
|
|
This was a little experiment to get a useful base of cross-browser code that does some interactive stuff in Javascript. It is simple but handles mouseover, button highlight, and just has a nice, basic feel. The only issue is in Opera the text is at top of the buttons, but didn't have any nerves left for that one. At first I tried using :hover and :focus which brought me to the conclusion that this really isn't standard between the browsers so used onmouseover and onmouseout to deal with it. Also worked out a number of quirks that various browsers had, e.g. I removed the ugly dotted focus line in Firefox on the buttons, they left it there in Firefox 3 as well I noticed, I replaced it with a gradient background for the focussed button. So this code looks decent in Firefox 2/3, Internet Explorer 7 (probably 6 too), Opera 9.5 (in fact only after I upgraded from 8 did it show the background on the buttons), and Safari. The bad boy of the group is Opera, but since opera gets embedded in quite a number of devices these days (e.g. Philips TVs), you don't want to leave it out completely. You can view this example online here. Of course next step when implementing this is to make it read from a database or XML file, I just wanted to get the browser-compatibility as accurate as possible first.
| post comment or questionpost comment or question |
|
|
 tip
|
JAVASCRIPT TIP - added on July 3, 2008
If you are getting into AJAX and need a booster course on Javascript, this site has a nice concept/example format to get you up to speed fast without the make-the-background-color-blink examples you get on other sites. Note the "AJAX for N00bs" section as well.
post comment or questionpost comment or question |
|
|
TooTall: just curious why the first set of quotation marks are covered by some letters...and if there is a way to fix this? replyreply post comment or questionpost comment or question |
|
|
|
This code runs in Explorer, Firefox, Opera and Safari, simple code that enables you to attach Javascript functions to button clicks, etc.
post comment or questionpost comment or question |
|
|
PHP CODE EXAMPLE
- added on June 30, 2008
If you have various translations of your website, a quick way to implement this is to have an .ini file with all the translations in it and read it out. This code shows you how to also use constants within the ini file.
| post comment or questionpost comment or question |
|
|
|
CSS CODE EXAMPLE
- added on June 30, 2008
This CSS script give you absolute pixel-exact control of where to place text in a left and right area of a wide div, e.g. a header or footer. I was not able to get it to align automatically, e.g. left/center/right, so you have to know your font size and your text and position things exactly, but at least you have control, checked in Firefox and Explorer.
patryksharks321: nice code
btw relative is according to the last element and absolute is towards the block it's in right?
greetings post comment or questionpost comment or question |
|
|
 tip
|
GENERAL TIP - added on June 25, 2008
I've been recently downloading and listening to some great IT talks from the Conversation Network, talks by e.g. Rasmus Lerdorf founder of PHP, Mark Shuttleworth, founder of Ubuntu, even things that are on the edge of technology such as stuff going on in Biology and other sciences, really interesting talks by some key people in the industry, I've listened to about 5 and they've all been good. They have a nice format: you sign up to their RSS feed and just download the ones you want straight onto your MP3 stick and go. The free MP3s have a plug to sign up at the beginning and the end but you can download and listen to anything you want. After you download one, you get an email to review it the next day and in one click you can say how you liked it, which I assume gives good feedback so the best float to the top. If you have a lot of listen/wait time in your daily life, this is a great way to stay up on the latest in the IT space.
post comment or questionpost comment or question |
|
 tip
|
PHP TIP - added on June 19, 2008
EditPad Lite has been my text editor of choice for a long time since it is free and has an easy time-stamping feature (ALT-E-I) and you can set the time format. But it used to have a nasty habit of always writing a BOM to the beginning of UTF-8 files which PHP 5.2 can't deal with. I always had to go into jEdit and save the UTF-8Y file again as UTF-8. But just in March EditPad Lite came out with a new version that allows you edit UTF-8 files without the BOM characters at the beginning and and EditPadLite will *leave it this way*, very nice. This means that if I need to make a quick change to a PHP file, I don't have to fire up and wait the 15 long seconds for Eclipse to commence: I simply pop into EditPadLite and edit it without fear of adding a BOM (hmm, interesting that it sounds like "BOMB" since that is exactly what it does to your PHP file, nice). In any case, EditPad Lite is now an ideal free text editor to edit any kind of text file in any encoding and to convert to and fro between the various encodings (e.g. between Windows 1252, ISO-8859-1, and UTF-8). You have the option to simply change the encoding setting of a file but not translate the characters or you change the encoding setting of a file and translate the characters as well--just the tool you need when you find yourself in encoding hell.
 | post comment or questionpost comment or question |
|
|
|
FLEX CODE EXAMPLE
- added on June 13, 2008
You can do a lot more with filters, e.g. dynamically change them in ActionScript but here is the syntax for a basic shadow filter on a text.
Johann: Hello,
I'am very new to Flex 3 and programming but like it a lot. I've a ne question: i'am using multiple hsliders and the sum of the values of those sliders may not be over 100(%), so when the first slider value=60 the second slider is limited to value=40. What AS function do I need to achieve this? post comment or questionpost comment or question |
|
|
|
FLEX CODE EXAMPLE
- added on June 13, 2008
Check out this example here. This shows you the basics of using styles in flex, I did all of this with the FlexBuilder in design mode, very easy to use, when you are in a CSS file just click on design. The alpha transparency is wonderfully easy and the background picture leaves behind all the problems you have with page backgrounds in HTML/CSS, namely, it constantly resizes it, etc.
| post comment or questionpost comment or question |
|
|
 tip
|
FLEX TIP - added on June 13, 2008
Flex Builder 3 has a design mode for CSS style sheets
When you are in a CSS file in Flex Builder 3, you can click on the Design button and see your styles as they will appear. You can change them and the CSS code will change in the background, it gives a library/symbol feeling to CSS files, nice.
| post comment or questionpost comment or question |
|
|
 tip
|
ECLIPSE TIP - added on June 12, 2008
Code completion for PHP templates
When you make a PHP tempalte (like a macro) with Windows|Preferences|search for "templates"|PHP Templates, and you include $$${variable} in your template text, you will be presented with a dropdown of all available variables in the context where you call your template, nice.
post comment or questionpost comment or question |
|
|
FLEX CODE EXAMPLE
- added on June 11, 2008
This is another example of access filesystem this time with ActionScript. Did an expanding window in this example, but there are some scrolling issues on this window I need to work out, couldn't find a scrollable=false in the application element. To try this example, download adobe air and then you can install this application.
Pramod: Is it possible to access the File System in Flex web application, not AIR?
If it is, how it is done?
FileSystem type is not recognized in a Flex web application.
I want to upload a file in Flex web application?
Need Help.
Thanks in advance... post comment or questionpost comment or question |
|
|
 tip
|
FLEX TIP - added on June 10, 2008
Flex allows you to comment out attribute values
Flex Builder is full of surprises, here is another uncommon but useful feature: two slashes in front of an attribute value comments it out. ...addendum: any variable after the line with the double-slash will not be recognized in code complete = bug. oh well, 1 point for ingenuity.
| post comment or questionpost comment or question |
|
|
|
FLEX CODE EXAMPLE
- added on June 10, 2008
This shows you the basics of getting access to files and directories with AIR using FileSystemTree and FileSystemDataGrid. Would be interesting to see how these work in Linux and Mac. To try this example, download adobe air and then you can install this application.
| post comment or questionpost comment or question |
|
|
|
FLEX CODE EXAMPLE
- added on June 10, 2008
Here's how to get started with windows in an AIR application.
| post comment or questionpost comment or question |
|
|
|
FLEX CODE EXAMPLE
- added on June 7, 2008
View the example here. The graphic is png with transparency and you see that it lets the background of the button show through.
| post comment or questionpost comment or question |
|
|
|
FLEX CODE EXAMPLE
- added on June 7, 2008
Check out the example here. This shows you how to make a custom component (LanguageSelector) that you call from your main MXML file. The component throws a custom event which you handle externally in your main MXML file as well.
Udayan: Can you please let me know, if the code for LanguageSelectedEvent.as you mistakenly put the code of LanguageSelector.mxml. As both LanguageSelector.mxml and LanguageSelectedEvent.as looks same. post comment or questionpost comment or question |
|
|
|