Archive for September 2008

 
 

A Wasted Day?

When I set out writing this blog, I wanted to ensure that I was writing some code every day, even if only a little. Work has been slow lately, so this hasn’t been too hard to accomplish. Sadly, I’d also expected to be making more progress in a day than I accomplished today. Still, perhaps the failures are as worth recording as the successes.
Den ganzen Beitrag lesen…

Searching NSString Before the Insertion Point

Although I was gratified to have achieved my basic objective — getting a mathematical expression as a string to actually spit out a numerical answer — it felt like a kludge. The biggest sacrifice I made right away was to limit my calculations to appearing as the last bit of text in the document. Recall my method for grabbing the expression string:
Den ganzen Beitrag lesen…

Making the Left Side of = My Bitch

That’s really what it comes down to. Whatever the user has entered into Napkin, if they hit the “=” sign, I want to snatch up the equation they put in and spit back an answer. That’s easier said than done, since there are a lot of situations that I have to contend with. Some that occur to me include:
Den ganzen Beitrag lesen…

Reading from a Pipe

Last time, I was trying to get a shell script to give me back the results of a calculation sent to the command line utility bc. By writing the shell script that takes an argument, like

mybc “2+2″

I get back the right answer:

4


Den ganzen Beitrag lesen…

Implementing Calculations

Just to get started, I wanted to create a text editor that would detect when a mathematical expression is entered, and supply an answer. Using NSEvents’ keyDown: method, I can detect when the equal sign is entered, and then parse the expression by overriding the insertText: method:
Den ganzen Beitrag lesen…

Introducing Napkin

So here’s what I’ve got. Imagine a text editor that also has the capabilities of a spreadsheet. At its most basic level, you could type a mathematical expression, hit the equal sign and get an answer. Further, you could write out items in column format using nothing more than the tab key. The app would know to keep columns lined up, and it could perform math both across rows and down columns.
Den ganzen Beitrag lesen…

The Choices

At the core, I’m running a business here. I really want to learn how to program in ObjC/Cocoa, but my day job keeps me pretty busy, and I haven’t had the time to really, really learn it. Yet, I’ve got some potentially great ideas here that I’d like to put on the market. What to do?
Den ganzen Beitrag lesen…

What I’m Doing Here

This is the first in what I hope will be an enlightening series of posts tracking the development of my first Cocoa Mac application, Napkin. Getting to this point has been a long journey, and I can see there’s still a long way to go. But at this point, at least, I’m starting to write some code, and I’d like to have a way of documenting this very complicated process: share my forks in the road, and how I chose a particular way.
Den ganzen Beitrag lesen…