Archive for the ‘CS’ Category

Someday…

Monday, April 30th, 2007

Someday, I am going to stop printing out solutions for any of the CO programs I write, the print out will be fairly simple:

“Solution Verified”
or
“Failed to Verify Solution”

I like results, I like the creative process, but results make me happy. The way there, fun as it is, is often filled with anxiety. It is a lot like being in a mode of transportation for a while.

Ze Panda

Freeing stuff, 64-bits

Monday, March 5th, 2007

Being not completely sure about freeing large chunks of memory successfully sucks, oh well. Also need to find ways of finding better lower bounds on my graph coloring algorithms, the current one gives a maximal lower bound of something like number of colors + 2, and hence without the greedy adjustment to the upper bound, it goes on to explore too much of the tree, not that it isn’t exploring too much of the trees already. I am not completely sure why I am doing this Combinatorial Optimization class, it makes me happy, but also keeps me up and such, much like 167/9 except it is so much earlier in the semester. Also it would be nice if this supposedly 64-bit machine supported more 64-bitness.

HTA application open today, and course numbers change in a bit, and I am not sure whether I should apply to be a HTA, or what I am taking next semester. The one GRE I am not sure about how to prepare for is a month and a half away, spring break is four weeks away, the summer is a little less than three months away, and senior year is 6 months away. With all the people I know who got into fancy grad school’s this year, I am not sure whether I should be celebrating the apparent fact that grad school’s do indeed accept people, or cowering in fright, apprehensive about being the only person not getting into everything. Oh well, back to work.

Ze Panda

Watch This

Friday, February 16th, 2007

Watch this, it is amusing, despite obvious similarities to lives of too many people in any cs departments.

Ze Panda

PS: I am surprise NVidia let me into there CUDA pre-release program
PPS: Documentation on ATI shaders, especially things related to how to build them on Macs is fairly limited, this seems to be a recurring theme.

A little knowledge can be dangerous

Monday, February 12th, 2007

Living in a world full of NP-complete problems with polynomial time approximation makes it so much harder to appreciate stories such as this. Well fine so there is the remote possibility that someday I might own a 80-processor beast, on the other hand, I am not going any faster on my DP solution to the knapsack problem using one of those beasts, though I guess it will help with other approaches. There is also little chance that we’ll be producing much better approximates to problems involving better estimates for what to probe while attempting to solve certain optimization problems. On the other hand I could use the 80 cores to run really fast ray tracing, or test lots of hypothesis simultaneously. Maybe brute forcing stuff on n-cores is the future, and even that does not give a theoretically pretty solution. Well, there is a non-zero probability that someone announces a viable quantum computer tomorrow, and then I can weep about buying this dual-core beast this year.

Also for those who didn’t know, folks over at Skype have an API available. The API for OS X (Cocoa and/or Carbon, the AppleScript API as it exists now does not give return values and is hence useless for a lot of things, though I can see cool tricks with using Address Book and such) currently relies on passing space separated strings back and forth, sort of like most RFCs produced before the dawn of the XML era. The API seems cool, but is designed mostly for USB and other Skype supported devices, but seeing as said devices seem expensive (at least the nicer ones), and seeing as Skype until recently offered $7/year anywhere in the US calling, I think this is one of those cool things you can use to send music, text read by text to speech stff, and other things over phone lines. Think of all the fun you could have with calling up friends over an unrecognizable phone number and scaring them, think of all the computer generated voices, think of all the hours of fun that can be had. Now if only someone would document Core Audio better :)

Ze Panda
PS: Anyone tried one of those 4 core beasts, anyone want to complain about having less than a 20th of the power you could have had, had you bought out Intel.
PPS: I do know a bit about the Skype API for OSX, garnered from staring at their sample code, and reading their header files. I however know nothing about the Windows API, if someone wants to buy me a copy of Vista (Brown does not provide us with free copies yet), and VMWare keeps the Fusion Beta program alive for a little longer, I might consider exploring the API for Windows. On the other hand, you could just do this yourself.

Type Kung-Fu

Friday, February 9th, 2007

Type safety, or more simply put, the reason ML use leads to fewer errors than C, is cool. Yes I know C is cool, and close to assembly and all of that good stuff, I probably wrote as many, if not more lines of C code than the next person over the course of the last year, I like systems programming and all that fine stuff, and I spent most of last night (let us just say from about 7 pm to 6 am) staring at C code, and I know that some, who’s kung fu is significantly older than mine, created this entire operating system by flipping bits, and while hacking through raw stuff is fun and all, strong typing, or compilers which give intelligent warnings by default (rather than weird void* to pointer cast warnings) would be much appreciated. In general, type safety would be much appreciated, see piece of code below, it would never have compiled in Ocaml, and would not have taken me and a friend seven and a half hours to hunt down, and hence would not have kept us up all night (it really did, I went to sleep at noon yesterday). What follows is a comparator for two structures, which contain cost, weight pairs, so that qsort can sort them in descending order. The problem is sorting is a part of getting data off a file, and is a fairly minor part of the algorithm (Branch and Bound for the knapsack problem). I guess even the most well done of algorithms can be thwarted by tiny errors, either ways, type safety is good.


int cmp_cwstruct(const cost_weight_struct * str1,  const cost_weight_struct *str2) {
    double cwt1 = (float)str1->cost / (float)str1->weight;
    double cwt2 = (float)str2->cost / (float)str2->weight;
    return cwt2-cwt1;
}

Ze Panda

Licensing

Tuesday, July 18th, 2006

This is my little rant about licensing, it is somewhat work related, but as before I am not breaking any rules here.

People of this world love GPL, much like the people of this world like RMS. GPL is good for somethings, there was a time when I actually used to put GPL notices on top of some of the code I wrote, however GPL also makes software hard to use in certain circumstances, and that sucks. If software’s about freedom, freedom should be afforded to everyone, even those who work for corporations which have traditionally not maintained too many free software practices. When RMS and GNU talk about freedom, they also, admirably, force everyone using their software to respect the same sort of freedom, something which is good, but well the idea of restricting freedom to people who also uphold those same freedoms seems a little weird in this context/it prevents me from excersising such freedom in this context.

This shall not happen again, copylefting has issues with a lot of things I had never thought about. I like the ability to use somethings without caring about licensing, especially if they are freely available. It would make me happy if people started using the New BSD, the MIT/X, LGPL, or any of the other freer licenses. I really don’t care that much about the politics and such behind licensing and open source software distribution, but seeing as GPL 3 is going to be more restrictive than the current version is, having people change to something less restrictive is in by best interest, for now, and for later.

Ze Panda

Observations, and Ramblings, sort of

Friday, July 7th, 2006

This isn’t officially breaking any of the things on the confidentiality agreement I signed for working at Bloomberg, LP, mostly because this is about things I have discovered which are fairly general, not really anything which is somehow proprietary to Bloomberg, LP. Some of these might have been learnt as a course of my work at Bloomberg, LP, but none of them are specific to the Bloomberg. This is going to be a list, so I don’t have to go through long pragraphs.

  1. The one of the more obvious ones which has been pointed out has been my lack of C++ skills. Well see, the way this worked out was, that when I tried learning C++, what existed of the language wasn’t very fun, things like templates weren’t commonly used, and namespaces were the subject of a future DDJ article. I have to admit that I have used a lot of weird flavors of C, but thanks to programming stuff on Linux, and other stuff, I am pretty used to using C on gcc, which is fairly similar to using ANSI C, and once you try to learn enough to pretend you are a language nazi, you sort of learn enough. C++ on the other hand never really appealed to me, it was much like Java, except not really, and I have never completely understood people’s love for object oriented programming. It is definitely useful for somethings, but it just doesn’t seem to represent much of a model of computation, and I am not that big a fan of it. That being said, there are definite advantages to it, for one all that the STL offers is sort of useful, you really don’t want to code all of it up when working on small projects. I am still iffy about using C++, I like C, I like Scheme, and I am not that sure about my relation with Object Oriented languages. Sure I can code in Java, and I am pretty good at it, it is merely a problem with finding that the ideas which it affords are used more often than they are often needed. That being said, I have warmed up to it over the last two years, and I would definitely like to see some of what the new features in C++ offer.
  2. sed and regular expression, sure I have read about them, I can read some and even write them down, they however are not things I am used to, and it takes me too long to use them. sed however seems useful, and well regular expressions are always sort of useful.
  3. C debugging tools, I am not really used to them, I can use gdb, there’s only so much I can do with it though.
  4. More vi, I have definitely warned up to gvim, and I remember more of the keyboard shortcuts than I ever have before, and this is useful. It is definitely better than emacs, though I’d still settle for a more modern editor which can do everything vi can.
  5. This is not a learning thing, but of late my feelings on the difference between pthreads, and Java threads is something to the order of Java threads being a lot more process like, they are lightweight, allow for easy communication, but aren’t exactly the same thing. pthreads on the other hand are a lot more thread like, the programming model forces you to imagine them as two execution threads through the same code segment, and they have their own peculiarities which are cute.
  6. Oh, this is historic, but back when I was still in school, if you did computers at school (it wasn’t computer science, the science was mostly non-existant), you needed to make these projects, which worked in certain ways, and needed to have certain things, graphics for instance, and you used these libraries including conio. Now the problem is outside of the Turbo line of things, and their derivatives (Boroland and such), you really didn’t see conio, and it was this strange library who’s functionality you never really saw anywhere else. In reality you shouldn’t need them, but there are these things which you could use them for, and then you find out about curses (something like an ncurses precursor) and realize that conio was nothing more than a less powerful curses. Darn.

Hmm that’s all I can remember, I will add to this slowly, perhaps.

Ze Panda

PS: I am warming up to some of Joel’s ramblings, I still don’t agree with a lot of his comments, but some of them are definitely true, and are somewhat fun.
PPS: Seeing as Fog Creek no longer accepts internship applications from internationals, I am not that worried about this going online.
PPPS: I wish Drunken Batman came back, and published something new.