« first day (1280 days earlier)      last day (3557 days later) » 

7:06 PM
Oh...I remember why I came in here
I'm trying to write the controller part of my controller program
I know how to open a process and pipe to it...but I don't know how to terminate a process
anybody here have preexisting code for piping to stay alive processes?
with a timeout*
 
Process.destroy() in java? what language is your controller in?
 
Python
 
popen.terminate and popen.kill?
 
...I can do that after communication is finished
 
some subprocess-allowing controllers like to ask the process to end gracefully
by sending it some input that means "quit"
and then term/kill it if that doesn't work
 
7:12 PM
...this is the issue of a bot not responding
I will send "Q", that's in my description
not responding = taking longer than 1 second
 
oh, sure, then you term/kill it
 
yeah, but if I understand the docs, correctly, popen.communicate() doesn't return until the process has terminated
 
yeah, you don't want to use communicate
that seems to be mostly for processes that do one thing and exit
use popen.stdin and popen.stdout and treat the process i/o like file i/o
 
those don't have timeouts
they are blocking calls
...but I think I found it
 
Do you have a non-blocking call that simply checks if input is available?
 
7:20 PM
select.poll()
 
popen.stdin just returns a file handle for writing to
I don't know if/why it could ever block
 
sorry, popen.stdin.readline()
select.poll(), however is *nix
I'm on *ows
 
I thought readline was blocking.
 
readline is blocking
 
210
Q: Non-blocking read on a subprocess.PIPE in python

Mathieu PagéI'm using the subprocess module to start a subprocess and connect to it's output stream (stdout). I want to be able to execute non-blocking reads on its stdout. Is there a way to make .readline non-blocking or to check if there is data on the stream before I invoke .readline? I'd like this to be ...

if only there was some website for asking technical coding implementation questions and getting multiple ranked answers :p
 
7:23 PM
lol
 
@MartinBüttner for my new bracket numbers solution, I think I want to keep track of the minimum and maximum operation at the outer level of each best representation for a number.
the bracketing increment operation makes an atomic container, but every other non-parenthetical operation is important.
I can't put unbracketed addition or multiplication on the right side of an exponentiation
I can't put unbracketed exponentiation on the left side of an exponentiation
 
aw, i was hoping @KyleKanos would be here
i wanted to bother him with random things :D
 
@Trimsty I'm here now
I got pinged :)
 
oh, yay :D
@KyleKanos so the random stuff from above is just me being stubborn i guess
So obviously modern Fortran is faster than C (woohoo) and I feel like writing a browser (because I'm an idiot)
 
Of course Fortran is faster than C
That's why everyone uses it :D
 
7:36 PM
Modern Fortran seems a bit overloaded to me though, with the object oriented stuff and all, so I decided I'd just write a language heavily influenced by Fortran that is really close to the machine but easier to debug and maintain
because I'm even more of an idiot than I was before
 
so it's not because there is a massive legacy code-base and the only people working on them are from the 70s themselves, or eager sci grads who don't know how to program yet?
 
Okay, then I demand that you allow for i++ syntax
 
and that I'd write the browser around 70% in that and 30% in assembly for the more intense parts, like gmp
 
@VisualMelon That's actually quite a myth. There are plenty of codes written today in Fortran 90+
 
@KyleKanos i shall ;o
 
7:37 PM
(this was my experience, I had to teach my brother FORTRAN in 2 weeks because he got a well paid job using it and had not clue how to program)
 
wat
 
I know how to program (and do it well)
And I learned Fortran
First
 
@KyleKanos neat, I liked what I learned of FORTRAN, but we were using 70 I think because his job used it
 
Kyle doesn't know how to code in Fortran, Kyle is Fortran
 
Sadly FORTRAN 77 is still around. Lots of younger people have become aware of how sadly out of date and easily destroyable F77 is, so we build things on F90+
 
7:39 PM
the best bit about teaching my brother FORTRAN was that I didn't know it either
 
anyway so yeah, I came here because I haven't used Fortran before and would nag you about things as I learn it and rip it off into a notepad window
 
The OO aspect of Fortran 03/08 is gaining support too (c.f. the piernik code)
 
@KyleKanos I'm not sure if I like that, though,
object-oriented programming just seems kinda unfocused to me
imho
 
It is syntactic sugar. Instead of call foo(this, bar) you use call this%foo(bar)
 
@KyleKanos so it doesn't affect runtime?
 
7:42 PM
@Trimsty Not that I'm aware of, but I have not tested it
 
@KyleKanos ah, i see
 
Also, doing a Google search for "Introduction to Modern Fortran Jonathan Dursi" returns two 120+ PDF presentations from an expert in Computational Astrophysics & SO answerer
 
i'm quite interested in dissecting the differences between fortran 95 and 08
 
Namely: wiki.scinethpc.ca/wiki/images/e/eb/ModernFortran.pdf and wiki.scinet.utoronto.ca/wiki/images/0/0e/ModernFortran-morning.pdf
 
@KyleKanos sweeeet ;D
 
7:45 PM
@Trimsty The difference is 87.
 
@Geobits only 77 and 90 are numbers
 
Then obviously you round to 90 :p
 
@Geobits But 95 + 90 = 95?!
 
@Trimsty Three major things: co-array, do concurrent, and submodules
 
@KyleKanos yay
 
7:48 PM
is that a concurrent array, or a covariant array, or something not horrible?
 
@Trimsty The difference between 6 and 5 is 1, but that doesn't mean 6+1=6...
 
@Geobits yeah, but you can't have duplicate features in languages
 
co-array = parallelized array
1 copy per process
 
thus, a+b = a if b == a
 
Um, what?
 
7:49 PM
Trimsty is confusing disjoint addition with set union
 
yes
yes i am
 
@MartinBüttner repr[16777216] = "[[[]]] [[[[]]]] [[[]]]"; seems wrong. to me that says 2^(3^^2)
 
Unfortunately the + operator is, indeed, set union
wait
 
not in any language I've looked at!
 
Maybe where you're from :p
 
7:50 PM
+ on sets is union in some language I was reading about recently
SETS, not LISTS
 
Well, in some alternate universe where sets can't contain duplicates, it is set union.
xD
 
since when is + not set union?
 
that's the definition of a set
 
we're in an alternate universe then
 
You can use whatever you like in your language, but ∪ is all the set union I need.
 
7:53 PM
something is wrong with me, I listened to the same song for 5 hours today
 
To be clear, is that one 5-hour long song, or a short song repeated for 5 hours?
 
@Geobits 3 mins 20 seconds
 
I once listened to the same 34seconds on repeat for 50hours (with sleeping)
after the mandated 2 days was over, I didn't want to listen to anything else
 
@VisualMelon i feel normal
 
oh, turns out it's 35seconds, 34seconds is the other thing I listen to on repeat alot
(though I often listen to it at .8 and .64 speed, which of course makes it inverse proportionally longer)
 
7:57 PM
lol, you can still open the song queue when itunes is on one song repeat
lemme take a screenie
 
@Sparr I can't see the spaces there
 
@MartinBüttner I commented as well
on your entry
 
very accurate depiction of my current playlist
 
repr[16777216] = "[[[]]] [[[[]]]] [[[]]]"; seems wrong. to me that says 2^(3^^2)
damnit, it ate more spaces
 
8:00 PM
2 spaces, 3 spaces?
 
yes
 
ohhh
I see what you mean now
 
you're trying to say 8^8 as 8^^2, and that as 2^3^^2
but precedence kills that
 
no that was just me trying to be clever and using the shorter form of 8 there
 
you did it on 387420489, too :p
 
8:02 PM
it's not going to affect my code anywhere, it never gets there
yes
 
trying to use 3^2 for 9
 
:)
repr [16777216] = [(27, 3, 3, "[[[[[[[[[]]]]]]]]] [[[]]]")]; # 8^^2 = 8^8
repr[387420489] = [(29, 3, 3, "[[[[[[[[[[]]]]]]]]]] [[[]]]")]; # 9^^2 = 9^9
that's in my code right now
(length, min_op, max_op, bracket representation)
for each number, I'm going to have a heap. that heap will be a list of representations sorted by length, also tagged by the minimum and maximum operations used outside brackets in the representation
when I need a representation for a number to substitute into another representation, I'll walk through the heap from shortest to longest until I find one that meets the current context's operation restrictions
 
I'm looking forward to the results! :)
 
random aside...
nine has two minimal representations
 
[[[[[[[[[]]]]]]]]] and [[[[[]]]]**[[[]]]]
swap the operands on the right one, that's ten :)
my previous code represented 10 as 5*2
3^2+1 is both one character shorter, AND atomic
your code found 3^2+1
the length-optimalness isn't surprising to me, but now that I'm paying attention to all of the precedence concerns the outer [] matters a lot
 
I always pick the one with the higher-order operation at the top level
or maybe I don't
 
my previous code didn't try addition at all if the number was composite
 
oh yes, because increment is higher-order in terms of precedence
 
anyway, very very slowly getting started on this much better algorithm
I expect to be able to reproduce your perfect 1-256
there's got to be some happy medium between my 3 second 2^31-1 and your 7 minute 8191 :)
 
8:16 PM
I really doubt that my 1-256 is perfect
it might be if I kept around the shortest representation for each possible top-level operator
 
well, it is until I can do better :p
 
and took all of them into account
 
grah, might have to write that Kakuro program myself, my mental arithmetic really is shocking
 
oh I didn't even notice that's your proposal
I was looking for something to golf and that looks neat ^^
(it is going to be code golf, right?)
@VisualMelon ping
 
8:35 PM
indeed
 
wow, despite Mathematica's IntegerPartitions this is surprisingly complex
 
should I post it?
 
I have a feeling GolfScript will rock this
I'll have another read later
I understood the spec but I kinda read it all over the place and multiple times
let me have another look if it's all clear if you read it like normal people do :D
 
Did someone say kakuro?
 
@MartinBüttner I notice you omitted 2^^2 from your hardcoded tetration entries
 
8:46 PM
I play it on my phone during basically any "waiting" time.
 
I have a tin of kakuro's to do on trains
they are infuriating
3
A: Proposed Question Sandbox - Mark XIV

VisualMelonKakuro Combinations I'd have thought something like this would have already been asked, but I can't find anything that looks like a duplicate, I'm not the best person at searching for things though. For those of you who know Kakuro, this isn't as interesting as it might sound - is there a bette...

 
If you have an Android, I recommend mPuzzle. It's got tons of them of various levels/sizes.
 
@Sparr how would that be better?
@Geobits will be checked out, thanks :)
 
wait
I have 4 votes on Programmin Pacman
 
It's also got other puzzle types like fillomino, sudoku, etc.
 
8:49 PM
...I don't have any rep
...do different sites have different rep counters?
 
4 votes in the sandbox? Meta doesn't give rep.
It just uses the site rep.
 
ah, right
Meta, forgot about that
 
Otherwise the sandbox would be a great way to double-dip ;)
 
hehe, I wasn't doing it for the rep, but I noticed that I hadn't been getting the green +10s
 
This is open again? Even as a golf it's a duplicate.
 
9:02 PM
@MartinBüttner it's not, sorry
 
@VisualMelon got it sorted at 244 bytes
 
I'd better post it then ;)
 
actually no, Mathematica doesn't like unicode intersection
okay, I'll give it another read quickly
 
oh dear, I can't remember what combinatorics is...
(and more importantly whether it's a suitable tag)
 
if it involves sets
 
9:05 PM
of course my highest voted answer is going to be the one I abandon in favor of another entry
 
it's probably combinatorics
though...you could say every field is combinatorics
 
@VisualMelon well it might be a veeeeery simple case of combinatorics
 
I don't think I'll credit it with that long word
 
I wouldn't mind personally
 
Of course, there's always the [puzzle-solver] tag, even if you're just solving the puzzle one step at a time.
 
9:05 PM
someone will remove it if they're bothered
okay, I think it's good to go
you can definitely slap on arithmetic though
I think that's a thing
 
Posted
ah, I'll check/edit
 
Next step? A full kakuro solver :D
 
I was worried people might think it would be that
it's not nearly that interesting, but I do struggle with the arithmetic and I thought it'd be good fun, I was surprised there wasn't something like it already
 
@VisualMelon initially I thought that and was well confused by your examples :D
 
I posted a fillomino solving puzzle, but that one is probably a bit harder to code up. Only one answer, and it's not necessarily working.
 
9:08 PM
@VisualMelon Peter Taylor will probably tell you that it's totally equivalent to something else :D
 
well, he made an edit
because I misspelled Sodoku
I was going to thank him, but he's not appeared here
 
how do I get a byte count of my applications, I thought I was supposed to measure character count.
 
Unless you're using funky characters they should be the same.
(funky = multibyte)
Not a concern for many languages.
 
so I am good then
 
@VisualMelon you can thank him next week I think... he's on holiday
 
9:13 PM
on holiday but still fixing spelling errors in sandbox questions? that's devotion
 
ikr :D
 
Peter and Rusherbolt both gone... you'd think it'd be quieter in here :D
 
he fixed one in the domino challenge to
@Geobits it's weird... basically the day both left a wave of new users flooded the chat :D
 
Oh, can someone test something for me? Can I still get a ping if you edit my @name out afterward?
 
ping pong
 
9:16 PM
Cool. I'm definitely going to start calling him Rusherbolt then.
 
@VisualMelon are you going to clean up the sandbox post or should I?
 
errr, I'd be grateful
 
@Geobits brilliant :D
if it wasn't so long...
 
I'm trying to find a post that I can edit to look at the markdown for consistency ;)
 
True...
@Visual Consistency? Pah. Don't look too hard.
 
9:18 PM
@MartinBüttner thanks
 
you're welcome
 
Can I pitch something to you guys?
 
please don't
(please do!)
 
Okay
 
Can I get my glove first?
 
9:20 PM
hrhr
 
get your glove first
 
badum
 
cause this one
nah, I got nothin
anyway
koth
 
@MartinBüttner is there a way to test Mathematica with WolframAlpha or something that doesn't require me to have Mathematica?
 
9:21 PM
@VisualMelon nope
WA uses a completely different frontend
 
The entries code minions, who will get send tasks by their (evil?) boss
 
but the Wolfram Language is now an independent standard so you can hope that there will be a free implementation some day
 
every task has an amount of points attached to it
Who ever completes a task gets the points
The better you perform as a team, the more points the boss can distribute
 
...do I only know my task?
 
The tasks are not assigned to one minion
 
9:23 PM
What is an example of a task, first of all?
 
The boss might say, I need those 4 items and I need these three guys killed
 
...I don't think I'm understanding a task. Is a task simply like "4+4", is it "attack a player"?
you also mentioned teams...1 boss, 2 teams?
 
I'll get to that
 
So.... this is basically an MMORPG with competitive quests?
 
there's two teams
 
9:24 PM
lol
 
both teams contain all entries as minions
and the bosses are
maybe you guessed it
entries from another koth
 
Ok. So mega boss gives minibosses money for tasks
and minibosses give minons tasks
plus less money
 
no no
only two levels
bosses and minions
bosses put out tasks
minions complete them
 
well, you said that a boss can give more money if his tasks get completed
what tasks can a boss give out, and where is he getting this money?
 
yeah, to the minion that completes it
 
9:27 PM
one sec...let me quote you
 
I might have expressed miself poorly
 
The better you perform as a team, the more points the boss can distribute
 
ah yes
resources
I haven't worked it out entirely yet
but I'd say the teams compete for capture points
the more point you control, the more resources
something like that
 
that gives me an idea....a pyramid scheme where everybody tries to get rich
 
Could be cool
 
9:31 PM
anyways, go on
 
Well, the winner of the match is the one who controls all of the resources at the end
or most after x amount of time
Winner of the minions is the one with the most points
Every boss goes up against every other boss
 
I'm not sure KotHs will work well when split up into two challenges. Because all the submission do need to be tested together in a single run. I don't see how splitting it up helps here, except that you can declare one winner on each team.
This seems easier with code-challenges where each challenge simply serves to generate some more test data for the other challenge.
But I'd love to see you prove me wrong. ;)
 
Well it's not really teams that I split up
there's two levels to the competition really
the minions will be competing against other minions
and the bosses competing with other bosses
There really are two competitions going on, which makes the separation logical
they just so happen to coincide in one game
 
...would the minions really have any effect on how well the bosses do?
assuming there are minions
if I have 2 minions, both who take tasks with the top price, but do them differently, does it make a difference to the boss?
 
both bosses have the same minions
so it's more about how they distribute the tasks
what they priorotize
noting which tasks need some more incentive
 
9:44 PM
I think you need something a little more solid before you propose
 
I'm not proposing yet
 
I know :P
 
There's still some gaping problems
 
I still have a hard time imagining any tasks a boss would want a minion to complete
 
I basically still ahve to think of the entire actual game
I'll get there
And if I don't, at least I gave you an idea
 
10:06 PM
@VisualMelon match.Complete gets called in the lambda action. the play/complete sequence is wrapped in a try/finally so even if the play method were throwing.
 
@EoinCampbell match.IsCompleted() is called, but I can't see how CompleteMatch(Match) is called
 
@VisualMelon matches have a "source" added to them when they're instantiated. That Source is the matchGenerator. Match.IsCompleted calls Source.CompleteMatch(this);
 
ah, OK
 
its circular because once the match is yield'd out of the generator, it needs a way to call back into the generator to let it now that player have become available
 
yeah, it's just that call isn't in your code, I figured it might have been neglected, but that makes sense
 
10:13 PM
my VB answer is still less than the Java Answer!!!
 
epic win
 
@VisualMelon isn't in which code ? what I posted on SO ?
 
aye
unless my Ctrl-F doesn't work
 
ah I see. yeah I added some extra info there. and a link to the source on GH.
 
ah, didn't see the link had appeared
 
10:15 PM
head was melted looking at it earlier so went to see GOTG in the cinema.
 
I Have invaded again
0
A: The Rock, Paper, Scissors, Lizard, Spock Tournament of Epicness

MalachiDice Throw Bot, C# Just Random using System; using Microsoft.CSharp; using Microsoft.Win32.SafeHandles; using System.Collections.Generic; using System.Linq; public static void Main (string[] args) { var computerPlay = GetRandomOption(gameGestures); IList<Gesture> gameGestures = GetGest...

 
10:56 PM
Hey, I had a new idea for a KoTH: meta.codegolf.stackexchange.com/questions/1847/…
 
0
A: Proposed Question Sandbox - Mark XIV

Nathan MerrillTraders You are a foreign trader, hoping to make a profit. There are 5 goods people wish to trade: Apricots, Boars, Canaries, Daffodils, and Earwigs. Starting in the winter, you need to decide what to produce. Then, in the fall, you travel and spend your days trading for a profit. Gameplay ...

 
How convenient ^^
 
the offer-accept is unnecessary
the seller can include a price in his offer. this doesn't have to be shown to the buyer
then the buyer's offer can be automatically accepted or rejected without asking the seller
 

« first day (1280 days earlier)      last day (3557 days later) »