« first day (372 days earlier)      last day (4569 days later) » 

9:00 PM
Finally, a photo where the food doesn't look like Miss World. Norwegian "fårikål". Sheep in cabbage! Very good. Doesn't look like much, though.
Main ingredients: lamb, cabbage, black round peppers, water, some people add some flour
 
@FredOverflow right-click > View Page Source?
Now don't tell me that doesn't work either.
 
@FredOverflow You are not able to figure this out yourself?
 
thx :)
Now this is what I get when I register. Do you get more?
 
@FredOverflow You, who implemented the 8 queens problem solver with C++ compile meta programming?
 
That gives you the source, i.e., what the server sent to the browser, but not the current state of the DOM (as modified by JavaScript and such).
 
9:02 PM
note that the html tag isn't even closed
There must be something wrong with who-knows-what.
 
@StackedCrooked Did you see my Haskell solution?
 
@StackedCrooked Actually I googled, and it was like the 8th hit or something.
 
@FredOverflow What??
 
@FredOverflow do u want me to try?
 
9:03 PM
I'm used to Opera, and there you can find it in the View menu.
 
@RMartinhoFernandes I don't think I have seen it.
 
@AlfPSteinbach Try what? Register? Yes, please.
 
@RMartinhoFernandes Feel free to post me the link.
 
It's Ctrl+U in most browsers.
 
3
A: Solve the eight queens problem at compile-time

Martinho FernandesI came up with a solution that uses the Haskell type system. I googled a bit for an existing solution to the problem at the value level, changed it a bit, and then lifted it to the type level. It took a lot of reinventing. I also had to enable a bunch of GHC extensions. First, since integers are...

 
9:04 PM
"Thank you, alfps, your account has been successfully created and you may now login."
 
What the fuck is wrong with my computer?
 
"You are seeing this page because your email address has not yet been validated. Please ensure that the email address below is correct and click "Send Email". You will then receive an email containing a validation link/activation code. You can either click the link in the email or use the activation code found in the email on the next screen."
 
@RMartinhoFernandes Thanks.
 
@AlfPSteinbach never got any email
 
Maybe someone else can register you?
Unless the login page doesn't work either.
Did you try refresh while holding a combination of Shift and/or Ctrl to bypass the cache? (I never know which one it is, so I just try at random)
 
9:07 PM
When I try to login, I get "login failed" at the top. When I try again, it disappears. But I'm still on the login page.
Okay, I just tried registering ten mores times, and suddenly it worked!
> Thank you, ProjectFred, your account has been successfully created and you may now login.
 
Something doesn't work on the web? Apply more F5.
4
 
take off those wheels, mount them again, restart engine: voila, no longer flat tyre
 
The tried and true "reboot until it works" method.
 
> Your email address has been successfully validated
The goose has nested!
 
9:11 PM
The LaTeX guys are quite used to it "Compile. Repeat until it's compiled."
 
I could never figure out why the damn thing can't implement multipass on its own.
 
Btw this was my 8 queen solution in C++ which I once frantically coded at 2 AM. A little quick-and-dirty but quite simple in retrospect.
 
> Congratulations, the answer you gave to problem 1 is correct. You are the 177092nd person to have solved this problem.
 
Well, you won't get a medal for that.
 
9:14 PM
What are you using to solve them?
 
@RMartinhoFernandes sorry I'm too tired to try to understand your Haskell code. (I'll try again tomorrow, since I do know the basics of the syntax).
 
Maths? Haskell? Some other programming language?
@StackedCrooked Don't worry if you don't understand it. It's chock full of GHC extensions and it's all at the type level, even the driver in the end.
 
I solved the first problem with Math, but since I was too lazy to calculate the result, I wrote a C++ program :)
 
@FredOverflow That doesn't really make one feel special.
 
I once solved about two or three dozens of the problems in Haskell, but then I forgot my user name, so I have to start over :)
 
9:16 PM
@FredOverflow It's like they are saying: "Congratulations! You're nobody."
 
@FredOverflow Hah, me too. But I kept the code in a repository, so I just had to rerun everything :)
 
When you solve a problem, you can read a forum thread where other people post their solutions. Guess what language was used by the first two posters on problem 1? :)
 
9:18 PM
nope
 
Microsoft Visual C++
 
nope
 
Ok, I'll have login to see it.
 
9:18 PM
C++
 
It's x86 assembly language :)
 
Those guys finally found a challenge that fitted their scope.
 
followed by PHP and C++
 
9:20 PM
@FredOverflow That link only works for logged in users who solved it.
 
@RMartinhoFernandes And you didn't solve problem 1? :)
 
Guess what. I forgot my username.
 
I remember reading that C++ is a popular language in programming language contests.
 
@RMartinhoFernandes lol
 
It's the third time I register.
So you can be happy that you were actually the 177090th person to solve problem 1 :)
 
9:22 PM
5 hours ago, by FredOverflow
@Griffin If you're interested, here is my solution without arrays or loops.
 
Ah, points everywhere!
:P
 
@RMartinhoFernandes I already did it a couple of years ago, so I'm probably more around 150000th or something :)
@RMartinhoFernandes I like points in C++ :)
 
Yeah, me too.
Pointfree C++ sounds scary.
 
@RMartinhoFernandes You could put your Project Euler username into your stackoverflow profile in case you forget it again.
 
Oh, that's actually a good idea.
 
9:26 PM
@StackedCrooked In Java, it means unsigned right shift. In Haskell, it means arrow composition.
@RMartinhoFernandes And while you're at it, put your mom's birthday there ;)
 
@FredOverflow No, that would be >> (called "sequence")
>>> is arrow composition.
 
oh right :)
 
hello
 
import Control.Arrow ((>>>))
That's so cute :)
(>>>) :: Control.Category.Category cat => cat a b -> cat b c -> cat a c
meow!
 
9:30 PM
(.) = flip (>>>)
Does that help?
 
Oh, I already knew what (>>>) means :)
Hm, the Haskell room has been dead for 10 days, and one of the last messages was:
in Haskell, Oct 13 at 19:07, by R. Martinho Fernandes
I'm trying to see if (.)(.) can be useful.
 
@RMartinhoFernandes Is (>>>) just flip (.), or is it more powerful/abstract?
I suppose it works on more types?
 
Yes, it's generalized.
It works with (->) but it also works with Kleisli arrows (aka monadic functions) for example.
 
in Haskell, 10 secs ago, by FredOverflow
My Project Euler username is ProjectFred.
In case I forget :)
 
9:34 PM
I noted my new one in my profile.
 
@RMartinhoFernandes Why can't I write (a ->) instead of (->) a? The second one somehow looks as if the arrow goes to a (instead of from a, which it actually does).
(->) a is the Reader Monad or something, right?
 
You can't use sections on types.
 
Why not? I thought Haskell was super-orthogonal.
 
Dunno.
In fact, now I wonder how one would refer to (-> b) (if it was possible).
 
@RMartinhoFernandes I find my solution a bit sexier ;)
 
9:39 PM
Oh, how do you do that?
 
Why doesn't it display the number of solved problems?
 
Neat, now I need to get that "Solved" number bumped up, next time I boot up Linux.
@FredOverflow I just re-registered.
 
But shouldn't it at least display it as 0? Or is it not the number of solved problems, but a list of the solved problems?
 
Oh.
Could be. Solve number 3!
 
Nah, that would be bad luck ;)
Oh wait, I discussed problem 20 some time ago in the Lounge...
> Congratulations, the answer you gave to problem 5 is correct. You are the 110867th person to have solved this problem.
Still shows "Solved 1", must be a cache issue.
Oh cool, you even get a PDF discussing the problem once you solved it. Must be a recent addition.
 
9:46 PM
Nah, that's been there since ever.
 
Then I simply must have been to blind to see it :)
 
Only on some problems though.
Nope.
 
stupid caches :(
 
Maybe you didn't solve problem 5 ;)
Hey, friend me: 90015696275480_edfcdabf92f8c5bcb23fcf95dac102e4
 
4 mins ago, by FredOverflow
> Congratulations, the answer you gave to problem 5 is correct. You are the 110867th person to have solved this problem.
*Main> 2 * 3 * 2 * 5 * 7 * 2 * 3 * 11 * 13 * 2 * 17 * 19
232792560
 
9:49 PM
Ugh, I'll spend all night trying to use FT.
 
Fortran? :)
 
Screw that, I'll cheat and use GDI instead.
 
I always preferred NOD over GDI. They had these awesome laser towers.
 
mawning
 
You have earned 1 new award:

Baby Steps: Solve three problems
I don't remember this.
 
9:53 PM
Now, do I remember how to use CreateFont.
 
10:04 PM
According to wiki, VBO was first introduced in OpenGL 3. Is this true?
I thought they had VBO's in OpenGL 2 also
 
I thought those were on 1.5
 
Sorry
FBO's
But that's the same thing maybe? I don't really know
 
What's VBO then? =)
 
A framebuffer object holds pixel data.
A vertex buffer object holds vertex data.
 
10:06 PM
> Congratulations, the answer you gave to problem 7 is correct. You are the 94590th person to have solved this problem. You have earned 1 new award: Baby Steps: Solve three problems
 
@RMartinhoFernandes Of course, I'm mixing things up
 
FBOs can be used for output and input.
 
I meant VBO
from the start
 
VBOs are used for input.
 
are they not implemented in OpenGL 2?
 
10:07 PM
It took me about 2 minutes to write a prime number finder, and then about 15 minutes to find out how to convert a Float to an Integer... why is stuff like that so hard in Haskell?
 
(Maybe output with the new geometry shaders, but I wouldn't know)
 
Yes, in FBO you can render data and use it in your shaders
but I was going to use VBO's now
 
@ManofOneWay I distinctly remember using them (VBOs) for my CG class, and we used 1.5.
 
But they seem to be added first in OpenGL3 :( and I only have 2.1 support
Yes I've misread I believe
 
@FredOverflow floor?
 
10:09 PM
exactly
 
It's not that hard.
You're just used to conversions.
 
Well, you certainly won't find it by hoogling Float -> Integer.
 
Yeah, you need to use type classes :)
Float -> Integer is not generic enough :)
 
--  in  if (all (\x -> (p `mod` x) /= 0) candidates) then p : rest else rest
    in  if (all ((/= 0) . (p `mod`)) candidates) then p : rest else rest
There, I did that just for you ;)
 
:)
Can do better.
 
10:13 PM
show me
 
But starts to get unreadable.
You can get rid of p with ((/= 0) .) . ($ mod)
You were the one who taught me that (concat .) . map trick :P
 
I find it strange that if foobar than x : rest else rest has not been factored into a library function.
Oh, I need p in other places, really don't want to get rid of it :)
 
I find it strange that g++ can't handle Windows filenames
but now at least the code to support my writings works, for both reading and writing file with arbitrary name
 
wchar_t     buffer[MAX_PATH];
yuck
 
but the design is a bit ungood: when the compiler's standard library doesn't support general names, then obtaining good name creates a file...
 
10:17 PM
hopefully( 0 < nChars && nChars < MAX_PATH )
lol
 
no, don't yuck on arrays. that's not so smart. what would you have instead?
 
I don't know, arrays just give me the itches...
 
when u need an array, u need an array. then i think it's not good to add more on top. unless it's needed.
 
What is throwX, a function your wrote yourself?
 
#if defined( _MSC_VER )
#   define  NORETURN    __declspec( noreturn )
#   pragma warning( disable: 4646 )     // non-void return type
#elif defined( __GNUC__ )
#   define  NORETURN    __attribute__(( __noreturn__ ))
#else
#   define  NORETURN
#endif

NORETURN inline bool throwX( std::string const& s )
{
    throw std::runtime_error( s );
}

inline bool hopefully( bool v ) { return v; }
but it's all together just for writing about it.
i think in normal code better to put compiler-specific thing in compiler-specific file, dragged in via compiler-specific include path...
 
10:19 PM
What's the point of NORETURN? ;)
The point of no return is the point beyond which one must continue on his or her current course of action because turning back is physically impossible, prohibitively expensive or dangerous. It is also used when the distance or effort required to get back would be greater than the remainder of the journey or task as yet undertaken. A particular irreversible action (e.g., setting off an explosion or signing a contract) can be a point of no return, but the point of no return can also be a calculated point during a continuous action (such as in aviation). Origins and spread of the ...
 
the same as "noreturn" in c++11
so that the compiler won't complain if a function that should return something, only calls throwX. then compiler knows that that call does not return
 
cool, never heard of it before
 
It's [[ noreturn ]] with the new, not implemented anywhere syntax.
 
ugly syntax
 
didn't they remove the brackets?
 
10:20 PM
Only for alignas.
 
[[ _Ugly ]]
 
Yes the attribute syntax is ugly
but it's better than using some macro to handle different compilers :)
And pragma for OMP for example^^
 
In the future you can have [[ msvc::super_duper_msvc_attrib, gcc::super_duper_gcc_attrib_that_does_the_same_but_with_a_different_name, clang::and_the_super_duper_clang_version ]] int x;
I'd rather use a macro.
 
hm, it helps to paste code. then i see errors from copying (wrong definitions from documentation).
 
10:27 PM
Sometimes you have to wonder, do they really know what they're doing, or are they just trolling us.
 
@CatPlusPlus At least that must compile everywhere.
 
@RMartinhoFernandes i failed to understand Heinlein's reference to the "SDS". they were out space-walking and nobody would say what was going on at the secret part of the station. but somebody almost blew it by mentioning the "SDS"
the Super Duper Snooper
 
@AlfPSteinbach Hmm, I haven't read much Heinlein yet. I didn't know "super duper" came from him.
 
@RMartinhoFernandes macro make code more obscure, and with this syntax you can specify some attribute and it won't cause any compile error.
 
@Geoffroy Right, and if you want portability you either use a macro or specify a train of attributes.
 
10:32 PM
For example if you create a library
You need to specify dllimport and dllexport stuff for windows
 
And for GCC as well.
 
which is useless for unixoid
 
Okay, screw TrueType. Let's just do old school bitmap fonts.
 
Except with different names.
 
I don't need any of that for gcc
 
10:32 PM
Do you compile shared libs?
 
yes
 
And you don't use the visibility attributes?
 
never heard of them
 
So you just make everything visible.
 
No :)
 
10:33 PM
Everything hidden?
 
I don't really know
the only visibility I know
is that because of C++ mangling
So I export the method to use
as export "C"
 
May be useful, thank's :)
 
See the problem I was hinting at now?
 
Yes
 
10:38 PM
Now, at least writing the macro will be easier.
No #ifdefs needed.
 
Yes :)
 
lol
> ... & blow your family to smithereens!
 
Er..
It's a pity DevIL took the OpenGL state machine style crap.
ilBindImage why, oh why?
 
it's a pity the OpenGL state machine crap stuff ever existed
let alone that it perpetuated through OpenGL
 
11:36 PM
room topic changed to Lounge<C++>: Why so synchronous? [c++] [c++11] [c++-faq]
 

« first day (372 days earlier)      last day (4569 days later) »