Doing Math in Objective C

Share this:  


One thing you will find you need to do in any programming language is do math. Here are some useful math functions for the Objective C language. I give a little bit of a comparison to Visual Basic for those who know that language. They are provided in no special order:

  • fabs() – Gets the absolute value of the value in parentheses. Works like ABS() function in Visual Basic. fabs(-123) = 123, fabs(34) = 34.
  • ceil() – Find the ceiling integer. Kind of like rounding up. Same as INT(x+1) in Visual Basic.  ceil(3.1) = 4.
  • floor() – Find the floor integer. Kind of like rounding down. Same as INT(x) in Visual Basic. floor(3.6) = 3.
  • exp() – Find the exponential value.
  • pow() – Raise a number to the power. pow(3,6) = 3^6 in Visual Basic.
  • rand() – Generate a pseudo random number. Function is RND(x) in Visual Basic. A good discussion on random numbers in Objective C can be found here.
  • srandom() – Generate a seed for the random number generator. This is done with the Randomize statement in Visual Basic.
  • sqrt() – Find out the square root of a number. sqrt(x) = x^(1/2) in Visual Basic.

Book Review: RibbonX – Customizing the Office 2007 Ribbon

Share this:  

My Book Rating: 5 of 5 stars:

Power Users and Developers: Making customized Apps Using Microsoft Office
Those of us who have the responsibility of producing customized Excel workbooks, and Word documents that essentially have become small powerful applications in their own right are always looking for ways to make the tools we build in these Microsoft Office products more powerful, easy to use, and more like actual stand-alone apps. One of the ways I looked at enhancing the “tools” I created was by adding a tool bar to an Excel workbook for example. I first did this myself in Excel 2003. It was tedious but doable. One draw-back in the way tool bars were done back then is that the changes applied to the whole app (Excel or Word), and one screw-up on your part could truly clobber Excel or Word’s tool bars and menus system wide.

A New Way of Doing Tool Bars in Office 2007
In Office 2007, Microsoft changed how their user interface worked. And they changed the scope of the changes. If you were going to screw something up for your tool bars now it would only be with one document file, not the entire system. Customizing this tool bar was more flexible. You could do much more with the new tool bar than the old version (the new tool bar Microsoft calls a ribbon). The Technology behind the ribbon they call RibbonX. Read more

iOS Christmas Concert: Amazing iBand Musicians Play Three Songs

Share this:  

This video is great! A band of talented musicians whose instruments are only iPads and iPhones:

I am amazed at how creatively musicians from North Point Community Church use these devices… picking specific apps for different instruments, and the creativity of the app developers who dreamed them up. Just cool!

The musicians needed to practice a bit more on the middle song, but the first and the last songs were very polished and professional.

Anyways everybody, Merry Christmas!

Javascript: The Good Parts – A Collection of Lectures By Douglas Crockford on the Javascript Language

Share this:  

A few years ago, I am not sure just when or how, I stumbled upon these videos on Yahoo where programming legend Douglas Crockford gave very interesting and insightful lectures on the JavaScript language. It has been a bit tedious to find part X of a lecture and I would think about creating a page on the web that embeds all these videos in a way that makes watching them easier to do. To curate this content as Robert Scoble might say. Well after all this time I am doing just that in this post.  I think that if you are a programmer and you use JavaScript in any fashion that this information is really useful. Both to learn new things, as well as for review. Read more

How to Fix Base SDK Missing Problem in XCode

Share this:  


In this article I cover how you can fix the Base SDK Missing problem you might have had using the iOS SDK 5.2. The video above is easiest to see in full screen mode.

Background:
I downloaded Apple’s iOS SDK 5.2 and installed it on my Mac. After that process was over , I decided to load an existing project of mine into XCode. Ok, good. Then I tried to do a build. Kaboom! It did not work! No worries I thought, I will just go to the drop-down and pick the latest SDK 5.2. But the option was not there! The thought came to me that I might have to create a new project and import all my files from my existing project just to get it to work. Not a very nice thought to say the least! Read more

Happy Thanksgiving in 2010!

Share this:  

 

Thanksgiving Turkey
While in many ways 2010 was a tough year, there are still many many things to be thankful for. Here is a list of things I though of for myself:

 

  • A job. Not something to be taken for granted these days.
  • Food to eat.
  • A roof over my head
  • A wife that loves me.
  • 2 nephews.
  • 2 sisters and 2 brother-in-laws.
  • My mom.
  • Fall colors.
  • Fresh clean crisp air to breathe in.
  • A good church.
  • Good friends.
  • A working car.
  • walks in the forest preserve.

I could go on a while but I think you get the drift. What are you thankful for?

Here’s wishing you and your family a very happy Thanksgiving!

I Have Been Spiffing Up the Site

Share this:  

If you have ever been to Chomer.com before, and now have come back, you will notice that things look a lot different. I’m not done with this spiff-up by any means, but it is well along the way. I think that visually it is a big improvement. Also I am using a Like button for Facebook on posts, and a Retweet button for Twitter. So I’m beginning to get some of the social aspects covered too. Why the social aspects? Its a good way for people to spread the word about content on this site if they find it useful. Read more

How to Create Class Categories in Objective C

Share this:  


Note: Video is Best Viewed in Full Screen Mode

As I began refining some sample code for making Universal Apps for the iPhone and iPad, I sought a way to make my code as concise as possible. I needed to determine if the app was running on an iPad or iPhone/iPod Touch and use it to my advantage. This basic information is contained in the UIDevice class.

Unfortunately, using:

Read more

1 2 3 4 5 6 12