tcepsa: (Computation Suspended)
A little gem that [ profile] gipsieee pointed me to earlier this afternoon.

Don't Wake The Programmer

I never thought of programming like this before, but after thinking about it, and about how it works for me, holy crap he's exactly right! No wonder I get so irritable when I'm interrupted abruptly--or why I can handle little interruptions reasonably well, but as soon as it goes for more than a few minutes or takes a higher level of concentration, the dream falls apart.

It also explains why thinking about a problem that I'm trying to write code for and daydreaming feel so similar ^_^
tcepsa: (Cake)
This didn't actually happen to me at the time, but it would have been incredibly apropos of my mental soundtrack to be playing Weird Al's "Everything You Know Is Wrong" while I was trying to figure out why my Elevator Simulation Project (the last one for my C++ class) wasn't working:

Everything you know is wrong
Black is white
Up is down
And short is long
And everything you thought was just so important
Doesn't matter

Everything you know is wrong
Just forget the words and sing along
All you need to understand is
Everything you know is wrong!
tcepsa: (iSquared)
Would you see anything interesting if you were to do signal analysis on the prime numbers?

Is it unrealistic to think of the primes as a sort of hologram for the integers, since you can generate any integer by multiplying the necessary primes together?

Isn't it interesting, given the ease with which they can be used to create all of the other integers, that there is apparently no direct way to generate the prime numbers from themselves? (Is there a name for that?)

These thoughts brought to you by the fact that I just implemented an algorithm to find all the primes using a method inspired by the Sieve of Eratosthenes. (Start with 2 as a known prime, testing 3. Attempt to divide the test number by all of the known primes. If any of them divide it cleanly--no remainder--discard it. If none of them divide it cleanly, it is prime; add it to the collection.) This is sufficient because all of the non-prime integers are products of some collection of prime integer and therefore a number is divisible by a non-prime integer if and only if it is also divisible by a prime integer. So you can save a lot of time by not doing the checking of non-prime integers.

That having been said, I'm only up to the high 60000's. The fact that I'm doing this with a HugeInt class that I wrote myself to remove the limitation of the computer's native 4-byte integer appears to be moot, as I suspect that even if I left this to run forever I might very well die of old age before that became relevant.

~ponder~ I wonder what would happen first: me die or the computer use up all its RAM. (Annnnd we're back to signal processing and frequency analysis ~grin~)
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).
tcepsa: (I'll fix it!)
I spent far more time than may have been prudent playing with electronics last night.

I now have a square wave generator in the form of an astable 555 timer circuit (I've wanted one of those for years!) If I remember right, I could also use that in combination with the proper op-amp arrangement to make a triangle-wave generator (square wave + integrator = triangle wave).

This is, however, merely the means to a larger end. I then went on to try to get that to drive a resonant LC circuit. This consumed the majority of the time, and while I am not sure I have come out all that much wiser for the experience, I think I finally got to the point where I understand enough about what it's doing to actually attempt to create a receiver for it. Yes my friends, I have taken up my electronic lance and am heading full tilt at the windmills of wireless power transfer.

The irony of all of this is that it, in turn, is merely a cog in my greater scheme for an advanced human-computer interface device, which would be much more convenient if it were entirely wireless and did not need a battery (or could run off rechargeable battery and run or charge off of wireless power).

I was actually inspired to look into this by [ profile] adularia's ongoing project, as I am hoping to do an implementation of that concept, but wireless and probably with a different sensing mechanism.

It was a good night ^_^

Cut for tangent about time management skills )
tcepsa: (Computation Suspended)
I was worried that my Software Engineering class this semester would be analogous to my undergrad Economics for Engineers class, but now I think it has the potential to rank as one of my favorite classes (though I maintain that it also, as a topic, has great potential for being analogous to my Econ class; the instructor and the other students seem determined not to let that happen though ^_^)

A little background )

Well and good; I am reasonably convinced that documenting design decisions is something that ought to be done. However, I am also strongly convinced that one often-overlooked aspect of such documentation is that it theoretically will need to be referenced at some point in the future, and that the person doing the referencing is almost certainly not going to have the inclination or patience to read through the entire document trying to find the relatively small portion that is relevant to the matter at hand for them.

Does an effective method exist for tracking such things as design decisions? Are there tools out there to facilitate this? It seems like tagging might be able to offer some help, but I don't know. Similarly, does it make sense to keep such documents in plaintext (or maaaaayyyyybe HTML) and track them in a version control system? Is there such a system specifically for such documents?

If there's not, but you were given the opportunity to provide input on a design for one, what features would you want it to have?

Is this a problem that can be solved by such tools, or does a methodology or discipline need to be developed as well and then applied in order to really work? Does such a discipline already exist?

Disclaimer: Yes, I am tentatively entertaining the notion of trying to actually build something like that if it does not already exist. However, the odds of this actually happening are rather small, given other projects currently taking up my attention (such as the aforementioned class; something tells me that this undertaking would be bigger than makes sense for a semester project ~grin~). On the other hand, if I suddenly find myself between projects, and nobody else has actually put something together by then, I might have a go at it and it would be great to know what other people would want to see in it as well as my own ideas of what would look good.

Or maybe I'll just learn Lojban ~wry grin~
tcepsa: (TryScience!)
Last Wednesday I ended up making a trip up to Baynesville Electronics in Towson (northern edge of Baltimore). It was awesome ^_^ I'm not sure quite yet whether I'll be going back there for parts often, but it seems fairly likely. On the one hand it seems like online sites are quite a bit cheaper, but on the other hand I have not actually verified that and I really like the idea of supporting these guys, as there are, in my opinion, not nearly enough stores like that around. A (more-or-less) local alternative to Radio Shack? Sign me up! Plus the ability to just run out and get a part in under and hour vs. placing the order online and waiting for it to be delivered... sure there's the extra element of anticipation in the latter case, but even I can only take so much suspense ~grin~. And projects are more likely to end up shelved because I lost momentum while waiting for the part to arrive than if I make a run to a store (an hour of downtime could still be too much of a drag on my mental flywheel, but it's still significantly less than that of ordering a part and waiting for it to come in). That having been said, I am on the edge of my seat waiting for my Boarduino kit from Adafruit to arrive. Mmmmm, antici... pation!

So, enough philosophical rambling, back to the foray! While I didn't interact much with the staff, they seemed both knowledgeable and friendly in a way that gave me a sense that they were there because they liked being there. I spent most of the time I was there (probably about an hour-ish, maybe a little longer) just wandering up and down the rows of shelves looking at all of the different things they have stocked. While I saw a lot of neat stuff that I'd love to play with at some point, a lot of it also left me with a vague feeling of, "Huh, that thing has an interesting shape, I wonder what it does but I'm not going to make too much effort to find out right now. Maybe someday I'll know, but if not that's probably okay too." Normally I'm used to going into a place like that and needing a lot of willpower to counteract the "Oh my god it's so shiny I want it all right now!" but I think that's been happening less lately; "It looks nifty but I don't have time for it," apparently quashes that gleeful urge to buy a whole bunch of stuff really effectively.

I'm not certain I like that. In fact I'm kind of thinking I don't. "OOOO I'm going to buy all of this right now!" is not good for the wallet, but "I won't ever have time for any of this..." is, I suspect, not good for the soul. More to poke at later...

And I did buy some things, for projects that I am currently working on. If anything, I'm seeing a positive swing back in the direction of getting excited about and engaged in projects like this; I am actually actively working on a couple of things. (The Boarduino being rather important for one of them as the PIC I currently have apparently doesn't have enough memory, and the Motorola HC11 is still too obtuse for me to understand it, which is slightly ironic because my favorite class in college was programming one of those, but that was over six years ago and we had the setup done for us and basically just had to write the code. I've what little assembly I had known back then is rusty enough that I am not patient enough to re-learn it just to try to implement my current project.)

The big score for the evening was a probe connector for the oscilloscope that I got from my (recently deceased) grandfather over the holidays. I didn't find a probe for the scope, and it had a very strange-looking connector where the probe was supposed to attach. It was a thick (comparatively) connector with a jagged edge and a hole in the center; I don't remember ever seeing anything like it before. But while I was at the store I did see connectors like that. It turns out that it's a UHF connector, and I was able to get the corresponding (male) plug for it that would convert it from RCA, and an RCA connector that I could then solder leads to. It was a bit of a shot in the dark, but when I got home and checked it the connection fit like a glove. I now have a semi-functional oscilloscope! (I still haven't soldered the leads to the RCA plug, but I shall soon).

Other scores for the evening are a little box to hold SD and other memory cards (I have a handful and this will help keep the ones that I am not actively using from wandering off) and a two-PS/2-to-one-USB adapter. This will theoretically be useful with keyboards and mice and laptops... and possibly with other things ^_^

So yeah, Baynesville Electronics Trip 1: Win! ^_^
tcepsa: (Computation Suspended)
Fantastic opportunity--I promise, if you are able to complete this job, it will take your career to new heights:

(Before entering a competing bid, however, I strongly recommend you look at the other bids and consider who you'd be going up against ^_^)
tcepsa: (Computation Suspended)
I've discovered a situation that would be made significantly less cumbersome if I could have an array of function pointers, loop over the array, and only have to write the setup and teardown code once around the call to the current function being pointed to with the same arguments every time.

While superficially it might seem that my claim to have leveled up is inaccurate because I've been chucking around references to functions for years (primarily in Javascript callbacks), this is one of the first times I can think of needing them to do something proactive instead of reactive. But I'm constrained to programming in Java for this assignment (and it already had 20+ hours of work in it by the time that I'd realized I wanted function pointers) so I had to triplicate my code instead (once surrounding each of the three core function calls).

Still, I take it as an encouraging indicator of the direction in which my thinking is trending that I recognized that they _would_ have been useful here ^_^

(I probably could have done something approaching that with JUnit, but I would have had to split the code up in ways that seem awkward to me and may not have been familiar to the grader, and I wasn't up for that...)

(I also probably could have done something with aspect-oriented programming, but that would be getting WAY too involved for this project, especially since I'm relatively unfamiliar with that paradigm in general and its implementations in specific)


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)
Thoughts that I developed after a conversation this evening:

I tend to be pretty bad in general about starting conversations. I feel like I do reasonably well at carrying them on and even helping them develop in new directions once they've gotten going, but... ~wry grin~ I seem to have a high conversational inertia.

(And sometimes there's a high coefficient of conversational friction, which also works against me...)
tcepsa: (iSquared)
Today has been one of those days where I walk away feeling like "Wow I learned a lot!", and even though I didn't write a single line of code that will actually be included in the final product I consider the time well-spent as tomorrow (or more likely early next week; I'm trying to learn Spring and Hibernate and I haven't even gotten started on Hibernate...) I will be writing code, and it will be very good code thanks to the time I've invested today.

Levels gained:
  • 2 in Spring
  • 1 in Dependency Injection
  • 1 in Aspect Oriented Programming (AOP)
  • 1 in Logging (with Log4j)
  • 1 in Unit Testing (with JUnit)
  • 1 in Eclipse
And there might be more tonight, if I don't decide that I've had enough. I hit a kind of frustrating point just now with the AOP side of things (or I could have maybe claimed two levels in it alone... ah well): it isn't actually executing what ought to be "before" and "after" advice (separate code blocks that run before and after a given method is executed, respectively). I'm not seeing anything obvious wrong with my config file, but I'm also not familiar enough with the AspectJ notation to say whether I did the pattern for the pointcut right, either.


tcepsa: (Default)

April 2015

   12 34


RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 24th, 2017 09:03 pm
Powered by Dreamwidth Studios