Installing Starcraft 2 without downloading the whole game with Blizzard’s installer client

The installer client provided by Blizzard has bandwidth limit I guess. I could not exceed 200KB/s. As I don t have patience, I searched for alternative ways to install the game.

Downloading the game and starting the installation may not be enough. Because as you try to install the game, installer give error and stop operation.

Here is how I installed the game:

  1. Downloaded game from rapidshare. ( Rapidshare Links )
  2. Extracted game to C:\sc2\
  3. Downloaded blizzard installer client ( Client Link )
  4. Executed the the client and targeted the directory C:\sc2\
  5. As the download starts, cancel it. Because before installer download  files for installation, it creates the files (part files) which are going to be downloaded in a directory. Lets name it for instance C:\sc2\sc2Dwn. (Can t remember the actual folder name. You will realize the file as you check C:\sc2 folder  )
  6. I moved all files and folders in C:\sc2 except “C:\sc2\sc2Dwn” to directory C:\sc2\sc2Dwn folder.
  7. Deleted all part files.
  8. Appended “.part” to filenames of every file (not folder!) in the C:\sc2\sc2Dwn directory. (i.e. if file name is “Starcraft2.exe” rename it to “Starcraft2.exe.part” )
  9. Start the downloaded installer client again and target C:\sc2 folder. The client will check the files in C:\sc2\sc2Dwn download some extra stuff and finalize download operation.
  10. I started installation.
  11. Couldn t have fun so far (: Because I only played the game about 30 mins I guess cause of work.

Finally, Starcraft 2 is released at last. Long nights with overwhelming challenges awaits. See you in Battle.Net

No Comments

Connect to Internet Using Nokia E71 From Ubuntu

In this small article I will share my experience on connecting internet using my new toy E71 from Ubuntu.

The most important reason that I bought this phone, is to be able to use it as 3G modem (Well, the other reason is it’s impressive looking). But it has so many many overwhelming functionalities that I am testing it as a 3G modem today (3 weeks later).

Connecting the phone over windows xp was not a problem. I was wandering how it was going to be with ubuntu. It was unexpectedly very easy :) . Here are the steps I went through and got shocked in the end;

First of all I am using Ubuntu 9.10

System->Preferences->Network Connections

Click “Mobie Broadband” tab

Click “Add” on the menu at right side

At this wizard you will be required to input; your country,GSM provider name,APN (ask your GSM provider).

Now connect your phone via USB cable. On your phone you will be asked for the usage mode. Select “Pc Suite”

Now return to ubuntu. Find the network locations icon in your desktop (Where you usually select wireless network to connect). Its usually on the toolbar next to clock. You should now see your GSM name as a connection. Select it and have fun in net.

And we are done :) Hope this small article helped you.

, , , ,

No Comments

Cropping Images Using PHP and Javascript

In dynamic web sites we let our users to upload their own images. Most of the times we resize and decrease the quality of the image for optimization purpose. But sometimes this is not enough. When you need a standardization for image size, you look for ways to make cropping operations. In this article I will share how I made cropping for my website using;

The jsCropperUI will help us :

  • to provide users to select the area to be cropped
  • get the selected area’s cordinates to our web server.

If you have downloaded the jsCropperUI, take your time on testing the javascript and until you succeed with submitting the coordinates. From this point I will assume that you have the image stored in your web server and you have got the selected area’s coordinates in web server.

In order to understand the algorithm I suggest you to check the algorithm demonstration on Scratt below :)

php javascript cropping algorithm explanation

Here is the php class that I wrote to crop images.

/*
* Image Cropping utility
* by Cihan Necat KAVİ  [ me@cihannecatkavi.com ]
*/
class ImageCroppingUtils
{

public static function getImageAsResource(string $imgAdress)
{

try
{

$fileextension = pathinfo($imgAdress,PATHINFO_EXTENSION);
$simg=null;
switch($fileextension)
{

case 'gif':
{
$simg = imagecreatefromgif($imgAdress);
break;
}
case 'jpg':case'jpeg':
{
$simg = imagecreatefromjpeg($imgAdress);
break;
}
case 'png':
{
$simg = imagecreatefrompng($imgAdress);
break;
}
default:
{
throw  new Exception("Error while trying to get image as resource(format not supported)");
}
}

}
catch(Exception $er)
{
throw  new Exception("Error while trying to get image as resource Message::".$er->getMessage());
}

return  $simg;
}

// this function can be used to crop image files
public static function cropImage(string $source,int $x1,int $y1,int $x2,int $y2) {

$simg = null;

try
{
$simg = ImageCroppingUtils::getImageAsResource($source);
}
catch(Exception $er)
{
throw new Exception ("Image file could not be found while getting the source image to be crop");
return;
}

list($w, $h) = getimagesize($source);

$crop1x = $w-($x2-$x1);
$crop1y = $h-($y2-$y1);

$tmpImg = imagecreatetruecolor($w, $h);
$finalImg = imagecreatetruecolor(($x2-$x1), ($y2-$y1));

imagecopyresampled($tmpImg,$simg,$crop1x,$crop1y,$x1,$y1,$w,$h,$w,$h);
imagecopyresampled($finalImg,$tmpImg,0,0,$crop1x,$crop1y,$w,$h,$w,$h);

return $finalImg;

}}

As you can see there are two functions. First one is to get the source image as resource. The second, is the core function cropping the image.

The cropImage functions is returning resource so after this if we are done with the image we may save it to disk.
(ex: using imagejpeg($image_resource, “test.jpg”) )

Here is a sample usage of the class:


/*Before starting I am assuming that you have the adress of the source image
and the coordinates as I stated above.
*/

$sourceImageAdress = "test.jpg";

// the parameters here are sample inputs.
$finalImage = ImageCroppingUtils::cropImage("test.jpg",10,5,15,20);

//here we save the final image
imagejpeg($finalImage, "Croppped_test.jpg");

And we are done :) İf I have time I will provide more details for this article. I ll be happy to recieve suggestions or questions. Hope this articles helps you.

3 Comments