Avian’s Blog

Electronics and Free Software

Reblog icon

13.06.2008 10:26

Last week Zemanta released Re-blog - a feature that allows easy and proper quotation by clicking on a small icon on the bottom of a blog post.

I found the previous Zemanta icon visually annoying and did not want to include it in posts on my blog. However, in the spirit of "don't just complain, but suggest a solution", I started up GIMP and came up with these in an hour or so:

Compare this to the old icon:

When I got back from Tenerife I was surprised to learn that my "Traditional" version of the icon is now one of the icons you can choose in the preferences page.

Posted by Tomaž | Categories: Ideas | Comments »

Early summer math

22.05.2008 20:02

Getting caught in an early summer shower a while ago got me thinking. If you have to run a certain distance through the rain and want to remain as dry as possible, is it better to slowly walk or run as fast as possible? It's a popular question and I remember seeing Mythbusters and Brainiac episodes on a similar topic. But since I didn't feel like experimenting I tried to come up with a theoretical solution.

First there are some things that needed to be defined:

I defined rain as a homogeneous mixture of air and water, moving downwards with a constant velocity (since raindrops reach their terminal velocity well before hitting the ground).

The measure of wetness is the amount of water accumulated on you during the exercise, and that amount is proportional to the volume of air/water mixture you displace during movement. The rationale here is that the air will move around you as you move through the rain while water droplets will stick to you since they cannot follow the air flow due to their inertia.

To make calculation simpler I also presumed that the person is of a rectangular shape (the following calculation is done in two dimensions, but accounting for the depth is trivial). You can think of the rectangle sides a and b as your projections to the vertical and horizontal plane.

Now with these things defined, it's pretty simple to get to a result. You basically have to calculate the volume of the hole you bore through the rain. Here is the situation with the ground as the frame of reference, where va is your velocity, vb is the velocity of rain droplets and d is the distance you have to cross in rain.

It may be simpler to think with the water droplets as the frame of reference. In that case the rain is stationary and you are moving up and right through it with the velocity va - vb.

The displaced volume is then the sum of volumes of three parallelograms:

\mathcal{P} = \mathcal{P}_1 + \mathcal{P}_2 + \mathcal{P}_3
\mathcal{P} = a \cdot b + a \cdot h + b \cdot d
\mathcal{P} = a \cdot b + a \cdot \frac{v_b \cdot d}{v_a} + b \cdot d

Now if you look at these three terms: the first and the third one are constant. Only the second one depends on your velocity va and it's an inverse relationship.

So the conclusion of this purely theoretical endeavor is that the faster you run, the dryer you'll be and even if your speed goes to infinity, you're still going to get wet. Also note that the amount of water accumulated on your front side is the same regardless of your speed, it's only the amount that falls on the top of your head that varies.

Posted by Tomaž | Categories: Ideas | Comments »

Mutual inductance problem

05.04.2008 17:02

A few days ago I was browsing through my notes from the first year of study and I stumbled upon this interesting problem I've never managed to solve. I've discussed this a couple of times with the late professor Valenčič and we couldn't find a flaw in my line of reasoning. So, if you know what's wrong, please drop me a mail.

Describing mutual   inductance

In professor's book, there is an introduction to the principles of mutual inductance that goes like this:

Imagine two coils (designated 1 and 2) in some arbitrary relative position to each other. Current i1 that flows through coil 1 will cause a magnetic flux through coil 1 Φ11 = i1 ⋅ L1 (according to the definition of inductance). However some of the flux will also flow through coil 2, designated Φ21.

Mutual inductance between coils 1 and 2 is then by definition:

M21 = Φ21 / i1

Obviously, the magnetic flux Φ21 is less or equal to Φ11, so we define a coupling coefficient k ≤ 1 so that:

Φ21 = k ⋅ Φ11

Now due to principle of reciprocity, the same holds true if the current flows through coil 2 and we calculate the flux through coil 1. Coupling coefficient stays the same:

Φ12 = k ⋅ Φ22

Now multiply both mutual inductances:

M21 M12 = k2 Φ11 / i1 Φ22 / i2

Use definition of inductance:

M2 = k2 L1 L2
M = k sqrt(L1 L2)


Now this final formula is present in a lot of literature and it's certainly correct. It's also certainly true that from the principle of reciprocity M21 = M12. However this way of deriving the formula seems dubious - from steps above you can also see that:

M21 = k Φ11 / i1
M12 = k Φ22 / i2

And since M12 = M21:

M = k L1 = k L2

L1 = L2

Which would mean all pairs of inductances are equal, which is certainly false since we didn't impose any restriction on the geometry of the two coils.

If I would have to guess, I would say something is wrong with the first application of the reciprocity to the fluxes through the coils, however from what I know this should be correct.

So yeah, if you are fluent in electromagnetic theory, I would love to hear your opinion.

Posted by Tomaž | Categories: Ideas | Comments »

Being a bit evil

17.03.2008 19:20

One thing that I learned at Zemanta is never to underestimate processing power and memory needed to do anything non-trivial (and also a lot of trivial things) with English Wikipedia dumps. After you spend some time dealing with these huge XML files you gradually learn from your mistakes and accept that as a fact.

The resources needed to process Wikipedia also became kind of a recurring inside joke at the office, especially when this needs to be explained to someone new in this field:

It is certainly not
a bug

(this is, of course, a completely unofficial imitation of a xkcd comic)

Posted by Tomaž | Categories: Ideas | Comments »

Crack

22.11.2007 3:54

Last Friday I went with the rest of Zemanta's team to see the famous crack on the floor of Tate Modern gallery. Considering that I read Stephen Baxter's Moonseed recently, the timing just couldn't be better.

The gallery occupies the building of a former power station and this particular art installation is placed in its massive turbine hall.

The sheer size of the hall is impressive. You can still see some large steam pipes that were cut off at the walls. I can't stop myself thinking that this place probably looked more impressive when it was filled with machines than how it is now, serving as a gallery for modern art.

On the other hand Shibboleth (the formal name of the installation) looks equally impressive. It spans the whole length of the hall - it starts at the entrance and disappears below the far wall - and looks very realistic, down to the smallest detail. Both edges of the crevice really look like they once fit together. I haven't seen any clues on how this was made - even the hairline cracks at the edges look like they formed in the material of the floor. I expected to see some marks where they dug out a larger groove and then filled it with concrete, but now I have no idea how they managed to dig such deep and narrow grooves into the concrete floor.

The realism breaks down only when you look closely at the inner walls of the crack which are too smooth to be natural and where you can see the iron mesh that reinforces the concrete.

I failed to see how this installation addresses a long legacy of racism and colonialism that underlies the modern world which is, as I learned from a sign on a wall, the message that the artist wanted to convey with her work.

Posted by Tomaž | Categories: Ideas | Comments »

Cool switches

12.11.2007 18:24

The next electronic thing I build will definitely have one of these things on it.

(found on CNET's list of Top ten off switches)

Posted by Tomaž | Categories: Ideas | Comments »

Gimping Galaksija

07.10.2007 13:24

Some time ago (probably while I was waiting to get my thesis approved) I didn't have anything better to do and I played with printed circuit board masks for Galaksija motherboard and GIMP. I just found these two images again today when I did some hard disk clean-up

This is how a professionally created Galaksija PCB would look like, with green solder mask, white silk layer print and gold plated contacts. I got the idea for doing this from a post on gEDA mailing list. Maybe I'll eventually hack up a GIMP script that will do this automatically from a PCB file. A picture like this is useful to do a last sanity check on a board before sending it to the manufacturer.

This one is a bit weirder and shows how a motherboard would look like on a x-ray machine.

Posted by Tomaž | Categories: Ideas | Comments »

Why HDTV?

10.07.2007 14:11

When I was designing Galaksija's video amplifier I did some reading on the design of analogue (now called low-definition) TV systems. It's impressive how much science and research went into this.

The resolution of various components of the video stream (luminance, chrominance) for example was chosen on the basis of research into the capabilities of the human eye. Only some relatively minor design decisions were based on technology limitations of the time (like interlaced picture).

Now suddenly there appears to be a general opinion that these 40-years old specifications aren't good enough and that everyone should move to new HDTV standards. These new standards seem to be based on a race who will cram more pixels on the screen rather than some scientific method (it seems they can't even decide on a single picture format).

So I wonder: either the designers of the original TV missed something and the resolution of the analogue TV is really smaller than it should be or are HDTV systems designed only so that they look better in the shop when you're looking at them from a much shorter distance than usual and can actually see the difference in the resolution.

Posted by Tomaž | Categories: Ideas | Comments »

Dangerous code

03.05.2007 10:21

This piece of Z80 code will assemble into a certain 16 byte sequence that seems to be quite popular last few days.

add hl,bc	;0100   09
ld sp,hl        ;0101   f9
ld de,09d02h    ;0102   11 02 9d
ld (hl),h       ;0105   74
ex (sp),hl      ;0106   e3
ld e,e          ;0107   5b
ret c           ;0108   d8
ld b,c          ;0109   41
ld d,(hl)       ;010a   56
push bc         ;010b   c5
ld h,e          ;010c   63
ld d,(hl)       ;010d   56
adc a,b         ;010e   88
ret nz          ;010f   c0
Posted by Tomaž | Categories: Ideas | Comments »

Web two point oh

14.01.2007 14:02

Do you think all this Web-two-point-oh You-control-the-information-age stuff was made possible by fancy XML, Javascript and other technologies I haven't heard about?

Wrong. I think user-provided content on large web sites was feasible only after the use of Captchas became wide-spread. All web pages would be filled with links and advertisements for casinos and porn sites without this inaccessible, politically incorrect and unfortunately also the only reasonably effective way of detecting a living brain on the other side of the HTTP connection.

This post brought to you by last year's disappointment at the impossibility of creating a spam-free comment system that is accessible from a text-only browser (and ignoring specialized solutions such as this interesting example).

Posted by Tomaž | Categories: Ideas | Comments »

An ideal mobile phone

30.11.2006 11:18

I find the quality and design of wast majority of today's mobile phones appalling. I believe these devices are one of the best examples of wide-spread feature bloat. So, here's my idea for an ideal mobile phone (in hope someone from the industry will actually read this):

Hardware

  • A durable casing that will survive a fall or two without breaking apart.
  • Clamshell design: mobile phones are made for talking. I think the most intuitive way of answering a call is to open the flip, not searching for the right key to press (in a hurry I often happen to press the wrong key). Also with this design the positions of the microphone and earpiece allow for better voice quality.
  • Monochrome LCD display: I don't care about colorful menus or a true-color video of a sheep to say "Hello" to me when I turn it on. On the other hand I do want to be able to read the display comfortably in sunlight. Monochrome displays also consume less power.
  • No cameras, hard drives, GPS, flashing lights or other nonsense. Your making a telephone not some mixture of all of today's popular electronics.
  • Bluetooth for communication with a personal computer and other devices (like wireless headsets). Infrared is history. So are the serial and parallel ports.

Software

  • There are exactly four features to be implemented: voice calls, data calls (in combination with a Bluetooth connected computer), short messages and an address book. A calendar is also acceptable (I personally find a paper calendar superior to any electronic alternative, but many people I know use this function). I don't need games, ring tone composers, photo editors and other such stuff. Most people I know don't know (or don't want to learn) how to operate their WAP browsers and many don't know what a MMS is.
  • Don't write everything from scratch for each new phone. Have an operating system that is stable and is optimized for the limited system resources of a mobile phone. This way each release of the software will have less bugs (I have a feeling it's exactly the opposite today - each new phone seems to have more bugs). Don't use stuff like Windows CE or Linux (it's a mobile phone Jim, not a laptop)
  • Use a big, friendly font on the display. From time to time I actually read the contents of the display (I've seen a phone display tiny dark blue text on a light blue background). You can make it look good and make it usable. Ever heard of something called usability?
  • Stick to standards when communicating with other equipment. AT commands were invented for a purpose. Don't reinvent the wheel and make a Windows-only driver for it just because you're lazy and you didn't do your homework. Bluetooth implementations are notorious today for incompatibility because nobody sticks to the standard.
  • Have I mentioned reliability? Dropped connections, software lock-ups, erased address books, garbled messages, etc. are daily occurrences. Since it's happening to everyone almost nobody is complaining. The standard practice today seems to be to ship a product with half-finished software, release two or three patches for most obvious bugs during the production time and forget about it when a new model comes on the market. Spend more time writing quality software instead of adding a hundred new features.
  • Don't delete every piece of documentation and software about a model the minute after a new model comes to market. Some people buy used phones and they like to still get user's manuals and software updates from your web page even after you stop selling this particular product. Are you really that short on disk space on your web servers?

For a while I was hoping that at least Apple will fix some of these problems with their iPhone (judging by how well they designed iPods). But now more I'm reading about it, more it looks that Apples product will be just as feature-bloated as everyone else's (it will perhaps just look good on the outside).

Posted by Tomaž | Categories: Ideas | Comments »

Ghost in the rasterizer

25.10.2006 14:37

Judging by the abstract art my printer sometimes makes I guess it already passes the Turing test.

Posted by Tomaž | Categories: Ideas | Comments »

Popularity contest

30.06.2006 20:49

In reference to yesterday's late-night discussion, Harry Potter seems to be around 8200 times more popular than the Slovenian classic novel Deseti brat (according to the number of hits on Google).

Posted by Tomaž | Categories: Ideas | Comments »

Let's see if this works

22.05.2006 14:03

Dear Lazyweb

Can you make a PVM3 compatible library that would:

  • Communicate over TCP instead of UDP,
  • use strong authentication and encryption and
  • would tolerate large roundtrip times and packet loss.

Bonus points if it uses HTTP requests to be more firewall-resistant.

Ordinary PVM is completely useless over large, insecure and slow networks like the Internet. Also a standard library like that would simplify large distributed computing projects where nodes are scattered all over the world.

Thanks.

Posted by Tomaž | Categories: Ideas | Comments »

A simple patch

07.02.2006 16:47

Recent news make me think that Wickel's program might need to be patched:

 
--- nuke/nuke.c 1997-10-01 12:27:27.000000000 +0200
+++ nuke-2006/nuke.c    2006-02-07 16:37:12.000000000 +0100
@@ -11,7 +11,7 @@
 #include <sys/time.h>
 #include <unistd.h>

-#define WALD 20  /* the Wald Number. */
+#define WALD 30  /* the Wald Number. */

 main ( )
 {
Posted by Tomaž | Categories: Ideas | Comments »