For Joe Meehans module in Physics, some past papers:
Posted on: October 3, 2011 at 10:01 pm.
Filed in: College
For Joe Meehans module in Physics, some past papers:
Posted on: April 23, 2011 at 1:34 pm.
Filed in: iOS, Mac, Software, Technology
Spent a couple of hours today trying to jailbreak my iPod. After numerous attempts, I was on the point of giving up when I found this forum post with a solution: Run greenpois0n from the command line, rather than from the GUI.
While the forum post refers to RC5_2, I can confirm that it works with RC6 also. Here’s my method.
And that’s it – you’re good to go!
There are currently 3 comments on this post. Read comments.
Posted on: April 18, 2011 at 10:54 am.
I’ve been working on a website that includes a download button. When clicked the button would prompt to open or save the file. The prompt appeared on cue and the file downloaded, but for some reason the file was empty.
Checking the php_error.log, showed that this error was being generated:
PHP Warning: filesize() [function.filesize]: stat failed for http://localhost:8888/ringstone/wp-content/uploads/docs/brochure.pdf in /Applications/MAMP/htdocs/ringstone/wp-content/themes/ringstone/frontpage.php on line 26
Normally if the filesize function fails it’s because the directory where the file is stored is not writeable or the file is larger than 2GB.
In this case, the directory was writeable and the file was a lot less than 2GB in size. So I was stumped.
Going over my code, the only thing that I could see that might be causing the problem was the link to the file.
I was using the following code to get the WordPress uploads directory:
$uploads = wp_upload_dir();
$url = $uploads['baseurl'];
$filename = $url . ‘/docs/brochure.pdf’;
This generated the url for the document as: http://localhost:8888/ringstone/wp-content/uploads/docs/brochure.pdf
According to the PHP manual for filesize, as of PHP 5.0.0 the filesize function supports using some URL wrappers, including HTTP. The version of MAMP that I’m using includes PHP 5.3.2, so this shouldn’t have been a problem. It turns out that I was wrong.
I updated my code to:
$uploads = wp_upload_dir();
$path = $uploads['basedir'];
$filename = $path . ‘/docs/brochure.pdf’;
And it worked.
The lesson is that if you’re seeing filestat error in your PHP error log, then go through the following checklist:
There are currently 2 comments on this post. Read comments.
Posted on: April 18, 2011 at 1:21 am.
Over the last couple of years, I’ve developed an interest in astronomy. I’m a dilettante – I read a couple of astronomy blogs and I’ve downloaded a couple of astronomy podcasts/ lecture courses. So I’m far from being an expert.
One of the things that drove my interest in the subject was a wish to find out more about my, and humankind’s, place in the Universe. I knew some basic facts, such as the Earth is about 93 million miles from the Sun, but I wanted to know how scientists could know that. It’s not like they could directly measure it. And so I began my journey.
The deeper I looked, the more I became aware that the Universe is big. And it’s big on a scale that I just couldn’t comprehend. The numbers involved are so huge, that they are basically meaningless. And the further I looked, the bigger the Universe became.
In the middle of this vastness is our home, the pale blue dot so eloquently described by the master of scientific discourse, Carl Sagan:
From this distant vantage point, the Earth might not seem of particular interest. But for us, it’s different. Look again at that dot. That’s here, that’s home, that’s us. On it everyone you love, everyone you know, everyone you ever heard of, every human being who ever was, lived out their lives. The aggregate of our joy and suffering, thousands of confident religions, ideologies, and economic doctrines, every hunter and forager, every hero and coward, every creator and destroyer of civilization, every king and peasant, every young couple in love, every mother and father, hopeful child, inventor and explorer, every teacher of morals, every corrupt politician, every “superstar,” every “supreme leader,” every saint and sinner in the history of our species lived there – on a mote of dust suspended in a sunbeam.
The Earth is a very small stage in a vast cosmic arena. Think of the rivers of blood spilled by all those generals and emperors so that, in glory and triumph, they could become the momentary masters of a fraction of a dot. Think of the endless cruelties visited by the inhabitants of one corner of this pixel on the scarcely distinguishable inhabitants of some other corner, how frequent their misunderstandings, how eager they are to kill one another, how fervent their hatreds.
Our posturings, our imagined self-importance, the delusion that we have some privileged position in the Universe, are challenged by this point of pale light. Our planet is a lonely speck in the great enveloping cosmic dark. In our obscurity, in all this vastness, there is no hint that help will come from elsewhere to save us from ourselves.
The Earth is the only world known so far to harbor life. There is nowhere else, at least in the near future, to which our species could migrate. Visit, yes. Settle, not yet. Like it or not, for the moment the Earth is where we make our stand.
It has been said that astronomy is a humbling and character-building experience. There is perhaps no better demonstration of the folly of human conceits than this distant image of our tiny world. To me, it underscores our responsibility to deal more kindly with one another, and to preserve and cherish the pale blue dot, the only home we’ve ever known.
And while I think that is one of the most endearing and touching descriptions of Earth’s place in the vastness of the Universe, it is a little sad to think that we are so alone, that our little planet is so insignificant.
We look out to the stars and dream of what may be there and we look back and see ourselves wrapped in the darkness of space. In these circumstances it’s difficult to remain upbeat.
But there can be hope, and there can be joy.
Because as we orbit around our average star, we realise that we are here. That come what may, we have a place in the Universe and that we can look at the beauty of the night sky and wonder and dream.
The Universe may be vast beyond comprehension, but in all of that vastness there is just one “me”. And I can look up and be amazed that I have a place in the Universe and that right now, my place is here, on a pale blue dot.
httpv://www.youtube.com/watch?v=Rk6_hdRtJOE&feature=player_embedded
There are currently 0 comments on this post. Read comments.
Posted on: April 1, 2011 at 11:34 am.
I love April Fools Day, here’s the ones I’ve seen so far:
Any more to add?
There are currently 1 comment on this post. Read comments.
Posted on: March 5, 2011 at 2:39 pm.
Filed in: Linux, Mac OS X, Software, Technology
I recently needed to boot a laptop from Linux, but didn’t have any of my Linux boot disks with me. Luckily I had my USB flash drive, so I decided to install a mini-version of Linux. A quick Google searched led me to Recovery is Possible, or RIPLinuX.
Here’s how to install the .iso onto the flash drive:
Open Terminal under Applications → Utilities.
We’ll be using the diskutil command to write the .iso contents to the flash drive. So the first thing to do is determine the block device associated with our flash drive.
Before inserting the drive type
diskutil list
and hit enter. Insert your drive and run the diskutil list command again.
You should get something like this:
As you can see, the flash drive is connected via /disk/dev1, though this may be different on your system. Before you can start writing the data to the flash drive, you need to unmount the drive.
diskutil unmountDisk /dev/disk1
Now, you’re ready to start writing the data to the drive.
sudo dd if=/path/to/linux.iso of=/dev/disk1 bs=1m
Once the data has been written to the drive, all that remains is to eject it.
diskutil eject /dev/disk1
And you’re done! Remember that in order to boot from the USB drive, the computer that you’re using must support booting from USB devices and that you need to change the boot order in the BIOS.
There are currently 8 comments on this post. Read comments.
Posted on: March 4, 2011 at 12:20 pm.
Because of the re-design, there’s a lot of broken links – mainly because the blog used to live under the /whatithink/ folder on the server and now resides in the root folder. So all those Google links now point to a part of the site that no longer exists.
So anyone coming here from Google is going to get a 404 error. Not good.
While I get my head around using .htaccess to automatically rewrite the broken URLs, I’ve created a 404 page that will, (hopefully), correct the URL.
Here’s the PHP:
$requested = $_SERVER['REQUEST_URI'];
$parts = explode('/', $requested);
foreach ($parts as $part) {
switch($part) {
case ('whatithink'):
break;
case (''):
break;
default:
$out .= '/' . $part;
}
}
$out = 'http://' . $_SERVER['HTTP_HOST'] . $out;
Because all my broken URLs have an extra “/whatithink/” section, I can just break the requested URL into parts, and rebuild it without that section.
There are currently 0 comments on this post. Read comments.
Posted on: March 3, 2011 at 11:13 pm.
Filed in: Blog
I’ve just completely redesigned the site, so there’s quite a few things broken. (Mainly because the WordPress importer didn’t do a great job.) Comments are closed on all the old posts. If I get the time I might go back and fix ‘em and re-open the comments.
Any questions or feedback, just leave a comment!
There are currently 0 comments on this post. Read comments.
Posted on: February 27, 2011 at 6:31 pm.
Filed in: Apple, Linux, Networking, Software, Technology
If Time Machine is unable to connect to your backup disk with an error message containing “OSStatus Error 2″, then check the permissions on your NAS.
SSH as root into your MBWE and check the permissions for /var and /var/lib.
Use chmod 755 on /var and /var/lib to apply the correct permissions.
Use the Time Machine System Preferences to set your backup disk to your MBWE.
There are currently 5 comments on this post. Read comments.
Posted on: September 14, 2010 at 2:22 am.
Filed in: Politics
Dear Minister,
I note that you have agreed to be involved with the launch of John J May’s Book – “The Origin of Specious Nonsense”. A book that espouses the notion that The Theory of Evolution is wrong.
As our Minister with responsibility for Science and Technology, what were you thinking when you agreed to this?
The Theory of Evolution has been shown in countless scientific experiments to be the correct explanation for the diversity of life on this planet, yet you have decided to make your Department and your Office a laughing stock throughout the world.
As the Minister for Science, Technology, Innovation and Natural Resources, you represent our country on a global stage. Every day we hear that Ireland is positioning itself to be part of the information economy. Every day we hear that our colleges and universities are among the best in the world. Every day the government spends a lot of time, effort and money trying to secure jobs with from companies who specialise in providing science based products. And you have decided to do your best to undo all that hard work by being associated with an author who believes the notion that one of the most fundamental Theories of our time is wrong. How do you think the rest of the world will see Ireland now?
Many people have worked hard to bring this country into the 21st Century. Your decision seeks to undermine the progress this country has made in the last 40 years.
It is simply not acceptable that a person in your position should attend an event of this nature. It is in the best interests of this country that you publicly withdraw from this event.
Yours sincerely,
Paul McCarthy,
Limerick.
There are currently 0 comments on this post. Read comments.
There are currently 0 comments on this post. Read comments.