Saw a tweet today with the first list of known WWDC parties that I've seen this year.
Tuesday, 19 May 2009
Device Detection
Posted on 06:51 by Unknown
Update: The author of the device detection code has been identified! Max Horváth dropped me a note letting me know that this lovely little bit of code was written by him. He's got a great blog that often covers iPhone SDK material also.Somebody asked me over Twitter for how to detect what device the code was running on. Since a tree fell in my backyard the other day, right on the telephone lines and taking out my internet service in the process, I was working on an iPhone, and trying to answer a question quickly.
In short, I gave a wrong answer. My apologies to anybody who relied on it.
Here's some code, written by Max Horváth, that detects the device model correctly.
#import <sys/utsname.h>
enum {
MODEL_IPHONE_SIMULATOR,
MODEL_IPOD_TOUCH,
MODEL_IPHONE,
MODEL_IPHONE_3G
};
@interface DeviceDetection : NSObject
+ (uint) detectDevice;
+ (NSString *) returnDeviceName:(BOOL)ignoreSimulator;
@end
@implementation DeviceDetection
+ (uint) detectDevice {
NSString *model= [[UIDevice currentDevice] model];
// Some iPod Touch return "iPod Touch", others just "iPod"
NSString *iPodTouch = @"iPod Touch";
NSString *iPodTouchLowerCase = @"iPod touch";
NSString *iPodTouchShort = @"iPod";
NSString *iPhoneSimulator = @"iPhone Simulator";
uint detected;
if ([model compare:iPhoneSimulator] == NSOrderedSame) {
// iPhone simulator
detected = MODEL_IPHONE_SIMULATOR;
} else if ([model compare:iPodTouch] == NSOrderedSame) {
// iPod Touch
detected = MODEL_IPOD_TOUCH;
} else if ([model compare:iPodTouchLowerCase] == NSOrderedSame) {
// iPod Touch
detected = MODEL_IPOD_TOUCH;
} else if ([model compare:iPodTouchShort] == NSOrderedSame) {
// iPod Touch
detected = MODEL_IPOD_TOUCH;
} else {
// Could be an iPhone V1 or iPhone 3G (model should be "iPhone")
struct utsname u;
// u.machine could be "i386" for the simulator, "iPod1,1" on iPod Touch, "iPhone1,1" on iPhone V1 & "iPhone1,2" on iPhone3G
uname(&u);
if (!strcmp(u.machine, "iPhone1,1")) {
detected = MODEL_IPHONE;
} else {
detected = MODEL_IPHONE_3G;
}
}
return detected;
}
+ (NSString *) returnDeviceName:(BOOL)ignoreSimulator {
NSString *returnValue = @"Unknown";
switch ([DeviceDetection detectDevice]) {
case MODEL_IPHONE_SIMULATOR:
if (ignoreSimulator) {
returnValue = @"iPhone 3G";
} else {
returnValue = @"iPhone Simulator";
}
break;
case MODEL_IPOD_TOUCH:
returnValue = @"iPod Touch";
break;
case MODEL_IPHONE:
returnValue = @"iPhone";
break;
case MODEL_IPHONE_3G:
returnValue = @"iPhone 3G";
break;
default:
break;
}
return returnValue;
}
@end
Monday, 18 May 2009
Yahoo Limits Mobile Development to One Platform
Posted on 14:19 by Unknown
Yahoo! has announced that they will no longer support multiple mobile platforms. They are going to focus on just one: the iPhone. No more Blackberry, Windows Mobile, Symbian, or Android apps from Yahoo! Mobile. Just iPhone.
Wow.
Wow.
iPhone Intelligence Party
Posted on 12:00 by Unknown
Raven Zachary has announced this year's iPhone Intelligence WWDC party at the Harlot. Monday, June 8, 7-11 PM. RSVP required. I attended last year's, and it was hopping. The Harlot's just not very big, though, so if you plan to go, RSVP, and get there early, or you'll probably have to wait outside for someone to leave.
Friday, 15 May 2009
Just for the Record
Posted on 18:59 by Unknown
Mobile Orchard asked for, and was given permission to run my circle gesture posting. I've also given them pretty much a blanket permission to re-run any posting from my blog at any time. The Mobile Orchard guys are good citizens and definitely members of the iPhone dev community, so please don't go accusing them of anything on my behalf, please :)
Also, while Planet iPhone SDK did not approach me, they specifically credit both the source blog and the author when they re-post material. While it would have been nice to have been told that they would be re-running my material, I'm really not at all jazzed by it. They've done proper attribution. If you read one of my articles on their site, you know who wrote it and what blog it originally came from.
Like I said, I'm pretty easy-going about this stuff. I'm not looking to crucify people that use my material, II just want to be credited for my work. Nuff said.
Also, while Planet iPhone SDK did not approach me, they specifically credit both the source blog and the author when they re-post material. While it would have been nice to have been told that they would be re-running my material, I'm really not at all jazzed by it. They've done proper attribution. If you read one of my articles on their site, you know who wrote it and what blog it originally came from.
Like I said, I'm pretty easy-going about this stuff. I'm not looking to crucify people that use my material, II just want to be credited for my work. Nuff said.
Feed Changes
Posted on 11:40 by Unknown
I have changed the RSS and ATOM feeds to only display part of the posting. I've now found three different websites that have been using my feeds to display my content in its entirety without attribution. I doubt I can stop that, but I can make it a more labor-intensive process by not publishing entire blog postings in my RSS feed anymore.
I apologize for any readers who will be inconvenienced by this. You have been inconvenienced because of others' dishonesty.
Change of Plans: After a few readers who read my blog using Google Reader requested that I not truncate the posts in the feed, I have decided to restore full feeds, however comments will not be included in the feed, and feed postings will have a copyright notice appended to the end of them.
I apologize for any readers who will be inconvenienced by this. You have been inconvenienced because of others' dishonesty.
Change of Plans: After a few readers who read my blog using Google Reader requested that I not truncate the posts in the feed, I have decided to restore full feeds, however comments will not be included in the feed, and feed postings will have a copyright notice appended to the end of them.
Dick Move - iwyre.net
Posted on 11:12 by Unknown
I'm pretty easy going about my writing and my code. I've granted people permission to republish blog posts in whole on several occasions. In fact, I can't recall ever having said no to somebody who's asked to republish a blog posting. On top of that, all the code I publish (unless it wasn't written by me) is published under a license that allows unlimited re-use without attribution.
Of course, I can't be quite so cavalier with Beginning iPhone Development because I'm neither the rights holder nor the sole author. But when it comes to stuff I publish on my blog, I'm generally happy to have it re-used and shared. When people ask to republish my writing, all I want in return is an attribution and a link back to my blog. For code, I don't even ask for that.
So, I must admit that it made me a little cranky today when I was notified about a site that's been just blatantly taking every single one of my blog postings and republishing them in their entirety without attribution. I believe it's probably being done automatically via a script because they don't even bother to change the internal links in the article.
But the byline on my articles reads "by admin". That's the part that really annoys me. They've listed an author for the articles I've written, and the author they've listed is not me.
This iwyre "portal" is no such thing. A portal aggregates material and shows you just enough to let you know whether you want to follow the link to the source material. what iwyre is doing is simple theft; it's stealing content in its entirety and not even bothering to give attribution to the author. And they're not stealing just from me. I noticed articles from KRAPPS and from other tutorial sites there, also done without attribution.
I have attempted to contact the site to get this resolved. I like doing things in a civil manner and try to give people the benefit of the doubt. Not everybody understands what is okay and what's not when it comes to content available the Internet. It could have been a misunderstanding. It could have been a mistake.
But, the administrative contact for that site is a bogus e-mail; in fact, several e-mails I've found for the people involved in this site are bogus, which leads me to believe this is an intentional scam, done with full knowledge that it's wrong and that it's a completely dick move. It's done with full knowledge that it's plagiarism, and they've taken steps to insulate themselves from takedown notices.
I suppose I could pursue this further. I have enough information about the guy who runs the site that I could get through to him if I really wanted to, but now that I'm pretty sure it's not an honest mistake, I expect any contact would be adversarial in nature. I suppose I could also report the site to Google and Amazon; I suspect that this blatant plagiarism violates the terms of service of both of their ad-revenue services, but I just don't know that it's worth the effort.
I know how much AdSense revenue I get from running my content on my blog, and it's not very much. After almost a year, the ads have generated almost as much as a junior iPhone developer would make in an hour. So, I should probably just let it lay and forget about it. I should just accept this as a natural part of internet life.
But it irks me.
Of course, I can't be quite so cavalier with Beginning iPhone Development because I'm neither the rights holder nor the sole author. But when it comes to stuff I publish on my blog, I'm generally happy to have it re-used and shared. When people ask to republish my writing, all I want in return is an attribution and a link back to my blog. For code, I don't even ask for that.
So, I must admit that it made me a little cranky today when I was notified about a site that's been just blatantly taking every single one of my blog postings and republishing them in their entirety without attribution. I believe it's probably being done automatically via a script because they don't even bother to change the internal links in the article.
But the byline on my articles reads "by admin". That's the part that really annoys me. They've listed an author for the articles I've written, and the author they've listed is not me.
This iwyre "portal" is no such thing. A portal aggregates material and shows you just enough to let you know whether you want to follow the link to the source material. what iwyre is doing is simple theft; it's stealing content in its entirety and not even bothering to give attribution to the author. And they're not stealing just from me. I noticed articles from KRAPPS and from other tutorial sites there, also done without attribution.
I have attempted to contact the site to get this resolved. I like doing things in a civil manner and try to give people the benefit of the doubt. Not everybody understands what is okay and what's not when it comes to content available the Internet. It could have been a misunderstanding. It could have been a mistake.
But, the administrative contact for that site is a bogus e-mail; in fact, several e-mails I've found for the people involved in this site are bogus, which leads me to believe this is an intentional scam, done with full knowledge that it's wrong and that it's a completely dick move. It's done with full knowledge that it's plagiarism, and they've taken steps to insulate themselves from takedown notices.
I suppose I could pursue this further. I have enough information about the guy who runs the site that I could get through to him if I really wanted to, but now that I'm pretty sure it's not an honest mistake, I expect any contact would be adversarial in nature. I suppose I could also report the site to Google and Amazon; I suspect that this blatant plagiarism violates the terms of service of both of their ad-revenue services, but I just don't know that it's worth the effort.
I know how much AdSense revenue I get from running my content on my blog, and it's not very much. After almost a year, the ads have generated almost as much as a junior iPhone developer would make in an hour. So, I should probably just let it lay and forget about it. I should just accept this as a natural part of internet life.
But it irks me.
Subscribe to:
Comments (Atom)