code logs -> 2014 -> Tue, 22 Apr 2014< code.20140421.log - code.20140423.log >
--- Log opened Tue Apr 22 00:00:48 2014
00:16 JackKnife [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code
00:16 mode/#code [+o JackKnife] by ChanServ
01:11 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code
01:11 mode/#code [+qo Vornicus Vornicus] by ChanServ
01:52 jeroud [sid10043@Nightstar-a1k27g.irccloud.com] has quit [Connection closed]
01:52 jeroud [sid10043@Nightstar-a1k27g.irccloud.com] has joined #code
01:52 mode/#code [+ao jeroud jeroud] by ChanServ
01:55
< [R]>
ErikMesoy|sleep: 1) that only adds up to like 59% or such...
01:56
< [R]>
2) var per = %; if (per <= 9) { return 1 } if (per <= 8.1) { return 2 } ...
01:58
< [R]>
Also, point 1 is assuming that the pattern was in fact: 9^n / 10^(n-1) where n is the expected return value range
01:58
< [R]>
Also error in #2
01:58
< [R]>
2) var per = %; if (per -= 9 <= 0) { return 1 } if (per -= 8.1 <= 0) { return 2 } ...
02:01
< [R]>
Alternatively, loop method: var per = %; for (var n = 0; per > 0;) { ++n; per -= 9^n / 10^(n-1) } return n
02:03
< [R]>
Ugh, missed the 1 == 10% somehow
02:04
< [R]>
Eitherway, it's still only 65.1%
02:09 Derakon_ is now known as Derakon
02:09 mode/#code [+ao Derakon Derakon] by ChanServ
02:40 macdjord|wurk [macdjord@Nightstar-7rac1r.mc.videotron.ca] has quit [[NS] Quit: "Too long have night and day warred, their false dichotomy plaguing this land. No more. I come now to put them both down, to usher in a new era of balance and peace. For now is the time of... /Twilight/. *And the Dusk shall Reign Eternal.*"]
02:42 celticminstrel [celticminst@Nightstar-57p13c.dsl.bell.ca] has quit [Ping timeout: 121 seconds]
02:42 Reivles is now known as Orthia
02:50
<~Vornicus>
Okay, interface question. I'm building a power grid clone. In this, there is the possibility that, when replacing a power plant, there will not be enough capacity in the new plant to store everything that was on the old plant. Often this can proceed without asking any questions: if there's only one possible final result, we can simply cull the resources and be done. But sometimes, there is a question as to which is best.
02:51 celticminstrel [celticminst@Nightstar-57p13c.dsl.bell.ca] has joined #code
02:51 mode/#code [+o celticminstrel] by ChanServ
02:52
<~Vornicus>
For instance: if I get a demand-2 hybrid power plant, it can hold 4 resources, of any combination of coal and oil. But if it is replacing a demand-3 hybrid power plant, there can be up to 6 resources on it... let's say that there are currently 3 coal and 3 oil, so I have to get rid of two.
02:54
<~Vornicus>
So here's the question: what precisely do I ask of the user? "what do you wish to discard?", or "what do you wish to keep?"
03:01
<&Derakon>
The latter.
03:01
<&Derakon>
It's technically more selections (in most situations anyway) but IMO is more intuitive.
03:05 macdjord [macdjord@Nightstar-7rac1r.mc.videotron.ca] has joined #code
03:05 mode/#code [+o macdjord] by ChanServ
03:05
<&ToxicFrog>
Ask the former, but phrase it as the latter - i.e. ask "what do you want to keep?", default to "everything", and don't let them escape until they have unselected a sufficient quantity of stuff.
03:12
<~Vornicus>
Actually I meant more in the, um, event response, uh, idiom. Which is to say: the game model is expecting a function to be called with the answer.
03:13
<@macdjord>
Vornicus: I can't immagine any reason that would matter.
03:13
<~Vornicus>
What I meant was TF's description is more on the end of... uh...
03:13 Turaiel is now known as Turaiel[Offline]
03:14
<~Vornicus>
The planned interface is IRC
03:14
<~Vornicus>
I can't throw up a dialog box there.
03:14
<&ToxicFrog>
Yield, resume when you get the answer?
03:17 Turaiel[Offline] is now known as Turaiel
03:22
<~Vornicus>
Uh
03:23
<~Vornicus>
I already have that.
03:24
<~Vornicus>
Or rather: the game object is handled by an event-handling controller, and is a state machine that knows when certain commands are allowed.
03:24
<~Vornicus>
The problem I'm trying to answer is "what should the command that decides what resources to cull and what resources to keep look like"
03:25
<@macdjord>
Vornicus: "You have (1) Oil, (2) Oil, and (3) Coal in this plant. You can keep 2 of them. Which do you want to keep?" "1" "That is not enough. You have..." "2,3" "You want to keep 1 coal and 1 oil?" "Y" "One coal and one oil kept. One oil dicarded."
03:28
<~Vornicus>
Okay so basically everybody says keep
03:29
<&Derakon>
Affirmative answers are more clear IMO.
03:29 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has quit [[NS] Quit: Program Shutting down]
03:30 jeroud [sid10043@Nightstar-a1k27g.irccloud.com] has quit [Connection closed]
03:30 jeroud [sid10043@Nightstar-a1k27g.irccloud.com] has joined #code
03:31 mode/#code [+ao jeroud jeroud] by ChanServ
03:51 Orthia [orthianz@Nightstar-3tp.juj.184.203.IP] has quit [Ping timeout: 121 seconds]
04:19 Kindamoody[zZz] is now known as Kindamoody
04:26 JackKnife [Z@Nightstar-484uip.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
04:30
<@celticminstrel>
Okay, I try to draw my line properly (instead of just drawing a super-narrow triangle) and suddenly nothing appears.
04:33 Turaiel is now known as Turaiel[Offline]
04:34
<@celticminstrel>
Blah.
04:35
<@celticminstrel>
Maybe... maybe it's setting the fill colour instead of the line colour...
04:40 Orthia [orthianz@Nightstar-3tp.juj.184.203.IP] has joined #code
04:40 mode/#code [+o Orthia] by ChanServ
04:46
<@celticminstrel>
Or maybe not. It looks like there might not even be separate line and fill colours.
05:05 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has quit [Operation timed out]
05:07 Turaiel[Offline] is now known as Turaiel
05:11
<@celticminstrel>
...even when I use OpenGL directly in direct mode, it's not working.
05:12
<~Vornicus>
got your line modes set up right? width and all that?
05:12
<@celticminstrel>
Uh. I did set the line width.
05:13
<@celticminstrel>
To 2.0, I think.
05:14
<@celticminstrel>
Yeah.
05:14 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has joined #code
05:14 mode/#code [+ao ToxicFrog ToxicFrog] by ChanServ
05:26
<@celticminstrel>
Oh. The issue was totally unrelated to the line drawing. (It was the blending mode.)
05:30
<@celticminstrel>
On an unrelated note... Firefox seems to have lost my toolbar. Again.
05:34
<@ErikMesoy|sleep>
[R]: I did say "and so forth".
05:34
<@ErikMesoy|sleep>
10% chance of stopping each increment
05:34 ErikMesoy|sleep is now known as ErikMesoy
05:37
< [R]>
?
05:38
< [R]>
Eitherway, optimal method is likely a hard-coded if/else chain ordered by most likely to least.
05:44
<@ErikMesoy>
i = 1; while True { n = randint(1,10); if n==10 break; else i++; } return i
05:44
<@ErikMesoy>
this has a 10% chance of returning 1 (stops on first pass), 9% chance of returning 2, etc.
05:48
<@ErikMesoy>
I'm pretty sure this loop works out to the if/else chain you mention.
05:52
< [R]>
It has a few more instructions :p
05:58
< [R]>
Eitherway, night
06:08 HotShot [fake@Nightstar-l2nbvd.sfldmi.sbcglobal.net] has quit [[NS] Quit: Trespassers will be shot, Survivers will be shot again! [Time wasted on Mirc 21hrs 16mins 8secs]]
06:09 HotShot [fake@Nightstar-l2nbvd.sfldmi.sbcglobal.net] has joined #code
06:16
<@macdjord>
[R]: DOes it have to be 10%? If 50% is acceptable:
06:16
<@macdjord>
int rand_int = 0, value = 0;
06:16
<@macdjord>
while(!rand_int = rand()){
06:16
<@macdjord>
value += SIZEOF(int)
06:17
<@macdjord>
}
06:17
<@macdjord>
while(rand_int){
06:17
<@macdjord>
value++;
06:17
<@macdjord>
rand_int >>= 1;
06:17
<@macdjord>
}
06:18
<@macdjord>
Wait, make the second loop be 'while(!(rand_int & 1)){'
06:26
<@celticminstrel>
Also make the sizeof lowercase.
06:27
<@celticminstrel>
If that's C, anyway.
06:33
<@macdjord>
celticminstrel: There are several issues with it that need to be fixed for production, but none other than the one I mentioned change the meaning.
06:38
<~Vornicus>
what are we doing? geometric variate?
06:42 * macdjord point up a page or so
06:43 Turaiel is now known as Turaiel[Offline]
06:45
<@ErikMesoy>
I'm trying to generate by non-terrible means a distribution that starts at 1, has 90% chance of incrementing each step.
06:45
<~Vornicus>
Geometric variate.
06:45
<@macdjord>
Vornicus: No idea how to work it for reductions that are not powers of two, though.
06:45
<@ErikMesoy>
So returns 10% 1, 9% 2, 8.1% 3, 7.29% 4, and so forth.
06:46
<@macdjord>
Ah!
06:47
<~Vornicus>
Easy.
06:47
<~Vornicus>
Given a float random: int(log(random())/log(0.9)) + 1
06:47
<@ErikMesoy>
Ooooh.
06:47
<@ErikMesoy>
Clever.
06:48 RchrdB [RichardB@Nightstar-c6u.vd5.170.83.IP] has quit [[NS] Quit: Gone.]
06:48
<@macdjord>
Yay for Vorn the Magic Math Man.
06:48
<@macdjord>
Well, Squid.
06:48
<~Vornicus>
mmmmmmight wanna switch to 1-random actually
06:49
<~Vornicus>
(you can get 0 out of random() but not 1; in this case, 1 is okay, but 0 gives you divide by 0)
06:50
<@ErikMesoy>
random()+1/maxint :P
06:50
<~Vornicus>
1-random() works better
06:50
<@ErikMesoy>
Yes.
06:50
<@macdjord>
Vornicus: Actually, I think you'd be better off sticking with random and just checking for 0. floats retain precision as they approach 0 but lose it as they approach 1.
06:51 RchrdB [RichardB@Nightstar-c6u.vd5.170.83.IP] has joined #code
06:52
<~Vornicus>
This isn't as cool as you'd hope, unfortunately. Actually...
06:52 macdjord is now known as macdjord|slep
06:53 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
06:53
<@ErikMesoy>
or cheat with a not_log() function that returns 0 for 0 and otherwise returns regular log()
06:55
<~Vornicus>
Might work too.
07:15
<~Vornicus>
http://imgur.com/NscVhvP anyway.
07:17
<~Vornicus>
I should add confidence intervals or something but those get Weird.
07:19 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
07:19 mode/#code [+o himi] by ChanServ
07:24 celticminstrel [celticminst@Nightstar-57p13c.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
08:08
<@Azash>
http://www.myce.com/news/microsoft-onedrive-for-business-modifies-files-as-it-sy ncs-71168/
08:26 AverageJoe [evil1@Nightstar-fb1kt4.ph.cox.net] has joined #code
09:04 Kindamoody is now known as Kindamoody|out
09:06 AverageJoe [evil1@Nightstar-fb1kt4.ph.cox.net] has quit [[NS] Quit: Leaving]
09:44 JackKnife [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code
09:44 mode/#code [+o JackKnife] by ChanServ
10:55 Orthia is now known as Reivles
11:10 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
11:14 macdjord|slep [macdjord@Nightstar-7rac1r.mc.videotron.ca] has quit [Ping timeout: 121 seconds]
11:21 macdjord|slep [macdjord@Nightstar-7rac1r.mc.videotron.ca] has joined #code
11:21 mode/#code [+o macdjord|slep] by ChanServ
11:23 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
11:23 mode/#code [+o himi] by ChanServ
11:33 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection closed]
11:33 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code
11:33 mode/#code [+qo Vornicus Vornicus] by ChanServ
11:52
<@Tarinaky>
Caption, "I have found a solution to my terrible docking skills"
11:52
<@Tarinaky>
http://i.imgur.com/zgYtr0K.png
11:53
<@Azash>
This sounds NSFW
11:54
<@Tarinaky>
It isn't.
11:59 * TheWatcher eyes that, ...s
12:00
<@TheWatcher>
I belive the only appropriate response to that is "I say, steady on"
12:02 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving]
12:07 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code
12:56 You're now known as TheWatcher[d00m]
12:58 Syka [the@Nightstar-3j1.p6c.166.101.IP] has joined #code
12:59 Syka is now known as NSGuest840
13:02 NSGuest840 is now known as Syk
13:38 macdjord|slep is now known as macdjord|wurk
14:03 mode/#code [+o RchrdB] by ChanServ
14:25
< HotShot>
lol hows that help
15:12 celticminstrel [celticminst@Nightstar-57p13c.dsl.bell.ca] has joined #code
15:13 mode/#code [+o celticminstrel] by ChanServ
15:49 Syk [the@Nightstar-3j1.p6c.166.101.IP] has quit [[NS] Quit: lolbed]
15:52
<&ToxicFrog>
HotShot: means you don't need to aim as precisely because everywhere in that grid is a docking port.
16:14 You're now known as TheWatcher[afk]
17:06 AnnoDomini is now known as Julius
17:29 Turaiel[Offline] is now known as Turaiel
17:57 Turaiel is now known as Turaiel[Offline]
17:59 Turaiel[Offline] is now known as Turaiel
17:59
<@Alek>
Azash, scary. real scary.
18:46
<@celticminstrel>
I feel like it might be a bad idea to continue to hold 50 or more images in memory even after they've been transferred into textures (and thus are presumably on the graphics card).
18:47
<@celticminstrel>
My current implementation of the resource manager never frees a resource once it's been loaded (unless explicitly asked to, or if it detects the presence of a new override).
18:50
< froztbyte>
https://github.com/blog/1823-results-of-the-github-investigation
19:09 Kindamoody|out is now known as Kindamoody
19:18 gnolam [lenin@Nightstar-lgrapr.tbcn.telia.com] has joined #code
19:18 mode/#code [+o gnolam] by ChanServ
19:39 Turaiel is now known as Turaiel[Offline]
19:51 You're now known as TheWatcher
20:12 Kindamoody is now known as Kindamoody[zZz]
20:35 Julius is now known as AnnoDomini
20:51 Turaiel[Offline] is now known as Turaiel
21:24 JackKnife [Z@Nightstar-484uip.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
21:27 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
21:31 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
21:31 mode/#code [+qo Vornicus Vornicus] by ChanServ
21:39 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
21:39 mode/#code [+o himi] by ChanServ
21:44 JackKnife [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code
21:44 mode/#code [+o JackKnife] by ChanServ
21:50
<&jerith>
https://twitter.com/researcheneur/status/454218273253388288/photo/1
22:24 * Vornicus thinks vaguely at depixel... thinks it may be possible to actually get an exact value for total curvature. maybe.
23:13 Reivles [orthianz@Nightstar-3tp.juj.184.203.IP] has quit [Ping timeout: 121 seconds]
23:24
<~Vornicus>
uch. looked ahain at the formula. never mind.
23:27 Orthia [orthianz@Nightstar-3tp.juj.184.203.IP] has joined #code
23:27 mode/#code [+o Orthia] by ChanServ
23:29 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving]
23:47 Orthia [orthianz@Nightstar-3tp.juj.184.203.IP] has quit [Ping timeout: 121 seconds]
--- Log closed Wed Apr 23 00:00:04 2014
code logs -> 2014 -> Tue, 22 Apr 2014< code.20140421.log - code.20140423.log >

[ Latest log file ]