Sunday, April 25, 2010

reconfigurable chess game

ie: say "board dimensions are now x by y, knights now move the following way, there's now 3 knights (placed at the following spots), and no more rooks"

and then play a game

Thursday, April 22, 2010

back to the object-code thinger

once you read code into a compiler as an abstract syntax tree with a symbol table, it's in a really neat state. It's independent of language semantics or syntax. (or, it can be)

ideas for what to do with it in that state:

code style converter (for example, braces and indentation)

code generator (convert your C to python, your python to java, etc.)

diagram generator (spit out meaningful diagrams of the structure of the code)


more and more I'm thinking this is the utility I want. I wonder if this is pretty much what something like Doxygen is capable of.

Wednesday, April 14, 2010

twofer

zoomable document editor thing

music: all the instruments of today utilized in full force as a descriptive measure of the wonders of the earth

much as gershwin did a city, and prokofiev did peter and the wolf, we could have several things! A city album, a countryside album, a mountain album, a train album, an ocean album, a small town album, a farm album, a castle album - just, music inspired by these things.

Especially a city; gershwin had a good idea there.

Wednesday, December 23, 2009

Not my idea but it's good to remember

If you have a text editor, you should be able to do a search/replace only within a selected piece of text.

Thanks, Hoyle.

Tuesday, November 17, 2009

A Hard Problem

Probably not a "very hard" problem.

I've put in a bit of thought about the code style switcher - drawn some diagrams and such. The thing which is irking me at the moment is style switches in a revision controlled system.

Inevitably, there are going to be conflicts. Lots of conflicts. You can do nice things like make whitespace not count, but the different styles mentioned earlier don't all become erased in an "all whitespace is the same" world.

So... either you would need better diffing tools, a different means of describing the formatting of code-data, or a revision system that doesn't handle conflicts the same way

the other option is to have everyone "throw away" their repositories overnight, while the code is refactored to a different style, then they all come back and check out new copies. This could work, but it's not really feasible. Just think about how much code Googlers and Microserfs would have to check out, working on Office or Google Docs. Just think about how many little things they'd have going on as personal branches, all the half-finished code. Things that would have to be meticulously gone over and backed up, or lost. This option is nigh impossible for other reasons.

So, better diffing tools, a different means of describing the formatting of code-data (maybe partially compiled semi-object files, which your editor interprets? Oooh let's zoom in on that.

You could build a symbol tree and go through a large glomp of the compilation process but pull in a ton of data about the code itself, and then store those partially-compiled files. Then in your editor, you have specific stylesets which get applied to the code, and you pull the code out of the object file by interpreting it. You want to change styles? Just change styles and click. The program does the best-compile-possible (either takes the old object file and uses that, or compiles yours, or compiles as much of yours as is compilable and leaves chunks out) and then reinterprets the code outward. Oh that's fancy.

I'm taking compilers next semester; this is my new Awesome.

Wednesday, November 4, 2009

code style switcher

It can't be hard to write a linter that will go through code and make

if(){
}


into

if()
{
}


or (this is messy, I don't want to fight with blogspot's syntax today, I'm sure you get it)

if()
{
}


and all combinatorial groupings therein

well, maybe it can be hard, but I'm going to do it. I'm sick of reading people's code that doesn't agree to preconformed styles, and it shouldn't be a human's job to fix it.

Also, control over what styles for while, switch, if, methods, classes, would be useful.

Probably exists.


OOOH and convert spaces to tabs or vice versa, with control of how many spaces a tabstop is!

generally it just prettifies your code! I'm sure this exists. But it would be so fun to make! #isgoingtodoitanyway

Monday, November 2, 2009

bash on windows update

I looked into it this morning, and many people have tried this out. I went with the last of those three links, because it spoke of Unix Utilities and it was just a "download, extract, set PATH" sort of install process, which is one I grok.

Unfortunately, it didn't exactly pan out. I posted at TechSutram's blog (where I got the instructions from):

I just followed these instructions - I'm quite happy to have some additional unix utils on my command line (cat, less, rm) - but I could not get bash itself to work.

It will run fine, but reports "bash: warning: could not find /tmp, please create!" - I tried creating a "tmp" within C:\Users\myusername (where I set my HOME environment to), and also within C:\bash, but this did not stop the error.

Not so bad though, right? Just a warning. Well, actually it's worse: immediately after opening bash, a command like "ls" will display files in the good old fashioned style, then dump this to me: "[sig] C:\bash\bash.exe 1000 (0) call_handler: couldn't get context of main thread, error 998", and hang. After a CTRL+C, you end up with "[sig] bash 1000 (28) call_handler: couldn't get context of main thread, error 998", and now the terminal is entirely nonresponsive.

I'm running 64-bit Win7 Ultimate on an Intel Core2, about 4gb of ram and the rest is unimportant. I'm guessing this is a 64-bit issue or just a "Win7 is different" issue, which is causing some DLL call to fail or return differently and muck things up.
And I'm happy with the situation to some extent. I've now got the ability to string some bashfu together on my command line, and I'm closer to having UNIX available on this crazy Windows stuff, but I'm not quite there.

I'll keep looking, and if I find something that's not 2+ years old or broken, I'll report back.