Showing posts with label code. Show all posts
Showing posts with label code. Show all posts

Wednesday, February 13, 2019

Printing PDFs for tiny books

It's great being a programmer, would highly recommend it. So many things one can do when you leverage the power of scripting. The skillset helps you everything. For example, even with book binding! Say I totally, hypothetically, have some random PDF that you'd like to turn into a tiny book. Cool! How so?

STEP 1: PDF JAM!

The key to all of this is the pdfjam tool written by others far more talented than myself. That alone will let you craft your book, if you want to do it manually. Go to the linked page, follow the instructions, download & install it.

STEP 2: Grab my terrible script(s)

I have 2 sizes I like for my books... Both scripts print signatures that are 4 sheets to a signature, 8 pages folded, 16 pages front & back. Hopefully that make sense.

Option 1 is a 2x2 layout (so each page is 1/4th the sheet of paper) that can fold & nestle neatly. I like this and often don't cut the top pages apart until later. Often I'll wait till I sand/trim the top to separate the pages... Unfortunately I often find this to be "too big" for my tastes. But it's probably the easiest/most legible. [script].

Option 2 is a 4x4 layout (so that's a full signature per page) and really requires a tabloid size sheet of paper (11x17). I run my font really tiny, I suspect this is probably too small for most folks. The books I print this way are laid out specifically to be small, your average PDF wont be legible with this, even on tabloid. [script].

I'm just going to assume whoever is reading this is on a Mac because I can't help you with your Windows... but save the script (as a .sh file) and then make sure you can execute it. All this is going to happen on the terminal so... I hope you know how to work with that. I tend to choose "chmod 755 my_script_name.sh" to give it the correct permissions.

The script is going to ask for the PDF file name and how many pages it has. It'll then create a directory named "output_small" and dump all the individual (2 sided) pages created. If there was already a directory there, that'll get nuked. I wrote a terrible script and it can't handle page counts that don't line up with its exact layout so.... there's a very good chance it'll barf at the very end. It spews content onto the terminal and that last command will probably fail and you'll need to tweak it manually and execute it.... (Terrible, I know) Here's an example:


19:48 ~/directory/of/stuff>
19:48 ~/directory/of/stuff>chmod 755 ./small_book_pdf_jam.sh 
19:49 ~/directory/of/stuff>./small_book_pdf_jam.sh 

PDF file name:
jbic.pdf
PDF page count:
466
... looking at the following file:
-rw-r--r--@ 1 sithel  staff  1404186 Jan 26 16:22 jbic.pdf

Checking...
You will have 14 blank page(s) at the end
There will be 15 signatures
Dumping all old content from the directory 'output_small'
          ----
  pdfjam: This is pdfjam version 2.08.
  pdfjam: Reading any site-wide or user-specific defaults...
          (none found)
  pdfjam: Effective call for this run of pdfjam:
          /Library/TeX/texbin/pdfjam --suffix rotated180 --angle '180' --fitpaper 'true' --outfile output_small/temp_flipped.pdf -- jbic.pdf - 
  pdfjam: Calling pdflatex...
  pdfjam: Finished.  Output was to 'output_small/temp_flipped.pdf'.
Signature : 1 of 15
pdfjam --nup 4x4 output_small/temp_flipped.pdf '1,16,17,32' output_small/temp.pdf '4,13,20,29' output_small/temp_flipped.pdf '5,12,21,28' output_small/temp.pdf '8,9,24,25' output_small/temp_flipped.pdf '31,18,15,2' output_small/temp.pdf '30,19,14,3' output_small/temp_flipped.pdf '27,22,11,6' output_small/temp.pdf '26,23,10,7' --outfile output_small/temp_sig_0.pdf
          ----
 .... goes like this for a while, successfully, UNTIL!!! 
          ----
  pdfjam: This is pdfjam version 2.08.
  pdfjam: Reading any site-wide or user-specific defaults...
          (none found)
  pdfjam: Effective call for this run of pdfjam:
          /Library/TeX/texbin/pdfjam --nup '4x4' --outfile output_small/temp_sig_448.pdf -- output_small/temp_flipped.pdf 449,464,465,480 output_small/temp.pdf 452,461,468,477 output_small/temp_flipped.pdf 453,460,469,476 output_small/temp.pdf 456,457,472,473 output_small/temp_flipped.pdf 479,466,463,450 output_small/temp.pdf 478,467,462,451 output_small/temp_flipped.pdf 475,470,459,454 output_small/temp.pdf 474,471,458,455 
  pdfjam: Calling pdflatex...
  pdfjam: FAILED.
          The call to 'pdflatex' resulted in an error.
          If '--no-tidy' was used, you can examine the
          log file at
                  /var/tmp/pdfjam-sk2QxI/a.log
          to try to diagnose the problem.
  pdfjam ERROR: Output file not written
19:50 ~/directory/of/stuff>

You gotta' take that last command and then put {} for each invalid page number... given that I only have 466 of them it'd then look like: /Library/TeX/texbin/pdfjam --nup '4x4' --outfile output_small/temp_sig_448.pdf -- output_small/temp_flipped.pdf 449,464,465,{} output_small/temp.pdf 452,461,4{},{} output_small/temp_flipped.pdf 453,460,{},{} output_small/temp.pdf 456,457,{},{} output_small/temp_flipped.pdf {},466,463,450 output_small/temp.pdf {},467,462,451 output_small/temp_flipped.pdf {},{},459,454 output_small/temp.pdf {},{},458,455 (Gross, I know. Very embarrassing)

Now that you've got those signatures you can just print each file out individually OR you can pull one smaller script and run that to glue them together [script]. Just does some basic math for you and sticks 'em into one file called 'book.pdf' in that same directory.

See... it's... not that bad... I printed several books this way. There's a whole 'nother step where you wrestle with your printer quality, paper quality, text legibility and all that... but that's for another day.

Sunday, March 6, 2016

Small magnetic single throw double pole circuit

Back when I was a wee lass I saw Jurassic Park and knew then I wanted to get into computers so that I could create special effects. When I was a bit older we were visiting San Francisco and I went on an Aliens themed "3D" ride around Fisherman's Wharf (or maybe it was in Seattle?) Anyway, I remember being blown away by the experience of the seats moving and air hissing and decided I wanted to do computer stuff that would effect the real world. Fast forward a couple more years and I was at UW, majoring in Computer Engineering with a focus on embedded systems. Fast forward a few more after that and I'm a web dev tinkering with JavaScript... whoops. Might have miss-stepped somewhere along the way... but my love of computers is sound.

I have an inkling of knowledge on how to do things In The Real World but it's pretty weak. Turns out EE is hard and intimidating. But my interest remains strong. This, combined with my experiences doing several Escape Room games and the delight I had playing in a friend's Harry Potter puzzle LARP has lead me to the obvious conclusion that I should organize my own escape game.

Settling in to craft

Happily we got a lot of rain this weekend here in San Francisco. Not only does it help the drought problem, it allowed me to stay inside most of the weekend coding and crafting. And boy howdy is there a lot of coding and crafting to be done for this project.

A majority of the project is computer systems/pure code which I've been chipping away at, but some elements are hardware related and I've certainly been avoiding working on them. I enjoy it! But... it's hard. Thankfully I made actual progress on one portion but also wound up scrapping a different portion after repeated failure. Lets focus on the positive though!

If there's a chance you'll be playing in the game (you know who you might be, my so few Readers), I'd recommend not reading the rest of this post.

Not even half of what I needed Failed ideas

The goal: Have a surface that players can place an object on. The object has several magnets embedded in it, which activate switches below the surface when aligned correctly. The switches are attached to an Arduino which informs the computer, which informs the game server, which then has an effect on the game.

Turns out the end portion of it- the Arduino talking to the server is suuuuuper easy given the pySerial library. So the question here is about the circuit. Magnetic switches in a small space. Not difficult, right?

First attempt: run a wire to a bent paperclip, tape the wire to the hidden "floor" below, and use the wire as a hinge. Have the "surface" above be wrapped in tin foil and ground that. Now the wire runs to an Arduino pin in `INPUT_PULLUP` mode. Boom! Done! Success! When the magnet moves above the paperclip, the paperclip jumps up and grounds itself against the "surface" above and you've got a closed circuit!

Problem: There's only a couple pins on the Arduino and I'd like there be be a number of sensors so that different configurations can be recorded. That means each sensor circuit needs to ground 2 pins so I can have more unique combinations (That's multiplexing... right? Maybe?)

Next attempt: ... somehow close 2 circuits with a single paperclip's movement rather than just 1 circuit.

Problem(s): The paperclips I bent all had a single point of contact where the magnet was. The wire hinge was a bit too ridged/constricting to allow smaller pieces to rise and fall. I tried many different shapes and sizes and padding/fringe along the top of the paperclip that contacted the surface above. The signal was finicky, rarely closing both circuits.

Not really "success," but acceptable

eventually... "success!" (the signal is still a bit finicky, but good enough to go forward for now)

The solution? Have lots and lots of craft items laying around your house... No, really. The solution? conductive thread & copper tape

Conductive Thread : something needs to hold the paperclip to the "floor", allow it to pivot, and make sure it's connected to the circuit. Wire hinges were proving to be too ridged along with folded tape or aluminum foil. Enter the ever magical conductive thread. Taking two strands and tying them to the paper clip solved this problem. The clip was bent to be flat along the bottom, one strand tied to each corner, then the strands taped down with masking tape. It was a smooth hinge and a reliable connection. I wrapped the floor with aluminum foil and grounded it so that each paper clip is grounded via it's conductive thread tie downs.

Copper Tape : originally acquired for stained glass purposes, it's great. One side sticky, one side copper & conductive. Note that the sticky side is not conductive (sadly). I used this to mark out the traces on the bottom of the surface, where the paperclip would connect to. The tape is already pretty thin but I was able to cut it in half and place very close to each other- like laying out a sticker circuit board. I cut the paperclip to be U shaped, anchoring it to the floor at the bottom of the U. Now when the clip jumps up towards the magnet and closes the circuit, it has 2 little points contacting the 2 different traces (rather than one broad one).

Wednesday, January 27, 2016

Gaming Craft

I like gaming. The social aspect is fun, yes, and story telling, but it's this whole crafting/art project portion that really hooks me.

As I've aged I'm finding it a little harder to just make things willy nilly without thought as to why or for what purpose. I've tucked about as many little monsters about the house as Adam will let me. I've given ones to many friends and all family members. Why make more things? Well, making things is FUN! But... why? That's where gaming comes in. Now I'm making not just "something" but rather a prop or an accessory. A visual aid for something that involves more people than just me. Purpose.

D & D : Prep is fun

Up until this point I've mostly been playing in games but 2016 is the year I dip my toe in trying to run them. Picked up the D&D 5e suite of books/rules and have run 2 little one-shot games for my friends. Wouldn't say they've been that successful but I've definitely enjoyed having friends over and having an excuse to think creatively. The first game involved a 2 level map where I drew the ground on graph paper and then had a tree branch level drawn with dry erase markers on a glass shelf (resting on several cardboard tube tree trunks). The second involved a dungeon map slowly revealed as people explored it.

D & D : ready for that dungeon crawl

Turns out peeling off square by painful square of "fog of war" isn't super fun. Also, candy colored "fog of war" really doesn't add to the "dungeon crawl" vibe... The problem wasn't the taping down (that actually worked super well) but just the general scrabbling for a hold on tiny paper piece in order to pick up. One takeaway from it though was that drawing the map was a good exercise in thinking about the story and helping me build out an idea. Drawing is my best way of building a narrative- something I've known for a while.

Rogue Trader : Homework

Another delightful gaming craft recently worked on was the Rogue Trader Yu'Vath Battlestation Assault Plan. Given a rather math-y description of a patrolling ships around a point of interest, friend Nate and I wrote a little simulator to help find the best approach. Mind you, this is for a game I'm not even in. Was thrilled to have a valid reason to use the three.js library again and limber up my mind, wrapping it around 3D math/space/modeling. Not sure how long Nate will host it for, but the simulation is up at this site right now. [code posted on Github]

Monsterhearts : The PCs
While not really a craft, I've found games (mine but especially others') to be an excellent source of sketching and art. Friend Kelly drew the characters from a game and then flattered me by asking to help with inking/coloring it. I appreciate that with her effort/interest/involvement I managed to overcome the wall of white space most my sketches hang in and provide the vaguest of something for background (drawing backgrounds being my majorly failed 2015 New Years resolution). Never mind the fact that it's mostly a munged photo I found on the Internet...

I was going to follow this up with several more gaming sketches but alas this week's plot didn't get far enough...

Named arrows fly better

Along the gaming craft tangent: applying game content to other activities. Friend Suko and I continue our once-a-month shooting. I've marked my arrows with names of 4th Terminus characters and not only does it help me improve my aim/track my shot history but it also tells a story with every round. "Oh Hayley, once again going off target. Morgan, always flies true. Jayce, right where I send him and look at that- the Jaya arrow is snug up against him. Again." What I need to do now is figure out a better way to label the arrows. Right now I've scribbled the names on the nocks (over half of which need to be re-aligned) but the ink rubs off so easily there.... Anyway, the important take away is that once I named my arrows and could track which offset/corrections were needed for each I was able to hit the bullseye three times with the arrow named Jaya. Just saying. The other arrows need to start pulling their weight.

In conclusion gaming is fun. Friends are great, telling stories with them is a fantastic way to pass the time, and using said content to overlay on other actives makes everything better.






Monday, November 2, 2015

Getting 8 pages from a US Letter page

This is one of those things where I'm sure the answer is clearly posted somewhere on the Internet... and I just really couldn't find it. So I'm typing up my solution here in the hopes that the next person who looks for the answer can more easily find it.

The problem was simple- I have a single piece of "normal" US Letter paper. I wanted to get 8 pages (4 per side) out of it. I also wanted the page to be part of a signature, which meant the layout of the pages wasn't just 1-4 on one side and 5-8 on the other. What am I printing? I'm printing a PDF of N pages. It happened to be generated by LaTeX but that shouldn't matter for this really.

So, how? Easy- use two command line tools pdf180 and pdfjam. The pdf180 command is required to flip the pages upside down so that they're right-side up when you do the first fold (which will later be cut open). pdfjam is required to correctly tile 4 pages per side of the paper so they're in the right order when you do the second (spine) fold.

That means a simple, single page would look something like this:
# assuming what you want to print is named MY_STORY.pdf
pdf180 MY_STORY.pdf --outfile TEMP_FLIPPED.pdf

pdfjam --nup 2x2 TEMP_FLIPPED.pdf '1,8' MY_STORY.pdf '4,5' TEMP_FLIPPED.pdf '7,2' MY_STORY '6,3' --outfile LAID_OUT_STORY.pdf

You now have a nicely laid out LAID_OUT_STORY.pdf to print and a TEMP_FLIPPED.pdf file you can delete.

That's all cool... but what if you're trying to print, say, a 445 page document? And you want to use 4 pieces of paper per signature for a total of 32 pages, front and back? That requires... PROGRAMMING! So I wrote a script which you can find over at my GitHub repo: signature_creator_32.sh. There's also the 2 pieces of paper/16 pages total, front and back variant: signature_creator_16.sh. If I were a not-lazy programmer I'd have written a single script that could dynamically take how many pages per signature. Oh well.

Disclaimer: the scripts don't handle missing pages at the end of your document. It does notify you if it's expecting blank pages, but what that really means is that it'll crash on the last pdfjam call. Just copy the command printed to the terminal and add in {}s instead of pages numbers that exceed your page limit. Again, if I were a not-lazy programmer I'd have written that in too, but bash scripting was... icky.

What this gets you is a new folder called output (careful! all content in existing output folder will get deleted!) filled with files temp_sig_1.pdf, temp_sig_16.pdf, temp_sig_32.pdf... etc, the number being the first page for that signature set.

So now you have as many files as you have signatures. That's obnoxious if you want to take a thumb drive to Office Max or something and have you print 3 copies of the book. So there's a second script called glue.sh that you can run and it'll reach into the output directory and squish all the temp signature files into one file called book.pdf. And that is what you print.

Warning: if you go to the last page of the book.pdf, don't freak out that it doesn't have the last page of your original document! Remember, the signature is folded so the last printed pages will actually be some 6-12 away from the actual "end" of your book. I forgot this fact once and spent nearly 5 minutes having a heart attack thinking I had printed four copies of the wrong file.

Great! Now you have a stack of paper with your content printed on it! In the case of my 445 book that means 56 pages that need to be folded into 14 signatures.... and heaven forbid you get those pages out of order. Even with them being in order it takes a little bit of a mental warm up to ensure you fold them correctly. And so, here's an animated image and some basic steps to take in order to fold correctly:

  1. Ensure the lowest page number for the signature is in the upper left corner (upside down)
  2. Take page off of stack and place it "face" down, landscape. Lowest page number now lower right, face down in front of you.
  3. Hamburger fold the page, left side atop right. You can verify correctness by ensuring page numbers are consecutive inside the fold. Lowest page number still face down. Press edge with bone folder.
  4. Set aside. Repeat steps 1-3. You can be certain things are aligned correctly when the page number offsets of lower top page are 4 apart. They increase 4, 8, 12, 16, 20, 24, etc. Looking at the ones digit it's easy to follow the cycle -> 4,8,2,6,0,4
  5. On your 4th page stop. You'll know you're done with this signature set because after the hamburger fold in step 3 the to page should have consecutive pages. This is the middle of the signature.
  6. Use a knife to slice half the fold on each piece of paper- be consistent on which half you cut. Don't cut the rest of the fold until you're done with stitching the spine. If you're going to use a guillotine, just let it deal with the fold. Brace against something flat, fold, and press! VoilĂ ! Now you have a signature!





Final note: since I used LaTex, here is what my page geometry looked like for the original PDF generated:
\geometry{
     a5paper,
     % due to the folded nature of my printouts, and the
     % failure to scale the paper correctly the bottom
     % and non-bound margins have extra space. The top
     % and the bound margin are expected to be the
     % specified offsets here.
     bottom=4mm,
     left=2mm,
     right=2mm,
     top=20mm,
     bindingoffset=15mm,
}

That's what I printed. And things looked great! And then I stitched my 14 signatures together and some skew crept in. And then I used the guillotine and came within a hair's width of losing content on the top and bottom. I didn't! But it was waaaay to close for comfort. Will definitely be adding 5mm to the top and bottom margins next time around.

Final final note: I used \documentclass[10pt]{book}, \setlength{\parindent}{5mm}, and \setlength{\parskip}{4mm}. It's tiny, but legible. Definitely don't go smaller! A little larger would probably be nice but I couldn't afford to bump the book length any longer than it already was.

Friday, August 14, 2015

Extracting comments from Google Docs

One of the best parts about Google Docs is the whole easy-to-share aspect of it, which includes an excellent commenting system.

Google will happily let you export your document, but this extra info is harder to get ahold of. From the drop-down menu you can currently export your file as: PDF or RTF (has formatting, lacks any comments), TXT (has comments, lacks formatting), or HTML (has comments and formatting). However, check out what the HTML output looks like:

That's really close to what I want, but it lacks the highlighting to indicate exactly what the comment is referencing. Or does it?

Here I've marked up all the <p> tags with a green border and all the <span> tags in blue. You can see that there are spans wrapping the formatted text, but also where the highlighted text would be. Most notably, see how "obnoxious" is split across two tags.

Unfortunately, there's no markup in the <span>s themselves to indicate which comment it goes with. There's the tag/link right after it, which will have to be enough.

<sup><a href="#cmnt1" name="cmnt_ref1">[a]</a></sup>

But now, how to tell how many of those previous span tags, working back from the link, is part of the comment? For that, you gotta' lean on the Google Drive API. Specifically, the comment's list endpoint.

Look at that! It even has the user who made the comment and the timestamp. All we could ever want. It also indicates there was a reply, which the [b] comment is. The important field it has though is context. It doesn't tell me *where* in the document that context is (that's okay, we've got the HTML) but it does tell us how much of the content the comment spans.

And that's it. Well, the basics at least. From there, it's a bunch of corner cases about character escaping and sticking together the spans the right way so you can match the context string. Haven't ironed all those out yet, myself.

For some specific examples (and some gnarly code) you can checkout some segments of my project on Github, specifically grabbing file information, content, and comments and pairing comment with highlighted text in a very brittle way.

If there's a better way to do this, I was unable to find it and would love to hear about it! Seems odd that it was this convoluted... am likely missing something.

Thursday, August 13, 2015

One Month In

So I've had a month to myself now. Have I squandered it? Probably. Lets review:

Visit all the public library branches in SF.

Am at 10 of 28 now.
Library Progress : 1
I've picked off all the easy ones, they're just getting further and further away from here on out. Mostly the western half of the city left, with a few far north and south to check out. I still believe it's a good idea, gets me out of the house. I've discovered that the Teen section of the library is much larger than I thought/remembered it was. There's apparently a non-trivial section/genre called 'Urban Teen' that I've never encountered before. Also, the graphic novel section is pretty neat. And there's a *lot* of romance novels there, more than I even expected.

Today I flipped through Emily Post's enormous Etiquette book. It was fun and enlightening.

Try to walk more than 5 miles a day.

Working out reasonably well... Travel had an impact, but I'm not beating myself up over it.
Fitbit Data
One thing that I find particularly interesting is that it's not so much that the distances increased that much (I used to walk to and from work, and then frequently out to dinner or activities), but that the "active time" is what most noticeably jumped up. Even sitting at home crafting or cooking, I'm moving around around so much more than when I sit and code.

Finish piecing/appliqué of quilt so I can start actually quilting it (and taking it with me when I travel).

Quilt progress continues, slower than I'd like. But it is progressing. There's just so much work to do. I still have about 7 station dots to sew down. And two track bends to correct. And some more border to piece together. And then the whole thing to assemble. And then the back to assemble. And then the quilting can begin. And then, yeah, there's that whole second quilt I'd like to kick off real soon here. Hmmm. Quilt progress, as it comes along, can best be tracked via the #quilt tag over on my Tumblr.

Wrap head around food/cooking.

Eh, going reasonably well. I cooked chicken for the first time ever in the oven. Pathetic, but at least I'm trying to correct the situation. I made some super awesome sourdough bread using just starter recently. Sour and chewy and delightful. Am going to take another stab at it soon.
Super tasty sour dough

Draw more.

Fucking failure. A huge gaping hole in my pretty picture of intentions. I don't know what's wrong with me. I've sat down several times, both at the Cintiq and with my pencils. Aside form Dr. Sketchy's, I've not been able to produce anything. It's getting to be a little disturbing... Not tracked in inital post, but worth mentioning:
  • Code for fun : going quite well. Have been really enjoying my Google Doc-to-LaTeX document converter project. Will make a stand alone post for that soon. Just got set up today (Tuesday) to run sutro.fm locally so I can start working on that again. Gah, I've forgotten how much I for (no good reason, really) dislike Backbone. Also, after bumping into a swarm of ex-Rdio co-workers, one after another, I feel an urge to clean up my animation patch for Thor. There's also some inventory management system project mentioned in passing by Logan and the joke-but-maybe-not-a-joke idea of contracting for a friend. And finally I'm starting to bump into enough minor nits that I don't like about Stalk like Stecker that I might need to re-write it.
  • Be more social : Seems to be going reasonably well. I have friends. They're pretty fucking awesome. They'll even hang out with me some times. There are things on the calendar. A number of them. I'm excited. Will post separately about it so as to not forget. Remember, future Rebecca. Life and friend can be good.




(written Tuesday night)

Tuesday, April 21, 2015

Winning and Gaming

Life goes on, like it does. Things continue to be reasonably well. I am sad that I failed to post something in March. We visited Hawaii, it was nice, hopefully photos will make their way online at some point.

Custom Game Pieces

I've had some minor successes here and there recently that please me. While camping at the start of the month I was Mistress of the Campfire and managed to start several fires (in the fire pit) with one match each. This makes me proud. In the last seven months I've managed to lose 10 pounds and am only about 3 away from my randomly-chosen target. In that same time frame I've gone off the pill, and despite initial fear/uncertainty stayed off of it. While I struggle with Feelings, less reliable biology, more Feelings, and whatnot I think being free of it has improved a lot of things in life. When I ask Adam if he's noticed any change his immediate response is "You want to draw all the time."

At work I've been more assertive and involved in more external facing stuff. On a recent call the folks on the other side of the line said something along the lines of my introduction being the best they've ever heard and they were happy/excited to work with me. I continue to "Make an Impression" on people. It helps that I finally feel like the non-engineers I'm working with respect me. While my hatred and loathing of Python blossoms by the day, I've been able to carve out work for myself in Java and it's a delight.

Academie : Set 1

On the art side I've had several crafting successes that makes me extremely pleased with myself. The feeling of having an idea, executing on it, and having it not suck is incredibly delightful- and sadly still quite rare. My sketching is still sporadic- I've fallen off the "morning sketch" routine and ache to return to it- but at least I'm sketching sometimes. Tonight at Dr. Sketchy's I finally won again (2nd place) which always makes me happier than it should.

On the other hand, there's been some gaming. Definitely no winning there. Have been mostly having fun, but so not winning. Except for one game of Pandemic, which was won... but when I think back on it, I'm pretty sure we were cheating...

Extended 4th Terminus session was fun- there was a map and even some dice rolls! But sadly there was also NPC deaths and damage, despite all efforts. And the party is split. And who knows when we'll ever game together again. The end is nigh.

Custom Game Pieces & Map

Played my first LARP character this weekend. Burying oneself in costuming does in fact help with nerves! Does not magically help you win however. Upon hearing my character's description, Adam asked if I was worried about being typecast, to which my response was simply :P

Game of Thrones is a horrible game. It may not displace Caylus as Worst Game (since Caylus has fundamentally broken gameplay in my opinion) but it displaces Power Grid for certain as Most Unpleasant To Play. Will I ever get to play Puerto Rico again? At least Adam and I played a couple hands of Race for the Galaxy and while he (as always) won the 2 of 3 set, I put up a solid fight each round.

Life goes on, like it does.

Saturday, December 13, 2014

Keeping busy

Been doing a lot of things these days. November feels like it breezed right past and we're about to trip over the middle of December any day now. Crazy, that...

Cranky Rebecca vs The Drugs

Been keeping busy lately. More production, less consumption. A couple things in brief about consumption.

  • Birdman was great. You should go see it
  • True Detective rocked my world. You should watch it.
  • Interstellar is lame. You should avoid it.
  • Inherent Vice is great. You should go see it when it comes out, but don't expect to understand/catch half the dialog
  • Big Hero 6 is incredibly predictable but very lovely and hilarious. I laughted out loud multiple times in the theater. Also seeing animated Japan!SF was fun.
  • I think American Horror story this season is good... I bought a season pass but just can't seem to find the time to watch the last...4? episodes. I'll get to 'em... eventually.
  • I'm stalled out in the middle of In The Woods and it's blocking me from starting anything new/better. >:-/
True Detective : Shooting

In terms of production, I've been drawing a lot. Haven't tackled many backgrounds, like I'd hoped to, but I'm working on some composition/layout stuff and "coloring" in monochrome. My True Detective fan art has been fun and gotten me the most "Likes" of anything I've posted on Tumblr. Been coding a bit in my spare time, which feels nice. I think it's because of all the rain we've been getting here this winter. So easy to stay inside and draw or code when it's so shitty out.

A nice union of drawing and coding not too long ago was a Blogger page with my 4th Terminus character lineup on it. Turns out there's too many dudes to nicely put in one static image... and I've handfuls of more characters that I should sketch! Going for just a basic silhouette and minimal character features is super easy and very fun! Check out my 4th Terminus page in general incase you'd like to know more about that game I keep talking about. And here's a picture of my character around the start of last session. Good times!

Post-Fight Jaya

Am really looking forward to the long winter break. Adam and I are psyched to be just saying around town doing nothing, no joke.

Thursday, August 28, 2014

Worken' on things

Quilt Progress

If I try hard, I might be able to finish this quilt before Thanksgiving, keeping it under a year of work. Am excited to try the idea of laying down masking tape as guide lines when I get to the actual quilting portion.

Pretzels!

Been seeing a lot of people lately, doing a lot of things. This is good. Behind me is pizza, soap making, pretzel making, dinner cooking, and gaming. Ahead of me is archery, gaming, and hopefully more dinner cooking. I have finally cooked a meal with meat, I feel so proud of myself. Want to try it again. Thanks, Hannibal, for showing me the way!

Happy Feelings

Got a lot of things going on at work. I hope this is a good thing. Learning more things. Working a bit on things that I actually use daily in my not-work life. Trying to be a good person and actually follow through with quality documentation and faster email responses. It's hard. Being lazy is way easier. Shout-out to my awesome manager who leads via good example on those fronts.

Morning Sketches : page 5

One of the problems about work going well though is that it makes side code projects hard to do. I've been really wanting to work with WebGL but can't seem to find the energy after a day of work-- and weekends are meant to be spent entirely outside, in my opinion. I got a Cardboard headset from unofficialcardboard.com and haven't yet made something for it.

So instead of coding I've been finding myself drawing a lot. The morning doodles have decreased in number due to poor sleep... but on the other hand, when I do doodle half the time I've got crazy dream inspiration. Drawing while on a flight remains solid as well-- I made some progress trying to draw the character Hayley on a recent short flight. Dr Sketchy's this month also went quite well.

Gaming : Jaya

The 4th Terminus game has been going quite well. Playing Monster Hearts was interesting. Winning at Tigris & Euphrates and losing at Glass Road was fun and makes me sad that we don't play more board games.

Monday, June 16, 2014

Tumblr is best thing

I've been fond of Tumblr for some time now, and that fondness has only grown with my usage of it.
Week 1 : Warmups
Started in on a wordy write-up on why I liked Tumblr so much, but I'm not feeling it. Brain is in image mode, not text mode I guess. The above sketch is from a work weeks' worth of morning warm up sketches, drawn while I sipped my tea before leaving the house. All of them are drawn from reference, see the tumblr post for links.

Ask me about it in person some time, I'd love to wave my hands about and rant why Tumblr is so marvelous. I don't think it is the single solution for all Internet things (see, I'm still posting on Blogger), but I find great value in what it provides and no end in sight for the delights found there. Distilled: animated gifs, fan art, community, content creation, reference photos, and simple interactions.

I continue to favor it as a dumping grounds for artwork. Currently the artwork chain goes Tumblr -> Flickr -> Blogger.

Was in Barcelona last week attending a Music Hack Day event for work. There was a minimum team size of 2 so I worked with a Paul fellow on making a web monome (he had a real monome that you could plug in and use with the site) [Github repo][Site]

It's 11:36pm and I haven't been hit with jet lag pains yet... am almost frightened by that. I don't worry about sleeping either since my eyes are already heavy, now as I type...

Tuesday, November 6, 2012

Some basic mental warmups

Am back in Munich for another week. Switzerland was exceptionally lovely and fun. More words and photos on that later.

Have finally started spending some quality time with my laptop, trying to kick my brain back into shape. Decided some simple math/graphics projects would be a good warmup. I know that I'll need to tumble into the interview circuit at some point soon and I know I *can* be good at it... but it (at least the white-boarding part) is definitely a skill that I need to retrain up.

On a whim I was interested in animating vines unfurling/growing. Some basic Googling failed to provide me any existing algorithms so I had to figure out what I want. Turns out the Logarithmic spiral [x = aebtcos(t), y = aebtsin(t)] is what I wanted (as opposed to the Archimedean spiral) and so I waded into battle against Javascript, logarithms, and trigonometry. As I put it to Adam last night, it felt like I was doing one pound dumbbell curls with my brain. It was hard (despite being simple) but I felt good when things finally fell into place.

Used jsfiddle when working, which was pleasing. Here's the link in case this iframe doesn't work...

If you go to the Result tab you'll see the demo curl I made. Am still struggling to wrap my brain around what all of the parameters do/mean but this widget makes it a little easier. Next step: cleaning up the code and diving into b-splines (which, I will confess, I have already found helpful code/algorithms for here, for the vines)

Interesting (to me?) to look back at the little things I stumbled over:

  • Omg- trig! Bane of my high school math experience! The problem I ran into here was that I wanted to rotate the spiral so that I could hold it's "tail" in a fixed position. (left alone it just spirals around the origin). That meant I spent *at least* half an hour trying to solve for θ (x′, x, and y being known) : x′ = xcos(θ)-ysin(θ) I was pulling my hair out trying to figure out how to isolate that fucking θ... the key to success was realizing I was solving for when x′ was 0 and that sine over cosine is a tangent. Sounds simple, but that took some time...

  • I swear, every time I look at the canvas element and then look away, I forget everything. Another (smaller) stumble I had was keeping everything on the canvas... turns out that when you've got logarithmic stuff, things just fly off the page with astounding speed. Took longer then I'd like to admit to figure out what value I need to scale to and then to remember/realize the scale method call had to happen before the path. (turns out putting the scale right before the .stroke() doesn't get you much). Also had to remember to scale line width. If you check out the equation for the spiral you'll see that the value a is supposed to scale it... which I realized later, but found that the animation was smoother when I let the canvas scale it rather then squishing the equation myself.

  • Pinning x=0 to one location was pretty neat, but wasn't actually the look I wanted (the spiral sat atop the point rather the to the right of it as I hoped) so I had to add in a "tail". The fact that I STILL can't figure out how to just solve the equation for a value when x is, like, -50 or something shames me but... whatever. I just manually added a fixed number of "steps" and computed that end point. Lame, but some times programming is about finding a solution and moving on rather then dwelling on the optimal solution mid-project.

  • As I move out of jsfiddle and try to make this code usable, I'm finding Javascript Function Invocation Patterns to be a fun/helpful read. I feel like I know most of it, but it has helpful points/gotchas.

In other news :

  • I am now 29.

  • I saw Skyfall last night. It was pretty sweet. Highly recommended if you're an action/Bond fan. Best Craig!Bond by far, plus evil!Javier Bardem. That man is golden, no matter how bad of hair-cut you put on him! Vague internet rumors of Idris Elba as a potential future Bond make me happy and maintains my interest in the franchise. I loved Noamie Harris in this film as well, she plays kick-ass so well (see: 28 Days Later)

  • I rode a cow this last Sunday.

  • I wish I didn't like Taylor Swift but damnit, I do.

  • The US Presidential elections. Need I say more? Adam and I will be up, watching late tonight, as the polls close in the US. We both voted before we left. GO VOTE. I WILL THINK LESS OF YOU IF I EVER FIND OUT YOU DON'T VOTE (of course I'm pro-Obama, but having things/people I don't like pass/win is much easier to swallow if there's high voter turnout. Then that *really* means "the people" want such a (stupid/silly/evil) thing... but when (stupid/silly/evil) things pass/win with low voter turnout it's just... really fucking depressing)

Thursday, July 12, 2012

Kindle & Code

Have I mentioned how much I love my Kindle? Because I love it a lot, if I haven't mentioned it yet.

Reading is one of the good things in life. Always loved reading, always loved sketching. Two of the most constant facts of my life. Reading however had always been a very passive activity for me pre-Kindle... I would read a book, love it or hate it, think about it, talk to folks later about it.

The Kindle added a new layer, a new relationship I could have with my books. It has that lovely little keyboard that lets me... I don't know what... "talk" back to the book? Talk to myself? I don't know what exactly I'm doing with it when I use it, but I love it now too. Never before could I bring myself to mark/deface a page in the book but boy howdy do I love to leave a snarky mark in the Kindle "margins".

These snarkisms were mostly just for the pleasure of commenting at the time. I'd mark it and poof- off into the Kindle either it would go. I've opened that dreaded clippings.txt file a couple times but the site of it revolted me. Quotes, highlights, comments... scattered about, hard to read, not related to one another.

Project this week has been several-fold and is still very much in progress.
  • Get a Google App Engine server up and running. I'm not in love with app engine, but it's free... so... that's why I'm using it (long long ago I thought to set up a python one but I gave up on that ridiculous idea.. phh... python! Ha!)
  • Start poking at some open/public APIs-- notably the GoodReads one, maybe find something Google related I can use... just.. you know, practice
  • MAKE A USEFUL TOOL (I'm sure there are already other Kindle clipping processors out there, I don't care)
I felt like sharing a fragment of the fruits of my labor, so happy have I been with the work... not that it's complicated, or that it looks good yet (heavens no! I'm talking to a designer friend this weekend to hopefully come up with a good UI flow) but that I have liberated my comments! Yay! (merging of comments & quotes is still a bit buggy)

I've included below the clippings from The Hero of Ages by Brandon Sanderson... a book that had lots of great ideas but toooooootally rubbed me the wrong way. It's book 2 in a 3 book series and book 1 & 3 I read in hardcover... so much criticism was never written down...

Anyway, here's my typical behavior with a book. Highlighted physical descriptions (in case I ever want to sketch characters later) and random comments.... (I've no idea what the un-commented bookmarks are for... I've stopped doing that these days)

Spoiler alert!

The Hero of Ages by Brandon Sanderson 34 entries
Location : 1957
03/01/10 12:43 AM
bookmarked location
Location : 1973-75
03/01/10 12:53 AM
" “I do have to say, however,” Breeze continued, chatting along in his normal way, protected from the ash by a parasol attached to the back of his saddle, “the ash is a tad unimaginative.” "
cute discription
Location : 1982-84
03/01/10 12:53 AM
" Black is so monotonous that you can forget about it, but red—you’d always be thinking, ‘Why, look at that. That hill is red. That evil force of doom trying to destroy me certainly has style.’ ” "
something Trisha would say for sure. sounds like her writting style
Location : 2028
03/01/10 12:52 AM
bookmarked location
Location : 2045
03/01/10 12:56 AM
hoooooow many times will we cover the same ground again and again :(
Location : 2060-63
03/01/10 12:57 AM
" The bobbing figure resolved into a young woman with golden hair, wearing a bright pink dress—one that made her look younger than her twenty-something years. Allrianne had a fondness for lace and frills, and she tended to wear colors that made her stand out. Sazed might have expected someone like her to be a poor equestrian. Allrianne, however, rode with easy mastery, something one would need in order to remain on the back of a galloping horse while wearing such a frivolous dress. "
Location : 2065
03/01/10 12:58 AM
" spinning the animal in a flurry of ruffled fabric and golden hair. "
Location : 2078-80
03/01/10 12:59 AM
" She didn’t quite “scamper”—instead, she held up her dress in a rather unladylike fashion. It would have been immodest if she hadn’t been wearing what appeared to be several layers of lace petticoats underneath. "
Location : 2103
03/01/10 01:01 AM
this whole Sazed abandoning his multi faith irritates me and makes me focus on the moromness of the author.
Location : 2105-6
03/01/10 01:02 AM
" He dried his face with a clean towel, then took out his razor and mirror so that he could shave his head properly. "
sazed description....
Location : 2111-12
03/01/10 01:03 AM
" She wore her standard shirt and trousers, after male fashion, though during the last two years she had grown her raven hair to a feminine shoulder length. "
blaaaah.... feminine hair... vin desc
Location : 2205-7
04/01/10 06:51 PM
" Most disturbingly, the First Contract contained a provision which, if invoked, would require the mass suicide of the entire kandra people. 11 "
if they all kill themselves then they release enough power to capture the Ruin. They release the power used to create them. The will do this. My theory
Location : 2218
04/01/10 06:53 PM
they are all naked though... why bother saying it?
Location : 2218
04/01/10 06:52 PM
" cold and naked on the platform. "
Location : 2291-93
04/01/10 11:39 PM
" Vin hadn’t been TenSoon’s master—TenSoon had killed her kandra and taken his place, spying on Vin at Zane’s order. Zane. He had been TenSoon’s master. He had held TenSoon’s Contract. "
oh my god. shut up already. we know this. why say it again damnit!
Location : 2335-36
04/01/10 11:43 PM
" Without her, we have nothing. We cannot create new Blessings, or new kandra, on our own! The Trust is hers, now! We should go to her. If this truly is the end of all things, then the Resolution will soon come. She will—” "
Location : 2471-72
04/01/10 11:51 PM
" Ham asked. As always, he wore simple trousers and a vest. He was a Thug, and could burn pewter—which made him resistant to heat and cold. He’d cheerfully walk around sleeveless on a day that would send most men running for "
Location : 2848-49
05/01/10 08:06 AM
" Tin helped an Allomancer pierce the mists, and Spook’s increasingly sensitive eyes were even better at this. He brushed through the mists, barely noticing them. "
we knooooooooow!!!
Location : 2876
05/01/10 08:09 AM
I'm theeditor now and I say cut this line.
Location : 2876
05/01/10 08:09 AM
" His sense of smell, like his other senses, was incredibly sensitive. So "
Location : 2988
05/01/10 08:25 AM
way too much jessu for me.... blah....
Location : 4046-48
05/01/10 07:07 PM
" We’re thieves, he’d said. And we’re extraordinarily good ones. We can rob the unrobbable and fool the unfoolable. We know how to take an incredibly large task and break it down to manageable pieces, then deal with each of those pieces. "
programmers!
Location : 4258-63
06/01/10 09:49 PM
" Noorden said, looking a bit shaken. “But . . . what if it’s not a coincidence? What does it mean?” “I don’t know,” Elend said. It means consequence, Vin thought. It means that there are laws, even if we don’t understand them. Sixteen. Why sixteen "
Location : 4282-84
10/01/10 02:34 PM
" Each slave who hadn’t been able to find at least one geode a week had been executed. There were likely still hundreds, perhaps thousands, of corpses pinned beneath the ground, lost in deep caverns, dead without anyone knowing or caring. "
omg! we know already! whats with the stupid trivial details repeating all the time
Location : 4384-85
10/01/10 02:43 PM
" “Wasing the where of what?” Spook demanded. "
this is only here, back in the past so that we can hear this style of speach agan. the author is way too in love with his concepts.
Location : 4603
12/01/10 08:26 AM
it seems like all he knows off warfair re sieges and sneak attacks. this sounds so childish when i read it... but only because ive heard it so many times before from him.
Location : 4603
12/01/10 08:24 AM
" and to endure a longer siege without running out of supplies.” "
Location : 5299-5302
12/01/10 05:54 PM
" Plus, you’ve managed—in our short three years together—to kill not only my god, but my father, my brother, and my fiancĂ©e. That’s kind of like a homicidal hat trick. It’s a strange foundation for a relationship, wouldn’t you say?” Vin just rolled her eyes. "
Location : 5547-48
12/01/10 10:28 PM
" The priests who had filled them had mostly been bureaucrats and clerks—but, then, that had been the real power of the Final Empire. Its control of resources and management of people. "
i want to stab my eyes out. we know this already!
Location : 5709-13
12/01/10 10:38 PM
" Vin stood in the doorway wearing a stunning black gown with silver trim, cut after a modern fashion. Somehow, it managed to look sleek despite the bell-shaped skirt, which fanned out with petticoats. Her pure black hair, which she often wore pulled back in a tail, was down, and it now reached to her collarbone, neatly trimmed and curling just slightly. The only jewelry she wore was her simple earring, the one she’d gotten from her mother when she was just a child. "
Location : 6751-52
13/01/10 08:21 AM
" The man was a Smoker, a Misting who could create copperclouds, "
really? do we really need to say that again 40 % of theway through the book?
Location : 7637-38
20/01/10 07:27 PM
" Ash rained down like shards of a broken sky, floating, making the very air look pocked and sickly. "
what the hell? shards ash floating? wtf?
Location : 8985-89
24/01/10 11:58 PM
" Sure enough, as he read about the religion, he saw the holes in its doctrines. True, the Nelazan had known a great deal about astronomy, but their teachings on the afterlife were sketchy—almost whimsical. Their doctrine was purposefully vague, they’d taught, allowing all men to discover truth for themselves. Reading this, however, left Sazed frustrated. What good was a religion without answers? Why believe in something if the response to half of his questions was “Ask Trell, and he will answer”? "
dig at unitarians?
Location : 9558-59
26/01/10 08:15 AM
" The power in the Well was of Preservation, and an Inquisitor could only have taken it by first removing his Hemalurgic spikes. That, of course, would have killed him. "
nut vin removed it and she has that earing...

Wednesday, June 13, 2012

Shhh! In-progress work

Efforts to sew were thwarted by a missing presser foot holder and then by my model for the next apron I'm sewing being off at a baseball game.

Spent a very dazed evening coding... several quick points:

  • My 13" Macbook Pro is so cute and tiny and doesn't BURN when I sit with it on my lap (see: work 15" Macbook Pro)
  • Coding at work and then coming home and coding some more = unhappy eyes and brain pan. I feel kinda dizzy and not-awesome. I also forgot to eat more then just an egg for dinner. Feels like college all over again.
  • Visual Design is hard. Haaaard. It's so easy to wave the data together but I don't know how to wave the user's brain into the system.
  • I tried to use Twitter Bootstrap, I really did... but those tables, they just solve all my problems...
Found out that I can host content from my DropBox! Oh joy! No idea what the bandwidth limits are like.... Will get the Stereogram project up soon.

Anyway! Ratio Recipe Manager

The page may look terrible, but I've been using a much simpler/stupid version of it for my last 4 loaves of bread (at least). I aspire to improve the saved-info functionality, and make adding ingredients easier. It would also be a nice challenge for myself to make it not look like ... like it does now.



MMMmMMmmmm.... Knockout.....

Thursday, March 15, 2012

Life in February

Went out to Colorado last week for work. Not sure if I mentioned it, but my company was acqu-hired by these guys last month. They're based in Boulder, Colorado but, no, I will not be moving out there.

Turns out everyone in Colorado (at least the Boulder & Fort Colins portions I visited) is crazy nice. Like... kinda' spooky nice. I hadn't realized how jaded I had become living in SF...

Work is still working along though. We're still using the Play framework (1.2.4) and I gotta' say I'm a huge fan. Several people on the team have become slightly disillusioned about aspects of the framework but not me. As long as you're willing to accept that their testing framework should be taken with a very large pinch of salt and that you're going to have to brush up against more static methods then you'd like, it's great.

Also, we are using git and I've sorta' pushed myself to the front of managing our transition from the basic "working off the master branch" to something more like the git-flow behavior. I've had at least two nights of intense git dreams now... not nightmares, but not exactly restful. I still haven't mastered rebasing, but other then that I'm finally starting to feel pretty damn comfortable with it. It helps that we're using FishEye and it visualizes everything fantastically. Also, we're using Crucible for code reviews. THAT is super awesome.

Just switched some UI code the other day from a janky "jquery hacking at stuff in Spine" over to Knockout. OMG Squee! I've talked about Knockout before and I gotta' say- it still rocks. Working with it just feels right. Like a fuzzy code blanket that you wrap yourself in and sigh, knowing that everything will be alright.

We're still using Coffeescript and it still makes me mutter under my breath. I don't have any problem using it myself, but I apparently have a problem accepting that folks are going to write code in the Coffescript way which means no method ()s and using the words "and" and "or" in their conditionals... and that conditionals/control structures sometimes go *after* the statement they're controlling.... It's like... like... WHY? Why? I refuse to believe you gain anything by leaving off method ()s-- it just makes it harder to read. Coffeescript CAN be written in the "usual" way. Maybe if you don't know how to program the "English" style of coding is helpful, but personally I've learned to read code that looks like Java, JavaScript and C++ and have optimized my code skimming/scanning behavior for things that match that.

I've said it before in the office, but reading Coffeescript feels like reading a Cormac McCarthy novel-- I'm sure there's a great story/stuff there, but WHY? You can leave off the quote marks in English and ()s in code and I can figure out what you mean but it's not helping anything. It's just really fucking annoying.

Also- no {}s? WTF.

Speaking of questionable ideas, I've for some reason started to express interest in cooking. Talk about being a late bloomer. It helps that I bought an immersion blender aka spinning blades of death machine. That's fun.

It's not fra-la-la-la cook anything interest though. I've got 1.5 very specific dinner party plan ideas with specific dishes I need to learn to cook. So... yeah, I'm working on that....
Eggs & Needles

In fact, I'm so dedicated to the plan, I'm shelling out ridiculous $$$$ x more to take a pasta making class at Flour + Water (it comes with a dinner so I guess that makes it reasonable?). I'm also going to the Gastronomy event at the Exploratorium.... So we'll see how this all goes....
Put it in the oven?

But with every up, there is a down... Increase in programming thoughts + cooking = decrease in ... ? Sewing? Drawing? (could it get any infrequent?) I'll probably miss the gardening boat this spring...

Eggs & Needles

Wednesday, January 11, 2012

Programming in Paris

Still in Paris. Things are going ok. Did you know that there are NOT fireworks around the Eiffel Tower on New Years? We didn't. No biggie, but still... a pinch of a let down. Adam emailed the Rick Steves Paris 2012 travel book we have with the correction.

So, yeah... no fireworks. And there was this whole being sick for a week thing... Spent a lot of time in our rental sleeping... and... sleeping... there was some reading at least. And sadness.

But! But! Things have been getting done! One of which was the porting of my Java Stereogram program to HTML5! The algorithm is from http://www.techmind.org/stereo/ which is great. Very dry, but I did eventually wrap my head around everything it was doing... back when I implemented it the first time ~3.5 years ago... It was a sample code project for a job application, and after combing through what I wrote back then I'm shocked I ever got hired. It was my first Java project after school and clearly I had a lot to learn. Amusing that I'm using the same project to learn/poke at HTML5 with... I've no doubt I'll look back later and wince at how ugly it all looks...

Took a little under a week of scattered work. Mostly debugging. Fucking lack of typed variables! Ran into lots of "Javascript doesn't have ints" problems... yes, yes, you can cast the value... but remembering to cram everything back into int format is not the same as/far more trixy then just having values that are and will always be int. Grrr...

----- Java ------

int b, c;

int a = b - c/2;



----- javascript ------

var a = Math.floor(b + c/2); // WRONG

var a = b + Math.floor(c/2); // CORRECT

Adam gave me a hard time about it after I found the problem. I mean, *yes* I know the difference between the two and I realize why I was getting problems.... but... when I'm re-writing code quickly, I feel like it was an easy mistake to make... :(



Another gotcha I ran into was with Canvas (a major part of the learning exercise). When trying to scale an image, remember to transform before drawing the image.... This makes total sense when I think about it (and given how other graphics stuff works) but, again, slipped my mind.

ctxt.scale(scale, 1); //don't be retarded, remember this goes BEFORE the .drawImage call
ctxt.drawImage(otherCanvas, 0, 0);

A final thing to note is that I'm using this project as an excuse to finally work with git. Yes, I know I can set git on my own, but I didn't see the harm of using github to track the work. Now all I need is an actual web hosting service to host the page! Anyway, I'm still very much working on the Stereogram code so don't judge too harshly by what you see uploaded now... I'll post again when it's pretty (and hosted) : https://github.com/sithel/Web-Stereogram-Generator

Todos:
  • Lift code to let you save canvas images
  • Made the page less ugly
  • Make sure everything works (just now fixed another rounding bug)
  • Add some tests
  • Provide sample images for depth maps and tiles (the quality of the tile can greatly affect the result!)
  • Find hosting for it
  • remove JQuery need- only used that because I was lazy initially

Wednesday, October 19, 2011

Thrashing and Agile crafting

Am totally thrashing on crafting now. I've got intense urges to draw (with reasonable results), perhaps in feverish anticipation of the Inkling I plan to buy the second they go on sale. I've also got a half-skinned Zergling plush to finish, a Frankenturret plush to rev, a Frankenturret model to do final touches on, a Settlers of Catan quilt to limp along with, and a Halloween costume to plan. ... So instead I've found myself playing Mass Effect the last couple nights to chill. And any time I do pick up a craft, all I can think of is the other things I should be working on (or worse yet the nigglings of new ideas).

Despite this, I have been making minor progress. The weekends have been clobbered recently with socializing (parents in town! friends hanging out!) which leaves me only the evenings to squeeze in an hour or two of something (given how often Adam and I eat out and how much time that takes up... who would have guessed hanging out with your S.O. would consume so much time!)

I dislike the concept of Agile software development as I've actually encountered it so far. I think the ideas are nice and reasonable enough, but the way it has evolved at work is very displeasing... But! Let that not sully the entire Agile idea. I feel my recent (ongoing & diverse) Portal 2 projects sort of embody some of the basic ideas... Recently I was under the impression I could make a cute Frankenturret plushie that met the following requirements :

  • low complexity
  • machine sewable
  • durable
  • no non-snuggable parts
  • cute
  • small-ish
  • These are all things I'm bad at and need practice with. Which means it shouldn't be surprising that the first results look like shit:

    The scale is too small to be reasonably machine sewable... I've no experience with fleece (though I must say it is awesome!) and I've stared too long at frankenturret details to easily abbreviate it. So much failure... But the point is iteration! I can't just expect it to be perfect on the first go. I've got to rev my designs, put forward due diligence to get each rev as close to the "done" state as possible, but not obsessively dwell or grind to a halt if it doesn't turn out the way I like it. Try again! Am giving up on the machine sewable portion rule (at least for the head) but hope to hold onto my other goals. If anyone has any ideas, I'd be very open to them!! The 'less is more' design concept for 'cute' is a struggle I seem never to be able to win.

    At least I have my stalwart Catan quilt to stand by. It lives on the empty stereo box now and is mainly Duck's perch in the den. I'm down to 5 tiles to edge and then it's playable!!


    The darkening days has it's pros to counter the obvious cons. The season of coding approaches. I'm excited to be getting back to the Tichu project soon. Coding while the sun is up is ridiculous... but now it's well into dark by the time I get home... which means my time will have yet another contender. Along those lines, I was at work until 10-something tonight. Working on a KnockoutJS demo for our project as it shifts into the wondrous realm of JavaScript. Holy poop- Knockout is flipping awesome. Seriously! I've no doubt I'll be doing the Tichu client with it.

    Saturday, September 10, 2011

    Coding... just not recreationally...

    Things at work have been pretty fun lately. Normally our client is in Flash but we're poking at some web stuff. And by we, I mean me.

    Mostly I've been trying to work out some new visuals to display energy savings information. So graphs. The product people come up with the actual design ideas, but I've got to make the picture into an interactive page. I was pointed towards the awesome D3 graphing library by Adam but it's not compatible with IE before version 9, which we can't accept. Too bad, because D3 looks great.

    Instead I've been poking at the Raphaël graphics library. It's really easy to work in and I recommend looking at it. The internet has come a long, long way since I last poked at it back in high school.

    The neatest thing of it all is poking at graphics. Like, graphic stuff independent of whatever language you're in. In one of the rare cases of me actually finding something I don't know the name of, I started looking into some circle packing algorithms. While there is a JavaScript libray called moocirclepack, I think I'll pre-compute the packing on the server if we decide to use the visual.

    Am currently looking into fitting a nice curve to some data points, which has me reading up on Bézier curves. The program people just started talking to a User Experience? Interaction? contractor today so hopefully they'll have even more interesting requests for me to implement.

    Over dinner tonight, both Adam and I agreed Javascript is a pretty sweet language. It's the nicest untyped one I've experienced so far... it's so damn easy to work in!

    Tuesday, August 9, 2011

    Knowing the words

    One of the things I'm worst at is words. Terrible. I always like to say I'm good at talking to people. Silly contradiction. I believe both statements true, but I'm not really clear on how that works out. I think the "talking" I'm good at is actually called "making a connection"... not the kind of talking that conveys in real, solid data.

    Anyway, it's hard to be good at something in a technical/work sense when you can't speak the jargon. So I've known of "closures" for a while. And I'm pretty sure I knew what a closure was even though if you had pressed me for a definition I'd have waved my hands about and said something about functions and private data and scope. Hacker news and some spare time at work resulted in me running through this:

    What's a Closure?

    Absolutely love it. Love it. It starts off slow (almost painfully so) but builds ever so nicely! I had a hiccup at #9 due to some typos/sloppy code and in #10 I forgot a return statement and failed to "see" that I had missed it for, like, 10 min.

    Our... "PM"? McCool (yes, that's actually his real name) went through it as well. He has some minor programming experience from college but not much and he was stumped on a couple, but he worked through them. Which is awesome. Interesting how he actually read some things closer then I did. He raised (what I think is) a valid point about #7 which I didn't even see/consider. Relating to the fact that there's no guarantee the return value of f() is constant. Also, when he questioned me about a block of example code, my mind skipped around and was almost unable to process the code during the conversation. Very interesting.

    Also, there's talk about doing an HTML5/JavaScript customer facing project at work, getting away from the sucking hole of hell that is Flex 4. Woot!

    I still love Java the most :P

    Wednesday, July 27, 2011

    Smart people learning to program...

    This post is about taking on challenges. Here is a photo of my cucumber plant ready to take on any challenges. See that? He's holding a fucking hat pin. Don't mess with him or he'll fuck you up. Take that, challenge!

    My sister (the middle one) has embarked down the respectable path of acquiring a PhD in the field of... bio-chem-ish-something... She's over out at U of Madison which is nice because that means she's living near our father's side of the family. Nice people, them.

    Anyway, dear sister K and I don't talk much, which is fine. We're rather different folks... but just last week (or so) ago I got an email out of the blue notifying me that sister dearest has signed up for a class on Perl! Oh joy! Never before has she shown the slightest interest in programming and now she is (rather unprompted) elected to take a class on it. Unfortunately it's an intense summer course with classes every day and it failed to notify her of several pre-reqs that are kinda' required. Or at least suggested... and oh my how she should have taken them. I've been talking her through a couple subjects... it's been a while since I've "taught" programming and it's... different with A) a sibling B) someone who isn't a child/dumb AND isn't really into it. It means she's bright enough to get it but doesn't quite... go out there and try to learn. No- she is trying to learn. But she's not trying to.. really dig in and grasp everything?

    Subjects that have confused her so far :
    • Hashes. Somehow her professor phrased something in such a way that she basically thought hashes were a collection of key & value pairs where *every* pair you gave it was stored. She thought she could add several sets of pairs all with the same key and then request the set of pairs that matched a given key and iterate over them. I feel bad because I can totally see how that could make sense... and yet she really, really had to struggle to get back onto the right track. You know, the whole "keys are unique" idea...
    • Debugging. She gets stuck and then... I don't know what... I told her that she really should be printing out the values of things to "check" them but it just... it doesn't seem to click with her. She prints some now but without additional comments (so the spew is a really confusing jumbled mess) and not all the information. Also, walking through the code. I can't tell if it doesn't occur to her or she can't do it herself. When we do it together she can quickly spot the problems...
    • Initializing values. Several times now when discussing a problem with her I realize she's initializing some value inside a while loop and over-writing the existing data she was hoping to collect. We had a long conversation about the idea of conditionally initializing something and it... didn't go well. This is the most fascinating problem of them all to me because I cannot figure out what her brain is thinking...
    Anyway... have been having several (of my first!) video conferences with her. Talking about programming is fun but I'm severely out of practice. And an even worse word-garbler then before.
    In the theme of things over-coming obstacles, here is a photo of my cucumber plant from last week. Notice that it has a baby cucumber on it. Fuck yeah! Take that you tiny-container doubters!! (to be fair I've no reason to believe it will actually make it to maturity yet...) Also- all 3 of my edamame plants of popped out pods... even the severely retarded/bonsi one. All pods scaled to the appropriate size so far.

    Friday, July 15, 2011

    Generics Suck

    Never before have I experienced such rage and failure with Java as I did this week at work. Blah.

    Not only did I find finding documentation about it difficult but talking to someone about it proved almost too much. I suck more at knowing the vocabulary then I normally do.

    I'm having difficulty articulating what exactly one of the problems was... It had to do with the fact that :
    List<subclass> extends List<superclass>
    doesn't really work, you need:
    List<subclass> extends List<? extends superclass>

    All my method and class signatures got super bloated and became obnoxious to read.

    Also, while this didn't really factor into how I was fixing the problem, I was boggled to learn something new about the Java language. I may not be great at a lot of things, but to find something totally new after a couple years working with it is... surprising. And perhaps sad.

    Anyway, did you know that you can pass type parameters to a method? Like:
    fooObject.<X,Y>barMethod();
    Woaaaah! Crazy! I'm used to only seeing instance variables and constructors use the <>s when declaring something...

    In other news, in other areas where I suck less, I still haven't killed any of my bottled plants. In fact, several seem to be thriving.

    Sadly the lettuce (not pictured) is getting rather wilty... so that'll probably be my second failure-- the first being that the catnip NEVER SPROUTED. Everything else I've grown from seed just fine, but the catnip refuses to wake up. Damn.