Zaemis' Digital Junk Drawer

Whoa there! It looks like you've stumbled upon my tumblr account! Here you'll find various odds and ends that didn't make the cut for my main blog, things from around the internet I'd like to share, and other tidbits I just don't want to forget.
Posts I Like

Mi ne sentis sane kaj mi dormis multe hodiaŭ, tial mi ne faris multe. Mi redaktis kelkajn artikolojn por phpmaster.com, kaj babilis kun amikoj per ret-mesaĝilo (ni grumblis pri altaj impostoj). Malekcita tago! Morgaŭ, mi vizitos la dentiston. Malamuzota tago!

Antaŭ unu aŭ du monatoj, mi aĉetis la libron “Vivo de Zamenhof” de Privat ĉar ĝi estas laŭdita inter Esperantujo. Sed mi ne ĝuas ĝin, kaj malfacilegas por mi fini legi ĝin. Mi rimarkis, ke mi ne ŝatas biografiojn! Mi ne zorgas kiel oni iri tien aŭ ĉi tien, kaj kion oni diri. Enuigas min! Mi pli preferas aŭbiografiojn. Mi ŝatas kiam oni rakonas memvorte; mi ŝatas vidi personecojn. Sendube, tiu estas malpli enua!

Mi devas skribi ion ĉar mia esperanta defio, sed hodiaŭ, nenio tre interesa okazis. Mi laboris, dormetis, kaj ludis Kolerajn Birdojn (“Angry Birds”). Mi gajnis miajn restajn nivelojn de la unua ludo, kaj nun ĝi, “Rio”, kaj “Spaco” estas tute gajnataj. Kelkaj niveloj tro frustigis min! Nun mi ludos “Sezonoj”.

Por plibonigi mian Esperanton, mi decidas skribi iom da Esperanto ĉiutage dum kvin tagoj. Ĉiu rakonto ne devas esti longa; nur gravas ke mi skribas ion ĉiutage. Kaj se mi ne havus interesaĵon pri mia vivo, eble mi tradukus ion. Mi volas meti ilin surrete, ĉar iu ajn povas korekti miajn erarojn per komenton (certe, mi eraros!) Do, saluton kaj bonvenon… bonŝancigu min!

So I upgraded to 12.04 LTS, Precise Pangolin. Not only do I not know what a Pangolin is, it deleted MySQL.

tboronczyk@laptop:~/$ mysql -u dbuser mydatabase
The program ‘mysql’ is currently not installed. You can install it by typing:
sudo apt-get install mysql-client-core-5.5
tboronczyk@laptop:~/$ history | grep mysql
1152 mysql
1153 mysql -u dbuser mydatabase
1156 mysql -u dbuser mydatabase < schema.sql
1212 mysql -u dbuser mydatabase
1331 mysql -u dbuser mydatabase < data1.sql
1332 mysql -u dbuser mydatabase < data2.sql
1366 mysql -u root
2025 mysql -u dbuser mydatabase
2026 history | grep mysql

As the history command shows, it used to be there. Great job, Ubuntu!

Unless the visual layout of a program’s code affects its execution, there will always be programmers who circumvent the established coding standards. I admit, I’ve done it myself from time to time. There’s no scientific survey that such standards really reduce cognitive friction when reading someone else’s code as far as I know, and aesthetic matters are generally subjective. Make the argument for tabs over spaces until you’re blue in the face; someone will just come along touting the benefits of spaces.

I warned achieving a consensus on PHP Coding Standards as PSR-1 would be difficult and that the group’s efforts would be better spent discussing more “meatier” topics, such as object caching. Two months later, the proposal failed to garner enough votes for a simple majority and has now been split.

And let’s not forget the “Beat Up on Crockford” festival over bootstrap and JSMin. His comments were a bit harsh, yes… but then again he only made two comments in the entire (quite lengthy) discussion and ended up immortalized in the (admittedly funny) Dangerous Punctuation.

Novelists don’t all write in the same style; noting the formatting in a section of code might give a heads up on who wrote it or insight into the coder’s way of thinking. Maybe it’s a clue as to who we can go to for help when something doesn’t work. Weak arguments, sure. But maybe so is “consistency breeds success” when applied to code formatting.

Most coding standards seem to target only low-hanging fruit: capitalize something this way, place your braces in this manner, space something that way, etc. None of that really matters, does it? Standards that enforce good architectural design, specific interoperability concerns, etc. have more merit. After all, standards should help make things work, not squash creativity. And if Joe Programmer’s self-expression manifests itself as 5-space indenting, who am I to judge?

Mia fratino komencis fari sian propran ŝminkon kaj vendi ĝin interrete. Ŝajnas, ke estas multaj sendependaj vendistoj kiel ŝi; mi neniam sciis ke ili miksas kolorojn kaj argilojn por produkti unikan okul-ŝminkon, lip-ŝminkon, ktp.

Mi proponis al ŝi, ke ŝi nomu kelkajn da ŝiajn kreojn per Esperantaj nomoj, ĉar nemultaj komercoj celas vendi je Esperantujo, kaj certe, esperantujinoj volas aspekti bela! Ŝi koncentis, kaj nomigis la unuon “Verda Stelo”.

Bv. diras al viajn amikojn ke tio estos esperanta-nomata ŝminko… kaj ankaŭ, sentas libere por proponi sekvajn nomojn.

Ŝœia butikretejo (angle) estas ĉe: http://moonrabbitcosmetics.storenvy.com

Kaj por mi, la skribado de ĉi-tiu posteno estis bona esperanta-ekzerco. Mi ne sciis la vorton “ŝminko” antaŭe :)

  • Sccerplaya29: hey
  • me: hi
  • Sccerplaya29: how's it going? havent talked to you in awhile.. lol
  • me: oh God... not you again.
  • Sccerplaya29: do you remember me?.., it's Stephanie.
  • me: yes, I do. You're the bad sexbot with a rusty vagina.
  • Sccerplaya29: when was the last time you had any? I want it NOW! lol
  • me: I've never had a rusty vagina.
  • Sccerplaya29: so what's up?...
  • me: Lorem ipsum?
  • Sccerplaya29: not much here just got out of the shower went to the gym today :)
  • me: wow, that's twice today.
  • Sccerplaya29: i gotta question do you like a girl with big tits? or do you prefer a girl with a fat ass..
  • me: dolor sit amet, consectetuer adipiscing elit.
  • Sccerplaya29: okay! well i got alot of both wanna see? im feeling a little naughty@!
  • me: why is your ass fat if you go to the gym twice a day?
  • Sccerplaya29: well im gonna show you if its okay ;)
  • me: your owner obviously doesn't realize you're "talking" to a gay guy
  • Sccerplaya29: cc is just to verify age..you'll get in for free through my page!
  • me: you're going to used closed captioning to verify my age?
  • rmcannsx25: hi
  • me: hello
  • rmcannsx25: how's it going? havent taIked to u in awhiIe.. IoI
  • me: it's going well. refresh my memory, who is this?
  • rmcannsx25: Jenny
  • me: Jenny.... ?
  • rmcannsx25: do u remember me?.., it's Stephanie.
  • ***me is totally confused.
  • rmcannsx25: so what's up?...
  • me: Is it Jenny or Stephanie?
  • rmcannsx25: not much here just got out of the shower went to the gym today :)
  • me: ah... a sex/spam bot.
  • me: sexbots shouldn't take showers... the water shorts out your circuitry.
  • rmcannsx25: wow i need to get some
  • me: circuits? I know a few good sites on the internet you can mail order some transistors if you're too rusted to get to your local radio shack.
  • me: I wrote you a love poem... would you like to read it?
  • me: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce lacinia, elit ut tempus eleifend, magna mauris porttitor augue, sed auctor neque turpis vel nulla. Donec venenatis risus quis ligula adipiscing pellentesque. Quisque non odio vel sem posuere convallis vitae id neque. Integer eget libero pulvinar mi facilisis viverra sed non nisl. Morbi rutrum felis quis lectus laoreet bibendum. Aliquam viverra dapibus placerat. Maecenas non massa tellus, nec sollicitudin libero. Sed quis libero sit amet dolor fringilla eleifend. Sed sagittis gravida augue ut feugiat. Fusce et nunc lacus. Quisque ut erat justo. Duis tortor sem, adipiscing eget iaculis non, faucibus in tortor. Nunc vitae elit elit. Cras consequat arcu a magna mattis iaculis. Suspendisse id est lectus. Suspendisse nisi massa, lobortis eget congue a, pharetra id nibh. Fusce tempor sodales suscipit. Nulla eget dui risus, ac condimentum eros. Sed a turpis id urna fringilla pharetra at a odio. In quis posuere ipsum. Morbi cursus semper feugiat.
  • Unable to send message: Refused by client
  • me: refused!? that's not very nice.
  • me: you're a bad sexbot. I hope your vagina rusts shut.

I finally had a chance to play with my Arduino! I had a handful of red LEDs laying around (police lights are red in New York State) and thought it would be fun to emulate a police light bar as my first “project.”

I’m not the first to do it, and others achieved better results than me, but I think the most interesting part was the use of trigonometry. All of the code for similar projects I found on the Internet specified each light change (even for the simple flash pattern I did) resulting in lengthy files which were easy to get lost in. Instead of hard-coding each value, I calculated the brightness levels as a graph of a sine wave. The x-axis is time, and the absolute value of the y-axis value is the LEDs’ brightness.

// Pins 3 and 11 are PWM
int right = 3;
int left = 11;

float deg2rad(int d) {
  return d * 3.14 / 180;
}

void setup() {
  pinMode(right, OUTPUT);     
  pinMode(left,  OUTPUT);     
}

void loop() {
  int x, y;

  for (x = 0; x < 180; x += 18) {
    y = 255 * (int)abs(cos(deg2rad(x)));
    analogWrite(right, y);

    y = 255 * (int)abs(cos(deg2rad(x + 90)));
    analogWrite(left, y);

    delay(30);
  }
}