Fri, Apr 13 2012
I use irssi for IRC, inside a GNU screen session. I wanted to be able to work in other screen windows and be notified when things happen in the channel in irssi. Unfortunately, setting an activity monitor via CTRL-a-M had the bad side effect of triggering every time the clock in the irssi status line changed (once a minute).
Just for others so that they don't have to spend as much time googling as I did, the command you need in irssi to turn off the clock is:
/statusbar window remove time
That will allow you to monitor activity in the GNU Screen window where irssi lives, so that you'll get notifications when things happen in the channel. Making that work for only when your name is mentioned is an exercise left to the reader.
Comments, etc.
Mon, Apr 09 2012
Facebook acquired Instagram today for a cool one billion dollars.
Who won? Instagram's founders, Instagram's investors, and of course the investors who pitched into the Series B funding round of Instagram, who literally made a 100% profit, overnight. If this were a public company, we would call it insider trading, but since this is private, we just call it "business as usual."
Who lost? Facebook investors, and most important in my opinion, the people who actually built Facebook, its employees. Because you know where a large amount of that $1bn is coming from? Facebook shares, which dilutes the equity of every employee and investor of Facebook (but moreso employees due to the fact that investors typically have liquidation preferences and stack the deck in their own favor). So guess what Facebook employees, that payday you had been hoping for on IPO? It just got knocked down by X%, and I hope for your sake that X is a small number.
This just goes to show that in Silicon Valley, just like Wall Street, it's not what you know, or how hard you work, it's who you know, and how well you are connected. Once you're one of those charmed ones who sits on boards and gets calls telling you to invest in a particular startup because they are about to be acquired at double the valuation you will get, you can write your own ticket. But if you're on the ground, building the technology, you have to assume that all those people will trample over you in their race to get their next hundred million.
Comments, etc.
Wed, Mar 21 2012
This post is inspired by the Super Saiyan (youtube), who posted on reddit today about his progress on doing insane feats of acrobatics after four years so far of training. Check out the video to be impressed.
The post on reddit brought me to a number of cool links. There is the author of Overcoming Gravity, a book giving a systematic approach to making yourself into someone like the Super Saiyan whose video I linked above. The author did an AMA (Ask Me Anything) on reddit recently where he answers all kinds of questions about the book and bodyweight training in general. Then there is a website where the author posts articles, Eat. Move. Improve which seems like another great source, and is definitely going into my Google Reader account. A comprehensive guide to building your own workout routines is located here.
If you're planning on getting into it, you might need some paralletes, which are the things that Super Saiyan has his hands on during his crazy maneuvers. You can either buy them (and a review), or make them (pdf), depending on your budget and proclivities.
As usual, I'm in information overload mode here, and since I've been sick for the last few days, I can't even go bust out a workout like I normally would with information like this. Anyone care to join in an online training group to get started with this?
Comments, etc.
Thu, Mar 15 2012
In the early hours of the morning, when your mind is foggy and your body is stiff, it's really tempting to think: "If I just get an extra half hour, I'll feel better." But the reality is almost always that I wake up feeling worse after that half hour, hour, or even sometimes more. Most of the time, I am much better off if I just get out of bed in the morning whenever my body wakes me up naturally.
That's easier said than done, and many mornings it just seems impossible. This morning I had the luxury of accidentally knocking over a glass of water at 7AM, so I was forced to get up and clean it up. In the process, my mind unfogged, my self-discipline turned on, and for the first time this week I was able to get out of bed and go for a run before work.
I feel really great now, and I know I can be productive and get a lot of things done before lunch. On the days that I sleep until 9, 9:30, or even 10, I have a hard time accomplishing anything before lunch, which makes me feel guilty and stay late in the evening, which gives me no time to exercise. A vicious cycle indeed.
Comments, etc.
Tue, Jan 31 2012
It has been a long time, but the site is finally back up. A few months ago, I was the sole actor in a comedy of errors which resulted in the contents of my site being deleted, all the way back to July of last year. Whoops. I learned a lot about why backing things up is so important.
Tonight I finally mustered up the motivation to get it back up and running. I fixed search, including adding a post-save hook to the Post model to update the ts_vector in Postgres, so that it doesn't have to be triggered by a manage.py command or a CRON job. I took out tagging, because it seems like the django-tagging library is a wasteland. I'll probably go ahead and reimplement that myself, as it is pretty straightforward.
A lot has happened in my life since the last recorded post here, so I'll just go ahead and put it into a list:
- In September, I moved back to the US from the Philippines, to the San Francisco Bay Area.
- After a short search, including interviews at a few great companies, I accepted a job at Milo.com, an eBay company. Milo is a local shopping search engine that allows you to find prices and availabilities for products near you. I work on the data team, developing feed ingestion code in Python, among various and sundry other duties.
- On January 13, 2012, I was married to Frances Kristin Jamille Pansacola Regis, who shall now be known as Frances Kristin Jamille Regis Kotenko. It was the most natural decision, and I am grateful every day for having found such a perfect companion in life.
So that's the gist of it. About this site, I'm going to focus down the topics to purely programming and related subjects. I have written about things as diverse as politics, running, etc., in the past, but I feel the need to build up a body of work that represents me professionally from here on out. In that vein, I'll start highlighting some of the work that I'm doing both at Milo and on the side.
Comments, etc.
Thu, Jul 21 2011
I was a Java teacher for two years, developing Java courseware, supporting Java courses being taught by other teachers, and teaching many classes myself, online or in person. I have the Sun Certified Java Programmer 6 certification, which means that at one point, I was able to answer incredibly arcane questions about Java's sometimes tortured syntax and semantics. That wasn't easy, and how I prepared for it is the topic for another post.
There are some auxiliary languages that run on the JVM, like Clojure, Scala, and I'm sure a whole raft of other ones. But I've yet to see one that simply removes the pain from Java, without changing the character of Java, until today. The Gosu language is 100% compatible with Java, compiled, imperative, and statically typed, and I'll just say, it's much nicer to use.
What are some of the features? First of all, you remember getters and setters right? Something like this:
public String getName() { return name; }
public void setName(String name) { this.name = name; }
Yep, all Java developers have written thousands of those things, and in fact they are so onerous that Eclipse will even just generate them for you. But haven't you often wondered, why don't we just do away with them unless we need them? That's where Gosu's property shines. A Gosu property is accessed the same way you would access a public variable in Java, but it will use any getters and setters you define, and generate them if you don't. So if your variable doesn't need any fancy handling, you just define it like this:
var _name : String as Name
There are a few things going on in the syntax here, you'll notice the var keyword, that signifies a variable. The : String gives the variable a type, and the as Name tells the compiler to go ahead and turn this into a property, with generic compiler generated getters and setters. So a class user can then call:
myClassInstance.Name = "Joe"
By the way, have you noticed that there are no semicolon line terminators?
Now, if need some access handling, all you do is define your getters and setters like so:
property get Name() : String{
return _name + " copyright Jason Kotenko 2011"
}
And your user can go ahead and access the variable as a property as usual.
This is just one feature of many that makes your life easier as a Gosu programmer. Just to cover what was shown in the Intro to Gosu, I'll give you a list. But definitely check out that intro, it's very well organized.
- Local variables don't require type definitions, i.e. var jason = new Person() is valid, no more repeating the type twice unless it's necessary, i.e. var jason : Person = new Student()
- An override keyword ensures that classes up the hierarchy don't break your code without you knowing.
- Single line delegation - no need to instantiate a class and call it from within a the overridden methods.
- Drumroll please... a print() function, no need for System.out.println() anymore!
- A null tolerant accessor syntax, i.e. var couldBeNull = object.?propertyName will not throw an NPE.
- Sane comparison operators: and, or, not work alongside the old C style operators.
- Enhancements: This one deserves its own post, but in short, you can add arbitrary functionality to pre-existing classes (including the standard libraries), relieving the need to keep piles of child classes around for one-off needs.
- Closures (called blocks in Gosu).
- Templates - A JSP like functionality for generating markup programmatically.
- The using keyword cleans up resource variables for you.
That's just the tip of the iceberg, but I think you can see that this language takes a lot of the pain away from writing Java, things that we've gotten used to because Eclipse generates a lot of it for us. But with improvements in readability, could Gosu improve your team's productivity? There's a very good chance, in my estimation.
Comments, etc.
Mon, Jul 18 2011
I ran into this pretty early. I couldn't figure out why I was getting the error message:
R.layout.main cannot be resolved.
I think this is mainly caused by using Eclipse's CTRL+SHIFT+O hotkey to auto insert imports, which sets your R import to this:
import android.R;
This imports the Android system's R object, which apparently is separate from the R object you need to reference your own resources. You have to delete this to make your own "R" object resolvable. If you are still having a problem, see the UPDATE below. For that you need to change the import to:
import com.mydomain.myproject.R;
Obviously, change the package name to your appropriate thing for your project.
UPDATE: The project specific import is not necessary. What may be causing the problem is that one or more of the files in your "res" folder has a syntax error. Fix that, save the file, and your R object will be recreated successfully. If there are errors in your XML, the R object is not reachable.
I'm hoping to make this style of article a series, where I report on things that I learn while taking up Android development. Mainly it will be a repository of pitfalls so that other users can learn from my mistakes, but I hope that as I progress, I can add some insightful code snippets that others will find helpful. You can keep track of it at: the android tag category.
Comments, etc.
Sun, Jul 17 2011
Patents have been on my mind lately. It seems like everywhere you turn, there is a new company whose sole purpose is to buy up patents and use them to litigate against people who are actually innovating in the marketplace.
Even developers in Europe are starting to pull their apps from the US markets because of the threat of lawsuits from companies like Lodsys and Macrosolve.
At what point is the US Legislature going to recognize that software patents have become a serious impediment to innovation in the marketplace? At this point in time, if you are an independent producer of software, whether that be mobile apps, desktop software, or even web applications, you are in imminent danger of being extorted by patent trolls.
Why? Because it seems that the US Patent Office has absolutely zero expertise in evaluating technical patents, firstly. Patents are granted for things like "electronic forms distributed via the Internet or to mobile devices", in the year 2002. This is literally a dozen years or more after the the Internet and similar services were popularized, and all through that time forms were being distributed via the Internet to mobile devices like laptops. The prior art here is ridiculously obvious, and yet this company was granted the patent. This happens on a non-stop basis at the Patent Office, so you've got hundreds or thousands of patents which are laughably invalid.
The second factor making this a death knell for any small or even medium sized company is the cost of patent litigation. Just to defend yourself from a claim of patent infringement, you are looking at well over $2.5 million in costs. This is just to defend yourself. How many app developers do you know who have that kind of cash? I'd guess that it is something on the order of 1/10 of 1%.
These two factors together make for a highly combustible situation. Today, we're looking at companies which are funded from large institutional investors (more here), who are looking at this whole "business" as just one more investment in their portfolios. These "patent troll" companies only have to do one thing: accuse hundreds of app developers of patent infringement. In the process, they can collect a royalty from the resigned ones, put the scared ones out of business, and litigate the principled ones into bankruptcy. I hate to bring it up, but it looks like once again, Wall Street is out to rape the people in this country who actually create value.
How do we solve this? That's a tough question. One thing is to make patent litigation easier and less expensive. This is counter intuitive, but if the process were not a multi-million dollar game, it would put much smaller shops into the running for overturning bogus patents in court. A second suggestion is to have a pre-trial phase of patent litigation where the defendant is allowed to present evidence to a specially assigned US Patent Office examiner that the patent is invalid. This would be a streamlined and easy to use process, which would allow only patents which pass a higher level of scrutiny to even make it to trial. Something like this probably currently exists, but as it stands, it is prohibitively expensive. Perhaps fees should be left only for the eventual loser of the case.
The best option, in my opinion, and many others, is to abolish patents on business processes and software entirely. With a federal government bought and paid for by the highest bidder, however, good luck with that one.
Comments, etc.
Thu, Jul 07 2011
I recently did some site customization for a client, and her site was written in Wordpress. Now, I have no business doing anything in Wordpress, but I figured, what the heck, how hard could it be. I'll just modify the templates, mostly leaving the PHP alone, and everything will work out.
For the most part, that much was true. However, there was one thing I didn't know that came out to bite me. For the work, I just grabbed the Twenty Ten theme and hacked the hell out of it. I actually just cleared their style sheet and created a new one. Worked like a charm... until the user updated Wordpress. I received an e-mail that said "Oh no, I did something in the WP-Admin thing, and now my site looks like crap! What's going on???!!"
For anyone who is searching on this - here's the gist: If you modify a Wordpress default theme, when Wordpress is updated (which it prompts the user to do when they are updating the content on the site), your theme changes are going to be wiped out. That's it. No backup, no warning, just plain old wiped out. If you had cowboy coded the changes (live on the server), you are totally and completely screwed.
The answer is to make a child theme from the one you are modifying, or copying over the theme entirely and changing the name/author details in the style.css file. However, the data you lost from that update? That's gone unless the server you were working on has backups.
Luckily for me, I did have a backup on my home machine, but it wasn't really up to date, so a little work had to be repeated by me for free. That's okay, that's just the price I paid to learn one more lesson. As Donald Rumsfeld once said, you've got your known knowns, your known unknowns, and your unknown unknowns. This one was in the last category, and that's the one that can really bite you in the ass some days.
Comments, etc.
Tue, Jul 05 2011
I have had a great time in the Philippines. For a few articles on my experience here, check out my Philippines tag. But I fear that the time has finally come time when I have to get back on the plane and head back to the US. The money just simply cannot last longer without me having some sort of steady job. I've got a few things cooking, of course, but nothing that will leave me with any measure of stability.
So, after thinking long and hard about where to land in the US, I have decided upon San Francisco. For technology right now, you just can't beat it. Even the big companies that didn't start there are beginning to place branches there just to partake in the huge ecosystem of developers. The way I see it, my best chances at finding a job are there, especially one that I will actually enjoy doing.
I'm a little worried that at this point I am not up to snuff for the big startups, but hopefully I can find something that will challenge me and let me learn and grow as a developer. I am looking forward to getting back into the office after most of a year off, and two years before that working remotely for a training company. During those two years I learned Java inside and out, and taught it to hundreds of people on site and remotely, but I didn't do much development. The most I did was to start a website redevelopment using Django. Since then I've mainly just been using Django on personal projects like this website, Jam's website, and a few others for friends and contacts.
I definitely miss my previous job before the remote one, where I was working at the Idaho National Laboratory doing image processing in C++ (with some Python glue code). Implementing the results of scientific papers has to rank as the most fulfilling portion of my short career so far. So I hope that I can find a job that will allow me the same creativity and real thought, instead of all mind numbing coding. Don't get me wrong, even scientific programming has its mind numbing stretches, but in the end the payoff is so much better. There is nothing like getting some complicated algorithm working and seeing it plow through a complicated problem easily. RANSAC is one of those, while not too complicated, it takes your huge intractable problem and gives you a 90% solution very quickly. Better if you've got the processor time.
In the time I have left here (we leave on September 1), I hope to make myself a better programmer somehow. I've got to decide exactly where to focus to make that happen. I want to show that I can work on hard problems, but I am at the moment locked in analysis about where I should apply my efforts. The ideas so far are:
- Work on a small startup idea. This would be the number one choice if it was my goal to start a successful startup. I don't mean that this one would become successful, but that the process of doing it would teach me many things about the process that could help me to become successful, either through the current idea or the next one. However, I wonder if it will expose me to the real, hard problems of programming that I'm looking for. My idea has very little algorithmic complexity, it's mainly just a marketing and business problem in the end.
- Read Introduction to Algorithms and work on TopCoder-esque programming challenges. This is kind of like the "go back to college" route. I can go through the Cormen book and implement the algorithms within, and see if I can apply them to programming challenges as well. I could make a series of blog posts about this, and post the code on GitHub, to have a work product to show at the end.
- Work on an open source project. This one really appeals to me in principle, since open source is such a huge part of my life, and I abstractly want to "give back." However, I just don't know where to go and feel like there is a huge barrier to working on interesting things in the established big projects. Maybe that's just a mental block. The other issue is that I don't know what to work on. Everyone says "scratch an itch," but really, what itches do I have? I want to work on something interesting and difficult, and the only itches I can think of are user interface gripes I have with the software I use. Otherwise, things like Hadoop and Django are things that interest me, but I don't have any projects which use them to such an extent that I feel a driving need to add something. Hell, with Hadoop, I don't even have a project that uses it. So I'm kinda stuck on what to do in this space until I can resolve these things in my mind.
Those are my basic ideas at the moment. I'm thinking about it more, and I am aware that I just need to get moving on it, since I have only two months to get something done to improve myself.
Comments, etc.
Copyright 2011 Jason Kotenko. All Rights Reserved.
Contact me