My Two Cents
Clouds Are Blocking The Sun 
Tuesday, October 13, 2009, 04:04 AM
Posted by Administrator
Cloud computing is the provision of dynamically scalable and often virtualised resources as a service over the Internet. Users need not have knowledge of, expertise in, or control over the technology infrastructure in the "cloud" that supports them (Source: Wikipedia).

Now that sounds as if it would be something new. But it isn't. Once in a while, something like that pops up. 20 years ago, we used terminals to connect to IBM or UNIX servers which ran the applications. Unix's X-Windows system is still able to display the output of remote running programs on local displays. Ten or so years ago, we were told that we should run the applications on our local computers but to keep files and applications on LAN servers.

On a first glance, it looks promising. Nothing on local drives, all programs and data reside on remote servers. But it didn't really catch on. Why? Because it took some time to launch the programs, to load and to save data over the LAN, the licensing issue was a mess and the single server introduced a single point of failure.

Now it's cloud computing with the Internet providing the cloud. The promises are the same: Access to a great variety of software, remote data storage means no need for local backups. The lazy man's dream.

But think about it: No access to your data without Internet. Accessing programs will cost money, long(er) load and save times. And you must rely on other people to protect your data. And that is what T-Mobile's 'Sidekick' customers did. Some of them just lost their personal data because the data storage provider '>Danger' (a Microsoft subsidiary), didn't do backups (see report from >Engadget).

What is the value of one's addresses, calendar entries or photos? T-Mobile believes it is about US$ 100 - though not cash, but as a voucher to other services. What would you say if somebody loses your important data and says: Hey, sorry. Too bad. Here's a 100 Dollar. You can use that to buy other services from me.. What kind of service and security can one expect, if the provider values your data at 100 Dollars in, well, vouchers?

Other companies had problems too (like Google's Email-Services, Amazon), though they didn't lose any data.

If something sounds too good to be true - you know the saying. It is a headache to backup and to protect data. However - a nice big hard drive or NAS device costs less than a 100 bucks and allows you to copy all of your important files.

I personally would not entrust anybody with the safety of my data. It's just too important to me. I won't let any 'cloud' block the view of the sun.

add comment ( 73 views )   |  permalink   |   ( 3.1 / 87 )
Having Fun With MySQL 
Saturday, October 3, 2009, 05:11 PM
Posted by Administrator
The other day, I was toying around with the "M" part in LAMP. I had a set of data and I needed to find a match. Usually one uses something like

select * from dataset where key like '%findme%'.

However, I was dealing with CSVs (comma separated values) and I needed to find a specific value within the CSV. My data looked like that:

Harry,Tom,Bill,George,Frank,John,Elmo,Susan,Mike,Ella

Let's call this data set "names". Now - MySQL has a clever function to deal with this kind of data:

FIND_IN_SET('Frank',names) would return 5, while i.e. FIND_IN_SET('Robert',names) would return 0. But, unfortunately, one can not use wildcards in FIND_IN_SET.

After a little looking, a found a hint on mySQLForge. A function named FIND_WILD_IN_SET. It should work just like the original FIND_IN_SET with wildcards enabled. However, after studying the MySQL source code I understood, that it would just return boolean true if a match would be found and false if not.

I modified the function so that it now really allows for wildcard searches with the right return value:

CREATE FUNCTION FIND_WILD_IN_SET(theString varchar(65535), theSet varchar(65535))
RETURNS int
DETERMINISTIC
BEGIN

DECLARE delimiterCount int;
DECLARE pos int DEFAULT 0;
DECLARE setElement varchar(65535);
DECLARE returnValue boolean DEFAULT FALSE;

SET delimiterCount := CHARACTER_LENGTH(theSet) - CHARACTER_LENGTH(REPLACE(theSet, ',', ''));

WHILE (pos <= delimiterCount) DO
BEGIN
SET setElement := SUBSTRING_INDEX(SUBSTRING_INDEX(theSet, ',', pos+1), ',', -1);
IF (setElement LIKE theString) THEN RETURN pos+1; END IF;
SET pos := pos + 1;

END;
END WHILE;

RETURN 0;


In other words:

FIND_IN_SET('Frank',names) returns 5 and FIND_WILD_IN_SET("%fran%",names) returns 5 as well. A big thanks to Scott Noyes at MySQL Forge for the original code snipplet.


add comment ( 67 views )   |  permalink   |   ( 3.1 / 80 )

<<First <Back | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Next> Last>>