Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 325 326 [327] 328 329 ... 796

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

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4890 on: September 10, 2013, 01:52:52 pm »

Indeed, since its output is needed to index into cellGrid, it will always be called first.  What is not defined behavior is the order of evaluation of arguments to a function.  So if you had code like this:

Code: [Select]
some_function(function1(), function2(get_argument()))

get_argument will always be called before function2, but you have no way of knowing whether function1 or function2 will be called first.  I don't think it's even defined behavior whether get_argument will be called before function1.
Logged
Through pain, I find wisdom.

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #4891 on: September 12, 2013, 10:06:20 am »



Biology stuff is so interesting The first genetic drift thing happens because it satisfies all the conditions for genetic drift, especially a small population size (only 500 members), random mating and no gene flow.

I just made the simulation insert a random creature every turn, and there
s no noticeable fixation yet.
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

gigaraptor487

  • Bay Watcher
  • Escaped Lunatic now civilised
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4892 on: September 13, 2013, 09:21:15 am »

Hello guys,

I have just done about a year of c and about the same of python and done about a dozen odd projects and i wondered where i should go next because i want to write operating systems. So i read a basic 8086(not i386) assembly tutorial but it seemed not to have taught me much past general purpose registers and segmented real mode memory address (segment:offset). What i wanted to know is a few things:

-Where can i find a comprehensive x86 Assembly pdf or tutorial for either windows or cygwin?(my linux box is in the same                          room as the xbox and the sounds of call of duty are really annoying)

-Would it be a better idea to read the intel handbooks on the subject in lieu to a tutorial?(i don't know whether standard intel syntax is more applicable to GAS or NASM)
           
-Where can i find free books or documents apart from osdev.org on the subject?

Thanks

Logged
Hehe, you thought there would be an interesting sig here

I now run a program which brings old multiplayer games back to life : click

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4893 on: September 13, 2013, 09:52:32 am »

Back when I was still interested in OS development, I got 99% of my information from osdev.org.  I don't remember there really being any other decent quality sources.

For your other questions: I'd recommend definitely starting with tutorials, probably from osdev.org, over just diving into Intel's manuals.  They're thousands of pages long from what I recall and don't tell you many of the intricacies of anything beyond what the assembly instructions do.  Tutorials will tell you a lot more about what needs to be done, especially in regards to things like using the BIOS for initial low level setup.  There were a lot of tutorials on writing boot loaders at least, and they were enough for me to figure out x86 assembly well enough to get one working in Bochs.  I did have prior experience with MIPS assembly, but if you know anything about x86 assembly languages it would probably be easy enough.
Logged
Through pain, I find wisdom.

gigaraptor487

  • Bay Watcher
  • Escaped Lunatic now civilised
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4894 on: September 13, 2013, 02:09:33 pm »

Thanks Telgin, i shall.  :)
Logged
Hehe, you thought there would be an interesting sig here

I now run a program which brings old multiplayer games back to life : click

Mephisto

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4895 on: September 13, 2013, 08:21:08 pm »

Thanks, Fox News, I needed a laugh this week.

Explanation of GitHub for morons by morons

That's a surprisingly good description, given how the media portrayed Sergey Aleynikov. Yes, it's called subversion. That doesn't mean it's subversive.
Logged

MorleyDev

  • Bay Watcher
  • "It is not enough for it to just work."
    • View Profile
    • MorleyDev
Re: if self.isCoder(): post() #Programming Thread
« Reply #4896 on: September 14, 2013, 08:51:02 am »

..."reposotory"...wow 0_o

Anyhoo: Visual Studio 2013 (VS12) RC has been released. It's actually...pretty neat.

They finally have full cmath support (no longer will I see warnings over doing value != value when checking for NaN in UnitTest11), and fixed a few annoying bugs. It also means multiple category support for Visual Studio is in and all my tests are green.

Of course other annoying bugs are still there (Note to Microsoft: Fix your Variadic Macros!).

As a side note I'm thinking of throwing together a simple ReST API to allow me to update the build status of my projects on my website for Windows. Travis CI takes care of this on Linux, but whilst *I* know they're green since it's a managed by my localhost jenkins instance, I need some way to let the rest of the world know without spending $20 a month renting a server...
« Last Edit: September 14, 2013, 08:53:33 am by MorleyDev »
Logged

Dutchling

  • Bay Watcher
  • Ridin' with Biden
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4897 on: September 14, 2013, 09:04:31 am »

Thanks, Fox News, I needed a laugh this week.

Explanation of GitHub for morons by morons

That's a surprisingly good description, given how the media portrayed Sergey Aleynikov. Yes, it's called subversion. That doesn't mean it's subversive.
Thy understand it better than I do. Github is magic to me.
Logged

MrWillsauce

  • Bay Watcher
  • Has an ass that won't quit
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4898 on: September 14, 2013, 09:41:18 am »

In C++, can I use structs as part of a class? Also, can a function return std::string strings?
« Last Edit: September 14, 2013, 10:11:30 am by MrWillsauce »
Logged

Siquo

  • Bay Watcher
  • Procedurally generated
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4899 on: September 14, 2013, 10:14:20 am »

In C++, can I use structs as part of a class? Also, can a function return std::string strings?
Structs are the exact same things as classes, except that every member/method is public by default, so yes.

And yes, a function can return any object (including std::string).
Logged

This one thread is mine. MIIIIINE!!! And it will remain a happy, friendly, encouraging place, whether you lot like it or not. 
will rena,eme sique to sique sxds-- siquo if sucessufil
(cant spel siqou a. every speling looks wroing (hate this))

MrWillsauce

  • Bay Watcher
  • Has an ass that won't quit
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4900 on: September 14, 2013, 10:17:31 am »

Okay thank you. Is there some sort of Bay12 (or other) programming IRC that I can go to to talk to programming people? Asking for help in a forum thread and waiting for an answer is not ideal (although people do respond quite quickly).
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #4901 on: September 14, 2013, 10:20:56 am »

I hang around #bay12lb @ irc.darkmyst.net most nights. Does that count? A bunch of other programmy people hang out there too.
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

MrWillsauce

  • Bay Watcher
  • Has an ass that won't quit
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4902 on: September 14, 2013, 02:07:26 pm »

How do I make a loop in C++ where a condition is that two strings are equal or unequal?
Logged

cerapa

  • Bay Watcher
  • It wont bite....unless you are the sun.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4903 on: September 14, 2013, 02:23:14 pm »

How do I make a loop in C++ where a condition is that two strings are equal or unequal?
The usual == and != work just fine with strings.
Logged

Tick, tick, tick the time goes by,
tick, tick, tick the clock blows up.

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #4904 on: September 14, 2013, 03:33:53 pm »

Just to clarify, that's if you use the string class.  If you're using C style strings which are just character arrays, you should use the strcmp standard library function instead.

So, assuming you're not using C style strings and are using a while loop, something like this:

Code: [Select]
// Initialize these however you want
string first;
string second;

while (first != second) {
    // Do something
}

I'd highly advise using the string classes over raw character arrays wherever possible.
Logged
Through pain, I find wisdom.
Pages: 1 ... 325 326 [327] 328 329 ... 796