Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 593 594 [595] 596 597 ... 796

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

i2amroy

  • Bay Watcher
  • Cats, ruling the world one dwarf at a time
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8910 on: February 02, 2016, 04:39:57 pm »

I am failing to understand a bit of found code that takes the aspect ratio and area of a rectangle and returns the width and height. I wondered if anyone else might be able to explain. I suspect this is a basic maths fail on my part.

Spoiler (click to show/hide)
Think of it this way:
x = smaller side
a*x = a (ratio) * smaller side = larger side
(a*x)*(x) = larger side * smaller side = area
a*x^2 = area
x^2 = area / a
x = sqrt(area / a)
Therefore:
smaller side = sqrt(area / ratio)
larger side = ratio * smaller side OR larger side = area / smaller side     (The two are functionally equivalent in the amount of processing they do, one just risks decimal rounding error and the other integer overflow).
Logged
Quote from: PTTG
It would be brutally difficult and probably won't work. In other words, it's absolutely dwarven!
Cataclysm: Dark Days Ahead - A fun zombie survival rougelike that I'm dev-ing for.

Vattic

  • Bay Watcher
  • bibo ergo sum
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8911 on: February 02, 2016, 05:00:51 pm »

Well explained i2amroy many thanks, and to you too TheBiggerFish for the hint. Crossed fingers this message will get through the gateway errors.
Logged
6 out of 7 dwarves aren't Happy.
How To Generate Small Islands

TheBiggerFish

  • Bay Watcher
  • Somewhere around here.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8912 on: February 02, 2016, 05:23:32 pm »

It worked.
Logged
Sigtext

It has been determined that Trump is an average unladen swallow travelling northbound at his maximum sustainable speed of -3 Obama-cubits per second in the middle of a class 3 hurricane.

Malus

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8913 on: February 03, 2016, 01:12:16 pm »

I've been dabbling around a bit with live code editing while I learn OpenGL. Basically, you have all of your main code built into a .dll, and then you have a helper executable that loads that .dll and calls it, reloading it if it changes. The result is pretty neat. Kind of makes scripting languages feel weak in comparison... I was going to implement some kind of lua but I don't think it'll be necessary now.

Logged

Mephisto

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8914 on: February 03, 2016, 02:00:20 pm »

Kind of makes scripting languages feel weak in comparison...

Heh.
Logged

cerapa

  • Bay Watcher
  • It wont bite....unless you are the sun.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8915 on: February 03, 2016, 03:42:14 pm »

Intellisense is officially the dumbest piece of crap ever devised by mankind.

It complained about the line "int SecondFaction;", which you might correctly deduce has no error and is literally just a goddamn int.

Being forced to use Visual Studio for writing C++ code for Unreal 4 is so goddamn annoying.

EDIT:

i is indeed unidentified you fucking idiot.
« Last Edit: February 03, 2016, 03:56:02 pm by cerapa »
Logged

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

Levi

  • Bay Watcher
  • Is a fish.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8916 on: February 03, 2016, 04:12:09 pm »

Any chance its currently set to the wrong language?  I vaguely remember intellisense was pretty good 10+ years ago when I used it.  A lot can change in that amount of time though.   :P
Logged
Avid Gamer | Goldfish Enthusiast | Canadian | Professional Layabout

cerapa

  • Bay Watcher
  • It wont bite....unless you are the sun.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8917 on: February 03, 2016, 04:17:18 pm »

I don't know if you even can set the language to be different than the project.
Logged

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

itisnotlogical

  • Bay Watcher
  • might be dat boi
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8918 on: February 03, 2016, 04:26:52 pm »

I looked in to writing programs for my TI-89 because I want to believe that there is a reason for me to have this thing once I'm finished with math classes. A lot of the things I've found are hobbyist resources, and those are for standard TI Basic anyway when I need 68k. Are there any official Texas Instruments manuals, aside from the physical one that probably came with the calculator and I don't have?
Logged
This game is Curtain Fire Shooting Game.
Girls do their best now and are preparing. Please watch warmly until it is ready.

i2amroy

  • Bay Watcher
  • Cats, ruling the world one dwarf at a time
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8919 on: February 03, 2016, 04:31:27 pm »

I can assure you that my TI-89 Titanium has been one of my most useful tools for rapidly prototyping math stuff; computers have calculator programs, true, but the speed which I can view, adjust, and change things on the calculator is just so much faster and easier to use that it's definitely been worth keeping it around, even without much customization.

And here's a guidebook published by Oregon state. To be honest for most calculators you can just google "calculator-name manual" and you'll find at least one pdf version of the official manual (and in fact a lot of more recent calculators, like the 89-Titanium, don't even have physical manual copies).
Logged
Quote from: PTTG
It would be brutally difficult and probably won't work. In other words, it's absolutely dwarven!
Cataclysm: Dark Days Ahead - A fun zombie survival rougelike that I'm dev-ing for.

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8920 on: February 03, 2016, 05:30:48 pm »


i is indeed unidentified you fucking idiot.
This happens to me sometimes, too. I think something gets fudged in whatever parsing thing it has when you try to quickly edit typos and such. It usually goes away when I save and re-open. Sometimes it's also due to weird characters getting in (backquotes, etc.)
« Last Edit: February 03, 2016, 05:38:37 pm by Bumber »
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #8921 on: February 03, 2016, 08:41:13 pm »

On the other hand, Intellisense for C# is extremely good. But that's because C# was probably designed around the idea of Bisual studio.
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

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8922 on: February 03, 2016, 09:33:53 pm »


i is indeed unidentified you fucking idiot.
This happens to me sometimes, too. I think something gets fudged in whatever parsing thing it has when you try to quickly edit typos and such. It usually goes away when I save and re-open. Sometimes it's also due to weird characters getting in (backquotes, etc.)

Weird characters like smart quotes and unprintable things are great fun to fix in every programming language it seems.  I remember the first time I had one get pasted into a JavaScript source file once.  Trying to figure out why the browser was complaining about UNEXPECTED TOKEN: ILLEGAL took a while.
Logged
Through pain, I find wisdom.

alway

  • Bay Watcher
  • 🏳️‍⚧️
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8923 on: February 03, 2016, 10:37:57 pm »

Yeah, Intellisense is not only just bad, but reliably so. So reliably so, in fact, that companies like this both exist and rely upon it being terrible and continuing to be terrible into the future: http://www.wholetomato.com/
Just be glad it's only underlining the wrong thing instead of deciding it wants to parse something and locking up visual studio in the process. :v

As for live coding, I've posted it here before and will inevitably post it again in the future, but Shadertoy is great for learning about some graphics stuff, as it's doing a pixel-shader in your browser sorta thing: https://www.shadertoy.com/
Even has multi-buffer support now, so you can do compute stuff like this: https://www.shadertoy.com/view/Xd33Df
Logged

Cryxis, Prince of Doom

  • Bay Watcher
  • Achievment *Fail freshman year uni*
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8924 on: February 04, 2016, 11:35:58 am »

Started coding in Robotc for an elevator my friend and I have built for engineering class.

He is making the 3D model of the device on inventor while I get stuck with the code.
I think I know what I am doing.... maybe....
Logged
Fueled by caffeine, nicotine, and a surprisingly low will to live.
Cryxis makes the best typos.
Pages: 1 ... 593 594 [595] 596 597 ... 796