Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 66 67 [68] 69 70 ... 796

Author Topic: if self.isCoder(): post() #Programming Thread  (Read 903514 times)

Stargrasper

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1005 on: January 28, 2012, 11:27:23 am »

Fuck IE. Every other browser bumps my page footer down when I un display:none the recaptcha box.

IE doesn't just ignore the standards...it spits on them, insults their mothers, and kicks their puppies.  It'd be really nice if Microsoft didn't feel that it could ignore and otherwise redefine the standards simply by virtue shipping a browser with it's OS that people are crazy enough to actually use.  Seriously, why is IE so uncompliant with standards?  Is Microsoft actually trying to make it's own standards the internet's standards?
Logged

Xegeth

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1006 on: January 28, 2012, 11:41:42 am »

Yes, they are. In an antitrust trail, it was found that they actually used the phrase "embrace, extend and extinguish" to describe their tactics.
Logged

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1007 on: January 28, 2012, 10:20:52 pm »

Well, we almost dropped off page one... Can't have that! Time for a lesson, or depending on how I feel afterwards, two.
First up, will the C# students come to the front of the class, and grab one of these freshly cut cigars, then take a deep puff and blow smoke in the face of the Java student to your left. Today we are going to do something Java can't do! Well it has a work around, but we will do that another day.

Now we can pass a lot of things around as types; primitives, enums, structs black magic, objects... But we can also pass around methods! We do this using a thing called a Delegate. They have a return type, a name and parameters, observe.

Spoiler (click to show/hide)
So as you can see, we start with 'delegate', this declares a new delegate in the same way you use the 'class' keyword to make a new class.  Next we have the return type, in this case void, but you can use anything. Then the name of the delegate: While classes are ideally named after singular common nouns, and methods are named after verbs, delegates should be named after events. For example, OnUpdate, KeyPressedDown, OnDeath, OnSunrise ect... Just like a lot of methods start with 'get' or 'set', most delegated end up starting with 'on'. Finally, we have the parameters, once again, anything you need.
Now, the return type + the parameters determine the signature of the delegate. Only methods with the same signature can fit into a delegate, just as if you have a car class, and a person class, you can't fit a person into a car variable.

Now just like when you make a class you still need to use it somewhere, the same is said for delegates! So let's add one to our short little program.

Spoiler (click to show/hide)
There! Just like making a new object! But wait, red lines, things are bad! We can't just make a new delegate without feeding it a method to run. It needs to know what you want it to do. Well we don't have any yet, so let's make a quick little method for it to run.
Spoiler (click to show/hide)
Add that to your program class. Now over in your main, change that line to this.
Spoiler (click to show/hide)
Notice that we didn't add any parentheses after the name of the method? That is because we don't want it to run, we just want to pass it in. You use parentheses after a method when you want to invoke it. Now let's flesh out the main a little more and try it out!
Spoiler (click to show/hide)
Run that, and check it out! You are running a method without having to reference to that method! Cool as! But sad to say I'm sort of running low on time here, and there is more to show off. I'll come back some time to finish up, but just play around with that, find out what you can and can not do. Protip: A lot more than you can do than you can't.

Stargrasper

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1008 on: January 28, 2012, 10:47:00 pm »

Fuck IE. Every other browser bumps my page footer down when I un display:none the recaptcha box.

IE doesn't just ignore the standards...it spits on them, insults their mothers, and kicks their puppies.  It'd be really nice if Microsoft didn't feel that it could ignore and otherwise redefine the standards simply by virtue shipping a browser with it's OS that people are crazy enough to actually use.  Seriously, why is IE so uncompliant with standards?  Is Microsoft actually trying to make it's own standards the internet's standards?

In other news, Microsoft managed to f over my computer.  It was having trouble loading Mint.  It refused to load Fedora.  It refused to load Windows 7.  It refused to load Windows 7 Safe Mode, it refused to load the Windows 7 Recovery partition (it's job is to save me from this exact situation), it refused to load the Mint Recovery Mode for no clearly apparent reason.  It failed to load the Windows 7 Installation Disk.  It finally (and is currently using) a copy of Mint I thankfully happened to have on one of my usb keys.  I am presently rescuing files.  I was smart enough that almost all of the important data was already backed up, but I need to grab what isn't and figure out what the hell I'm going to do since apparently just putting in the Windows 7 Installation Disk was enough to kill GRUB...or more accurately, my partition table.  Does anyone here know enough about GRUB programming to rebuild the partition table from GRUB rescue mode or to just make it load the Mint partition so I can rebuild the partition table from there?

More on topic and less ranty, I'm not going to be in a situation where I can continue writing tutorials until I fix this computer.  That may be tomorrow or it may be never depending on whether it's software or hardware that's malfunctioning.  I'll try to keep an eye on my PMs and this thread where possible, but I'm going to be in a limited position there.  Sorry for the two or three of you that care. :P
Logged

MaximumZero

  • Bay Watcher
  • Stare into the abyss.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1009 on: January 28, 2012, 10:49:59 pm »

{
 lesson
}

I...actually understood that. Holy crap, that's a good feeling. TYVM, Max. ^_^
Logged
  
Holy crap, why did I not start watching One Punch Man earlier? This is the best thing.
probably figured an autobiography wouldn't be interesting

Mego

  • Bay Watcher
  • [PREFSTRING:MADNESS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1010 on: January 28, 2012, 11:51:28 pm »

@Stargrasper, http://community.linuxmint.com/tutorial/view/245.

@Max White: Cool, function pointers implemented safely! I think I am going to learn C# at some point, despite hating Microsoft.

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1011 on: January 28, 2012, 11:59:46 pm »

I really don't get what is with the Microsoft hate. What did they do to inspire the rage of a thousand Linux users? Seriously, they gave me a quick and safe language to work in, and a kick ass IDE to use, and even a games library that can be ported over to XBox, so if I ever wanted to join the console wars I have an easy point of entry. You can't even say Billy Gates is evil, when he has made a full time job out of giving away money, and convincing others to do the same. If I want to develop on a platform quickly and appeal to a mass audience, would you prefer Microsoft or Apple? Seriously, not a hard choice at all...


On the other hand, we could be dealing with smart phones, and then it comes down to Google or Apple, and seriously, Google. What more need be said? They are Google.

Sirus

  • Bay Watcher
  • Resident trucker/goddess/ex-president.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1012 on: January 29, 2012, 12:01:15 am »

To me, Google hate is just as irrational as Microsoft hate. I just use whatever is at hand.
Logged
Quote from: Max White
And lo! Sirus did drive his mighty party truck unto Vegas, and it was good.

Star Wars: Age of Rebellion OOC Thread

Shadow of the Demon Lord - OOC Thread - IC Thread

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1013 on: January 29, 2012, 12:03:33 am »

No, Microsoft hate is more rational than Google hate. Still pretty irrational, but hating Google is like if god came down, gave you an unlimited supply of cookies in every flavour ever and they never made you fat, and then you hate him for it. And in exchange he kept data on what type of cookies you ate most.

Stargrasper

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1014 on: January 29, 2012, 12:06:51 am »

The Microsoft hate, at least from Linux users, comes from that fact that Microsoft plays very, very poorly with others.

Also, thank you Mego for the grub documentation.  I haven't the slightest idea why I didn't find that in my earlier searches.  Chances are I'm just an idiot, but that's nothing new.  Here's hoping I can get something to work on the machine...
Logged

Sirus

  • Bay Watcher
  • Resident trucker/goddess/ex-president.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1015 on: January 29, 2012, 12:07:16 am »

You know, that analogy really sounds good to me. If you were attempting to make me fear Google, you should try again  :P

All I know is that some people hate certain things with a passion, and it's rarely fully justified.
Logged
Quote from: Max White
And lo! Sirus did drive his mighty party truck unto Vegas, and it was good.

Star Wars: Age of Rebellion OOC Thread

Shadow of the Demon Lord - OOC Thread - IC Thread

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1016 on: January 29, 2012, 12:11:24 am »

The Microsoft hate, at least from Linux users, comes from that fact that Microsoft plays very, very poorly with others.
Still more sociable than Apple.

You know, that analogy really sounds good to me. If you were attempting to make me fear Google, you should try again  :P

All I know is that some people hate certain things with a passion, and it's rarely fully justified.
No, I don't think you get it, I love Google. Fuck, I'm a bigger google fanboy than Microsoft!

Willfor

  • Bay Watcher
  • The great magmaman adventurer. I do it for hugs.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1017 on: January 29, 2012, 12:15:13 am »

All big tech companies are evil. Linux will be evil within our lifetimes, regardless of how you see it now. You may not even see how it could become evil, but trust me, there are ways.

Thus, use what you want to work with, because there is no way to escape evil.
Logged
In the wells of livestock vans with shells and garden sands /
Iron mixed with oxygen as per the laws of chemistry and chance /
A shape was roughly human, it was only roughly human /
Apparition eyes / Apparition eyes / Knock, apparition, knock / Eyes, apparition eyes /

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1018 on: January 29, 2012, 12:17:25 am »

That is because they inherit this property from the fact that all big companies are evil. As far as big companies go, tech companies aren't so bad.
Put tech companies next to chain super markets, or god forbid the media, and they are saints.

Stargrasper

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #1019 on: January 29, 2012, 12:18:09 am »

The Microsoft hate, at least from Linux users, comes from that fact that Microsoft plays very, very poorly with others.
Still more sociable than Apple.

It's up in the air...Apple will usually play with others if you prod it enough...Microsoft is known for overwriting others without asking and refusing to talk to others.

Perhaps scratch that whole "fix grub and half my problems go away" thing...the machine is so fucked that gparted says that the partitions that are supposed to contain Mint and Fedora are unallocated space...no wonder my partition table broke...um...I wonder just how fucked I am and whether or not those partitions still exist...and also what the hell caused this...

So...what causes partitions to cease to exist...?  And can I make them spontaneously exist again...?
Logged
Pages: 1 ... 66 67 [68] 69 70 ... 796