health medication

Programming


Programming and Technology18 Jun 2008 12:32 pm

I was recently working on a new gallery display using a flash interpretation of the Apple Cover Flow view. The problem I had was the flash movie swf content was displaying infront of the css drop down on the site. The css dropdown was built using divs and the flash content was in a div but it didn’t seem to matter the settings on those divs.

To get the flash to display behind the css drop down menu you just have to set the wmode property to transparent. This setting must be made both in the AC_FL_RunContent call and in the Flash Object or by choosing Transparent Window in the Publish Settings menu in flash.

[tags]flash,css[\tags]

del.icio.us:CSS Drop Down Displaying Behind Flash Movie digg:CSS Drop Down Displaying Behind Flash Movie spurl:CSS Drop Down Displaying Behind Flash Movie wists:CSS Drop Down Displaying Behind Flash Movie simpy:CSS Drop Down Displaying Behind Flash Movie newsvine:CSS Drop Down Displaying Behind Flash Movie blinklist:CSS Drop Down Displaying Behind Flash Movie furl:CSS Drop Down Displaying Behind Flash Movie reddit:CSS Drop Down Displaying Behind Flash Movie fark:CSS Drop Down Displaying Behind Flash Movie blogmarks:CSS Drop Down Displaying Behind Flash Movie Y!:CSS Drop Down Displaying Behind Flash Movie smarking:CSS Drop Down Displaying Behind Flash Movie magnolia:CSS Drop Down Displaying Behind Flash Movie segnalo:CSS Drop Down Displaying Behind Flash Movie
Programming and Software and Technology19 May 2008 12:45 pm

When I first tried to get PicLens enabled on my website photogallery I could not get the PicLens plugin to recognise my pictures rss feed. I had created my pictures.rss feed and instructed by the PicLens webmaster guide and pointed the page to the rss file using the link call at the top of my page.

<link id="gallery" rel="alternate" href="photos.rss" type="application/rss+xml">

I double checked the format of my photos.rss page but I still could not get PicLens to recognize it, and instead kept getting the error:

“This site does not yet support PicLens.”

The Cause: I discovered was that my web host (GoDaddy Shared Hosting Plan) was not correctly serving the rss file.

The Solution: Rename the photos.rss feed to photos.xml. Since the rss file is an XML file I knew it would be correctly served and would be hopefully be discovered by PicLens. For me changing the rss file to an xml file extension solved my “This site does not yet support PicLens” Error.

The second issue I discovered was that the webmaster guide does not list the guid field in the spec yet it is seems to be necessary for PicLens to match images on your site to the declarations in the rss feed. The guid field is included in the example photos.rss fied that comes with the downloadable webmaster guide which seemed to work unlike mine was so it was my clue the rss guid field was necessary. The rss spec clasifies the guid field as a unique identifier. I chose to use the filename as the guid for my photos.rss (photos.xml field as is the case for my setup) since it is unique and change the isPermaLink field to be true since it is. I could have also used the ID field of that row in my Database but I figured the PermaLink provided me with more information.

<guid isPermaLink="true">picture_214_2_1211225557.jpg</guid>

Let me know if this solves your PicLens error or if you have any others I may be able to help with.

Technorati Tags: , ,

del.icio.us:PicLens Can Not Find photos.rss PicLens rss Feed digg:PicLens Can Not Find photos.rss PicLens rss Feed spurl:PicLens Can Not Find photos.rss PicLens rss Feed wists:PicLens Can Not Find photos.rss PicLens rss Feed simpy:PicLens Can Not Find photos.rss PicLens rss Feed newsvine:PicLens Can Not Find photos.rss PicLens rss Feed blinklist:PicLens Can Not Find photos.rss PicLens rss Feed furl:PicLens Can Not Find photos.rss PicLens rss Feed reddit:PicLens Can Not Find photos.rss PicLens rss Feed fark:PicLens Can Not Find photos.rss PicLens rss Feed blogmarks:PicLens Can Not Find photos.rss PicLens rss Feed Y!:PicLens Can Not Find photos.rss PicLens rss Feed smarking:PicLens Can Not Find photos.rss PicLens rss Feed magnolia:PicLens Can Not Find photos.rss PicLens rss Feed segnalo:PicLens Can Not Find photos.rss PicLens rss Feed
Programming and Technology06 Feb 2008 04:22 pm

Many times you need a quick encryption solution in a database but do not want the overhead of coding something more complex. mySQL provides you with a simple encryption solution directly in the sql query.

TO ENCRYPT:
INSERT INTO users (user, pass) VALUES (‘$username’, AES_ENCRYPT(‘$pass’, ‘secret encryption key’));

TO DECRYPT:
SELECT user, AES_DECRYPT(pass, ‘secret encryption key’) FROM users

del.icio.us:Encrypt and Decrypt Strings in mySQL sql Queries digg:Encrypt and Decrypt Strings in mySQL sql Queries spurl:Encrypt and Decrypt Strings in mySQL sql Queries wists:Encrypt and Decrypt Strings in mySQL sql Queries simpy:Encrypt and Decrypt Strings in mySQL sql Queries newsvine:Encrypt and Decrypt Strings in mySQL sql Queries blinklist:Encrypt and Decrypt Strings in mySQL sql Queries furl:Encrypt and Decrypt Strings in mySQL sql Queries reddit:Encrypt and Decrypt Strings in mySQL sql Queries fark:Encrypt and Decrypt Strings in mySQL sql Queries blogmarks:Encrypt and Decrypt Strings in mySQL sql Queries Y!:Encrypt and Decrypt Strings in mySQL sql Queries smarking:Encrypt and Decrypt Strings in mySQL sql Queries magnolia:Encrypt and Decrypt Strings in mySQL sql Queries segnalo:Encrypt and Decrypt Strings in mySQL sql Queries
Programming and Technology05 Feb 2008 04:04 pm

I recently had all kinds of problems installing the UPS XML Shipping Module on my osCommerce shopping cart. I (thought I) followed the setup instructions correctly but every time I actually tried to checkout a shopping cart the shipping checkout page would hang and then I would get a mySQL timeout error. This error made no sense because the mySQL database was mostly empty and the shipping query is not that intensive.

After much debugging and hair pulling I found the solution. Since the website is set up on a GoDaddy Shared Hosting plan, the curl call to the UPS XML api was failing. GoDaddy Shared Hosting uses a curl proxy and you must configure any CURL requests to go through that proxy.

Below is the solution, which I am sad to say I found at the very end of the readme.txt document included with the UPS XML package AFTER I figured it out the HARD WAY! DOH and DOH. I am embarrassed to say I stopped reading the instructions when I thought I got to the end but the last last step is how to make it work with GoDaddy Hosting. Hopefully this post will save someone similar frustrations by being able to quickly find the solution with a google search!

From the readme.txt file …

----------------------------

STEP 12 ** FOR GODADDY HOSTING ONLY **

----------------------------

A number of people using GoDaddy for their hosting have found that the UPSXML module times out when getting rate quotes. This is due to the fact that GoDaddy uses a special setup for the https connections, namely a proxy server.

In that case (haven't tested this, but this is a compilation from the postings and uploads) change a part of the code in catalog/includes/modules/shipping/upsxml.php

Line 662-670

**REPLACE**

// uncomment the next line if you get curl error 60: error setting certificate verify locations
// curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
// uncommenting the next line is most likely not necessary in case of error 60
// curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlRequest);
curl_setopt($ch, CURLOPT_TIMEOUT, (int)$timeout);

**WITH**

// BOF GODADDY STUFF
// uncomment the next line if you get curl error 60: error setting certificate verify locations
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
// uncommenting the next line is most likely not necessary in case of error 60
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlRequest);
curl_setopt ($ch, CURLOPT_HTTPPROXYTUNNEL, TRUE);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
curl_setopt ($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
curl_setopt ($ch, CURLOPT_PROXY, "http://proxy.shr.secureserver.net:3128");

// EOF GODADDY STUFF

Technorati Tags: , ,

del.icio.us:Setting Up osCommerce UPS XML Module w/ GoDaddy Shared Hosting digg:Setting Up osCommerce UPS XML Module w/ GoDaddy Shared Hosting spurl:Setting Up osCommerce UPS XML Module w/ GoDaddy Shared Hosting wists:Setting Up osCommerce UPS XML Module w/ GoDaddy Shared Hosting simpy:Setting Up osCommerce UPS XML Module w/ GoDaddy Shared Hosting newsvine:Setting Up osCommerce UPS XML Module w/ GoDaddy Shared Hosting blinklist:Setting Up osCommerce UPS XML Module w/ GoDaddy Shared Hosting furl:Setting Up osCommerce UPS XML Module w/ GoDaddy Shared Hosting reddit:Setting Up osCommerce UPS XML Module w/ GoDaddy Shared Hosting fark:Setting Up osCommerce UPS XML Module w/ GoDaddy Shared Hosting blogmarks:Setting Up osCommerce UPS XML Module w/ GoDaddy Shared Hosting Y!:Setting Up osCommerce UPS XML Module w/ GoDaddy Shared Hosting smarking:Setting Up osCommerce UPS XML Module w/ GoDaddy Shared Hosting magnolia:Setting Up osCommerce UPS XML Module w/ GoDaddy Shared Hosting segnalo:Setting Up osCommerce UPS XML Module w/ GoDaddy Shared Hosting
Programming and Technology29 Mar 2007 11:38 am

I was recently coding a PHP application that connected to and interacted with a mySQL server. One of my sql scripts was producing a mySQL Error 1421 that I had not seen before. Here is the sql that I was running, the error, the resolution, and the reason.

The SQL:

INSERT INTO my_table(
 field1, field2, field3, field4, field5
)
SELECT (
 fieldA, fieldB, 1234, NOW(), fieldC
)
FROM my_table_two
WHERE my_table_two.PK =1

The error:

MySQL said: Error#1241 – Operand should contain 1 column(s)

The resolution: Remove the Parentheses () around the second embedded SELECT statement so the statement is as follows.

INSERT INTO my_table(
 field1, field2, field3, field4, field5
)
SELECT
 fieldA, fieldB, 1234, NOW(), fieldC
FROM my_table_two
WHERE my_table_two.PK =1

The reason the error occurs: When you ad parentheses () around the SELECT columns you create an ordered list of values or a tuple. The SELECT statement expects a list of individual values. Or in simpler terms you are giving it the array[1][2] when it expects the values 1 and 2. You can recreate this error by running this sql statement SELECT 1,2 which will return 1 2 amazingly. Then run SELECT (1,2) which will return ERROR #1241 – Operand should contain 1 column(s). For me it occurred because I copied and pasted code from an insert statement to not have to retype all the fields and grabbed a little too much in my copy.

The Cliff Notes Version If you get a mySQL ERROR 1241 then look for some unnecessary parentheses surrounding your SELECT statement and remove them!

Technorati Tags: , ,

del.icio.us:mySQL Error #1421 digg:mySQL Error #1421 spurl:mySQL Error #1421 wists:mySQL Error #1421 simpy:mySQL Error #1421 newsvine:mySQL Error #1421 blinklist:mySQL Error #1421 furl:mySQL Error #1421 reddit:mySQL Error #1421 fark:mySQL Error #1421 blogmarks:mySQL Error #1421 Y!:mySQL Error #1421 smarking:mySQL Error #1421 magnolia:mySQL Error #1421 segnalo:mySQL Error #1421
Programming05 Jan 2007 02:48 pm

The Problem: Lightbox Prev and Next Navigation being visible onMouseOver is not obvious enough
After enabling Lightbox on my picture gallery I quickly realized that the onMouseOver Prev and Next on the Lightbox were way to confusing for my viewers 🙂 The problem with the design it the Prev and Next links on the Lightbox pop-up are mystery navigation. If you don’t know to mouse over the right or left side of the image in order to get the links to appear, you don’t.

The Solution: Change lightbox.css to make the navigation graphics always visible
My solution was to change the stylesheet (lightbox.css) to fix the display of the prev and next links to always be visible. I am OK with the prevLabel.gif and nextLabel.gif always showing on top of the image because it makes the navigation so much more obvious.

I know this fix is pretty obvious to the coder types but since many people who use the LightBox Library on their website are not so savvy I hope to take the mystery out of this fix. Simply:
1) Download the new Lightbox CSS File.
2) Remove the .txt from the end of the filename.
3) Make sure the nextLabel.gif and prevLabel.gif and blank.gif are pointed to in the right directory (if they are not in the ./img/ directory you need to change anywhere it says img/ to your directory name, for example images/)
4) Upload the new lightbox.css file to replace the old one

del.icio.us:Lightbox with always visible Prev and Next Links digg:Lightbox with always visible Prev and Next Links spurl:Lightbox with always visible Prev and Next Links wists:Lightbox with always visible Prev and Next Links simpy:Lightbox with always visible Prev and Next Links newsvine:Lightbox with always visible Prev and Next Links blinklist:Lightbox with always visible Prev and Next Links furl:Lightbox with always visible Prev and Next Links reddit:Lightbox with always visible Prev and Next Links fark:Lightbox with always visible Prev and Next Links blogmarks:Lightbox with always visible Prev and Next Links Y!:Lightbox with always visible Prev and Next Links smarking:Lightbox with always visible Prev and Next Links magnolia:Lightbox with always visible Prev and Next Links segnalo:Lightbox with always visible Prev and Next Links
Programming20 Dec 2006 05:57 am

I recently redesigned my picture gallery as part of moving my website to a WordPress powered site. As part of that redesign, I wanted to move my full size picture view to one that uses LightBox JS 2.0. That worked out smashingly until I decided that I wanted the home movies in my gallery to also display in a LightBox frame. Turns out that LightBox is coded to display image files and does not work out of the Box (har har har) for displaying movies.

After a quick google search I stumbled upon the MPOV blog and a post on Lightbox with iframes. I downloaded his script and plugged it in instead of my current lightbox.js file. It worked great to display the movies but wouldn’t display the images because of a bug. To display my Flash movies in the new iFrame LightBox JS v2.0 I just edited the existing link to the Flash created simple HTML file to include the rel=”lightbox” property. The HTML file is simply a file with an embedded Flash movie (.flv) playing file (.swf).

My issue with the new hacked LightBox was that although it now allowed me to define a height for the iFrame and Lightbox, it didn’t support setting the width of the iFrame and the LightBox and it would no longer display the images. So, when my Flash movie would load in LightBox it, depending on its size, would have a scroll bar. You can set the width at the top of the lightbox.js as the iFrameWidth variable but my videos are a variety of sizes so I needed to be able to dynamically set the width for the LightBox/iFrame.

No biggie, though, with the addition of a few lines of code the new Lightbox with iFrames now supports setting the height and width of the iFrame and therefore LightBox and it also now displays images :). To pass in the width and height use: rel=”lightbox|WIDTH|HEIGHT”. For instance if you want to display a 640px X 480px movie you would use rel=”lightbox|660|500″ The script automatically adds the defined LightBox border (var = borderSize) x 2 to the width and height.

Download the new LightBox with iFrames Reloaded
Install by changing the extension to .js from .txt and replace your existing lightbox.js file with the new one.
Note: You will need the full LightBox v2.0 installed already which you can download from here.

For an example of using LightBox to open embedded Flash movies and standard JPG images check out our Picture Gallery. Click on one of the movies links from the first page to see an iFrame + LightBox being used to display the Flash Video or one of the thousand pictures for the standard LightBox image usage.

Thanks to Lokesh Dhakar for the LightBox script and Tim Morgan cool iFrame hack.

del.icio.us:Lightbox with iFrames Reloaded digg:Lightbox with iFrames Reloaded spurl:Lightbox with iFrames Reloaded wists:Lightbox with iFrames Reloaded simpy:Lightbox with iFrames Reloaded newsvine:Lightbox with iFrames Reloaded blinklist:Lightbox with iFrames Reloaded furl:Lightbox with iFrames Reloaded reddit:Lightbox with iFrames Reloaded fark:Lightbox with iFrames Reloaded blogmarks:Lightbox with iFrames Reloaded Y!:Lightbox with iFrames Reloaded smarking:Lightbox with iFrames Reloaded magnolia:Lightbox with iFrames Reloaded segnalo:Lightbox with iFrames Reloaded
Programming01 Dec 2006 06:59 pm

Ever noticed that the little icon next to the URL in your address bar? For some websites the icon is customized and for others it is either blank or a default icon. That icon is actually pulled from a file on your webserver called favicon.ico. The favicon.ico file tells the browser what 16×16 pixel icon to display when people browse to your website. The icon will also appear to the left of your favorite entry for any website with a favicon.ico.

So how do you get your own icon for your website? You need to create a file named favicon.ico and upload it to the main directory of your websierver. Sounds easy enough, right? Well almost, the only thing that makes this tricky is this very tiny image file is in a format most image editors can not save as a default. This little devious file is a Windows Icon Format file (.ico) which should spread dread into the hearts of MAC users everywhere. No fear, though, with a little plugin you can use good old Adobe Photoshop to create your very own favicon.ico file.

First, go to: this website and download the ICO format plugin for your version of Photoshop (MAC and PC are different). Next, follow the included instructions to drop the ICO plugin into your Photoshop plugins folder. Now the fun part, get your self a 16×16 pixel canvas and design your favicon.ico. A little hint is to use a canvas of 32×32 and then change the image size right before you save so you can actually see what you are doing! Now, choose save as and select Windows Icon Format (ico) from the format dropdown box. Last upload your file to the home directory of your webserver.

The first thing I know you are going to do is go to your website to see your nifty new website icon! Sadly, though, there is a good chance you will not see it 🙁 Browsers are iffy on when they check for the new versions of favicon.ico. Some check when you refresh, some you have to clear the cache, some you have to bookmark the page, others you have to jump on one foot while left clicking! Anyways, just give it some time and sometime your new image will pop up on your address bar.

del.icio.us:Create a favicon.ico with Photoshop digg:Create a favicon.ico with Photoshop spurl:Create a favicon.ico with Photoshop wists:Create a favicon.ico with Photoshop simpy:Create a favicon.ico with Photoshop newsvine:Create a favicon.ico with Photoshop blinklist:Create a favicon.ico with Photoshop furl:Create a favicon.ico with Photoshop reddit:Create a favicon.ico with Photoshop fark:Create a favicon.ico with Photoshop blogmarks:Create a favicon.ico with Photoshop Y!:Create a favicon.ico with Photoshop smarking:Create a favicon.ico with Photoshop magnolia:Create a favicon.ico with Photoshop segnalo:Create a favicon.ico with Photoshop
Programming05 Jan 2006 02:52 pm

Problem:

Macromedia Dreamweaver file_save.js error on line 45 when changing and saving a template.

When It occurs:

Sometimes when changing a template Dreamweaver MX will issue an error on file_save.js on line 45. This error will not change any pages in your site with the new template and will also freeze Dreamweaver MX. You have to close and then restart Dreamweaver to continue working. Once you get this file saving error on line 45 once Dreamweaver will issue this error every time you attempt to change the template.

Resolution:

1) Close Dreamweaver MX
2) Rename your site directory to [Old Site DirectoryName]_somethingNew
3) Open Dreamweaver MX
3a) You will get an error because the site no longer exists. Ignore this.
4) Delete Old Site from Dreamweaver’s site manager
5) Close Dreamweaver
6) Create a new directory named [Old Site DirectoryName]
7) Using Windows Explorer Copy and Paste all the files from [Old Site DirectoryName]_somethingNew into [Old Site DirectoryName]
8) Start Dreamweaver MX
9) Using the site manager create a new site to replace the one you deleted in step 4
10) Dreamweaver will now rebuild the cache and your problem should be fixed

Why:

It seems to be a bug that occurs in the cache file. I have had problems when adding large values to tag fields so this could cause a buffer overrun or similar problem perhaps. I have found this solution combining a couple I have found on-line into one procedure which has worked now three times when I have had this file_save.js on line 45 error while using Macromedia Dreamweaver MX.

del.icio.us:Macromedia Dreamweaver file_save.js error on line 45 digg:Macromedia Dreamweaver file_save.js error on line 45 spurl:Macromedia Dreamweaver file_save.js error on line 45 wists:Macromedia Dreamweaver file_save.js error on line 45 simpy:Macromedia Dreamweaver file_save.js error on line 45 newsvine:Macromedia Dreamweaver file_save.js error on line 45 blinklist:Macromedia Dreamweaver file_save.js error on line 45 furl:Macromedia Dreamweaver file_save.js error on line 45 reddit:Macromedia Dreamweaver file_save.js error on line 45 fark:Macromedia Dreamweaver file_save.js error on line 45 blogmarks:Macromedia Dreamweaver file_save.js error on line 45 Y!:Macromedia Dreamweaver file_save.js error on line 45 smarking:Macromedia Dreamweaver file_save.js error on line 45 magnolia:Macromedia Dreamweaver file_save.js error on line 45 segnalo:Macromedia Dreamweaver file_save.js error on line 45
Programming27 Aug 2005 10:41 am

Here is a fairly quick and painless way to remove duplicate rows from a mySQL database table.

To remove the duplicates in mySQL 3.23 and above we will move the non duplicates into a temporary table, then delete the old table, and rename the temporary table to the old table to finish the circle.

First Create the temporary table and populate it with the values from the old table.

NOTE: As of mySQL 3.23, you can create one table from another by adding a SELECT statement at the end of the CREATE TABLE statement :: CREATE TABLE new_tbl SELECT * FROM orig_tbl;

CREATE TABLE newtable
SELECT * FROM oldtable WHERE 1 GROUP BY [column to remove duplicates from];

Now we have a newtable with all of the duplicates removed. So next we drop the old table (the one with all the duplicates still remaining)

DROP TABLE oldtable;

Now we just rename the newtable to the name of the oldtable so we don’t break our whole code base!

RENAME TABLE newtable TO oldtable;

Thats it, duplicates removed. With newer versions of mySQL and with other database engines such as Oracle 9 you can remove duplicates in a single statement and step but this method will still work (using any changes in the SQL commands necessary for your engine).

del.icio.us:Remove duplicate rows / entries from a mySQL database table digg:Remove duplicate rows / entries from a mySQL database table spurl:Remove duplicate rows / entries from a mySQL database table wists:Remove duplicate rows / entries from a mySQL database table simpy:Remove duplicate rows / entries from a mySQL database table newsvine:Remove duplicate rows / entries from a mySQL database table blinklist:Remove duplicate rows / entries from a mySQL database table furl:Remove duplicate rows / entries from a mySQL database table reddit:Remove duplicate rows / entries from a mySQL database table fark:Remove duplicate rows / entries from a mySQL database table blogmarks:Remove duplicate rows / entries from a mySQL database table Y!:Remove duplicate rows / entries from a mySQL database table smarking:Remove duplicate rows / entries from a mySQL database table magnolia:Remove duplicate rows / entries from a mySQL database table segnalo:Remove duplicate rows / entries from a mySQL database table

Next Page »