« first day (1281 days earlier)      last day (3552 days later) » 
00:00 - 20:0020:00 - 00:00

12:01 AM
Another idea: you could use a double auction to create a market more similar to the stock market: en.wikipedia.org/wiki/Double_auction
 
If you work with the ages, you could also let people decide which products exactly they eat
and which they trade
 
I wonder, would older products or newer products imply higher production rates?
 
that way they can try and hide how many of certain products there are
 
older Phi
older means surplus
which means higher productivity
overactor, I'm trying to figure out a way to do that without making the trade less complicated
I don't want to enforce any additional input
 
Is there ever a reason to consume the younger products, then?
 
12:06 AM
yes...if you underproduce something, you want it to appear that there is a surplus of it
if you overproduce, you want it to appear that there is a lack of it
 
to drive the price of it down
allthough
if you underproduce
you're not going to be selling it
so it shouldn't matter what you eat
you'll want to generally sell old things though
 
For the 50 turns of trading, I am paired up with the same player each turn, correct?
 
no no no
 
okay good
Maybe you can simplify the age data into either "fresh" (produced this year) and "preserved" (produced in previous years).
 
12:31 AM
Apparently I killed the conversation.
 
it looks more like it just generally dwindled and you happened to be the last one to say anything ^^
 
12:46 AM
@MartinBüttner I think this is the smallest way to represent 256 atomically in bracket numbers... [[[[[[[]]]]**[[[[]]]]]*[[[[]]]]]*[[[[]]]]]
(((3^3+1)*3+1)*3+1)
 
What do you mean by "atomically"?
 
@PhiNotPi that it's wrapped in an increment
which allows it to be combined with any other operator (without precedence being a problem)
 
okay
yeah, I think that is the shortest way too
 
the question is basically, what's the optimal way to build 255 ^^
 
255 = [[[[[[]]]]**[[[[]]]]]*[[[[]]]]]*[[[[]]]] = ((3^3+1)*3+1)*3
I might have optimal 1-256 now
8486 bytes
 
12:54 AM
is that with delimiters?
 
which is more than @MartinBüttner's results, but I'm not 100% confident in them any more :p
 
no delimiters. you've got me beat by about 500 bytes on 1-256 right now
 
If you can find one where the precedence is wrong in mine, let me know
 
I'm still not doing an exhaustive search, so I'm sure I'm still missing some optimal ones
 
12:55 AM
but I think if anything the optimal solution should be even better than mine
because I don't consider taking detours in order to ensure atomicity
 
my 8486 takes 7 seconds
 
whoa
my exhaustive search took well below a second
 
well, I'm generating a lot of info not relevant to getting to 256
 
I guess you could just look at our two outputs in a difftool and look whether mine are wrong at the differences
oh okay
well I'm off to bed
see you
 
bye!
 
12:57 AM
good night
while calculating bracket numbers up to 64, here's the temp data I've produced:
a lot of stuff that will be useful for bigger numbers
overkill for 1-64, which it still isn't optimal for
 
I haven't really taken a good look at that challenge yet.
 
1:25 AM
there are multiple little quirks of the representation that make it annoying
 
2:08 AM
@MartinBüttner got 1-256 in 7944 bytes without delimiters. Plausibly optimal.
now I need to convince this entry to do the bigger numbers
 
2:32 AM
@MartinBüttner Yep, meta.
FTR I fully support "Programming Contests and Code Golf;" the amount of puzzles we have here is... lacking, at best
 
...the problem with programming puzzles is that 1 answer solves it for everybody
Project Euler is great because it doesn't show you other people's solutions
and while your code may be different, most of the time its approximately the same solution
 
@NathanMerrill do you do SPOJ?
 
no
what is it?
I don't want to register
 
afaik it's the biggest and best programming challenge site
spoj.com/problems/classical for "right answer" sorts of problems
spoj.com/problems/challenge for "best answer" sorts of challenges
supports dozens of languages
 
...I don't see other's solutions there either
 
2:41 AM
you won't
didn't you say euler was great because of that?
 
yep
I thought you were giving me a site where they showed other people's answers
and it worked
 
:)
SPOJ does let you compare runtime / memory usage / etc with other solutions
that one is a challenge, so it's ranked by how good the solutions scores are
 
...are the non-public problems not free?
 
that one is ranked by runtime
I think everything on the site is free
 
oh...I just saw an ad for pay for something
oh, I clicked on the digital ocean ad accidentally
 
2:48 AM
omg
this is amazing
 
hahaha
...the only public-facing site that would benefit from that is SO
 
oh, it looks like there's a small category of problems with public solutions now
 
3:39 AM
ok, submitted a second answer to bracket numbers
my 1-256 might be optimal
my bigger solutions are good, but could be better
 
 
2 hours later…
5:42 AM
ok...anybody here have experience with writing a stay alive controller?
 
stay alive?
 
the bot you are controlling doesn't get restarted after input
I don't pass it a bunch of info, it gives me output, then it closes
rather, it waits for input, passes output, repeat
 
It'd be best to use the stdin adn stdout for that
How to do that though, I'm not sure
 
5:57 AM
Piping
its just not working :P
the bot throws EOF errors
 
Then I'm the wrong one to ask
Bugger
 
6:10 AM
@NathanMerrill I did it for Hunger Gaming, but in Java, not Python. Still, the controller source might help. There's a link in the post.
 
Mines in python
thanks @Geobits
 
It was a complete pain in the ass, though.
 
do you do threading or queues?
 
I'm not sure I understand what you mean.
 
oh
sorry, I misread your post
I thought you said it was in Python, not Java
 
6:13 AM
Nope. My Python is weak.
 
well, I've got nearly everything working except a bug with piping
 
What's the bug? Just an EOF?
 
no, that's different
I believe I can't get around it
basically, the bots themselves will have to deal with cases when they try to get input, and there isn't any yet
in Python, that means EOF
 
Yes, mine had to also. I wrote an example bot in Java to show how to do it, but basically it boiled down to checking with the available() method in a loop with sleep.
It's a bit hackish, honestly, but it worked well.
 
I just have a try catch
since exceptions don't really cause a slowdown in python like they do in compiled languages
 
6:17 AM
So what's the problem?
Just the added complexity for the bots?
 
no, there's a real problem with the piping
I'm not getting messages through, and not getting responses either
 
So when you send something to the bot, it isn't received, and vice versa?
 
yeah
the bots getting run though
so at least one good thing :P
 
How are you writing to the bot, exactly?
 
piping
so, in python, the bot will do raw_input()
 
6:21 AM
I mean piping it how, with what function(s)
 
its a bunch of code...but in essence I call subprocess.Popen() which returns an object with stdout and stdin. If I just try to read them here and now, they will block, so I put them in a Synchronized queue
 
You shouldn't need a queue to write to them, though.
 
in case the bot isn't currently accepting input, then, yes I do
 
Why wouldn't it be accepting input?
 
it's processing
basicall, writing to the pipe will block me until the other bot does a readline()
if there is a .1 second sleep, I have to wait for that .1 second
but with Queues, I don't
 
6:27 AM
Right, but how long is the bot going to be processing? They shouldn't be doing much else if they have no input, right?
 
supposedly. I'm still allowing myself to get locked up though
 
Only if a bot is locked up. That's why mine had a strict 100ms timer (or somewhere around there).
If it took too long, the program just skipped its turn and continued.
 
I can't do that without threading
hence the queues
 
Is there really no way to? That was admittedly the ugliest part of my code, but it wasn't impossible.
 
nope. I can throw an exception with Ctrl-C, but python will just sit there
 
6:31 AM
So really this is only a problem if/when a bot misbehaves?
 
yes
well, kind of
it also improves speed
 
"If a bot causes my program to block/lock, it's disqualified"
 
...here's the thing...every program will lock mine
if it sleeps for .1 second, then prints, I'm locked for that period
 
Well... yes, but that's normal.
 
times that by 50...that's 5 whole seconds of wait time
queues, it becomes 0
because the queues are on a separate thread, accepting all input
 
6:33 AM
Except that you can't get queues working :/
 
I'll get it to work :P
 
Ok, so assuming you get the controller wait time to 0 with queues, what else would it be doing if you don't have responses from bots yet?
 
its blocked
on its own thread
wait...what's defined as "it"
 
Gotcha
 
the controller?
 
6:35 AM
Yes
 
oh, the controller will be doing logic
so, the queues have a nice timeout parameter
I say "if there isn't any input within X seconds, throw an error"
and if it does, I output the name of the bot that isn't working
and then continue along
 
Ok, I did basically the same thing but not in a queue.
 
so, there's still a timeout for unresponsive bots, otherwise, I just grab the output, and work with it
 
I don't know python queues at all, though, so if your problem is specific to the threading issues it creates (as it seems to be), I'm not sure how much help I can be.
 
well, I'm really just following this post: stackoverflow.com/questions/375427/…
and making it work for output too
 
6:40 AM
Doing it sequentially was quite fast for me, though. 40k rounds in under 20 minutes, and the vast majority of that was controller logic. Pure I/O was probably 25% or less.
That was with 10 entries, YMMV.
Either way, it was absolutely much, much faster than doing a process per turn like many koth.
 
Eureka...?
 
sort of
I didn't test getting STDOUT properly
apparently, it works just fine
 
Nice
 
its STDIN that is the problem
 
6:43 AM
On the controller or bot side?
 
bot
bot can't read
 
No Bot Left Behind
When you say "can't read",do you mean it reads and there's nothing there, it throws an error, what?
 
it throws an EOF error :P
it just isn't getting anything
 
using raw_input, right?
 
6:47 AM
so when you catch the error, you loop back after a short wait and try again, right?
 
And it never gets anything from the controller?
 
Well I'm not sure how that could be the bot's fault then, that part should be straightforward.
I've gotta head out for now, though. Good luck!
 
bye!
hmmm...I'm wondering whether it would be easier to make this a non-stay alive program
 
 
1 hour later…
8:11 AM
Can you make a computer that runs on steam?
I read somewhere that you can make hydraulic transistors.
You wouldn't want paper cards for input, because they'd get too soggy.
Maybe some kind of metal chain where the links can be in different configurations, or different types.
Instead of a keypunch, you'd use something more like a linotype.
Heavy metal programming. :/
Closer to reality, I want to design and build an espresso machine with a built-in player-calliope. I'm not entirely sure about the design of the player part; either punched cards or discs. But if you've got a source of steam, why not have a built-in calliope?? And to that question, I have not found a satisfactory answer.
 
 
1 hour later…
9:27 AM
@luserdroog Probably... you might just get a problem with miniaturisation ;)
@Doorknob But there has been a meta post and it's not like it really accomplished anything
@Sparr not bad!
 
10
Q: What would the replicator do if Picard ordered "Hot Earl Grey tea"?

JoshDMIs there a particular required sequence used for replicator request descriptions? Is there a reason Captain Picard orders his tea, "tea, Earl Grey, hot" aka "noun, descriptor, descriptor" and not "descriptor, descriptor, noun" or "descriptor, noun, descriptor" (in case he missed a descriptor)?...

 
@NathanMerrill If it's a good puzzle with multiple solutions there are still ways to rank them, by code length, upvotes, etc. But in general yes, that is a big problem with puzzles within the SE format. How does Puzzling.SE do it? Do they actually pose puzzles or just discuss them?
^ @Doorknob (you're a mod there too, aren't you?)
@luserdroog Ha, I saw that in the HNQ on my phone this morning and was going to check it out now :D
 
@MartinBüttner I'm not even sure what the process is for changing a site's name, but I'll try to figure that out
 
There's one really good answer, with quotes.
 
@MartinBüttner Yep; it's not really the same as PPCG there in that there's no objective winning criterion; it's more similar to "regular" SE sites. Although people still do post puzzles to solve, but they're mostly "first correct answer wins" (or sometimes "most through answer")
 
9:35 AM
Ah I see
 
 
1 hour later…
10:56 AM
@MartinBüttner sorry dude... new guys are slipping you down
:-)
 
@EoinCampbell :(
and that pony just can't be beaten :D
I think I'm still up for the "Concise" award though :P
 
looks like it. gazzr gave it a run for its money. but was beaten 43-37. if that result had gone the other way the tourny would hae been a 63/63 tie
 
11:50 AM
@VisualMelon would you mind sending me your circuit solver, so I've got a program to test my controller with?
 
 
2 hours later…
2:06 PM
@MartinBüttner Puzzling.SE isn't a competition. Answering the questions if for the benefit of the questioner
 
@NathanMerrill Ah yeah, I wasn't sure about that. Thanks
 
 
1 hour later…
3:31 PM
@MartinBüttner my perfect 1-256 is a lot slower than yours, and I'd like to improve that just because it would mean getting more data for the bigger numbers.
 
@MartinBüttner visualmelon.onl/dominoPrinter.cs
 
or maybe I'll just ignore it. I've got a bad habit of only doing the challenges without much participation
 
@VisualMelon cheers, how do I compile it from the command line?
@Sparr happens to me, too
 
csc dominoPrinter.cs ought to do it
it write out a lot of rubbish to stderr, do you might need to re-direct that somewhere
(and don't give it the 4-bit parity checker or 6-input example if you don't want to wait forever)
 
3:49 PM
wow it took me ages to find csc
 
oh, sorry
 
no problem
are you expecting the input on STDIN?
it's going to come in via argv actually
 
I am indeed expecting from STDIN
I can change that now if you want
 
if you don't mind
 
wow, don't know how I missed that
 
3:55 PM
it wasn't as clear before
the spec said "command line argument" but the example had a line break between M N and f
so it looked more like STDIN
 
re-uploaded .cs to use command line args
 
cheers
would you mind renaming the file to VisualMelon.cs, so I don't have to rename it every time? :D (just in case I need to redownload again)
 
sure ;)
 
4:33 PM
gaaaah, c++ and it's bloody broken modulo
 
I did the 24-hour IEEXtreme competition this year
and one of the questions requires some dodgy Modulo behavior
 
...c++'s modulo works...?
 
that was most annoying, everyone using Java seemed to complete it in no time, and we just skipped it rather than trying to reverse the behaviour from the examples
 
what is broken about it?
 
negative numbers...
give negative results
how could that ever be useful
 
4:36 PM
So...-9 mod 4 = -1 or -3?
 
it's -1
 
what happens in Java? 3?
 
I don't know about Java, but I have never had a use case where I wanted the result to be -1 instead of 3
 
according to docs, Java will do that same
 
4:52 PM
if -9 mod 4 == 3 then what is -9 / 4?
 
@Sparr hadn't thought of that, but -9 % -4 is still -1
 
5:07 PM
0
A: Tweetable Mathematical Art

Martin BüttnerRandom painter char red_fn(int i,int j){ #define r(n)(rand()%n) static char c[1024][1024];return!c[i][j]?c[i][j]=!r(999)?r(256):red_fn((i+r(2))%1024,(j+r(2))%1024):c[i][j]; } char green_fn(int i,int j){ static char c[1024][1024];return!c[i][j]?c[i][j]=!r(999)?r(256):green_fn((i+r(2))%1...

@Sparr I believe it's -2 such that (m / n)*n + (m % n) = m
 
that's beautiful!
 
thanks :)
 
images won't load for me right now, but I'll look at it later
 
I got messaging between persistent programs working ^^
 
@MartinBüttner the "random adjacent pixel" seems to favor northwest and/or southeast pixels?
 
5:13 PM
@Sparr only southeast
that's the first of my bullet points at the end
I can only pick them at larger coordinates, because I don't have enough characters to handle underflow in red
 
oh, sorry
also, are you relying on the array being initialized to zeros?
 
I'm currently trying out what happens if I fix it for green and blue
@Sparr yes
static storage
should be 0
okay if I can save one more character, I might be able to make it isotropic
 
what is the format for the pixel art wrapper output?
MathPic?
 
ppm
is that what you mean?
 
ahh, sure
gonna put an extension on the file so my system knows what to do with it :)
 
5:19 PM
imagemagick can convert it to png
 
yeah
 
ha, found that one character
 
would it be cheating to rename the functions?
so wasteful for them to be red_fn instead of r, etc
the challenge technically is just for the function bodies
 
i know, right?
there would be a lot of interesting possibilities, if we had a bit more leeway with the framework
like forward-declaring the three colour functions
 
he says you can use another language
which makes me think that manipulating the framework would be reasonable
 
5:23 PM
yeah I thought about that as well
 
as long as you aren't introducing additional functionality
something is wrong with my framework
I'm just having red_fn return i and green_fn return j and blue_fn return 0
that should give me a 2d black/red/green/yellow gradient, right?
 
yes
is it oscillating like crazy?
 
I'm getting a grid of very tiny such gradients
 
there's some little endian/big endian trouble
 
that would do it
 
5:27 PM
I switched to using chars instead of shorts and reduced the maximum colour to 255
btw I added isotropic random walk to my post
I prefer the diagonal strokes though
 
0
A: Proposed Question Sandbox - Mark XIV

hslGenerate a random work of art We've all seen minimalist modern art at museums and thought, I bet I could do that. Well, now's your chance. Your challenge is to (pseudo-)randomly generate an image in the style of Piet Mondrian's Composition paintings, but make it look like a real painting, not a ...

 
also wow, rand is SUCH a band PRNG... if you just generate all colours randomly you can see so much structure in the picture
 
void pixel_write(int i, int j){
static unsigned char color[6];
unsigned short red = red_fn(i,j)&DM1, blue = blue_fn(i,j)&DM1, green = green_fn(i,j)&DM1;
color[1] = red&255;
color[0] = red>>8;
color[3] = green&255;
color[2] = green>>8;
color[5] = blue&255;
color[4] = blue>>8;
fwrite(color, 1, 6, fp);
}
my rand() is pretty unstructured
 
ah that's a nice alternative, but I can't use it now because it would require one more character in my code :D
(to replace a 255 with 1023)
 
1024 instead of 256 as a const?
yeah
there's virtually no structure in my random output
that's 1/4 of the output
 
5:35 PM
huh
 
just rand(1024) for all three channels
err, r(1024) which is rand()%1024
 
huh
well I had r(256)
and got a lot of diffuse vertical lines
 
I got vertical lines when imgur converted my full size image from png to jpg
no idea why that happened, and they weren't present or visible in my original
those dark lines are not present in the original image
 
ah no, I don't mean lines like that... they were more large scale patterns in a few places
 
looks like carpet
 
5:38 PM
well, now that I finally have a submission I'm really happy about I can turn my back on that challenge
Now I'm almost tempted to implement rule 110 in that challenge, but 4 submissions are really enough :D
 
5:56 PM
I'm thinking of doing an entry that does an arbitrary CA rule
or a randomly selected one
or overlaps three randomly selected ones
 
yeah exactly, something like that
 
@MartinBüttner why !c[i][j]?foo:c[i][j] instead of c[i][j]?c[i][j]:foo ?
 
6:18 PM
@Sparr because you wouldn't gain a character from it
you'd need to replace the ! by a space
and this way around seemed to be the more logical way to write it for me
@githubphagocyte why does area 51 state that a proposal needs 40 followers in the definition phase if you need at least 80 followers (in the unachievable best case scenario) to fulfil the requirement regarding the questions?
 
@MartinBüttner I have wondered this myself. My only guess is that this provides several layers of targets to hit, so that we don't get put off by seeing how far away the end is. Lots of little journeys rather than one big one. Of course it doesn't help people who see through it...
@MartinBüttner if you were talking about the tweet art question when you said you couldn't spare a character to use 1023, you can use DIM for 1024 and DM1 for 1023, if that helps.
 
@githubphagocyte Ah, good point. I don't think I can be bothered to switch back to short right now ^^ (of course, that macro could still save a few characters in different places)
 
6:59 PM
damn
have a entry for tweetable mathematical art at 166 bytes for one of the functions
I can fix this!
 
:)
wanna give us a preview here? :P
 
it's just three random 8-bit CAs overlaid, one per color channel
cellular automata
I manually chose rules 30, 90, and 94 for that one, but my code picks at random each run
I'm working on squeezing out some bytes to get it to fit at all. If I can get further than that, I can make it skip boring CAs more often
 
you made yours return 0-255?
 
7:14 PM
tempted to say mine returns 0-1 and ditch some bytes :)
 
:D
well with your fixed writer I could change mine back to short I guess
 
only saves me a single "*DM1" though
 
7:27 PM
139 bytes with no filtering of rules at all
and misbehavior at the edges of the image for some rules
damn, nope, that approach leads to greyscale images
decided to just use time() instead of rand, since I only need one random number per run
but I actually need three numbers
one per channel
 
7:59 PM
@MartinBüttner only just noticed your beautiful creations repeat on the X axis
 
00:00 - 20:0020:00 - 00:00

« first day (1281 days earlier)      last day (3552 days later) »