Skip to main content

Posts about recursecenter (old posts, page 4)

Recurse Center, 2014-07-06

I took it easy during the weekend, and went on a nice camp with my a cousin's family to TobyHanna State Park for a day or so, and spent the remaining (long) weekend at their place in PA. It was a pretty nice break!

Yesterday evening, I talked to Madhu about how ugly my code looked while I was trying to use libclang, and he told me that he found a lot of wrapped C++/C libraries end up being that way, and I also realized that using the Python AST library seemed much cleaner, because it just contained Python objects, but representing C/C++ objects in an AST and interacting with them in Python, isn't that clean.

I cleaned up my code, and removed all the ugly regexes to use libclang to do the parsing of the libs, and get the source code. I basically got all the tests passing, but they were taking an order of magnitude longer to run. So, I guess the next step is to cache things somehow.

I also added support for viewing the sources of built-in types. It was pretty simple, once I had everything working with libclang.

Recurse Center, 2014-07-02

Recurse Center, 2014-07-03

  • I got distracted trying to add a hack to Hacker School's blaggregator, to enable posting to different channels on zulip.
  • I learnt a few things about Django. Commented out references to views that don't exists breaks templating. Formsets didn't seem very convenient to use, for editing data showing the user only partial forms.
  • I played around with Clang for a bit, to try and use libclang to parse the C code for inspection, instead of writing one myself. It sometimes feels like an overkill, but it feels like it'll make the whole code more robust. I'm not sure. I'll need to play around for a bit more to decide.
  • I also finally got around to fix the resolution of my tty shells. I was in a bus, and wanted my laptop's battery to last longer, and decided to use a tty shell with just emacs running. But, the resolution sucked. So, I fixed. Essentially it involved removing a blacklist file that an old version of Nvidia drivers left behind in /usr/share/grub-gfxpayload-lists/blacklist/ and setting GRUB_GFXMODE=1920x1080 in /etc/default/grub.
  • Later in the evening I also bought the domain, given there were a bunch of people buying cat domains, and talking about it on Zulip!

Update [7/7/14]: I forgot to write about the presentations. There were interesting presentations!

Recurse Center, 2014-07-01

  • I happily let myself get distracted from all the math! I had seen a tweet by Tom during the weekend, asking if there was any package that let users inspect C sources of builtin modules like ruby's pry-doc
  • I spent the morning playing around with pry-doc, reading its code, etc.
  • The latter part of the day was spent pairing with Tom, and figuring out what needs to be done to write a first cut version of something like this. Ugly regexes, FTW! I have something that works for most of the stuff, it seems!
  • I also attended an interesting talk about Bit-torrent clients by an alum.

Recurse Center, 2014-06-30

  • During the weekend, I read up a lot about HMMs and related stuff.
  • During the day, I tried to start writing code for different parts of the pipeline, and ended up reading about Mel frequency cepstrum related stuff, and wrote a little bit of code.
  • Later, in the afternoon I paired with some of his iOS code, and helped him clean up some of it. I'm not sure how useful it was for him to pair with me, but …
  • The day ended with a talk by Jesse at EBay, titled Write an Excellent Programming Blog. I had already read up his blog post, when the talk was announced, and so, most of the content was known, but the Q&A session had some interesting suggestions on how to improve your actual writing.

Recurse Center, 2014-06-27

  • This Friday we worked on building our own URL shorteners. It was a fun exercise, and I built one that is not persistent, in the two hours. I worked on a not so important problem of having sorted query parameters, instead of the more important problem of having a persistent server. Anyway, I should be building something that works, first, before trying to solve the more interesting problems. At least on Fridays.
  • I watched this old but interesting talk by Brandon Rhodes, titled The Mighty Dictionary, and played around with his _dictinfo module after-wards.
  • I spent the rest of the evening reading up about Markov chains and Hidden Markov Models. I'm happy to finally understand what these terms mean, after seeing them being thrown around for so many years!

Recurse Center, 2014-06-26

  • I played around a little bit with my emacs configuration and got jedi working, with virtualenvs, thanks to virtualenvwrapper.el
  • Continue to work on the singal processing stuff and built a DTMF decoder using FFTs. It's able to decode audacity generated audio, but not recorded ones. I'm not sure what I'm doing wrong, yet.
  • As with every Thursday, there were a bunch of interesting presentations:

Recurse Center, 2014-06-25

  • I like how some of the people here are taking check-ins so seriously. A bunch of people posted messages on Zulip, informing that they would not be able to make it to check-ins, and seemed quite sorry about it.
  • Check-ins are indeed useful. At the end of every day, I review my work wondering what I did, and sometimes end up pushing myself harder, to have something reasonable to talk about during the check-ins!
  • Yesterday, I read up about FFTs and ended up playing around with fft in scipy, and played around with audacity, etc. Nothing concrete, really.
  • There was a "goals" workshop by Stacey, where she talked about how to get the most out of this batch of Hacker School, and then we split into groups of 3, and presented our goal-statements to each other, and gave our impressions of each others' goals.
  • I didn't really have a goal, but the exercise seemed to help, anyway.
  • Also, I think it is making me nervous to treat Hacker School as super-important. It is important to make the best use of every hour, every minute here, but at the same time, I shouldn't be constantly worrying about whether or not, whatever I'm doing is the best use of my time here.
  • I think I would like to form some good habits, and make a few good friends, more than finish projects and build something uber-cool. Of course, it would be great to build awesome stuff (and may be the only reasonable way to form habits, and make friends) but I shouldn't worry too much about time running out. Never Graduate!

Recurse Center, 2014-06-24

  • I worked for the whole day on implementing an algorithm to analyze a cipher text, and guess the substitution cipher used. The algorithm was pretty straight forward, and I had it "mostly" working, in a couple of hours.
  • I then began to refactor it, and found that there was what looked like a bug, and I "fixed" it mindlessly. I was essentially trying to swap 2 rows, and columns of a pandas data frame. I had a data-frame D and its copy D_. I was trying to swap 2 rows and columns of D_. I found that the code was initially using the data from D to do the swap. To fix it, I checked if tuple unpacking did the right thing. It looked like it did. So, I used something like _D['a'], D_['b'] = D_['b'], D_['a']. Essentially, changed D on the right hand side to D_. I thought I had tested this on the terminal, but after hours of debugging (along with fixing another minor issue), I later found out that the tuple unpacking doesn't work and the swapped rows and columns actually become equal! I had suspected this initially, and had "tested" this manually, I thought. These are the kinds of things that should have tests for, I think. It wouldn't have taken me too long to write a test, and I could have been totally sure that it works! (I was manually reading off values in the array, and probably messed up somewhere)

    FWIW, the code now reads _D['a'], D_['b'] = D_['b'].copy(), D_['a'].copy()

  • The algo seems to need about 1000 characters to get past the 90% accuracy mark. I could probably tweak it a little to perform better, but I'm going to leave it here, for now, and move on to the signal processing parts. I'm not totally sure how the signal processing would work, and whether we could actually map back the keystrokes to a substitution cipher enciphered text.
  • If required, the tweaks could be -
    • Use trigrams instead of bigrams
    • Add a degree of dictionary look-ups: May be something like, look-up all the deciphered words, and try not swapping the characters that appear in most of the words that are in the dictionary.
  • This paper is 20 years old, and there would surely be work by others building on top of this, or doing it totally differently.

Recurse Center, 2014-06-23

  • The Apprenticeship patterns book is very interesting! I shall continue to read it and start create daily/weekly rituals from the actions prescribed in the book!
  • I was reading this post on git gc, reflog, etc. and wanted to see what the default values were for some of the configurable variables. But, the git config command didn't help. Developer/code defaults are also a part of the "config" system, and any tools to inspect config variables should display them, if no other values have been set explicitly!
  • "If experience is built upon failure as much as success, then you need a more or less private space where you can seek out failure." – Apprenticeship Patterns.
  • Our check-in groups changed, but 3 of us from our last check-in group are together again!
  • Most of the day was spent with Git. In the morning, I learned that setting push.default to nothing will prevent pushing any branches without specifying explicitly which branch I want to push.
  • Also, later in the day, Alan gave a presentation mapping the internals of git to the commands, trying to give everyone a better mental model of Git.
  • I spent some time trying to get jedi integration for emacs. It should've worked out of the box, but I'm not sure the ELPA repositories have proper dependency/version management. Seems to be the problem, everywhere! Dependencies of a package get updated, and the package starts acting up…
  • Chaitu sent me a link about solving mazes using Finite Automata, and I spent some time trying to write a simple solver, and compare it with Nava's breadth first search. But, it looks like we broke her code during the refactor. I may get back to this, at some point.
  • I also spent a few minutes talking to Kyle, while he was trying to implement a simple version of the NTP protocol. The algorithm it turns out, is pretty simple.
  • I started reading a little bit on crypt-analysis for Simple Substitution ciphers, and I'll try implementing one of the algorithms today.
  • The day ended with yummy pizza and video watching! We watched –