Tuesday, April 29, 2014

Thanks HackBU Hackathon!

Sleep-impoverished and in between HackBU organizers Daniel O'Connor and Peter Liu

This past weekend I had a lot of fun at Binghamton University's first hackathon, where I spent 24 hours coding a prototype of what would be the second-place(!!) prize winning project BearCatBus, a real-time bus schedule app for the Pebble smartwatch, a device which I had never seen before this great event but now kind of wish I owned. The experience was inspiring and educational and the organizers did a thoroughly good job; I only wish I, like the lucky current freshmen, could have three more years with three more of these hackathons.

Though my demo at the closing ceremonies was (if I may say so myself) sloppy and incomprehensible to the point of being offensive, some have nonetheless expressed that they want the app for their Pebbles or want to help flesh it out. It's open source and it's on GitHub but it's a rough prototype, and I unfortunately lack a Pebble to continue working on it; I hope to make an in-browser webapp and maybe Android/mobile web version of the idea in the coming weeks, to make this something usable to everyone with access to a computer. But if you're a Binghamton student and have a Pebble and want to meet up one weekend (I only have about two of them) to work on it with me, my contact information is on my main website.

Meanwhile, I will be thinking of ideas for this new Raspberry Pi. I'm thinking something using a service like SendGrid (like my peers' award-winning 2048-SendGrid project) so that people can send it an email or tweet and it will do something interesting. I'm honestly open to suggestions here.


I will definitely think of more stuff I have to say about all this in the coming days and will probably edit this post -- I just wanted to get a blog post out because I haven't put anything here in forever and the HackBU folks deserve much thanks.

Thursday, August 1, 2013

Consider Not Using CutePDF to Save PDFs to TrueCrypt File Containers

Lately I've been in the habit of saving copies of emails to my computer, and then deleting the emails from my Gmail account, being a bit more comfortable with personal data (such as receipts) off of Google's computers. For sensitive information, I put some email PDFs in TrueCrypt file containers.

Today, I decided to poke around my registry for viruses, etc. To my very slight horror, this is what I found:


That was one of the most recent files that I saved using CutePDF, an Acro Software product -- to my TrueCrypt file container. I guess this is useful if CutePDF wants to recall the most recent directory it printed to. I've looked through the limited program settings, but there doesn't seem to be an option to disable this feature.

Sunday, June 5, 2011

Page Archive

Not much to say about this program; it's very self-explanatory, besides the fact that it will only work with Linux computers with working scanners attached. Also gthumb, scanimage, and pygtk are required (though you can use different programs than the former two by editing the config.) I find it extremely useful.



http://code.google.com/p/page-archive/

Friday, February 11, 2011

Writing and Coding

I have always wanted to make a good comparison between writing in English (or any similar language, or even possibly dissimilar ones) and writing code. I have been proof-reading some writing for a friend recently and I have come up with a good comparison:

When you are done writing some small bit of code, you usually test it. If it does not work for all values of input, you carefully read through each line of the code to see what has logical errors. You continue to retest until the code works for all inputs.

When you are done writing some small (relatively; an essay is the largest I would consider small; though, what I am about to write applies to larger pieces. I have no experience with writing things like short stories or novels so I won't go into them.) bit of English, you do not have to test it. You can assume that there will be syntactical, logical, and structural errors. So to be a concise, clear, robust writer, you must carefully read through each line of the text to find these errors. Then you release it into the wild, like your blog.

Saturday, January 29, 2011

"They"

As an undergrad, I hear the term "they" a lot. What "they" want "you" do to. The work that "they" want "you" to show when doing a Calc II "problem". I honestly think this is a very bad way to go about wording things when teaching to students of any age. When you, the instructor, use these pronouns, you make the education of your students revolve around "them". The people who write "the tests", the people who have written "the tests" and will be writing more tests. The point of teaching any form of calculus (passed the superfluous Calc I, from which I have seen questions such as "what is the graph of |y|=1?", at least at SUNY Binghamton) or any theoretical (or even practical) study is to build a foundation of thinking for higher practice. Calculus is the foundation for some higher math and most higher physics. If you are teaching a convention, it is not because of the rules; the rules are, hopefully, incidental of the convention's strength.

So forget about what "they" might want. When you're discussing standards or showing work, and a student asks how they "should" do something, style-wise or otherwise, say not "this is the way they want" but "this is the way that makes the most sense".

Unless it doesn't make sense. Then mention "them" by name and insult them appropriately.

Tuesday, January 25, 2011

An Anagram Solving Bot In Python

This article will detail how I made a bot in Python that can solve web-based anagram games. I wrote it for people with at least a beginner's grasp of Python and programming languages. I originally wrote it for a joint blog my friend and I were starting but it never got started. It is half a tutorial, half a 'look what I did!' post.

Any experienced developer knows that before you can run a program with an interface of bells and whistles, it is best to write a command-line version; reduce the problem to a command, and it becomes an algorithm. Therefore, before I made the bot itself, I wanted to make a method that solves anagrams, as many times as I wanted, whenever I wanted.

Saturday, January 1, 2011

heart.py: String macros in Linux with Python

Here's something I made after discovering the Python module virtkey: a way to bind macros that type out strings for you to keyboard shortcuts in Ubuntu (and most likely other Linux platforms):


import virtkey
import time
import sys
time.sleep(0.5)
v = virtkey.virtkey()
if len(sys.argv) > 1:
    str = sys.argv[1]
    strords = [ord(c) for c in list(str)]
else:
    strords = [9829] #heart!
for i in strords:
    v.press_unicode(i)
    v.release_unicode(i)


The fourth line (time.sleep(0.5)) is a necessary hack: When you bind the keyboard shortcut, you will likely bind it to Windows + a letter key or Ctrl + Alt + a letter key. The delay gives you time to release those held mod keys before virtkey starts typing the argument, or if there is no argument, a heart (♥). It would be run as:

python ~/heart.py "hello, world!"

And one could keybind it with the Keyboard Shortcuts dialog in Ubuntu, or a similar tool in other Linux distros. The original script can be downloaded here. It's also in my code scraps on Google Code

The idea is, for developers or other people who have strings that they use a lot and would like to keep on a permanent clipboard, to bind oft-used strings to Windows + 1, Windows + 2, ... , Windows + 0, for quicker access. This has probably been done with multiple-clipboard applications, but this was still fun to make.

Followers