Cocoa + VB coders -> Please read!

Discussion in 'Mac Apps and Mac App Store' started by mmmdreg, Apr 27, 2004.

  1. mmmdreg macrumors 65816

    mmmdreg

    Joined:
    Apr 14, 2002
    Location:
    Sydney, Australia
    #1
    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. A thread outlining what it does is here.
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    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).
     
  3. cait-sith macrumors regular

    Joined:
    Apr 6, 2004
    Location:
    canada
    #3
    its been a few years but i do know objective c.
     
  4. ExoticFish macrumors 6502a

    ExoticFish

    Joined:
    Dec 3, 2002
    Location:
    The inner depths of madness, aka Kent, OH
    #4
    do you have the VB code as well that i can look at?
     
  5. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #5
    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.
     
  6. ExoticFish macrumors 6502a

    ExoticFish

    Joined:
    Dec 3, 2002
    Location:
    The inner depths of madness, aka Kent, OH
    #6
    gotcha. do you want it in VB or do you want it in something like RB (RealBasic) so it could be used cross platform?
     
  7. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #7
    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.
     
  8. mmmdreg thread starter macrumors 65816

    mmmdreg

    Joined:
    Apr 14, 2002
    Location:
    Sydney, Australia
    #8
    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!
     
  9. mmmdreg thread starter macrumors 65816

    mmmdreg

    Joined:
    Apr 14, 2002
    Location:
    Sydney, Australia
    #9
    It's seemed to have gone quiet.. any progress?
     
  10. ExoticFish macrumors 6502a

    ExoticFish

    Joined:
    Dec 3, 2002
    Location:
    The inner depths of madness, aka Kent, OH
    #10
    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:
     
  11. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #11
    OK, just in case this is better for someone to translate to VB here is the Java version: Java Schedule

    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).
     
  12. mmmdreg thread starter macrumors 65816

    mmmdreg

    Joined:
    Apr 14, 2002
    Location:
    Sydney, Australia
    #12
    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..
     
  13. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #13
    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?
     
  14. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #14
    OK for anyone sticking with this here is a better version! Good Cocoa Version. 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.
     
  15. mmmdreg thread starter macrumors 65816

    mmmdreg

    Joined:
    Apr 14, 2002
    Location:
    Sydney, Australia
    #15
    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!
     

    Attached Files:

Share This Page