New keyboard is wicked! It's super thin and more comfortable than my current Apple wireless keyboard is to work on. I can't wait for the wireless version of this
Speaking of keyboards I think it's time to invest in a couple of Kinesis keyboards.
New keyboard is wicked! It's super thin and more comfortable than my current Apple wireless keyboard is to work on. I can't wait for the wireless version of this
Speaking of keyboards I think it's time to invest in a couple of Kinesis keyboards.
If you want a web page or a iPhone ready website to hide the "url-bar", just add the following to your onload event in your body html tag.setTimeout(scrollTo, 0, 0, 1)Here's the begin "body" tag as an example.
<body onload="setTimeout(scrollTo, 0, 0, 1)" />
Last Friday night, when coming home from the bar I noticed that I couldn't touch the "home row" on my iPhone screen. I instantly thought, perhaps a reboot is in order. Did the reboot, no love! I was livid! I couldn't believe it. I know the rule and I broke it. The rule is: "Never buy anything Apple that is 1st generation." I'm going to modify this rule to "Never buy anything Apple that is 1st generation, ever!" I couldn't really use my phone to make any calls, it was essential to get this fixed. Of course being a loyal Apple customer I know exactly what to do. Get on the Apple Store website and schedule an appointment. The next day, I was in the Apple Store. I assumed I would be getting a brand new iPhone, and be on my way... wrong! I got a "loaner" iPhone and a $30 fee. I was assured that my repaired iPhone would be shipped back to me within 7 business days. What if this thing breaks again, what then? Tons of questions flooded my head. So I took pictures of the "loaner" iPhone, and it's AppleCare packaging.
I found an awesome iPhone bug today.
I was able to reproduce this bug on other iPhone's by assuming the following....
To reproduce the bug follow the steps below...
I found this video on Mashable.
This is an amazing technology! Very hott!
I've been doing some web development, and decided to use my MacBook Pro. I've never really used OSX for any kind of development. I usually use a Linux box when performing web development. Because I'm using Apache with virtual hosts. I was in a situation where I needed to remove my development entry for the virtual hosts from /etc/hosts. Removing the entry went without a hitch, but it was when I added the entry back into the hosts file that I encountered the problem. A google search yielded a few solutions none of which worked for me, but the command below worked perfectly!
sudo lookupd -flushcache
One accurate measurement is worth more than a thousand expert opinions.
Admiral Grace Hopper
I decided to automate some file transferring I normally do the old fashioned way via FTP. I decided this would be a great job for python. I came up with the following code....
from ftplib import FTP #You probably want to initialize the variables below.... FTP_ADDRESS = "..." FTP_USERNAME = "..." FTP_PASSWORD = "..." REMOTE_DIRECTORY = "... " REMOTE_FILE = "..." VERSION = "..." ftp = FTP(FTP_ADDRESS) ftp.login(FTP_USERNAME, FTP_PASSWORD) ftp.cwd(REMOTE_DIRECTORY) renamed_file = "%s.%s" % (REMOTE_FILE, VERSION) ftp.rename(REMOTE_FILE, renamed_file) upload_file = open(REMOTE_FILE, "r") command = "STOR %s" % (REMOTE_FILE) ftp.storlines(command, upload_file) upload_file.close() ftp.quit()
So I had a situation where I found myself trying to load data from a file into a byte array so I can base64 encode the binary data to be passed along via something "web" based. I've never tried to do this before, because well almost everything I've ever encountered pertaining to data within files has been string based, so I typically parse on newlines. Below is my solution....
//Probably want to initialize the path variable prior to hitting this code block,
// and perform the proper exception handling.
using(FileStream stream = new FileStream(path, FileMode.Open, FileAccess.Read))
using (BinaryReader reader = new BinaryReader(stream))
{
int number_of_bytes = (int) stream.Length;
byte[] bytes = reader.ReadBytes(number_of_bytes);
string encoded_data = Convert.ToBase64String(bytes);
//Do something with the encoded_data.
}
Now of course the premise of my method above was to be able to load whatever is in the file into a byte array, my file had only a small amount of data in it (32 bytes to be exact), if you have a file on the order of kilobytes or greater I wouldn't advise this method, and would choose to process the data contained within the file in some kind of "chunked" fashion.