tcepsa: (Cake)
Okay, I've managed to work out all of the major show-stoppers that I wrote about here and am moving on. That serial port not connecting problem? I had to give myself adequate permissions (or run PuTTY as root, hrm...) Not being able to compile? Apparently the latest version of avr-gcc doesn't support the straight-up Atmega328 anymore (or maybe that was never a real chip, or maybe it's fully compatible with the Atmega328p object file that one must now compile against). Fixed by telling it the compiler, "Heh, well, I know I said that I was using a 328, but what I meant was a 328p." (Yeah, super embarrassing. That compiler must think I'm a complete baka by now, considering the wacky stuff I keep asking it to do...)

Not able to use the native Arduino programming environment? Don't care! I have Emacs!
tcepsa: (Computation Suspended)
I have traveled the Woods. I gained entrance with a single coin. One side of the coin was Faith, the other was Frustration. I wandered down several dead-ends. I thrashed through thorny thickets. They tore my trousers, and left my ego bleeding. Many times I found myself at Despair's abode, in the deep shadows surrounded by dank and rotting leaves. I never tarried long; the glint of one of the few shafts of sunlight there would reflect off one side of the coin or the other and I would find myself backtracking once again, trying another path, gritting my teeth with determination to overcome the chaos or certainty that one of these paths must surely take me to the other side. This morning, almost a week after entering, I found a signpost that directed me back the way I had come. Frustration glinted as I thought about ignoring it and attempting to plow on, so I decided to follow its instruction; at least it wasn't pointing me deeper into the woods, and I was reasonably certain I could find my way back to it if needed. As I returned almost to where I started but coming from a different direction, I realized that the path had forked at that point and I had simply taken the route that seemed most direct. I may not have even consciously realized the other option existed, but upon closer examination it did seem promising. Faith flashed brightly as I stepped onto it, and a few hours later I found myself emerging from the Woods on the other side.

The moral of the story: Faith and Frustration can be a valuable combination.

(And now I know how to recover if a svn commit crashes halfway through).


Aug. 5th, 2008 05:14 am
tcepsa: (Computation Suspended)
Getting to bed 2 hours earlier than the last night-before-class-project-is-due.

And yes, I may have overdone this one slightly as well... but I now can detect words that:
1) consist solely of equal numbers of A's and B's
2) consist solely of a number of A's followed by an equal number of B's
3) consist solely of a number of A's followed by twice as many B's
4) consist of a group of A's, followed by a group of B's, the whole grouping of which is repeated a number of times
5) are palindromic and consist of capital letters
6) consist of a group of A's followed by an equal number of B's followed by a group of A's with one more A than the previous group, followed by a group of B's with one more B than the previous group, followed by a group of A's with one more A than the previous group, ad infinitum (i.e. until I overflow the stack ^_^)
tcepsa: (JuggleGeese)
It's kind of spooky that this actually makes sense to me:

A deterministic finite automaton is a structure

M = (Q, E, d, s, F) where

  • Q is a finite set, the states
  • E is a finite set, the input alphabet
  • d : Q X E -> Q is the transition function that maps each of the possible combinations of (state, input) pairs to a state.
  • s is a member of Q and known as the start state
  • F is a subset of Q and elements of F are known as accept or final states

(Kozen, Automata and Computability, Springer-Verlag New York, 1997)

I got shivers when I read the one about d : Q X E -> Q and understood it... being able to pull that kind of meaning out of such a small handful of symbols makes me more inclined than ever to try to learn more mathematical notation (and the fact that I get all tingly from reading it probably explains a bit about why I like regular expressions so much as well ^_^)
tcepsa: (PyrateSmirk)
If you do Lab 2 so thoroughly that you inadvertently meet the requirements for Lab 3, you unlock a secret Lab assignment!
tcepsa: (Computation Suspended)
Returning from a recursive function call is like dreaming that you've woken up.
tcepsa: (JuggleGeese)
I'm really not supposed to stay up this late on a school night... except dammit, I needed to get the assignment done!

Frakking memoization. The worst part was that my implementation of it was such that the "optimization" actually caused a significantly higher processing time. Stupid graphs and their stupid paths anyway...

But I'm a better programmer for it. Proof that I'm learning in this class: by the time that I wrote the double-nested for loops to ensure that I wasn't letting false positives through, I was starting to suspect that I'd be looking at at least O(n^2) for it. Given that those are happening _inside_ another double-nested set of for loops, that should push the whole time up to, oh, about O(n^4) if I remember right.

SO VERY MUCH LESS THAN IDEAL. Fortunately the memoization part was for extra credit anyway, and I should still be able to score that with a slightly fancier version of the paragraph I just wrote. "I may be taking the Edison approach, but I'm learning! Also, optimization isn't always!"

PS Why am I doing so much algorithm work in a data structures class? ~wry grin~

PPS (Yes I realize that the only good way to appreciate these things is to use them to facilitate the construction of spiffy fast algorithms. And I do. ^_^)
tcepsa: (iSquared)
The Awesome Bar
An establishment frequented by Firefox users. Tell the bartenders a couple of letters from the drink you want, and they'll review all the orders you've ever placed to try to guess what you'd like this time.
tcepsa: (TryScience!)
I think I'll be posting stuff from the Russia trip in fragments, since there's way too much to try to get down in sequential order and even then I always feel like I'm just reciting a list of Stuff That Happened (We did X. Then we did Y. The trees were beautiful. The wind was cold. They brusquely confiscated the bottle from him.) and I could do that, but I'd rather try to tell stories. In manageable chunks.

That having been said, The Tale of Babushka's Computer )
tcepsa: (Computation Suspended)
One by one the unit tests steal my sanity...
tcepsa: (Inconceivable!)
Actually, at this point it has been somewhere between one year and two since I encountered the programming concept of "closures". When I first encountered closures it was in the context of Javascript, and someone had told me that I should be careful with the toolkit that I was using at the time (Dojo 0.42) because it apparently used them and they have a propensity for causing memory leaks. I did a little bit of exploring but was unable to come up with a satisfactory explanation of what they were or why they would have this effect. The result was that I had a sort of nebulous impression that a closure was something that happened--not something that was--when a newly created object ended up with a reference to one or more of the local variables back in the method that called it.

That was pretty much my understanding--and I knew it couldn't be right but at the same time I was keeping an eye on my memory usage and it didn't seem to be getting gobbled up too quickly, nor did it seem that it was never being released. So at the same time it wasn't really a pressing enough issue for me to pursue it terribly deeply. Then, last Autumn, I went to the No Fluff Just Stuff consortium and learned of a language called Groovy. One of the things that makes it so powerful is that it has fairly extensive support for these closure thingies. I got a slightly refined understanding of closures (at least Groovy closures) during the conference and figured that maybe they had decided to use the word (which I still thought was more of a verb) to refer to these somewhat magical functions that could be passed around like variables and have properties like objects and retained references to the local variables that were in scope when they were created.

And now today, about four months later, I was reading the appendix to this article and came across a parenthetical statement that finally tied everything together: "In OO languages, you can, to a limited extent, simulate a closure (a function that refers to variables defined in enclosing scopes) [...]"

It's like there's this lightbulb in my brain that I screwed in back when I first heard the term, and it's been sort of glowing dimly off a trickle current this whole time, and when I read that finally it flared into brilliance! It's called a closure because, for all practical purposes, it's enclosed!! And therefore it can see all of their variables! And furthermore it can screw up garbage collection because it has a reference back to the enclosing object and garbage collection only happens on objects that aren't being referenced by anything that is, or is being referred to by, something on the stack! It doesn't actually screw up garbage collection--GC continues to do its job just the way it is supposed to--but it can trip you up, and that's what they were talking about when I first heard the term.

EUREKA!!! ^_^

(while my understanding may still be less than complete, it is a quantum leap better than it had been before reading that sentence ~grin~)
tcepsa: (I'll fix it!)
It turns out that Blender works pretty well as a 3D Graphing utility ~grin~
tcepsa: (Computation Suspended)
Anyone out there know whether there's a reasonably easy way to represent a tree of arbitrary depth in a database? There's nothing special about any given level of the tree, but there has to be a fairly straightforward way of retrieving the parent and (if present) children records of a given node. Siblings would be nice too, but aren't as important for what I'm thinking about (and worst case scenario, if I need them, siblings are all of the current node's parent's children that aren't the current node).

All of the shadows of ideas that I've come up with so far involve either one, two, or X tables (X being the number of levels in the tree, which makes my brain recoil in horror for daring to even think of it), and a bunch of semi--if not fully--recursive programming on the code side... I'm wondering if there's a way to set it up so that the database can handle it instead, but my SQL-fu is not that strong. Am I barking up an impossible tree, or is there a solution to this problem if I just throw my brain at it harder?

(For a concrete example of what this could be used for, think XML document storage. I make no claims as to the usefulness or efficacy of such an implementation; I merely wish to know about the feasibility.)

Required queries (since maybe this'll be a little more straightforward than the phrasing above):
Give me the record of the parent of this node ID.
Give me the records of the children of this node ID, if there are any.

Queries that would be nifty:
Give me the records of all the siblings of this node ID.
Give me the records of all the ancestors of this node ID [even more optional: to N generations away].
Give me the records of all the descendents of this node ID [even more optional: to N generations away].

[EDIT: Okay, I'm pretty sure two tables would work to provide the 'required' queries. One to hold the actual node records, and one to map parents to children. That doesn't address the problem of recursion on the 'queries that would be nifty' side of things, but that part may be intractable...]
tcepsa: (I'll fix it!)
I was at the Northern Virginia Software Symposium this weekend. Holy crap was it awesome. If Groovy can deliver on the things that were hinted at over the weekend... wow. But that's not what this post is about. This post it about a simple observation that I made while at the conference.

Every single presenter that I went to (with the possible exception of one that I forgot to check) used a Mac. And they did it REALLY WELL. As in "I'm going to give this full-fledged demonstration complete with code examples and slides and running the demo applications, and when I am done you will be able to count the number of times that I used the mouse on one hand." (Most of them were also running XP in a program that I believe was called Parallels, but that's a digression from this post). Combined that with the fact that it's now running on a Unix kernel, and there are applications like Quicksilver out there, and I am seriously considering going over to the Apple side. [Though almost certainly not completely...]

So I'm interested in learning more from those of you who have them, especially those of you who do development work on them, how you like them, what are the things you love about them, what are the things you hate (or would prefer were different)? What things do you wish they had?

And what things would you say that I, as a relative Mac newbie, should keep in mind when considering the purchase of one? Could I get away with something used, or is that just crazy talk? I've got about 22 years of experience (of various levels and flavors) with computers (and those of you who know my age and think I am pulling your leg, I can provide proof, at least anecdotally ^_^) but precious little of that involves Apple products, and even less of that involves modern Apple products.

Thoughts? Recommendations? I'll probably follow this up with a more specific-questions post once I think up some more specific questions ~grin~
tcepsa: (I'll fix it!)
So that drive partition that I said I lost in the last post I made? It's, um, back. By magic, apparently. I am quite happy about this, and hope it decides to stay for quite some time ^_^

I am also very happy about overriding my initial inclination to reformat it upon discovering that it wasn't working quite right. Instead I booted into Knoppix to see whether it was really gone, and everything was still there, right how I had left it. So I booted back into Windows, and ta da! Everything visible again. And there was much rejoicing. Yay.
tcepsa: (I'll fix it!)
Iiiiiiiiiiiiiiiiiiiit's... Monday night. Just doesn't have the same ring to it...

Anyway, it worked. I'm now on a fresh new clean install of Windows. How fresh? Fresh enough that I need to get SP1 on here. And yet despite all that freshness, I still feel dirty... and not in a good way! I'm up a new motherboard (which hopefully includes functional USB 2.0 ports) and down a gigabyte of RAM--though even that has a silver lining, since now the remaining RAM is free to unleash its full 164-bit dual channel glory (the stuff that died was dragging everything down to 64-bit, so this ought to theoretically be significantly faster. Anyone care to confirm/debunk that for me? Anyone? Bueller?)

Erm, actually, why don't I stop writing about how fresh and clean my install is and just put a big target on my computer with the words "|-|axx0rz \/\/3|c0m3!!1!!1!ONE!!" written on it? At least I've gotten Firefox installed...

(oh yeah, and I seem to have also lost my partition containing all my downloads in some freak formatting accident. So much for not having to re-fetch everything! Ah well. ~stiffens upper lip~ It builds Character! (Tee Em) )
tcepsa: (iSquared)
Anyone out there interested in helping me understand the guts of a Tomcat 5.5 server configuration? (Doing some work on a project that requires some tweaking, and for which all the how-tos are written for Apache and are scary to me. More detail: Trying to implement a web-based chat client using JWChat and ejabberd, and it involves some bizarre level of redirection in which requests to a certain URL are somehow sent to the ejabberd server instead--I think!)

Even something as simple as a basic "Here's what the config files are. Here's what the settings tend to mean" or something might at least help me start figuring out which way is up!
tcepsa: (iSquared)
Wow, if those EJBs came with a warranty, I just thoroughly voided it ^_^
tcepsa: (JuggleGeese)
Today has been a very good day at work so far; I've rewritten a portion of code that used a bunch of cumbersome "if" checks to take advantage of the fact that JavaScript supports try/catch blocks. Now I just do what I want to do, and if it doesn't work then I fix it and move on. The fun part is that they're nested three levels deep, but in pretty much all cases I can actually recover from whatever broke it, fix the thing that caused it to break, and move on. No more shall I be at the mercy of (this particular aspect of this particular set of) data architecture!

As it turns out, that was just an appetizer )

tcepsa: (Default)
This was inspired by Friday's Code Snippet of the Day over at The Daily WTF

public boolean myMethod( Object myObject ){
        // Extremely exception-prone error code here...
    catch( Exception e ){
        log.print("Unable to perform myMethod--trying again");
        myMethod( myObject );

My favorite definition of insanity is doing the same thing over and over and expecting the outcome to be different...


tcepsa: (Default)

April 2015

   12 34


RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 26th, 2017 04:28 pm
Powered by Dreamwidth Studios