More than a feeling

Standard

Since my last post, that little social interaction group I had, has become a bit more tight. In this spirit of next level of acquaintanceship, we had an evening together. It was invigorating and more than a feeling. Good food, good company complimented by pleasant climate and an endless stream of human population in the crowded streets of Old Delhi. It was a good experience given the fact that I usually shun such bondings and interactive activities.

Father was a bit unwell and was under medical supervision. He was given a green signal today to carry on with life as he usually does whilst taking certain precautionary measures. It took sometime to get things done and get him back home. I wrote this because I wanted to give a reason for my late arrival to the venue for the evening. But anyway, I was present at the scene and thus started the evening of passing smiles and random sentences. Since all the participants are food lovers and Old Delhi is known for it’s delectable street food, we, being sincerely foodie and sidelining health concerns, went on a street food spree.

IMG_20160130_164808

In lieu of Indian Republic Day on 26th of January, Delhi Tourism has organised a food festival at the magnificent Red Fort. Various people from various states of India had on display and sale, various food items. Various states showcased their traditional art forms and specialities of their states in forms of tableaux and stage performances. It was a good atmosphere and I really enjoyed the positiveness of the moment. Lady D and Soni looking pretty as ever were making me skip a heart beat with every other smile that lingered on their lips. The Guy was, as always, in total tune with my frequencies and we had a laugh about many a thing. We have such social interactions at work too but the punch was the ambiance of the location.

groupie - 1

Chandni Chowk is especially known for this street called “Parathe Waali Gali” which roughly translates to “Baker Street”. Well, wtf to that. The crux of the evening was this restaurant which has a legacy almost 200 years old. The walk from Red Fort to this restaurant was long and in the overly crowded streets of Chandni Chowk, navigating your way through is an exhausting activity. The company was such and the euphoria of being with amicable humans, the walk didn’t put much strain on any muscle as such. Good, I usually avoid putting any strain on any muscle during weekends. All were chittering and the good thing about it was, none of it seemed exasperating. Given the fact that Lady D has naught capacity for bullshit, it was fun to say random stuff to her and listen to an equally random hooting from the ladies as a consequence.

IMG_20160130_172346

And coming to the heart of the street food spree, the parathas were decadent and savoury. The restaurant was established in 1875 and has been, since then, serving various kinds of parathas in an overly small shack located inside a more overly crowded street. It’s a shack yes… don’t let that fool you. The food there is worth all the money that you’ll shell out after stuffing yourself till you choke. We, being sincerely foodie and sidelining health concerns, satiated our craving for such delicacies. The Guy suggested the “banana paratha”. Its’ roughly equivalent to a croissant stuffed, generously, with pieces of bananas and cashew and cream. It was something I have never eaten and it was delicious as fuck amongst other things. The buttermilk or, in native tongue, Lassi was as authentic as a Lassi in this part of Delhi can get. They still use the same ingredients and methods going back almost 200 years.

IMG_20160130_174906041

A traditional Indian meal ends with a dessert and we, being sincerely foodie and sidelining health concerns, honoured this tradition. Falooda is a speciality of this area of Delhi and this place is the to-go point. Oh damn the sweetness. I have never kissed a female human but I think this falooda would be sweeter than that. The walk to that place was lengthy too but again, with the company, it was jovial and jocund. The falooda called to an end, this awesome evening, that is forever laid down here with these words.

Wishing that this level of acquaintanceship only grows upwards, I sign off with a special tip of my hat to the humans of this little social interaction group. Let’s keep this spirit of new level of acquaintanceship alive and kindle it to a newer and better level.

Ninja.

Advertisements

Panegyric

Standard

It means an expression/article of praise. Its’ been a while since I have updated my blog. I’m happy actually. Not that rainbows and butterfly kind of happy but life-is-going-good happy. I have a social circle and they talk to me too, which is nice. As per social conventions, you should say good things about people who have a positive impact on you. I have 4+1 elements in this set of human entities and in this panegyric I’ll try and describe these 4+1 elements.

At work, I have nothing much to do so I was working on Qt/QML. Qt is to C++ what Android is to Java. Like Android, Qt is not pure C++ and rather extends C++ and makes it more awesome (as if C++ needed to be any more awesome). QML is a declarative language that is used to design UIs and together with Qt, one can create powerful desktop applications independent of platform. A friend asked me for a comprehensive tutorial and I’ll try to elucidate a sample music player application I made in Qt/QML. It’s nothing much really but it does implement concepts of models, views, delegates and exposing variables from C++ code to QML. You can download the code here and must have the latest updated version of Qt Creator.

So I have 4+1 elements in this set of human entities. 4 of us are in a group and we talk on this messaging application where they laugh and respond or simply respond. The other element is whom this article is meant for. The Guy and I discuss not about piffling things such as human dealings (a.k.a bitching) and talk about better things such as world happenings and imaginative ideas that may not happen in real life. This one is rathe for new ideas, adventures and experiences and values friendship. This one thinks that I’m erudite so I assume that there is something wrong with this one. And as a matter of fact, there is. This one has his own world and is lost most of the time in that world. It would be condescending to say that The Guy should adjust the volume of his voice but its’ ok. At least he speaks not shit like most other humans do.

Sweet P is sweet. This one is happy go lucky and has an infectious smile. This one is artistic and sees a world full of colours and possibilities. This one also yearns for new experiences and has a lot to see and do. This one too thinks that I’m erudite so there must be something wrong with her too. And there is. This one is too happy. I wish that this one gets to see the fucked up side of life soon. One becomes a true sage when they experience downward spiral as zealously as upward spiral.

Open Qt Creator and start a new Qt Quick application. Like most languages today, it scaffolds a basic skeleton for your application. A “main.cpp” file and a “main.qml” file. The CPP file is the controller and QML is the application UI. I added a “player.h” file that defines a class for the music player and a “player.cpp” that defines the controller logic for the music player. If you run the application, it will show a menubar with buttons on the bottom and a “load area” on top. The “load area” is where the UI of the music player will be loaded on click. QML looks like CSS on steroids and if you have an understanding of CSS its’ easy to grasp QML quickly.

QML is used to define “elements” of a UI. Every element has an ID and we refer to an element by its ID. Qt Creator is called so because you can create a UI by dragging and dropping (and editing properties) an element in the Creator window. If you see my “main.qml” file, there is a Loader element. This is the “load area” and we can load an external QML directly into this load are with the Loader element. To make an element clickable, we define, within that element, a mouse area. Mouse area defines an “onClicked” signal which is used to define the function of the element if it is clicked.

Loader {
 id: contentLoader
 x: 1
 y: 0
 width: 1023
 height: 324
}
MouseArea {
 id: mouseArea2
 anchors.fill: parent
 onClicked: {
     contentLoader.source = "mediaPlayer.qml"
 }
}

The important and confusing part, like margins in CSS, are anchors. You must read about anchors yourself but it basically means how an element is positioned relative to its’ parent.

Coming to “mediaPlayer.qml”, it looks much the same as “main.qml”. The focus areas are “FolderListModel”, ListView and MediaPlayer. In QML and in general, data is cast into a model. Model is how your data is defined. In this case, we are going to access a folder pointed to by the “musicUrl” variable (we will come back to this). A Model is used by a View to format the data you’re accessing. In this case, we are formatting it in a List and hence the ListView. A View uses a delegate. A Delegate defines how each element in a data set is rendered. In our case, each song in our music folder is enclosed in a clickable rectangle. If you click on it, it will start playing that song. We are using QtMultimedia library to play songs and it defines a MediaPlayer element. You can check out the available parameters of MediaPlayer and QtMultimedia library in the links. Here, we update the “source” parameter of the MediaPlayer element when we click on a song shown in the list. The available parameters of MediaPlayer are used further down the code for example: mediaPlayer.metaData.title and mediaPlayer.metaData.author.

 FolderListModel {
   id: folderListModel
   folder: musicUrl // TODO: write C++ Controller. Done
   nameFilters: [qsTr("*.mp3")]
   showDirs: false
 }
 ListView {
   id: playList
   x: 9
   y: 8
   width: 261
   height: 308
   spacing: 5
   flickDeceleration: 1000
   model: folderListModel
   delegate: Rectangle {
     x: 23
     y: 21
     width: 234
     height: 56
     gradient: Gradient {
         GradientStop {
         position: 0
         color: "#ffffff"
     }
     GradientStop {
         position: 0.881
         color: "#ae5151"
     }
  }
 Text {
   id: song
   text: model.fileName
   anchors.fill: parent
   verticalAlignment: Text.AlignVCenter
   horizontalAlignment: Text.AlignHCenter
   font.pixelSize: 12
   wrapMode: Text.WordWrap
   MouseArea {
     anchors.fill: parent
     onClicked: {
         mediaPlayer.source = model.fileURL
     }
   }
  }
 }
}

The third element of the set of human entities is Soni. This one is our darling. We all revere this one and look up to this one. This one is quite mature and emotionally and mentally stable. This one seldom thinks that I’m erudite so there is not much wrong with her. This one is a bit haughty and I feel lucky that I’m in talking terms with this one. Lucky because she is sorted enough to filter out obtuse humans out of her life. This one has experienced much and knows how to hold her composure and stature in direst of situations. This one is the coolest human entity I have come across till now. Right now, this one is globetrotting.

Yanka is not in the messaging group but the technical aspect of this article is meant for this one. This one is one hap chick. This one has a flamboyant style statement. This one is amiable and if you ask this one for some time, she will give you time. This one will sit and listen to you and talk to you. Although this one speaks almost 100 words within a minute but you can slow it down and process it mentally if you aren’t distracted by that sparkling smile. This one thinks that I’m intelligent but I give her that… not her fault, this one doesn’t know me much. Which is good for this one’s mental well being.

Lady D. This one is awesome. This one thinks I’m a fucking idiot and hence there is nothing wrong with this one. This one is different. Out of the pack. I can relate with this one and I like to think that this one and I have same mental frequencies. This one is funny, intelligent… pretty. A whole package just to take your breath away. This one is a bit narcissistic but that’s alright. It suits this one’s persona. You can sit with this one and observe her without getting involved and you won’t be bored. This one has an active (if not over active) mind and cannot sit still. I find many a similarity between this one and myself. I’m mentally (over) active and cannot sit still either. This one is striving to be mentally and emotionally stable like Soni and will eventually get there. This one has naught capacity for bullshit. This one forms clear opinions and characterises deliberately and clinically which I find utterly cool. This one thinks that she is all been there and done that but the only experience that she has is of that one city which was her first home away from home. Given all her imperfections though, this one is perfect in every way. If I ever decide to take a chance with some human, this one would be the one.

Coming to the “player.h” file, here we define a class that will eventually help us get the songs out of our directory and into the list model. In Qt, every class must extend the QObject class. I won’t go into the nitty gritty pieces of this class and directly jump to the implementation of the function definitions. QStandardPaths define all the standard paths in the OS for example, all the paths in the $PATH variable in a terminal are defined in this header file. In “player.cpp”, we extract the standard path to our music folder in the constructor of class “player”.

player::player(QObject *parent) : QObject(parent)
{
     musicPaths = QStandardPaths::standardLocations(QStandardPaths::MusicLocation);
     musicUrl = QUrl::fromLocalFile(musicPaths.isEmpty() ? QDir::homePath() : musicPaths.first());
}

The musicUrl variable is set in the controller as shown above. We must expose this variable somehow to QML so that it is accessible in QML. To do this, we add this variable to the root context of the main application engine.

engine.rootContext()->setContextProperty(QStringLiteral("musicUrl"), p.getMusicUrl());

This piece of wonder basically allows us to execute a function defined in our controller whenever the said variable is referred to in the QML. This is pretty fucking cool.

Well, this panegyric comes to an end. These 4+1 elements of this set of human entities are awesome. All opinions presented here are a solely the authors perspective. It is not the author’s intention to degrade anybody but if you feel degraded, feel free to take out time and jump off of a cliff.

Yours truly,
Ninja.

Windows, yes Windows.

Standard

Rain, apathy and boredom. That is how the last few weeks have been. To make things worse, I was pushed into this new project forcing me to dabble with Windows 8.1 and its deployment process.

So apparently, you may think “Deploy Windows 8.1? You had to write a blog for that?!”. Well let me tell you, you fuck stick, there is a difference between installation and deployment. You do an installation when you set up everything from a brand new Windows CD. Deployment is a process where you directly apply a pre configured Windows image to the system. Got it? Good.

So before starting… or just lets start, yeah. You have to download some stuff before you start. To be more elaborate, what you are downloading is Windows Assessment and Deployment Kit (ADK). It is a suite of tools required to configure and deploy Windows 8 on a machine. Please follow instruction on how to obtain and how to install Windows ADK on your machine. I assume that you have done so.

We will start with Windows Pre Installation Environment or WinPE. It is a scaled down version of the failed Windows Vista and provides a minimal command line interface to run deployment and other scripts. After you install Windows ADK, you’ll have WinPE with other tools… we make a copy of it.

If you installed the ADK, you’ll have a command line environment called Deployment and Image Servicing Tools (DISM), you must run this as an admin:

pic1

Once it starts up, assuming that your PC is 32 bit (mine is), fire off the command:

copype x86 C:\winpe_x86

replace “x86” with “amd64” if you are on a 64 bit machine. This will copy the required files into a folder named “winpe_x86” (create the folder beforehand).

We have to mount the image. Once upon a time that would have excited me because I was working on Linux. Now its just… boring. Fire off: (you’ll have to make a mount folder in the previously created folder)

dism /mount-image /imagefile:c:\winpe_x86\media\sources\boot.wim /index:1 /mountdir:c:\winpe_x86\mount

You can customize it. As an example, here is how to add packages for PowerShell and language packs and other dependencies for PowerShell. You can get commands to add packages all over the net.

dism /image:C:\winpe_amd64\mount /Add-Package /PackagePath:"C:\Program Files (x86)\Windows Kits\8.1\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-NetFx.cab"
dism /image:C:\winpe_amd64\mount /Add-Package /PackagePath:"C:\Program Files (x86)\Windows Kits\8.1\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-NetFx_en-us.cab"
dism /image:C:\winpe_amd64\mount /Add-Package /PackagePath:"C:\Program Files (x86)\Windows Kits\8.1\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-PowerShell.cab"
dism /image:C:\winpe_amd64\mount /Add-Package /PackagePath:"C:\Program Files (x86)\Windows Kits\8.1\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-Powershell_en-us.cab"

Plug in a flash drive and install WinPe on it. Fire off: (after plugging in the flash drive of course, I’ll assume the drive letter is F:).

dism /unmount-image /mountdir:c:\winpe_x86 /commit
makewinpemedia /UFD C:\winpe_x86 F:

Now, starts the fun part. We will capture an image of the running system. To do so, you have to “Sysprep” the machine into Audit mode. Go to run and type “sysprep”. A window will open and you have to execute “sysprep” executable file.

pic2

from the first drop down menu, select Audit mode and make sure you have checked Generalize. Let shutdown options remain same. When the system shuts down, connect the flash drive created above and restart the system. It will boot into WinPE:

pic3

I have fired the “DISKPART” command which lists the current partitions on the hard drive. To capture an image then, you must do: basically, you are capturing the current state of the windows partition on your systems (C drive in most cases) to your pen drive (“install.wim”)

dism /capture-image /capturedir:c:\ /imagefile:F:\install.wim /name:"DeploymentTestImage"

Now that you have captured an image, lets customize it. Type exit to exit from WinPE and reboot the system. When the system reboots, you have to mount the captured image to customize it. Mount the captured image by typing the following in DISM command prompt (above): make a “mount” folder under C: before continuing

dism /mount-image /imagefile:f:\install.wim /index:1 /mountdir:c:\mount

When you navigate to “mount” folder, you can see that it looks like the C drive of your current system. Common folders like “PerfLogs”, “Windows\System32” etc are present. I’ll change the wallpaper as a basic customization as I’m not a Windows whiz kid. Navigate to Windows\System32\Web\Wallpaper. You’ll see the default wallpaper that you get when you do your first install (img0.jpg). Replace it with your own wallpaper. Note that you might have to take admin privileges to do that.

Dismount the image and commit changes:

dism /unmount-image /mountdir:c:\mount /commit

Now again reboot the system whilst the flash drive is plugged in. Now,

If you are on a BIOS machine, this is the layout. We have to make partitions before deployment. We use “DISKPART” to make these partitions.

// Create Partitions BIOS
// These commands are used with DiskPart to
// set up the drive and create three partitions
select disk 0
clean
// System partition
create partition primary size=350
format quick fs=ntfs label="System"
assign letter="S"
active

// Windows partition
create partition primary size=15000
// Format Windows partition
format quick fs=ntfs label="Windows"
assign letter="W"
create partition primary size=10000
format quick fs=ntfs label="User"
assign letter="D" // the "D:\" Drive

// Recovery image partition
create partition primary
format quick fs=ntfs label="Recovery image"
assign letter="R" 
set id=27
list volume
exit

You can alternatively run create a text file (partitions.txt) with the above commands and run diskpart as:

diskpart /s partitions.txt

To deploy the final captured image, I made this batch file to automate the process (actually borrowed it):

rem    Usage:   ApplyImage WimFileName 
rem    Example: ApplyImage F:\install.wim ==

rem == Copy the image to the recovery partition ==
md R:\RecoveryImage
copy %1 R:\RecoveryImage\Install.wim

rem == Apply the image to the Windows partition ==
dism /Apply-Image /ImageFile:"R:\RecoveryImage\Install.wim" /Index:1 /ApplyDir:W:\

rem == Copy boot files to the System partition ==
W:\Windows\System32\bcdboot W:\Windows

:rem == Copy the Windows RE image to the System partition ==
md S:\Recovery\WindowsRE
xcopy /h W:\Windows\System32\Recovery\Winre.wim S:\Recovery\WindowsRE\

:rem == Register the location of the recovery tools ==
W:\Windows\System32\Reagentc /Setreimage /Path S:\Recovery\WindowsRE /Target W:\Windows

:rem == Register the location of the push-button reset recovery image. ===
W:\Windows\System32\Reagentc /Setosimage /Path R:\RecoveryImage /Target W:\Windows /Index 1

You can read about the command line options and documentation for the commands used any where on the web (if you google correctly).

Thats it. There, you have a pen drive having a custom Windows 8.1 image that you can deploy on any system. It will take half as much time as a full installation and automatically create partitions etc. I have started to like Windows 8.1… will see what else can I do.

A few bad days

Standard

“Choose life. Choose a job. Choose a career. Choose a family. Choose a fucking big television. Choose washing machines, cars, compact disc players and electrical tin openers. Choose good health, low cholesterol and dental insurance. Choose a starter home. Choose your friends. Choose leisure wear and matching luggage. Choose a three-piece suit on a hire purchase in a range of fucking fabrics. Choose D.I.Y and wondering who the fuck you are on a Sunday morning. Choose sitting, watching mind-numbing spirit crushing game shows stuffing fucking junk food into your mouth. Choose rotting away at the end of it, pissing your last in a miserable home. An embarrassment to the selfish, fucked up brats you have spawned to replace yourselves. Choose your future. Choose life.”

Well, that is from the opening scene of the best movie ever made: Trainspotting. That being said, the last few days have been an utter devastation to the above “regime”. So I took a detour from my usual ramblings and started working on a Perl project called “Complain management system”. It’s not a big fucking deal really, but this is my first commercial project in Perl and it is quite simple. To keep things simple and clutter free (this is not a tutorial…), please refer to this tutorial for details.

The requirements are as follows:

  • Perl. On Linux systems, you must have it installed already. If not, use your favorite package manager (I use apt) and install it. On Windows, go for Strawberry perl.
  • Catalyst. Catalyst is an agile MVC framework written in Perl. It is very robust and increases the development speed considerably. You can use CPAN to install it.

I’ll assume that you already are a Perl programmer because I cannot really get into the intricacies as such. I’ll directly start with how to use the Catalyst framework to make a small web application. The source code will be upped on git.

Now exactly like Mark Renton, I chose not to choose life. I chose something else. And again like Mark Renton, there were no reasons. Who needs reasons anyway when you got weed? The month that started with a good bright fucking smile on my face ended with me fallen on the freakin’ road about to be bowled over by a double fucking decker bus.

“Goa! Dude I have 5 days off and I’m not fucking them up eating at the miserable mess food you love to stuff your mouth with!” said my friend. So we went to Kashid. One of the best trips of my life. Starting with the ferry ride from Gateway of India, the journey was memorable… weed, beer, beach, silver sand, moonlit night, high tide and the cool nightly sea breeze. The water was fresh and sparkling right until the moment I lost my phone.

So starting with starting to write a web application in Perl. I’ll be using Linux obviously so all you Windows lovers are on your own. Open your terminals and fire off:

code-ninja@GeniuSisMe:~/Projects$ catalyst.pl MyApp

This will dump a long output which will result into a directory being made in your PWD (mine is Projects) by the name “MyApp”. When you change into the MyApp directory, you’ll see that there are some sub-directories and some Perl scripts. The “lib” directory will contain your code, the “root” directory has all the HTML code, the “script” directory has generated scripts to help you test and develop your application.

MVC is an acronym for Model View Controller architecture. You can read about it on Wiki. Essentially, it is a paradigm which divides your projects into three modules namely Model, View and the Controller. Model is the database, View is what you see in the browser and Controller is the bond between View and the Model. Lets make a Catalyst Controller. Fire off:

code-ninja@GeniuSisMe:~/Projects/MyApp$ perl script/myapp_create.pl controller Complain

It will again dump some output which essentially will generate a template controller for you to play with. Open “MyApp/lib/Controller/Complain.pm” in your favorite text editor. You’ll see just one sub-routine (“index”):

sub index :Path :Args(0) {
    my ( $self, $c ) = @_;

    $c->response->body('Matched Complain::Controller::Complain in Complain.');
}

This is supposed to be programmed by the developer. You can add more complex routines and stuff you want to do with the data.

But no! I will not give up! It was just a phone I lost! For a brief moment, I ate like a fucking pig and worked out at the gym. Went out and got fucked up without having any fucking idea about my miserable and depleting funds

“Lets go out and eat!” said Dang. I acceded. The Baghdadi restaurant in South Mumbai is awesome. Order a Chicken Curry and the guys will serve you with a whole chicken floating in a decadent curry. Whole… full, not cut. One big fucking piece of the meat you love to devour. “Lets go to Malabar hills and smoke up!” said Sammy. So we went to Malabar hills and smoked up. Came back… there is only 100 bucks in my account and there are 2 full weeks before I get my salary and I live in Mumbai. Fuck.

And so started the miserable week of utter penury. No food, no outing, no beer and only weed. No fucking idea about how I’d manage the 2 weeks, I give up eating like a fucking pig and working out at the gym. I give up taking a bus to work and started walking 3kms to reach my office. No money means no food during lunch time… not even a freakin’ banana.

So lets see… Now that we know how to make a controller, we will see how to make a model and a view. We write a small SQL script to make a database. Note that I’m using the SQLite3 database and the commands I fire will be specific to it.

We make a table in our database which will store user’s complain amongst other things.

PRAGMA foreign_keys = ON;

CREATE TABLE complain (
    complainID INTEGER PRIMARY KEY,
    userName TEXT,
    userAddress TEXT,
    userContact TEXT,
    productSerial INTEGER,
    productType INTEGER,
    productMake TEXT,
    complain TEXT,
    status INTEGER -- 0: open, 1: processing, 2: closed
);
INSERT INTO complain VALUES(1, 'Code Ninja', 'Andheri', '98111111111', '0112358', 'Laptop', 'HP', 'Screen Crapped up!', 0);

save it under any name you want (I called it complain.sql). Then give it to your database engine so that it creates a table.

code-ninja@GeniuSisMe:~/Projects/Complain$ sqlite3 complain.db < complain.sql
code-ninja@GeniuSisMe:~/Projects/Complain$ sqlite3 complain.db
sqlite> select * from complain;
/* whatever output */

To enable the model, we say:

code-ninja@GeniuSisMe:~/Projects/Complain$ perl script/complain_create.pl model DB DBIC::Schema Complain::Schema create=static dbi:SQLite:complain.db on_connect_do="PRAGMA foreign_keys = ON"

Don’t worry about the complex commands, you don’t really need to know them. I know what each of the commands mean but it really doesn’t matter if you don’t. Now, if you look in the “lib” directory of your project, you can see a new sub-directory called Model. Open the Perl module you see inside it. It has a Perl representation of the data columns you just made in your SQL script.

The mess where I eat refused to give me any credits because I was already in debt to them for 20 freakin’ bucks. But I disabused this nice cigarette shop guy from not giving me credit and coaxed him for my constant supply of tetra-pack milkshake and cigarettes. So, no phone, no money, one milkshake and cigarettes to go through the day. Ripped my landlady off of 500 bucks (never to be returned) and some more out of my colleagues at work. They are too friendly and don’t expect things back… good for me.

Under such conditions, the grass was a luring distraction. When you are on junk, you have only one worry… scoring. When you are off it, you are suddenly obliged to give a fuck about all kinds of things. Got no money, got no girl… about human relationships that don’t really matter. So I gave in to my senses and rolled a joint and took a long fucking drag.

And that long fucking drag could not satiate my will of fucking myself up. Its never enough… you must go out and fuck everything all over again. You know you cannot afford it but you cannot also ignore the craving. To top it, the attachment, the feelings I had for the one girl I fell for became overwhelming… I missed her, way too much. So I get higher than usual and planned to go out (knowing that I haven’t got any money). Got on the wrong bus and I stepped out of it in the wrong way… against the direction of motion. Slipped and the road was thick with traffic as it was peak traffic hours. Saw death, right in front of me… a red double decker.

For the view, we will need a few more things. First we will need a view controller that will to and fro the data between Model and the HTML web page. Second, we will need a page template that will be rendered as an HTML page by the Catalyst engine. For the template, we will use the Template Toolkit along with jqDock and a bit of jQuery. To make a view controller, fire off:

code-ninja@GeniuSisMe:~/Projects/MyApp$ perl script/myapp_create.pl view TT TT

This will create Template Toolkit view that the Catalyst engine renders into a complete HTML page. It will also create another sub-directory under “lib” called “View”. You must follow that tutorial I linked above because I’m not writing a fucking tutorial. I’m just elucidating what all is there to make a small web application in Perl.

And in this situation, the quote “A friend in need is a friend indeed”, was tested. Found a gem :). Thanks to the guy that I was able to survive this state of penury without affecting all my debauchery. Now, I have got money… got a bonus from work (for my work with this application) and now…

“The truth is, I’m a bad person, but that’s gonna change. I’m gonna change. I’m cleaning up and moving on. Going straight and choosing life. I’m looking forward to it already. I’m going to be just like you. The job, the family, the fucking big television, the washing machine, the compact disc players and electrical tin openers, good health, low cholesterol, dental insurance, mortgage, starter home, leisure wear, luggage, three-piece suit, D.I.Y, game shows, junk food, children, walks in the park, good at golf, washing the car, choice of sweaters, family christmas, indexed pension, tax exemptions, clearing gutters, getting by, looking ahead, till the day you die!”

The code can be found here. I haven’t uploaded the SQL script I used but you can make it yourself. The README has everything you need to know about how to run the application.

Life: Echoes of Mirage

Standard

Stuck somewhere,
somewhere in the tide of time.

A time with which remains the ambition sometimes,
sometimes, most times,
times that slip, slip like sand, times that fly, fly like fog.
A fog that you chase, a chase that never ends,
ends that are desired every time.

End with a winning, ends of achievement,
achievement that costs, a cost that’s undefined.
Undefined questions and answers undefined,
answers sought for throughout life.

A life that is pacey, a brutal life,
a life that is cruel, a beautiful life.
A beauty it is, this journey of life,
life of a journey, journeys of life.

A journey that seeks some hand,
a hand that suits your kind of band.
A band with whom you tie some bonds,
bonds which tie you to the band.

Chaos, dilemma and confusion,
interment are some truths of life.
A life full of illusions,
illusions of a hidden truth.

Truth about acceptance,
realization, existence…
the truth of life.

LIFE… with some lies of life,
take whatever you can take from life
because,
life’s turn of taking can make any night, the last night

written by: A friend.

An idiot’s gudie to socialism

Standard

Hello everyone :). Well, since my last post, I have got 10 more follows. Behold the fields in which I grow my fucks, lay thine eyes upon it and thou shalt see it is barren (I like you guys even if I haven’t met you, you are awesome… thats my way of saying thank you 🙂 ). Anyways, today we will learn how to socialize and analyze an Allwinner A23 tablet.

That girl I really like… she says I should go out and socialize. I thought I should give it a try. So this Sunday, I FORTUITOUSLY, get out of my room and see a random guy coming downstairs from the room above. He has a cycle… lets try him.

Me: “Hey… hi. You live upstairs. Did you just move in?”

Him: “yea… you live downstairs?”

Me: *thinking to myself* obviously you moron. “Cool… do you mind if I hangout with you guys? I’m kinda new here and don’t have much friends and all…”

Him: *thinking to himself* what kind of a moron is he? “Oh yea! that’d be cool!”

So… I socialized! We hung out for a while, had a fag or two and then dinner. He is quite cool. He is a mechanical engineer and I have no idea how I know that he has been into 2 relationships.

So this new tablet I got at work. It runs on an Allwinner A23 SoC and Allwinner boasts that it is the most efficient SoC ever built for a tablet device. And their claim ain’t faulty. In the “quick boot mode”, it takes less than 3 seconds for the tablet to boot. The “high speed mode” is blissfully fast but the problem is, the tablet is not recognized by ADB.

Luckily, the vendor managed to, somehow, install Debian LXDE into the NAND partition and we can select to boot Debian in the “Backup and reset” option under Android settings. Thats 1337! I wish I could do that but since I cannot right now, we will try and see what all drivers and libs Debian loads. We will then hack the drivers (next post probably) and have a powerful fully dual booting tablet at our disposal.

Booting the tablet into Debian, the first hurdle: touchscreen doesn’t work. The USB OTG works and I’m able to interface a mouse and a keyboard. So I have a complete desktop system with a 7″ screen, MALI-400 GPU and a 1.8 GHz dual core SoC.

Me: “So what you do?”

Him: “I’m a mechanical engineer. I work in aviations.”

Me: *thinking to myself* another fucking engineer. “Cool… I’m a R&D Engineer. How long have you been in Mumbai?”

Him: *thinking to himself* another fucking engineer. “Two and a half months approx.”

… *Some more random talk.*

Lesson/analysis 1: You just talk random shit to people. If someone is very chirpy and enthusiastic to present their perspective of things, clearly the person has had a social life and knows how to put their point across.

Lesson/analysis 2: Talking random shit is not hard. Well, its not easy either. There is this destitute homeless woman who walks the street just outside our quarters. The way she is living is not logical. I don’t really need to prove how its not logical but the guy had to prove why it is logical.

Me: “Why would someone live like that?! Its not logical!”

Him: “Whats not logical in it?”

Me: “She doesn’t have any plans. She doesn’t know what she will wake up to tomorrow. If you live linearly, you’ll always know whats gonna happen tomorrow!”

Him: *thinking to himself* This guy is so full of himself… dumb fuck. “but thats the point! she doesn’t know whats gonna happen tomorrow and therefore she is happy! She lives in the moment and doesn’t have any sense of right or wrong.”

Me: *thinking to myself* what kind of a dumb fuck would think this way? “Is that so? You can do that?”

Him: “yea obviously!” *you dumb fuck*.

What I meant to say was, if you have 2 hands, 2 legs, a brain and all of them working properly, you are not allowed to be… beggarly. If you have nothing to wake up to every morning, if you have nothing to drive you everyday, whats the point of living?

So opening up the terminal and firing a few of my default favorites:

root@debian:/# lsmod
Module            Size            Used by
sunxi_keyboard    2753              0
mali            159916              0
lcd               6964              0
disp           1046693              3 mali, lcd
nand            245773              2
root@debian:/#

Cool, Debian uses the “sunxi_keyboard” driver for OTG support. It doesn’t load a touchscreen driver. Although it ships with 2 pre-compiled modules (FT5x and GSLX680), the drivers are not loaded on boot (even after mod’ing /etc/modules). Conclusion, the touchscreen is NOT a Focal Tech or GSLX. Next wi-fi.

root@debian:/#lshw
bash: lshw: command not found
root@debian:/#lspci
bash: lspci: command not found

Fuck! But reading /var/log/messages, Linux does configure RTL8723BS wi-fi driver. `lsmod’ does not show it though. So lets mod /etc/modules… bingo! The driver loaded! But I need wi-fi tools (iwconfig and family). Since I cannot chroot into the tablet I’m at losfer words!

Lets see what else… reading /var/log/messages more closely, this is Debian Linaro 14.x or something (Linux Debian kernel 3.4.39). I even got the u-boot.

Me: “well yeah, you are not immature but there is some adolescence in you.”

Him: “I’m adolescent?! Tell me more!” *dude, you are the first shit who said that.*

Well… the guy rides to work on his cycle. I’m thinking of doing the same… its the best option. No fuel and traveling expenditure. But if the first thing that came to your mind was “I’m saving the environment by using a bicycle!” you are NOT immature, you are adolescent! Immaturity would have been like when one does not know how to listen to others.

Lesson/analysis 3: act normal. The person you are talking is another human being. Just like you are. They go to work, they have ideologies and principles that are NOT in sync with yours, they have had their share of troubles and you are not the only fuck in the world who has suffered!

Lesson/analysis 4: after reading this… don’t try and make an opinion of anyone. Its an exercise in vain. Your perception of a person maybe totally wrong or maybe so correct that it may hurt you and/or the person. Or even the person may not be at all what you analyzed. That would suck cuz then you’d have to question your ability of analysis!

I have written 1051 words. Fuck… that too on how to socialize. Geez…

May the force be with you,

Ninja.

A day in monotony

Standard

Hi again :). Its been a while since I wrote anything (yet again) but I was busy trying to be busy. Keeping yourself occupied when you really are anti-social and isolated (and loving it) is hard work. You have to force your mind to NOT to focus on the things that you lack or have a longing for. For instance, you earn enough to satiate all your whims but you are reticent because its not worth spending the money on it. No, not because you are a miser, but because you don’t have anyone to share the joy with. Sigh… am I not such an emotional fuck?!

Why am I isolated or why I prefer to be isolated is very simple indeed. I like it. I like the fact that my thoughts and my actions are not molded according to a group of individuals. I like the fact that I’m the master of what I say or do. I like the fact that if I screw up something, I have only myself to blame and if I achieve something, I have only myself to praise. I have only myself to hate and I have only myself to love. No complications because there are no variables in my life. And no, I’m not self-obsessed.

And although I like it, the monotony does get over the head. It does become boring being with yourself every freakin’ microsecond that passes by. Since I have no variables around me, it gets miserably monotonous. Get up in the morning, go to work, come back, go for a jog, eat and sleep. Nothing more, nothing less. On weekends, the only thing that changes is that I do not go to work. I go out and get lost in the urban jungle. It is the best part… and if you do fortuitously see me talking to myself with earphones on never giving a fuck about people around me, don’t worry, I’m getting expert advice about life. :D.

Its just, I’m irritated… I like my own company more than anyone else’s but there is nothing to do right now. Things are slow at work and there is no new development on the personal end either. The girl I wrote about is far away and frankly fading away. She was something good but I guess I must let her go now. Not because I want to, but because she is gorgeous and will get better options. At work, the R&D has come to a standstill, I fucked up the hardware. Fuck. At least that was something to look forward to daily!

Hmm… I just wanted to rant about something. I woke up today fed up (already and that too after having a good weekend) with the monotony. I’m working on updating the Linux Kernel Module Programming Guide to reflect changes in the kernel version 3.x. But its getting drier by the minute because I really don’t have anyone to discuss things with. I have the Internet Relay Chat but a real human is better than chatting with a person sitting at some other corner of the world.

The last few months were extremely happening. I got a new job, I made a friend (the girl I wrote the blog for), I switched to a new city and I had shit loads of research to do… happiness in short. Right now, I have a job (its no longer new), I lost her, research has reached a roadblock and I really don’t feel like exploring much because… well, I don’t get time. At least I have my poison to go through the night. I lost my music collection and with it died all the humanity. I have my guitar but due to lack of skills/knowledge that too is getting boring. Haaa… I know things will look up soon. I have much patience.

Sionara my good folks (lol… “good”.)

Ninja.