Category Archives: General

X11


Dear AMD,
Randall Munroe has correctly pointed out that you are adversely affecting my quality of life. Please fix your shit.
Hate,
PAPPP

Posted in Computers, DIY, Entertainment, General | Leave a comment

Ready Player One

Plans for the evening: Write some code I don’t really care for.
Actual activity for the evening: Binge the latter half of Ernest Cline‘s Ready Player One.
As literature, it isn’t exactly stunning – the writing is standard mass market light reading fare (think Dan Brown, and that isn’t exactly complimentary) – but it is possibly the most glorious wallow through geek culture I’ve ever experienced. Geeky Movies. Geeky TV. Old video games. New video games. Geek issues. The Internet. All of it is, through a contrived but delightful plot device, the entire topic of the book. It picks up a huge amount of influence from predecessors in the style, especially Vernor Vinge’s True Names (One of my favorite novellas) and Cory Doctorow’s YA fiction (Little Brother is worth reading no matter how old you are) and makes self-aware references as nods to the things it borrows. The whole thing is extraordinarily masturbatory, to the point of occasionally damaging the storytelling and conception to reach through the forth wall, shake you and ask “Aren’t you excited too?!” but it is totally unashamed, and it is so much fun to just go with it (Enchantment of just going with it vs. disenchantment of thinking about it visible in the contrast of the review and comments here)

It’s also a little bit heartbreaking, because much of the promise the plot hinges on has been eroding away. It presumes that the copyrights on all the pop culture ephemera of the 1980s will have expired in 2044. Thanks to the concerted efforts of entities like Disney, that isn’t likely. Likewise, in an early chapter, it notes “People rarely used their real names online. Anonymity was one of the major perks of …” and goes on as though the “Avatars first, real identities (with physical baggage) for those you choose” model of the internet hasn’t been eroded is a matter of course, and hinges the bulk of the plot on that premise. It even accepts that various things online will need your real name and identity, but, like all such stories, posits that users will chose to go by their handle, and only use real names online where necessary. I grew up in that ‘net. My imagination is set in that ‘net. I want that ‘net back. But it just isn’t the way things are happening (this shame ray is pointed at Facebook and Google).

All that is to say, it isn’t high literature, it isn’t a worldview changer, but holy crap is it fun.

Posted in Entertainment, General, Literature | Leave a comment

Power Factor Corrector

We’ve been tracking down the failure mode of power supplies in the clusters on campus, and picked up a plug-in “Power Saver” power factor corrector box for around $5 to look at in our experiments. Prices on these things range from about $5 (less than the cost of the components in small quantities… and in a nice wallwart case – this is what we paid) to over $70 (fleecing the morons).
This particular device is a “PowerSaver PowerStar CHT” (or some similar random string, the model is “CHT-001A”), about which a variety of bemusingly improbable claims are made.


Upon opening it up, it contains a large (5uF,450V) capacitor, two LEDs, three quarter-watt resistors, and a single-sided PCB with “Comment” all over the silkscreen where fields were not filled in. As best I can make out, the resistors are a very high impedance voltage divider to step down the 120V/60Hz from the wall to a level the LEDs can handle, and the LEDs are acting as their own rectifier. The capacitor is at least connected across the outlet. Curiously, only about half the board is populated, and I can’t figure out what some of the missing components would do – they appear to be a second independent indicator LED circuit rotated 90 degrees from the populated one.
Under a very limited set of circumstances (linear inductive load, like an AC motor) these things could actually help the power factor, but since most residential power billing is net, with no power factor penalty, it wouldn’t actually reduce bills. In the case of non-linear loads, like say, computer power supplies, it will do nothing useful. Experiment complete, although it may still be plugged in while instrumented for funsises.

Posted in Computers, DIY, Electronics, Entertainment, General, Objects, School | Tagged , , | Leave a comment

Dumplings!

It’s been a while since I had a “I made this food. Look at it” foodblogging post, but this makes a good one. One batch of Bison Momo, based roughly on this recipe, and one batch of pork jiaozi, based roughly on this recipe.

Momo filling - Way more photogenic before the meat sludge phase


Both came out pretty well. The jiaozi taste pretty much exactly like the ones from a typical Americanized Chinese restaurant, and the momo are significantly more complex…although they would definitely benefit from some sort of sauce, like they are traditionally served.

The momo are the darker box-folded ones, the jiaozi are the lighter colored crimped half-moons.


I have a fair amount of left over filling from each, due largely to lack of patience and finesse for suitably pressing out the springy dough (In retrospect: breaking out the rolling pin would have helped), which will probably be wrapped in napa cabbage leaves and steamed later, or used for another batch of dumplings. With a bottle of Gewürztraminer and some friends, an evening well spent.

Posted in FoodBlogging | Leave a comment

Principles of Programming Languages

I referred to Bruce J. MacLennan’s Principles of Programming Languages in my previous post, then discovered I can’t find the list anywhere on the ‘net, at least not as I was taught them. They are (AFIK) derived from his book, also named Principles of Programming Languages, so it may not be precisely kosher to put them online, but I’m going to post a copy anyway, because they are terribly useful to refer to.

  1. Abstraction: Avoid requiring something to be stated more than once; factor out the recurring pattern.
  2. Automation: Automate mechanical, tedious, or error-prone activities.
  3. Defense in Depth: Have a series of defenses so that if an error is not caught by one, it will probably be caught by another.
  4. Elegance: Confine your attention ot designs that look good because they are good.
  5. Impossible Error: Making errors impossible to commit is preferable to detecting them after their commission.
  6. Information Hiding: The languages should permit modules designed so that (1) the user has all of the information needed ot use the module correctly, and nothing more, and (2) the implementer has all the information needed to implement the module correctly, and nothing more.
  7. Labeling: Avoid arbitrary sequences more than a few items long. Do not require the user to know the absolute position of an item in a list. Instead, associate a meaningful label with each item and allow the items to occur in any order.
  8. Localized Cost: users should pay only for what they use; avoid distributed costs.
  9. Manifest Interface: All interfaces should be apparent (manifest) in the syntax.
  10. Orthogonality: independent functions should be controlled by independent mechanisms.
  11. Portability: Avoid features or facilities that are dependent on a particular computer or a small class of computers.
  12. Preservation of Information: The languages should allow the representation of information that the user might know and that the compiler might need.
  13. Regularity: Regular rules, without exceptions, are easier to learn, use, describe, and implement.
  14. Responsible Design: Do not ask users what they want, find out what they need.
  15. Security: No program that violates the definition of the language, or its own intended structure, should escape detection.
  16. Simplicity: A language should be as simple as possible. There should be a minimum number of concepts, with simple rules for their combination.
  17. Structure: the static structure of the program should correspond in a simple way to the dynamic structure of the corresponding computations.
  18. Syntactic Consistency: Similar things should look similar, different things different.
  19. Zero-One-Infinity: The only reasonable numbers are zero, one, and infinity.
  20. Avoid Creeping Featurism: Do not add features which are expensive to implement and rarely used. [I think Rafi added this one himself, but I learned them from him, so here it stays. Also, I feel like there was a more elegant phrasing presented at some point.]

I’m not entirely fond of all the rules, particularly 6 and 7, which encourage trusting other people’s code and space inefficiency respectively, but it is generally a wonderful compact way of evaluating languages, that should resonate with anyone who programs.

Posted in Computers, General, School | Tagged | Leave a comment

Vala

Yesterday I decided to indulge my language fiddling impulse and spent some time reading about Vala and writing some simple programs in it. As far as I can tell, it is the answer to the running “My ideal language…” conversation my lab mate and I have, with only a few tiny exceptions. Even from a more formal view, evaluating based on Bruce MacLennan’s Principles of Programming Languages (not the book, just the list of aphorisms) Vala does INCREDIBLY well.

The syntax and feature set is based on C#, but instead of compiling to another unwanted virtual machine (Microsoft’s CLR or its second class citizen implementation, Mono), it compiles to (human readable) C, then native code, so it can piggyback on the platform CC. Most of the fancy language features are actually implemented with glib and GObject, so if you are running anything GTK based all the bits and pieces will be in memory anyway.

Rather than repeating the entire tutorial, the things I find exciting are: Array slicing. Proper Strings. Regular expressions. An optional garbage collector. A reasonable object system with limited inheritance and overloading. Coroutines(-ish) and iterators. Pointers of both the object-respecting and real varieties. Closures. Assertions/contract features. It also has incredibly clean interfaces for writing GUIs (in GTK) and network code, which are definitely weak points for most languages low-level enough for my tastes.

It does have a few interesting quirks (get and set methods allow you to override assignment, string concatenation is “+”, etc.), some dumb inherited things (were long and short ever a good idea?), and a handful of missing features (nothing has powerloops), but those are all minor quibbles.

The only real issues I have with Vala are that it isn’t terribly widely adopted, and that it is maintained by the GNOME foundation (which has a proud history of doing horrible things on a whim), but I think I’ll try writing all my random little bits of code in it for a while, because it is fun in a way I rarely find pure software.

Posted in Computers, General, Objects | Tagged , | Leave a comment

Note Synchronization?

I’ve started the hunt for a suitable new note taking program. My demands are simple: I want a stack of text documents with persistent offline access on my Linux and Android devices, Web access from elsewhere, and automated synchronization between them.

I’ve been using xfce4-notes-plugin, which has been adequate, is backed by plaintext, and is ridiculously light on resources — but it has no capacity synchronization. I wish Google hadn’t abandoned notebook, since that would provide a mechanism to build around without an extra entity I have to trust with my data, but its viability is long gone. In a similar vein, I’m getting a strong urge to find and punch the dropbox folks for using a goofy proprietary protocol instead of something I can trivially self host (hint).

Evernote, with the Nevernote Linux-compatible client, looked like a generally acceptable solution (persistent local copies mitigate the cloud trust issue) until I got a good look at Nevernote – a 55MB blob of crude, crudely-packaged Java code, which seems to function, but consumes 3-6% CPU and 3% memory to sit in the background empty on my i7M620/8GB system. I don’t care how snazzy it is, this is not a solution for a persistent tool.

Hacking something together with text-file-backed editors, rsync, and my web hosting is a last ditch option, since it really is all I want, but there must already be something light, functional, and not dripping with proprietary cruft floating around… right?

Posted in Computers, DIY, General, Objects | Tagged , | 1 Comment

I’m mystified by how much I miss having a little kickstand on my handheld computer. The n810’s didn’t even work very well – only the “Closed” and “45° to the table” detents actually held – but being able to have … Continue reading

Posted on by pappp | Leave a comment

Too Much Toolchain Time

Having my “work project” be finishing the code generator and simulator fronted for LARK, and my “play project” be coaxing uClibc and TCC to build for Android (demonstrably possible, it’s just a question of if I’m clever and/or tenacious enough…) is giving me a little too much time working with compiler toolchains to be healthy. It does make me understand how compilers people get their — characteristic — personality traits, though.

Posted in Computers, DIY, General, Navel Gazing, School | Leave a comment

Android Love of the Day: Like Things are Handled Alike

[This post is part of a series on my initial Android impressions.]
I think I’ve covered most of the really problematic things Google needs to get on. Some other issues are either already being fixed – they’re apparently already working on the notification shittyness – or unsolved problems for developers – like the fact that landscape mode is a definite second-class citizen, despite a profusion of landscape keyboard sliders.
And now a change of pace for the end of the week: this post is about something I think the Android designers did right, and certainly did better than many competing platforms.

Mobile platforms are especially guilty of treating otherwise indistinguishable objects as different. For years there has been the ringtone scam, with carriers and third party assholes charging for suitably down-sampled and/or converted music tracks, even when it is often visible that devices internally use .mid or .mp3 tracks for the function. Likewise, a couple of the mobile platforms distinguish between editable and non-editable text, which is absurd.

Android doesn’t pull that shit. Music is any compatible audio file the indexer can find. Ringtones are any native audio file that you point at as a ringtone, with a default /sdcard/Media/Audio/Ringtones directory for things you intend to use that way. Notification sounds are likewise audio files you point at as notification sounds, with a default /sdcard/Media/Audio/Notifications folder.
Text, with the occasionally irritating but entirely understandable exception of certain UI elements, is text. The same (clunky) select/copy mechanism works on all text, and it all goes to the same system-wide clipboard. Because I have a Sense ROM, the mechanism is actually this one(video), which is slightly less clunky than the default, but still inelegant. The important thing is that it’s consistent.

All in all, I like my MT4GS. It has some quirks, many of them in software which can and will likely be fixed with updates or third party extensions as time passes, and it costs a fortune to feed, but it does the vast majority of things I want in a little handheld computer, and it does them more elegantly than the competitors I’ve tried. I may not find Android to be an exciting platform, but it is a solid platform, with multiple, reliable companies backing it, a parent company actively trying to improve it, and enough market penetration to be a first-class citizen for years to come. It even appears the native code situation is improving, which should let me work around many of the things *I* would like to work differently that aren’t concerns for most users.

Posted in Computers, DIY, Electronics, General | Tagged , | Leave a comment