<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description></description><title>Socketwiz Technical Blog</title><generator>Tumblr (3.0; @socketwiz)</generator><link>http://www.socketwiz.com/</link><item><title>I'm an official Scrum Master :)</title><description>&lt;p&gt;As of today I have finally completed all of the requirements to become a &lt;a title="Scrum Master" target="_blank" href="http://socketwiz.s3.amazonaws.com/Ricky_Nelson-ScrumAlliance_CSM_Certificate.pdf"&gt;scrum master&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;From &lt;a title="Wikipedia" target="_blank" href="http://en.wikipedia.org/wiki/Scrum_(development)"&gt;Wikipedia&lt;/a&gt;: Scrum is an iterative, incremental methodology for project management often seen in agile software development, a type of software engineering.&lt;/p&gt;
&lt;p&gt;Although Scrum was intended for management of software development projects, it can be used to run software maintenance teams, or as a general project/program management approach.&lt;/p&gt;</description><link>http://www.socketwiz.com/post/2610645123</link><guid>http://www.socketwiz.com/post/2610645123</guid><pubDate>Wed, 05 Jan 2011 12:24:15 -0500</pubDate></item><item><title>Use console.app to monitor any log file</title><description>&lt;p&gt;I just discovered something pretty cool on my mac this morning and wanted to share.  I use Symfony (&lt;a title="http://www.symfony-project.org/" href="http://www.symfony-project.org/" target="_blank"&gt;&lt;a href="http://www.symfony-project.org/" target="_blank"&gt;http://www.symfony-project.org/&lt;/a&gt;&lt;/a&gt;) to develop web apps and it has a log file that you can use during development to help you debug certain aspects.  I discovered that you can open the log file with the mac console.app:&lt;/p&gt;
&lt;p&gt;open log/backend_dev.log&lt;/p&gt;
&lt;p&gt;and it will automatically refresh.  I normally open up a second terminal and run tail on it:&lt;/p&gt;
&lt;p&gt;tail -f log/backend_dev.log&lt;/p&gt;
&lt;p&gt;but this is pretty neat as well.  Yuo can also use all of the console features such as clear display, insert marker, and filter.  I imagine this works with any type of log file.  I just happen to stumble upon it with the symfony log I was working on.  At any rate, give it a try and see how you like it.&lt;/p&gt;</description><link>http://www.socketwiz.com/post/1242296890</link><guid>http://www.socketwiz.com/post/1242296890</guid><pubDate>Mon, 04 Oct 2010 08:55:00 -0400</pubDate></item><item><title>Mac: How to extract an icon</title><description>&lt;p&gt;&lt;p style="clear: both"&gt;&lt;img src="http://socketwiz.s3.amazonaws.com/app.png" height="128" align="left" width="128" style=" display: inline; float: left; margin: 0 10px 10px 0;"/&gt;&lt;strong&gt; The need&lt;/strong&gt;: When I first learned how to write Cocoa applications I was reading a book by Aaron Hillegass titled “Cocoa Programming for Mac OS X, Third Edition”. At the end he issues a challenge to choose a medium difficulty application and create it. I wrote an RSS reader. I followed that up by a license manager. I have dozens of shareware applications that I have purchased over the years and they each have their own license to keep track of. So I decided to create a management application to keep track of them all. This application was a little more complex than the RSS reader. I decided it would be a great way to learn CoreData. Somewhere along the way I hit a road block and shelved it. Well I’ve been working with CoreData quite a bit lately and decided to dust off this old app I started since I still have the problem of tracking all of my licenses. I got to a point where I needed an icon. Whenever you create a new Cocoa application it comes with a default icon and I thought it would be perfect to use on the list that contains the apps in my license manager. See the image at the top of the post to see what I was looking for.&lt;/p&gt;&lt;p style="clear: both"&gt;&lt;strong&gt;The quest&lt;/strong&gt;: I thought this would be relatively easy to find so I fired up a Spotlight search window: command option space and entered icns (the extension of a Mac icon file) then selected “File Name” instead of “Contents”. A lot of interesting icons came up but not the one I was looking for. So I followed that up with a search on images.google.com but I just couldn’t seem to put the right words together to find the icon I was looking for. I even tried a regular google search: “mac application filetype:icns” but still nothing. So I decided rather than spend all day searching I should be able to extract the icon I want right out of the file. I am a Mac hacker after all…how hard can it be? &lt;/p&gt;&lt;p style="clear: both"&gt;&lt;strong&gt;The project&lt;/strong&gt;: It turns out, it’s not hard at all. I ran across this example &lt;a href="http://mattgemmell.com/source" target="_blank"&gt;Icon For File Type&lt;/a&gt; written in Cocoa that I thought was going to do it. It takes a file extension as input, then displays the icon for the application associated with it. So I downloaded it but I was unable to build it because the project file was to old. But it was so simple that I just rewrote the whole thing. So after I built it I ran it thinking I could just type in .app and get the icon I was after. But thinking about it now I realize that was never going to work because there is no application associated with a .app as the .app is the application. However with this little utility in hand it was not hard to extend it to extract the icon from a .app itself so that is what I did.&lt;/p&gt;&lt;p style="clear: both"&gt;With this little utility you can either specify an extension like html, pdf, pages, numbers, etc… and display the icon of the application associated with that type, or you can locate the application itself and display its icon directly. Either way once you have the icon, you can save it to a location of your choice.&lt;/p&gt;&lt;p style="clear: both"&gt;&lt;img src="http://socketwiz.s3.amazonaws.com/IconForFileType.png" height="270" align="left" width="529" style=" display: inline; float: left; margin: 0 10px 10px 0;"/&gt;&lt;br style="clear: both"/&gt;&lt;strong&gt;What I learned&lt;/strong&gt;: This exercise was not in vain by any means. I was willing to settle for a 48x48 pixel image but what I ended up with was the actual .icns file. An icns file is nice because it has the ability to store 1 or more representations of a file. So for an icon you would most likely store a 16x16, 32x32, 128x128 and a 512x512. That way in various different settings you would always have an icon that looked nice. I guess one could extend this utility a little more to be able to save off 1 or more of the representations themselves instead of the entire file. However for my purposes it was easy enough to just bring up the .icns file in Mac’s built-in preview utility then drag the representation that you want onto the desktop.&lt;/p&gt;&lt;p style="clear: both"&gt;&lt;strong&gt;Code&lt;/strong&gt;: If you you want is the utility, you can grab that here:&lt;/p&gt;&lt;p style="clear: both"&gt;&lt;a href="http://socketwiz.s3.amazonaws.com/IconForFileType.app.zip" target="_blank"&gt;Icon For File Type Utility&lt;/a&gt;&lt;/p&gt;&lt;p style="clear: both"&gt;If you would like the Cocoa project for it, you grab that here:&lt;/p&gt;&lt;p style="clear: both"&gt;&lt;a href="http://socketwiz.s3.amazonaws.com/IconForFileType.zip" target="_blank"&gt;Icon For File Type Utility Cocoa Project&lt;/a&gt;&lt;/p&gt;&lt;br class="final-break" style="clear: both"/&gt;&lt;/p&gt;</description><link>http://www.socketwiz.com/post/893951576</link><guid>http://www.socketwiz.com/post/893951576</guid><pubDate>Mon, 02 Aug 2010 11:27:46 -0400</pubDate><category>mac</category><category>cocoa</category></item><item><title>How to recover data from a memory card for free</title><description>&lt;p&gt;So a friend of mine took some pictures on her camera which contains an SD card but for some reason was unable to retrieve the pictures off of it.  I have a similar camera and a Mac she has Windows.  Many times I’ve been able to access data on removable drives on my Mac that were inaccessible on Windows but not this time.&lt;br/&gt;&lt;br/&gt;So my first hurdle was how to mount this drive under the file system.  I put the card in my camera but it does a great job of masking that there is a removable drive inside of it.  Normally I don’t care.  I just plug it in and up comes iPhoto ready to pull the images off and remove them from my camera.  So when I plugged her card in, iPhoto dutifully came up…but no pictures.  So I found a free piece of software called &lt;a title="PhotoRec" target="_blank" href="http://www.cgsecurity.org/wiki/PhotoRec"&gt;PhotoRec&lt;/a&gt; that would supposedly extract the data from the memory card if I could only see it.  So with iPhoto up and running I ran the app, but there was no drive to be seen.  For some reason I decided to look around on my Mac to see if by any chance there might be a card reader of some sort and lo and behold right under the CD drive is an SD card reader.  Who knew?  So I plugged her card into the reader and finally it was properly mounted.&lt;br/&gt;&lt;br/&gt;The website for PhotoRec says that as long as you can see the card and the proper size of the card is detected, then there is a very good chance that the data can be recovered.  Luckily this card was reporting the proper size.  Now PhotoRec is a free application and as such it doesn’t have a fancy user interface that just anybody can click around and figure out.  You have to run this utility from the command line.  &lt;br/&gt;&lt;br/&gt;The drive that is 1000GB is my hard drive, the one that is 513MB is the memory card.  So I choose the first one /dev/disk2, not the /dev/rdisk2. And I’m given a screen with more options:&lt;/p&gt;
&lt;p class="code"&gt;Disk /dev/disk2 - 513 MB / 489 MiB (RO)&lt;br/&gt;&lt;br/&gt;Please select the partition table type, press Enter when done.&lt;br/&gt;[Intel  ]  Intel/PC partition&lt;br/&gt;[EFI GPT]  EFI GPT partition map (Mac i386, some x86_64…)&lt;br/&gt;[Mac    ]  Apple partition map&lt;br/&gt;[None   ]  Non partitioned media&lt;br/&gt;[Sun    ]  Sun Solaris partition&lt;br/&gt;[XBox   ]  XBox partition&lt;br/&gt;[Return ]  Return to disk selection&lt;/p&gt;
&lt;p&gt;Intel seems like a the most reasonable out of the choices so I select that one.  I’m then prompted with more choices:&lt;/p&gt;
&lt;p class="code"&gt;Disk /dev/disk2 - 513 MB / 489 MiB (RO)&lt;br/&gt;&lt;br/&gt;     Partition                  Start        End    Size in sectors&lt;br/&gt;     No partition                   0    1002495    1002496 [Whole disk]&lt;br/&gt; 1 P FAT16 &gt;32M                   233    1002495    1002263 [NO NAME]&lt;/p&gt;
&lt;p&gt;I’m pretty sure that memory sticks for most cameras are formatted as FAT so I choose that. I’m then prompted with more choices:&lt;/p&gt;
&lt;p class="code"&gt; 1 P FAT16 &gt;32M                   233    1002495    1002263 [NO NAME]&lt;br/&gt;&lt;br/&gt;To recover lost files, PhotoRec need to know the filesystem type where the&lt;br/&gt;file were stored:&lt;br/&gt;[ ext2/ext3 ]  ext2/ext3/ext4 filesystem&lt;br/&gt;[ Other     ]  FAT/NTFS/HFS+/ReiserFS/…&lt;/p&gt;
&lt;p&gt;Again, I choose anything that says FAT, and again I prompted with more choices:&lt;/p&gt;
&lt;p class="code"&gt; 1 P FAT16 &gt;32M                   233    1002495    1002263 [NO NAME]&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Please choose if all space need to be analysed:&lt;br/&gt;[   Free    ]  Scan for files from FAT16 unallocated space only&lt;br/&gt;[   Whole   ]  Extract files from whole partition&lt;/p&gt;
&lt;p&gt;You know me, I’m going with FAT.  Now I’m asked where I would like to save the recovered files.  This is starting to look promising.&lt;/p&gt;
&lt;p class="code"&gt;Do you want to save recovered files in /Users/socketwiz/bin ? [Y/N]&lt;br/&gt;Do not choose to write the files to the same partition they were stored on.&lt;/p&gt;
&lt;p&gt;I choose to store the files on my desktop and then select Y and it begins to attempt to restore the files…FINALLY.  A folder is created on my desktop called recup_dir.1 and PhotoRec appears to be recovering the files:&lt;/p&gt;
&lt;p class="code"&gt;Disk /dev/disk2 - 513 MB / 489 MiB (RO)&lt;br/&gt;     Partition                  Start        End    Size in sectors&lt;br/&gt; 1 P FAT16 &gt;32M                   233    1002495    1002263 [NO NAME]&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Pass 1 - Reading sector     384119/1002263, 151 files found&lt;br/&gt;Elapsed time 0h01m41s - Estimated time for achievement 0h02m42&lt;br/&gt;jpg: 151 recovered&lt;/p&gt;
&lt;p&gt;After around 10-15 minutes all 412 files are properly recovered.  Your mileage may vary but I would say if you can mount your card, and the operating system is reporting back the proper size of your card, then you have a pretty good chance of recovering you data from it.  This software also runs on Windows and I would expect you would receive the same choices I described above.  At any rate, if you or a friend end up with a corrupted memory card give these steps a try, I hope this helps.&lt;/p&gt;</description><link>http://www.socketwiz.com/post/840610166</link><guid>http://www.socketwiz.com/post/840610166</guid><pubDate>Wed, 21 Jul 2010 08:40:00 -0400</pubDate><category>mac</category></item><item><title>New blog software already :)</title><description>&lt;p&gt;So I decided I wanted to start blogging again and wrote my own blogging site.  Then yesterday I was reading my news feeds and stumbled upon &lt;a title="tumblr" target="_blank" href="http://www.tumblr.com/"&gt;tumblr&lt;/a&gt;.  I wasn’t really looking to replace my awesome software that I had written myself, but tumblr just has to many features to ignore for a decent blogging site.  So I’m going to give it a try, after all the price is right.  I don’t understand why people would go through all of this effort to make a wonderful product and then give it away for free.  Oh well.  Of the many features tumblr has is that it seems there a at least a thousand ways to get content to your blog including an iPhone app.  So I think I’m now totally out of excuses for not keeping up with my blog.  I’ve been doing OK so far, lets see how this goes…&lt;/p&gt;</description><link>http://www.socketwiz.com/post/836222169</link><guid>http://www.socketwiz.com/post/836222169</guid><pubDate>Tue, 20 Jul 2010 08:30:01 -0400</pubDate><category>Miscellaneous</category></item><item><title>Python via Cocoa</title><description>&lt;p&gt;I have an idea for a Cocoa front-end around a Python script that I recently came across. As you may or may not be aware Cocoa has the concept of a &lt;a title="scripting bridge" target="_blank" href="http://developer.apple.com/cocoa/pyobjc.html"&gt;scripting bridge&lt;/a&gt; for Python. However, almost all of the examples I could find were to allow Python to use Cocoa as a GUI interface basically. But I want to do is the other way around, use Python for it’s engine from Cocoa. Google being the amazing search engine that it is helped me to find an example that describes &lt;a title="exactly that" target="_blank" href="http://www.informit.com/blogs/blog.aspx?uk=Ask-Big-Nerd-Ranch-Adding-Python-Scripting-to-Cocoa-apps"&gt;exactly that&lt;/a&gt;. Using that example I was able to break out the basic concept and build a very simple app that calls a Python script from Cocoa. The python script just calls ls and is then able to print the output back into my Cocoa app’s text view. So the bridge allows a two way communication from Cocoa to Python and back again. This is very cool stuff. Here is a screen shot of my little test app&lt;/p&gt;
&lt;p&gt;&lt;img height="462" width="560" src="http://socketwiz.s3.amazonaws.com/rover.png" alt="Python bridge test app"/&gt;&lt;/p&gt;
&lt;p&gt;Here is the Cocoa script that I executed in it’s entirety:&lt;/p&gt;
&lt;pre&gt;&lt;span class="c"&gt;#&lt;/span&gt;
&lt;span class="c"&gt;#  RoverExecutor.py&lt;/span&gt;
&lt;span class="c"&gt;#  Rover&lt;/span&gt;
&lt;span class="c"&gt;#&lt;/span&gt;
&lt;span class="c"&gt;#  Created by Ricky Nelson on 7/16/10.&lt;/span&gt;
&lt;span class="c"&gt;#&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;Foundation&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;AppKit&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;subprocess&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;PythonExecutor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;NSObject&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
	&lt;span class="nd"&gt;@classmethod&lt;/span&gt;
	&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;main_&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
		&lt;span class="n"&gt;textView&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
		&lt;span class="n"&gt;path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
		&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Popen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'ls /'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stdout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PIPE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stdout&lt;/span&gt;
		&lt;span class="n"&gt;textView&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;textStorage&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mutableString&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setString_&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
		&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;YES&lt;/span&gt;
&lt;/pre&gt;
&lt;p&gt;Now that I have a basic understanding of how it all works I can move on to building my little UI.&lt;/p&gt;</description><link>http://www.socketwiz.com/post/836194039</link><guid>http://www.socketwiz.com/post/836194039</guid><pubDate>Sun, 18 Jul 2010 00:00:00 -0400</pubDate><category>cocoa</category></item><item><title>First Post</title><description>&lt;p&gt;I have never been much for keeping up with a blog.  I’ve tried it a couple of times but I just never seem to keep it updated.  But I’m always thinking about stuff to put into a blog so I’ve decided it’s time to try it again.  This time I’ve written my own blogging application so we’ll see how well it works.&lt;/p&gt;
&lt;p&gt;It is my intention to post information on the following topics:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Mac&lt;/li&gt;
&lt;li&gt;Cocoa&lt;/li&gt;
&lt;li&gt;Web Development&lt;/li&gt;
&lt;li&gt;Symfony&lt;/li&gt;
&lt;li&gt;World of Warcraft&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;And maybe a few miscellaneous technology related articles such as radio controlled airplanes, helicopters and cars which are some of the things I like to mess around with in my spare time.  I’m not sure how often I’ll keep this up to date, but we shall see how it goes.&lt;/p&gt;</description><link>http://www.socketwiz.com/post/836117291</link><guid>http://www.socketwiz.com/post/836117291</guid><pubDate>Mon, 12 Jul 2010 00:00:00 -0400</pubDate><category>miscellaneous</category></item><item><title>Graphics editor for the Mac</title><description>&lt;p&gt;I am certainly no graphics artist as you have probably gathered from the looks of this site but I seem to be getting a little better thanks to &lt;a title="Pixelmator" target="_blank" href="http://www.pixelmator.com/"&gt;Pixelmator&lt;/a&gt;. It is certainly not a Photoshop replacement, but it does just about everything you need for those of us that don’t make a living creating digital graphics. If you are on a Mac and you like to play around with graphics, give Pixelmator a try. It is a fraction of the price of Photoshop and still has many of the important aspects of a decent graphics editor such as layers. There are also many tutorials that show you how to do almost anything you would like to do.&lt;/p&gt;</description><link>http://www.socketwiz.com/post/836149628</link><guid>http://www.socketwiz.com/post/836149628</guid><pubDate>Mon, 12 Jul 2010 00:00:00 -0400</pubDate><category>mac</category></item></channel></rss>

