View Full Version : Cocoa + VB coders -> Please read!
mmmdreg
Apr 27, 2004, 07:32 AM
To my gratitude, robbieduncan lent his time creating a piece (of a piece) of a software application that works flawlessly. Unfortunately, the software is in VB and the piece of it is cocoa'ed. With the countless thousands of members on the MR boards, surely there is someone who is competant enough (unlike yours truly) to translate the code from one to the other.
So I appeal to your generosity. The original code is hosted here (http://homepage.mac.com/robbieduncan/.cv/robbieduncan/Public/schedule.tar.gz-link.gz). A thread outlining what it does is here (http://forums.macrumors.com/showthread.php?t=67902).
robbieduncan
Apr 27, 2004, 09:09 AM
If it helps anyone (mmm included) I can easily re-code/translate this into Java tonight. (more people are likely to know Java than Obj-C so the chance of match are better).
cait-sith
Apr 27, 2004, 10:12 AM
its been a few years but i do know objective c.
ExoticFish
Apr 27, 2004, 10:19 AM
do you have the VB code as well that i can look at?
robbieduncan
Apr 27, 2004, 10:55 AM
There is no VB code. I do not write VB. I wrote the code as an example in Cocoa/Obj-C hoping that it would be possible for someone else (in this case mmmdreg) to use the ideas in it to write it in whatever language they wanted. This thread is to try and find someone who can turn the Cocoa into VB.
ExoticFish
Apr 27, 2004, 11:49 AM
gotcha. do you want it in VB or do you want it in something like RB (RealBasic) so it could be used cross platform?
robbieduncan
Apr 27, 2004, 03:48 PM
Personally: I don't care! It's not for me though. I think mmmdreg wants VB, but a RealBasic solution would be closer than we are. Basically I can write almost anything apart from VB! The last Basic I used was Acorn Basic on an A3000.
mmmdreg
Apr 27, 2004, 08:41 PM
gotcha. do you want it in VB or do you want it in something like RB (RealBasic) so it could be used cross platform?
VB would be great. I don't know how similar RB is to it but it would be a step in the right direction though. If you can do it, it'll be awesome!
mmmdreg
Apr 29, 2004, 09:19 AM
It's seemed to have gone quiet.. any progress?
ExoticFish
Apr 29, 2004, 10:47 AM
i haven't had any time to look at it. i might get some time today but i'm not promising anything... a couple people are out of town and i'm the only person in the IT department this week... things are a bit hecktic! :rolleyes:
robbieduncan
May 1, 2004, 05:28 AM
OK, just in case this is better for someone to translate to VB here is the Java version: Java Schedule (http://homepage.mac.com/robbieduncan/.cv/robbieduncan/Public/Schedule_Java.tar.gz-link.gz)
I would like to point out a general problem (which I think I brought up at the start of this whole thing). The java version may be slightly worse than the Obj-C version in this respect but both will struggle to do this for any realistic amount of subjects. On my PowerBook (768Mb of RAM) the Java version claims to run out of memory with more than 5 subjects! I know you can increase the Java stack size to get round this for a bit but it will happen pretty quickly.
To do this for real you need to get clever! Either remove possible solutions early or use a better solution (genetic algorithm).
mmmdreg
May 1, 2004, 09:54 AM
I guess you could compare it to the student file after every combination and if it's not a decent bunch of clashes then get it scrapped.. or won't that fix anything? Saying it does work, it'll make the algo a bit slower sure, but in the end it should work better! Also, when a realistic amount of subjects are there, combinations where all the columns aren't utilised etc. could be scrapped as soon as they're made..
robbieduncan
May 1, 2004, 10:04 AM
That's exactly what I meant by remove possible solutions early. Note that this means you cannot be guaranteed the "best" possible solution. A solution that looks really bad relative to the others after adding some of the subjects may actually be better than the others once all the remaining subjects are added. How many subjects are we going to be talking about here?
robbieduncan
May 1, 2004, 03:30 PM
OK for anyone sticking with this here is a better version! Good Cocoa Version (http://homepage.mac.com/robbieduncan/.cv/robbieduncan/Public/schedule_best.tar.gz-link.gz). This one has vastly reduced memory consumption by using our own linked list class to allow reuse of the partial solutions and early dropping of solutions that look bad. Still not going to work for hundreds of subjects but can permute 10 subjects on my PowerBook in 12 seconds. Not too bad.
mmmdreg
May 17, 2004, 04:35 AM
I did it! But I used a totally different way that didn't involve recursion.. instead of solving it in memory and displaying the graphics later, I solved it graphically and I *will* record the results later..
the beeautiful code, nice and simple, is attached!
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.