More...

The worst trait of a pessimist is his profound belief of him being a realist.

Category: Programming


Guess the render

Thanks to the second incarnation of the raytracing course in the Uni, I'm having the rare opportunity to experience how it feels to rewrite a modestly-sized (7k sloc) project from scratch. Sounds familiar? Raise your hand, if you, at some point, did have the burning desire to scrap the whole ungodly mess you're currently working on, and restart from Square One. Doing it right™, this time.

Yes, I know. Probably some of you even did that.

Well, it's a known fact, that this could be the worst strategic mistake for any bigger project.
For smaller stuff, it's quite okay though. I feel that we got the sample raytracer a lot better this time. Today, I even decided to compare the global illumination results (with path tracing) against V-Ray (the scene is courtesy of Kevin Beasons's smallpt).

Image
Image

LGTM :)
This even poses an opportunity for a small challenge. Can you guess the renderer? V-Ray on top, or the bottom?

Browsing around SmallPT, I stumbled upon something of interest, which made me acknowledge (again) how cool 3D graphics programming could be.

For comparison, imagine you're writing FS stuff. And you've got a bug. What follows next is a kernel panic, reboot, and keeping your fingers crossed that the test partition is not completely invalid, so you can spare the reformat. Oh, and you still have a bug to fix.

Or, you could be writing some web software, and you've got a bug. Three months later, someone figured out how to exploit it, made your site blinking pink, tens of hours of human input are lost, etc. Oh, and you still have a bug to fix.

Or, you could be writing 3D graphics stuff - just went on optimizing some rendering code, which renders the images above. And you've got a bug (you should have seen the trend by now). And the bug manifests itself into this:

Image

:)
The best part is - you can even publish it as is, bugs included.

What else: I'm up for finishing the latest major version of AGG, 0.3.0. After that, I'm going to delve into ucbench and add OpenCL support (which, sadly, this implies a lot of website-related stuff, too).


Posted in category Programming -- clock 7 Jan 2012, 02:20, 0 comments


thought

C

A wise guy once said, „Assembly language programming is an extravagant waste of human talent and should be avoided whenever possible“.

While the previous week I was playing around with SimNow, ucbench and assembly language for x86, this weekend (partly as a tribute to the recently deceased master, Dennis Ritchie (R.I.P., dmr!)), I went for a higher-level language on a lower-level CPU: C for PIC.
That Peter Norton quote on the top is soooooo true¹, applied to my last PIC project; it is partly finished, but there's still a lot of not-very-hard-but-obtrusively-massive code left to be written. Thus, the mentioned waste comes easily to mind, and the temptation to avoid it is very hard to resist. So, to start clean, I went from scratch, on a new (but easier) project, new breadbord and all. I'm using Hi-tech's C compiler, and this is the first test program that I wrote:

Image
Click (h.264 format - opens fine VLC)
.

Whether the ways of C could be successfully applied to the "big" project is left to be checked - as even the tiny program on the video utilizes some 10% of the code memory, and also around 10% of the data, too. Yet, there's hope - I wasn't sure I'd have the mental persistence to write that amount of assembly :)

There was a fun moment with the electronics I bought: I needed a good 3.3V low-dropout regulator, and, after some research, I settled on the MCP1703. I bought it along with some other parts, but haven't checked the purchases until I got home. I didn't see the regulator in the bag at first, and thought they must have forgotten to put it. Then... I saw it... It's just unreal: I was expecting something like this, while it turned out like that instead (see the arrow)... You should have seen what's it like to solder pins to that thing! Having completed this feat, I bet I could now solder wires to a grain of sand, too... :)


--------
¹ even though that smart ass didn't write even a single line of anything, except assembly, for the first few versions of Norton Commander :)


Posted in category Programming -- clock 24 Oct 2011, 03:08, 3 comments


thought

Random ramblings

Some miscellany, non-serious stuff around programming that recently occurred to me:

First, I got the impression that working as a law maker (or, more accurately, a law maintainer) is not much different than working as a programmer. Both the programmer and the lawmaker have to be very explicit and unambiguous; they are working on laws (directories), consisting of parts (files), filled with articles (classes), constituting of paragraphs (methods). Everything is in strict order. Changes to these laws come (at least in my country) through a state-issued paperwork (called the State Gazette in my case), which explains that law AAA, Part BBB, Article CCC, paragraph DDD, which formerly stated XXX, should now read YYY. Just a plain diff, that is.

So, in spirit of this comparison, here I demand: when will the Bulgarian lawmakers finally put up a Subversion access to all of the Laws, and stop applying patches through the State Gazette? This is so 20th-century...

Anyways, what else... I was pondering through some Linux kernel sources recently, more precisely within intel.c and amd.c... and got just truly convinced that there is nothing hardware-y in these processors anymore. They are full of bugs! So, did you actually think that your $150 you prepared for the shiny-new quadcore CPU pays for the silicium/hafnium in the crystal, or for the gold in the pins (for those of us who actually got pins; Intel owners are exempt from this)? Think again...

And I did some fun coding for valgrind, out of a necessity at work. I'm really glad when I can purposefully use work time to help open source projects like this. I love my job :p


Posted in category Programming -- clock 6 Dec 2010, 02:25, 0 comments


thought

New year's eve


Last moments before the new year. Everyone is gathered around the table, in front of the telly, listening to the wise (hm?) speech of the President. Glasses of champagne in the hand, and some are already slightly drunk...

... but not me. I'm in front of he desktop, the broadband is up and running, but I'm also hooked up through an old 33.6 modem to another ISP. Redundancy, you know? You are never sure, one of the ISPs might freeze up in the worst moment, right? The rest is obvious. Firefox. I'm hitting the Refresh button every five seconds...

The website? Nothing special, C++, Stroustrup, that sort of boring stuff...

Time is ticking away.

*REFRESH*









*REFRESH*









*REFRESH*




... the last seconds they can still publish C++0x in...


Posted in category Programming -- clock 13 Jan 2010, 01:28, 0 comments

Language:

bgБългарски
enEnglish


Categories:

Meta
Hardware
Technology
Fun
Open source
Interesting
Hiking/Trips
Stuff
Programming
Music
Images
Photography
All


Archive:

+ 2008 (9)
March '08 (2)
April '08 (2)
May '08 (2)
October '08 (1)
December '08 (2)
+ 2009 (8)
January '09 (2)
March '09 (1)
August '09 (2)
September '09 (1)
November '09 (1)
December '09 (1)
+ 2010 (9)
January '10 (1)
April '10 (2)
June '10 (1)
July '10 (1)
September '10 (1)
November '10 (1)
December '10 (2)
+ 2011 (10)
January '11 (3)
February '11 (1)
August '11 (2)
September '11 (2)
October '11 (2)
+ 2012 (14)
January '12 (3)
March '12 (1)
April '12 (2)
May '12 (3)
August '12 (1)
September '12 (1)
November '12 (1)
December '12 (2)
+ 2013 (1)
March '13 (1)
+ 2014 (3)
September '14 (3)
+ 2015 (5)
January '15 (1)
March '15 (3)
May '15 (1)
+ 2016 (4)
June '16 (1)
July '16 (1)
November '16 (1)
December '16 (1)


Last comments:

30 Mar 2017, 13:59 by antfarmer
26 Dec 2016, 17:52 by Private
19 Dec 2016, 23:01 by ицаци
16 Dec 2016, 19:50 by Антон
8 Dec 2016, 01:23 by anrieff
8 Dec 2016, 01:06 by Николай


Valid XHTML 1.0 Strict

Blogroll:

linkJoel on Software
linkRidiculous Fish
linkXKCD blag