## Search found 167 matches

Wed Sep 13, 2017 2:30 pm UTC
Forum: Logic Puzzles
Topic: Another hat puzzle
Replies: 9
Views: 4671

### Re: Another hat puzzle

Gwydion wrote:Just want to clarify - when you say worst-case, do you mean that we can assume an adversary is placing the hats so as to subvert our strategy? Does that also mean that we should treat "guess randomly" as guaranteed to fail?

Yes, and yes.
Wed Sep 13, 2017 11:02 am UTC
Forum: Logic Puzzles
Topic: 538 hats riddle
Replies: 20
Views: 5781

### Re: 538 hats riddle

Also everyone has perfect color vision(much unlike myself T_T) We had two very nice variations a while back where they didn't: see http://forums.xkcd.com/viewtopic.php?p=3811937#p3374392 and the post following it. (Also, I just posted http://forums.xkcd.com/viewtopic.php?f=3&t=123441 with anoth...
Wed Sep 13, 2017 10:54 am UTC
Forum: Logic Puzzles
Topic: Another hat puzzle
Replies: 9
Views: 4671

### Another hat puzzle

The setup is pretty classical : n mathematicians stand in a circle, each gets assigned either a black or a white hat. Everyone can see everyone else's hat, and they each have to guess the color of their own hat. Everyone guesses simultaneously, without hearing the others' guesses. If you are allowed...
Tue Jul 18, 2017 9:37 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9890
Views: 1832945

### Re: Coding: Fleeting Thoughts

I feel like it might have been suggested in the past, but I don't recall anything specific coming of it. Feel free to open an issue about it in csswg-drafts, with the usage examples you're citing (which are why Twitter doesn't actually do gifs; it transcodes them to videos so it can pause them >_<)...
Sun Jul 16, 2017 9:36 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9890
Views: 1832945

### Re: Coding: Fleeting Thoughts

Hm, Xanthir, while you're here. I've been day-dreaming a bit about CSS -- specifically, about an "image-animation" property. Mainly I would really like to be able to use ":not(:hover) { image-animation: disable; }" as a user stylesheet, but it seems like it should more widely use...
Mon Apr 03, 2017 2:53 pm UTC
Forum: Religious Wars
Topic: What is log² x?
Replies: 11
Views: 6934

### Re: What is log² x?

Sensibility aside, I've only ever seen log^2 x as referring to (log x)^2. For example: [1] , [2] . I think it's reasonable from an oral perspective: O(N log^2 N) would be pronounced "oh n log squared n" while O(N (log N)^2) would be the rather more ambiguous "oh n log n squared"....
Tue Mar 28, 2017 1:34 pm UTC
Forum: Logic Puzzles
Topic: Two secrets
Replies: 20
Views: 8896

### Two secrets

I'm thinking of two numbers (x, y) from a large set {1..N}, and you want to find them. At your disposal is the ability to ask questions about subsets S ⊆ {1..N}. For each such question I will (adversarially) pick one of my two numbers, and answer with either (x in S) or (y in S), without telling you...
Fri May 20, 2016 8:11 pm UTC
Forum: Logic Puzzles
Topic: JavaScript chaining challenge
Replies: 6
Views: 3311

### Re: JavaScript chaining challenge

You could also argue that ES6 arrow functions: arr.reduce((total, value) => value) should be okay. Alternatively, you could do: arr.reduceRight(String) if you know the array consists only of strings, or arr.reduceRight(eval) if it consists only of non-strings (and...
Fri Sep 11, 2015 9:09 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9890
Views: 1832945

### Re: Coding: Fleeting Thoughts

Although, as the result is a bool: are there rules against bools having trap values? Can an unspecified bool be a trap value to read? Sneaky, but no: Values of type bool are either true or false. So you would need to invoke UB to get a trap bool. Think of segmented memory. Pointers have two parts, ...
Fri Sep 11, 2015 4:25 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9890
Views: 1832945

### Re: Coding: Fleeting Thoughts

Well, the very next paragraph states that: [...] Otherwise, the result of each of the operators is unspecified. so not as much undefined behavior as unspecified behavior. For reasons I've never quite understood this does not apply to std::less, though: For templates greater, less, greater_equal, and...
Fri Sep 11, 2015 2:31 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9890
Views: 1832945

### Re: Coding: Fleeting Thoughts

Not sure where you got disjoint union. Because pointers/iterators are only valid within their domain? I'm seeing the iterator type as split into separate "universes", based on which container an iterator comes from, such that two iterators are comparable iff they come from the same contai...
Fri Sep 11, 2015 7:28 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9890
Views: 1832945

### Re: Coding: Fleeting Thoughts

A disjoint union of ordered torsors, perhaps?
Sun Aug 30, 2015 9:24 am UTC
Forum: Coding
Topic: Sanitizing Code Submissions
Replies: 6
Views: 3629

### Re: Sanitizing Code Submissions

Within the context of competitive programming, I've heard good things about isolate. Something like this would make Python work.

This SO question describes other approaches to sandboxing.
Thu Mar 12, 2015 12:45 pm UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 526229

### Re: The "IT DOESN'T WORK!" thread

That doesn't sound right. C++ allocators separate allocation and construction; push_back should just do the equivalent of a placement new on uninitialized memory. The behavior I'm seeing on GCC is that the code does not compile because it's missing an operator=, which gets required by the instantiat...
Sat Jul 19, 2014 1:06 pm UTC
Forum: Coding
Topic: Project Euler
Replies: 411
Views: 152809

### Re: Project Euler

Sure, but still, problem 1 is easy to solve with a pen and paper (if you know the tricks) but problem 2 is not (or may I just don't know the tricks). It's not that bad, relatively speaking - I managed to solve it by hand in two hours, which is less than what most Project Euler problems have taken m...
Thu Apr 03, 2014 3:18 pm UTC
Forum: General
Topic: Mod Madness 2014 : The Announcement
Replies: 542
Views: 119794

### Re: Mod Madness 2014 : The Announcement

One sample per hour, containing the first 50 entries of the list of (non-hidden) users seen visiting the fora within the last 5 minutes. So when looking at a particular user the data can be rather spiky:

I'll sent you a PM with the raw data.
Thu Apr 03, 2014 2:02 pm UTC
Forum: General
Topic: Mod Madness 2014 : The Announcement
Replies: 542
Views: 119794

### Re: Mod Madness 2014 : The Announcement

That page builds on data scraped from the who is online page every hour. I believe the vertical scale is something like "average rows (pointing to that user/forum, if specified) saying "reading topic" or "replying to topic", for the particular time of day, times 1000", ...
Fri Jan 31, 2014 9:55 pm UTC
Forum: Logic Puzzles
Topic: Prisoners disguised as guards
Replies: 29
Views: 8550

### Re: Prisoners disguised as guards

I recently came across a paper that discusses a version of this puzzle: http://www.ma.rhul.ac.uk/~uvah099/Maths/ksDRev2.pdf
Sun Jan 19, 2014 9:34 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9890
Views: 1832945

### Re: Coding: Fleeting Thoughts

If you don't care about portability, gcc has a flag -ftrapv for trapping (i.e. crashing, by default) on signed overflow. Performance is about as terrible as you'd expect, but it's lovely for things like Project Euler.
Sat Nov 16, 2013 5:37 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9890
Views: 1832945

### Re: Coding: Fleeting Thoughts

Another approach to micro-optimization: precompute and bitpack the results of __builtin_parity: #include <bitset> #include <vector> uint32_t min_nonlinearity(const uint16_t* sbox) { const int LIM = 1 << 16; std::vector<std::bitset<LIM> > bits(LIM), bits2(LIM); for (int i = 1; i < LIM; i++) { for (in...
Sat Oct 19, 2013 1:00 pm UTC
Forum: Forum Games
Topic: Programming Wars [Round 8]
Replies: 420
Views: 74084

### Re: Programming Wars [Round 6 Results]

Yeah, sorry, I haven't been able to come up with any interesting ideas... If you (or anyone else) can think of something, just go ahead!
Tue Jul 30, 2013 12:03 am UTC
Forum: Forum Games
Topic: Programming Wars [Round 8]
Replies: 420
Views: 74084

### Re: Programming Wars [Round 2]

I'll call this the deadline. Winner is ... benneh, with a full score of 70. Snark is second, with only 26.52 something points. dudiobugtron and phillip1882 are third and fourth (with probably 20 and 7.78... points, but manual solutions). Here's a directory listing, with all the submitted...
Sun Jul 21, 2013 4:32 pm UTC
Forum: Forum Games
Topic: Programming Wars [Round 8]
Replies: 420
Views: 74084

### Re: Programming Wars [Round 2]

Edit: Also, I submitted a solution before realising that this might affect the scores. Feel free to delete my submission since I am only a spectator. Nah, that should be alright. (You can submit here if you're looking for an alternative place though.) But feel free to jump in at any time, Snark and...
Tue Jul 16, 2013 10:34 am UTC
Forum: Forum Games
Topic: Programming Wars [Round 8]
Replies: 420
Views: 74084

### Re: Programming Wars [Round 2]

bluebambue wrote:What happens if two people have the same score?
Scores aren't integers, so it probably won't happen. But let's call it a tie if it does.
Mon Jul 15, 2013 11:25 pm UTC
Forum: Forum Games
Topic: Programming Wars [Round 8]
Replies: 420
Views: 74084

### Programming Wars [Round 2]

Challenge 2: Maze maze.jpg In southern Ontario, many corn farmers create cornstalk mazes like the one shown. The mazes are created in the fall, after the grain has been harvested. There is still time for you to help design the best maze ever for 2013. A field is covered with corn stalks except for ...
Mon Jul 15, 2013 9:39 pm UTC
Forum: Forum Games
Topic: Programming Wars [Round 8]
Replies: 420
Views: 74084

### Re: Programming Wars [Pre Round 2]

Now to analyze what in the heck made operator[]'s so fast! :D I guess didn't comment it very well, so I'll try to provide some insight into what the code does: At its core, it's simply a brute-force (i.e., it tries all possibilities, recursively). The things it does well is quitting ear...
Tue Jul 09, 2013 2:23 am UTC
Forum: Forum Games
Topic: Programming Wars [Round 8]
Replies: 420
Views: 74084

### Re: Programming Wars [Round 1]

Joining! Languages: C++, JavaScript, also Python, Java

I'm hacking on a reasonably optimized piece of C++ right now; I have most 9x9s down to around 0.01 - 1s.
Wed Apr 03, 2013 10:30 pm UTC
Forum: General
Topic: THE MADNESS GOES
Replies: 315
Views: 64091

### Re: THE RECKONING cometh

This link has left me to wonder what "User Activity" is and why mine is zero. It's something like how often you appear in the logs compared to the most commonly appearing user (Dark567, who has activity 1000). This includes data from back to 2010, so it's not anymore a very useful number....
Tue Apr 02, 2013 8:56 pm UTC
Forum: General
Topic: THE MADNESS GOES
Replies: 315
Views: 64091

### Re: THE RECKONING cometh

(I'm the author of that tool. It simply scrapes the "who is online" page once a hour, so it's nothing fancy.) You know what's great? Data . I was kinda hoping for it :mrgreen: You're right, it sucks that we don't have labels on the vertical axis. Aye. The reason for not including them is t...
Tue Apr 02, 2013 12:26 pm UTC
Forum: General
Topic: ITT: We make xkcd slightly worse.
Replies: 8652
Views: 1646608

### Re: ITT: We make xkcd slightly worse.

WolfieMario wrote:Otherwise, I *could* hack the family of the fora font, if its creator (operator[]?) doesn't mind.
Go ahead! I'll try to update all relevant references to point to the modified version.
Wed Nov 23, 2011 5:07 pm UTC
Forum: Coding
Topic: I'm too lazy to write a greasemonkey script
Replies: 3
Views: 3367

### Re: I'm too lazy to write a greasemonkey script

It's easier to just redirect the other domains to forums.xkcd.com: ( from here ) // ==UserScript== // @name xkcd fora redirect // @namespace Nav // @description Redirects traffic from other forum domains to forums.xkcd.com, so you don't need to login three times. // @include http://forums3.xkcd.com/...
Sun Oct 23, 2011 12:21 am UTC
Forum: Coding
Topic: Code Bowling V: The Arithmetic Strikes Back!!!
Replies: 8
Views: 3667

### Re: Code Bowling V: The Arithmetic Strikes Back!!!

It's efficient if it involves bitops, right? get_residue=function(a, b, m){ //to get the whole residue r = [] for (a1 = a;a1|0 == a1;a1 -= m) { //loop over 32-bit numbers r.push(a1) } for (a2 = a+m; a2|0 == a2;a2 += m) { //loop over 32-bit numbers r.push(a2) }...
Sun Oct 17, 2010 7:40 pm UTC
Forum: Coding
Topic: Xkcd coding contest administratorium thread
Replies: 142
Views: 12283

### Re: Xkcd coding contest administratorium thread

Most of them are around 100x100.
Sat Oct 16, 2010 11:07 am UTC
Forum: Coding
Topic: Xkcd coding contest administratorium thread
Replies: 142
Views: 12283

### Re: Xkcd coding contest administratorium thread

Yes, and this is intentional. "Maze" is a bit of a misnomer.
Fri Oct 15, 2010 6:57 pm UTC
Forum: Coding
Topic: Xkcd coding contest administratorium thread
Replies: 142
Views: 12283

### Re: Xkcd coding contest administratorium thread

Bump. Would anyone be up for a coding contest? I suggest this for a task: maze2007.jpg In southern Ontario, many corn farmers create cornstalk mazes like the one shown. The mazes are created in the fall, after the grain has been harvested. There is still time for you to help design the best maze eve...
Wed Sep 08, 2010 1:37 pm UTC
Forum: Logic Puzzles
Topic: 7zip Matryoshka
Replies: 164
Views: 25841

### Re: 7zip Matryoshka

Some hints: #16: Try TinEye if you don't recognize the image. #16 (additional hint): Related Wikipedia article. #17: This anagram solver works for undecim's hint. #17 (additional hint): javascript:alert(document.body.innerHTML.match(/( [bdefghilnrstvyI]+){6}/g))
Fri May 21, 2010 1:11 pm UTC
Forum: Logic Puzzles
Topic: 7zip Matryoshka
Replies: 164
Views: 25841

### Re: 7zip Matryoshka

Hint for #0D:
Spoiler:
It is, indeed, a md5 hash.
Bigger hint:
Spoiler:
Hint for #0E:
Spoiler:
Note that it is ASCII art instead of, say, a JPEG.
Thu May 20, 2010 8:10 pm UTC
Forum: Logic Puzzles
Topic: 7zip Matryoshka
Replies: 164
Views: 25841

### Re: 7zip Matryoshka

Hint for #0C: Try looking at the file with something other than a picture viewer. Almost giveaway hint: ���� JFIF  H H �� Created with GIMP�� C ������������������������������������������������������������������ C������������������������������������������������������������������  � �" ...
Fri May 14, 2010 12:39 pm UTC
Forum: Logic Puzzles
Topic: 7zip Matryoshka
Replies: 164
Views: 25841

### Re: 7zip Matryoshka

Wow, I guess the next logical move would be a brute force assault on the password, I must've tried everything by now :P I'll check back in a few days to see if anyone has gotten this, but I'm done for now, never thought I'd be an insane cultist specialist :) The answer is "...
Wed Apr 21, 2010 9:46 pm UTC
Forum: General
Topic: ITT: We make xkcd slightly worse.
Replies: 8652
Views: 1646608

### Re: ITT: We make xkcd slightly worse.

Sources: http://xkcd.com/71/, http://xkcd.com/572/, alt hosting http://i.imgur.com/CLhoz.png I hear the same method also works for providing principal values for multi-valued functions. ( [1] [2] [3] [4] ) Dinosaur Comics slightly worse? Sources: http://www.qwantz.com/index.php?comic=1668, ...

Go to advanced search