« first day (412 days earlier)      last day (4536 days later) » 

6:03 AM
@RMartinhoFernandes Discovered any cool operators in Haskell, lately?
 
I've been reading about performance and optimizations.
Learned a bunch of details I was missing.
 
for example?
 
I only had vague ideas about strictness, for example.
 
seq?
 
6:06 AM
What's the difference between foldl and foldl'? :)
 
The latter is strict!
It won't overflow the stack.
(Well, in general. I guess you might still use it in a way that overflows)
 
Does Haskell even have a notion of stack? :)
 
Not the call stack.
The thunk stack.
3
 
3 hours ago, by R. Martinho Fernandes
#define TABLE_SIZE 100489 // must be a power of 2
LOL
@RMartinhoFernandes Does "thunk" stem from "think"?
 
No idea where the name comes from.
It's a delayed evaluation.
 
6:11 AM
Maybe it's something that needs to be "thinked" ;) later. Some kind of "TODO think".
 
Does this apply?
26
Q: What is a 'thunk'?

fbreretoI've seen it used in programming (specifically in the C++ domain) and have no idea what it is. Presumably it is a design pattern, but I could be wrong. Can anyone give a good example of a thunk?

 
Doesn't C++ use thunks for multiple inheritance?
 
Eek, Design Patterns.
 
Oh, second answer covers it.
 
@Pubby Yes. But that's an overload.
 
6:13 AM
Wonder if any languages have a thunk construct
 
Isn't the term "overloaded" overloaded itself? As in "stuffing too many people in an elevator" and "having multiple meanings"?
 
@FredOverflow Yes.
 
I don't know, I hear overloading and explicitly think method overloading.
What other meanings have been tacked onto it?
 
> stuffing too many people in an elevator
 
lol.
 
6:15 AM
> "The fusion core is overloading!"
 
@RMartinhoFernandes Are you telling me natural language is ambiguous? :(
 
In the context of computer science?
 
@FredOverflow Context-sensitive.
 
Overloading is a chess tactic in which a defensive piece is given an additional defensive assignment which it cannot complete without abandoning its original defensive assignment.
 
chess is fun
 
6:15 AM
^ agreed
 
If only I could play it.
 
That's a good one Pubby
I forgot about piece overloading
 
Why is "The thunk stack" starred?
 
LOL
I'm not to blame, but if I had to guess, because it sounds funny / made-up.
 
It's not made-up!
 
6:20 AM
I know
 
It exists.
 
I've read about Haskell a bit
Isn't it an internal stack used in the evaluation of closures, or something similar?
 
Btw @Fred, seems like people mentioning Haskell here spiked @Alf's curiosity enough that he started learning it.
@robjb Yeah.
 
Quite a nice language, I wish I had enough time for personal projects
I couldn't do much more in it than a hello world off the top of my head, but from the reading I've done, it's conciseness, expressiveness, and clarity of syntax are very appealing.
 
haskell syntax is nice, but I don't like the whitespace and camelCase
 
6:24 AM
Hmm, I don't mind it.
 
I really don't care about those things anymore.
 
But as I said-- not a lot of practical experience with it.
 
The languages I use regularly all have different conventions.
So I have to live with them all.
 
What about oldschool ALL_CAPS?
 
C++ macros.
 
6:26 AM
@RMartinhoFernandes Learning new languages is always good.
 
IT_MUST_HAVE_BEEN_VERY_ANGRY_BACK_THEN
2
 
lol
 
anyone know python? I've tried it but didn't see what was so great about it
 
i-like-the-lisp-naming-convention-but-nobody-else-seems-to
 
@Pubby The batteries.
 
6:28 AM
@Pubby I think Python is pretty handy, it has a pretty good standard library. I just don't like dynamic types.
Do any of you guys use Ruby? I think I hate it. But I don't have a really good reason to do so.
 
Isn't Ruby OO on crack?
 
Tried but didn't really like it. I don't do well on dynamic typing.
 
Hmm, I have some similar feelings about python @keithlayne
It's handy, has a good library, but I don't like dynamic types -- and that's about the only legitimate reason I have for disliking the language
 
ummm...I don't know about "OO on crack" (POO on crack would be funnier). I know that you can rewrite pretty much anything at runtime, which is scary.
 
6:32 AM
what do they call it? Monkey patching or something? I know it came in handy for me once because Rails was broken.
 
poking around using some weird feature of a language you don't know to fix an installation of a framework you don't like on a machine you don't own is not so awesome.
 
> Memory allocation issue with multidimensional array
Why do they let multidimensional arrays mix with newbies?
 
from what I've seen of Ruby, it just seems really foreign....Python not so much.
They all took the red pill.
 
Well, Ruby is Japanese afterall. That's pretty foreign.
 
6:36 AM
1. How many of you have a copy of the new standard?
2. Is it different enough from the last draft to pay for?
 
I don't think so.
 
Plan to write a compiler? If not, waste of money.
 
You can also build your own PDF from GitHub.
 
@Pubby I just want to rep whore on SO
 
@keithlayne The latest draft is fine.
 
6:39 AM
I guess I'll just start throwing out random stuff, as long as you use that squiggly thing you look like an authority.
3
 
It's so silly how quoting gets you free upvotes.
 
@RMartinhoFernandes thanks, I'll look into that
 
I've quoted things that completely contradicted what I wrote and still got rep
 
Here's an interesting article on monkey patching
 
@Pubby You did? Links! I have spare downvotes :P
 
6:41 AM
@Pubby I can't bring myself to answer questions lately...it's just no fun. I can't compete with robots.
 
Atwood has a good one too
@keithlayne Robots?
 
Hey, I'm not answering much lately.
 
@robjb shhh....they're watching you
I got my first taste of the "rep from an old question" the other day....it was a couple of garbage answers, one got accepted way later without answering the question. Weird.
 
hmm
I've had that happen
 
Maybe I'll start hunting crappy answers instead of crappy questions. Then bring the hammer and tell people how much they suck at life.
They way I see it, I have about 400 downvotes in my pocket just waiting to be dished out.
 
6:46 AM
Woah.
 
@RMartinhoFernandes Keanu?
 
 
Party on dudes.
 
If I'm you, and you're me, then what number am I thinking of right now?
 
6:47 AM
42
 
no soup for you
 
-1?
 
69, dude!!!
 
luls
 
Cleverbot says "You are thinking of me thinking of you.".
It actually makes total sense.
 
6:49 AM
I think you need some parens in there to clear it up for me
 
Have you guys done anything with machine learning?
 
It depends on what you mean
 
I'm curious on how well an artificial neural network could perform in Robocode (en.wikipedia.org/wiki/Robocode)
 
I wrote an agent in Lisp to learn how to play a hard game using a handwritten neural net
 
At least in projectile prediction / avoidance
And perhaps movement to some degree
 
6:51 AM
dude every time I open wikipedia lately there's that creepy old lady staring at me
 
lol I know.
:(
It seems like they have some pretty neat algorithms already for avoiding projectiles
 
wow, it supports all the crappy languages
 
I'm thinking the error rate would make it difficult to learn something like projectile paths, but I guess I can't know without trying.
 
Anyone do that AI ant competition?
 
well, I'm sure you know that a neural net is just a function approximator
 
6:53 AM
I don't know much about formal AI
Yes I do
 
there has to be a way to train the net...
 
But there are so many different variations and tweaks to implementation that can drastically impact the net's performance
Kohonen SOMs are neat
 
yeah, I'm not sure exactly how you mean that, but changing the number of layers, inputs, etc. is a pain. Not so much to do, but to get a good mix, and then train, and then test
 
Yea, exactly
Layers, inputs, whether or not to backprop
I guess backprop is usually a requirement for anything complex
 
backprop is necessary for TD, right?
 
6:58 AM
Hmm, not familiar with the term TD?
Does it have anything to do with gradient descent?
 
temporal difference...
 
Oh, I don't think so
Isn't that a reinforcement learning technique?
 
I used it for my learning thing, I can't remember the details
maybe lookup TD-lambda
 
Oh, it's math used for reinforcement learning
Yea, looking at that now
This talks about a difference between regular back-prop and TD back-prop
 
I'm definitely up on the state of the art
 
7:05 AM
Yea, we addressed that in my neural networks class, but it was only really described as a method for improving backprop
I didn't realize that it had a specific name / broader application
What game did you teach it?
 
It is called Arimaa.
 
A chess variant?
The page seems to imply the usual chess brute-forcing method wouldn't work for that game -- did your net play very well? :)
 
not so much, just played on a chess board with chess pieces. The creator wanted to make a game simple enough for his 4yr-old to learn with stuff they already had, but difficult for a computer to play. Pretty interesting
 
Hmm that looks pretty cool
 
Mine ignored initial placement (~64 million possibilities there) but it was slow. I wanted it to train from scratch. It was for a school thing, it was total overkill for the class. I was deployed at the time and never got back to it, and lost the source.
 
7:14 AM
That's unfortunate
 
oh well, I can't concentrate long enough to do much of anything now anyway. But it was fun. And that $10,000 prize to beat the humans is pretty attractive.
 
I know, I was just thinking that myself
 
but robot tank battles sound pretty sweet too
 
7:26 AM
lol yea.
 
0
A: Chat search fails to load page 2

Marc GravellFor the techie-folk, this was due to parameter-sniffing; the database server had prepared a query plan based on some early typical parameters that was not representative of all the rooms on the site, meaning: for different values, the plan was inappropriate and timed out. This has been solved by...

 
ha I just meta-repped you
 
7:46 AM
Thanks.
 
all right, the solution of that can-the-crack is all over norwegian newspapers
they can't possibly hire everybody who reads the solution
 
@AlfPSteinbach What is that?
 
gives you a chance to get a job in her Majesty's service, if you're a non-convicted British citizen
it's a silly three-stage chase
first you have to figure out that the hexdump might possibly indicate machine code and Linux
and that the int $80 exit call confirms that
then they're smart about it, having hidden a part of the program in the png image's header
i'm not sure about that, i didn't get that far when i looked at it
anyway you run that and it spits out an URL to the next part
which is something about creating a virtual machine in JavaScript
which creates an .exe
which evidently spits out the password
 
8:02 AM
Sounds silly.
 
well i think what's silly is the time frame, that the "contest" is still open.
because now it's all over the net
 
they will probably just discard later entries :/
@AlfPSteinbach How'd you figure out the PNG had instructions in it?
 
@robjb i just googled it
:-)
they're reportedly base-64 encoded
 
lol, all of the instructions?
 
no, it's just about 80 bytes or thereabouts IIRC
the main stuff is the hex dump given pictorially
 
8:11 AM
ah
 
8:29 AM
never heard of uintmax_t before
anyone know the type of this?
 
@TonyTheLion It's the largest unsigned integer type of the implementation.
 
What's an inline namespace?
 
Probably uint64_t.
 
@Pubby c++11 thing
 
8:32 AM
oh right
 
@Pubby New feature. I think it's the same as namespace foo { blah blah } using namespace foo;
 
and now, how could I convert a uint32_tinto a size_t type?
 
just assign
that's it
both are unsigned types where the standard guarantees modulo 2^*nBits* arithmetic, and size_t is necessarily 32 bits or more if you have uint32_t
 
Yeah, size_t is unlikely to be smaller than uint32_t.
 
Scratch that.
 
8:36 AM
@RMartinhoFernandes No?
 
It's the exact equivalent of what I showed above.
 
So much for being useful.
Not that it would really be anyway.
 
You can use them for easy versioning, with the help of macros.
 
This not allowed? inline namespace pepe = std;
 
"inline namespace"? what's that?
 
8:39 AM
@Pubby What would that do?
 
This makes no sense.
 
6 mins ago, by R. Martinho Fernandes
@Pubby New feature. I think it's the same as namespace foo { blah blah } using namespace foo;
namespace my_super_library {
    #ifdef V2
    inline namespace v2 {}
    #else
    inline namespace v1 {}
    #endif
    namespace v1 { /* v1 stuff goes here */ }
    namespace v2 { /* v2 stuff goes here */ }
    /* common stuff goes here */
}
 
If you want to pull existing namespace, then using namespace.
 
namespace pepe = std; using namespace pepe;
 
Not that you should ever do using namespace std.
 
8:40 AM
I want to create an alias and eat it too.
 
It's pointless.
Aliasing std is just obfuscation.
 
inline namespace pepe = jepe?
 
isn't using namespace whatever kinda defeating the purpose of namespaces?
 
Yes.
That's why you usually shouldn't do it.
 
user457812
The correct way to do it is to not use std and reimplement everything yourself all the time. Even if you've already got it in your project once, write it again.
 
8:42 AM
@RMartinhoFernandes That doesn't really need another language construct, though.
 
#define LIB_VERSION 1
namespace lib {
    namespace v1 { ... }
    namespace v2 { ... }
    #define LIB_NAMESPACE v ## LIB_VERSION
    using namespace LIB_NAMESPACE;
    #undef LIB_NAMESPACE
}
 
Would that work with ADL?
 
Dunno.
 
lib::A x; f(x); <- would this look f up on v1 (assuming compiled with v1)?
I think that's the difference.
> If an associated namespace is an inline namespace (7.3.1), its enclosing namespace is also included in the set. If an associated namespace directly contains inline namespaces, those inline namespaces are also included in the set.
The ADL stuff.
 
8:46 AM
Actually, it works on gcc. ideone.com/7kZWE ideone.com/UNFeo
 
Well, I don't know what the fuck is the difference then.
 
@CatPlusPlus It doesn't compile.
 
@StackedCrooked The errors make his point.
 
It finds either one or the other, it's not supposed to compile.
Though it could be GCC extension stuff.
 
True.
 
8:49 AM
> The proposed extension allows the use of the inline keyword in a namespace-definition to specify that members of the namespace can be defined and specialized as though they actually belong to the enclosing namespace. This is referred to as namespace association because of its effects on argument-dependent lookup.
> This extension has been implemented in the GNU and EDG compilers for several years now (expressed with a special using-directive, rather than a change to the namespace definition itself), and is getting a fair amount of use.
Wait, no, the extension requires an attribute. But they use templates in examples, so maybe that's the corner case.
 
Ah, specializations.
I don't see why they couldn't just change the semantics of using to allow specializations.
 
@RMartinhoFernandes You mean like inline using?
 
9:05 AM
Or just using.
Could that break any code at all?
 
0
Q: operator new already defined in custom memory manager with library

StrangeCodeSorry for the poor title, but hopefully the description makes it clearer. At the momemnt I have one main application which is built together with other libraries (like libpng, libvorbis,etc.). I'm trying to add libtheoraplayer to the main application, but I keep running into problems: 1) Linkin...

> The main application does not support STL, and I started by changing references to STL in the libtheoraplayer to our own STL replacements
cringe
 
how many times does this run do { // do something }while (0); ?
 
right
 
None, because it's a syntax error.
Har har.
 
9:11 AM
@CatPlusPlus Your browser is broken and doesn't render the newline.
 
@RMartinhoFernandes so's mine, apparently :P
 
@AlfPSteinbach: Who needs to decrypt the data when you can just visit the success page? canyoucrackit.co.uk/soyoudidit.asp :P
 
OMG, this "clueless newbies using OpenCV" thing is getting annoying.
 
Makes me want to CloseCV
 
heh
 
9:14 AM
"OpenCV <insert name of function here> <issue/problem/error>" I'm trying to OpenCV something and wall of code can you help?
 
lol
 
Awful lot of MPL questions today.
 
Where? I didn't see any.
 
Oh, someone's been raiding the tag and bumping them up.
 
Oh, the front page.
 
9:16 AM
I have in ignores.
 
Me too, but I can see them when the page loads.
 
Along with 300 others, which doesn't really help at all.
 
Sounds like a good plan.
 
9:20 AM
@cHao No.
 
/r/WTF has been on a roll lately.
 
@CatPlusPlus Yeah, it was slowly forming into some pseudo r/funny but now it's back to normal.
 
@curiousguy feel free to clarify.
 
Yes?
 
9:25 AM
Maybe.
 
mzero
 
<^(:)^>
Who's up for some productivity killing? m0ar.org/4449
 
0
A: Do namespaces affect initialization order in C++?

Jan HudecWell, the "Global variables are initialized in order of appearing in the translation module" is definite. It does not leave any room for anything else, like namespaces, to affect the order. Remember though, that the "global variables are initialized in order of appearing ..." is actually slightl...

See comments
 
@RMartinhoFernandes Now convert to HSV in memory on the go.
 
9:31 AM
I wonder why after the quote he says "so ..." as if the quote defined what "globals" are!
 
morning
 
9:47 AM
-1
Q: Is there any raw TCP library in C or C++?

Madnik7GI going to create kernel mode driver level app that establish a TCP connection, here is my requirement: I don’t want pass data to user-mode I don’t want use winsocket and OS socket library I need to just pass tcp packet to a library and the library create simple TCP-client or TCP-Server connect...

 
cpx
oh I had it last week
5
Q: Use of Unnamed namespace over static

cpxCan I assume an object declared in unnamed namespace to be equivalent to as if were static? namespace { int x; };// #1 static int x; // #2 FWIK, In both cases, x will have static storage duration and internal linkage. So does all the rules of an object declared as static applies to an object...

 
> I'm trying to write a batch file in Windows XP that takes in a fully-qualified path name and outputs the 8.3 short name version...
Find what's wrong in this sentence.
 
Close, but no.
 
He's using a batch file instead of PowerShell?
 
10:00 AM
8.3 is for dos?
 
The ellipsis!
 
What's with all the ellipsis in questions... Do people think they are question marks...
 
Some people use them when they stop to think.
Because it's important that you know that they stopped to think at that point.
 
That would explain the other day….
 
They should use them more often.
 
10:02 AM
stop... hammertime?
 
> I have no clue how to spot this kind of error, my guess is that the virtual table is broken.
 
@RMartinhoFernandes Am I missing context?
 
(╯°□°)╯︵ ┻━lɐnʇɹıʌ━┻
9
 
@ConspicuousCompiler Seems to be a rare error.
@Pubby lol
0
Q: C++ rare runtime error

RaxvanI have a class B that inherits the class A with some virtual functions. Class B also has a virtual function (foo) that seems to have no address. When i walk with the debugger it points that foo has 0x00000000 address and when i try to step in it will fail with access violation at 0x00000005. If i...

 
Sounds like an off-by-one error somewhere else in his code that's walking past the end of a previous object and overwriting his vtable pointer.
/me speculates wildly
 
10:07 AM
ok, question about fwrite, I'm writing a buffer of type char* to a file, now should I pass the size param as sizeof(char*) or just put 1. In C sizeof(char*) gives me 4, but here I"m writing 1 at a time. Is this a problem?
 
He won't show code, so good luck with that.
 
If he can compile it under Linux, and it is what I suspect, valgrind will catch the error.
 
@TonyTheLion Do you want to write characters or pointers?
 
@Pubby I want to write what's in the buffer, which is bytes (image file).
 
sizeof(char*) is the size of a pointer.
 
10:08 AM
So use sizeof(char), which is 1
 
@Pubby not in C
it's 4 in C
 
@TonyTheLion Try it.
sizeof(char) is 1 by definition.
 
What? sizeof(char) is not 4 in C
 
cpx
4 bytes?
 
yes you're right
but why does `sizeof('a') return 4 in C and 1 in C++?
 
10:11 AM
It gets converted to int.
 
cpx
its promoted to int
 
Gets converted, or is an int?
 
I hate to say it, but the C side of C++ is much better designed.
 
Not really.
0
Q: Debug Assertion Failed … _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)

ChriZzZI have got a really bad memory leak I am trying to fix, but somehow i am not able to delete Objects without triggering this assertation. I have searched for a solution via Google and have read the Questions on stackoverflow about this Error but I was still not able to find the answer! Possible ...

Yuck.
 
cpx
10:15 AM
I'm learning C from this book.
 
You know what? We missed the 2000000th message.
 
cpx
oh no
 
I'm curious as to what makes a modern approach to C
 
Not using C.
 
10:20 AM
I expect the Gtk+ likely felt they were taking a modern approach by implementing an OO interface using pure C.
 
@cpx well, it's modern
hence the name
 
> Emphasize compatibility with C++.
That's good.
0
Q: Texture mapping: getting black texture

bbarreI'm short on time so I'm maybe we can do it this way: post if you want to help, then I'll promptly post what we need to look at. In general I'm trying to do gl texture mapping using the DevIL external function ilutGLLoadImage("/home/brent/Desktop/myimage.bmp"); but the cube on which this image sh...

WTF.
 
I am thinking about letting him know that I am not willing to help.
 
Even if I wanted to help repwhore, I have no idea what to answer.
 
@RMartinhoFernandes probably a witty sarcastic answer is the best way to get rep on that one
 
10:29 AM
Will I get a rep for posting "This is a witty sarcastic answer."?
 
"I know the answer but have too little time to tell you. Upvote me to let me know you're interested" ?
7
 
There is a chance he is doing the same mistake as here: gamedev.net/topic/312072-texture-appears-white (Passing an OpenGL handle to something that expects a pointer to pixel data.) But without code, hard to say.
 
there have been a lot of questions about DevIL in the last week or so
 
DevIL sucks so much.
 
I'm not sold on the Boost.GIL thing though
it looks like it has too few expert users compared to most Boost libraries
 
10:34 AM
@CatPlusPlus When I used it, I don't remember ever seeing a sample where return values were tested.
Then you get clueless noobs all over.
 
You always get clueless noobs all over.
 
> In computing, turning the obvious into the useful is a living
definition of the word "frustration." — Alan Perlis
REMOVE ALL THE NOOBS
 
10:49 AM
I hear the PL/1 guys got rid of all of their noobs.
 
Pfft. APL got rid of everyone.
 
Who needs noobs?
 
11:05 AM
donno
 
11:16 AM
@TonyTheLion Wasn't everyone a noob once?
 
yea, I was being silly
 
Hola:)
 
11:58 AM
I'm reading C++ Primer and I'm not sure I understand this example:
sum = 0;
	int value;
	// read till end-of-file, calculating a running total of all values read
	while (std::cin >> value)
		sum += value; // equivalent to sum = sum + value
	std::cout << "Sum is : " << sum << std::endl;
The book tells me to give it 4 random numbers, but how would it reach end of file on a command line?
D'oh, putting in a ; did the trick
 
In this case, you can just input something not a digit.
On Linux you can type Ctrl+D.
 

« first day (412 days earlier)      last day (4536 days later) »