Image Extractor for Microsoft Word Documents Released on the Mac App Store!

Image Extractor for Microsoft Word Documents Mac app icon.

           

Today I have released Image Extractor for Microsoft Word Documents on the Mac App Store. Image Extractor for Microsoft Word Documents allows you to extract all the images out of your Microsoft Word document files (.docx and .doc files). All you have to do is drag and drop a .docx or .doc file on to the window and Image Extractor for Microsoft Word Documents will begin scanning the document for images.

Why use it?
Most text editors on Mac OS X do not fully support Microsoft Word file formats. Most of the document converter apps out there on Mac strip out all the images from Word document files if you try to convert it to another format (like textutil). If you have a Word document and you want to extract all the images out, you can do it now without having to buy expensive software.

Screenshots


Image Extractor for Microsoft Word Documents Mac app screenshot.
Image Extractor for Microsoft Word Documents Mac app screenshot of .doc file being dragged onto the window.
Image Extractor for Microsoft Word Documents screenshot of window with spinning progress indicator.
Image Extractor for Microsoft Word Documents Mac app screenshot of extracted image gallery.

Coin Flip Released on the Mac App Store!

Coin Flip has been released on the Mac App Store!

Coin Flip Mac app icon.

           

You’re arguing with a friend about something, and you decide you’ll settle the argument the old fashion way: flip a coin! Don’t have any change? No problem! Use the Coin Flip app!

Coin Flip is the first coin flipping widget for OS X Yosemite’s Notification Center! Easily add the “Coin Flip Widget” in the Notification Center and flip a coin at any time!

Features:
-Easily flip a coin on your Mac. You can flip a coin from the main app or optionally add the Coin Flip Widget in the Notification Center!
-Flip up to four coins at the same time!
-Lands on heads or tails. It’s a random coin flip just like in real life.
-Choose different coins to flip!

Screenshots:

Coin Flip Mac App Screenshot of penny in main app window and in notification center widget.
Coin Flip Mac App screenshot of 4 coins in main window.
Coin Flip Mac App screenshot of dime on heads.
Coin Flip Mac App screenshot of nickel on tails.
Coin Flip Mac App Screenshot of quarter in Notification Center Widget.

How to Disable NSScrollView Scrolling

Unlike UIScrollView on iOS, NSScrollView on Mac does not have a handy scrollEnabled property for you to set to NO if you need to temporarily disable scrolling in your app.

If you Google around, you can find several posts on websites like stackoverflow that ask questions like How can I disable the vertical scrolling of a NSScrollView? Some have suggested setting the hasVerticalScroller property to NO as the answer. However, the hasVerticalScroller property only effects the visibility of the scroller, a value of NO does not actually prevent scrolling.

There are also ways to constrain scrolling from an NSView subclass, as described in Apple’s documentation here. Constraining scrolling from a view subclass can be useful, but what if you want to just temporarily disable scrolling?

The easiest way to disable scrolling it seems is to subclass NSScrollView and add a BOOL property with a name like scrollingEnabled. Then you can simply override the designated initializers (initWithFrame: and initWithCoder:) and set the ivar of the property to YES as the default value:

-(instancetype)initWithFrame:(NSRect)frameRect 
{ 
   self = [super initWithFrame:frameRect]; 
   if (self) 
   { 
       [self setUpOnInit]; 
   } 
   return self; 
}
 
- (instancetype)initWithCoder:(NSCoder *)coder 
{ 
    self = [super initWithCoder:coder]; 
    if (self) 
    { 
         [self setUpOnInit]; 
    } 
    return self; 
}
 
-(void)setUpOnInit
{
   //Set all default values. 
   _scrollingEnabled = YES; 
}

Now you can just override the scrollWheel: method and check the property:

-(void)scrollWheel:(NSEvent *)theEvent 
{ 
    if (self.scrollingEnabled) {  
      [super scrollWheel:theEvent];  
     } 
    else {  
       //scrolling is disabled. 
    } 
}

This technique will work in most cases, but there may be times when a view inside of a scroll view implements autoscrolling behavior (perhaps if the view is a dragging destination). If you need to temporarily disable scrolling in such a case, you may want to subclass NSClipView and block scrolling from the appropriate methods there. It would probably be better if Apple just added a scrollingEnabled property on NSScrollView.

Ten Different Takes on Objective-C Since 2011

I thought it would be fun to post quotes from various articles/blog posts I found around the web about the Objective-C programming language. Objective-C is still my primary programming language. I would like to believe that for Swift to win, Objective-C does not necessarily have to lose. I cannot help but wonder if many are discrediting the language because it is simply a trendy thing to do on the blogosphere. Has the tone changed?

2011

Alex Payne, when asked “Are you surprised at the popularity of any current languages?” during the preview of emerging languages for OSCON 2011’semerging languages track:

Alex Payne: I’m constantly surprised at the popularity and success of Objective-C. Almost everyone I know tells the same story about Objective-C: they started learning it and they hated it. They thought it was the worst of C and the worst of dynamic languages. And then eventually, they learned to love it. Most of the time, that software works pretty darn well, so who am I to judge? I’m pleasantly surprised by the continued success of Objective-C, and I think it should be taken as a lesson for the language designers out there.

*Blog Post Title: The surprising thing about Objective-C…
http://blog.metaobject.com/2011/07/surprising-thing-about-objective-c.html
In the past few years, quietly, almost invisibly, Apple has transformed its Objective-C language into the best language available. I have been working with Objective-C since the release of the iPhone App Store in 2008. In that time Objective-C has evolved from a clunky, boilerplate-heavy language, into a tight, efficient joy. It is an amazing tool. Anything that I would not write in C I would want to write in Objective-C, were support available. The changes that made Objective-C this way are fairly recent. Basically, they were introduced in 2011, and weren’t supported by enough iOS devices until some time after that. Developers have been able to observe the new features only recently. So I am fairly certain that what I have to say is news.

*Blog Post Title: Apple Could Power the Web
http://kevinlawler.com/objective-c
2012

It is interesting to note that both Java and C++ are losing ground while Objective-C is gaining significantly,€ said Don Babcock, a software engineer at Wake Forest University Health Services. €œI’ve always disliked C and C++ because of all the €˜warts€™ [pointers, memory management hassles, etc.] and I’m a longtime fan of Java [ever since the 1.1 days]. However, my new favorite language is Objective-C because it has all of the best advantages of both.€

*Blog Post Title: Objective-C Overtakes C++ in Programming Language Popularity
http://www.eweek.com/c/a/Application-Development/ObjectiveC-Overtakes-C-in-Programming-Language-Popularity-645924
Though the Apple App Store is the main reason for the recent rise of the language, Eric Shapiro, technology chief of app developer ArcTouch, also argues that the language is easier to use than most. “Almost anybody can just pick up a book and learn [Objective C] basics,” he tells Wired. “That doesn’t make you an expert, but that does mean that so many more [developers] are familiar.”

*Article Title: iPhone Coding Language Now World’s Third Most Popular
http://www.wired.com/2012/07/apple-objective-c/
Obj-C is a beautiful and simple extension to plain vanilla C, giving you both the simplicity of C, and the power of C++. It is a major reason why the Apple toolbox is as good as it is, and the apps work as well as they do. Don’t underestimate that.

Java looks more like an extension to xml, with its endless nesting. Where Obj-C teaches you good programming habits, java does the opposite. In even basic java templates, you will see methods with the same name. In my first project, made from Wenderlich’s tut, I never dropped below 200 warning. Two hundred. Inline overrides and methods might be good for quick fixes, but they will quickly turn your code into a bloated mess. There are no headers, to in a glance tell you what a class does, and you will in no time lose track of what you are doing. I could go on.

[…]

I strongly disagree that java is anywhere near as good a programming language as Obj-C. I actually believe, that the reason that I am a good programmer – NOT implying that you are not 😉 – is because I keep it simple. And for that, I need a simple language, and a simple editor. And a biscuit and some water …

*Cocos2d Forum Post in Thread Titled: 30 days of Android
http://forum.cocos2d-objc.org/t/30-days-of-android/7844
2013

I cut my programming teeth on Java, and didn’t think much of Objective-C at first, in large part because of its excessive verbosity: a line like

String s2 = s1.replace(“abc”,”xyz”);

becomes

NSString *s2 = [s1 stringByReplacingOccurrencesOfString:@”abc” withString:@”xyz”];

but I’ve grown very fond of Objective-C. It’s just better and cleaner than Java.

*Article Title: Android vs. iOS Development: Fight!
http://techcrunch.com/2013/11/16/the-state-of-the-art/
2014

When the iPhone came out, the Objective C language became a hot topic. I was so excited about the thought of writing games for iPhone that I forced myself, despite wariness at [[funny foreign] syntax], to learn Objective C and begin writing a game. Boy was I surprised when I came to love Objective C’s simple elegance and powerful Foundation classes.

Now, after nearly three years of making games in Objective C with Cocos2D-iPhone, I’ve discovered Cocos2D-X and unearthed a whole new love for C++.

[…]

If Objective C is an automatic transmission car, then C++ is a manual.

One might argue that the automatic car is superior because it’s easier. However, that one hasn’t had the experience of clutching into neutral across a gravelly patch to avoid spinning the tires.

C++ has more speed and control, yet it requires a greater level of skill from the programmer.

[…]

Readability

Here’s another fundamental difference. Objective C is inherently more readable than C++ because method parameters are built into the name of the method. Consider:

// Objective C
[layer addChild:sprite z:1];
// C++
layer->addChild(sprite, 1);

*From the online book: How to Make a Platformer Game with Cocos2D-X
http://wizardfu.com/book/cocos2d-x/cpp-vs-objective-c/
Even without knowing a thing about programming, it’s easy to understand this is a big deal: Apple’s current language of choice, Objective-C, has been in the mix for Macs since the launch of OS X, and for iPhones and iPads from day one. For Apple to throw out the developer playbook across its entire product portfolio suggests there’s a big change afoot — and many devs aren’t sad to see it happen. “[Objective-C’s] a real pain,” says Alex Chung, the co-founder of Giphy, who has created multiple iOS apps. “If you’re off by one character it all falls apart. It’s just really old school, you know, it’s like speaking Latin.”

*Article Title: The Swift effect: Apple’s new programming language means way more iPhone developers and apps
http://www.theverge.com/apple/2014/6/2/5773928/apple-swift-programming-developers-objective-c
Indeed, Swift is much, much simpler than Objective-C, with syntax that barely appears like English to the average person. Here’s how you would print “Hello, my name is Swift” using the language’s print command:

let name = “Swift”
println(“Hello”)
println(“My name is \(name)”)

You can see how it’s a little more understandable than the garbled Objective-C code below:


NSString *name = @”Swift”;
NSLog(@”Hello my name is %@”, name);

*Article Title: Go Ahead, Tim Cook, Write An App In Swift—We Dare You
http://readwrite.com/2015/02/10/tim-cook-swift-app-objective-c
IS SWIFT EASIER TO LEARN?
From a pure programming standpoint, you’re almost guaranteed to be more productive using Swift. Of course, if you’re an expert Objective-C developer, that might not be the case.

Swift is the obvious choice if you’re new to iOS and looking to get up to speed quickly. The language will stay out of your way allowing you to focus on the things that matter: making your app work the way you want it to!

*Blog Post Title: Swift vs. Objective-C
http://learn.onemonth.com/swift-vs-objective-c

So which is it? Is Objective-C readable or too verbose? Is Objective-C complicated (like Latin?) or is it so easy that anyone can pick up a book and learn the basics? I personally did not find Swift any easier or harder than Objective-C when adding Swift support to Visual Attributed String. I wonder how much, if any, of the praise and criticism expressed in these quotes, has to do with influence from a very powerful, external force.