Archie In⦠A Different Class!
-
Comments:
- here.
From Chris’s Invincible Super-Blog » Blog Archive » Archie In… A Different Class!
From Chris’s Invincible Super-Blog » Blog Archive » Archie In… A Different Class!
everybody kills Hitler on their first trip.
This had me in stitches.
Databases are interesting. That’s not really what I mean, databases are kinda boring. But necessary.
Accessing databases, however, can be interesting. Not in the sense that it is something you’d like to be spending time on, but more in the “May you live in interesting times” Chinese curse sense.
I know enough about databases to design simple ones, and access complicated ones using something like SQL. I’m not saying I’m an SQL Wizard, but I can generally fudge around enough to actually get at the data I want. It’s really something I’d rather not do, fiddle around in SQL, but sometimes it’s a necessity.
I do like tools that make accessing databases more “fun”. There are two types that I’ve been using a bit lately.
The first are wrappers that make database tuples appear as objects. For instance, SQLAlchemy in python, and Java Entity Classes allow you to basically fetch an object from the database, operate on it, and ensure that the data is pumped back into the database. It’s a really neat way to handle data, and allows great persistence of objects in OO programming.
The other is a GUI tool designed for accessing a particular DBMS or set of DBMSs. For instance, MySQL comes with an administrator program, which does a passable job. Lately, however, I’ve been required to access a PostgreSQL database. And there is a great tool for that: Navicat. With the latest version, you can even access a PGSL database over an SSH tunnel, all without having to set the tunnel up yourself.
For instance, I have a machine at my work that I can ssh into, but I can’t directly access the development machine that has the PGSL database on it. I can set up the database as if I were on the work LAN, and then set up the SSH tunnel into the machine I can access. First time, without any hassles, and I was connected to the database. Securely. Over the internet.
I also tried another application I downloaded. But it was written in Java.
Java apps on the Mac really don’t fit. I haven’t used too many on Windows, but as soon as you launch a Java application in OS X, you know it’s a Java app. It doesn’t feel right. It doesn’t use the right file open and save panels. That have all of my shortcuts that make it possible for me to work on several different projects and keep sane, and well organised.
I’ve fiddled with a couple of other Java apps, and almost without exception I have thrown them out immediately. There was a clunky merge application, which lasted one run. Same with PowerArchitect. It just interferes enough with my workflow that I can’t make it happen.
Hell, it seems like a well-written application written for Windows, and running in Wine or VMWare seems to feel better than just about every Java application I have ever used. Well, maybe not every one. I guess a Java application that didn’t feel like a Java application would slip under my radar.
Which is what I’d want.
I think I can say that, since I used to be one.
I guess having been a teacher means I know how to spot when one isn’t really prepared, or doing their job properly, or just plain incapable.
I’ve got some teachers, both lecturers and tutors, who I don’t really have much time for.
There are a few things I really dislike. The first is obnoxiousness. I have one lecturer who is not only obnoxious, but also boring. He can spend a whole lecture teaching a tiny amount of content, and perhaps this is why he is so boring. He is also dry, and does not use examples to elaborate particularly well. His worst trait is probably the questions he asks. It is never clear whether a particular question is a rhetorical question or not. Finally, he seems to think that it is acceptable to just discard all negative feedback that he receives, as it is “probably invalid”, or the person “just has a grudge”. Never mind that you are just a crap teacher.
The next thing I dislike is when someone is teaching something they don’t really know that well. This is definitely a place I have been, having to teach stuff I didn’t really know about. I have one tutor who as much as said several times there were things he didn’t understand. I’m paying good money to go to Uni, I don’t want to waste that, or my time. At one stage, when I knew I was right about something, and he wasn’t really listening to what I was saying, I basically gave up and let him continue. I know (that with a ternary relationship total participation isn’t automatically implied), and I think now that the rest of the class thinks that it is.
My third annoyance is to do with general organisation. I hated being poorly organised when teaching, and did my best to overcome this issue. I know at times I didn’t and it really embarrassed me to be the one who was at fault. Not having work prepared ahead of schedule, not being on time, these are all things that turn off the good students, perhaps more so than the bad students!
My final gripe is about… I’ve forgotten what I was going to write next.
Last night, after Uni, I went to the supermarket to buy a few things. BBQ chicken is always worth a couple of meals, so I thought I’d grab one of those. There was a short-ish line for the deli, so I used the whizz-bang new touchscreen system to place an order for a small BBQ chicken. It printed out a little voucher, which promised me a coffee on the day of printing only, and which I could also use to collect my goods.
There was a counter that I assumed was where you go to wait for the express-style ordering, so I went over there. A couple of minutes passed before someone asked me if I was waiting for something. I pleasantly said yes, I had ordered a BBQ chicken, and dutifully gave her the number on my voucher.
The next (fat, but that’s immaterial) girl took one look at me, and just said “we don’t have any.”
I said “Super. Does your feeder know you have gone out.” No, I really said “Well, that’s pretty silly. Your automated system should have told me there weren’t any left.”
She haughtily replied, “Yeah well, the system doesn’t work properly.”
This raises lots of questions in my mind. The system in question stands to really improve a shopping experience - it means you have to deal less with people (and let’s face it, people are dumb). It also should make things quicker, and less hassle free. Instead, I walk away vowing not only to not use the system again, but to abuse it. (Can anyone say, I just printed out 30 BBQ chicken orders, and used the vouchers to get 30 coffees I threw away out of spite?)
via Whatever
For a Uni project, I have to write the same algorithm different ways, and in different programming paradigms. I also need to collect data on the execution of said programs. Since some algorithms may run in large time on large data sets, I need to stop execution after 30 minutes of run time. And, since there needs to be between 50 and 64 runs of each data size, I wanted to automate the process.
Using the $ time `other-command`
is the most obvious way to time execution of any command line application on any decent operating system. However, the time that comes with OS X is somewhat limited - from the man page:
NAME
time – time command execution
SYNOPSIS
time [-lp] utility
It only has two options, and they aren’t that useful. However, it is possible to use this command to time execution.
Because it outputs it’s timings to stderr, then you need to do some tricky python to capture it and save it to a file. I used sys.popen3()
, and then read from the stderr stream. Which worked okay, but there isn’t really a way to stop execution after a certain time frame. You can try to use TimeoutFunctionException
- which I can’t remember where I got it from, but it’s cool. It doesn’t work in this case, since the sys.popenX
calls run in a sub-process, and thus continue to run after the exception is raised. Fail.
About this time in my thought process, I came across a better time. GNU time allows you to select the output format (excellent, no need to parse the output quite so much!), and to output to a file instead of stderr/stdout (even better). It also allows to append to a file instead of overwriting, and some other cool stuff.
But it doesn’t solve the issue of commands running too long. This was a killer, since the process continues to run, but worse than this, new processes are started. So the machine clogs to a virtual halt.
Then I came across ulimit
. This handy tool can limit the resources a user or process is able to use.
$ ulimit -t X; time -f %U -a -o {DATAFILE} {COMMAND} {ARGS}
This command will limit a command to X seconds (or slightly less, since the time command itself uses some time. It will then execute COMMAND, with arguments ARGS, and time the execution, appending the run time only, on a seperate line, to the file DATAFILE.
Note that this is no excuse for not using code profiling. I have already run profile.run()
on my code to work out where the slowdowns are in the python versions, and then optimised them. This is more like the last phase, actual comparisons.
Doing support isn’t that much fun, however, at times it needs to be done. Until today, I used to have to either fire up a VMWare session, or run Darwine (or CrossOver) in order to run TeamViewer on my Mac. But today, when I went to the TeamViewer website, and they have a beta version of their client for OS X.
I haven’t had the chance to use it in anger yet, I nearly had to today, but managed over the phone instead.
What I did do for the first time yesterday is use IM for work specific purposes. That was kind of fun. And the cool thing about Adium is that it keeps logs of my chat with my minion, so when I bill my boss for the time spent on the tasks, I have evidence.
via monoscope
I’ve not commented on iPhone related stuff before: mainly because I don’t have an iPhone, and won’t be getting one any time soon. It’s not that I don’t want one, but they aren’t coming out in Australia, and my new phone has still got a long way to go before it is out of contract.
The latest post, however, piqued my interest. Because it doesn’t just apply to iPhone, or any handheld device, but any computing device in general:
How are they even going to know which apps do continue to run in the background? They won’t. A likely reaction would simply be to regret ever having junked up their iPhone with any third-party apps at all.
I have a Nokia E65, and one of the “great” features is true multi-tasking. I say “great”, because this feature burned me not too long ago.
I use Salling Clicker - mainly as an automated syncing system, but also for interaction between the phone and Mac in other ways - from a Growl message when I receive a phone call, and my iTunes pausing, to sending SMS via bluetooth. Typing is much faster on a normal keyboard! (Granted, this is using emitSMS, not Salling Clicker, but, meh).
Recently, I installed a bit of software that allowed me to download call and SMS lists, so I could access them and interpret my data usage patterns. It installed a background helper agent, which I didn’t even realise. Some time later I noticed I wasn’t receiving as many phone calls as before. It wasn’t a big difference since I mainly use the phone for calling, rather than receiving calls, but nonetheless it was a difference. When out at dinner with family, it came to a head. It turned out that every time someone tried to call me, the call was rejected, but not to voicemail. A second call immediately worked.
When a call came in, the phone displayed a (very short) out of memory error, and then this immediately disappeared. The light came on, which made me realise just how often it had occurred. I had seen the phone light turn on sometimes while my phone was next to me, but because the message was so short-lived, it had vanished by the time I looked at the screen. I’m talking less than a second here.
It turned out the faceless background app was using up all of the phone’s memory. Receiving a call initially failed, but if another call came immediately after, then it would work. I guess some memory was being freed, but being used again a short time later.
Long story short - I didn’t use the software I had installed, so junking it (and removing the installed helper, which wasn’t real easy) fixed the problem. But because the problem was intermittent, it was pretty hard to nail down.
I don’t even remember what the software was called. But I’m much more cautious about what I install onto my phone now.