Monday, June 29, 2009

MYSQL, Foreign Keys

Here is my example and some pointers that lead a solution to my problem.

'contact_id' in table 'note' referencing 'id' in table 'contact'

CREATE TABLE 'contact' (
'id' int(10) unsigned NOT NULL auto_increment COMMENT 'Unique Contact ID',
PRIMARY KEY ('id'),
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=0 ;

CREATE TABLE 'note' (
'id' int(10) unsigned NOT NULL auto_increment COMMENT 'Note ID',
'entity_table' varchar(64) collate utf8_unicode_ci NOT NULL COMMENT 'Name of table where item being referenced is stored.',
'entity_id' int(10) unsigned NOT NULL COMMENT 'Foreign key to the referenced item.',
'contact_id' int(10) unsigned default NULL COMMENT 'FK to Contact ID creator',
PRIMARY KEY ('id'),
KEY 'index_entity' ('entity_table','entity_id'),
KEY 'FK_note_contact_id' ('contact_id')
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=0;

ALTER TABLE 'note'
ADD CONSTRAINT 'FK_note_contact_id' FOREIGN KEY ('contact_id') REFERENCES 'contact' ('id') ON DELETE SET NULL;

Things to note

1. Tables must be same type. [in this case InnoDB]
2. The columns must be the same type.[in this case int(10)]
3. The Attributes must be the same unsigned
4. The field that is referencing must be default set to null "default NULL"
i.e. contact_id , must be default NULL. (If you specify a SET NULL action, make sure that you have not declared the columns in the child table as NOT NULL.)
5. Indexes on foreign keys and referenced keys
6. Watch your case. the FK is case sensitive

If you need to alter a table do the following

set foreign_key_checks = 0;
...
Alter table etc..
..
set foreign_key_checks = 1;

Useful reference:
See also:

Thursday, June 04, 2009

LIME 3G speeds

Testing a lime 3g Modem... 

Received the following speeds in the New Kingston Area

The  installation on a Mac 10.5  failed but worked flawlessly on Windows XP.

During the so far I have received burst speeds of up to 5.3 Mbps per second.  The problem is this if you have to pay for the data you could run in trouble

Without downloading any programmes, just regular browsing in no time over 6 MB was consumed.

Friday, May 22, 2009

IE Tester for IE Version Testing

For many web developers cross browser testing has been a pain. One of the greatest pains has been test the different versions of IE, 5.5, 6, 7 and now 8. Users of browsers like Firefox, Safari and Opera tend to upgrade regular and even in some cases the updates are automated.

The reality however is that IE still controls the majority share in the browser market thanks to Microsoft dominance of the Operating System found on personal computers around the world.

Here is a good tool for testing different versions of IE.
Here are some reviews

Go ahead and give it a try. Solving those CSS and JavaScript errors should be alot easier now.

Tuesday, April 07, 2009

Javascript Frame works

Today I got a e-mail asking about Javascript frame works.  I am no expert but from my little fooling around I like JQuery..

Here you can read what a few other persons have to say.

  • Specky Boy lists their top 10 (not in order) and the his audience seems to give JQeury the edige.
  • Sixrevisions they also list their top 10 (not in order) but the comments are again worth reading.

This is one promotion I really endorse
“jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. jQuery is designed to change the way that you write JavaScript”.
As usual it boils doing to what you are doing, your style and what best suits you project

Friday, March 20, 2009

Windows Batch File

I needed  the get the date for batch file on Windows in this format yyyy-mm-dd e.g. 2009-03-20 so I did a little research on the internet.

The result is I found this snippet at tech-recipes.com

FOR /F "TOKENS=1* DELIMS= " %%A IN ('DATE/T') DO SET CDATE=%%B
FOR /F "TOKENS=1,2 eol=/ DELIMS=/ " %%A IN ('DATE/T') DO SET mm=%%B
FOR /F "TOKENS=1,2 DELIMS=/ eol=/" %%A IN ('echo %CDATE%') DO SET dd=%%B
FOR /F "TOKENS=2,3 DELIMS=/ " %%A IN ('echo %CDATE%') DO SET yyyy=%%B

SET mydate=%yyyy%-%mm%-%dd%

There are some nuisances so for more discussion on the top visit  tech-recipes.



Thursday, June 12, 2008

Useful Marketing Sites

Useful Internet Marketing Information Sites

Signing up for their newsletters are worth it

Others
  • Biz Report
  • SiteProNews

YouTube: You Created the Content, Now Sell the Ads

Google, Looking to Monetize Video Site, Is Letting Content Producers Sell Advertising on Their Branded Channels
 
Google has struggled to find the best way to monetize YouTube. The latest idea: Let content creators sell ads.

Professional content producers -- those who come equipped with their own ad-sales teams -- are now able to sell advertising on their YouTube channels. That includes the click-to-expand overlays that run across the bottoms of YouTube videos and display units on the page that hosts the video player. The revenue is split between the content creator and YouTube, just as it would be if YouTube sold the ads.

Wednesday, June 11, 2008

Javascript event handling

http://mislav.caboo.se/js/handling-events-on-elements/
feed://feeds.feedburner.com/mislav/js
feed://www.advancescripts.com/rss/786.html
http://cssglobe.com/post/1539/css-dos-and-donts-part-1-css-selecting
http://cssglobe.com/post/1539/css-dos-and-donts-part-1-css-selecting
http://mislav.caboo.se/js/

Saturday, May 24, 2008

Mysql TIps

Multiple inserts
http://www.petefreitag.com/item/379.cfm

Insert Delayed
http://www.petefreitag.com/item/430.cfm

Optimisation tips
http://www.petefreitag.com/item/613.cfm

More tips
http://www.petefreitag.com/item/455.cfm - Cheat sheets
http://www.petefreitag.com/item/505.cfm - Apache Security

Thursday, May 22, 2008

Copyright Issues

Every now and then someone is going to steal your content. What are you going to do?

Here are some useful links into the problem 

http://lorelle.wordpress.com/2006/04/10/what-do-you-do-when-someone-steals-your-content/
http://lorelle.wordpress.com/2006/04/11/finding-stolen-content-and-copyright-infringements/
http://www.cs.cmu.edu/~dst/Terrorism/form-letter.html
http://diveintomark.org/archives/2003/05/01/my_first_ceaseanddesist_letter
http://www.webtechniques.com/archives/2001/05/legal/
http://www.webmastertechniques.com/Insight/cease.html

Thursday, March 20, 2008

No to Google Ad Manager?

A few days ago, Google launched an Ad Manager for free. This came a few days after the deal to acquire DoubleClick, the largest display Ad Network on the Web.

Here are my reasons for not liking this move.

1. Google already has Adwords, Adsense(we love), Analytics, Base and Gmail( you now have to have a Gmail account)
2. With all of the above, Google already knows enough about you.
3. With the Ad Manager with its reporting capacity Google will now know your CPM rates and how other ads perform on your site, does Google need to know your CPM rates.

Will this infomation drive down your revenue or up?

There was an interesting post on the Open X blog.
http://blog.openx.org/03/why-should-ad-serving-be-open/

n.b. This Blogging Platform is also owned by Google

Tuesday, February 26, 2008

Google Adsense Terms and Conditions updated

Google has updated its terms and conditions.

New Products and Services
1. Changes are coming to products and services Google officers. Here is an interesting line, "anticipating, for example, that future products may be priced, paid, or managed differently than current ones."

2. Publishers will have up the 3 months, i.e. by May 25, 2008 to agree to the new terms and conditions.

Privacy

3. Publishers will have to be transparent. Publishers will have to post and abide by a privacy policy. So if you do not have a privacy policy on your site, you need to post one.

You need to notify your users/visitors that data is being collected with the use of cookies and or web beacons to facilitate the ad serving process.

There are many other changes so it is time get reading.

Tuesday, January 22, 2008

Simple but Effective - US $10 million a year

Here is a guy that has proved that simple is often very effective. His simply designed site, graphically that is, earns close to US $10 million, mostly if not all from Google Adsense

"Mr. Frind built the Plenty of Fish Web site in 2003 as nothing more than an exercise to help teach himself a new programming language, ASP.NET. The site first became popular among English-speaking Canadians. Popularity among online daters in many United States cities followed more recently, and with minimal spending on advertising the site. According to data from comScore Media Metrix for November 2007, Plenty of Fish had 1.4 million unique visitors in the United States. In December, Mr. Frind said, the site served up 1.2 billion page views, and page views have soared 20 percent since Dec. 26." - From the NY Times article.

Sunday, January 13, 2008

Monetise RSS Feeds

Useful Blogs

http://www.doshdosh.com/monetize-rss-feed-advertising/
http://www.scottgatz.com/blog/2005/11/17/monetizing-your-rss-feed/
http://www.demc.com/marketing/article_167.shtml

Networks

http://www.feedburner.com/
http://www.text-link-ads.com/
http://www.pheedo.com/
http://publisher.yahoo.com/
http://kanoodle.com/
http://www.mediafed.com/rss_reader.html
http://www.adgenta.com/
http://www.thankyoupages.com/publishers/rss.mpl
http://www.bidvertiser.com

www.emarketer.com
http://www.masternewmedia.org/podcast_directory/
http://www.masternewmedia.org/rss

Sunday, November 18, 2007

Google is dealing with Accidental Clicks

Google is moving to reduce accidental clicks.

This post post explains it well http://blogoscoped.com/archive/2007-11-13-n42.html but you can read it at Google Adsense Blog. This could mean decrease in revenue for some. Despite that I think it is a fair change as it gives the advertisers better value for their money. I am not sure why it was not like this from before.

Happy advertisers are likely to keep on advertising. This quote from the the article sums it up. It says, "By reducing accidental clicks, we hope to increase advertiser campaign value and satisfaction, encouraging additional spend and facilitating higher monetization for all publishers."

Wednesday, August 01, 2007

I insert data in to multiple tables in MySql

I saw this question on Techjamaica forum and noted it. Interesting question and interesting answer.

Basically here is the question. Can I insert data in to multiple tables in MySQL using one insert SQL statement?

Seems like the answer is no

Can I you insert data multiple times into the same table with one statement too.
INSERT INTO employees VALUES
(DEFAULT,'Hicks','Freddy','crew'),
(DEFAULT,'Harris','Joel','crew'),
(DEFAULT,'Davis','Julie','manager');

Examples taken from:
http://www.tizag.com/sqlTutorial/sqlinsert.php
http://www.desilva.biz/mysql/insert.html

Friday, June 29, 2007

color schemes

Color
------------
http://www.colorsontheweb.com/colorschemes.asp?search=&category=Corporate
http://www.colorschemer.com/
http://www.articleinsider.com/article/229290
http://www.colorschemer.com/galleria_info.php
http://colorschemer.com/schemes/?start=331
http://www.webwhirlers.com/colors/colorschemes.asp
http://dianev.com/web-design-help/web_design_basics/color.html
http://dianev.com/web-design-help/web_design_basics/website_color_schemes.html
http://www.smashingmagazine.com/category/color/

examples
----------------
http://www.aviva.com/
http://www.norwichunion.com/

Thursday, May 31, 2007

http://mobile.ups.com
pda.sky.com
bbc.co.uk/mobile
mobile.wunderground.com
pdaportal.com
pdahomepage.com
http://www.purelymobile.co.uk/


  • Google (http://www.google.com/m/products)
  • Yahoo Messenger (http://mm.yahoo.com)
  • News.com (http://m.news.com)
  • CNET Mobile (http://m.cnet.com)
  • Weather.com (http://palm.xhtml.weather.com/xhtml/)
  • Digg (http://mobits.com/digg/)
  • Reuters (http://mobile.reuters.com/)
  • New York Times (http://mobile.nytimes.com/)
  • Business Week (http://pda.businessweek.com/index.html)
  • Dictionary.com (http://dictionary.com/wml/)
  • StreetIQ podcasts (http://m.streetiq.com/)
  • Amazon.com (http://www.amazon.com/gp/aw/h.html)
  • Flickr (http://m.flickr.com/)
  • GameGeeks (http://www.geek.com/gaming/portable/)
http://blogs.techrepublic.com.com/hiner/?p=487?tag=1-1-11-0-0

http://www.mobidish.com/
Adshandy.com
http://www.enpocket.com/


http://realplayer.com/blog/?pageid=broadBandHomePage&pageregion=footer&src=realhome_bb_0_3_1_0_0_1_0&pcode=rn&opage=realhome_bb
http://archives.neohapsis.com/archives/fulldisclosure/2008-03/0157.html
http://www.download.com/8301-2007_4-9890945-12.html

Robots.txt and Search Engines

It is not sexy but it useful. The robots.txt is suppose to tell robots/bots/crawlers where they can crawl on a web site. The robots.txt mus...