Posts
Seven Languages in Seven Weeks Part 6: Scala Day 2
For day 2 of Scala the book focuses on the functional programming side of things. The first exercise was just a quickie to make a very simple functional style program using foldLeft. The goal was to count the total number of characters in a List of Strings. The foldLeft function takes a starting value and then iterates over a list. Each iteration uses the value returned by the last as its new starting value.
I solved this with both forms of foldLeft, the curried version and the standard (is there another name?).
val strings = List("moo","meow","oink") //foldLeft can be …
Seven Languages in Seven Weeks Part 5: Scala Day 1
I didn't do the Prolog chapter yet. I'll come back to it. I need to take some time to study what I can do in Prolog before I can do the exercises there. So now I'm on the Scala chapter.
I'm not sure how I feel about Scala yet. There's some good stuff here and some stuff that feels like it's just different for the sake of being different like class definitions and accessing array elements with () instead of []. I also don't like how some types of collections, like Arrays, don't have methods that it seems they should …
Seven Languages in Seven Weeks Part 4: Io Day 3
For day 3 of the Io programming language a very simple XML-like markup builder was given (the book named it LispML). The book gave the code to take a list of node names and the text value for those nodes and then it would put it into a markup language format So you could enter something like this:
Builder ul( li("Io"), li("Lua"), li("JavaScript"), )
And get output like this:
<ul> <li> Io </li> <li> Lua </li> <li> JavaScript </li> </ul>
Then for the exercises …
Seven Languages in Seven Weeks Part 3: Fibonacci in Io
I've started the chapter on the Io language. This language is pretty different from anything I've worked with. The syntax is a bit strange at times, but it seems to be very flexible. Io is a prototype language, so every object is a clone of another object starting with the base Object object that is the root of all objects.
I haven't done all of the exercises yet, but I did solve the Fibonacci problem for Day 2 of Io. In this exercise the goal is to create a method which you pass a number into. The method will then …
Seven Languages in Seven Weeks Part 2 - Ruby Day 3
Finished up day 3 of Ruby a little while ago. The goal was to implement an each method on a provided class which read a csv. The each method was to return each row of the csv as a new CsvRow class. The CsvRow class needed to let you specify object.rowname and get that column value from the row.
So with a csv like this: one, two, three cake, cookies, pie dog, cat, goat
You could do something like:
my_csv = RubyCsv.new() my_csv.each {|row| puts row.three}
And get the …
Seven Languages in Seven Weeks Part 1
I recently picked up the book Seven Languages in Seven Weeks. This books runs through seven programming languages and shows you how to use them. It skips much of the basics under the assumption that you already have programming experience and so understand data types, can look up api documentation, etc. by yourself. Instead it intends to only focus on what is interesting about each language and only gives instruction on how to use those features and api's that make the language stand out.
I primarily picked the book up for everything it covers other than Ruby, but Ruby …
Removed AIDL From XMPP Client
When I started work on my Android XMPP client I wrote a service that handles all of the communication and the UI then communicates with the service. I am starting the service with a separate call to startService() so that it is not tied to the lifetime of the activity that starts it. Based on the info I had when I originally wrote that I believed that this required me to use AIDL to communicate with the service. It turns out that is not correct, though. AIDL is only needed when the service is in a different process and with …
New Ways To Build My Skills
I've begun adding another approach to building my development skills. The first phase is becoming active on Stack Overflow. I am attempting to answer at least one question per day there as well as trying to read as many things as I can that sound interesting. So far I'm not doing too bad.
I am also hoping to add a how-to/tutorial section to this site. I'm not quite sure what to write about yet for a tutorial, so that's going to be a bit slow to get going, but I really hope to do so.
Progressing with Django
So I picked up a print copy of The Django Book (I find books easier to read all the way through than the same thing as a pdf or html) and read the whole thing over a couple of days. Most of the basics I had of course learned when I switched this website over to Django, but I did learn some tricks for more advanced stuff.
With my new knowledge I've been working on a couple of Django projects at work. We've got an existing application with 120 or so tables in the db and a terrible, nearly useless …
So much to do!
There's so much to do right now. I'm still working on that Android XMPP client when I've got time. It's nowhere near complete, but what I have works well so far. Rather than adding more "new" functionality I'm working on polishing what is there already and adding in the little bits that will make it work well such as proper options and the options screen, proper management of the background service, etc.
I've also started trying to do a bit more Python work. I've started messing with the SocketServer class and am reading up on creating pre-forking servers so that …
Android XMPP Client In Progress
I've been doing a little work on the Android XMPP client I mentioned. I'm using asmack for the XMPP bits. All of the interaction with the XMPP server happens in a service. The UI binds to the service using AIDL to get roster updates, send messages, etc. So far I've got a working roster and the ability to start chat with a specific user and send them messages. Receiving messages will hopefully be done sometime tonight.
It's all very unpolished right now, of course. Server info is hard coded for google chat, username and password can be entered but cannot …
New Project - XMPP Clients and Server
So, I think I've got my new project for now. It's going to be a three part deal.
- First an XMPP client for Android. I'm no UI guy, so this may or may not be anything worth releasing on the market, even as a free app. It's mostly just about interacting with XMPP. If it is half decent, I'll release it, though.
- An XMPP client using Python and wxPython. This will be my second Python app (the first being this site), so it should be good practice and relatively simple after the Android client.
- An XMPP server in Python. This …
Django and Complex Forms
I recently decided to try Django for a project at work and discovered that it really has trouble with complex forms. I needed a combination of nested InlineFormSet objects and the ability to add to the form set dynamically. Neither of those things are clearly covered in the Django documentation or as easy as I would have expected. I still don't have it working, but here's what I got so far in case anyone else is working on the same thing.
For the nested form sets I came across this blog post which was very helpful. It needed a couple …
Running On Django
The site is now up and running on Django. I made the switch because I really needed to add another high level, interpreted language along the lines of Perl to my repertoire with the demand for Perl dying off. Everyone seems to love Python and I've seen some demand locally for Python and Django devs, so Django seems like the way to go. I've got a bit of work to do here and there such as tweaking css, adjusting the admin interface a bit, and maybe adding back in a bit of functionality that I lost from the Perl version …
A bunch of stuff
Doing random stuff with Android lately. Some OpenGL, some work with the sensors, etc. Whatever comes to mind that might be interesting and will let me do something new and interesting. My current to-do list is something like a simple OpenGL 2D game like a Space Invaders clone, a Twitter client (because we need more of those, right?), and maybe an IPv6 subnetting tool.
I'm also beginning work with Python because as much as I love Perl, there's just no demand for it. I'll probably be migrating this site over to Python using Django.
I can't recommend the site http://www.mysqlperformanceblog.com/ …