2009

MySQL: Deleting Duplicate Rows or Records | Selecting Unique Rows into A New Table

One of the principles of data integrity is to reduce data redundancy as much as possible and wipe out any duplicate database table entries. Another reason for this is that you need to add unique indexing to one or a group of table columns and you need the one column or combination of columns to …

MySQL: Deleting Duplicate Rows or Records | Selecting Unique Rows into A New Table Read More »

Dynadot Affiliate Program Review – Not Worth the While

I joined Dynadot at the commencement of .tel domains and tried my luck to get some domainers to register a domain with them. Maybe it’s because they just don’t care about expanding via affiliates, the system might be a little buggy or not so affiliate friendly in that once the referred friend signed up an …

Dynadot Affiliate Program Review – Not Worth the While Read More »

Build Simple Amazon Affiliate Text Links with just ASIN (10 digit ISBN) and Your Amazon Associate Tracking ID

Amazon Affiliate system does a great job presenting you a variety of ways to make associate affiliate links so that you can take credit of their products that you have referred to others. Today I messed around a little bit with their generators and finally come to a simple solution to generate affiliate links dynamically …

Build Simple Amazon Affiliate Text Links with just ASIN (10 digit ISBN) and Your Amazon Associate Tracking ID Read More »

1 tip about ALTER TABLE xxx ADD INDEX yyy

Proper indexing can work wonders for large databases in query efficiency, it’s a compromise of disk storage in exchange for sorting speed. For databases with millions of records, indexing takes considerable amount of disk storage, and, AGONIZING lengths of time to create. I recently compiled a database with one table mytable consisting of over 4 …

1 tip about ALTER TABLE xxx ADD INDEX yyy Read More »

Largest U.S. Bankruptcies, 1980–Present

Just imagine, that much amounts of money just vaporized into thin air at a cause of nothing. Company Bankruptcy date Total assets pre-bankruptcy (in millions) Lehman Brothers Holdings, Inc. 9/15/2008 $691,063 Worldcom, Inc.1 7/21/2002 $103,914 Enron Corp.2 12/2/2001 $65,503 Conesco, Inc. 12/17/2002 $61,392 Pacific Gas and Electric Co. 4/06/2001 $36,152 Texaco, Inc. 4/12/1987 $34,940 Financial …

Largest U.S. Bankruptcies, 1980–Present Read More »

Google AdWords mistake (a bug?)

Naturally, you’d never expect an AdSense ad of a site to appear on itself. But this I just encountered, indicates an inherent *bug* of AdWords. Or is it? But I’ll never understand otherwise. What’s the point? Maybe there’s an option for the AdWords advertiser to opt out of his advertisement listing being published on his …

Google AdWords mistake (a bug?) Read More »

MySQL: INSERT INTO … SELECT … FROM … Selectively on Table Columns / Fields to Combine Multiple Tables into One

While you can always fulfill tasks such as creating a new table out of existing ones in MySQL by the help of PHP, it’d be much faster and way more efficient with native SQL queries. Consider when you need to combine a few tables into one, more precisely, you need just certain fields / columns …

MySQL: INSERT INTO … SELECT … FROM … Selectively on Table Columns / Fields to Combine Multiple Tables into One Read More »

DreamHost Review: Pros and Cons plus Uptime Charts

I’ve been DreamHost since 2006 and that’s more than 3 years of hosting experience with them on a shared plan ($9.95 / month). For those who’d prefer scanning instead of reading, I’ll sum up my points in short lists: Pros Affordable price with generous offerings in disk storage and monthly transfer. Full pack of features …

DreamHost Review: Pros and Cons plus Uptime Charts Read More »

MySQL: Insert if doesn’t exist otherwise update the existing row

A good practice of increasing SQL efficiency is to reduce the number of separate queries as much as possible. In a situation where you want a row updated if it exists and inserted if it doesn’t may take a newbie MySQL developer to write 2 independent queries, namely: first, check if the row exists with …

MySQL: Insert if doesn’t exist otherwise update the existing row Read More »

What is a programming framework?

Programmers write programs for users so certain processes in the workflow can be automated for efficiency and correctness. As such, to improve the programming efficiency of similar projects for addressing a common set of related problems, such as the need for content management system in web authoring, some programmers write programming frameworks to integrate the …

What is a programming framework? Read More »

VeriSign Data Analyzer — The Most Authoritative Type-in Traffic Analysis Tool for Unregistered Domains / Misspelled Domains

VeriSign, the central registry for COM domains, recently released a new tool called Data Analyzer. Data Analyzer allows you to check the amount of traffic a domain name gets, even if the domain does not exist. So just the kind of traffic analysis tool that examines the type-in traffic of unregistered domains (.COM). Well, not …

VeriSign Data Analyzer — The Most Authoritative Type-in Traffic Analysis Tool for Unregistered Domains / Misspelled Domains Read More »

Katrina Costedio Steals (KatrinaCostedio.com)

Katrina Costedio currently lives in Sarasota, Florida and has a small design firm (katrinacostedio.com) that attends to small business needs doing all kinds of design work: print design, card design, logo design and web design. She’s planning to go to San Francisco, California, though. I worked for her on 2 projects, namely maahs acupuncture clinic …

Katrina Costedio Steals (KatrinaCostedio.com) Read More »

MySQL: Add Statistics Column for the Number Count of Records from Another Table

It’s hard to describe this scenario precisely with limited title length. Basically, this is when you want to dedicate a field in ‘category‘ table to store the number of articles or posts in ‘post‘ table that fall into this category. Previously, you had both ‘category’ table to store post categories and ‘post’ table to store …

MySQL: Add Statistics Column for the Number Count of Records from Another Table Read More »

PHP: Convert between Numerical Bases | Binary Number, Decimal Number, Octal Number and Hexadecimal Number Conversions

Different number notations for different numerical bases: 0144 // base 8 100 // base 10 0x64 // base 16 To convert between number bases, use PHP base_convert() function: $hex = ‘a1’; // hexadecimal number (base 16) $decimal = base_convert($hex, 16, 10); // $hex converted from base 16 to base 10 and $decimal is now 161 …

PHP: Convert between Numerical Bases | Binary Number, Decimal Number, Octal Number and Hexadecimal Number Conversions Read More »

PHP: Convert Degrees to Radians and Convert Radians to Degrees

Degrees and radians are different metric means to gauge an angle. They are mutually convertible in PHP. Simply use the PHP degrees to radians function deg2rad() and PHP radians to degrees function rad2deg(). $degrees = 180; $radians = deg2rad($degrees); // 3.1416 $degrees = rad2deg($radians); // 180 Because trigonometric calculations are usually done in radians, you …

PHP: Convert Degrees to Radians and Convert Radians to Degrees Read More »

PHP: Number Format Function to Format Numbers in PHP (Integer or Float)

To display numbers to end users, especially large numbers, you may need to format them to be more user friendly. For example, with a large integer 43386000.75, it is usually preferred to comma-separate every 3 digits to this: 43,386,000.75 To format numbers this way in PHP, you need number_format() function: print number_format(43386000.75); // prints ‘43,386,000.75’ …

PHP: Number Format Function to Format Numbers in PHP (Integer or Float) Read More »

PHP: Send HTML Email (mail)

As we all know the simplest approach to create an email message and send it out is to use the php mail() function. A typical usage example would be: mail(‘[email protected]’, ‘Subject Title’, ‘Message body goes here.’); However, as the mail() function sends emails in text/plain mime type by default, if you include HTML code in …

PHP: Send HTML Email (mail) Read More »

PHP: Wrap Long Lines | Insert Line Breaks into a Long String

Some strings of texts may lack necessary wraps and don’t have natural line breaks in them so that the lines are too long to read comfortably. Therefore, you want a way to insert line breaks in to the string every dozens of characters. The php function you need is wordwrap(): $s = ‘ … ‘; …

PHP: Wrap Long Lines | Insert Line Breaks into a Long String Read More »

Scroll to Top