One of my favourites is the uniq
command. The command enables you to report or omit repeated lines in a file.Here’s some switch details from the man page.
-c, --count
prefix lines by the number of occurrences
-d, --repeated
only print duplicate lines
-u, --unique
only print unique lines
So if you wanted to find and sort common lines in two files you could do something like.
# cat file1 file2 ! uniq -d | sort
Quite a few friends have been asked to do something similar in interviews. I always find that a bit funny as it takes a minute to look this stuff up online so it’s probably not crucial to know every Unix command off the top of your head. Although there’s probably some nerdy bragging rights but with a 96% nerd test score I think I’ll pass.
Tag: technology
the phone as an AP
I saw this earlier today and thought it was really cool. I’m off to Mobile World Congress next week to demonstrate some of our work on the IMS-ARCS project. I guess if the tradeshow’s internal network should crash I can always turn my N95 into an Access Point. I’m kinda hoping this doesn’t happen but it would certainly be enviably geeky 🙂
tethereal and diameter
Here’s a useful tethereal filter that’s helped me out while debugging the Sh diameter interface of Fokus’ OpenIMSCore.
# tethereal -i lo -f "port 3868" -V -R "diameter"
I appreciate it’s a bit random but tethereal is one of my favourite tools and in Verbose mode it nicely format’s all diameter AVP information.
The case against Steorn
Deliberately misleading title for this post. The truth is that I’m a believer. This must be qualified as I’m not sure they know what they’ve actually done or the exact/proximate principles upon which it works. It’s interesting though that the arguments against Steorn should be looked at dispassionately. Here’s the arguments against from Wikipedia.
- Instead of opening up their technology for public inspection, Steorn has pitched their claim directly to the media. This is considered by Dr Robert L. Park, a professor of physics at the University of Maryland at College Park, to be an important indicator that a scientific claim lies well outside the bounds of rational scientific discourse.
- Steorn’s claim violates the first law of thermodynamics. Many ordinary people and established scientists including Leonardo da Vinci have attempted to do this for centuries and failed.
- In particular, Steorn claims to violate the law using “a way to construct magnetic fields so that when you travel round the magnetic fields, starting and stopping at the same position, you have gained energy”. Magnetism is a conservative force, so it is well established that the energy of motion which one gains when two magnets attract or repel is exactly equal to the energy needed to restore the starting position, no matter how you arrange the magnets.
- In view of the fundamental nature of the laws of thermodynamics within physics,
overwhelming evidence would be required to support Steorn’s claim that these laws have been violated. No such evidence has been provided.
1 – Dr. Park’s reasoning is sensible but not conclusive in and of itself.
2 – Ignore the DaVinci comments. Most scientists I know realise that his contribution to science is far far below his contributions to art. So let’s deal with the first law of thermodynamics. (“The increase in the internal energy of a thermodynamic system is equal to the amount of heat energy added to the system minus the work done by the system on the surroundings.”) In an age where there exist many scientific phenomena which are not fully understood can we really consider the first law of thermodynamics to be inviolable? If we do then how do we define “surroundings”? We don’t have a GUT, we don’t have an independent reference frame so it’s all observational. In light of this it’s very difficult to say that so-called “energy from the void” theories and apparatus are unworkable as we can only talk about observed energy transfer. Try getting a string theorist to define “surroundings”!… Don’t think we’ve reached our zenith of knowledge yet just like we hadn’t in 1905 when classical mechanics was revealed to be inadequate and relativity was born.
3 – It’s possible their mechanism to achieve the end result (apparent perpetual motion) is not well explained in their documentation for deliberate or accidental reasons. This is not cold-fusion. According to the company they’re repeating the experiment every day. I just don’t think these guys are cranks. However, it’s important to note that they CAN’T PATENT THIS SYSTEM IN ENTIRETY until they understand roughly how it works. Patents generally can’t be granted if they violate physical laws. So I’m guessing they’re getting their scientific evaluators to help make their case.
4- Agreed. So let’s wait and see.