Showing posts with label tech. Show all posts
Showing posts with label tech. Show all posts

12.03.2007

why i hate computers...

... because they *should* help you automate things, but it never seems to work out that way.

I've been doing data analysis on large batches of data files (100's, not 10's, not 1000's) lately, and while I've written an IDL program to do the fitting, plotting, and output of parameters I need, there remained a few tasks that I couldn't figure out how to automate:


  1. prepare the batch file (unfortunately, the files are not entirely sequential, so it's not that easy to automate... I could pull some trick with getting a file list and going from there... but...)
  2. convert all of the .eps files that IDL outputs to .pdf so that I can actually use/view/print them


I decided not to bother about the batch file, it didn't really take that long, and once made I save it and never touch it again. BUT the only way I seemed to be able to convert the eps to pdf was to open all the eps files in Preview (it converts them on opening) and then save each of them. This is fine for a few eps (or ps) files... but when you have a 136 staring you in the face and know there are more to come... and that each one involves pressing command-w, enter, enter, you want to find a way that avoids causing tendonitis. Seriously.

First I turned to Automator (I'm a Mac user... unfortunately my solutions will be less than helpful for Linux users, and nearly useless for Windows users... sorry!). To be fair, I have actually managed to get Automator to do some useful things recently, but usually my encounters with the cute little robot leave me feeling rather let down. A quick perusal turned up what I thought was true anyhow, that Automator has no built in way to convert eps (or ps) to pdf. I also checked the Apple Automator downloads and Automator World to no avail.

So I thought, hey, I've got unix commands up the wazoo on here, there *must* be one that can convert eps to pdf...

pstopdf

excellent. So I pull up the man page, figure out how to use it, test it on a couple of files, and merrily enter:

pstopdf *.eps

uuh... geeee... that was fast. A quick "ls" showed me why... it only did the first file. Bugger. A bit of frigging around later, it was determined that pstopdf does not take multiple file arguments.

Ok. That stinks, but maybe now Automator can do something for me using the action "Run Shell Script". Yes, that's it, I'll grab the filenames with a "Find Finder Items" input it to "Run Shell Script" to run the pstopdf command, and voila, there will be 136 pdf's waiting for me. Right? Well not so simple, but yes, eventually. The two main quirks I had to overcome were:

  • Apparently at some point the file output and file input of "Find Finder Items" and "Run Shell Script" became mismatched. Oddly this can be solved by inserting a "Label Finder Items" between (you can select none, so it appears to do nothing) which mysteriously does indeed change the file listing in the correct manner.
  • When using the "Run Shell Script" action: do not enter anything into the script box until after you selected how you wish to pass the input from the previous action. That little drop down will insert the necessary script fragments you need to work with, but only if the box is empty. Since I tend to dive in, I of course immediately put my command in before selecting this, and got very frustrated very quickly.
  • Also, since the pstopdf command only takes one input at a time (and I couldn't get it to work with stdin, though the man page claims it should function) I used the "Pass input: as arguments" option and placed the pstopdf command inside the loop with "$f" as the argument where the input file should go. If you have a command that takes multiple inputs, you *should* be able to use "$@" outside the loop.



Long story short, I'll make available to you, the fruits of my frustration, all for the low, low price of *FREE* (err, uhh, and listening to my rant)... better yet, I'll include my other workflows that I've been using:


Since some people were having trouble downloading the workflows above, I've put the workflow to convert eps to pdf and to combine pdfs into a zip file for download: PDFworkflows.zip



Is that all? Oh no... no, no, my friends. I started many hours ago, this morning, with IDL opening into an xterm completely UNCONFIGURED for my needs. Let's look at my "needs":

  1. Something more readable for my not yet caffinated eyes than black on white (I like a nice soothing green on charcoal... reminds me of that old Apple//c we had when I was a kid)
  2. More pressing: a bigger window (ok, I can drag and resize, but sometimes funky things happen when I do that)
  3. And pure luxury would be a SCROLLBAR... yes I like to scroll, especially when I'm running batches of 136 files and I'd like to look at some of that output.


Is that too much to ask? I have my X11 configured to open an xterm that is more pleasing on the eyes, but since IDL launches it's own xterm from a mini-app, and I couldn't find where it actually did that anywhere I was stuck with what it gave me. Until today people, until today. All one needs to do is create a default xterm style you are happy with and then any program launching it's own xterm will use this default style. The trick is simple: create a .Xdefaults file in your home directory. The bits of code I used were:


XTerm*background:grey15
XTerm*foreground:PaleGreen
XTerm*vt100*geometry:160x48
XTerm*scrollBar:on
XTerm*scrollKey:on
XTerm*jumpScroll:on
XTerm*saveLines:500
XTerm*cursorColorBackground:DimGray
XTerm*cursorColor:DarkSeaGreen3
XTerm*highlight:LemonChiffon
XTerm*borderColor:SlateGrey


I got most of the commands from here and there is an xterm color table here. Now it looks like this:



Now go make a beautiful, scrollable xterm and make me proud... I have to believe I didn't waste my day in vain.

And convert some eps files to pdf while you're at it. Hell, convert a whole bunch of them and put them together into one gigantic pdf!

Because today, I got my computer to do what I wanted it to do... It just took a really long time.

1.23.2007

Quote of the day

PC: "Keyboard error: press F1 to resume"

1.19.2007

Mac-hugger

Ok, so I was checking out some news and I ran accross this article in the Globe and Mail:

Enough of the iHype already

and so being a self-proclaimed mac-hugger I had to read...

The jist is this: Apple is really good at marketing... especially viral advertising.

No.... really??? You mean... you never figured that out before??? Duh. What I really don't get is why this is a big deal. We are bombarded with marketing everywhere and for everything, esepcially electronics where the need must be created.

I don't need a cell phone, iPod, computer... I need food, shelter, clothing. Yet most people have most of these things today. (ok, fine I need a computer for work... but whatever, you get the point). Companies generate a need for these things... through marketing. One look around on a bus or a coffee shop, or your own apartment will telll you that they're doing a damn good job.

So Apple plays the game, and plays it very well. I remember the add for the first iPodnano... man, I wanted to get my hands on one of those. I even had an iPod, but I was suddenly struck by a burning desire to hold, if not own, a nano. It's rare an ad is that effective on me.

Maybe what gets to people most is that Apple still gets play off its underdog appearance. There is still a cult of mac, people who zealously defend and push Apple products (I know because I used to be one of them... I still love macs, and personally think they're better, but unless you really pick a fight with me in the PC vs. Mac arena, I try to keep my trap shut)... but hey, now it's catching on. iPod is everywhere. Students are toting MacBooks around campus, baby-boomers are putting iMacs in their living rooms. Apple profits are up. And ads like the Mac vs. PC portraying Mac as young and hip and cool compared to the barely functional, emotionally fragile, uptight PC are still hugely popular. Has Apple become successful enough that it's just no longer fair to pick on Windows?

Or does the author of the article just really not want to want an iPhone and went off on a disparaging rant to convince himself that he doesn't.

Anyway, the article sent me off on a tangent looking for spoofs of the Mac vs. PC adds and I ran accross this completely politically incorrect, but hugely funny video:





Enjoy, and don't get mad at me... I warned ya.

1.16.2007

Apple Mojo

Wired news story: Why Apple Makes Me Cry.

'nuf said.

Damn that Steve Jobs and his brilliant company. How does he do it? Why do we all want it... whatever it they come out with?

1.09.2007

shiny new apple products

iphone - oooh... yeah, i'd like to phone on iphone... ;) seriously though, this is pretty cool... ipod, pda, portable web and phone all in one. i see people on the bus juggling all these things at the same time and wonder how many times they've dropped them all. so nice to have them in one package.

apple tv - enh. i like the idea of not having wires around, but i'm not super excited here... not yet anyway. i think it's the right direction, but not for me right now.

Airport Extreme (802.11n) - this i like. i mean, faster wireless = good, but shared wireless harddrive for backups? awesome. :D unfortunately, we've already got an airport express... so for now, we'll just stick with that.

summary? given that iphone is with cingular, and thus probably not coming to Canada for awhile, and I probably couldn't afford it anyway, I will remain iphone, or any-phone -less for awhile yet. the others are cool, but not purchases I'm looking to make right now. nope, nothing here to drool over for me really.


Edit: some real photos from Wired

12.15.2006

Appologies for bloggy weirdness

I must have picked the worst possible time to upgrade to Blogger Beta!

I'd like to send a thanks to Styleygeek for hosting and including me the the Carnival of GRADual Progress... however all you new readers are getting to see every quirk in my new blog template as I try to fix it up! I'm not sure actually if Blogger Beta and Safari get along too well. I really like the new editing tool for templates, but it seems to keep freezing up on me, so probably some of you have seen a few duplicates of things, and things popping up in weird places.

I think I've got it looking more or less normal, so I'll be leaving it like this for now. I'm home sick for the day, so I'll probably swing back around the blogosphere again later, but for now I have paper corrections to work on!

12.14.2006

iResearch

I wish there were an i-App like iTunes, iPhoto, etc for organizing research papers. Something that I could add keywords that would be linked into Spotlight, and one could sort by journal, topic, authors, and maybe give ratings (you know you've read papers that are 5-star, and some you wish you could remind yourself never to read again by giving, oh, maybe negative stars!), oh, and most importantly link directly to the pdf of the paper. I'm not particular fond of the i-everything naming scheme, but a program organized like Apple's iLife apps would be fantastic. My current system of folders works ok but breaks down when I have papers that fall in multiple catagories... and I have this burning desire to rate papers these days.

Does anyone know if one exists (that doesn't involve inputing all data manually)? If not, anyone wanna write one???

Blogger Beta!

So it seems I'm now one of the cool kids, and I get to play with Blogger Beta! Which means things like labels... mostly I've wanted to play with labels... and I'm not sure what else. Should entertain me for a bit anyway! Hopefully there will not be horrendous glitches...


EDIT: oh, apparently, I got Beta just days before Beta came out of Beta. Kinda like being the last picked for the baseball team in gym class...

12.04.2006

anybody in there?


anybody in there?, originally uploaded by saburke.

It's just been that kind of a day where at this point my brain can't do much more than play with my iSight camera. That little eye peeking out at me from atop my screen is just too much to resist sometimes... I wonder... is she watching me??

11.28.2006

Flickr

This is a test post from flickr, a fancy photo sharing thing.

10.28.2006

sorry... a bit under construction

Since I'm changing a few things still with the template, it's quite likely things will look out of place on occasion. It might also help to refresh your browser as I've updated some of the images used for the backgrounds. Sigh, it's a work in progress... still not sure about the molecule background... I wanted something scienc-y since the title graphic is now gratuitous placement of photos I like. Of course, lately I haven't posted much about science... I guess spending so much time at work these days (oh yeah, back in the lab on a rainy Saturday), I'm a bit science-d out.

Tah-tah... time to go... my AFM tip just approached... nearly crashed... but didn't, so I have work to do!

10.27.2006

a fresh face

So, I decided a few days ago that my blog template was "agressively boring" and it was time for a change. What do I mean by "agressively boring"? Well, here's the old page:



What was I thinking, just look at all that grey! Ugh! I came up with the term "agressively boring" in regards to the cover of my 4th year Quantum Mechanics book which had stripes of 3 shades of grey... like it was just trying so hard to be boring. And what did I do with my own blog? Shades of grey... shades of grey everywhere.

So in my attempts to stay awake today after being in the lab until 2am last night, I made some changes. The photos in the title graphic are mine, the fireworks are from Basel and the clock is from le Cafe des Hauteurs at the Musee d'Orsay in Paris. I don't know if the molecule background is going to stick... I think it might be too busy looking... but at least it's not grey. I also want to change some of the text colours, but man, I am just too tired to track down where all those are in the template. Another day... another day...

9.14.2006

Comments?

Sigh... I can't seem to find any reason why the comments wouldn't be working... I'm going to post this and then try to comment on it. Anyone who happens along, can you try posting a comment? Just a "testing testing 1-2-3" kind of thing? Thanks.

Blogs, Blogging & one-sided friends

So, as I sat here at my desk eating my lunch and downing a quick coffee before my first hockey class of the season (yay!!! hockey's back! ... note: the only reason I might possibly look forward to winter rapidly approaching) I read a few blogs that I occasionally read. It's really only recently that I got into this whole blog thing. I never thought I'd become an avid blog reader, or blogger myself.

I was first really introduced to the concept by Josh (found over here at life's propagation, aka quarem.blogspot.com) when I worked in a lab with him in Victoria. When I left there I found myself checking in on his blog just to see what was up and really enjoy reading his posts on whatever he's doing/thinking/reading etc.

This got me a bit interested in blogging, and I had some ideas for things I might put out there to share. I tried my first blog shortly after but it didn't get very far... abandoned after 1 post... I still feel bad for it. Then I tried using a blog format to communicated with my 1st year physics tutorial students, and actually that more or less worked out, though I think there are probably better ways. I maintained a little election blog with some friends last year, but that had kind of a limited life span anyway and is silent for now. Then I decided it was time to try a personal blog again... this one. I figured it would mainly be a way for me to post my goings-on while away on trips and interesting stuff about my life in Montreal, and that maybe friends and family would read it. So far, that's about what's happening... but there are also quite a few people who visit who I'm sure I don't know.

So this brings me back to the reading end of things. I was just reading this blog that I stumbled upon in a totally random fashion while looking at some photos on Flickr's "interestingness" page (because I'm getting into photography now, and I find it fun to see what other people do with their cameras, what lighting they catch/create, what angles look interesting, etc). So now I find myself reading this blog about this girl from Oregon (you can catch her over at lylium.org), and I'm suddenly so happy and excited for her starting College! And it occurred to me... this is a bit weird. I mean, here's this girl I have never met, have no connection to, and yet I find myself really, genuinely excited for her. At the same time I feel a bit strange because she knows nothing about me... at most, I am a few pageloads and maybe she knows where from. I could post a comment, but I don't have anything really to say other than "Hi, I've been reading your blog, you don't know me, but have fun at college!"

Anyway, despite this strangeness, I still like the idea of blogging. I also find it intriguing to think that someone might randomly stumble upon my blog ramblings and read for awhile and feel some connection (though one-sided, and a bit strange) to me.

So on that note, I hope I will post a bit more than I have since getting back from Germany (yes, I'm back now). I still have things I've meant to write about and post pictures of from the trip, so hopefully I'll get to that soon, but work is getting in the way as I have made a pretty good plan of things I must do to finish this PhD thing, so now they must be done.

(ps - for some reason, it seems that comments are not working here... I will try to resolve that and post again asking for test comments.)

7.20.2006

so, now to find out if anyone reads this...

So, I've finally added a counter to my blog. I meant to do it a long time ago, but since I'm pretty sure nobody reads this, I kept not bothering. One of these days I will actually email my friends and let them know that I've started a blog... that was kind of the point afterall. Maybe I'll do that now... well... in a little while. Maybe after I go get a chocolate bar...

6.22.2006

Arrrrgggghhhh... Apple you are pissing me off!!!!

So... for someone who keeps their whole life on her computer, losing your computer can be one of the most frustrating events ever. This is round two for me. My first laptop decided to crash'n'burn at a rather inconvenient time (as I was finishing grad courses and working on a programming project that needed to be written up in LaTeX). As it was dying I backed up what I could, and when I finally got my new computer I restored what I could. This time around I was actually even more careful. I now own a backup drive, yes a lovely 160GB external drive, I had an sync program installed, and I even used these items to perodically back up (not often enough, but none-the-less it did happen).

Great... but...

It turns out that making a copy of ones library isn't quite enough. No, no. Even though I have (in principle) all the data I should need to restore everything up to my last backup, it doesn't seem to actually work that way with important programs like iCal (where I keep track of my life) and Address Book (where I keep track of all the people in my life). AAAAARrrrrrggggg....

Ok, so after fighting with that for awhile and giving up, I decided to set out on a mission to properly back up these things, heaven forbid, this computer kicks the bucket. So, it turns out that there are indeed menu items which allow you to back up the databases of these two program. Thanks Apple! No, seriously, no sarcasm here, that's great. But, it's not really that convenient. When I back up I have one script I run and I walk away, go to bed, whatever. No user intervention necessary, because if I have to sit there and do something I'll keep telling myself I'll do it later.

So... I start searching...

I first looked for automator actions... for anyone familiar with apple these days they have probably heard-of, tried, and given up on automator several times... sounds cool, but it never seems capable of doing what you want. No luck there.. of course. So I tried just google-ing something like "Back up iCal". I got AppleScript stuff. Ok, well, I'm not familiar at all with AppleScript, but the work appeared to be done for me. So I copied and pasted and tried to run the script and I got an error. Huh. So, I walked back to the simpler version of the script and I got the same error. Huh. Seemed the problem was with a command called "click"... which seems like a pretty obvious choice to tell the computer to click on something, but maybe that wasn't quite right, so I started looking in AppleScript manuals...

4 hrs later...

Same error. Huh. I've since found instructions on the Apple website on how to click a menu item in an application, copied and pasted that, replaced all the relevant text, and lo-and-behold... same error. Huh.

All I want to do is freakin' back up my calendar and address book. Is that so much to ask????

5.23.2006

Google's automated ads

You know how sometimes Google's sidebar ads are from companies that use the search term to auto-generate an advertisment? Here's one I ran across tonight:


Yes, I was looking for store hours... but I doubt there are any manufacturers of them out there!

ps- this was also a good test of Blogger's photo hosting service... super-easy! expect more photos...

5.03.2006

Personalization...

Not that there was anything wrong with the blogger template I initially selected from the standard templates... but it just wasn't quite me. This is a bit more sciency, and a bit more me. :)

Nothing else to report today. There is this Nanoforce thing going on, but I'd like to get some work done, so I'm skipping the talks and scanning. Fingers-crossed. Hopefully I can get some good stuff today, go home at a "reasonable" time to do laundry and such... yeah, yeah, wishful thinking.

4.24.2006

First post

Well, I have tried to blog before... it didn't go well. I made one post. I've decided to try it again, mainly because it looks like the next few months are going to be pretty interesting (read: busy). Lots to do in the lab, lots of places to travel to, and a wedding all in the mix. Surely this will give me the occasional thing to write about?

So, "Mad Scientist" isn't a very creative title, I know, but it's a little bit fitting. I've been known to be a bit mad at times (pretty much any meaning of the word you'd like to choose), and well, I have been called a scientist from time to time (though I seem to be missing the stereotypical lab coat).

Mostly this will be a personal blog, but as I run across things that are amusing or interesting tid-bits of science I will also probably post those.