Sunday, June 14. 2009How to enable remote desktop on headless Mac
The graphics card on my old PowerMac G5 gave up, so my Mac is now headless. That is, it runs fine, but it can't display anything on the screen. It's still possible to log on to it through SSH, but I needed to use GUI applications. Getting a replacement graphics card proved to be difficult, so I needed to find another way.
Macs support remote desktop logins through Apple Remote Desktop, which is just a different name for VNC. The only problem was that I had not enabled desktop sharing before the graphics card broke down, and all the instructions I could find were about how to enable it in the Mac's System Preferences. And I can't access the System Preferences since it's a GUI application! With the help of this Apple Support article, I could enable the VNC server. The VNC clients I tried reported errors like "No matching security types" and "Server did not offer supported security type". Finally I got it to work. The trick is to enable "legacy mode" and set a password. This is the command that did the trick (with the legacy mode and password options highlighted): sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -restart -agent -privs -all -clientopts -setvnclegacy -vnclegacy -yes -setvncpw -vncpw somesecretpasswordI guess there are security implications with this, but as long as I don't expose the VNC server to untrusted computers, I guess I'm fine. Both Vinagre (the VNC client that comes with Ubuntu) and xtightvncviewer now work. The vncviewer command still doesn't connect properly for what seems to be some other reason. Technorati tags: vnc, remote desktop Thursday, June 11. 2009How to create a Git repository from a Subversion working copy
Sometimes I want to add the files handled by one version control system into another. Typically I have checked out files from a read-only Subversion repository and want to add all files to a Git repository, so I can work with them locally.
The following command has worked for me, and perhaps you'll find it useful. Just change to the directory where you have your Subversion working copy. Then create a Git repository in the same directory: git initThe Git workspace will be in the same directory as the Subversion working copy. This works fine since they store their metadata in different directories (.git and .svn respectively). Now, to add all files that are under Subversion control to the Git repository, execute: svn ls -R | grep -v '/$' | xargs git addThe svn ls -R command lists all files and directories, the grep command removes the directory names from the list, and then all the file names are sent as parameters to the git add command. Of course, this only works if you have those commands installed. It should work fine under Linux, OS X or other Unix variants. I haven't tested it with Windows ports of the same commands. Now that the files have been added, just commit them: git commit -m "Files from Subversion revision XXXX"EDIT: Changed the title of this post as it sounded like this is a way to convert a Subversion repository to Git,. What I'm doing here is taking the files under Subversion control, i.e. the working copy, and adding them to Git. I typically realize I want to do this after checking out the Subversion working copy, and this is a simple way to do it. To convert a Subversion repository to Git, git-svn is a better tool. Technorati tags: git, subversion, version control Wednesday, May 13. 20097-bit characters today
I got this error message when I tried to log on to my bank today:
![]() It's in Swedish but note the strange use of curly braces and pipe characters. Back in the eighties it was common to have national code pages where certain seldom used characters in the ASCII set were replaced by national characters. For Swedish, the mapping included: { (left curly brace) mapped to ä (lower case a with umlaut) } (right curly brace) mapped to å (lower case a with circle above) | (pipe) mapped to ö (lower case o with umlaut) It was common that software didn't map correctly to the national characters. Many users learned to read the braces and pipes fluently instead. I can't remember the last time I saw this character mapping used. It must have been 15 years ago or so. Until today. Technorati tags: computer nostalgia, ascii, character set Thursday, February 26. 2009Meme time: Wikipedia album generator
I think it originated here. Anyway, here are the rules:
1 - Go to Wikipedia. Hit random. The first random wikipedia article you get is the name of your band. 2 - Go to Random quotations. The last four or five words of the very last quote of the page is the title of your first album. 3 - Go to flickr and click on explore the last seven days. Third picture, no matter what it is, will be your album cover. 4 - Use photoshop or similar to put it all together. Preferably in a square format layout, like a nice old-timey vinyl album cover. Here's my result. ![]() Original photo by CarLee. Friday, January 16. 2009The frame rate of the universe
I stumbled upon this article which presents the hypothesis that the universe is a 3D projection of a 2D surface, like a giant hologram. I like to read about modern physics. It is so weird and I can't say I really understand very much of it. But the descriptions provoke strange and fascinating images and thoughts in my head. Like this one:
The article mentions the Planck length, which as I understand it is the smallest distance there is. It's extremely small: 1.6 × 10-35 meters, which makes it billions and billions of times smaller than an atom (or even a proton). I'm used to thinking about computer graphics, so I imagine the Planck length as the size of one "pixel" of the universe. Nothing can be smaller than a pixel. (The pixels of the universe are small, I calculate the resolution to correspond to 2.19 × 1033 DPI.) The radius of the observable universe is 4.4 × 1026 meters. If we want to fit the universe into a box, its sides would have to be twice that size. That is 5.4 × 1061 Planck lengths. So that's the width, height and depth of the universe in pixels. Quite a good resolution. (Actually since they are 3D cubes instead of 2D squares, I should call them voxels instead of pixels. All 1.61 × 10185 of them.) There is also the Planck time which is the time it takes for light to travel one Planck length. As light is fast and the Planck length is tiny (tiniest there is!), you can image that it's a very short period of time. Certainly. The Planck time is 5.39 × 10-44 seconds. No measurable time can be shorter than that according to quantum physics. Thinking about graphics again, this is like a limit on the frame rate of the universe. Inverting the Planck time, I get 1.855 × 1043. So by my surely incorrect logic, we get the value of the universe's frame rate: One thousand eight hundred and fifty-five billion billion billion billion frames per second. I'll say that again: 18.55 septillion FPS! Video cameras won't be perfect until they can record at that speed. I hope I got the calculations right, but I'm pretty sure my interpretation of the quantum physics behind this are way off. It's still fascinating to think of the universe as a computer simulation. Modern physics make it seem more like a video game than ever. Thursday, January 8. 2009What are the oldest files in your home directory?
James Bennett replies to Doug Hellman's follow up on Brandon Craig Rhodes' idea "What are the oldest files in your home directory?". Of course I couldn't resist doing the same. I won't repeat the procedure for how I found my oldest files, since the posts above tell you how if you want to repeat the experiment.
Before I go on listing my oldest files, I'll tell you what files you unfortunately won't find listed here. It must have been around 1998 when I received an old cardboard box with the old cassette tapes containing the old games me and my brother made for the ZX Spectrum 8-bit computer back in the mid 80's. The tapes were like ordinary audio cassettes, and I used some DOS software that could read the Spectrum's format through the PC's sound card. Unfortunately the tapes had deteriorated to the point where most of the files were unreadable. The games I got to run were quite embarassingly bad, so I thought they were better kept in fondness in my memory instead of in the light of a present-day emulator. I throw the box with the tapes away. Anyway, I found some pretty old files whose timestamps have survived several computer generations. Here we go: 1995-08-07 ./gammalt/pre-2000/exjobb/INLEDNIN.DOCThese files are the documentation for the degree project I did with a friend back in university. We investigated the implications of moving from a classical two-tier client/server architecture to a three tier GUI/functionality/database model. Nobody builds two-tier systems any more, so I guess the three-tier model won. Reading a few pages, I notice how much else that hasn't changed. What we discuss in this document is what today goes under names such as SOA, RIA and Ajax, and the issues we bring up are still relevant. So much for the misconception that what you learn in university is out of date by the time you graduate. Note that we split the document into several files to keep Word from choking on the size of it. I doubt you even can do that in the latest version of Word. 1995-12-13 ./gammalt/pre-2000/bildmanipulation/LASER4.JPGThis file must be even older than what the timestamp says. It is my first experiment with manipulating images with Photoshop. I took the original photo with my good old Minolta 9xi analog camera (or perhaps it was even the bad old 3xi) and scanned the print on the university's flatbed scanner. Not the best way to go for image quality I guess, but it was not like any normal person had a digital camera back in '95. The university had a small computer lab with a few Macs where i snuck in to learn Photoshop and this was the result. 1996-02-28 ./gammalt/pre-2000/august/annan diskett/BRUNNEN.WPSThose are some of the files for a children's book I was writing with a friend. We even had meetings with publishers about it, but it never was published, in part because of the discrepancy between the childish story and characters and the more mature humour. My entry to the IRTC June 1997 (click to enlarge). 1997-06-25 ./Documents/povscn/balls/BBall.incThese are source files for the POV-Ray raytracer and consist my entry for the june 1997 issue of the Internet Raytracing Competition (on hiatus since 2006). See the viewing page for that month's competition. I have older POV-Ray source files hidden in a zip file somewhere, but the files above are unpacked because I used them for something back in 2005. I found more interesting old files, some that I had forgotten about. There is enough stuff for another blog post strolling down memory lane, but this is enough for now. Technorati tags: computer nostalgia Tuesday, December 2. 2008Saved by tcpdump
Have you ever written a long post on a forum or a blog, clicked the submit button and got an error message back? Perhaps there was some temporary glitch in the server so your long thoughtful post wasn't saved, but all too often it's because your session has expired and you're requested to log in again. If you click the back button in this situation there is a risk that you will come back to the empty text box you started out with and there is no way to get your post back.
What I have learned to do in these situations is that instead of clicking the back button, I refresh the page. The browser will ask whether you are sure that you want to post the same data again, so the data is obviously still there in the browser's memory. If you go ahead and try to post again, you may succeed (you do risk a double post if the first post was successful although it looked like there was an error). If the server keeps on giving errors, I have a trick that is quite primitive. I start a network sniffer before I click the refresh button. (If you didn't know, a network sniffer is a piece of software that saves everything that is transferred over the computer's network card.) Wireshark is a GUI software that works well. Unix-like systems (including Linux and MacOS X) have a command-line utility called tcpdump. You can invoke tcpdump like this to capture everything that goes over port 80 (the default port for web traffic): sudo tcpdump -s 0 -A -i en0 port 80 > dump.txtThis will save the data in the file dump.txt. (You may have to replace en0 with whatever the name of your network card is.) Open dump.txt in a text editor and you should be able to find the text. It will be URL encoded (spaces are shown as "+" and other characters as "%21" etc.), but a good text editor should be able to unescape it. (In TextMate you'll find URL Unescape in the HTML bundle.) Then you can just save your witty, informative and well-written text to retry the post. I'd be interested to know if there's a simpler solution but this one works very well and has saved me a few times. Technorati tags: tcpdump, wireshark
Posted by Martin Vilcans
in Software, Software development, Web
at
18:21
| Comments (0)
| Trackbacks (0)
Monday, December 1. 2008The "one simple step rule" of development environments
There are many ways to set up a development environment when creating software. With a development environment I mean all the tools that the developers use to create the software, including the physical machines, operating systems, IDEs, build scripts, issue trackers, version control systems etc. Being a contractor I get to see a lot of different setups. If you're a new developer on a project that has been active for a while, it shouldn't take more than an hour from when you sit down in the chair on your first day to the moment when you have a working environment and can edit and run code. Unfortunately many projects underestimate how important this is. I've been in projects where weeks have gone by before some developers had the complete setup. Sometimes the hindrance is a slow authorization process by some remote IT support department which won't let you access parts of the system. Sometimes setting up the system requires deep knowledge of how the system works, and as a new developer it's cumbersome to troubleshoot a complex architecture with several interdependent components (GUI client, client-side logic layer, app server, web server, database, you name it). Sometimes it takes days to learn just how to build the damn thing.
There is a lot of time wasted on these things in software projects. The best thing to do to avoid such a situation is to have as a rule, from the very beginning of the project, that it should be possible to create a working development environment from scratch in one simple step. Typically the single step is to write a single command, whereby the build system will set up the environment properly, download the code from the version control system and create a complete working system. After editing code it should be just as easy to make and run a new build, but that goes without saying. Having a short edit/run cycle is essential and a one-step build process is a requirement for implementing automated continuous integration. It is important to have the "one simple step" rule in mind from the outset of the project. It may take a little time to create an environment that supports it and with some esoteric development kits it may actually be a bit difficult. Still, it is an investment that pays off in saved time and frustration, and it is much more difficult to create a good development environment for a moderately complex project that has been going on for a while (not to mention projects that have been around for a few years). I wouldn't recommend creating the mother of all development environments from the outset. You can begin with a simple build system and add functionality to it as it is needed. Just keep the "one simple step" rule in mind. Technorati tags: continuous integration, development environment, programming Sunday, November 30. 2008Are we in the 21st century yet?
I went to the city of Västerås today. It's a one hour train ride from Stockholm. The railroad company has received a lot of criticism for their incomprehensible pricing scheme, but apparently that has changed. As far as I can remember it from the last time I used it, the online booking system has been improved as well. But the coolest thing is that it's possible to order and pay for the ticket on the web site and receive the ticket as a text message to your phone. On the train I just showed the message to the ticket-collector. He used a device with a small camera, like the one on mobile phones, to scan the display of my phone. It took a few attempts for the OCR to get it, but hey, this really felt like science fiction. 10 years ago it would have been. It felt a bit like we have finally arrived in the 21st century.
But when I came to Västerås and tried to use Google Maps Mobile with lousy GPRS coverage to find my way in the chilly wet semi-suburban streets, I felt like I was back in the 1990s. Friday, October 24. 2008Increase the frame rate or be boring and conservative?
The BBC has published a research white paper about high frame-rate television. According to their experiments, a higher frame rate becomes necessary to avoid juttering or smearing of moving objects as the resolution and size of the TV screen increases.
As an old demo coder, I tend to frown upon the jerky motion of sub-50 frames per second graphics. Many a hard-core gamer would tell you that they wouldn't play a game running at only 30 fps. BBC's research shows that even at 100 fps, there is room for improvement. Still, motion pictures are trudging on in their old 24 fps that was set as a standard when sound film was introduced in the 1920's. As BBC's research shows, the perceived image quality can be increased tremendously by increasing the frame rate. There are suggestions to improve the frame rate of motion pictures, but since video has always had higher frame rates than film, those suggestions are typically met with a large number of filmmakers saying, "It looks like video!" So what? It's not like video is a dirty word. Currently, there is a new generation of filmmakers growing up that never has and never will shoot on film. In a few years, digital acquisition and projection will have more or less killed canned celluloid. Why should filmmakers stick to the limitations of film? Sure, video gives a different look than film and 100 fps gives a different look than 24 fps. But thinking different means worse is conservative in a very boring way. Technorati tags: frame rate, fps, filmmaking Thursday, October 16. 2008When Harry met Bettan screening at Uppsala Short Film Festival
I was invited to direct a short film this summer. Of course with a budget very close to zero, but enough to cover most expenses and with a writer/producer who could take care of lots of the practical things around making it. The first public screening will be at the Uppsala International Short Film Festival. (The site isn't designed for deep links, but here's a link to the screening.) The film is called "När Harry mötte Bettan" (When Harry met Bettan) and tells the story of a bitter young woman working in a video store and a romantic movie loving nerd who also happens to be a bouncer at a local night club. The movie is in Swedish, but time will tell if we'll release a subtitled version.
Here are two world exclusive stills from the film: ![]() Niclas Buskenström as Harry ![]() Denicé Lundevall and Nathalie Söderqvist as Maja and Bettan Wednesday, October 1. 2008Quality + Quantity = Information Overload
People say that the key to writing a popular blog is to post often and regularly. If there is truth in this, I guess I'm not representing the typical feed subscriber as I have unsubscribed from blogs with interesting well-written content simply because they posted too frequently and I couldn't cope with the volume. If a feed is never updated, you forget that you're subscribed to it and it does you no harm, so there's no reason to cancel the subscription. Frequently updated feeds on the other hand make you feel stressed when you can't keep up with the information flow. This is a problem with the quality of the posts, but not in the way you'd normally think (that quantity has a negative impact on quality and vice versa). Quite the opposite: If the posts aren't good, you simply unsubscribe. It's unsubscribing to a stream of interesting/amusing/insightful posts that poses a problem. You get the feeling that you'll miss something, so you don't want to press that unsubscribe button. Quantity coupled with quality is what causes information overload.
To avoid information overload from quality and quantity, subscribe to my feed instead. I won't update often, I promise. As for the quality, I'll leave that for other people to judge. Technorati tags: blogging, feeds Thursday, June 26. 2008The PowerMac G5's power button
When I first got my PowerMac G5 several years ago, my first impression of the power button on it was bad. It's a clear example of form over function. It looks nice, but since the button is flat and level with the computer's front surface, it's difficult to find it by just feeling. I need to bend down to see the button to be able to find it.
But then I realized that even though it's annoying that I find it difficult to find the button, this also means that my son can't find it either and put the computer to sleep while I'm trying to use it. Well, not any more. ![]() ![]() Technorati tags: apple, powermac, power button, usability Saturday, June 14. 2008Set maximum threads in Blender!![]() Where to set the number of threads in Blender. I recently discovered that Blender (the open source 3D modeler, renderer and steep learning curve kitchen sink) only uses one CPU by default. It is possible to change the number of threads that Blender should use in the render settings. I expected the optimal number of threads would be the same as the number of CPUs. My good old Mac G5 has two CPUs, but eight threads (the maximum) actually renders a little faster than two. The big difference is seen between one and two threads though. Your mileage may vary of course, but if you're a Blender user who hasn't seen this setting before, try tweaking it! Technorati tags: blender, blender3d Saturday, April 26. 20083D Movies - Mainstream or Gimmick?
So, now I have watched samples of the latest trend in the motion picture industry: three dimensional (stereoscopic) movies. The main part of the reason for this trend is probably that there currently is no affordable way to view 3D movies at home, so they are a way to lure people back into the cineplex. 3D movies have been around since the 1890's (source: Wikipedia), and there have been several waves of 3D movies since then, but 3D hasn't caught on as the standard way of doing movies, like sound and colour once did. It is still a gimmick for just a handful of films.
The current digital 3D movies have far better image quality than previous technologies. I went to a 3D screening at the "inspiration weekend for filmmakers" Drömfabriken (site in Swedish!) this week, and the talks before they actually showed the movie clips sounded very promising. One person thought that 3D movies are here to stay this time. And the clips they showed looked good. I could see no ghosting (where you see a little of the right eye image in your left eye and vice versa), and the colour reproduction was excellent. The main technical problem I saw was that the 3D effect was more or less exaggerated. The image had more depth than what it would look like in real life. This causes double vision sometimes, and looks unrealistic all the time. The reason for the exaggerated 3D effect is probably that the "eyes" of the camera they used for filming were further apart than human eyes are, so it's a problem that can be solved by just moving them closer together. But if you do not exaggerate the 3D effect, the image would look quite flat. When you're looking at stuff in the real world, you do not actually have that much sense of depth at distances that are greater than a few meters. Stereoscopic vision is most useful at close distances. At larger distances, other parts of the brain do the work of figuring out how far away objects are. So, if you move the 3D camera's "eyes" closer together to get a realistic 3D effect, you don't get much of a 3D effect at all except for closeups. So why would the film production go through all the trouble of filming in stereo and forcing the viewers to wear those ugly glasses for such a subtle effect? I think the glasses is the reason that 3D movies won't go mainstream this time around either. You just don't want to make out in the back of the theatre wearing alien goggles. Since one driving force behind 3D movies is to get the audience into the theatres, it's ironic that the first 3D displays that don't require glasses are suited only for home use. The technology wouldn't work in a cinema. (This has to do with the fact that these 3D displays have a small "sweet spot". They don't allow for a wide viewing angle.) So, was I impressed by the 3D screening? No. It didn't feel very fresh or new, but it still is a cool effect, no doubt about it. It has always been. I just don't see it going mainstream any time soon. James Cameron (director of Aliens, The Terminator, Titanic and upcoming 3D feature Avatar) has a different opinion in this interesting article. Technorati tags: stereoscopic movies, 3D movies
(Page 1 of 7, totaling 92 entries)
» next page
|
PagesQuicksearchRecent EntriesHow to enable remote desktop on headless Mac
2009-06-14 How to create a Git repository from a Subversion working copy 2009-06-11 7-bit characters today 2009-05-13 Meme time: Wikipedia album generator 2009-02-26 The frame rate of the universe 2009-01-16 What are the oldest files in your home directory? 2009-01-08 Saved by tcpdump 2008-12-02 The "one simple step rule" of development environments 2008-12-01 Are we in the 21st century yet? 2008-11-30 Increase the frame rate or be boring and conservative? 2008-10-24 Categories |