quarta-feira, 30 de setembro de 2009

Setting Different Character Sets in MYSQL/PHP

I encountered a problem this week while updating the http://www.dancaiberica.org website for Dance Algarve 2010.

The site runs off a PHP/Myssql Database setup hosted on Godaddy shared hosting and servers pages in 4 different languages. This year I introduced a javascript dropdown menu that required the strict code in the header.

All was fine until the page were served up. Despite the fact the collation in the database is set to Latin_bin_1 and the following line is included in the header

meta http-equiv="Content-Type" content="text/html; charset=utf-8",

certain browsers were not rendering the Portuguese Characters correctly unless you manually changed the encoding in the browser each time one viewed the page. Needless to say the main culprit behind all this was Microsoft whose IE6/7/8 caused the original problem.

Anyway, after a bit of searching I found the following thread that resolved the issue:

http://forums.mysql.com/read.php?103,46870,247882#msg-247882


Simple:

Add

"mysql_query("SET NAMES 'utf8'");"

to your php database connection string/file.

Problem solved!

quinta-feira, 17 de setembro de 2009

Wifi

[quote="micas"]Please... experts out there, can someone explain to me how it works?
In simple language one can actually understand.
[/quote]

Wifi is essentially a system for transmission of data signals between computers and/or computer like devices over a limited range. The technology can therefore be used in homes, businesses and in compact public places to allow computers to connect to each other or to internet access facilities (usually know as routers) in the absence of cables.

Most laptop computers today and mobile phones such as the Apple Iphone
have built in wifi antennas.

One can also encounter WIFI signs in places such as motorway service areas. This usually means that if one has the correct access account one can use the short distance wifi facility to connect to the Service Area router and via that access the internet.

quarta-feira, 9 de setembro de 2009

3g Wifi Dongles with router

As regards using dongles with laptops, it is technically possible to connect one to certain models of routers with built in usb ports and then share the signal.

I have done this twice for clients here near Lagos. However, bandwith and speed are less than a Sapo connection. In both my cases, these were rural hostelries. At one stage, one had five pc's working on the system although the webpage load times were relatively slow when all five were being used.

The other unit has two computers operating (the owner's XP machine and a linux/ubuntu guest machine) and these work fine, although there can be periodic signal drops.

The problem is that most commercially available routers that work with dongles are quite expensive. I managed, however, to find a freeware firmware download from a guy in the Czech Republic which allowed me to flash the bios of a relatively cheap Asus router (€ 75.00) and connect the Vodafone Dongle.

www.zapp.pt offer a wireless internet solution here in Portugal also using old radio-telephone frequencies. They also offer a router option. See http://www.zapp.pt/equipamento/routerasus.php.

As mentioned above, and I cannot emphasize this enough, do not buy any gear until you are absolutely sure that you can receive not only a good mobile signal but a good 3G mobile signal. A normal GPRS mobile signal will only transmit data at 64 kpbs/sec. (Not much more than old dial-up) You must make sure that you can receive a good 3G signal to get speeds approaching broadband velocity.

quinta-feira, 3 de setembro de 2009

Scrabble Maniacs and Linux

Screenshot of wordbiz 1.8 running on ubuntu 9.04 on an Acer 4310 Laptop.

For use with Internet Scrabble Club - http://www.isc.ro/

(Click to enlarge:)

Why Linux?

[Question]Er.. forgive a question that may sound stupid B_expert, but does Linux run all Windows compatible programs?

Does it look like windows - i.e. similar to navigate?

Are there problems reading files on a Windows computer if they were originally created on a Linux one?

Sorry - that's 3 questions. It's just that I keep hearing good things about Linux but have reservations about taking a leap into the void :? :?[/Question]

I am writing this to you on a basic laptop purchased in Worten Portimão 2 years ago and running Ubuntu 9.04 . After years of getting fed up with Windoze, viruses, upgrades etc, etc, I switched 100% to using Ubuntu Linux in 2004. I looked at Apple, but the equipment is expensive and if anything goes wrong with the hardware or software, 90% of the time, it can mean, off to Loulé to the only authorised Apple Agent in the Algarve.

One does need a little bit of "nouse"/"common sense" to begin with but I have 95% compatibility with a Windows installation on my machine. With Openoffice 3.0, one can open, edit and save documents in Word, Excel and Powerpoint formats. To be honest, there may be the odd problems with formatting compatible headers and footers. I do all my webdesign on this machine. I play music on it, I watch videos (e.g. Shaun the Sheep) and youtube on it. I Skype on it!

One thing about Linux, which is great is that most of the programmes are freely available under the GNU Open Source License. For example, the Gimp which is the Linux world's version of Photoshop is free and in my opinion has more options and functionality than Photoshop.

With a Linux installation, you can usually print anything automatically to PDF format.

With Windows, you buy the operating system (e.g. Vista or XP) and then pay (a lot) for or pirate most of the extra stuff you need. With Linux, you can usually find what you need for free from one of the online repositories.

Linus Torvalds (the original developer of the Linux kernel (the core of linux)) and the millions of Linux volunteers world-wide who have voluntarily been nerding away for the past 18 years, have created a vast volume of software way in excess of what is available in the Windows world...and it is free.

This means that in the Linux world, piracy practically does not exist.

There are certain areas where Linux is not yet up with Windows:

1) No one has yet developed an alternative of Adobe/Macromedia Flash for making Flash animations for websites.
2) Microsoft Publisher - If you use this program you will not find a compatible programme at present in the Linux world.
3) Some programmes such as for making labels, (Such as those you buy in Staples), will not work on Linux BUT there is an virtual layer adapter software available in Windows called WINE, which can facilitate running windows programmes on Linux. However, I don't use it.
3) Depending on your computer, you may encounter the odd driver problem but that can usually be overcome with the help of the vast Linux nerd community world-wide.

There also may be issues if you use special accounts software for business.

Linux does not suffer from viruses or malware like Windows machines. No operating system is 100% safe, but a Linux desktop machine is 98% safer than a Windows machine as executable files cannot usually be installed without the users explicit permission.

In terms of navigation, Linux desktops have a familiarity about them and can be made to look like a windows desktop. One has a choice of at least two main interface types KDE and GNOME. These basically set up the Desktop Screen. KDE is very popular for those wanting flashy desktops....I like GNOME, its more workman like..like Windows 2000 used to be.

I use a Vodafone 3G dongle, as well as wifi, with my Linux laptop - No problem at all.

I have installed Ubuntu Linux on at least six public machines in the Lagos area in recent years. When previously, every time some smart alec backpacker messed with a windows machine, and downloaded a virus, it was a call out and sometimes a reinstall. With Linux, the machines run for months. The main problem is usually the hardware not the machine. You can also lock Linux machines down so that people can only use, for example, the browser.

On the Ubuntu Linux distribution, updates are available and delivered regularly over the web. Each edition is updated every 6 months.

Finally, I admit, I am an evangelist for Linux. However, I have felt for a long time, that the prices charged by Microsoft, over the years for its programmes, have actually created the software piracy issue. If you could pick up a legal copy of Windows XP and other programmes for Euro 20, piracy would be down by 80%. Viruses would not go away, however, because the Windows environment with its self executable .exe files is basically open to virus abuse.

In summary, if you have the time and willingness to switch, linux gets you away from the world of viruses and piracy and above all is free.

With Linux you have the tools, you have the support and you can get on with the job in hand.