Archive for June, 2008 Page 2 of 3



Bob the builder!

“Can we fix it?
Yes we can!”

They say you can divide all programmers into two categories. Those who rebuild their code every few lines, and those who write their code all day and then build, fixing syntax errors, and then running unit tests, and so on.

I’m trying to shift into the second category, firstly because it seems to be the sensible thing to do, and considering how long some compiles take (my average rebuild and link takes upwards of 300 seconds), doing it every few times can consume a lot of time. Moreover, there’s the time you get into “syntax fixing mode”, and maybe even debug later on, moreover, all the extremely experienced programmers seem to prefer the second and it helps their productivity.

Compiling

But to each his own, they say.

I for one have a huge fear of writing large modules or refactoring code where I go from one pseudo-working state to another and the build is broken from then on. But then again, getting myself to get started on any major patch is a lot of trouble for me, though it’s no biggie once you get into the mood. But the fear of broken builds is almost a phobia of sorts.

What would you feel is the best way to approach a large project, write code that grows in a very organized way writing unit tests along the way, or let your compiler sit in a corner while you churn out the next masterpiece? Or a personalized mixture of both?

Slave to the power of…

An extremely respected and well known blogger asked me to help build a tool which would perhaps be of good use to the blogger and web development community, which wouldn’t be too hard to build. But it got me thinking, nowadays a lot of services are out there which supposedly speed up or enhance the way we work with technology in the first place.

Someone once figured out that some websites have frequently updated content, which people visit, so instead of making the users visit the websites, it would be a much better idea if the content was bought to them. Thus the humble feed reader evolved.

But often, while a process is streamlined, people try to do more and more and more to “optimize” the system. Soon you see hundreds of articles to help you manage feed overload, hundreds of bookmarking tools, etc, etc, to help you read and connect to more and more articles.

But there’s only so much you can make more efficient. I don’t want this to go tangent into something that sounds like a “back in my day, we needed to climb three mountains just to read our email” story, but tell me, how many times have you found yourself clicking the “next” button or key again and again, barely reading any stories, and only absorbing what catches your fancy. How is this so much better than the days when people checked a website once, and actually read everything.

I’m not trying to say that “all the internet is crap”, but there was one point when I felt very afraid that the Internet is making me impatient and restless with the need for that “new story, article or tool”, that it almost spilled into my regular life.

The internet is crazy about having everything in one place. It’s about convergence and collection, yes, and it’s the natural order of things, but I’ve found joy in newfound minimalism and disconnectivity.

But I can’t help shake the feeling that the myspace and youtube generation might really hurt humanity in the time to come.

Wouldn’t this be nice.

While many people resort to logging for efficient debugging, writing everything to stdout might not be the best thing, especially with cout.

In my perfect world, I’d love to do this:


using namespace std;
#define __DEBUG
#ifdef __DEBUG
#define LOGME cout
#else
#define LOGME //
#endif

int main()  {
  LOGME << "Hello world";
}

But sadly, comment marks are excluded from preprocessors.

Here’s my winner of…

The best firefox extension in the known universe

It may not help you organize your ridiculously useless content or share it with your equally ridiculously useless social community, but it will help you use the mouse less, and save you from repetitive strain injury in the long term.

It takes a while to learn, but you can’t go back.

One of the best ideas I’ve had so far

If you’re into programming, I’d suggest you read this.

As a developer I’d love if I can write code that anybody can run, on their desktop (as opposed to trying to move it on to a browser so it can be truly cross platform), but let’s just stay away from the operating system in the browser paradigm. Let’s say I want to build an application which would run on windows, mac osx, and linux (and perhaps even bsd, etc). There are three major options I have

1. Write the code in java, and have it execute in a virtual machine. While java is nice, I’m not too fond of having my code run in a virtualized wrapper like format. Moreover, performance concerns, the Java Native Interface, etc do not make this the best choice for me.

2. Write code in a more simplified language like python, or ruby which has language bindings to major system so which allows me to run my code on most systems. This is nice, but there’s the performance concern, the obsfucation and moreover requiring the right version of python or ruby to be installed in the target machine.

3. Write code on C++ with the right cross platform libraries and compile. This is a confusing option because finding good cross platform libraries and learning to use all of them can be very complicated. But this does, however mean that my code will run natively, thus, much faster than the aforementioned options.

 

My idea deals mostly with number 3. I won’t beat around the bush and get to the point:

1. An easy to use suite of cross platform c++ tools, with open source wrappers to all of them, and are configurable to larger extents.

Here’s what this means. Suppose I needed to build an alarm clock, and wanted it to run natively on all platforms, I first write a “libcollection†file. This will be a list of all the libraries that I’ll be using for the project, and these are sort of dependencies. These might be gtk, wxwidgets, or qt for gui, opengl or SDL for graphics, openal or some other audio library for audio, one particular library for networking, etc, etc. These might also include other details as extra libraries, dlls, per-platform specification, etc.

ALSO, we will have native access to files, operating system, etc, through a vast object oriented library, who’s code will work on all object oriented systems.

The first benifit of this is that there’s a program that downloads the latest versions of all the libraries, and their dependencies, and create a project for an ide of your choice, ready to compile with any supported compiler.

Now the hassle of getting the right libraries is removed, which is only the beginning, as the best part, and an excruciatingly hard part is to write object oriented wrappers for all of these. So for example if I have:

(note this is just a concept and not anyway related to the final code)

File music_file(“asastor.mp3â€); // FILE: is a wrapper class

Audio_Decoder decoder(music_file); // An audio decoder

Audio_Output output; // to output audio

decoder.play_with(output); // set the output module.

decoder.playfrom(“1:00â€) //play from 1 minute timestamp

 

Now, you say, sure, there are libraries that can do things like this, even if you present an oversimplified audio, graphics, networking and filesystem interface, there are ways to do this, but the best caveat will be this:

Suppose you are writing code for linux. You’ve set your gui engine to gtk. So instead of writing code for gtk, you write it like this:

Window new(“My windowâ€);

Button click_me(“Click Me!â€);

new.Attach(click_me);

Now suppose some code like this would attach a button to a window. While porting code from gtk to another gui engine like qt is painful, it’ll be as simple as setting a simple variable in your library collection file. Of course, the functionality will be lesser than all libraries, as certain features are there in qt that’s not there in gtk but while we cannot hack our way to replicate features, we’ll have to allow ability to add features directly from the libraries themselves.

 

This would enable to write code once, and have it run almost flawlessly anywhere. Taking what we already know about building good cross platform libraries, and the great many advancements in compiler and build tools, and the power to run an application natively using the blistering fast power of computers, rather than running it on top of some other layer. Moreover, with so many open source libraries with some really cool stuff from computer vision, to artificial intelligence, etc, allowing developers to easily install and use these libraries would be a great first step before encapsulating them classes.

If compelling enough reason exists to build this and enough support, I plan to build this over the next few years.

Get over it people, it’s a sodding browser

More feeds were axed from my reading list, everyone going on and on about firefox 3 and being downloaded, blah blah blah.

So a bunch of very well paid developers(do you know how much money they make every time you use the search bar in the side) fix a few memory leaks, upgrade to a third party rendering engine, move buttons around and add a different location bar.

More importantly, the same fucking thing has been around and has been the same since betal, rc1, and so on. We’ve all been sefing it, and please face it, it’s a frickin’ browser, not your love child.

I don’t care if you can install plugins to nurse fractures and boners, but at the end, it shows me webpages, and has been doing a pretty decent job at that for the past four years.

So please, do the world a favour and don’t reiterate the same old bullshit about firefox extensions people will die without, top ‘n’ lists, more tips on how to make the green buttons blue, and waste everyone’s time and bandwidth on it.

Yes, you can go on in the comment fields downstairs about how my rant is undeserved. Go ahead, write “firefox is teh (somthing)”, and automatically certify yourself an idiot.

But remember this: firefox is a piece of software, not without it’s flaws(gecko really isn’t the best renderer out there), it’s horribly documented as far as the developer docs are concerned, it still bloats up after ten tabs.
//…snip

[update]: I went for breakfast. I realized I’ve been getting cranky. Nights of debugging javascript can do that to you I guess.

I think I’ll let the ranting stay, but try and turn it more into a Zero punctuation style of ranting.

Anticipation is everything

Over the past few years, I haven’t felt what it’s like for waiting for something to come out. Either I’d get something when I could, or it’d already be there when I wanted it. Sure I’ve waited for certain software releases, but with the advent of svn(and the liberty to compile your own software), and frequent release cycles, even that faded.

Now, I’m all tingled up in anticipation for Amon Amarth’s yet-unnamed album. This metal group from sweden rose up from humble origins to become one of the top metal acts in Europe, and the world today, and they do it with brilliant innovation, again and again. There’s no stopping these vikings whatsoever.

Their last album, “With Oden on our Sideâ€, was perhaps some of the best music I’ve ever heard in my life. Lyrics from the title song, “And with Oden on our side, we are victorious!†appears on my website’s subtitle. It’s infused with norse mythology, and speaks of the gods on our sides, when we go out to war. In that aspect, everyday is a war for everyone, and nothing beats the feeling of having Oden on your side.

I’m currently listening to “Fate of Nornsâ€, released in 2004. It has some amazing songs, including the brilliant riff of “An ancient sign of coming stormâ€, and of course “The pursuit of vikingsâ€

“Versus the worldâ€, their 2002 album is in my opinion, their second best. “Death in fire†is perhaps the best song to open with for any album. I love all the songs from the other albums, particularly “Friends of the suncrossâ€, which is really not what the name sounds like.

So anyways, they’ve got their new album coming out, and they say it’ll be great, and I have enough reason to trust these lovely people. They’re incredibly talented, creative, hard working and really take Viking and Norse mythology seriously. The album is still-untitled, and I can’t wait for it.

So here’s some well deserved advertising:

image

The last time I waited for an album was Linkin Park’s Meteora, of which’s release date coincided with the ending of my Class 10 Examination. Can’t say I’m proud, but what the hell! I’ve been waiting impatiently for six years to wait impatiently again.

Hopeful new oneclick launch tonight

I’ve started making a roadmap to help launch the new version of oneclick, re-written by White Shadow/Janis Elts tonight. It’ll be going mainstream this week, as I’m buying ad space on a few blogs(and a few offered to do it for free), and will also launch the new extension with better, firefox 3 compatibility.

 

If you want to test/translate, please check the next post in a few hours.

debugging stl with gdb

I was trying to write a simple program for this problem:
Hashit at spoj.pl on code::blocks on a windows system using mingw compiler. Building a hash map was easy enough, though I hadn’t written one before, but when I had an vector > object, that became almost impossible to debug.

I remember using gdb to debug applications on linux at work, and that is useful enough, I don’t know why I’m not able to see why I can’t read the data in my vectors. Oh well, cout to the rescue.

Anyone know a good way to debug stl with gdb, and since I’m on windows the commandline version is just painful.

Blog this.

I am extremely jealous of professional bloggers. I honestly tried making a living from writing everyday about random greasemonkey scripts and firefox extensions, and calling it news and tips. It involves a lot of patience, creativity, and one hell of an internet connection.

But still, being a smelly, impatient engineer, all I can do is analyze. From my humble rss reader, I did a quick study, and sorted items into categories. News feeds, aggregators(like digg and reddit), etc are not supported. These are only blogs, by relatively famous people I don’t know personally.

Tech news:
Apart from the apple flavoured shit that’s been floating around nowadays(see below category), this includes stuff like “shitty little webapp that helps you preserve and categorize your skidmarks now supports regular stains”
And yes, all of them have a [via] or a [source] at the end

iphone biyatch:
The kind of interest most males develop when they see a “spot” after it, apple fan’s develop when they see a “3″ before it. It’s also a coloquial name for a coloquial name for marijuana. If you know what I’m talking about, you’re too smart to be reading this.

Actually interesting:
People who make ocasional posts(remember this point, it’ll come in later), usually on a single topic on which they have real expertise in. (ex: robert’s talk)

Top n’ lists: This deserves trashing in a seperate post of it’s own, and it’s coming soon.

More webapps: This too deserves an exclusive post of it’s own.

Read this story: Links to one of the above.

“Tech tips”: How to make twitter create facebook accounts for all your skidmarks, add them to your friendfeed, and automatically digg them and upload videos of them so the whole world can see it.

bullshit

Now I know I’m pissing a lot of people off with this, but here are few things you have to consider.

There’s far lesser interesting stuff on the internet than there is demand for. While yes, a new interesting piece of software is out, or there’s some news story, there’s a surprising amount of shit out there. The pressure on big blogs to update regularly. Any blogger worth his salt knows that it’s the frequency of posting that matters a lot. And it’s hard for small teams of individual to keep adding original content, thus they end up just linking and writing about new things they find online. There’s really no expertise when it comes to the “internet”. I don’t want to sound like a douche when I say this, but spend less time randomly surfing and a bit more time learning. the internet is largely shit and when you really need something you’ll find it. And nobody cares two hoots if you know about and blog about every damn greasemonkey script out there, but everyone cares about you if you can write one. The best blogs are the ones written by individuals who’s life isn’t on the line, so they can write about what they like and not so regularly.

And if you feel like disagreeing with what I said, please point me to a weblog on the comments which has 1 post/author/day (minimum) and, out of the last twenty posts, eight should be useful, original and creative.







You are viewing a mobilized version of this site...
View original page here

How do you rate mobile version of this page?

Mobilized by Mowser Mowser