Wednesday, June 29, 2011

Bad luck with my xbox360

Hi,

For those who don't know me, I have been a tinkerer since my childhood, the first memories i have of this trait of mine is of opening my Leo toy gun and an unfortunate alarm clock, the toy gun i had to throw away and alarm clock was placed behind a cupboard, had to destroy the evidence, but was caught both times by my parents.

Since then I have opened mp3 players, FM radio's, CD players, floppy drives, DVD drives, my CPU, Television ... the list goes on......

I own a XBOX360 , courtesy of my better half and that was the thing which was left unopened , mocking me , sitting smugly , as a challenge , an unconquered frontier. Not anymore :)

Although the mission was not a total success as I wanted to flash my xbox to be able to play backed up games ( you know what i mean ), but my xbox has liteon DVD drive , model number DG-16D2S-(09C), firmware number 93450C, which unfortunately has to be flashed by soldering a wire onto it, and I am not great with soldering, so I wisely decided to back off.

Have repacked the xbox and tested it, its running fine. Here is the pics of the adventure i had.




Regards,
Ishan

Wednesday, June 15, 2011

using makefiles to compile objective-c

Hi,

In the last post i have discussed the procedure of installing the GNUstep compiler on a windows machine and using it to compile the objective-c code.

But as you all must have felt that the procedure for compiling the code was a bit tedious and raw, so here is the make file version of compilation as promised in the last post.

Create a file named "makefile" and into that file put the following lines:

first : first.m
gcc -o first.exe first.m -I /C/GNUstep/GNUstep/System/Library/Headers \
-L /C/GNUstep/GNUstep/System/Library/Libraries \
-lobjc -lgnustep-base -fconstant-string-class=NSConstantString


Then on the GNUstep shell , make sure you are in the same folder as your source and makefile , type the command "make" and hopefully you will get the error free result.

Hope this makes the process a bit easy.

Regards,
Ishan

Thursday, June 9, 2011

Objective-c on windows

Objective-c is a nicely designed language with a rich feature set, If you are aware of the recent history of programming, you will know that when steve jobs was booted out of Apple he founded NeXT, a company which created the NeXT workstations. He licensed objective-c from "StepStone" the original creators of the language.

Due to its brilliant features objective-c became the prefered platform of hardcore programmers. Then Apple bought NeXT and objective-c became a part of what came to be known as Mac OSX.

Today objective-c is the language of preference if you want to develop on Mac, Although because of the premium tag associated with Mac's its out of reach for many people.

If you want to start learning objective-c as a language before jumping on to the Apple bandwagon, there is a solution.

The blessed GNU people created an open source implementation of the objective-c compiler and called it GNUstep and guess what , its available on windows.

You can download the required tools from the link given below.

http://www.gnustep.org/experience/Windows.html

Download the four tools provided from the links available on the page and install them in the suggested order.

GNUstep MSYS System -> GNUstep Core ->GNUstep Devel -> Cairo Backend.

After the installation is done from the windows start menu open the GNUstep shell, remember its very important to get start the GNUstep shell , if you will try to program in objective-c from the dos shell it will fail.

Opening the shell opens up a bash like interface, those people familiar with the linux command line will be comfortable here, all your favourite tools like Vim , make are avialable.

Create a new directory using the command : mkdir dirName.
Go into that directory using the command : cd dirName.

now create a new source file using Vim.
vim filename.m

Notice the weird extention of the source file we just created, well thats the standard extention for the source files containing objective-c code.

In the newly created source file write the following code.

#import <Foundation/Foundation.h>
int main (int argc
, const char *argv[])
{
NSLog (@
"Hello, Objective- C!");
return (0);

}

Now to compile the code there are 3 options:

1. compile directly using gcc
2. create a standard makefile and use the provided make utilty
3. use the GNUstep make utility

In this post i am going to cover only the first option.

To compile using gcc directly just use the following command:

gcc -o output fileName.m -I/c/GNUstep/GNUstep/System/Library/Headers \

-L /c/GNUstep/GNUstep/System/Library/Libraries -lobjc -lgnustep-base \

-fconstant-string-class=NSConstantString


An executable file , output.exe will be created in the present working directory.

To execute it just write ./output.exe on the command prompt.


I will try and cover the makefile and GNU make methods of compiling as they are more practical and basically cooler to work with.


Till then enjoy the Mac goodness on your Pc.


Regards,

Ishan

Monday, May 30, 2011

Django models

Database are the backbone of any website, and database interactivity is a very important aspect of any server side programming.

As you all might be knowing that there are multiple vendors offering different databases. And usually in other established web development frameworks database queries are so tightly integrated with the code that any change in the backend database results in necessary changes in the code.

But not in django, Models are there for that service.

Models take care of the sql part for you and make it possible for the developer to concentrate on developing in a uniform language ( python ). Any change in the database can be handled by just making changes in settings.py file.

That's what i call intelligent development.

Regards,
Ishan

Saturday, May 28, 2011

django template loading

Templates are a really a great feature, using it is a delight as it lets the python developer concentrate on the backend code letting the designers concentrate on the page design.

If you are developing on a local dev machine and uploading it to a live server, template path can be an issue of concern for you.

To make it path independent there is a thing you can do to bypass that issue.
In the settings file, look for TEMPLATE_DIRS here you can use the python magic variable to chalk out a relative path.

import os.path
TEMPLATE_DIRS = (
os.path.join(os.path.dirname(__file__), 'templates').replace('\\', '/'),
)

__file__ variable points to the current path and the templates directory can be joined on to the path.
In practical scenario __file__ will contain the src folder, so keep the templates folder inside the src folder.

Isn't it neat.

Regards,
Ishan

Saturday, May 21, 2011

ubuntu 11.04

I recently updated my netbook with ubuntu 11.04 which by default comes with the unity interface in place of vanilla gnome, i was previously using ubuntu netbook remix, which was the ubuntu version with unity.

The changes which i feel in terms of performance is the the speed and responsiveness of the whole interface has significantly improved.

Also the new file explorer is a pleasure to work with when compared with the one bundled in the last version.

The experience is smooth even with running apache,eclipse and multiple other programs on a hugely underpowered netbook, but that's a thing that expected of linux, isn't it.

things i liked about django

Django is turning out to be better than i imagined, its python whats not to like :).

But apart from that , the template system django implement to separate presentation from actual backend code is a beauty in itself.

URLconf is another feature of django which i enjoy, unlike other web development platforms where url's are where you store the page on the web directory.

As my affair with django continues i keep falling deeper and deeper.