Math Libraries for Objective - C to be used in Iphone projects - iphone

Not wanting to re-invent the wheel, are there any open-source (or included) math libraries in Objective-C (for iPhone) that can calculate Internal Rate of Return (IRR) or Modified Internal Rate of Return (MIRR)?
I'd hate to have to re-do all that work if someone out there has already done it.
Thanks!

GNU is another option for any kind of mathematical calculation but it is a C library so not object oriented.
http://www.gnu.org/software/gsl/

I kind of doubt that there is. Objective c just seems too theoretical and idealistic for something as dirty and practical as accounting.
You might rephrase your title (and question) to indicate that you are looking for a Financial/Accounting Library and not just a general math library. I know you mention IRR and MIRR, but if someone sees "Math Libraries" in the title, they will be thinking of a totally different kind of math. Hopefully someone who knows accounting will glance at your title and know the answer!
Edit:
This probably isn't quite what you're looking for, but QuantLib is ported to many different languages. Objective-C doesn't appear to be among them.
http://quantlib.org/index.shtml
https://stackoverflow.com/questions/1962057/are-there-any-bsd-or-lgpl-libraries-for-calculating-amortization-schedules

Related

Python to Objective C (Expected Learning Curve)

I'm a self-taught programmer who jumped into Python as my first language about 7-8 months ago. I'm fairly solid at making things work, though my foundational knowledge is limited thanks to my questionable choice in college to not study computer science.
Beyond Python, I'm not really familiar with C or other lower level languages.
I would like to teach myself Objective C as a foray into programming iPhone apps (as a hobby initially). I initially want to create relatively simple utility apps (I think they are relatively simple, at least).
Could any one give me a guess as to how long it might take me to pick up Objective C and actually produce a semi-decent app? If time is of the essence, should I just scrap it and go with HTML5?
I pick things up fairly fast but, again, my background in Comp Sci is really limited.
Sorry if this question is a bit too general and thanks for any insight!
You may take some time once you do not have experience with C. The "C way" is very important to understand Objective-C. You can learn Objective-C without C as well but you will find a lot of C pitfalls in your way.
Said that, I started a project in Objective-C some time ago after giving up Python with Cocoa. I find Objective-C pretty easy to learn - in one month I had made most of my application. I bet you will take a bit more of time because you are not used to C but it is not impossible to learn Objective-C in a relatively short time - let us say, two or three months.
If you have a very restrictive time, you may try HTML5, however. HTML5 uses JavaScript, whose semantics is closer to Python. At least you'll not get segmentation faults with HTML5 :) Also, JavaScript syntax is closer to C so it can be of a little help to learn Objective-C.
Anyway, I have found this great book, Become an XCoder, which seems to be focused on non-C programmers learning Objective-C. You can start by it.
I really can't tell you how long it will take you to produce a decent app, but I can definitely recommend Stanford's iOS Development class on iTunes U for learning Objective-C. Once you finished all lessons, you are pretty good to go for your first app. It is really good.
You should learn both, Objective-C and HTML5. HTML5 isn't very difficult to grasp even if you don't have any experience.
I had to learn objective-C a couple of months ago to make an app for an internship. I had experience with C/C++, and learning Obj-C wasn't difficult at all. What was difficult was learning to use the SDK. Granted, I had next to no experience with using something like it before, but it was a significant learning curve to get a handle on actually putting the app together using Apple's tools. If you're in the same boat, that's something that will probably add to the time it takes to produce a finished app. (I finished the app in about a month.)
I agree with other posters that there are some great Stanford tutorials on iTunes, but as a reference I found Kochan's Programming in Objective-C very valuable. He states in the intro that he does not expect prior C knowledge from readers, and doesn't think it's necessary -- might be a good book for your situation.
Depending on the complexity of the app you want to build, I think you could build something decent in a month or two.
Well when i started progamming for Objective-c i was well known in Java, but nothing close to C/Objective-c. It took me around 1 month to learn the basics (using tutorials etc).
There are some really good tutorials on iTunes (search for Objective-c seminar). I also used a couple of pdf's to use them as backup while making my first app. That helped alot!

Which language for my dissertation project? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 12 years ago.
Improve this question
I am doing my dissertation project on NP-Hard Problems: I am going to implement various algorithms for problems such as the partition, the subset sum, the knapsack, etc and then compare the results, the running time, etc. Also, I am going to see what happens with the algorithms when you modify the problem (how does the algorithm behave on the reduced problem, etc).
Now I picked this topic as my project because I am interested in theoretical computer science but I am also not sure if I want to go on as an academic/researcher or join a company/startup and this project has both a theoretical and a practical (actual coding) side.
My question is, which programming language should I use? Should I stick to what I feel more familiar with (Java and maybe Python), or should I go with the web languages (HTML, CSS, PHP, RoR, etc), having in mind that web development skills are on high demand nowadays?
EDIT: HTML and CSS would be obviously used just for the UI.
I want my project to be something that will impress in an interview (for either a job or a masters course) and I am not confident that "yet another project in Java" can do that. I understand that as long as the work on it is good and the result is satisfactory I should be ok but if, let's say, using Ruby can give me some points I am totally going with that. In the same time, I understand that deciding which language to use is part of the project so I am not willing to complicate things just to try and look cool.
Thanks in advance!
EDIT: In case this changes any of the answers, this is a undergrad. dissertation project, not a PhD one.
First of all this is a subjective question, not perfectly suitable for SO, but we forgive you :)
Contrary to popular opinion here (looking at the previous answers), if you're trying to solve NP-Hard problems, I would definitely not write the programs in C or C++. Mainly because dynamic programming methods tend to look like absolute dog poop when written in low-level languages. For example, here's someone's dynamic programming solution to the knapsack problem: http://www.joshuarobinson.net/docs/knapsack.html.
It's well-written and well-formed, but barely readable simply due to the sheer amount of malloc, memcpy, and free you need to do. Go with Java or Python, no question about it. You want people to actually read (and maybe even enjoy?) your dissertation, I would assume.
Don't write it in PHP or Ruby because those languages aren't particularly applicable to computer science theory. With that said, if you're applying for a web-dev job and you're trying to impress your future employees with a knapsack problem or dynamic programming NP-Hard solvers, it's like shooting a sparrow with a cannonball.
If your project's subject is impressive, no one will care what language it's in. Do it in the language you feel is appropriate for the task. Knowing how to make the appropriate language choice and defending that choice should be more impressive than "OMG I used RoR XSL ActionScript CSS!!!"
Also, how long do anticipate this project will take? If you go with a language that's flashy and trendy today, do you know it will still be cool and popular when this project wraps up? Just saying in another way, popularity is not the reason to choose the language for something like this.
if you can invest effort and time, then i recommend c/c++. it will be an impressive add-on skill.
My language of preference would be Python. You could use Django and, in my opinion, it would be very applicable to things that are being done in the industry (especially with startups). Plus, you can't beat Python when it comes to readability and speed of development.
I would have thought that Python would be doing too much clever stuff under the hood to really be able to measure relative performance accurately.
Wouldn't it be better to use a lower-level language like C? Employers would respect you more for that than using something because it's "cool".
The languages you know look fine to me. The old saw is that a CS PhD makes you unemployable anyway, so I wouldn't worry about it. :-)
The other ones you mentioned are mostly specialized web presentation languages. I'm not real sure how one even goes about implementing the knapsack problem using CSS...
Well, as much as this might look fine on the web page, it seems to me that Java would do a better job doing what you need.
PHP, HTML and CSS knowledge is good for job finding, but not applicable very much on the subject you picked.
Also, I noticed a bunch of answers, so I guess this is a question very much related to personal taste and opinion. Hm... You asked for it, anyways ;)
Since you're already familiar with Python, I'd recommend using it. You can use the popular scipy and numpy libraries for your project. You'll probably find something of use in them.
That would be the core, or backend part of your project. When this part is finished, you should think about polish and presentation. You don't want to have an impressive looking presentation with wrong calculations.

Are these really the steps I need to take to finally program for iPhone?

First I went and purchased:
Beginning iPhone Development: Exploring the iPhone SDK
And it said I should know Objective-C
Then I went and purchased Learn Objective–C on the Mac by Mark Dalrymple, Scott Knaster
And it said I should know C
then now I'm at the beginning with Learn C on the Mac by Dave Mark
So this is the long journey I need to take to finally start producing actually GOOD apps for the iPhone
C > OBJECTIVE-C > APPS?
Nah, forget learning C, just go straight to Objective-C. My humble opinion.
If the Learn Objective C book assumes you know C then is it likely to not go into the code in as much detail as you need, making it more difficult for you. However you don't need to learn all of C, or even a lot, so working through a book will take some time.
Better, as silky says, jump straight into Objective-C, and when you struggle just come to SO
If you're a complete beginning to computer programming, I might get some information about programming in general before going to Objective-C; it's an easy language, but it would help to general programming constructs (like if statements, etc) and how they work before you learn how Objective-C does it.
I would think that you WOULD want to learn C first. Most objective-c books are going to presume that you know the difference between pointers and values, that you know basic looping and control statements, and that you understand arrays, structs, and functions.
Contrary to some other advice, unless an objective-c book you buy specifically starts from zero and makes that claim, I WOULDN'T just jump in. People will say that objective-c is easy, but that's not necessarily true, since with compiled languages (unlike interpreted ones where speed doesn't matter so the runtime can hide complexity via abstraction) the devil is in the details.
If you read an objective C book and you don't know what the "*" is for in front of a variable, start with C. My two cents.

Frameworks & Doneworks: Do you thinks it is cool to use those?

By using somebody else's works you advertize the authors of those works (At least, among other programmers). Do you think it is cool?
This line of questioning could go up one more level and become "Programming Languages: Do you think it's cool to use those?" Because someone(s) wrote those too. I can continue this up to the types of computers, to the components, etc...
Monet did not make the brushes or the paint or the canvas (well maybe, not sure). But who creates those building blocks is not quite what stands out at the end.
Languages/Frameworks/etc were built and released to be utilized by the masses (or make money for the creators).
I think it's always cool. Be more efficient, reduce redundancy, promote other useful code.
If you're trying to learn though, reading and understanding the framework you're using is very helpful. There are always other things you can be programming and learning, not necessarily reinventing the wheel.
If using their work has saved you time reimplementing the same thing (but with more bugs) then don't they deserve credit?
Or put another way, stealing other peoples' work without credit (or paying them, depending on whether we're talking about free or commercial software here) isn't cool.
Of course, nobody's stopping you from writing your own framework, if that's what you want to do...
It depends on what kind of programming you're doing.
Are you doing it to achieve a finished program? Then a framework could save you a lot of time.
Are you doing it to create something truly original? Then a framework might simply tie you into an existing way of thinking.
Rembrandt made his own paints. Michelangelo selected his own marble from the quarry. Alan Kay said "People who are really serious about software should make their own hardware". The Excel team famously has their own compiler. The iPhone ain't just an alternate firmware for the Blackberry. ISTM if you want to be at the very top of your game, you've got to get down and dirty with the nitty gritty of it.
I don't know anything about advertising, other programmers, or what's "cool", so I can't respond to those parts of your question.

Do Poor Code Samples Turn You Away From Libraries?

I've been evaluating a framework that on paper looks great. The problem is that the sample code is incomplete and of poor quality. The supplied reference implementations are for the most part not meant to be used (so they can be considered as sample code as well) and have only succeeded at confusing me.
I know that it's common for things to look better on paper, but my experience with the sample code is turning me away from further investigation.
Do you let poor code samples change your judgment of frameworks/libraries? So far my experience has been similar to the "resume effect": if someone doesn't put the effort into spell checking their resume, they probably won't get the job...
For me, it does. I tend to want to avoid libraries where the code samples are incomplete. If the library is open source, I will overlook it, since I can directly look at the code and see if the library's internals are reasonable, and I know that, if there is a problem someday, I could (if I had to) fix it.
If the library is commercial, and their samples and/or documentation is poor, I look elsewhere. I just see it as risk management - poor samples make me fear the quality of the library in general.
No matter how good something is on paper or in theory, it can still be crap when programmed.
I think this is a valid reason to turn away from and evaluate other libraries. As a potential user of a library a lack of documentation and/or bad code samples gives the impression that the library is not yet mature enough for use by third parties. In time it may well gain the missing pieces but until then I think its reasonable to look elsewhere.
I was recently evaluating the multitude of blogging applications that people have uploaded to github.com I quickly skipped ones that no documentation as they obviously weren't ready for others to use. The ones that remained at the end had a good README with info on how to get the app up and running as well as an online example of the code running.
Poor code samples combined with poor documentation will make me turn away from a library unless there is a compelling reason to use it. However, a library that has either good code samples or good documentation is usually worth using. (Assuming that the library itself otherwise meets my needs.)
If I can't find good examples (and/or documentation) illustrating how to use the library, I'm definitely less likely to use it - just as a practical matter, it'll be harder for me to figure out how. But I don't care what the code that implements the library itself looks like. I don't think I'd choose one library/framework over another just because the developers of the one have shown an ability to write cleaner code (which is what I understand the "resume effect" to mean).
Lack of documentation and examples makes me a whole lot less likely to use that particular library. It's not worth my time testing and trying to figure out how a black box works if there are alternate solutions to the problem out there.
Yes, definitely. Every library should come with a simple example using program and a CLI interface (for very simple libraries with <3 methods and <10 hooks, one example should suffice).
And why does your framework "look great" if it's so hard to use that even the original coders make mistakes using it?
It certainly matters to me. Evidence of sloppy/incomplete coding and poor communication decreases my confidence that the actual implementation code is stable and robust.
Myself yes, but there must be people out there who aren't turned off by this otherwise there are plenty of open source projects that would have died a long long time ago.