Let's get programmy!

If you have some randomness to share that you can't post elsewhere, this is the place to do it.
Post Reply

Is Assembly the best programming language?

Yes
3
9%
Oh God my eyes
3
9%
Oh God my brain
12
38%
I perform unholy incantations to keep Assembly at bay
4
13%
Real men write binaries by hand
10
31%
 
Total votes: 32
User avatar
ConansSideWalk
Trying To Take Over The World!

Posts:
39

Re: Let's get programmy!

Post by ConansSideWalk »

This is now the tech support thread!
ImageImage
Representing The Place I Love For The People Who Inhabit It. SOS団 Forever
User avatar
Kirbypepe
Wonder what I'll turn into =D

Posts:
135
Contact:

Re: Let's get programmy!

Post by Kirbypepe »

Since when?
Howdy Everyone=]

Things are fantastic. How about for you?

Thats cool.

Wait I just realized, who am I talking to????
User avatar
ConansSideWalk
Trying To Take Over The World!

Posts:
39

Re: Let's get programmy!

Post by ConansSideWalk »

since never pepe since never
ImageImage
Representing The Place I Love For The People Who Inhabit It. SOS団 Forever
Akonyl
Community Hero

Posts:
4200

Re: Let's get programmy!

Post by Akonyl »

if you ask me for tech support I'm just gonna try to get you to wipe your hard drive. :V
User avatar
ConansSideWalk
Trying To Take Over The World!

Posts:
39

Re: Let's get programmy!

Post by ConansSideWalk »

It's ok I don't need it though I expect in the future some people will ask. xD These videos came to mind. http://www.youtube.com/watch?v=YqL95vk_5Ps http://www.youtube.com/watch?v=dlHcqSxy-ZE
ImageImage
Representing The Place I Love For The People Who Inhabit It. SOS団 Forever
ranger
Community Villain

Posts:
3588

Re: Let's get programmy!

Post by ranger »

hmmm try restarting the computer...or open up yo control panel dawg
Image
Image
User avatar
aly_angelflight
Get that squirrel!

Posts:
577

Re: Let's get programmy!

Post by aly_angelflight »

Or better yet, make sure it's plugged in and turned on. :x
Image
"I suppose he could have changed. I myself have noticed my growing resemblance to a daffodil.”
3DS Friend Code: 2723-9258-9521
Abs.
DCTP Staff Hero

Posts:
3270

Re: Let's get programmy!

Post by Abs. »

aly_angelflight wrote: Or better yet, make sure it's plugged in and turned on. :x
Not just the monitor, too. :-X
Your opinion is always requested in Abs.' Random Polls of Whenever
User avatar
Kirbypepe
Wonder what I'll turn into =D

Posts:
135
Contact:

Re: Let's get programmy!

Post by Kirbypepe »

"Have you tried turning it off and on again?" =P
Howdy Everyone=]

Things are fantastic. How about for you?

Thats cool.

Wait I just realized, who am I talking to????
Akonyl
Community Hero

Posts:
4200

Re: Let's get programmy!

Post by Akonyl »

saw someone write an awesome program to help you calculate how much to tip a waiter at a restaurant
Spoiler:
int main(){
return 0;
}
Spoiler:
not that I don't tip at restaurants but it was still funny to me :V
User avatar
Kirbypepe
Wonder what I'll turn into =D

Posts:
135
Contact:

Re: Let's get programmy!

Post by Kirbypepe »

Akonyl wrote: saw someone write an awesome program to help you calculate how much to tip a waiter at a restaurant
Spoiler:
int main(){
return 0;
}
Spoiler:
not that I don't tip at restaurants but it was still funny to me :V

XD that is sooooo hilarious. Best program ever =P

and I'm in the same boat as you akonyl
Howdy Everyone=]

Things are fantastic. How about for you?

Thats cool.

Wait I just realized, who am I talking to????
User avatar
Callid
Ratio vincit omnia.

Posts:
1433

Re: Let's get programmy!

Post by Callid »

Hmm, I've been wondering for a while - is it possible (in Java) to call a function by its name? I.e. I have somehow generated a String, which is the name of a function, and now I want to call the function using that String. Of course, I could do that by something like:

Code: Select all

// s is generated String
if (s.equals("myfucntion1")) { myfunction1(); }
   else if (s.equals("myfucntion2")) { myfunction2(); }
      else if (s.equals("myfucntion3")) { myfunction3(); }
         else if (s.equals("myfucntion4")) { myfunction4(); }
            else if (s.equals("myfucntion5")) { myfunction5(); }
            // and so on
However, this will get quite impractical with a high number of functions. I'd want something like this:

Code: Select all

public boolean callFunction (String s) {
   // calls the function with a name equivalent to the String. If it doesn't exist, does not call any function and returns false, else true.
} 
Of course, having references to functions would be even better, but I doubt something like this exists :-X
If  ;), :D, ;D, ::), :P, :-X, :o or >:D are attached, that paragraph may not be 100% serious. Seriously.
This link provides further information.
Callid Conia Pact - Petitions - Archive
Akonyl
Community Hero

Posts:
4200

Re: Let's get programmy!

Post by Akonyl »

to call a function while using its name as a string, look up Reflection. I can't tell you how the java syntax goes as I've ever only used C# reflection to call functions, so you're on your own there :P

As for function pointers, those certainly do exist in C# and C++, but not in Java. If you want to emulate them, you'll have to do something like is discussed on this stackoverflow page, where you make a generic 1-function interface that has an "execute" command which you define elsewhere to do whatever it is you want.
ranger
Community Villain

Posts:
3588

Re: Let's get programmy!

Post by ranger »

arrgg I hate your coding style Callid, hurts my eyes to read your if loops
Image
Image
User avatar
Callid
Ratio vincit omnia.

Posts:
1433

Re: Let's get programmy!

Post by Callid »

ranger wrote: arrgg I hate your coding style Callid, hurts my eyes to read your if loops
Don't worry, I'd never write something like that :P
After all, this is exactly why I'm asking XD
If  ;), :D, ;D, ::), :P, :-X, :o or >:D are attached, that paragraph may not be 100% serious. Seriously.
This link provides further information.
Callid Conia Pact - Petitions - Archive
Post Reply