Learning to code kept me sane when I was a diplomat
vikparuchuri.com
vikparuchuri.com
So much programming instruction seems designed to teach people who already understand programming how to solve problems that nonprogrammers wouldn't even understand. A tutorial that started with automating tasks like this might be more effective than all the ones that start by demonstrating how to do basic arithmetic in $LANGUAGE and go on to a detailed explanation of $LANGUAGE's object system.
the fact that i knew exactly what you're talking about as soon as i read it is pretty good evidence that you're right.
the best tutorials i've ever seen are ones that start with a moderately complex program and step through it line by line, explaining in plain english why things are being done. this is how both human beings and computers parse programs, so i'm not sure why a tutorial writer would do it any other way!
i think the current trend of embedding documentation within your program as markdown on github is a pretty close approximation of that.
I can imagine trying to solve a problem like this in either; in theory, this is exactly the sort of thing the automation APIs should be good for...
In practice, you would get close and then hit a wall because something critical isn't exposed by the object model and the language itself offers no way around save for the ability to call down to components written in something else. At which point you're dealing with a lot more headaches.
The author illustrates something I think many of us too often forget: ease of use is often determined not by the intended use of the tooling, but by how easily they can be put to unintended uses - which in turn depends heavily on the ability of user to try stuff and observe what happens as a result.
I see more and more people - not programmers - poking around with JavaScript in their favorite web apps for the same reasons: low barrier to entry, low cost to failure, immediate gratification when they hit upon something that works.
From a class he took in high school, Vik knew that some sort of automation was possible. That spurred some reading and exploration, which led to some success.
Success led to thinking about other opportunities for automation and more exploration of what's possible, which in turn led to more success.
To me, it absolutely doesn't matter that things could have been done in other ways. Nothing to cringe about here. A developer can only use approaches that he/she knows or suspects are possible.
In the day-to-day work of a developer, knowing what's possible is perhaps the most important thing. Anything else can be googled.
It is said that most Nobel prizes are earned for research done before 30, since any older and they would know the breakthrough they are trying to accomplish is impossible :)
It just reeks of a lack of care not only for the power of automation systems, but disrespect for the people who have to do that work. Design your processes in such a way that easy stuff can be done easily and important stuff can be done by people who have some authority.
This is my biggest (personal) problem with bureaucracy. "You have to do it this way because it's the only way _I_ know how to do it, and I don't care if you know a better way, because you don't get paid enough to have good ideas."
I knew nothing about programming, but I had taken an intro stats class that had a few assignments in R. A super simple R script did half of my day's work in seconds (plus some debugging because of course I did next to no error handling).
In retrospect, I've realized that if I knew a thing of two about regular expressions at the time, I would have been able to automate my whole summer internship.
So it goes.
Luckily there are libraries that are great at interacting with a web page or multiple pages at the same time without needing to actually have a browser instance open. There's selenium and its various scripting environments, which are meant for browser testing but work just fine for many automation tasks: http://www.seleniumhq.org/
And, newer, are headless technologies like phantom.js: http://phantomjs.org/ and Dalek.js: http://dalekjs.com/
This is SO much easier than using Javascript to find purple links on a page, and so much more reliable.
He could have looked up each link on DB1, then used the data to look up the DB2 information.
In any case, what he did saved him hours and hours of time and started him on a lifelong interest in programming.
Also, obligatory relevant XKCD's: http://xkcd.com/1319/ & http://xkcd.com/1205/
For instance, take some city department or some big firm where things generally flow at a slow pace and require a lot of time spent on work items, doing possibly repeated tasks each week. What would a programmer do? Exactly as described in the article:
- learn what kind of tasks the job consists of
- identify repeated actions and patterns in work
- think of a way to automate the easiest parts, still requiring human to finalise the task
- gradually learning more and automating the harder and harder parts and building tools bottom-up based on earlier blocks
- finally ending up with a software mechanisation puppet that I can instruct and program to do my work
- gradually spend first some of my time doing the automation and as it would slowly take over I could devote more and more of my time automating the rest, and when all is done, I would feel the job is "completed" and get bored.
This is something that feels so natural to a programmer: I have dozens of little tools to aid in doing my programming job at work. The goal of a programmer is to program anything that can be automated and only work himself on the hard tasks that can't.
It's intriguing to imagine how you could apply those skills outside programming jobs.
The intern I shared an office with was assigned to go through each record, type the origin and destination airport codes into an online flight distance calculator, and enter the results in a spreadsheet. After two days of watching this I volunteered to take over and spent a few nights learning enough Java to read/write CSV and make the HTTP request. Saved days of pain for the intern and was a satisfying accomplishment as a novice.
The most important thing about any program is correctness: does it work and do what it is supposed to do. The only thing cringe-worthy about having to script GUI interactions is that fact that the operating system and environment requires it.
http://www.learnmsexchange.com/windows-servers/windows-serve...
It was practically made for this use case, and has an active community behind it. It even has its own script editor (SciTE4AutoHotkey) and was recommended as a Kevin Kelly-approved Cool Tool (http://kk.org/cooltools/archives/4147).
My go-to program for my desk job.
today i couldn't do that anymore; i've grown too uptight to try any of those inefficient "solutions". i guess i'd rather give up and admit defeat if there were no APIs or passable hacks (i'd say using phantom.js would be a passable hack) i could work with than solve the problems this way.
i'm usually unable to follow the advice given by the xkcd automatisation timetable described here: http://xkcd.com/1205/ "is it worth the time?" - if a dirty hack is destined to run more often than once, i just have to make it passably elegant, readable and efficient. i'm sure nine out of ten times the effort is pretty much wasted.
i guess i've just grown old.
I cringed a little. I'm glad he's learned enough to know now that this is not the right approach.
The only truly cringey part is not knowing about CSV!
Also, I'm not sure which is more embarrassing, having to write code to interact with the GUI or having to write VBA code.
The biggest problem is that apparently Guyana allows the US embassy to search their criminal records system:
> Search a different database with a separate program (“DB2”) for criminal and other history
So either Guyana allows the US wholesale access to its criminal records system or the US systems gather this data more or less illegally from somewhere.
edit: downvotes? seriously?
So it's not clear to me that the US must have wholesale access to Guyana's criminal records system, or that it must be illegally gathering data to populate DB2.
Even without INTERPOL, I would expect countries to have treaties to share some criminal records information. If Guyana is trying to capture a criminal, clearly it's in Guyana's interest to ask countries to help prevent that criminal from fleeing.
I'm actually fine with that. And if I ever apply for a visa, I gladly sign a waiver allowing the respective country to request the data from my country. But I am not fine with any government in the world being able to research my criminal record without authorization! Push, not pull.
> If Guyana is trying to capture a criminal, clearly it's in Guyana's interest to ask countries to help prevent that criminal from fleeing. There's a system for this: take away the criminal's passport and don't let him out of the country. That's a job of regular Guyana border police.
edit: oh, and who guarantees that (e.g.) the US respects expiration dates? In Germany, records have to be entirely wiped after certain dates (5-20 years, http://www.gesetze-im-internet.de/bzrg/__46.html) - but I highly doubt that the US respect this and just keep the data instead.
Criminal records are a matter of public record in most countries (including the US). That means that anyone can search your criminal history, not just governments.
There may not always be a central database, but the information is out there.
These days, everything can be searched online and especially copied and stored everywhere, far after expiration. And this is not a good development at all.
Criminal records were always meant to be as public as possible.
I do have a huge problem with the content of criminal records, because I have a huge problem with what we consider criminal--drug offenses mostly.
I also worry a lot more about the non-criminal mistakes we make being available for anyone and for all time.
In the US you also have lots of really bad laws about sexual offenses (which aren't real offenses by any sane standard; like teenagers sending each other nude pictures).
While the US wants to know immigrants' criminal history, the US isn't required to care about all of the crimes that show up on the record. For instance, convictions for performing or having an abortion (say, in Brazil) probably won't result in a denied visa.