Friday, November 18, 2011

(Before) Christmas Letter to friends

Just received this email from a mailing list that I am subscribed to.

 It is meant to spare all of us that are working in the IT industry, from the hours of free technical support we have to offer to our less technical friends and relatives when they want to buy a laptop/desktop - and hey, during the holiday period, there are LOTS of them:

All,

This is FREE advice from a geek to some friends and acquaintances!

Many are asking about what to look for in a laptop or desktop for Christmas shopping. Here is what I recommend:

Here are some things to look for in a:

Laptop and/or Desktop:
64 bit operating system.
4 GB RAM memory or more
Dual-core or better (triple-core, quad-core) processor
250 GB or bigger hard drive.
writes cd and dvd

USB 3 is coming out if it has usb 3 that is a big plus.

Laptop:
Brands: Lenovo and Toshiba - best bang for the buck.
Stay away from emachines, compaqs, and CyberPower.
When buying your laptop make sure you do not skimp on the memory or CPU. You do not have to get the best CPU but get a reasonably fast multicore CPU and as much memory as possible!
Wireless N
widescreen
Screen size: 14", 15", 16", or 17" screen depending on need. 15 to 16 inch is average, most common and cheapest.

  • 14 inch for portable laptops that you will carry around a lot (like at school); Will they be carrying it around all day at school? Then smaller (14") is better.
  • 17 inch is easier on the  eyes but heavier, only recommended for gamers or desktop replacement that will not be carried around a lot. If it just sits at home then larger may be the way to go.
  • Widescreen (standard now)

A 14" or 17" laptop are usually a little more expensive but worth it if you want it lighter (14") for carrying around or larger (17") for playing  games, CAD etc.
Operating System: 64 bit windows 7 home premium
CPU: dual core or better (triple-core/quad-core), 2ghz or faster (i3 is good, i5 better, etc.)
Memory: bare minimum 3 gb, preferably 4 gb or more
Hard Drive: SATA, minimum 250 gb, the bigger the better
Batteries: minimum 6 cell (no 4 cell, they die quickly), 8 cell is awesome

The following will increase the price a little but may be worth it. Necessities for some people and just nice to have for others:

  • Optional but recommended: HDMI port (to hook up to LCD monitor or HD TV); (do not settle for vga output unless the deal is really good)
  • Optional: webcam: built-in (with built-in microphone) - nice to have if you want to video chat

other specs to consider - these are

  • touchpad: there are several kinds of touchpads or other technologies for moving the pointer arrow, make sure you are comfortable with the one you buy
  • graphics/video memory: with 4 gb or 6gb of memory make sure it will reserve at least 256 mb (or more) for video
  • optical drive: dual layer dvd with direct disc labeling (pretty standard now)
  • wireless: built-in 802.11n (or latest technology if a new one comes out)
  • keypad: numbers pad on the right
  • Also get a 22" or larger widescreen monitor ($100 to $150) they can use at their desk at home. It will save their eyes, be useful for certain things, and takes seconds to plug in or unplug.


Lenovo Laptops are very good. Lenovo are considered tough computers (there are specially designed tough laptops but they are really expensive) that hold up well under a lot of traveling or movement and are recommended for college students for that reason.
In general I (and the other techies I work with) agree. Lenovo and Toshiba is what I usually recommend as the best bang for the buck - quality computer at a low price.
Asus and Acer are also pretty good.
I used to not like Gateway because they were proprietary but Acer bought them and their quality has improved and prices gone down.
HP make OK laptops and if you get a good deal then not a bad buy.
I also am not real high on Dells.
Sony is expensive and I am not sure on the quality.

You can get a laptop that meets these specs on sale for $300 - $400 or even less around Christmas!

To do this right and buy a laptop as a desktop replacement, here is what I recommend (you do not have to get all this at once but the cheapest prices are around Christmas season):


  • get a nice laptop on sale for about $300 - $400
  • Get a 22" widescreen flat panel monitor on sale for $100 - $130
  • Get a USB optical mouse and a USB keyboard on sale for $30
  • Get an external hard drive on sale for $50 - $100 for automatic backup
  • Get a powered USB hub for $20


You now have a laptop AND a desktop replacement - a work-station at home and laptop for school, vacation, etc. - all-in-one.

When sitting at your desk use the monitor, mouse, and keyboard. This will be easy on the eyes and easier to use.
Then when you want just unplug the USB hub and the monitor and you have a portable laptop to use on the couch or take elsewhere.
Plug-in the monitor at desk, unplug and go.

Other thoughts:

I buy a PC or laptop with windows on it and then I use FREE software for everything else including:

FREE Office Suite: Libre Office - presentations, spreadsheets, documents, and more - it is free and MS office compatible.

Also FREE antivirus, firewall, antispyware, email clients, browsers, media players, music software, graphics viewing and editing, etc...,

I am a big believer in FREE applications. I believe you should buy a PC/laptop with windows on it and everything else you can get for FREE - legally.
This includes anti-virus and other tools, office software, music, video, and picture software, and anything else you can think of!

There are several very good FREE anti-virus programs.
For the last year I have been using one by Microsoft. Microsoft now offers their own Anti-virus program and it is good and it is FREE. It is called Security Essentials.
Don't want Microsoft. Other good Free Anti-virus programs are AVG, Avast, Avira, and Comodo. There are others also but these are good for starters.
Remember NEVER, NEVER install and/or run 2 anti-virus programs at the same time. Choose only one.

Some of these also have a version you buy (and/or download a free trial). Be sure you choose the truly FREE version.




Other good FREE tools:

Office Suite (compares to Microsoft Office and is Microsoft Office compatible):



Email Clients:



Internet Browsers:



Teamviewer is a remote control application (you have to start the application and then give the person a user id and password, so it is secure). If you need help then call a geek and he can take control of your PC and it is just like sitting in front of your computer.



HouseCall is an online virus scan that can quickly identify and fix, remove, or quarantine a wide range of threats including viruses, worms, Trojans, and spy-ware.
You can use it to scan your PC in addition to your installed anti-virus. Especially if you suspect your PC may be infected.



Antispyware can help clean up spy-ware. Spy-ware is different from viruses but can also be dangerous. You can run as many as you want but loading a bunch of them can take up memory and slow down your PC. So only choose 1 or 2 at the most.
Use the others if you have problems especially with pop-ups!

FREE Antispyware:



SpywareBlaster is different it doesn't run all the time and take up memory.  It just runs when you tell it to run. It protects certain computer settings and browser settings so that bad software cannot change them later. So use it.



Soluto http://www.soluto.com/ is a very cool piece of software too. They call it Anti-Frustration software. It monitors all the stuff that boots with your PC.
It then shows you all this in a nice easy to understand window. Then it lets you choose to stop some of the stuff that starts with your PC.
This can speed up your boot time but more importantly it stops all of that stuff from running in the background all the time and taking up memory and slowing down your PC.

Other FREE software:

Ashampoo makes several good products and affers some of their older but still very good versions FREE.
This includes Burning Studio 6 for burning DVDs and CDs and Photo Commander 5.





Photo software:



Media Players:



Sound Editor and recorder (I use this to record live audio to mp3 format):



  • mp3DirectCut: You can directly cut, copy, paste or change the volume with no need to decompress your files for audio editing.
  • mp3DirectCut: http://mpesch3.de1.cc/mp3dc.html


Be careful of the emails you open and the websites you visit.

Your friend,

Thank you Darrel Woodard for sharing this with us.

Sunday, October 16, 2011

The best programming language in regard of library availability, ease to find/install a new library and community support

I found a question on stackoverflow about
What is a comparison of famous programming languages in regard of those aspects?
And I thought answering the more specific "Which is the best programming language in regard of library availability, ease to find/install a new library and community support?".

The answer is quire obvious:

Perl is hegemonic


  • it has a single point of access to ALL its libraries - CPAN
  • its description is more than compelling saying that The Comprehensive Perl Archive Network (CPAN) currently has 100,462 Perl modules in 23,551 distributions, written by 9,266 authors, mirrored on 269 servers. The archive has been online since October 1995 and is constantly growing.
  • finding modules requires just a search on http://search.cpan.org/
cpan Module::Name

 at the command line being sufficient
  • the community is simply awesome, the fastest and most efficient way to get help is to go on irc on the perl irc channels and ask there.
  • I have also seen some of the world perl gurus activating on stackoverflow
  • beside all of these, perl has cpan testers which provides multi-platform testing for modules. Today there are over 15 million tester reports and more than 100 testers each month giving valuable feedback for users and authors alike.

Regarding other programming languages, I think that Ruby is the one closest to copying the CPAN model

Friday, October 14, 2011

MySQL `FORCE INDEX` best practices?

Hi,

Almost everywhere I read the use of FORCE INDEX is highly discouraged and I perfectly understand and know why - there are immensely huge chances that MySQL knows better what indexes to choose than the (average) developer.

However, recently I have found a case where FORCE INDEX improved my execution times in the range of hundred of times:


  •  JOIN on 4 tables
  •  first table has about 500 000 records
  •  2 of the INNER JOINed table have more than 1 milion records
  •  first table has a field called published_date, stored as varchar in YMD format (could not changed to datetime)
  •  needed a range on published_date of at most 5 000 records
  •  some other GROUP BY and ORDER BY clauses on the first table on different fields than published_date were needed for this query


Although I've rewritten the query in many ways, I was not able to get execution times smaller than 130 seconds (with highest being over 700 ). After using FORCE INDEX with published_date, the execution time dropped below 5 seconds.

It took me a few days to remember about the infamous FORCE INDEX option.

Based on suggestions I received on StackOverflow, I have issued ANALIZE TABLE and OPTIMIZE TABLE on the annoing table that does not want to use the index - unfortunately, it stiil doesn't use that index, so for now FORCE INDEX remains the only viable option. Below is the output for EXPLAIN after each step I took in my tryings to optimize the table:

 without FORCE INDEX on table with alias a  
 id     select_type     table     type     possible_keys     key     key_len     ref     rows     Extra  
 1     SIMPLE     am2     range     PRIMARY,idx_meta_article     idx_meta_article     4     NULL     275228     Using where; Using index; Using temporary; Using f...  
 1     SIMPLE     a     eq_ref     PRIMARY,serial_issue_date_productid,pub_date,idx_d...     PRIMARY     4     mydb_toto.am2.ArticleID     1     Using where  
 1     SIMPLE     ai     ref     PRIMARY,idx_iso_article     PRIMARY     4     mydb_toto.a.serial     11523     Using where; Using index  
 1     SIMPLE     m     range     PRIMARY,meta_articles_type     meta_articles_type     4     NULL     96     Using where  
 1     SIMPLE     am     eq_ref     PRIMARY,idx_meta_article     PRIMARY     8     mydb_toto.a.serial,mydb_toto.m.meta_id     1     Using where; Using index  
 with FORCE INDEX on table with alias a  
 id     select_type     table     type     possible_keys     key     key_len     ref     rows     Extra  
 1     SIMPLE     a     range     pub_date     pub_date     11     NULL     17679     Using where; Using temporary; Using filesort  
 1     SIMPLE     am2     ref     PRIMARY,idx_meta_article     PRIMARY     4     mydb_toto.a.serial     21930     Using where; Using index  
 1     SIMPLE     ai     ref     PRIMARY,idx_iso_article     PRIMARY     4     mydb_toto.a.serial     11523     Using where; Using index  
 1     SIMPLE     m     range     PRIMARY,meta_articles_type     meta_articles_type     4     NULL     96     Using where  
 1     SIMPLE     am     eq_ref     PRIMARY,idx_meta_article     PRIMARY     8     mydb_toto.am2.ArticleID,mydb_toto.m.meta_id     1     Using where; Using index  
 after ANALYZE TABLE, without FORCE INDEX:  
 id     select_type     table     type     possible_keys     key     key_len     ref     rows     Extra  
 1     SIMPLE     am2     range     PRIMARY,idx_meta_article     idx_meta_article     4     NULL     275228     Using where; Using index; Using temporary; Using f...  
 1     SIMPLE     a     eq_ref     PRIMARY,serial_issue_date_productid,pub_date,idx_d...     PRIMARY     4     mydb_toto.am2.ArticleID     1     Using where  
 1     SIMPLE     ai     ref     PRIMARY,idx_iso_article     PRIMARY     4     mydb_toto.a.serial     11523     Using where; Using index  
 1     SIMPLE     m     range     PRIMARY,meta_articles_type     meta_articles_type     4     NULL     96     Using where  
 1     SIMPLE     am     eq_ref     PRIMARY,idx_meta_article     PRIMARY     8     mydb_toto.a.serial,mydb_toto.m.meta_id     1     Using where; Using index  
 after OPTIMIZE TABLE, without FORCE INDEX:  
 id     select_type     table     type     possible_keys     key     key_len     ref     rows     Extra  
 1     SIMPLE     am2     range     PRIMARY,idx_meta_article     idx_meta_article     4     NULL     275228     Using where; Using index; Using temporary; Using f...  
 1     SIMPLE     a     eq_ref     PRIMARY,serial_issue_date_productid,pub_date,idx_d...     PRIMARY     4     mydb_toto.am2.ArticleID     1     Using where  
 1     SIMPLE     ai     ref     PRIMARY,idx_iso_article     PRIMARY     4     mydb_toto.a.serial     11523     Using where; Using index  
 1     SIMPLE     m     range     PRIMARY,meta_articles_type     meta_articles_type     4     NULL     96     Using where  
 1     SIMPLE     am     eq_ref     PRIMARY,idx_meta_article     PRIMARY     8     mydb_toto.a.serial,mydb_toto.m.meta_id     1     Using where; Using index  
 after OPTIMIZE TABLE and ANALYZE TABLE, with FORCE INDEX  
 id     select_type     table     type     possible_keys     key     key_len     ref     rows     Extra  
 1     SIMPLE     a     range     pub_date     pub_date     11     NULL     17679     Using where; Using temporary; Using filesort  
 1     SIMPLE     am2     ref     PRIMARY,idx_meta_article     PRIMARY     4     mydb_toto.a.serial     21930     Using where; Using index  
 1     SIMPLE     ai     ref     PRIMARY,idx_iso_article     PRIMARY     4     mydb_toto.a.serial     11523     Using where; Using index  
 1     SIMPLE     m     range     PRIMARY,meta_articles_type     meta_articles_type     4     NULL     96     Using where  
 1     SIMPLE     am     eq_ref     PRIMARY,idx_meta_article     PRIMARY     8     mydb_toto.am2.ArticleID,mydb_toto.m.meta_id     1     Using where; Using index  

Questions:


  •  What are other use cases you found where FORCE INDEX saved you?
  • Do you have some best practices when you consider using FORCE INDEX?