yakman
Marcin's Stuff
7 posts
Don't wanna be here? Send us removal request.
yakman · 13 years ago
Link
Quick and easy reminder app for iOS - sets reminders in your calendar so they sync wherever your calendars do.
0 notes
yakman · 13 years ago
Link
Recently Facebook got rid of "Application About Pages", which contained a link that let you add Applications that were designed to be installed as Page Tabs to your Page(s).  Facebook now suggests adding a link to your app to let people add it to their page, which isn't practical for apps that are designed for a specific purpose / page in mind.
So I created this quick and dirty bookmarklet that lets you do it from the App Settings page, it scrapes the right values to build the URL to the Add Application to Page dialog and opens it in a new tab.
Works for me in Firefox 10(!), YMMV.
0 notes
yakman · 13 years ago
Text
Using CIDetector with video from an AVCaptureSession
I was checking out the CIDetector API in iOS5, specifically using it with an AVCaptureSession to detect faces in video.  I'd never played with the AV Foundation framework before, but it was pretty straight forward to hook up the front camera on the phone as an AVCaptureDevice and get the frames through an AVCaptureVideoDataOutput.
However I ran into issues when trying to get CIDetector to find faces in the CIImage from the video.  Eventually I came across the Apple SquareCam sample which contained the solution!
The reference for CIDetector only mentions the - featuresInImage:(CIImage *) selector, however there is also an - featuresInImage:(CIImage *) options:(NSDicitonary *) selector which can be used to provide a CIDetectorImageOrientation key.  This is documented in the CIDetector.h (and appears to only be available on iOS and not Mac).  The iPhone camera actually captures video "natively" in landscape mode, so if you're holding the camera in portrait you need to tell the detector this (I'm sure if I was more familiar with the AV Foundation framework this would have been obvious).
The SquareCam sample has a good chunk of code for converting a UIDeviceOrientation to the CIDetectorImageOrientation required by CIDetector (essentially an EXIF orientation) - this includes an enum for the various EXIF orientations and working correctly for the front and rear facing cameras, but as a basic hack for working in portrait mode with the front facing camera all you need to do is:
imageOptions = [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:6] forKey:CIDetectorImageOrientation]; NSArray *features = [detector featuresInImage:image options:imageOptions];
(this is the 0 row on the right and 0 col on top orientation - ie. image needs to be rotated 90º CCW to get it to the right orientation)
Anyway, probably something obvious for more experienced folk, but having never played with the AV stuff I didn't realise what the issue could be, so was happy to find the solution, so I'll leave this here in case anyone else is running into the same issue.
0 notes
yakman · 13 years ago
Text
Hi!
Well, I managed to post things for 2 days before I forgot all about Tumblr for a month. That's not totally true, the intention of this site is just to write about things I want to write about that won't nicely fit in 140 characters on Twitter, and there just hasn't been anything worth writing about.  There still isn't really, I just felt the need to write something.
Things that have been tickling my fancy (ruh) lately:
Backbone.js - really lightweight framework that makes it easy to add a bit of structure to your Javascript "applications" without getting in the way too much, and makes it trivial to integrate a REST backend.
CSS3 Transforms - I'd read about these and seen demos for ages but never implemented one, so so easy - especially with..
Compass - makes working with CSS a lot easier (especially dealing with cross-browser features like transforms). The spiriting support is a huge time saver, and I even found a use case for loops!
.. as you can probably tell I've been doing a lot of HTML/JS/CSS apps lately at work :)
0 notes
yakman · 13 years ago
Quote
Gives you a reference to the DOM object, so you can assign event handlers or just mess around. Note: Don’t mess with it.
Raphäel 2.0 Documentation
19 notes · View notes
yakman · 13 years ago
Text
Solving a "login loop" in Mac OS X Lion due to corrupt LaunchServices cache
Because it might help someone else Googling and it took me forever to find. I could no longer login to my account after a few system crashes due to bad RAM during the login process.
If you are suffering from a so-called "login loop" in Mac OS X 10.7 Lion - ie. you login to your account and then suddenly you're back at the login prompt again - your LaunchServices cache might be corrupt.
If you check your Console from another user account and the Stack Trace for a bunch of login related processes (loginwindow etc) shows a crash in:
0   com.apple.LaunchServices       0x00007fff8fa7dd24 CSStoreGetUnit + 40
Then this may be the case.  Older articles around the internets refer to deleting the LaunchServices cache in /Library/Caches or ~/Library/Caches however on my Lion machine I couldn't find this file.
Where you'll actually find it is in:
/private/var/folders/XX/YY/C/com.apple.LaunchServices-034ZZZ.csstore
Where XX and YY are random names - your user account will only have access to your own, you'll need to look into each of the folders under "folders" and find which one is yours (ls -al will show ownership).
The ZZZ is your userid (a number - the first user on the machine is 501 and so on).
Delete this file and you should be able to login! 
Note that this cache stores all of your customised file associations and things like default browser - so you'll lose those settings. It might even lose your "Login Items" you've configured, but I can't be sure that wasn't one of the other files I'd previously deleted that stored that :)
Took me about 3 hours of mucking around and searching for clues on the Internet to find that bugger!
22 notes · View notes
yakman · 13 years ago
Link
Neat tips and tricks about Javascript.
28 notes · View notes