Calculator Alpha for iPad released on the App Store

Apple just released Calculator Alpha for iPad on the App Store. It is a calculator/converter for the iPad and it is free of charge.

http://itunes.apple.com/us/app/calcualtor-alpha/id396151092?mt=8

Try it out and let me know what you think of it…

Some of the features are:

  • works in portrait and landscape mode
  • memory functions (add, subtract, recall, delete)
  • elementary functions (x2, xy, sin, cos, log and others)
  • flow display – shows last 3 calculations
  • saves state, so the next time it is opened you are back where you finished

Calculator Alpha for iPad

Leave a comment

iPad Calculator Alpha and KD Jezica website

Hey, it has been a while since I last posted something here on this blog. I have been busy with building my calculator/converter for iPad called Calculator Alpha. I uploaded it to Apple for review, so probably it will be up there on the App Store in couple of days (or maybe a week). It is going to be free and I think it will be competitive with other calculators out there for the iPad.

Calculator Alpha for iPad

I was also busy building a website for my basketball team here in Slovenia. It is now live at http://www.kdjezica.com. It is build on WordPress blogging platform (like this one here, but is hosted on it’s own server). Hopefully we will keep it up to date so everyone will be able to follow what is going on with our basketball team.

On kdjezica.com we will represent all the teams that are part of KD Ježica, from the men’s team that plays in the second Slovenian league (which I am part of) to the youngest members of our club.

New kdjezica.com website

Leave a comment

Social Calc just released on the App Store

My first app that I submitted to the App Store was just approved. It can be found on: Social Calc

Social Calc calculates how two names get along for love, friendship, business, kids and partying.

Algorithm to calculate percentage is what we used when we were kids in elementary school, it was fun then and I guess it is still fun now (after 20 years).

Application consistis of 5 calculators:

  • Love Calculator
  • Friendship Calculator
  • Business Partner Calculator
  • Kids Calculator
  • Party Calculator
 

, , , ,

Leave a comment

OnTime5D plugin tested on newly released Sketchup 8

I just tested the OnTime5D plugin on the newly released Sketchup 8, and it works without a problem. Sketchup 8 was recetly released by Google and can be found on http://sketchup.google.com/.

Leave a comment

Hide Status Bar in iPhone application, or change it’s style

What do you do to hide the status bar in iPhone application. If you build your views in Interface builder, you can set the status bar to None, but notice that above status bar menu it says: Simulated Interface Elements. That means, that it will only show a change in Interface Builder but not in a compiled application.

You have two options to hide the status bar, one is by editing info.plist file you have (typically in Resources Group). You can either open it up in TextEdit (or any other text editor) and add this value under dict XML tag:

<key>UIStatusBarHidden</key>
<true />

Other option is to open info.plist file by double clicking it and adding a new variable to the Information Property List. And under key type (or select from drop down menu) Status bar is initially hidden and check the checkbox (thus setting it’s property to true).

Last option is to do it programmatically inside one of your classes by:

[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO];

By changing BOOL value of setStatusBarHidden to NO, you are able to show the hidden status bar:

[[UIApplication sharedApplication] setStatusBarHidden:NO animated:NO];

If you want to change the style of iPhone status bar you can once again edit info.plist and add for Opaque black style the following:

<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleBlackOpaque</string>

for Transparent black style (alpha of 0.5) add:

<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleBlackTranslucent</string>

Again you can add status bar style by double clicking info.plist and selecting from dropdown menu Status bar style as Key and selecting prefered style as the value (again from the dropdown).

,

Leave a comment

% (modulo) operator only works on int and long data types in Objective C 2.0

Today, I tried to use a modulo % operator in a function in Objective C 2.0 like so: (Modulo operator finds the remainder of division of one number by another)

-(double) someFunction: (double) value {
  ...
  if (value % 90 == 0)
    return 0;
  ...
}

When I compiled my code, XCode generated and error saying that % function cannot be used for double values. I googled my way on to this stackoverflow question (isn’t it amazing that for almost every problem you have, stackoverflow.com has an answer to your question…), where one of the ways of getting remainder of division where one or both numbers are double is to use c function fmod(). So I rewrote my function and XCode compiled without a problem…

-(double) someFunction: (double) value {
  ...
  if (fmod(value,90) == 0)
    return 0;
  ...
}

,

Leave a comment

Implementing factorial numbers in Objective C 2.0

I was implementing a function that would calculate factorial number for a given positive integer value. Factorial is denoted by n! and is the product of all positive integers less than or equal to n. For example:

6! = 1*2*3*4*5*6 = 720

So I implemented the function factorialX as follows:

-(double) factorialX: (int) value {
  double tempResult = 1;
  for (int i=2; i<=value; i++) {
    tempResult *= i;
  }
  return tempResult
}

Tried the code out and [self factorialX:6] does return 720 as it should. Then I tried it with bigger numbers, and the first problem noticed was with 13! which returned result 1,932,053,504 but it should have returned 6,227,020,800. Well that is a little bit strange, then I googled factorial a little bit and found this post: Factorial Function in Objective C, and the author points out: “That’s because 13! exceeds unsigned integer maximum of about 4,000 million on 32-bit platforms.”.

Ok, but I have tempResult defined as double, so why did I get the problem that is associated with int. It turns out that in the loop tempResult is multiplied by i (which is defined as int) and thus the whole calculation is done for int values.

The solution is to cast the i as double, thus changing the expression in the loop to:

tempResult *= (double) i;

Then if I try to calculate 13! I get the correct result of 6,227,020,800 🙂

Found that math.h indeed has a gamma function, so I could calculate any factorial n (where n can be any positive number) with lgamma(n+1).

(One question I have, which maybe of of the readers can solve is, how to calculate factorial of non integer value. For example 6.4!. If you input this into wolframalpha.com it shows you the result and it is calculated as Gamma(7.4), since Gamma(n+1) = n!. But Gamma function is defined as integral, and I do not know a way to calculate it numerically…)

, , ,

10 Comments