Pale Shelter
May 07
Others Music, Song, Tears for Fears No Comments
Apr 13
Programming, Projects, Tech Android, Apps, Galaxy, Java, Mobile, Programming, Samsung, Tablet No Comments
Mar 24
Me, Others Burn down, Cops, Ecstasy, Girls, Movie, Night Club, Party, Project X No Comments
Today I went to the movies and watched Project X. Man, that was litteraly like an immersive movie to me. I won’t be giving too much details about it as some of you may not have watched it yet.
Not sure if it was because it’s been so long since I last went to a night club, or if it was because of the girls, or both. Excepting for the ecstasy, the cops and the fact that the entire neighbohood got burned down, I really pretend to go to a party like that one. I don’t really know why, but that movie was like… a dream!
Mar 21
Programming, Projects Fall, Free, FVGravityView, Gravity, iOS, iPhone, iPod touch, Open Source, UIView No Comments
Hey folks, I’m proud to announce my new open source project for iPhone. It’s called FVGravityView. It’s basically an UIView that has the ability to fall. Yes, fall. It uses the accelerometer to detect the device position and the view will fall depending on it. It’s basically an UIView that recognizes gravity.
A few thing:
-The default velocity is 20, but you may change this value by changing the velocity property.
-FVGravityView supports dragging. To enable it, set the property isDragable to YES.
-Say you want to invert the gravity. Just set the isInverse to YES.
-It’s basically an UIView, so you may add subviews to it. It also has every drawing capabilities that an ordinary UIView has.
To download the sample project, click here.
PS: I didn’t try it on an iPad, but it should work with no problems at all.
Mar 15
Projects Blog, Cocoa, Dead, iOS, iPad, iPhone, Mac OS X, Programming, Sensitive Code No Comments
Hey folks, unfortunately, my blog Sensitive Code is dead. I had no time to update it and ended up not renewing the domain registration. It had a great page rank. For example, if you type UIFileSharing on Google, a post from Sensitive Code it is the first result(not sure for how long). I moved every post from there to this blog, so everything is still available. I hope to write about programming on this blog in the future.
Mar 15
Programming Apple, Cocoa, Cocoa touch, iOS, iPad, iPhone, Mac OS X, Macintosh, Multi Threading, NSOperation, Threading No Comments
Threading is known for being very hard in any language. A foolish mistake can make your application crash. Programmers spend a lot of time to make sure everything works fine. On Mac OS X 10.5, Apple finally introduced a very easy way to deal with threading. NSOperation is The Apple Way® to deal with threading. All you have to do is to subclass the NSOperation, create and initialize a NSOperationQueue, create and initialize the NSOperation and add it to the NSOperationQueue. For this tutorial, I will teach you how to write a simple app that will load a RSS feed and display it on a NSTableView.
To get started, go to Xcode and create a new project. I will call mine RSS Reader, but feel free to call it whatever you want. Let’s start by editing our AppDelegate.h. Create 3 IBOutlets:
Mar 15
Programming Audio, Information, Metadata, Music, NSURLConnection, Radio, SHOUTcast, Songs, Streaming No Comments
When I was developing FireRocker, one of my biggest challenges was to figure out an easy way to get the audio metadata. The classic way is to read the value of a HTTP header and see how many bytes I have to wait for until the metadata is sent. Seems like a bit confusing, hum? Luckily, there’s THE easy way! SHOUTcast streams have an HTML page which you can download and parse to get the audio metadata. Say I have the following URL:
http://94.186.155.82:8044
Just add a /7.html to the end of it.
http://94.186.155.82:8044/7.html
If you downloaded this HTML file and opened it with a plain text editor, you’d see something like this:
<HTML><meta http-equiv="Pragma" content="no-cache"> </head><body>153,1,257,1500,153,32,Adrian - Lacrimi de iubire bY www.FmRadioManele.ro</body></html>
Cool, isn’t it? Now let’s parse it. You can do it in any language, but I will teach you how to write a nice app in Objective-C. Create a new project and name it SHOUTcast metadata(or any name you want). Open your AppDelegate.h and add the following IBOutlets:
Mar 15
Programming Audio Streaming, Cocoa, Mac, QTKit, QuickTime, Radio No Comments
Audio streaming can be a painful task. Download the audio data and feed an AudioQueueBuffer may be a risky operation and may involve many lines of code. So finally, on Mac OS X 10.6 Apple has introduced QuickTime X. We must remember that QuickTime doesn’t necessarily mean QuickTime Player. In this case, I’m talking about the QTKit framework. QTKit(AKA QuickTime Kit) is a high level framework for dealing with media. The QTKit framework was also updated and now includes this and other new features.
Mar 15
Programming Cocoa, Cool, Effects, Login, Mac, NSWindow, Shake, Window No Comments
On the Mac OS X login window, when you don’t type the right password, the window shakes. It’s a very cool and classic way to tell people the password is wrong. Even WordPress copied it. You can reproduce the same behavior on an ordinary NSWindow with just 7 lines of code! Here’s how it works:
//Gets the window rect
NSRect rect = [window frame];
//Shake offset amount
int amount = -10;
//Shake the window 5 times
for(int i = 0; i < 5; i++){
//Changes the frame origin
[window setFrameOrigin:NSMakePoint((rect.origin.x + amount), rect.origin.y)];
//Pause the thread for 0.04 seconds
usleep((useconds_t)40000);
//Inverts the offset amount
amount *= -1;
}
//Restore the window’s original position
[window setFrame:rect display:NO];
Download the sample app here.
Mar 15
Programming Chat, Cocoa, IRC, Open Source No Comments
Have you ever needed/wanted to implement an IRC chat on your Cocoa application? It might be easier than you think! There’s a Cocoa “bridge” for the libircclient library. The lib was written by Georgy Yunaev. Get the files on this link. These few lines of code will make it work:
IRCClientSession *session = [[IRCClientSession alloc] init];
MyIRCClientSessionDelegate *controller = [[MyIRCClientSessionDelegate alloc] init];[session setDelegate:controller];
[controller setSession:session];[session setServer:@"irc.dal.net"];
[session setPort:@"6667"];
[session setNickname:@"test"];
[session setUsername:@"test"];
[session setRealname:@"test"];
[session connect];[session run]; //starts the thread