Skip to main content

Posts

Python classes and getattr

I banged my head on this all day, and it's really stupid because I didn't read documentation carefully. I had a python class where I put the @property decorator on some instance methods, and later on, I called getattr(some_obj, 'name_of_method')() and kept getting 'unicode' object is not callable So the problem was the @property decorator, it seems, because getattr() was getting the actual value of that some_obj.get_id() before invoking. I removed @property and bam, it worked... only like 3 hours later.

Theory studying progress

So. I've been trying to study up on basic alg/ds theory. Here are a few things I discovered: I have grown a deeper appreciation for all the universities that put their class materials online, like UCB EECS, MIT OCW, etc. And Khan Academy and YouTube have also been helpful. CLRS is a dense read, but surprisingly enjoyable. I think I'm enjoying it as much as I did K&R and SICP. I'm not good at alg/ds code implementation, but it feels really great when I finally get something working. :) Studying this stuff is like a full time thing...

Compiling pgmodeler on Yosemite (with Homebrew)

Refer to  pgmodeler installation . Steps: Clone the pgmodeler git repo. Use Homebrew to install qt5 (5.4.2, see here ), libxml2, and postgresql. Edit the pgmodeler.pri (not .pro) file and change these variables: PGSQL_LIB = /usr/local/opt/postgresql/lib/libpq.dylib PGSQL_INC = /usr/local/opt/postgresql/include XML_INC = /usr/local/opt/libxml2/include/libxml2 XML_LIB = /usr/local/opt/libxml2/lib/libxml2.dylib Follow instructions to compile pgmodeler (you might need to put Qt's binaries in your PATH. I was lazy and didn't). $ /usr/local/opt/qt5/bin/qmake pgmodeler.pro $ make $ make install $ cd /Applications $ /usr/local/opt/qt5/bin/macdeployqt pgmodeler.app -executable=pgmodeler.app/Contents/MacOS/pgmodeler-ch -executable=pgmodeler.app/Contents/MacOS/pgmodeler-cli Then I was able to do $ open pgmodeler.app

Building and installing CAN bus bundle on Kura/Eurotech Software Framework

The documentation is incomplete as of 11/25/2015:  http://esf.eurotech.com/docs/how-to-use-can-bus . It shows you how to setup the can0/can1 interfaces. I think I finally figured out the real steps to getting the CAN bus service working in Kura. I found this website somewhat useful:  https://tobiddev.wordpress.com/2015/03/23/one-bundle-project-modbus-and-eclipse-kura/ . It didn't tell me how to build a bundle, but I took a chance with the following and now I'm able to see my module loading the CanConnectionService in the Kura logs. First, build Kura from source following this guide:  https://wiki.eclipse.org/Kura/Getting_Started . You'll probably want to build it in Linux (I am using Debian Jessie) or possibly OS X (I didn't test it). For sure, it fails in Windows 8 at the create_installer.sh part, so I decided not to waste any more time on it. You basically need Kura built just enough so that you can load everything into Eclipse. I was able to do this using Eclipse...

New stuff everyday

I finally got my own copy of CLRS. This is legit. Well, it's only legit if I really start studying. I'll give an update in the next few days... In other news, I finally figured out how to draw nice arrows in Paper53 .

End of year resolutions

Not really, but sorta. I finally figured out, ten years late in my career, that I need brush up on theory and just do side projects. Even if I'm no good at it. Starting with coding up data structures and algorithms. In C++. This past week, I did a basic doubly linked list (at least, I think... I'll need to check it against what I find in Google) and then will do a queue and stack, derived from the linked list. I'll also start binary search tree this week. I've also begun reading up on Java 7 and need to start a project with it.

Coding in Windows

I'm late to the party again, but I just discovered ConEmu . For the last year or so, I've been using Git Bash (and prior to that, I used cygwin). I can't remember why exactly I switched away from cygwin, but I vaguely recall that something funky happened when I was trying to develop something while using cygwin, and then I told myself never to use it again because I was so annoyed. Git Bash seemed to be the most straightforward and simplistic thing to use for <whatever I was trying to do>, so there I went. I just couldn't get myself to like it the way I liked cygwin, though. You know how sometimes when you have to use the mouse to copy and paste stuff into your terminal? Yeah. It was so annoying in Git Bash and no, I really didn't want to google for a hack to make it work. Out of frustration, I asked Google if there was a "better terminal for Windows". The first link was a StackOverflow page where the author of ConEmu replied. "Why not", ...