Tag Archives: xcode

Upcoming Semester

I have about two weeks before the next semester begins. I’m going to be teaching General Biology and MicroBiology in the Fall and the MicroBiology and Ecology in the Spring. During the semester, this blog changes focus to include many more academic topics, but I will still be posting Coding Challenges and other non-biology material. Also, I have moved my comments on film to another page called 100 films in 100 days (a project which I am slightly behind on, but feel like I can still catch up). I have considered splitting my coding posts to another site as well, but I fear that I will fractionate both my audience and my posting frequency in one fell swoop.

As a lead-in to the semester, I thought I would publish the mindmap I constructed for General Biology (I’m hoping to use it as a hyperlinked table of contents in my iBook).


I hope this is readable

Leave a comment

Posted by on August 4, 2013 in Uncategorized


Tags: , , , , , , ,

Now What?

A number of software development courses, such as Codecademy or even traditional university classes, prepares the student to solve problems using their language of choice, but leaves them unprepared to go to the next step.  This next step is to take what you have created and fold it into something free-standing and usable; Something you can share with friends; Something attractively packaged.

My own dilemma is that I have been taking classes and practicing programming C++ on my mac using XCode as my IDE. Now that I have actually created something (a personal summertime project between classes), I want a good way to present my work. Something more attractive and user friendly than the Terminal environment I currently have.

According to apple, my next step is Cocoa. But, what is Cocoa?

Apple defines Cocoa as “Cocoa is an application environment for both the OS X operating system and iOS, the operating system used on Multi-Touch devices such as iPhone, iPad, and iPod touch.” Which could be meaningful… but not very descriptive to me.


                            Hot Cocoa

For anyone familiar with Apple lore, Cocoa was first introduced as NeXTSTEP in 1989: A product of Steve Jobs’ successor company NexT. “You can use several programming languages when developing Cocoa software, but the essential, required language is Objective-C … You can even mix C++ code with your Cocoa code and link the compiled code into the same executable.”  It is this last phrase that gives me hope that I can figure out how to possibly use the work I have don’t so far and weave it (somehow) together with cocoa to add a friendlier appearance to my work. Furthermore, it looks like I could also use Ruby or Python with Cocoa, two languages that I have been working with and find to be somewhat less awkward at times than C++.

So, how to actually put this together: C++ and Cocoa?

            -I’ve been sifting through resources for a couple days now trying to identify some starting point to this without much luck.

-Perhaps this is the wrong way to go about using my C++ code, but is there another way?

Leave a comment

Posted by on August 4, 2013 in Uncategorized


Tags: , , , , , , , , , ,

Stack Overflow hates me

ImageI tend to ask a lot of questions that stack overflow considers useless. I understand the format of the site – it’s a place where people can ask questions that can be answered accurately and with references. An easy way to get your question flagged is to ask for a recommendation for something – a question that can only be answered by opinion and therefore does not have a discrete, ‘provable’ answer.

However, I still want my questions answered. I really do need help and I’m not sure where else to turn to get it (to reach such a well experienced audience).

What I am dealing with is:

ImageI have a small C++ program that I have developed in Xcode. Things are pretty close to working, but I would like to take my program and wrap it in a more attractive user  interface. Somehow, I thought I was just needing to learn some more C++. I thought that was all in ‘book 2’ or something. But I am getting the impression that I need another program and I have no idea where to start.

(The layers of programming are amazingly deep)

So, please write if anyone out there knows of

#1 a good program to do this with -or- a way to approach it by linking my C++ programs in XCode to an objective-C interface (blahblah, these are words I can repeat, but I don’t understand how to do it)  

#2 know a website / book / youtube channel that embodies a walkthrough approach to doing this

Leave a comment

Posted by on August 2, 2013 in Uncategorized


Tags: , , , , , , , , ,

C++ coding in XCode

For some reason it took me forever to figure out how to use XCode as a C++ compiler. Recently, I figured it out and have worked on several projects without incident. 

I needed a compiler to use on my mac because I am currently taking a class on C++ algorithms that uses Microsoft Visual run on Windows. Not surprisingly, Visual doesn’t run on OSX (and it’s frankly too much effort and processing power to install windows on my mac and then run Visual through that. – possible, but unwieldy.) 

Frankly, once I started using Xcode for C++. I realized that it’s both simpler and better than Visual anyway. Especially for a new user: I’d rather spend my time and energy working in C++ than trying to figure out a complex compiler. So, without further ado…


1. Install XCode on your machine (it’s huge, so plan accordingly)

2. Open XCode and select File > New Project.

3. Select ‘Command Line Tool’ from OSX > Application


4. Give your New Project a name


5. Click Next and select a location to save your file (desktop / developer folder/ etc.)


6.Your New Project will open and you just need to select main.cpp to get the familiar ‘hello world’ skeleton program.


7. I erase the skeleton and replace it with a simple :

int main(){

return 0;


and start from there. 

8. In order to to compile and run your program, select Program > Build, correct any errors and Build again if necessary. Then hit the play button in the upper left corner of your window to run the program (intuitive is nice, isn’t it?)

Your program will run, giving you an output window at the bottom of the main window. You may need to click on that window in order to provide input if your program requires it.

I hope this helps you speed along to programming quicker and with less hunting than I had to do. I don’t know why I even tried to find something outside of XCode to start with.  

Leave a comment

Posted by on January 19, 2013 in Uncategorized


Tags: , , , , , , , ,

Mastermind – from JS to something useful

So, I admit, I don’t really know what use javascript is. I’ve been studying it at codecademy for a couple of weeks now and used it to put together this mastermind game, but now what?

JS is the language of web applications, so I suppose that I could refine it and somehow integrate it within the website (that’s appealing) but I don’t know the first thing about how to bridge the gap between the actual programming part and the more practical application of that programming.

That is…

How do you place a JS application in your webpage?

How do you add some character and design to the basic functioning of the program (my program works as a series of alerts, no gameboard and worse yet, no visual clues as to what your previous moves and their feedback were)?

Or perhaps, what I find most important, how do I abstract the design of this program and recreate it in another language and in a structure compatible with XCode?


I find XCode to be a terribly daunting thing. On the surface, I see the wonder of being able to create and direct actions in a WYSIWYG manner, but then there are all the windows with code on them. How do they all tie together?

This is the kind of hand-holding that I really need to make the transition from having a slight understanding of code and how it works to actually making it work. A prior example of this is Python. Nowadays, the coding language of Python is presumably built in to Apple’s OS. I’ve been told that you can just write code in a text window and use it – I’m afraid that’s only a tantalizing piece of information to me – I should be able to use it – it’s easy! But I haven’t the foggiest notion of where to start! And I mean, really start.

Another example of my confusion could easily have been Javascript. I would happily work along the codecademy exercises, but have no idea whatsoever about where I could practice or ever use this. Luckily, the good people at codecademy foresaw this as a problem and have provided a web-based solution in the form of codecademyLabs – a practice place where one can create and run programs. This was the only way I could ever have taken on the Mastermind challenge.

Now XCode is a similar problem. At least I can see where to program (kind of), but now I am boggled by the volume of files and windows.


My goal at this point is to take what I’ve made and use it to demonstrate how one navigates the app submission process with Apple. I apologize, but this might take a while.

Leave a comment

Posted by on July 4, 2012 in Uncategorized


Tags: , , , , , , , , ,


This weekend I spent some time online looking for some good suggestions on practicing to write code. I’m still all ears if there are any good practice exercises out there that you might recommend, but I came across someone’s practice problem of making a version of the game master mind.

I used to love this game as a kid because it felt like being a code breaker – I guess it WAS being a code breaker, but I mean that it felt like it mattered to break the code. Anyway, at first glance, I thought this would make for a good project. Something to slow me down from gobbling up codecademy – because I’m getting to the point where the lessons are not so easy and straight forward and I may need time to digest some more.

This brings me to my design. I don’t know if I have a design yet. But what’s the design going to be? I feel like it’s a super easy game and should be super easy to code, but the more I think about it, the harder it gets. I worry that I may be making it harder than it needs to be too… but that will come out when I get to the coding.

So, here’s the basic outline… what happens in a game of mastermind?

(I’m designing it so that the computer makes the code and the player tries to crack it)

1. Computer asks for two pieces of input.

a. how many places / digits will the code be?

b. how many colors (I’m actually going to use numbers) should be available?

2. Computer makes up a secret code based on that input

3. computer asks you to guess a code

4. computer checks your code for right number/right space or right number/wrong space and gives feedback calculates how many tries you take to get a correct answer and (perhaps) keeps a leader board.

Now there also has to be some verifications put in place to make sure you choose a valid guess and that you’re not repeating yourself.

The fist hurdle I see if how does it not duplicate itself. (i.e. if position1 of a four digit secret code is ‘1’ and your guess is 1123, how to make sure that it calls position #1 as right number/right position and not give a second credit of right number/wrong position to digit2 of the guess?

I’m sure that there is some proper ordering of the if/then/else look to do that, but I’m a serious noobie and that’s exactly the kind of thing I need to learn.

When I do solve this project, I would like to take the next step and translate my Javascript mastermind into something in Xcode and use a graphic interface.It would even be nice to put this game up for DHS if I could – because I’m going to start making business rules for success here.

#1 is going to be take your job seriously.

#2 make the most of every exercise

I really do take this seriously. I know it’s a small thing, but I am trying my best to make this company work and if that means putting serious effort into making computer exercises, then so be it.

To make the most of every exercise, I am going to hold my feet to the fire and really make this game and get it through the Apple store. I could do this exercise and kind of throw away the result, but if I’m going to make the most of it, that means doing a good job, making a complete product that looks good and going through the steps with Apple, because, frankly, that’s not easy either and it’s another place that practice can pay off.

OK. program, expand the program and compile and start following some rules to keep me on track.Image

Leave a comment

Posted by on June 25, 2012 in Codecademy, Coding


Tags: , , , , , , , , ,

So, why provisioning?

I answered the what about provisioning last time. As far as ‘why’, I just attributed that to Apple’s control issues. I wanted to clarify what that means. After all, how are they actually controlling this?

The easy answer is that Apple controls provisioning by only allowing each provisioning file to work with 100 devices. 100 may sound like a lot if you’re just one person writing code for your machine and maybe that of two or three friends that are serving as your testers, but 100 can run out quickly if you’re a larger operation or if you give one person permission and then they stop working with you for whatever reason.

But what it really does is provides a limit to the number of times you can ‘work around’ their system. If there was no limit, then you are free to leave the walled garden and sell your apps to anyone and just provide them with the provisioning file along with your app. I’m sure it doesn’t matter what the number is to Apple, they just agree that you need some way to test on real devices, but want your ability to share to be limited to a number that is high enough for you, but low enough to never be a practical way for you to escape their control.


Tags: , , ,