Well, I don't really know what is causing it to slow down.
user55340
@abaldwin99 For over the phone communication, I would try to stick to base-36. Switching from upper case to lower case and punctuation (is that a dash or a slash) becomes awkward.
user55340
Aside from that, I would also look at the "how can I pack information in densely from the start. The most dense would be the time seconds (or minutes depending on resolution) since an epoch date.
user55340
The number of minutes since Jan 1, 2000 is about 8*10^6 which is a fairly dense value to pack in another format.
if you want (and can read CoffeeScript) you can read my code here: github.com/mbuettner/regex-vizard ... I guess /tests and /engine would be interesting for you. I never completed this engine, but the features that are there do work, including capturing groups (no backreferences yet, though, but they should be simple).
this is intended to implement the ECMAScript flavour to spec
in particular, when a group is repeated, itself and all the contained groups are reset to empty on each repetition. I think this is different in some other flavours.
so the \2 in (\2|(a))+ will always be empty or fail I think
the vision for this tool was amazing... I think it would blow all of the existing free regex debuggers out of the water... but like so many projects, I never finished it... :D
Yay, thanks to the built-in restriction I found a solution (without sort function) with the same score as algorithmshark. codegolf.stackexchange.com/a/47629/7311
@PhiNotPi how can you beat a bot in Core War if it just copies DAT to 'random' positions? (random could be achieved with a big increment relative prime to the core-size)
Add and simplify surreal numbers and combinatorial games
A game can be defined recursively as
{l1,l2,...|r1,r2,...}
where lk and rk are games. In this challenge, you can assume there are finite number of l's and r's in each game.
The simplest game is where the sets l and r are both empty: {|}...
Which Children Don't Play Well Together? [code-golf]
You are a kindergarten teacher who is having problems with fights breaking out among the students. You have noticed that altercations happen only when certain groups of children are together. A group of children who can't play well together, b...
I almost said something about that paper, but then I realized it sounded like a broken record high school kid who thinks he is too smart to be in Math class.
I used to hate it when kids in my class would raise their hand and interrupt the entire class with "Miss Teacher, how does this apply to the real world?"
I'm sure it has a purpose, or will have a purpose, and I am just too short sighted right now to be able to see it
My partner and roommate is a high school teacher. On the one day that I surprise delivered him lunch at work, half of his class was standing up, backs to the powerpoint presentation, phones in hand, and talking to each other while he was lecturing. It made me angry that he would even allow that to happen.
@Rainbolt I don't know what the situation is in your district, but in many places teachers have basically no recourse. If the (very) limited methods available to them don't have an impact, it's hard to fault the teachers for that.
I suggested that he call parents every single day until the kid gets it right. Every day that the kid can't be quiet, call the parent. The parent will eventually get tired of the phone calls.
Of course, if they ask him not to call back, honor that
But what kind of parent would actually say "Stop calling me about my kid"
I even offered to help him make all of the calls
This would really frontload his semester and then the rest of the semester would supposedly be smooth sailing
If it was just a call like that, every day? I'd tell him to stop. Call me for updates or something out of the usual, by all means. If I'm aware of the situation, constantly badgering me about it will only server to shift my view of the teacher, not the kid.
After one or two calls, the parent is aware of it and trying to work on the issue, or aware of it and doesn't care. Repeated calls at that point serve no purpose but harassment.
I agree he can't force it, but neither can parents.
I've also pushed him to stop changing kids grades just so that they will pass, and instead give them opportunities to raise them (that they have to work for). Seems like extra credit is better than free credit
confiscate phones, stare the children in the eyes, make them come up to the front to write on the board, mock them in front of their friends, don't face away from them, randomly raise your voice, we had a great teacher who would literally stand and shout at a random child for no reason at all for a minute, and then pace around the room, and repeat
@Visual Like I said, parents have tied their hands. Kids complain to their parents, parents complain to the board, putting rules in place to neuter their authority.
@Geobits I'd have to agree, having heard my mother's comments (she was a teacher in the past, and is a teacher now again, now that her children can look after themselves)
@Rainbolt Yea, the board, principal, superintendent... whatever level they have to take it to to make sure their special snowflake doesn't get his feelings hurt any more :P
I'm also aware of at least one teacher at my school who all the students liked (and was a good teacher), but he effectively had to step down from his position because of parents
Everybody's favorite at my high school, was the most ruthless, serious, no bullshit teacher in the entire school. His was the only class I ever made a C in.
@Rainbolt I know many teachers don't have control of much of the curriculum or grade system, but can he weight lecture participation in the overall grade? If failing is the motivator that works...
I think I've described my school a little bit in the past. It follows the "expeditionary learning" model (more freedom and responsibility on the part of the student.)
So give the kids something to do to make it up. Call the parents and say "Your kid is failing, but I gave him this difficult extra credit opportunity to make it up. If you want your kid to pass my class, he absolutely needs to complete this extra credit and get it right."
That way you don't need to fudge grades
And when the principal asks, "Why is your class failing?" you have something concrete to point to.
I agree with that, except for the "concrete to point to" part. Yes, it's concrete, but it might not matter. Anywhere that funding is based (at least partly) on grades/scores is going to have this problem.
You have to be totally willing to risk losing your job to go that route. Some people don't have that, especially since for teachers, that ultimately means moving to another district to find work.
@MichaelT Cool that's what we more or less decided on. Some others here had a good point on readability... i.e. 'B' vs '8' or 'O' vs '0'. So will likely do base-32/33/34 after doing some test print to see how certain characters look.
user55340
All caps, no confusion between glyphs (don't allow either 0 or O)
I was thinking of putting a note on the inputbox that said zero's and O's are interchangeable. Then doing a replacing those characters from the input string before it's passed off to my base-33 function
so... I want to map the alphabet of B to something that includes single character wild cards (? symbols) so that an exact match with wild cards will give me the same answer
I can do that if I am allowed to both A and B I think
by the following method... map 0 to ? and 1 to 0. Now if there is no match then the logical answer is 1
@MartinBüttner ok so the logical answer is 1 if there is at least one pair of 1s that align. This is the same as saying not(there are no pairs of 1s that align)
we are testing "there are no pairs of 1s that align" using the exact matching with wild cards and negating it
@MartinBüttner you don't need to. "we are interested in the or of ands .. so we are interested in (1 and 1) or (0 and 0) or (0 and 1) or (1 and 0) which equals 1" We are only looking to see if at least one pair of 1s is aligned.
oh hang on.. I misread your question
@MartinBüttner let's just look at A = 1 and B = 1 first. We map B ->0 and we have a mismatch, Now let's look at A = 0 and B = 0. We map A -> ? and B-> ? . Now we have a match. So we get a different answer
did that answer your question?
what's it for? Just silly puzzles I like :)
you can do exact matching with wild cards in large documents quickly using FFTs
My coworker just gave me a funny look when he found a GOTO in my T-SQL query. Before a word came out of his mouth I said "I made it 50% faster." and he just didn't say anything after that.
@MartinBüttner yes.. well my mapping works. But I would like a different one that either only has wild cards in either A or B or at least gets rid of the negation
@Geobits yes... A = 0001 and B = 1010 should output No. A=1001 and B = 1010 should output yes
@Geobits but the only thing you are allowed to do is map the alphabets of A and B to a finite set of symbols and the wild card ? and then do exact matching with wild cards
Yea, I just can't see how doing the mapping and then matching with wildcards would ever be faster. I'm not against arbitrary restrictions every now and then, but this just seems weird ;)
@MartinBüttner 1 to 2 in A and B and 0 to 1 in B. Let try A = 0001 and B = 1010 . We get A= 0002 and B = 2121 . This doesn't really get us anywhere does it?
Area of a Self-Intersecting Polygon
code-golfgeometry
Consider a potentially self-intersecting polygon, defined by a list of n ≥ 3 points in 2D space. E.g.
{{0, 0}, {5, 0}, {5, 4}, {1, 4}, {1, 2}, {3, 2}, {3, 3}, {2, 3}, {2, 1}, {4, 1}, {4, 5}, {0, 5}}
There are several ways to define the ar...
(@Peter, I'd value your opinion since it's one of the trickier problems, and you're the kind of person to spot some dodgy edge cases I might be overlooking ;))
The basic definition of a quine is a program that, when run, produces its own source code as output. There are a number of techniques and a number of way to implement those techniques across a number of different languages.
However, not all quine programs are equal. Clearly, any quine in HQ9+ or...
@MartinBüttner It doesn't really make sense to talk about 6d.p. accuracy any more given that you're now restricting the input to integer lattice points.
I found the deviantart profile of the guy who posted that absolutely massive rambling wall of text answer on Board and Card Games. rathenmedus.deviantart.com
Consider a potentially self-intersecting polygon, defined by a list of vertices in 2D space. E.g.
{{0, 0}, {5, 0}, {5, 4}, {1, 4}, {1, 2}, {3, 2}, {3, 3}, {2, 3}, {2, 1}, {4, 1}, {4, 5}, {0, 5}}
There are several ways to define the area of such a polygon, but the most interesting one is the ev...
Totally unrelated, but March Madness is going to be a thing in not too long. It's been a long time since I've made a bracket for it, and I want to try it the "right" way (i.e. programmatically).