« first day (808 days earlier)      last day (4156 days later) » 

12:03 AM
and now it's 2013 in my timezone and I give even less of a shit than I did previously, which is impressive (and I thought impossible)
3
 
It's 2013 man. It's a special year.
 
@irrelephant gf has been looking at that for a while now :)
 
lol man this code is so slow I might have grown a beard
 
12:07 AM
;_;
 
@Rapptz You don't already have a beard?
 
I do.
 
trying to think of a better algorithm
 
Didn't we do the whole no shave november show off thing here?
for like.. 5 minutes.
 
Movember, and I don't think so.
 
12:08 AM
but.. but.. why shave if you can code?
 
because looking at this is exciting
 
Question for those of you in next year: Is it better than last year has been?
 
@BenVoigt It's 1:12 AM and I'm writing code. Go figure. (Spoiler: it's awesome here in 2013!)
 
I'm coding, home alone, profiling code, eating junk food in my bed alone. How much better can it be?
 
I dunno. You could be coding and eating steak.
 
12:13 AM
 
Aggggh! Next year is worse, DeadMG proved it. How can I stay in 2012?
 
@DeadMG I find it odd that I have a feeling exactly how you found that.
 
@BenVoigt Try triggering a breakpoint
 
2013 is an ugly number
 
is 2013 prime?
 
12:15 AM
@JohanLarsson 3*11*61
 
@JohanLarsson No
 
@TomvanderWoerdt: funny thing about breakpoints -- they stop fetch-decode-execute but not hardware clocks
Now, where did I put that clock enable signal?
 
@BenVoigt You can force the kernel to slow down the hardware clock by 1/1000 ?
@BenVoigt to* not by.
 
@TomvanderWoerdt that was fast, nice
 
@JohanLarsson I Binged it
 
12:16 AM
zzzz
 
@AgainstASicilian ?
std::make_pair takes up 63.17% of the P(n) function, lol
I'm not even gonna lie that's pretty funny
 
really?
what :O
 
@Rapptz get a better compiler...
 
I'm using VS2012's profiler
So I'm using Update 1 as my compiler
 
I don't know much about VS2012 (or Windows dev at all) but can't you just switch to mingw and try again?
 
12:22 AM
I do use MinGW as my main compiler but trying to find profilers for it is really a pain the ass
 
Apple has a pretty amazing profiler in its dev suite, you should try it
(probably not an option for you though)
 
time for me to hit the sack
 
night puppy
happy new year
 
@DeadMG Goodbye
 
37 seconds for 1000/10^7
 
12:26 AM
@AgainstASicilian ?
 
in the N^2 algorithm
outer loop
37*10000 seconds = 4.25 days
ish
lol
 
:(
 
Improve your algorithm then...
 
You wanna try it?
Who knows, it might be fun :P
 
what's the algorithm?
 
12:30 AM
well here's the problem
Let's call a lattice point (x, y) inadmissible if x, y and x + y are all positive perfect squares.
For example, (9, 16) is inadmissible, while (0, 4), (3, 1) and (9, 4) are not.

Consider a path from point (x1, y1) to point (x2, y2) using only unit steps north or east.
Let's call such a path admissible if none of its intermediate points are inadmissible.

Let P(n) be the number of admissible paths from (0, 0) to (n, n).
It can be verified that P(5) = 252, P(16) = 596994440 and P(1000) mod 1 000 000 007 = 341920854.
 
Not a native English speaker here so I'm having trouble understanding that :)
 
@AgainstASicilian man.. that'll take forever.
 
that wouldn't take forever if you can find an O(n) algorithm
 
easier said than done.
 
@TomvanderWoerdt Of course, lol
That's the whole challenge
 
12:34 AM
oh, it's a challenge?
 
it's a project euler problem
I just want to get sub-100
:(
I'm always like sub 110 but only been sub 100 once and never been sub 50
 
i'm usually sub 100
sometimes sub 50
never sub 15
 
well, minor optimization if you avoid using too much STL, and if you just halve the amount of calculations done by only going up from (0,0) and then multiplying the result by 2
 
in this case i may not make the first 100
 
so you're in that list of fastest eulers then?
 
12:38 AM
yeah but not very high on it
 
but that makes it easy to find you :( I thought you didn't want that
 
@AgainstASicilian so you're among the slowest of the fastest?
 
@StackedCrooked XD
@Rapptz not that easy
 
user142019
fuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuck
 
user142019
Stupid Linux I never told you to put /tmp in RAM drive.
 
user142019
12:40 AM
Fuck this shit.
 
DavidKurokawa?
 
even if you guess right I am not saying XD
but no, that guy did solve 408 though
 
Only other guess is neverforget
 
umm, find a recursive definition of that problem
I guess the problem is with the conditionals?
 
maybe you can use the fact that square numbers follow the pattern +1 +3 +5 +7 +9, etc
 
12:43 AM
the square numbers is not the issue
 
(+1 = 1, +3 = 4, +5 = 9, +7 = 16, +9 = 25)
 
if x = a^2, and y = b^2 then x+y = a^2 + b^2 = c^2 then they're pythagorean triples
 
not the issue, perhaps, but these little details can really help you figure out an algorithm that's not O(n^2)
 
so you just have to generate those
and generating those was an issue for me :( until Against helped a bit
so now they take up less than 0.1%
 
generating the points is a solved problem at this point
the focus now is the counting algorithm
 
12:51 AM
you can store true/false for whether a number is square in 1.25MB of memory, which can probably be cached by most CPUs, and you can just lookup x/y in that table instead of generating points the hard way
(1.25MB for 10 million numbers)
 
the problem is finding the total amount of paths while accounting for the inaccessable nodes
 
start looking for a more mathematical approach
any 'bad' block (looking at it as a grid right now, with 'good' and 'bad' blocks) will block any access from the left and from the bottom
the amount of paths that go from (0,0) to (x,y) plus the amount of paths that go from (x,y) to (n,n) is equal to the amount of paths that go from (0,0) to (n,n) through (x,y)
 
yes, but any number of those paths pass through other bad blocks
 
(divide and conquer strategy might be used here)
there's a line from (0,0) to (n,n) that divides the first sector already: you can start at (1,0) then go to (n,n), then just multiply by 2
(citation needed)
just came up with an algorithm that might work
think of imaginary lines that divide the entire space. with n=100, you can draw this line at y=50. then for each node on this line, calculate the amount of paths to it by recursively calling this algorithm
then a line at y=25, y=13, etc
 
Hey all.
 
1:00 AM
@Cygwinnian Hi!
 
you don't need recursion; i have an iterative algorithm that works
but you can't do it by-cell, as it's O(N^2) in the end either way
too slow
 
my algorithm might be <N^2
it'll probably require a lot of memory though.
O(N^2) is probably too slow to win.
 
it's very slow here
10^14 is huge
 
I just realized that my algorithm makes absolutely no sense, so just ignore me.
 
user142019
Hee nog een Nederlander. Cool.
 
1:11 AM
@Zoidberg'-- I wouldn't consider myself Dutch.
 
user142019
Oh. xd
 
Happy new twelve months of keeping track of who implements what. Happy happy
 
cpx
Happy new year.
 
happy new year GMT-1 people! :)
 
user142019
Happy new day.
 
cpx
1:12 AM
Happy new month.
 
Happy birthday
 
Slightly unrelated: the next non-leap year where (year mod 4 == 0) is 2100
(not that 2012 was one of those years.)
 
That guy uwi always finishes first
 
does it have to be c++?
 
what language will you use?
 
1:23 AM
if time matters, asm
 
it can be any language really
but dang asm.
 
or C or maybe even C++
probably C
 
i have no idea how these guys finish so fast
 
user142019
That sounds so wrong.
 
uwi has finished first/second like the past 10 problems or something
;-;
 
1:25 AM
yeah
 
can you use multiple threads?
can you use OpenCL?
 
you can use whatever you want
whatever gets you the answer
 
user142019
You can use Coca-Cola. Terrible pun.
 
yeah it's language agnostic, there's just an Answer box and a captcha
 
Is there a list on how fast people have solved the different problems?
 
user142019
1:27 AM
Oh PE. You can do those things by hand if you want.
 
I did a lot of problems by hand.
:(
 
oh okay, I thought they would benchmark your algorithms and then select the fastest one
 
@JohanLarsson Sort of.
 
user142019
I usually solve PE problems with Haskell.
 
I like Python, C++, and sometimes Mathematica
 
1:29 AM
I'll google for it
 
That's what it says for neverforget's profile >:O
and uh
There's a twitter bot that publishes first 50 solvers
and there's the Eulerian page which lists the top fastest
 
Does anyone know why the unique_ptr constructor accepting std::nullptr_t is not marked constexpr?
 
1:42 AM
I am clueless. And the robot isn't here.
 
@GManNickG It is, according to cppreference
 
I've been toying with the idea of implementing policy based classes with boost::variant and visitor. This gives me type-erasure but it probably costs me some of the inlineability. poc
 
@Praetorian Well that solves that problem. :P
I don't know why I assumed it wasn't.
 
constexpr unique_ptr(nullptr_t) noexcept
: unique_ptr() { }
That's from the standard
 
Yeah. Hm, but now why not the one accepting pointer?
 
1:50 AM
Hmm, no idea. Can't think of a case where it'd need to do anything other than store a copy of the pointer
 
I asked this question a while ago: Are function-local mutexes thread-safe?. If you read "function-local" do you think it implies static local variable or just a local variable?
It seems to have caused some confusion.
 
Just local?
 
I'd say it implies non-static
 
function-local to me implies just a local variable, something within its scope
 
imho a static variable in a function is a global, not a local
(not sure about the actual definition)
 
2:03 AM
@TomvanderWoerdt It's locally declared to be global :)
 
sure, but do we then call it a local or a global variable?
 
Ok, changed my question to Are function-local static mutexes thread-safe?.
Lol.
 
We call it a static local variable :)
 
"function-local static" = global
(but limited to that function alone)
 
Unless it is returned from the function by reference.
 
2:05 AM
then you don't really get the variable, but the value
well, the reference
 
Which makes it a global variable that is not prone to static initialization fiasco.
 
"static init fiasco"?
 
can we just say function-global then?
 
ta
Yeah I kinda thought you were referring to that.
 
2:09 AM
It applies to all global variables not just statics.
However, function-local statics have well-defined order of construction and destruction relative to each other.
 
user142019
You know.
 
user142019
Overcoming the static initialization order fiasco may be the only valid reason ever to use a singleton (assuming a lazy singleton).
 
Note to self: writing a test function is not enough. You also need to call it.
 
user142019
No wait you don't need a singleton.
 
user142019
Just a function that returns a reference to the global, thread-safely initializing it when it's not yet initialized.
 
user142019
2:22 AM
What do elephants have that humans don't have?
Baby elephants.
 
tha name of dog doth not matter, as long as dog responds to name (and as long as others know of tha dog of which you speek)
@Zoidberg'-- baffled mice discussing their body parts
?
 
user142019
I already answered it myself.
 
user142019
In the same message, even.
 
so, it was not just a suggestion?
 
user142019
2:24 AM
Then I'd have ended it with a question mark. :P
 
so, it was, like, the answer
ok
 
considering the brain size of elephants, why are they not smarter, or are they?
 
user142019
@StackedCrooked lulz
 
I'll take my nobel prize now.
:P
 
user142019
2:26 AM
@Cheersandhth.-Alf less connections between neurons.
 
user142019
Hey guys guess what I'm doing.
 
also, there is an interesting law that no matter the size of creature, it lives roughly a certain number of heart beats (a universal constant)
 
user142019
Three guesses max.
 
so, person with big heart, lives longer
 
@Cheersandhth.-Alf Maybe they have close to solid skulls?
 
user142019
2:27 AM
@Cheersandhth.-Alf what about an animal with multiple hearts?
 
user142019
Yes.
 
user142019
Octopuses have multiple hearts, IIRC.
 
@StackedCrooked what is it going to be? are you using scintilla or like?
 
user142019
2:29 AM
@Cheersandhth.-Alf Octopuses have three hearts.
 
user142019
Also
 
octopi ← dan quayle
 
user142019
Humans once mutated a frog (or some other animal) with DNA from a multi-hearted creature, and that mutated frog was born with multiple hearts and could just live without any problems.
 
@Cheersandhth.-Alf I put my bets on DNA manipulation.
 
@StackedCrooked the looks-like-source-code-editor thingy?
 
user142019
2:31 AM
It's his Ideone clone.
 
user142019
Everybody in this room uses it for C++11.
 
@Cheersandhth.-Alf It's using the JavaScript ace editor.
 
Why do one want to live long? I don't think there are that many 80+ having much quality in their lives.
 
learned something new then :-) thx
one wants to be forever young
 
user142019
2:32 AM
@StackedCrooked Write your own editor!
 
@Zoidberg'-- Aye!
@Cheersandhth.-Alf That looks like a crybaby.
 
user142019
I find it most vexing how Ace uses Control+L for go to line instead of the default browser behaviour of moving focus to the address bar. :<
 
user142019
Websites that override short cuts, no matter where they're from (browser, OS, whatever), are terrible. xD
 
2:34 AM
You can use a native editor and send the compilation commands with wget.
 
user142019
:O
 
user142019
I should make a Vim plugin.
 
set makeprg=wget -nv -O - stacked-crooked.com/compile --post-data=%
Or something like that.
 
user142019
alias :P
 
user142019
Also quotes.
 
2:39 AM
hi guys, im developing a dll and i need to share a instance of a class whit all the aplications using the dll, so its a good practice use a singleton, or should i make a class and in the dll´s namespace put a method to get an instance?
 
The heartbeat hypothesis postulates that every living creature has a limited number of heartbeats or breaths. The hypothesis is based on two observations. First, that small mammals (such as a mouse) have rapid resting heart rate compared to a larger mammal (such as an elephant), and that their respective lifespans are inversely proportional to those rates. Second, is that athletically fit people tend to have a lower resting heart rate and tend to live longer than unhealthy people. In 1926 Raymond Pearl proposed that longevity varies inversely with basal metabolic rate (the "rate of living ...
 
@JuanAntonioOrozco You are looking for Inter-process communication. And you can't simply do that with a singleton. (The instances will be unique per app.)
 
@JuanAntonioOrozco absolutely bad idea
there is no good practice
 
user142019
Oh cool has Objective-C has underlying types for enums now.
 
because it's bad practice
except it's so bad it isn't practice
 
2:41 AM
> Additionally, the life span of houseflies can be extended by preventing physical activity.[3]
How is this related to heart beat at all?
 
Activity increased speed of heart beat?
 
There are other things physical activities do, it isn't limited to just heart beat. There are a lot more chemical processes involved
 
Yeah yeah.
 
The Hayflick limit The Hayflick limit was discovered by Leonard Hayflick in 1961, at the Wistar Institute in Philadelphia. Hayflick demonstrated that a population of normal human fetal cells in a cell culture will divide between 40 and 60 times. The population will then enter a senescence phase, which refutes the contention by Nobel laureate Alexis Carrel that normal cells are immortal. Each mitosis slightly shortens each of the telomeres on the DNA of the cells. Telomere shortening in humans eventually makes cell division impossible, and this aging of the cell population appears to corr...
 
user142019
If you want to do IPC use message queues.
 
2:44 AM
or just mailslots on windows
;-)
 
You can use email also.
 
user142019
@Cheersandhth.-Alf ØMQ is portabler. :P
 
user142019
@StackedCrooked omslachtig.
 
user142019
Also use messages queues for inter-thread communication.
 
so whats the best method to share a class instance betwen 2 o more aplications, im developing for windows but latter i will port that code to a linux .so
 
user142019
2:46 AM
Or, for very simple cases, use std::async and futures.
 
I never really programmed anything IPC.
@JuanAntonioOrozco Give each exactly 50%.
 
user142019
@JuanAntonioOrozco any reason you really want the two programs to directly access the class?
 
user142019
Message queues would make this a lot easier.
 
user142019
Otherwise you need locks and crap.
 
@JuanAntonioOrozco I would probably be inclined to use UDP or something. Depending on the performance requirements.
 
user142019
2:48 AM
I love actor model so much. No more explicit locks.
 
@Zoidberg'-- well thinking it again none, thanks
 
@JuanAntonioOrozco the clues you're missing are (1) that if you really needed it then it would be bestest as a separate process, not as an in-process DLL, and (2) that you don't need it: it's an XY problem you're asking
 
user142019
One actor manages one or more objects synchronously. Need to access that object, you gotta do that through the actor.
 
Hey, you are 18 years old. Last time I checked it was 17.
 
2:49 AM
@Rapptz for your sieve of eratosthenes, do you use an array of bools or a bitset or what?
 
user142019
@StackedCrooked I know I am 18 years old. No need to tell me that. :P
 
I have one with bitsets and one without it
 
which one is faster?
 
thanks for your help, neddles to say im mora a php guy than c++ one
 
both are about the same but bitset might be faster
 
2:50 AM
hmm ok :)
 
@JuanAntonioOrozco ah, php, that explains it
 
btw, where did johan larsson find the getPrimes function?
 
user142019
lol
 
i can't find it
 
user142019
PHP is horrific.
 
2:51 AM
PHP is Poop Hell Poop
 
user142019
@StackedCrooked Y U LOOK AT MY PROFILE D:
 
To stalk you obviously.
 
If you want an example of the bitset one uh
 
user142019
Seems legit.
 
whoa too big there we go
 
2:52 AM
No panic.
Nobody was gonna bin it.
 
@Rapptz thanks :)
 
user142019
start_logger() ->
    spawn(?MODULE, loop, []).

loop_logger() ->
    receive
        Message -> io:format("~s~n", [Message]), loop_logger()
    end.

foo() ->
    Logger = start_logger(),
    Logger ! "Hello, world!",
    Logger ! "This is logged!".
 
user142019
This is why I love Erlang.
 
@Tuntuni I wrote a crappy one myself
 
user142019
No locks, yet fully thread-safe.
 
2:55 AM
@JohanLarsson did you get this one on the internet?
 
@StackedCrooked How do I use std::chrono to time my programs? I've seen you do it but everytime I do it I get 0.
 
@Tuntuni Or you mean on the wikipedia site, it was down in the links
 
@JohanLarsson ahhh, there .. :D
 
@Tuntuni I don't understand
 
@JohanLarsson johan larsson was talking about one he found on the wiki page but i couldn't find it
found it now
 
2:58 AM
It's the Stopwatch class that I use.
Whoops, elapsed() can be const there.
 

« first day (808 days earlier)      last day (4156 days later) »