Sep 07

programming_book_reading_technique

For me, the process of learning something new from a programming book are as follows:

1. Buy two or more books that cover the same material.
Having two perspectives on the same topic fills in holes that one author left because he/she is so familiar with the topic that he/she assumes the missing information is common knowledge. Additionally, different authors tend to focus on different aspects of a topic; combing these different attentions, in my estimation, makes for a more rounded experience.

I was going to write that I don’t do this for advance topics, but as I look at my bookcase (yeah, most of my books are still paper), that isn’t true. The only reason I don’t have more than one book on a topic I’m interested in, is that a second doesn’t exist.

2. Have a small project in progress as you make your way through the book.
With some code already started (or at least planned out), the material is relevant to a task I’m trying to accomplish. For me this makes some of the material easier to absorb as I’m paying attention out of necessity. Without a project in mind, in the best case, things that seem useful are placed in the region of my brain where they are abbreviated so they can be looked up again. In the worst case, they are completely forgotten.

May 25

hydra

I’ve been quietly watching a fews companies’ reputations on Glassdoor fall for about a year now. It’s a massacre. That worst part is that most of the blood drawn originates from these companies repeatedly shooting themselves in the foot, over and over.

For companies there is a silver lining to a stretch of bad reviews; it tells you what your employees’ gripes are without a filter. This is about as close as you’re going to get to reading their minds. Obviously an organization doesn’t want to broadcast its disfunction to potential candidates, but there is some good to be made out of it.

With this in mind, you can make it a whole lot worse. Here’s how…

The absolute worst thing you can do is to start writing fake positive reviews; it WILL backfire.  Beyond not being ethical, to anyone with half a brain these stick out like a red thumb. Yes, even the fake lukewarm reviews stick out. Ultimately, fake reviews insult the intelligence of the candidates that may come into the company.  They also make the company look like they are hiding something rather than patching it up. To the content employees these will be a source of embarrassment. To those disgruntled employees or ex-employees on the sidelines, you’re inviting them to write negative reviews. This is a hydra with which you’re better off walking away from. This is what I call “shooting yourself in the foot”.

The second foot gets shot off when the positive reviews start criticizing the negative reviews. Don’t do this. This is a flag to everyone observing that, if it’s not already a fake review (which it likely is), it’s written by a company tool.  In the best circumstances a prospective employee would likely just ignore these.

The third foot (if there was such a thing) gets shot off when someone at the company responds to the negative reviews without addressing the issue.  The only response that is warranted is something like “We strive to foster an exciting, inclusive, dynamic team environment, but we have apparently fallen short. We apologize, and will take your comments into consideration so that we may improve in the future. Please give me a call so that we can further discuss this with you”.  If the negative review rails on about mistreatment but has a minor compliment about office decor, don’t thank them for the compliment without addressing the larger issue.  One might think this is something that doesn’t need to be said, but I’ve actually seen this occur. I can only guess that the person writing on behalf of the company believed they could perform some sort of Jedi mind trick causing the negative review to be erased from the mind of the reader.

What it comes down to is many might consider interviewing with a company with a stretch of bad reviews, but would likely ask about those bad reviews at the interview. A couple of bad reviews isn’t going to kill your reputation. Readers know that anonymity emboldens the fringes of society. With that said, most (myself included) wouldn’t touch a company with a swath of fake reviews with a ten foot pole.

Like in all things, being honest and respectful of the people around you seems like a better path. You might as well start down that path with your employees before they’ve even shown up for their first day of work. I’ll bet you can argue yourself out of taking that path, but it’s ill fated if you want to convince people to spend any time out of their career with your organization.

glassdoorbadreview

May 23

apple_osx_centos

1. Visit Centos’ web page, https://www.centos.org/download/, and download the iso image you’d like to boot from.
2. When the download has completed, open up terminal and use ‘hditutil’ to convert the *.iso to an *.img file (specifically, a UDIF read/write image).

$hdiutil convert -format UDRW -o target.img CentOS-7.0-1406-x86_64-Everything.iso
Reading Master Boot Record (MBR : 0)…
Reading CentOS 7 x86_64 (Apple_ISO : 1)…
Reading (Type EF : 2)…
Reading CentOS 7 x86_64 (Apple_ISO : 3)…
…………………………………………………………………….
Elapsed Time: 33.590s
Speed: 200.5Mbytes/sec
Savings: 0.0%
created: /tmp/target.img.dmg

3. Use the ‘dd’ utility to copy the iso to your USB drive:

$ diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *121.3 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh HD 120.5 GB disk0s2
3: Apple_Boot Recovery HD 650.0 MB disk0s3
/dev/disk1
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *31.9 GB disk1
1: DOS_FAT_32 NO NAME 31.9 GB disk1s1
/dev/disk2
#: TYPE NAME SIZE IDENTIFIER
0: CentOS_7.0_Final *4.5 GB disk2
$ diskutil unmountDisk /dev/disk1
Unmount of all volumes on disk1 was successful
$ diskutil unmountDisk /dev/disk2
Unmount of all volumes on disk2 was successful
$ time sudo dd if=target.img.dmg of=/dev/disk1 bs=1m
Password:
4261+0 records in
4261+0 records out
4467982336 bytes transferred in 1215.483272 secs (3675890 bytes/sec)

4. You should be done! Boot from the USB drive on your target machine.

Tagged with:
May 09

xcode6_graphics

Below is my Objective-C niggle list. Beyond listing my niggles, I’ve also included what I think is a proper resolution for each complaint and why I think it is a correct resolution. I’d love to hear from anybody who disagrees and why they disagree.

I should note that I’ve, at some point in the past, committed some (probably all) of the Objective-C coding sins I’ve called out below. whattayagunnado…


 

Constants

Instead of this:

1
2
#define FRAME_MARGIN_TOP 50
#define FRAME_MARGIN_BOTTOM 50

Do this:

1
2
static const NSInteger kFrameMarginTop = 50;
static const NSInteger kFrameMarginBottom = 50;

Here’s Why:
The macro doesn’t explicitly indicate any type information.

 


 

Literals

Instead of this:

1
2
3
4
NSNumber *myNumber = [NSNumber numberWithInteger:42];
NSArray *myHeroes = [NSArray arrayWithObjects:@"Superman", @"Spiderman", nil];
NSMutableArray *myOtherHeroes = [NSMutableArray arrayWithObjects:@“Black Panther”, @"Moon Knight", nil];
NSDictionary *myContacts = [NSDictionary dictionaryWithObjectsAndKeys:@"John", @"FirstName", @"Doe", @"LastName", nil];

Do this:

1
2
3
4
NSNumber *myNumber = @42;
NSArray *myHeroes = @[@“Superman", @"Spiderman"];
NSMutableArray *myOtherHeroes2 = [@[@"Aquaman", @"Moon Knight"] mutableCopy];
NSDictionary *myContacts = @{@"FirstName":@"John", @"LastName":@"Doe"};

Here’s Why:
The literal syntax is easier on the eyes. Not using the literal syntax signals that you’ve stopped paying attention to the advances in clang before 2012.

 


 

Enumerations

Instead of this:

1
2
3
4
5
enum BroadcastState{
    BroadcastStateDisconnected,
    BroadcastStateDataRecieved
};
typedef enum BroadcastState BroadcastState;

Do this:

1
2
3
4
typedef NS_ENUM(NSUInteger, BroadcastState) {
    BroadcastStateDisconnected,
    BroadcastStateDataRecieved
};

Here’s Why:
The NS_ENUM macro’s enumeration type is explicit.

 


 

No ops

Instead of this:

1
2
if( someVar != nil )
  [someVar doSomething];

Do this:

1
[someVar doSomething];

Here’s Why:
Sending a message to a nil object is a no-op.

 


 

Tagged with:
Sep 22

It turns out that getting rid of those wacky new constraints you see attached to user interface elements in Interface Builder is easy. To remove auto layout constraints in Xcode 4.5, just uncheck the “Use Auto Layout” box from the File Inspector while in the Interface Builder layout.  Honestly, if you’re building for iOS 6 and beyond you’re probably going to have to get used to them.  To me, this heralds the end of the days where we only had a couple of aspect ratios to design for.

Tagged with:
Sep 01
Next Year Will be the Year of the Linux Desktop

Always next year...

Tagged with:
Aug 18


iOS SDK Tutorial: Simple Multithreaded Programming with Grand Central Dispatch
This tutorial demonstrates how to one might begin to utilize Grand Central Dispatch in order to write a multithreaded application in iOS for the iPhone/iPod Touch/iPad using Objective-C with Xcode.

Tagged with:
May 25

Mary Millbee's Memory Match - New Card Set!

The newest version of Mary Millbee’s Memory Match is live! This update adds a new set of number & letter cards.

Tagged with:
Apr 08

Memory Match Game

Mary Millbee’s Memory Match is now available for the iPad! Check it out in the app store, here.

BTW, it’s a free app!

Tagged with:
Feb 10


Before moving last week, my wife and I packed away all of our belongings.  Since my Mac Mini and custom built PC were packed away along with our CRT TVs, we decided to use my monitor, a Samsung T260HD, as a television.  Long story short; we loved this monitor as a TV.  I’d bet that the T260H isn’t a particularly “good” LCD TV, but it was a huge step up from a little 18″ CRT whose place it took.

If my current monitor would be our new TV, I needed a new monitor, and I decided I wanted one with 2560X1440 or 2560X1600 resolution.  The monitors I researched were:

1. Apple Thunderbolt Display
2. Apple LED Cinema Display
3. Samsung SyncMaster S27A850D
4. HP ZR2740w
5. Dell UltraSharp U2711

Each needed to attach to a 2011 Mac Mini Server, a 2010 MacBook Pro, and a custom built PC.  The Mini and the PC needed to be attached at all times, while the MacBook Pro was transient.

I should note that I am not an expert in monitor hardware and would never claim to be one. This is just an exploration from the perspective of a layman who works mostly in Xcode, does some amateur Photoshopin’, and a dabbles in 3D modeling from time to time.

The Apple Thunderbolt Display was the first monitor I took a look at.  Having everything pumping through that single thunderbolt cords sounds awesome; so clean, and neat.  Unfortunately things get less than ideal when you have more than one Mac.  Things get downright impossible when you add a non-Mac in the mix.

Macs without a thunderbolt port are unable to use this monitor, so that eliminated the MBP.  Since there are currently no thunderbolt video cards at the time of this writing for the PC, it couldn’t use the Thunderbolt Display as well.  The Mac Mini was the only machine I had that could utilize this display.

Even if I had to two thunderbolt Macs, there is no KMV switch available to conveniently switch between them.  I would have had to physically plug and unplug the machines when I wanted to alternate which machine was driving the display.

Not being able to use 2 out of my 3 machines with this display was a deal breaker, to say the least.  It seems pretty clear that the Thunderbolt display is really meant to be a MacBook docking station with a screen.

With the Apple LED Cinema Display, Apple, once again, limited itself with input port options.

The ACD uses a single Mini DisplayPort which actually would work with all three of my machines.  For about $150 I could have picked up a  PC video card with a Mini DisplayPort output.  So what’s the problem with this one?  Well, the only Mini DisplayPort KVMS available are expensive and are (for the most part) poorly reviewed.

Apple seems to build monitors with the assumption that one monitor is exclusively tied to one machine.  I suppose this might be the case 99% of the time, but it is not my situation.

It looked as if the non-Apple monitors were my only options.

The Samsung SyncMaster S27A850D has seen mostly favorable reviews.  However, it is not an IPS panel and is apparently prone to horizontal color shifting issues per the reviews on amazon.com.  My current monitor has color shift issues, and I wanted to avoid this with the next monitor.

The HP ZR2740w has been favorably reviewed.  It also features a similar (same?) panel than what dwells in Apple’s monitor offerings.  Unfortunately, The input connections are limited with only a DVI, and a DisplayPort input available.  This means that a DVI or DisplayPort KVM would be necessary to access all three of my machines.  Like the Apple Cinema Display, finding an inexpensive KVM for the DisplayPort or DVI port (that supports the 2560X1440) is currently impossible.

The Dell UltraSharp U2711, like the ZR2740w, has been favorably reviewed.  Beyond being a high resolution monitor, its claim to fame has been a wide color gamut.  The only downside to this monitor is that it still uses CCFL backlighting, which means it has to “warm up” before reaching its full brightness.  Other than that, it has just enough connections for my needs that can drive the monitor at its full resolution (2 DVI, 1 DisplayPort).  It’s also comparably priced to the HP and Samsung, and priced lower than the Apple monitors (of course).

So, in the end, I decided on the Dell U2711. Did I actually buy the Dell? Nope. I retained the Samsung T260H as my monitor and I returned to the CRT world for TV watchin’.  My samsung 1920X1200 monitor works fine, and it turns out that I don’t really care about TV.  A high resolution monitor would have been nice, but it isn’t worth ~900 dollars when I have a perfectly fine monitor already.

Tagged with:
preload preload preload