Saturday, September 25, 2010

Choosing the right Intel & AMD processors and CPUs

INTEL:

It’s sometimes harder to choose the right part at the budget end than it is at the high-end.

The cheapest Intel processor (the Intel Celeron 430) sells for a shade over $40, but this is a 1.8GHz single-core part. Ideal if you don’t have anything particularly challenging to throw at it, but the single-core is a pretty big weakness, especially to power a modern operating system like Windows 7.

If you throw a little more money at the CPU, say another $10 you can grab an Intel Celeron E33002.5GHz dual-core part. At around $52 this part offers not only an extra core but a lot more power.

Throw another $10 at the CPU and for around $62 you can get the Intel Celeron E3500 which is also dual-core but bumps the speed up to 2.7GHz.

Since we’re spending the minimum possible on silicon here, we need to keep the motherboard modest too. That said, it still needs to be a decent board in terms of stability.

These CPUs all need a Socket LGA 775 motherboard.

The board I’m going with here is the BIOSTAR G31D-M7 featuring the G31 chipset. It’s a very basic board but does offer limited on-board graphics in the form of an Intel GMA 3100 GPU - nothing special but if you’re not planning on gaming or HD video, it’s fine. Price is a very reasonable $39.

Budget Intel CPU summary

  • Intel Celeron 430 - Single core - 1.8GHz - 32KB + 32KB L1 cache - 512KB L2 cache - $40

  • Intel Celeron E3300 - Dual core - 2.5GHz - 1MB L2 cache - $52

  • Intel Celeron E3500 - Dual core - 2.7GHz - 1MB L2 cache - $62

Main Stream:

OK, going mainstream gives us some more money to play with. A lot more considering Intel’s top-end CPUs go for $1,000! Fortunately though, you don’t have to spend as much as you think you might.

Looking through Intel’s current line-up of CPUs and one stands out head and shoulders above the rest in the mainstream category - and it’s only a shade over $200.

The CPU I have in mind is the quad-core, 2.8GHz Intel Core i5 760. This is a fantastic CPU retailing for $210. The four cores give you flexibility to carry out complex multitasking operations and do heavy lifting associated with multimedia rendering.

However, if you think that two cores is enough and you’d rather have more horsepower, then for pretty much the same price you can pick up a dual-core 3.33GHz Intel Core i5 661.

Both the CPUs I’ve listed need the newer Socket LGA 1156 motherboard.

The board I’m going for to match these CPUs is the Elitegroup ECS H55H-I. For $80 you get a good solid board.

Mainstream Intel CPU summary

  • Core i5 760 Quad core - 2.8GHz - 8MB L3 cache - $210

  • Core i5 661 - Dual core - 3.33GHz - 4MB L3 cache - $210

High-end

High-end is where things become fun - well, as long as you think spending money is fun.

At the high-end is the king of desktop CPUs - the Intel Core i7 980X Extreme Edition. This is a monster six-core, 3.33GHz part that represents the absolute best of the best - it should, for $999! When it comes to CPUs, this one is the best of the best of the best … with honors!

The i7 980X needs a Socket LGA 1366 motherboard, and one of the best boards featuring this socket is the EVGA E758-A1. This is a super board featuring 2-way and 3-way SLI and Crossfire support, meaning you can choose to go with NVIDIA or AMD for your GPU.

High-end Intel CPU summary

  • Core i7 980X Extreme Edition - Hexa core - 3.33GHz - 6 x 256KB L2 cache - 12MB L3 cache - $999

AMD:

Just like I did for Intel CPUs, I’m going to give you a selection of AMD CPUs in the $50 - $60 price range to choose from.

At the low end of the price spectrum is the AMD Athlon II X2 240, a dual-core 2.8GHz part that retails for around $50. For a shade under $60 you can get the Athlon II X2 245, same as before except this one runs at 2.9GHz. Finally, for a shade over $60 you can get the Athlon II X2 250 which boosts the clock speed even further to 3.0GHz.

If you want to spend another $10 and take your budget to $70 then you can pick up the Athlon II X3 425, a triple-core processor that runs at 2.7GHz. If you are going to be handling multimedia on the PC, then this might be the better choicer of the set.

All the processors use Socket AM3 motherboards. A great board to complement any of these parts is theBIOSTAR MCP6P, which features on-board NVIDIA 6150 GPU for graphics. All in all a great deal for $40.

Budget AMD CPU summary

  • Athlon II X2 240 - Dual core - 2.8GHz - 2 x 1MB L2 cache - $50

  • Athlon II X2 245 - Dual core - 2.9GHz - 2 x 1MB L2 cache - $60

  • Athlon II X2 250 - Dual core - 3.0GHz - 2 x 1MB L2 cache - $60

  • Athlon II X3 425 - Triple core - 2.7GHz - 3 x 512KB L2 cache - $70

Mainstream

With AMD processors being significantly cheaper than Intel’s offerings, the mainstream segment of the market is at a lower price than it was when we looked at Intel CPUs. In fact, it’s around the $100 mark.

Two CPUs stand out in this range. First is the quad-core AMD Athlon X4 630 that runs at 2.8GHz and retails for around $95. This is a great choice for those looking for plenty of cores to handle demanding multimedia work.

If you’d rather fewer cores with more power, then you want the AMD Phenom X2 560 Black Edition, which while only being a dual-core part it hums along at a cool 3.3GHz.

A good motherboard to go with these CPUs is the ASUS M4A77D which is a solid, reliable board that offers those who want too tweak the chance to try their hand at overclocking - all that for under $80.

Mainstream AMD CPU summary

  • AMD Athlon X4 630 - Quad core - 2.8GHz - 4 x 512MB L2 cache - $95

  • Phenom X2 560 Black Edition - Dual core - 3.3GHz - 2 x 512KB L2 cache - $95

High-end

The high-end choice for those wanting to power their PCs with AMD silicon is a no-brainer. AMD has the six-corePhenom II X6 1090T Black Editionprocessor. This runs at a whopping 3.2GHz and retails for around $270 - an absolute steal! Think about it - six cores for under $300. That’s pure awesome.

A great motherboard to complement this fantastic CPU is the ASUS Crosshair IV Formula which offers plenty of tweakability to allow you to get the most from the unlocked Black Edition processor. This motherboard will set you back $220.

High-end AMD CPU summary

  • Phenom II X6 1090T Black Edition - Hexa core - 3.2GHz - 6 x 512KB L2 cache - 6MB L3 cache - $220


Thursday, August 19, 2010

Membase, The Database Powering Farmville

5 million people play Zynga's online games every day. Millions of web browsers open to millions farms and millions of frontiers. They take turns, they tend crops, they send gifts. They buy millions of objects and upgrades. It's a mind-boggling amount of data. It's a new sort of data, and it warranted development of a new sort of database management system.

That system, Membase, is a "NoSQL" database optimized for storing web applications. Membase was developed by Zynga, NorthScale, and NHN, and its source code released as open source in June of this year.

RDBMS Redux

Membase is one of a number of new databases that break from the relational database management system (RDBMS) model. The RDBMS has a long history, dating back to the 1970s. In a relational database, data is stored in the form of tables, as is the relationship among the data. This system has worked well to handle transactional and structured data.

But as the amount of information, the kind of information, the number of users accessing the information have grown, the relational database has faced some challenges. With new data comes new storage demands. And the traditional RDBMS is not optimized for the kind of environment that big data and cloud computing have created - one that's elastic and distributed.

From Cache to Database

Memcached is a tool that was developed to help address some of the problems as our computing needs shifted. Originally built by Brad Fitzpatrick for LiveJournal in 2003, memcached is distributed memory caching system. But according to James Phillips, Senior VP of Products at NorthScale, many applications have been using memcached for more than just transient storage. "People like memcached because it represents a practically boundless place to easily cache data, at very low cost and with predictably stellar performance. No schemas, no tables, no sharding, no normalizing, no tuning."

farmville_aug10.jpgNorthScale was founded by some of the leaders in the open source memcached community, and the company, along with Zynga, has taken that expertise to develop Membase, so that the same speed, flexibility, and simplicity of memcached could made to really store data in a database, not just a cache.

Phillips says that memcached is designed to dock next to the relational database management system, and it's already seen as a "best practice bandaid." So from there, NorthScale argues that it can help move its customers from existing RDBMS technology towards a database architecture that's more scalable - in other words, to Membase.

It helps, of course, if you're going to argue for a move away from the RDBMS to have an early success story like Zynga to point to: the 500,000 ops-per-second database behind Farmville.

Friday, July 30, 2010

Installing LAMP On Ubuntu For Newbies

In this guide I will show you how to install a LAMP system. LAMP stands for Linux, Apache, MySQL, PHP. The guide is intended to help those who have very little knowlegde of using Linux.

Install Apache

To start off we will install Apache.

1. Open up the Terminal (Applications > Accessories > Terminal).

2. Copy/Paste the following line of code into Terminal and then press enter:

sudo apt-get install apache2

3. The Terminal will then ask you for you're password, type it and then press enter.

Testing Apache

To make sure everything installed correctly we will now test Apache to ensure it is working properly.

1. Open up any web browser and then enter the following into the web address:

http://localhost/

You should see a folder entitled apache2-default/. Open it and you will see a message saying "It works!" , congrats to you!

Install PHP

In this part we will install PHP 5.

Step 1. Again open up the Terminal (Applications > Accessories > Terminal).

Step 2. Copy/Paste the following line into Terminal and press enter:

sudo apt-get install php5 libapache2-mod-php5

Step 3. In order for PHP to work and be compatible with Apache we must restart it. Type the following code in Terminal to do this:

sudo /etc/init.d/apache2 restart

Test PHP

To ensure there are no issues with PHP let's give it a quick test run.

Step 1. In the terminal copy/paste the following line:

sudo gedit /var/www/testphp.php

This will open up a file called phptest.php.

Step 2. Copy/Paste this line into the phptest file:

Step 3. Save and close the file.

Step 4. Now open you're web browser and type the following into the web address:

http://localhost/testphp.php

The page will come showing the details of versions of LAMP packages installed in the system.


Congrats you have now installed both Apache and PHP!

Install MySQL

To finish this guide up we will install MySQL. (Note - Out of Apache and PHP, MySQL is the most difficult to set up. I will provide some great resources for anyone having trouble at the end of this guide.)

Step 1. Once again open up the amazing Terminal and then copy/paste this line:

sudo apt-get install mysql-server

Step 2 (optional). In order for other computers on your network to view the server you have created, you must first edit the "Bind Address". Begin by opening up Terminal to edit the my.cnf file.

gksudo gedit /etc/mysql/my.cnf

Change the line

bind-address = 127.0.0.1

And change the 127.0.0.1 to your IP address.

Step 3. This is where things may start to get tricky. Begin by typing the following into Terminal:

mysql -u root

Following that copy/paste this line:

mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('yourpassword');

(Make sure to change yourpassword to a password of your choice.)

Step 4. We are now going to install a program called phpMyAdmin which is an easy tool to edit your databases. Copy/paste the following line into Terminal:

sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin

After that is installed our next task is to get PHP to work with MySQL. To do this we will need to open a file entitled php.ini. To open it type the following:

gksudo gedit /etc/php5/apache2/php.ini

Now we are going to have to uncomment the following line by taking out the semicolon (;).

Change this line:

;extension=mysql.so

To look like this:

extension=mysql.so

Now just restart Apache and you are all set!

sudo /etc/init.d/apache2 restart

Monday, July 26, 2010

.MHT File Extension

Most Web pages viewed in a Web browser only contain HTML and reference images and other media files that are stored in other directories on the server; because all the files are encoded into a single file in a MHTML document, MHT files are commonly used to archive Web pages.

Programs that open these file formats:
Microsoft Internet Explorer
Opera
Mozilla Firefox with the Mozilla Archive Format extension

you can use the MAFF file format, with the following advantages:
Save disk space, since MAFF files are compressed
Include video and audio embedded in the pages
Be universal, since MAFF is based on ZIP and compatible with Linux and other platforms
Use an open format, with no risk of vendor lock-in

The MAFF format is exceptional when combined with the built-in browser support for the Ogg Vorbis and Ogg Theora media formats in web pages: you can save everything in a single file. You can even save more than one tab in a single MAFF file.

The MAF extension allows you to convert your already saved pages to the format of your choice. You can use this feature to save disk space, or even to convert MAFF to the other formats, should you ever decide to go back.

MAF also interoperates with other extensions, for example:
— Multiple Tab Handler (easily select the tabs to save)
— UnMHT (additional expert features to read and write MHTML)

Thursday, June 10, 2010

Upcoming Trendzzzz

Many Computers via 1 Keyboard & Mouse

Do you have multiple computers on your desk? Synergy (synergy2.sf.net ) allows you to use the keyboard and mouse of your primary computer to control all the other computers around you. Best of all, it is free, works with Linux, OS X, and Windows.
For more info: (http://code.google.com/p/synergy-plus)
Synergy+ (synergy-plus) lets you easily share a single mouse and keyboard between multiple computers with different operating systems, without special hardware. All you need is a LAN connection. It's intended for users with multiple computers, where each system uses its own display.

It doesn't do any encryption or Authentication. So, to secure Synergy you can either tunnel it through SSH or do like I do and configure a private VPN between your computers using OpenVPN and run Synergy over it. OpenVPN is available in most Linux distributions or you can download it directly from their site.

Some C language Questions...

1. Freeing a null pointer wont result in any error; The free() call would return without doing anything.

2. p=calloc(1,sizeof(int));
free(p);
p=realloc(p,sizeof(int));

Error: "glibc detected ** ... : double free or corruption"
Reason: "realloc(ptr,size)" has to be invoked after (m|c)alloc(), but before free()

3. p=calloc(1,sizeof(int));
free(p);
p=NULL;
p=realloc(p,sizeof(int));

No error
"realloc(,size)" is equivalent to "malloc(size)"

4. int *p;
p=calloc(1,sizeof(int));
free(p);
p=realloc(p, 0 * sizeof(int));
p=NULL;
p=realloc(p, 1 * sizeof(int));
*p=1;
free(p);

Error: "glibc detected ** ... : double free or corruption"
Reason: realloc(,0) is equivalent to free(); So we end up with double free

5.int *mp,*cp;
mp=(int*)malloc(sizeof(int));
printf("mp=%d\n",*mp);
cp=(int*)calloc(sizeof(int),1);
printf("cp=%d\n",*cp);

mp=garbage value
cp=0
The memory space allocated by malloc is uninitialized, so mp has some garbage value. calloc initilize the allocated memory space to zero. so cp=0

6.
#include
void main()
{
char *pd,*ps="I LOVE C";
pd=malloc(strlen(ps));
strcpy(pd,ps);
printf("%s",pd);
free(pd);
}
prints I LOVE C

7. int *p;
p=(int *)malloc(-10);
printf("p=%d",*p);
free(p);
Segmentation Fault

8.
int *p;
p=(char *)malloc(sizeof(10));
printf("The starting address is %d\n",p);
return 0;
Will give a warning,but run anyway

ptr = (cast *)malloc(size) Malloc returns void * which is explicitly casted to cast *.

printf("%d\n", sizeof(++x));
x is not incremented since sizeof doesn't evaluate its operand.

long long a;
int b;
int c;
a = b + c;
then expecting that no matter how big b and c are that they won't overflow because a is big enough. But in reality the calculation is done by adding c in to b, which might overflow b. The value of b is then assigned to a.
Using a = (long long) b + c; yielded the correct result.


#define myCharPointer char*

int main(){
myCharPointer p1, p2;
...
}
That's one of the reasons you should use typedef instead of #define


//courtesy: stackexchange for programmers