« first day (802 days earlier)      last day (4144 days later) » 

5:00 PM
Now I'm "relearning" C++ for a computer graphics course, which is hysterical, since it's being taught as Java without Garbage Collection.
 
Xeo
@TimPost Who summons you here?
 
user142019
@ShotgunNinja poor you, going to school.
 
user142019
I GET JAVA TOO AT SCHOOL AND I HATE IT PLEASE KILL ME
 
user50049
@Xeo A ton of flags, but SBI usually beats them to it when it comes to notification :)
 
user142019
@Xeo or you accidentally to make your destructor virtual. :^)
 
Xeo
5:01 PM
@Zoidberg'-- Like, accidentally a virtual?
 
user142019
(forgot)
 
Xeo
(I know)
 
user142019
(okay)
 
room topic changed to Lounge<C++>: C++, not even once [c++] [c++11] [c++-faq]
 
Xeo
(Meta-chat-messages are marked with parens)
 
user142019
5:02 PM
I hate C++.
 
Xeo
Feels like whispering.
@TimPost Oh, did something happen today?
 
I've used parens first :v
Another proof that I'm the king and you obey
 
Xeo
Ahahahaha, no.
 
Thank you, @CatPlusPlus. Not really.
 
user142019
@ScottW kill him/her
 
user142019
5:04 PM
@CatPlusPlus no, @Rin used parens first.
 
user142019
Oct 15 '10 at 9:10, by Rin
yep not only US - poland here ;)
 
it was funny though; so many of the students squirmed when we started making a global override for operator*(const double, const Matrix&)...
 
user142019
muh prefix const
 
user50049
@Xeo Yeah. Scroll up from here
 
YEAH TIM
 
Ell
5:07 PM
lol @ c++ is java without gc
 
@Zoidberg'-- yeah, I intentionally left off some consts and whatnot, since I'm sure you know what I'm getting at.
 
Guy was so smart he brought in sockpuppet to say that he can circumvent bans
 
@Ell Oh god, when the professor said that, me and a former roommate of mine both squirmed in our chairs, and the professor had to apologize to us.
 
What's going on.
 
user142019
Matrix is way too specialized! Write Tensor!
 
5:10 PM
if I didn't have to write unit tests for it, I'd already have quaternion done.
 
user142019
Quaternion is also way too specialized! Make it more general!
 
I understand how to do the ops and memory cleanup, but coming up with invertible matrices is too hard :P
 
@Zoidberg'-- How about Object
 
@NolwennLeGuen Was just gonna say that, damnit
 
Erase all types. Typeicide
 
5:12 PM
dat var auto keyword
 
user142019
Object is way too specialized! Write Entity!
 
@Zoidberg'-- Both are the same. Except Entity sounds pedant. I hate Entity.
 
I've seen Entity used for things in game engines, so it's contextual.
 
user142019
In C++ functions are not objects, but IMO they are entities.
 
user142019
And types.
 
Ell
5:13 PM
Object is way too specialized! Use void*!
 
void* is way too specialized! Use auto
 
Functions are not types
 
> Object may refer to:
> Object (philosophy), a thing, being or concept
> Entity, something that is tangible and within the grasp of the senses
Object is more general, therefore I wins.
 
user142019
@CatPlusPlus I didn't meant to say they are.
 
user142019
Types are entities. :P
 
5:14 PM
Types are types
 
Are they
 
user142019
Okay, how about Dingus.
 
Isn't that Polish
 
Doodad
Frob
 
user142019
@NolwennLeGuen No, it's English.
 
5:15 PM
Widget
 
user142019
Derived from Dutch or Afrikaans dinges.
 
Thing
 
@Zoidberg'-- > Smigus-Dingus, a Kurpie (Polish) traditional custom, also called Dingus Day or Easter Monday
 
user142019
@ShotgunNinja Midget.
 
user142019
@NolwennLeGuen unrelated.
 
5:16 PM
@Zoidberg'-- Related.
 
@Zoidberg'-- What are you saying about me, hmm?
 
user142019
@ShotgunNinja Midget.
 
Ell
mofo
 
user142019
Ell
 
class Ell : public std::doohickey
template <typename T> class Meta : public other::Meta<T>
 
5:20 PM
hm
interesting inheritance design :P
 
user142019
s/int/unint/
 
Dinitrogen monoxyde is hilarious.
 
user142019
@NolwennLeGuen wat
 
You edited your post, silly.
 
unint, or uint?
 
user142019
5:24 PM
I want to implement a distributed hash table.
 
Then make a hash table
 
@Xeo dereferencing a null pointer will get you a segfault.
 
Split it into pieces
And give it to children in need
That's how you distribute a hash table
 
cya guys
 
user142019
I am going to implement it
 
user142019
5:25 PM
in C.
 
Hashing any object: Treat as a byte array, iterate across the object, and add all values.
 
@Zoidberg'-- What for.
 
user142019
@NolwennLeGuen 4fun.
 
That's not a good way to hash an object, but it works.
 
@ShotgunNinja Addition makes a terrible hash.
@ShotgunNinja Define "works".
 
user142019
5:26 PM
@ShotgunNinja no it does not.
 
Generally one would multiply with a prime factor and add.
 
user142019
If you do that with std::string, two identical strings may not result in the same hash.
 
Ell
@Zoidberg'-- ..how?
 
Well, that was never intended to be a serious response.
You people need to lighten up a bit.
 
is there an easy way to use a different gcc in Debian?
 
5:27 PM
@Ell Because they are two different pointers, even though they point to the same data.
 
user142019
@Ell std::string points to an array of chars. That pointer is different for each std::string.
 
@ShotgunNinja You think this is a motherfucking game?
 
also
 
@NolwennLeGuen Yes. :D
 
hashing any object, plain and simple, does not make sense.
hashing relations only make sense between objects of the same or at least related types
 
user142019
5:28 PM
I only need to hash strings.
 
Then iterate across the characters, multiply by prime factors, and add.
Done.
 
@ShotgunNinja But now it's not "any object", is it? It's std::string only.
 
@DeadMG You really took me seriously?
 
user142019
Which prime factors must I multiply by?
 
@Zoidberg'-- look at how libc++ does it.
 
Ell
5:29 PM
@ShotgunNinja Realise now that a lot of people here are extremely pedantic, it will make time here easier :P
 
@Zoidberg'-- You would need N prime factors for N characters, I believe. It's not particularly sustainable.
 
@Ell - Understood.
 
and don't be argumentative. You'll soon see @DeadMG doing that... it won't end well ;-)
 
would be simpler to just use an existing hash algorithm like SHA-2 :P
 
@Zoidberg'-- Your choice. I've seen 31, 97, 101 and 65521 commonly used for some reason
 
5:30 PM
kinda overkill for a hash table, I guess
 
or std::hash
 
user142019
libc++ uses murmur2
 
user142019
lol SHA for a hash table
 
user142019
@rubenvb C; out of luck.
 
But still, there's going to be some overlap, such that multiple different strings may generate the same hash. Otherwise, your hash table is waaaaaay too big.
 
user142019
5:32 PM
But I don't mind implementing the hash function myself.
 
As long as identical strings produce the same hash every time, you're good.
 
user142019
Murmur2 is fairly simple.
 
Ell
@DeadMG isn't sha-2 a cryptographic hash?
 
@Zoidberg'-- Srsly for a string, just multiply by 31 and add. No more no less.
 
user142019
@ShotgunNinja you don't want too many collisions. Otherwise you could just use return 0;.
 
5:32 PM
murmur2 is in libc++. I doubt std::hash will be very C++ specific codewise.
 
@Zoidberg'-- Understood, but that's still an extreme example...
 
user142019
Murmur2(key, len, seed)
    m ← 0x5bd1e995
    r ← 24
    seed ← 0x9747b28c
    ...
 
user142019
I don't understand what the seed parameter is for if you're going to reset it to 0x9747b28c anyway.
 
Just checked, Java uses multiply by 31.
 
lol @Nolwenn
 
Ell
5:35 PM
lets look at what php hash uses :D
 
user142019
PHP probably uses a linked-lists of pairs.
 
user142019
Because it's written by morons.
 
@Ell return 42;
 
C# uses a pretty complex one.
 
Ell
Php has that hash attack thing
 
user142019
5:36 PM
I'll use Murmur3.
 
Does Python have a hashing system? Never used the language.
 
user142019
Python uses hash tables for dictionaries and attributes.
 
user142019
At least, CPython does, but any sane implementation should do that. Guido said that in a talk I watched last night.
 
C# string.GetHashCode():
    public override unsafe int GetHashCode()
    {
      if (HashHelpers.s_UseRandomizedStringHashing)
        return string.InternalMarvin32HashString(this, this.Length, 0L);
      fixed (char* chPtr = this)
      {
        int num1 = 352654597;
        int num2 = num1;
        int* numPtr = (int*) chPtr;
        int length = this.Length;
        while (length > 2)
        {
          num1 = (num1 << 5) + num1 + (num1 >> 27) ^ *numPtr;
          num2 = (num2 << 5) + num2 + (num2 >> 27) ^ numPtr[1];
 
Does anyone are good with JavaScript design here
 
user142019
5:38 PM
@NolwennLeGuen I am good at JavaScript.
 
How would you go at implementing an MVC with JS.
Yes I love vague questions.
 
You scare me, @Nolwenn.
 
That have no interrogation mark.
@ShotgunNinja That's a good start.
 
user142019
lol
 
A what?
 
5:41 PM
@Zoidberg'-- Murmur2 code is in this file: llvm.org/svn/llvm-project/libcxx/trunk/include/memory
 
user142019
Murmur3 returns 128-bit hash values, but I don't want to store 2^128 buckets, really. That would use way too much memory.
 
You could always truncate by shifting, and cut the number of buckets you need by powers of two...
 
it also contains cityhash64 code.
 
@rubenvb That's what SimCity used on Nintendo 64 I believe.
 
@ScottW oh you!'
aah
I see it now.
 
Ell
5:45 PM
Dll injection, y u no work in c#!?
 
user142019
Y U USE C#
 
user142019
USE HASKELL
 
lol
 
user142019
F# :p
 
@ScottW One star to fuck them all.
 
5:47 PM
@Ell Ofc it does.
 
Ell
@NolwennLeGuen it doesn't
 
@Ell You're probably just bad. What are you doing?
 
Ell
you can't use c# in a SetWindowsHookEx callback where the process doesn't have the clr loaded
 
user142019
I'd like to learn C# but I can't think of anything I'd ever implement in C#.
 
@Zoidberg'-- C# is great </ad>
 
5:48 PM
GTFO
 
@Ell What. How are you injecting your DLL exactly?
@ScottW C# doesn't run on ARM.
 
Ell
@NolwennLeGuen Well the problem is I don't have a dll to inject :P I want to use SetWindowsHookEx to read messages going to an external window
 
@NolwennLeGuen Or on blood, for that matter...
 
Ell
netduino anyone?
 
OK, went back to GCC master from Friday and it seems to want to compile.
Soon in digital shelves near you: A MinGW-w64 GCC 4.8 preview!
 
user142019
5:50 PM
I could write Hexapoda in C#, but you know
 
user142019
I could also just write it in Python or Ruby.
 
@ScottW It was just for the pun.
 
or COBOL
or Lisp
or Perl
 
user142019
lol @ writing a bug tracker with a web interface in Fortran
 
@Ell Oh okay. Well I think you're gonna need a native DLL then yes
 
user142019
5:51 PM
brb
 
Hey guys, is this a good place to ask C questions?
 
@JGord Yes! Ask!
 
or is there a better room? I'm new to SO, mostly hangout on chiphacker
 
No. No C here.
 
This is the most fitting room for C questions actually.
 
5:52 PM
write a Brainfuck scripting plugin for a web server.
 
Please ask.
 
Who let all these noobs in
 
I'll be delighted to answer.
 
Dec 23 at 1:02, by Cat Plus Plus
If you're new and don't want to be hated, read the rules.
This is not a joke.
 
Za ruuurruuus.
 
5:53 PM
Ask me your question now!
 
Ell
Hmm I could change the address of the WndProc and then forward it :3
 
user142019
> Starting Windows
 
The pinned 14-star message got his attention I think.
 
@rubenvb Skimmed
@NolwennLeGuen Ok it's about typechecking with enums
 
@JGord Alright. What's next
 
5:54 PM
Ha. C typechecking.
 
user142019
What is the best web framework for C#/.NET?
 
So I have a function which has a switch statement based on a parameter passed to it
 
@Zoidberg'-- asp.net?
 
that parameter is an enum
now unfortunately there are lots of parallel enums with a matching parallel fxn for each enum
 
Wait, there's typechecking in C? sarc
 
5:55 PM
@JGord Okay. Why not use an array with function pointers?
 
since C treats enums as ints, my fxn currently accepts parameters from ANY of the enums rather than the type of enum that the parameter in the fxn prototype asks for
 
user142019
@rubenvb isn't that the framework that requires me to write ten billion lines of XML to get a hello world app up and running?
 
user142019
Or was that Spring?
 
@NolwennLeGuen the address of the fxns is not necessarily known
 
@JGord Oh that's horrible.
 
5:56 PM
@Zoidberg'-- No idea. You said "web" and ".net" in one sentence and I sparked "ASP.NET"
 
user142019
:P
 
@NolwennLeGuen right, so you can understand several reasons why that's not desirable
 
user142019
Visual Studio y u no start.
 
@JGord If you could post a pastebin of your code please
@Zoidberg'-- Because fuck you! It doesn't start here either
 
@JGord change your file extension to .cpp, add a class after enum (in the declaration/definition and your problem is solved.
 
user142019
5:57 PM
It's hanging on the splash screen.
 
@Zoidberg'-- Notice how it has a slight shadow
I always wondered how they did this
Do they capture the background and draw a shadow?
Or what.
 
user142019
No of course not you fool.
 
user142019
They probably use a compositor.
 
Tell me how, master.
 
user142019
Or whatever.
 
5:58 PM
@rubenvb Nah this is for an embedded micro, no c++
 
user142019
OS X uses a compositor.
 
They might just use blending.
 
user142019
OS X renders when all windows are done rendering one frame.
 
@NolwennLeGuen Hm I can't do that, but let me see what I can find for you
 
@JGord that has nothing to do with C++ an sich. Stop spreading FUD.
 
5:58 PM
@JGord Just the relevant parts or a stripped down version eh
 
@NolwennLeGuen yeah
sec
 
@Zoidberg'-- Don't speak about OS X pls
 
user142019
Isn't there a free version of Visual Studio that normal people can use?
 
@Zoidberg'-- Express
 

« first day (802 days earlier)      last day (4144 days later) »