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

Deciding A Path To Follow (c#,php,java) …

.NET or JAVA

.NET or JAVA

Most of the developers are finding it hard to choose the right way to follow for a better future. It was same for me for some time ago. Now things getting clear for me. In this article I will try to share my ideas.

Lets start in the point of view that we are all “human beings” with responsibilty to earn money for a better future.  We are in a need to believe a road to follow. But sometimes we get confused with the language or platform we should be professional with. The reason of this confusion is that we can not be sure if the technology we are using/learning will be valuable in future.  As time is valuable and  passing quickly knowing  your investment for future is important.  My main investment for the future is actually “time management”. For this, first of all you have to play the “manager “ of yourself.  You have to organize the works so well that time should be used efficiently.  Knowing yourself is the key to be a better “self manager”. So the language or platform should not be important at this point of view. The most important fact should be “you”. Because to be honest we all know that accessing to an information is not that hard as we have google. Knowing what you are looking for and how deep you should go in to details has importance.

Secondly lets look from “developer” perspective.  Software development is an “art” and “passion”. These 2 facts make the developer go into details for to get better performance and ofcourse more benefits. I divide developers into 3 categories “advanced developers”,”intermediate developers” and “starter developers”. Advanced developers are the experts who have the ability to code tools,frameworks,drivers etc. for other  developers,people’s use. Intermediate developers have the ability to produce products, plug-ins, extensions from the tools or frameworks provided by the advanced developers. Starter developers uses tools provided from Advanced or Intermediate developers.  Most of the starter developers are focused on to provide business functionality. The have no clue about what is working behind. This is sometimes the same with intermediate developers. If you look into cost-benefit perspestive, having no idea about the overheads result solutions that cost more than expected (like getting extra server,software licence etc.). However optimizations that are made with focusing your bussiness model would bring great benefits and maximize cost-benefit percentage.

Previously I  worked with .NET technology in collage and in my career for about 4 years. Some of you will say that this is not long enough. But let me say that I learned the actual details of web technology after learning PHP. Some of the .NET developers still thinks that browsers can understand the script they are writing behind. They don t have any clue about automatic HTML,javascript generation. I simply call them drag and drop programmers. Drag and drop tools can be sometimes a benefit if the project is not that big or has so limited time for delivery.

Currently I am on Linux systems coding with JAVA and PHP. This was not a permenant decision of mine. The company that I am working with expected me to learn those languages and platform for the development of the project. At first times it was really hard for me to get used to it. I was allways thinking how I could make the same things more easily using Windows and .NET which would save time. In the project that I am working java frameworks ,which are strongly accepted in java community, are being used . As these projects were opensource they really made me wonder what was behind. I saw some overheads or features that I didn t need and tried to modify the code to get rid of them.  Repeating this for some time I started to feel myself more independent as I got into deails of the platform and the language that I am using. This is actually interesting because adepting to new technologies became more easier for me.

I don t know about the future probably I will be where the money is. But this .NET and Microsoft guy is changing the road to Linux, JAVA, PHP or simply opensource programmer.

I will be happy to hear yours suggestions or thoughts.  You will probably see more articles about JAVA, Linux and PHP in the following days.

Have bug free days everyone…

, , , ,

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.

2 Comments