« first day (1062 days earlier)      last day (3878 days later) » 

9:01 AM
which is the best hash function to hash words in english dictionary?
 
@user2713461 hash for what purpose?
 
Being high.
 
store those words in hash table ! i want to get unique hash address for all the words!
 
if it has to be unique, use the word itself as hash
 
Then make a vector with all the words from the dictionary and do a binary search on it. The index is your hash.
 
9:03 AM
@FredOverflow it a was question, to write a hash function
@FredOverflow i dont knw how to use vectors!
 
You are not ready to do this task then.
 
@FredOverflow Hey Fred, how good are you with Haskell?
 
@GamesBrainiac On a scale of 1 to Monad? 0.1
 
@FredOverflow I see what you did there ;)
 
9:04 AM
The most sophisticated program I wrote in Haskell was "Connect Four" with AI. Which isn't very much.
 
@MarcClaesen thank you
 
@FredOverflow More than me at least. I'm just learning
 
@GamesBrainiac for what purpose?
 
@FredOverflow For the sake of learning. I want to know how to use a functional programming language.
 
awesome
 
9:06 AM
@FredOverflow The most sophisticated I wrote was a compiler for a toy language. Mine was the only one in class with an optimiser :)
 
That reminds me: Compiler Confidential.
What a nerd. I love him!
 
@R.MartinhoFernandes Wide has an optimiser!
 
@DeadMG Do you use LLVM?
 
yep
 
Xeo
9:11 AM
So it's not handmade with love.
2
 
actually, strictly speaking, I also have a little RVO thing going on.
 
Xeo
sounds kinky
 
@DeadMG What about NRVO?
 
nah
RVO is trivially simple, essentially
NRVO is slightly less trivially simple
 
Q: WTF, why did `blah/configure` run so fast?
A: Because I ran `#blah/configure`, i.e., a comment.
 
9:18 AM
points deducted for "EplainedTheJoke" anti-pattern
 
@R.MartinhoFernandes This is what I do on a regular basis:
homer@marge:~$ :t zipWith
:t: Befehl nicht gefunden.
homer@marge:~$ ?
?: Befehl nicht gefunden.
homer@marge:~$ ghci
GHCi, version 7.4.1: haskell.org/ghc  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
[Prelude]
λ :t zipWith
zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
[Prelude]
λ :-)
 
export LANG=C
 
What @sehe said. So much.
 
@sehe wat
 
Put that on your bashrc.
 
9:21 AM
@FredOverflow So you need function :t() { ghci <<< ":t $@"; }
 
All I wanted to say was "Sometimes I'm too stupid to start ghci."
 
Xeo
But [Char] is not an Arrow!
 
I actually use LANG=en_US.UTF-8 on my system, but that's (I think) because it helps program spew unicode better
@FredOverflow "Warnung: Geschichte war nicht verstanden"
 
@FredOverflow Doesn't matter. Befehl nicht gefunden.
 
gefundenes Fressen
Jetzt hab'ich Hunger
 
9:23 AM
:)
 
Xeo
@FredOverflow I thought the story was "I can't remember what type zipWith has"
 
ZINGLOL
 
"no"
Awesome
 
Xeo
no: Deutsch nicht gefunden.
 
I just installed Deutsch
 
@FredOverflow r u workin? or studying?
 
Xeo
@R.MartinhoFernandes Maybe :<
 
I would love an English operating system with a German keyboard layout, but I don't know how that works.
@user2713461 taking a shower, then go to work
 
Xeo
set the system language to English, and the keyboard layout to German?
I have that on my Debian Vbox at home
well, had, since it apparently died.
 
9:26 AM
@MarkGarcia Are you here?
 
8 mins ago, by sehe
export LANG=C
 
Xeo
Null object pattern feels like a Maybe-thought that was not finished.
 
@MarkGarcia This is my Google+ page: https://plus.google.com/116535053954739855806
So we could be friends.
 
Finally someone worded the fundamental issue with NullObject in a way that makes it obvious to me
 
Xeo
9:28 AM
"</sarcasm>" ?
 
Just honest
 
Xeo
heh
 
(assume honest is defined)
 
@Xeo The only thing I've ever used it for is mocking.
 
Xeo
@DeadMG Guess it might work for that
 
9:31 AM
apart from that I solidly consider it an anti-pattern
 
@Xeo Oh. I only noticed the title of the blog.
 
@R.MartinhoFernandes I noticed the language used and moved on
 
lolwut, Ruby test frameworks provide functionality to test if a class matches the interface of another. Hahahahahahhaha dynamic typing is so much fun that you write your own static typing by hand.
8
 
Make it a tweet :/
I got the new yellow pages delivered. Well, I guess I can throw away the Internet then.
 
@Xeo Null object is one of those cases were Singleton actually makes sense.
 
9:43 AM
Hrrrm? Ah the Null object itself. It sounds like a Flyweight, rather
 
Your mother sounds like a flyweight... not!
 
Replace if/else if/else if with switch. But, yeah, that's a handrolled FSM (?) parser. Seems legit. Not into the protocol, but I'm assuming you know what you're doing there
 
I assuming the same.
Just noticed that the LF state can be removed.
I'm not certain what to do with invalid request. Return end pointer, return nullptr or throw.
 
Dynamic typing is so much fun that people write their own static typing by hand.
Like this?
 
9:48 AM
Almost. It needs a link to evidence that it is being done, and how. Otherwise, it's not going to convince my friends :/
And the essence to me would be that "people are having to write [...]" IYAM
 
@sehe Meh, I'm not trying to convince anyone. Just laughing about it.
(It's too stupid to take seriously)
 
user1804599
x OR y is short for if x then x else y for Booleans, right?
 
Xeo
yea
 
@R.MartinhoFernandes I'll add it in my RT then. Do you have a link? I'd rather not blindly rummage to those parts of the interwebs :)
 
user1804599
Hmm.
 
9:52 AM
@sehe It's on that thing above about Null Objects.
The whole thing is about testing that the null object has the same interface as the normal ones.
 
@R.MartinhoFernandes Oh. Dang. I wouldn't have noticed. I moved on :/
 
Contract Num, Num => Num
def add(a, b)
   a + b
 end
hahahhahaha
 
can type_info somehow be used as a prototype to construct an object of the associated class in TMP?
 
No.
type_info and TMP don't mix.
 
make-a-me sad
 
9:57 AM
@StackedCrooked Always throw if invalid.
 
@MarcClaesen Why?
Sounds like you are trying to do something that won't work in this universe.
 
I have a bunch of template types which I want to serialize and deserialize ... when serializing I have included enough information to reconstruct the type. Now I was wondering if it was possible to make some kind of map<string, Type> to deserialize cleanly.
but I guess that's optimistic
basically I need a clean way to call the constructor of the correct type, which is why storing types somehow would be cool ... though I didnt expect that to be possible
 
Oh gosh, 2013 and serialisation is still not a solved problem :(
 
It is. Use Java.
 
I can't use boost either (and even if I could, I think the problem would remain).
 
10:01 AM
How do you expect to call a constructor of an unknown type?
Where will you store the result?
How will you allocate enough storage?
 
for a finite set of types, which is the case, I could do it explicitly using a switch on the string, which is my last resort
 
Xeo
For a finite set of types, use variant + factories.
 
Aha! Thanks @Xeo
 
Xeo
Hm, I think one could even do []boost::variant<Ts...> with my proposal. Maybe I should restrain id-expression somehow. Thoughts?
 
and what would be wrong with that?
 
Xeo
Nothing, from my POV
 
I do exactly that with constructors in Wide.
 
Xeo
data constructors in Haskell are also just functions
But I think I'd also allow stuff like []my_var if I don't constrain id-expression
 
@DeadMG I could throw the iterator object where the fault was detected :)
 
@StackedCrooked Bad iterator! Get out!
 
Xeo
10:12 AM
auto bad_iter = input.end();
using out = request_error;
throw out(bad_iter); // and only come back when you've learned to behave!
words are hard
 
words can be harsh
throw flip(table);
 
@R.MartinhoFernandes thanks for the snippet
 
Compiler Confidential -> I sense much fear in you
:P
Assembly scares everyone
 
@GamesBrainiac I'm not scared of assembly.
 
@DeadMG Says the guy who's dead! :P
 
10:15 AM
Assembly is that weird friend we like to pretend not to know
 
Xeo
@R.MartinhoFernandes That only works for PODs / uninitialized memory blobs though, right?
 
@MarcClaesen Don't use the union btw; that was just a dirty way to do the testing.
 
yeah I know, I'll use variant
thanks :)
 
I am the flump.
 
SAM
:D
 
10:23 AM
Holy expanding bureaucracy to accomodate the expanding bureaucracy unicode.org/mail-arch/unicode-ml/y2013-m09/0056.html
 
The guy actually explains the stuff pretty well
 
Xeo
@R.MartinhoFernandes Any idea on how to escape the requirements of common ctor parameters?
 
@Xeo No way at all. How do you expect to deserialise something if you don't know how to construct it?
 
Xeo
Yea, guessed so
Guess you can describe the ctor-params per type, bundle that up in a "stream function" which converts a stream into a series of arguments and passes that on to the ctor.
Kinda like what I have here
 
@Xeo But whatever you do you still have to serialise those arguments too :/
 
Xeo
10:37 AM
Reminds me, I still haven't fixed the unspecified eval-order in _f(get<Args>(args)...)
struct invoker{
  template<class F, class... Args>
  invoker(F&& f, Args&&... args){ std::forward<F>(f)(std::forward<Args>(args)...); }
};
and then invoker{f, get<Args>(args)...}?
oh wait, return value
constructing a tuple and unpacking that again feels kinda redundant, though
Guess you could have template<class R> struct invoker and the return value as a member
hmm
 
Uh
Why does g++ compile this?
0
Q: C++. const reference to static member

Yivostruct Foo { constexpr static int n = 10; }; void f(const int &x) {} int main() { Foo foo; f(Foo::n); return 0; } I get error: main.cpp|11|undefined reference to `Foo::n'|. Why?

Pretty sure that MWid’s answer is correct and that this code is in fact invalid
 
Xeo
Also, I think I could modify stream_function so that it doesn't need to be wrapped in another std::function
Well, either that, or that it doesn't contain a std::function itself
 
10:53 AM
I think I scared that guy doing a Java compiler in C++ with Spirit away... :( Haven't heard back from him
 
Xeo
@R.MartinhoFernandes Wheee~
 
Sharing on Coliru will now use output from compile cache if available. (IOW share no longer means recompile.)
 
Xeo
@KonradRudolph I also think so
okay, now that that variant / factory thing is done, on to fixing / improving stream_function
 
user1804599
My hard disk hates me.
 
user1804599
Inserting many records. \o/
 
10:59 AM
@KonradRudolph Could it be that the number is passed as a literal which is then captured by const ref?
 
Xeo
yes, but for that to be valid, n needs a definition
 
11:10 AM
@sehe is spirit easy to use compared to flex,yacc ?
@StackedCrooked yay
 
@A.H. I'd say so. More importantly: it does a lot more for you. A lot more
The most tangible benefit over flex/bison etc. would be no need for external tools. But if it's just lexing/scanning Spirit has about equal complexity, IYAM (I don't really care whether it's Antlr, Coco/R or whatnot; I just like that I can hit the road running with Spirit)
 
@Xeo why would a reference to static member be wrong ?
@sehe ah so its more of the completeness/convenience
 
Xeo
@A.H. static constexpr int a = 10 is only a declaration.
to create a reference to a, it also needs a definition
 
well coliru accepts it :S, but yeah I see it now
 
Xeo
> main.cpp: In instantiation of ‘void stream_function<R(Args ...)>::call(std::istream&, std::string*, std::false_type) const [with R = int; Args = {int, int}; std::istream = std::basic_istream<char> std::string = std::basic_string<char> std::false_type = std::integral_constant<bool, false>]’:

main.cpp:38:42: required from ‘void stream_function<R(Args ...)>::operator()(std::istream&, std::string*) const [with R = int; Args = {int, int}; std::istream = std::basic_istream<char> std::string = std::basic_string<char>]’
guess what message came after that
> main.cpp:62:7: warning: unused variable ‘ret’ [-Wunused-variable]
:|
 
11:23 AM
@sehe a quick read of spirit intro says its only for top down parsers ?
@Xeo someone really needs to improve template related errors
 
Xeo
Oh whee, I can't easily fix the evaluation-order problem with GCC, I forgot.
They should get their ass to implementing proper LTR evaluation for braced-init-lists :<
ugh, I don't want to make this recursive just to build up the argument list with proper evaluation order...
 
damn
I'm hungry, but don't want to get sick.
 
Xeo
soup?
 
eat a salad
 
Xeo
or that
 
11:34 AM
@Xeo btw you were right, I didn't wake up at 2
woke up at 5 , found that I had turned off both alarms
 
Xeo
The reason you can find the best developers here is because it's not a head-hunter service. — Steven Doggart 12 secs ago
haha
 
I wonder if it works that way in other fields.
 
11:54 AM
@sehe You need extra RAM though :)
 
AntLR is nice.
That said, Parsec's still my favourite.
 
Xeo
Whee, stream_function fixed / improved! (atleast on Clang) coliru.stacked-crooked.com/a/fe9978a2bbdebf9f
 
12:14 PM
> ldconfig: /usr/local/gcc/4.8/lib/libstdc++.so.6.0.18-gdb.py is not an ELF file - it has the wrong magic bytes at the start.
 
lol
 
This is Bad™, right?
Wait.
Why would something expect a python to be an elf?
 
Xeo
Couldn't let that pun go, eh
 
Hmm, nah, seems harmless.
Some script passed too much to ldconfig and it dutifully ignored the ones that aren't Children of Ilúvatar. Good.
 
Children of Iluvatar?
 
12:18 PM
Tolkien legendarium.
 
Xeo
elfs
 
Elves and men.
 
@R.MartinhoFernandes By John Steinbeck?
 
How dare you confuse mice with such majestic beings?
 
Are elves as hairy as monkeys?
do elves shave?
 
12:22 PM
if the guys assist in answering the question rather than down voting then it is very much appreciated! — LetsCode 5 mins ago
@chris Thanks for the input. But could you plz see if you can come up with an algo for this? It is quite complex. — LetsCode 1 min ago
I've already made this algorithm in C#. Why would I do it again in C/C++ (yes, that's what it's tagged as) for someone who ignores everything and expects you to do their work for them?
 
P.S. I like mice, I think they are cute
 
strchr((char *)grp_range, '-')
 
Hannibal Lecter: We begin by coveting what we see every day.
 
Lovely, a cast to char *.
 
man
the Wide overload resolution code is disgusting.
 
12:26 PM
I don't see elves often enough, I haven't developed a feeling for them
 
> I have been able to compress all lower-, upper- and titlecase mappings, simple and extended (no conditions yet) of Unicode 6.2 into a 260 entry binary search array.
BASTARD DOESN'T EXPLAIN HOW
 
lol
 
I certainly want to get my hands on that thing.
@DeadMG Overload resolution is disgusting.
 
I think that when I ditch implicit conversions, it won't be too bad.
most of the complexity comes from that.
 
Xeo
@R.MartinhoFernandes Unparameterized overload resolution is disgusting.
@DeadMG ITT: implicit conversions suck, who'd have thunk
 
12:28 PM
@DeadMG solution : no overloads
 
@Xeo Yeah, but I previously didn't have an idea as to how I would reasonably function without them.
 
Xeo
And now you do? What insight did you have?
or was it that polymorphic type thing?
 
yeah.
 
Xeo
heh
 
Hmm, stray Es-zett.
 
Xeo
12:29 PM
Not like we told you several months ago or something
 
first I am going to implement deferred expressions, so I can typecheck something like f(x) { if (x > 5) return f(3); return x; }.
eh
 
you didn't have a real plan as for how that could function in the Wide system.
also
to be entirely fair, a lot of the last couple of months I have spent being even sicker than usual.
 
Xeo
We did - change the Wide system. Also, it's your job as the language creator to devise such a plan!
As consumers, we just need to complain.
 
lol
 
12:31 PM
> I know what to change, but not in what way
 
besides
it remains to be seen if that will actually work out in practice
also I'mma have to re-architect a lot of the overload set code anyway to handle some unpleasantries w.r.t Clang interoperation, compile-time reflection, and shit like that.
 
@A.H. is that limiting?
 
Xeo
Hm.. I could swear I had something else I wanted to do besides that variant-factory and stream_function stuff.
 
@StackedCrooked during compilation
 
Xeo
12:42 PM
I've been doing that, but my work currently has a lot of ... pauses.
while I compile / package or copy the shit over to the iPad
 
user1804599
Man.
 
user1804599
I'm such an idiot.
9
 
user1804599
I thought I had to insert 388000000 records, turned out to be only 3880000.
 
you might want to insert separators so that we can actually see what the difference is clearly
 
Xeo
> In the case of 32-bit architecture, this refers to two to the power of 32, in other words 4.3 billion bytes of information per cycle.
 
12:45 PM
lol
 
wat
 
gee gee
 
Xeo
> In the case of 64-bit architecture this refers to two to the power of 64, which totals about 18,400,000 trillion bytes.
:D
 
per cycle also ?
 
Ok, 5 machines updating several gigabytes of sources from the same repo at once. Will the CVS server handle that, I wonder.
 
12:47 PM
@chris He's a disaster striking from below
 
user1804599
I suck at databases.
 
> If a program has been written to take advantage of a 64-bit operating system, it should mean the processor needs to access data stored in the RAM (random-access memory) chip less often and can deliver a performance boost as a consequence.
Oh gosh, who the fuck are their tech advisors.
 
user1804599
> the RAM chip
 
user1804599
I've never seen it phrased this way. :P
 
well, arguably, more registers
 
12:48 PM
1 chip
 
but IDK if ARMv8 actually has more registers.
 
More than what?
 
@DeadMG But that's really unrelated to the "bitness".
 
than ARMv7
@R.MartinhoFernandes And it's really a compiler detail, not the program being written to take advantage of that fact.
 
@Xeo hey, that's awesome planning: plan the design phase to take several years, so it can be a fullblown evolution
 
12:49 PM
> Some have speculated that Apple's announcement might foreshadow the US firm ditching Intel chips in its laptops and desktop computers and moving to its own processors
 
lol no
 
And that "per cycle" thing can't even be discarded as an editorial mistake.
> The number of bits refers to the amount of data that can be processed in each of the thousands of compute cycles a chip carries out every second.
 
they wouldn't move to their own chips, they'd move to ARM chips.
 
They want to be very clear that they are stupid.
 
and that would be insanity because they'd break every existing program
and they'd get shitty performance out of it too.
 
12:50 PM
@R.MartinhoFernandes well sort of , in a way the ALU can now add 64 bit stuff
 
@Xeo I didn't knew. Interesting!
 
> Like ARMv7, AArch32 includes 13 general registers (R0-12), the Program Counter (R15) and 2 banked registers that contain the Stack Pointer (R13) and Link Register (R14). The User and System modes share these 16 registers and a Program Status Register (PSR).
 
I can't read more.
 
@DeadMG they actually plan on using ARM on macs ?
 
12:51 PM
@A.H. No, that would be insanity.
 
thank god
 
@DeadMG Why would it be insanity? :)
 
I just said up above why it would be insanity.
 
@wilx lets try and work for more portability, not less
 
@A.H. Still completely bollocks as that is nothing about "per cycle".
 
12:54 PM
actually in the way its worded has nothing to do with my interpretation
They are idiots, too bad no comment section
 
Xeo
@R.MartinhoFernandes But that would be awesome!
 
@Xeo It would?
64-bit processors can already handle much more than 64 bits of data on each cycle.
 
Xeo
Wait, I read that as 2^bits data :)
 
@Xeo Well, who knows. Their numbers do indicate that's the intended meaning.
 
Xeo
mh
 
12:56 PM
The only sure thing is that they're idiots.
 
Xeo
mh
 
> , but those written for 64-bit processors can, in theory, support up to 16 billion gigabytes of RAM.
They should check their theory again.
 
@LetsCode People were providing good feedback and asking you good questions here, and your additional information you edited in was helpful. But your statement about "prejudice", "idiots" and down voting were simply unacceptable here. Your comment was flagged as a result. Please don't do that sort of thing again. — Andrew Barber 4 mins ago
Thanks, smurfs
 
Oh, wait, they're correct there. Damn you stupid billions.
 
The guy is a complete blind fool:
Obvious answer mate! C nd cpp almost same. All I needed wanted was the logic be it c or cpp. — LetsCode 12 mins ago
 
12:59 PM
@R.MartinhoFernandes were the german billions confusing you? :D
 
Nein
 

« first day (1062 days earlier)      last day (3878 days later) »