Sunday, December 28, 2008
women and maths and chess...
The first is a bit of mathematical obviousness which points out that: "There are few women at the top of science because there are so few women in science. It's simple statistics."
It uses the German chess federation's statistics to support the theory: there, men outnumber women by 16 to 1 (so if all other (significant) things are equal, there should only be a (1 - 15/16 ** 3 = roughly 18%) chance of a woman being in the top three, if I understand rightly).
Which begs the question, why are there so few women in chess/science/etc? Well, this is the subject of the second article...
Which is about a study where they split the (all female) subjects into two groups. One group was told that women perform poorly at maths due to genetics, and the other group was told that women perform poorly at maths due to social factors. Then they gave both groups the same maths tests and found that the 'genes make women bad at maths' group answered half as many questions correctly as did the 'society makes women bad at maths'.
This supports the idea that women being (statistically) worse at maths is probably wholly due to the negative, self-reinforcing erroneous stereotype that women are genetically predisposed to suck at it. Boo society!
I must admit to allowing myself to openly stereotype people more often than I'd like (i.e. than never), but seeing the power of negative stereotypes to destroy the performance of the maths test subjects it's time to at least keep such preconceptions to myself as much as possible.
Wednesday, December 24, 2008
mini cd/dvd -> Macbook -> oops!
A quick web search yielded predictable advice such as "power off the machine and use a paperclip to extract the disc" or "disassemble the machine and DVD drive to remove the disk". Since I wasn't keen on scratching the optical mechanism to ruin or dismantling the computer, I kept scrolling until I found the following blatantly obvious and blatantly sensible suggestion from 'ashleyman':
"Or just tip it so the drive faces the floor and give it a few taps!!"
This served me well and I safely removed the CD within 5-10 seconds of gently shaking and tapping the laptop with the slot facing down. Sometimes the solution is so obvious that you can completely pass it by!
Wednesday, December 03, 2008
OS X isn't all that great...
Every once in a while (month), when I allow it to restart to "finish" updating, nothing happens. I start manually closing programs after getting warnings that each individual program failed to close (although manually closing them causes no problems at all). This time, the Software Updater seemed to hang as well, even though I had already told it to restart my Mac.
In the end, the machine seemed to shut down but the fan was still spinning. After hitting the power button a few times and waiting a minute or two, I held it to force a power-off and reboot. Then, instead of seeing the "Installing updates" dialogue you usually get when rebooting after installing updates, I just got my usual login screen, and sure enough, logging in as normal (after a ridiculous 4 minute delay before the Finder menu would respond to mouse clicks, WTF?) and opening the System Updater started the whole process from scratch.
LAME. Absolutely lame.
Sunday, November 16, 2008
How to replace a bicycle tube/tyre ten times faster than I do
So I was a bit embarrassed to see these videos of a guy removing and inserting the tube (and outer tyre in the process, which seems to just speed things up) in about 80 seconds. I'm still a bit skeptical about dealing with the outer tyre, which seems much tighter and stiffer on my hybrid wheel, but I'll have to try it next time!
Tube comes out
Tube goes in
These videos come from the very useful homepage of Jim Langley. (Note: Opera users such as myself may want to identify as Firefox or IE due to some outdated JS-crippling)
Thursday, November 13, 2008
Meteor MMS on the Palm Treo 680
It's not possible to specify those settings completely in the Messaging program on the Treo 680; instead, you need to modify (or copy and use) the settings in (main) Prefs->Network. This configuration worked for us:
Service: Meteor MMS Copy
Connection: GPRS
User Name: my
Password: mms
APN: mms.mymeteor.ie
Then in the Messaging program, go to the Preferences menu, select the Network tab, change "Network Configuration" to manual and enter the "Edit..." dialogue, where you can enter the following settings:
Message centre number: +353857000000
Email centre number: [blank]
MMS HTTP Proxy: 10.85.85.85:8799
MMS URL: http://mms.mymeteor.ie
Network Profile: Meteor MMS Copy
This works for downloading MMS messages.
Tuesday, November 11, 2008
the arithmetic calculator exercise in GFA Basic
randomly entertaining Chinese sentence
Here's a nice one I found when looking up the character 肥 (fei2), which according to my book means "(of clothes, shoes) loose*, (of animals) fat":
我被两个肥胖的女人紧紧地挤在中间,以致于要站起来下公共汽车都很难。
I was so tightly wedged between two fat women that it was difficult for me to get up and leave the bus.
:D :D
* although I couldn't substantiate the first meaning from the online dictionary..?
Saturday, November 08, 2008
Common Lisp: arithmetic calculator exercise
Saturday, October 25, 2008
ntl's expanded internet pipe
They recently retooled their broadband packages, so that the old 6mbit price now gets you 10mbit and for €10 more per month you can get 20mbit (I wouldn't bother with that unless I was sharing with a few people, though).
I had to call up to get it though, since they weren't nice enough to automatically shift me over to the new package - this is really something ISPs should do when they improve their packages.
It's working pretty good too - close to the quoted 10mb:
Thursday, October 23, 2008
Lexmark X4550 wireless woes with OS X
After a long conversation with a fairly patient technical support guy at Lexmark proved mostly fruitless, I dug a little further and ran a packet sniffer (Wireshark) over an attempted print job.
This prompted me to double-check the printer settings, which showed a device URI of lexnet3://192.168.1.3:1. Which is certainly wrong, as the printer is at 192.168.1.4. I'm not sure why it doesn't just use DNS properly, but anyway.
Trying to correct this, I stumbled across this post explaining how to modify the device URI via the CUPS web interface available on OS X. And it works! Good old Unix!
article: "Early Childhood Education: The Key to Success in Life"
After emphasising some of the importance and benefits of preschool education, it lists some basic and simple ways in which you can help educate your bairns. As usual with such material, there are 'obvious' things that never occurred to me - like placing a young baby face-down from even one month of age, because he will naturally want to raise his head which will help build up his back muscles which will improve general strength and co-ordination. The paper-crumpling trick is clever too.
Well worth a read!
Friday, October 10, 2008
classy typing tutor
. o O ( "Cop smearer"?? )
Sunday, August 24, 2008
Ireland's gradual transformation to a police state
Well, here we are. The Department of Justice, Equality and Law Reform have made it so that all migrants to Ireland from outside the EU must be fingerprinted (and their details shared with who knows how many foreign agencies). And of course, the costs for this are passed on to the migrants themselves - they will pay another €50 on top of the old €100 "registration" fee to lose their privacy. I have to wonder what practical use there will really be for the fingerprinting.
The "Land of the 100000 welcomes" is long dead and buried by this point. What disturbs me is all the people who feel that all foreigners should be fingerprinted and they're lucky they're not just sent home immediately anyway. What if all Irish citizens had to be fingerprinted? Would that be okay? No? So why the double-standard, and where does it stop?
Saturday, August 23, 2008
Refactoring threats
Re: Do not run this script, ever!
2008-01-25 15:45 • by morry (unregistered) 173406
I've always thought it's better to put these things into the positive, i.e. don't use "don't". For example:
RUN THIS SCRIPT WHEN YOU WANT TO BE FIRED
EXECUTE THIS PROGRAM WHEN LIFE NO LONGER HAS MEANING FOR YOU
IF YOU LIKE EVERYONE HATING YOU, THEN START THIS JOB
MAKING TOO MUCH MONEY? DO THIS TO REDUCE YOUR PAYCHECK TO 0!
GET ESCORTED OUT BY MERELY PUSHING THIS SHINY RED BUTTON
Thursday, August 14, 2008
Stupid thing of the day
However, it can't upgrade itself from version 3.3.2 to 3.3.4.
WTF.
Wednesday, July 30, 2008
"Who gives a shit?" attitude -> better mental performance
For example, deciding whether to have cake or cornflakes for breakfast could be enough to make you perform poorly at an interview later on.
A further implication of this (to me) is that people who coast through much of the day like zombies (especially in the morning), not making many decisions, are much better able to perform when they need to, because they haven't depleted those resources yet.
The moral of the story: if you want to improve your overall mental performance, get into the habit of saying "who gives a shit?" about irrelevant decisions like where to put the furniture or whether the curtains need to be washed again this week. Don't deliberate over mundane issues. Don't waste your energy. Just pick the first reasonable option. I'd like to know if strategies like this can minimise this effect, or if we really have to go around like cattle - I know I do, most of the time... Is that what girlfriends are for? To decide where the couch and TV should be and what washing powder to use, so that I can reserve my brain power selfishly for 'clever' use later (which rarely happens)? Seems a little unfair, really...
I have more questions. How do we recover from the effects? How long does it take? Can we speed it up? What about meditation, or induced alpha/theta/delta brainwaves (i.e. by listening to binaural beats, say)? Why does it happen?
Enough rambling (I guess...), I'm off to dodge some decisions! Probably.
Wednesday, July 23, 2008
(Auto-)Growing Panes
After scratching my chin in confusion, I whittled out the following minimalish example that demonstrates the result:
import java.awt.Color;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import javax.swing.BoxLayout;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;
import javax.swing.border.LineBorder;
public class TextAreaExample {
public JPanel createContentPane() {
JPanel contentPane = new JPanel();
JPanel mainPanel = new JPanel(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
// ipadx > 0 causes textarea panel to grow horizontally forever if linewrap is set!
c.ipadx = 1;
JPanel leftPanel = new JPanel();
leftPanel.add(new JLabel("Left"));
mainPanel.add(leftPanel, c);
JPanel logPanel = new JPanel();
logPanel.setLayout(new BoxLayout(logPanel, BoxLayout.PAGE_AXIS));
JLabel label = new JLabel("Hello");
logPanel.add(label);
// create misbehaving textarea
JTextArea log = new JTextArea(10, 40);
log.setLineWrap(true);
log.setBorder(new LineBorder(Color.BLUE));
logPanel.add(log);
mainPanel.add(logPanel, c);
JPanel rightPanel = new JPanel();
rightPanel.add(new JLabel("Right"));
mainPanel.add(rightPanel, c);
contentPane.add(mainPanel);
return contentPane;
}
private static void createAndShowGUI() {
JFrame frame = new JFrame("JTextArea growth test");
TextAreaExample demo = new TextAreaExample();
frame.setContentPane(demo.createContentPane());
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
}
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
}
});
}
}
I can get around it by setting a preferred size on the JTextArea (a size of 0,0 seems to do the trick without changing the initial layout), but what the hell?
Monday, July 21, 2008
Swing and a miss
/**
* Sets the the vertical alignment.
*
* @param alignmentX the new vertical alignment
* @see #getAlignmentX
* @beaninfo
* description: The preferred horizontal alignment of the component.
*/
public void setAlignmentX(float alignmentX) {
As you can see, the method description and param seem to conflict directly with the beaninfo description. I was sure the first two are a typo, copied from the alignmentY equivalent, but let's have a look at setAlignmentY:
/**
* Sets the the horizontal alignment.
*
* @param alignmentY the new horizontal alignment
* @see #getAlignmentY
* @beaninfo
* description: The preferred vertical alignment of the component.
*/
public void setAlignmentY(float alignmentY) {
???
Also, using it is confusing and the docs don't seem very helpful. I created a JPanel using a vertical BoxLayout, so that as you .add(component)s they stack up beneath each other.
To the empty box panel I added a JLabel with the text "Log" and beneath that, a JTextArea which would hold the log output.
However, I noticed on running the program that the label was not left-aligned - instead, it was indented by about 40 pixels beyond the log textarea beneath. Worse still, when text appeared inside the JTextArea, the label above would jump horizontally right, bizarrely. So the most logical thing to do seemed to be to call label.setAlignmentX(Component.LEFT_ALIGNMENT) to keep the label aligned to the left side of its containing box.
Seemed to be the logical thing to do. But no, this caused no obvious change. Various combinations of this did nothing, until I made the same call on the textarea underneath.
So if you have a vertical box containing a label with a textarea underneath it and you want the LABEL to be left-aligned, you have to tell the TEXTAREA to left-align itself.
...WHAT?
Wednesday, July 09, 2008
The great antivirus scandal of 2008
But the fact is, you can become automatically infected by a virus without running the infected program/trojan yourself; the virus scanner scans it automatically, but the file is designed to exploit a vulnerability in your virus scanner and you become infected.
That's a lot more dangerous than having no AV software and just being careful which programs you run...
Symantec is among the worst here, with about 32 vulnerabilities listed compared to 6 or 7 in FProt, AVG and BitDefender.
Personally, I think it serves AV vendors right for coding their products in languages as dangerous as C and C++, which are so vulnerable to buffer overflow mistakes. And nobody can code without mistakes. And the frequency of mistakes increases with code size, of course. They should have written their scanners/plugins in a better programming language (e.g. Lisp).