« first day (812 days earlier)      last day (4139 days later) » 

2:00 AM
@MarkGarcia std::hash
 
I'm still unsure whether to use hash maps or the "ordinary" ones.
 
@Ell it does, you want small variations in data to result in huge differences in hashes. Otherwise it screws everything up.
 
user142019
This is evil:
 
@MarkGarcia I usually use hash now. If you need iterator guarantees or order, then use a sorted map
and I am not evil
 
user142019
int hash(mytype const& a) {
    if (rand() == 0) return rand();
    return real_hash(a);
}
 
user142019
2:01 AM
:D
 
@MooingDuck Still, it needs some runtime tweaking to achieve constant time.
 
user142019
One thing I don't understand about hash tables.
 
user142019
How are the keys stored?
 
user142019
Binary search tree?
 
user142019
I can't imagine you'd use an array of size std::numeric_limits<unsigned>::max() if your keys are unsigneds.
 
2:02 AM
@Zoidberg'-- no! That'd defeat the point!
 
Ell
In err buckets
 
@Zoidberg'-- effectively std::vector<std::list<std::pair<key, value>>>
 
user142019
wat
 
user142019
how can you ever quickly look up the keys then?
 
user142019
Uh no fuck.
 
2:03 AM
@Zoidberg'-- hash the key modulo the size of the vector, and you know what element of the vector it's in. And each list should be 0 or 1 elements, so no issue there.
 
@Zoidberg'-- The hash function somehow deals on where the keys are stored (what bucket). The buckets are mostly implemented as linked-lists.
 
Ell
Linear search :3
 
user142019
I mean the hashes not the keys. XD
 
user142019
How are they hashes stored?
 
user142019
@MooingDuck ooooohhhh awesome.
 
2:04 AM
@Zoidberg'-- they aren't
 
user142019
Now I understand.
 
user142019
In Dutch we say dankjewel.
 
user142019
@Ell lol
 
Ell
Thank you well? :al
 
OMG VS9 takes forever to close! It's been like half an hour!
 
user142019
2:05 AM
@Ell There is no English translation of that meaning of "wel".
 
forget this I'm just going home now
 
user142019
It's the opposite of "not".
 
user142019
@MooingDuck what if you have five different keys that result in the same hash?
 
user142019
If a list can only be 0 or 1 elements.
 
@Zoidberg'-- they end up in the same std::list
 
user142019
2:06 AM
Ohh okay.
 
user142019
Also, why a list?
 
user142019
Why not another vector or a sorted map?
 
@Zoidberg'-- it should only have 0 or 1. If it has more, that's inefficient, and slow, but it still owrks
@Zoidberg'-- uh, actually, I think it could be another vector.
 
@Zoidberg'-- Linear search on same keys.
 
@Zoidberg'-- could be anything really, it's pretty arbirary. Just want it fast for 0-1 data.
 
user142019
2:07 AM
vector has faster traversal in many cases due to cache according to Bjarne. :P
 
user142019
@MooingDuck ah ye.
 
@Zoidberg'-- he's right
 
@Zoidberg'-- see, there is something to learn in school. Oh wait, in about 15 minutes that'll be gone
 
user142019
But std::vector<std::map<Key, Value>> would also be fine as hash table?
 
I'm trying to recall unordered_map's iterator guarantees. Everyone keeps saying list, it might be list is needed for the iterator guarantees
@Zoidberg'-- sure, except no comparison object is provided.
 
user142019
2:08 AM
(Say you have a gigantic number of keys and thus many collisions.)
 
user142019
@sehe I doubt we'll ever learn about hash tables. More like USE java.util.HashMap!!
 
@Zoidberg'-- it resizes the number of buckets to keep collisions down
 
@Zoidberg'-- You should then tweak the map. Increase the number of buckets.
 
user142019
Ah of course.
 
Ell
@zoid opposite of "not"is "so" I think
It is not! It is so!
 
2:09 AM
@Zoidberg'-- "I do thank you", an accentuated confirmation /cc @Ell
 
user142019
@sehe ah yeah.
 
That's why I somehow dislike unordered_map. I'm lazy.
 
@Zoidberg'-- yeah, I think unordered_map has lots of guarantees on the iterator, and no comparison is provided, so that just leaves list
 
@Zoidberg'-- That's misguided. They will teach hash tables. Teachers think they are cool, and even Java and PHP have them. They're unavoidable
 
leaving now bye
 
user142019
2:10 AM
Byebye.
 
user142019
@sehe nothing was said about data structures in the list of subjects.
 
user142019
Oh well.
 
Google thinks hash tables are cool too.
 
user142019
Better know how they work already so I'll be bored to death by then.
 
@Zoidberg'-- What kind of school have you picked? A marketing one?
 
user142019
2:11 AM
A terrible one.
 
user142019
Full of liars.
 
user142019
> Als een leraar afwezig is regelen wij meteen een vervanger!!!!! (Open dag.)
 
@StackedCrooked Well, hash-tables are cool. Make things scalable with carefully tuned entropy. Without that, no search would ever scale
 
user142019
In reality, drie weken geen les gehad omdat lerares ziek was.
 
user142019
Idioten.
 
user142019
2:12 AM
En maar schoolgeld betalen. En maar dokken.
 
@Zoidberg'-- hij was niet afwezig. Zij was heel alert.
 
user142019
Ziek en niet op school zijn is afwezig.
 
@Zoidberg'-- I presume just for the once subject
 
user142019
Also zij. :P
 
@Zoidberg'-- Nah, of course not. Read the smallprint
@Zoidberg'-- Ah, I'm beginning to see how you selected the school :)
 
user142019
2:13 AM
I selected the school because it sprak me the most aan.
 
user142019
Don't know why though.
 
"it appealed to me". You need sleep. Or update your language modules
 
user142019
lol
 
user142019
I don't like my teacher.
 
user142019
It'd be funny if he joined this room now. xD
 
2:16 AM
I'm full of expectation now.
Never mind, I'm off to sleep.
 
@Zoidberg'-- she?! :)
 
user142019
He once said in class:
 
He meant, in struct?
inbred, perhaps
... drumroll ...
 
user142019
> Het is verstandig om eerst klassediagrammen te maken voor je je programma gaat schrijven in een programmeertaal zoals Java, Haskell of Prolog.
 
'tis a lengthy poem he spoke
 
user142019
2:17 AM
Class diagrams for Haskell or Prolog. Interesting...
 
user142019
Show me one, please? I'm excited!
 
@Zoidberg'-- Haskell ok, prolog? Wait a minute.
 
user142019
xd
 
Ell
I can't understand peter pan talk :(
 
user142019
His lecture on pseudocode was also hilarious.
 
user142019
2:19 AM
> [In pseudocode, keywords are all caps, blocks are ended with END and you use indentation.]
 
@Ell "It's advisable to first create class diagrams before embarking on coding in a programming language such as redacted, Haskell or Prolog"
 
user142019
(Pro tip: nobody gives a fuck about how you format your pseudocode as long as it's readable.)
 
user142019
There are no rulez.
 
Ell
Oh gosh
 
@Zoidberg'-- Oh hey, now I know where our client got their FO-ers from
@Ell goshling
 
user142019
2:20 AM
FO-ers?
 
Functioneel Ontwerpers
 
@Zoidberg'-- That's like BASIC!!!
 
user142019
 
How many of you use PHP (vs., say, Python) for web development purposes?
 
user142019
@sehe ah. :P
 
2:20 AM
@MarkGarcia Wait. BASIC has oodles of rules. It even had (mandatory) line numbers
 
user142019
@MarcusStuhr I would never do that ever. PHP is horrible.
 
user142019
Python is great, Ruby is fine, Node.js is the bomb. I am now playing with Erlang for web development, and I like it so far (even though the particular framework I'm using lacks documentation).
 
@sehe Good ol' GW-BASIC. I enjoyed that.
@sehe GOTO laden code, PRINTs, etc...
 
Ell
@zoid pseudo Code shouldn't use silly symbols like :=
 
user142019
Pseudo code should use whatever the author wants it to use.
 
user142019
2:22 AM
And nobody should give a fuck as long as it's understandable.
 
@MarkGarcia Me too.
@MarkGarcia Wait, more Dutch?
 
user142019
I prefer Python-like syntax, but somebody else may like BASIC-like syntax. That's all fine, but don't force anyone to use a particular syntax, and don't tell people there are any syntactic rules.
 
Ell
Very fair
 
Fancy fair
 
Ell
I fancy a scone with jam and butter
 
user142019
2:24 AM
Funfair.
 
trying to get python working on my server... I can seem to channel it using exec() but it seems like I need something like Django otherwise
 
user142019
For Python I prefer Flask.
 
Any advantages over Django?
 
user142019
(Unless you need Python 3 support, in which case you can take a look at CherryPy.)
 
user142019
@MarcusStuhr it's a microframework.
 
user142019
2:25 AM
It does routing and templating, and handles cookies and sessions for you, as well as static files.
 
user142019
That's basically it.
 
I personally prefer Python 2.7 to 3
 
@sehe I had an original GW-BASIC reference. Damn I lost it somehow.
 
user142019
You'll have to do database stuff yourself, which I like.
 
user142019
from flask import Flask
app = Flask(__name__)

@app.route("/")
def hello():
    return "Hello World!"

if __name__ == "__main__":
    app.run()
 
user142019
2:27 AM
Django is also fine if you like full-stack frameworks.
 
I want to be able to access/manipulate data from my sql db, process sessions/variables, etc. nothing crazy, but I am trying to avoid PHP like the plague here
 
user142019
I haven't used Django extensively so I can't really help there.
 
user142019
I have written some small apps with Flask and CherryPy that used MongoDB as database.
 
@MarkGarcia I must still have one. But it sits topshelf, hidden in the back row.
 
user142019
I have no books apart from those required by school, which I haven't yet opened.
 
2:30 AM
in C#, 24 secs ago, by sehe
Thinking? Yeah. It's addictive once you start making it a habit :)
@Zoidberg'-- thankless bastard.
in C#, 40 secs ago, by sehe
Anyways, trollmode setting in, I guess I'll start with weekend proper. Cheers
 
user142019
@sehe no, the school should do that.
 
@Zoidberg'-- Do it out of respect for the trees who gave their lives
 
user142019
School should require books that are interesting.
 
@Zoidberg'-- They are interesting. Fascinating even. Just not your cup of tea. Goto -4
 
user142019
Not books that introduce PHP to noobs and explain how to work with MySQL using the deprecated mysql_ interface with examples that are prone to SQL injection.
 
2:32 AM
strangely enough i have yet to make an injection work
 
@Zoidberg'-- How else are they gonna teach about SQL injection in third semester :)
 
user142019
No, the code examples didn't tell anything about SQL injection.
 
user142019
Nothing about it was mentioned.
 
user142019
And the examples were said to be correct.
 
I really am enjoying SQL-injecting our school's site.
 
2:33 AM
@Zoidberg'-- They are correct. And despicably so.
 
user142019
That was the one time I opened the book.
 
@MarkGarcia You are Bobby?
 
@sehe ?
 
Bobby. Ya know, Tables.
 
@sehe Ahhh. That xkcd. lol.
 
user142019
2:35 AM
Doing mysql_query("SELECT * FROM Users WHERE Id='" . $_POST['username'] . "'"); and saying it's correct or good or anything that suggest you should do it that way is terrible.
 
user142019
No fuck was given about prepared statements, even.
 
user142019
But yeah
 
user142019
if you use PHP you're doomed anyway, so I guess it doesn't really matter. xD
 
TIL my children are prone to get "highbrow music preferences"
I better start saving for the lawsuit. Psychological damages these days
> associated with Highbrow preferences among their children here
 
@Zoidberg'-- This is what teachers should experience: pbfcomics.com/99
 
user142019
2:38 AM
Cool children.
 
user142019
@MarkGarcia I know that, but replace the English part here with JavaScript and Java.
 
user142019
(Yes, I corrected my Java teacher several times even though I have never used Java before attending this school of doom.)
 
user142019
He thought it was possible to have a concrete class with abstract methods.
 
user142019
HAHHAHAHAHAHAHAHHAHAHAHAHAHAHHAHAHAHAHAHAHHAHAHAHAHAHAHHAHAHAHAHAHAHHAHAHAHAHAHA‌​HHAHAHAHAHAHAHHAHAHAHAHAHAHHAHAHAHAHAHAHHAHAHAHAHAHAHHAHAHAHAHAHAHHAHAHAHAHAHAHHA‌​HAHAHAHAHAHHAHAHAHAHAHAHHAHAHAHAHAHAHHAHAHAHAHA noob.
 
@Zoidberg'-- Someday, somehow, we'll all end up as teachers.
But it'll be different.
 
user142019
2:41 AM
Other Java teacher thought classes implicitly got a non-argument ctor even when you explicitly created a ctor with arguments.
 
gah this stuff is just not my realm
 
@sehe TIL you have children
 
@Rapptz I'm so proud I realized it before you did :)
 
@MarcusStuhr What stuff?
 
web dev
 
2:52 AM
@Zoidberg'-- pbfcomics.com/130
 
trying to set up ssh/python
 
@Zoidberg'-- That would be silly. Java has no = delete feature
 
because PHP bleechuuhrnnrffhhhggg.
getting there slowly but surely
 
user142019
Write a Python-to-PHP converter.
 
PHP is like a hammer, but both sides of the hammer are the nail removal side.
 
user142019
2:55 AM
> You're a liar. You're a cheater. You're a FOOL.
 
@Zoidberg'-- I'm pretty sure that shouldn't be hard, at least if you count bytecode->bytecode crosscompilation
 
user142019
These lyrics use my favourite word!
 
user142019
@sehe TIL: there is PHP bytecode.
 
user142019
heh
 
user142019
2:56 AM
cool
 
There's even PHP->C++ transduction (facebook engineered it)
 
user142019
I once wrote a bytecode interpreter in JavaScript.
 
user142019
It was fun.
 
user142019
And Turing complete!
 
user142019
Registers were all floating-point though. xD
 
user142019
2:57 AM
It had an arbitrary amount of registers.
 
user142019
You could allocate as many registers as you wanted.
 
user142019
@sehe I know. HipHop. I confronted my development teacher with that during the first lesson.
 
user142019
He said languages like PHP and Python were always interpreted, never compiled. I mentioned PyPy and HipHop.
 
Bye all!
 
Night
 
user142019
2:58 AM
Goodbye Mark.
 
user142019
Now I'm in the mood to write a VM in C.
 
user142019
I could implement Malbolge.
 
user142019
That would be fun.
 
user142019
Except it uses a ternary VM. xD
 
user142019
> The standard interpreter and the official specification do not match perfectly.
 
user142019
3:02 AM
lulz
 
user142019
I need to store a ten-digit ternary number using bits. How many bits would I need? 3^10 = 2^n where n is... ln(3^10)?
 
user142019
Ah 16 bits.
 
user142019
For some reason Malbolge reminds me of PHP.
 
3:19 AM
looks like i might have to settle for php
 
user142019
Fun.
 
user142019
I have to modify trits represented using bits.
 
Hm.
Now for my convention.
LexicalCast<> or lexical_cast<> ?
 
user142019
I prefer lexical_cast because the standard casts also use that style.
 
Welp, hope nobody minds that I'm colliding with boost. :D
 
user142019
3:29 AM
But it doesn't matter, really.
 
user142019
@ThePhD namespaces, you fool.
 
using namespace boost
Isn't it so pretty? :3c
 
user142019
If you do that you're an idiot.
 
Awww I love you too Zoidberg. <3
I wish I could globally alias some namespace names in my code.
using boost = bst;
using std = s;
 
user142019
That's horrible.
 
3:33 AM
That's amazing.
 
#define? although maybe not for that std thing xD
 
user142019
Everybody in the world knows what std:: means. Nobody in the world knows what s:: means.
 
user142019
Also don't #define.
 
you can do that
 
user142019
namespace s = std;
 
3:34 AM
yeah
namespace boost = bs or w/e
you lazy fuck
 
user142019
I often do namespace fs = boost::filesystem but only in .cpp files.
 
Haha, I like namespace boost = bs :3c
 
user142019
Don't ever do it in headers except in function definitions.
 
user142019
namespace bs = boost; that would be.
 
I suppose using namespace is bad in headers too.
 
user142019
3:35 AM
It is.
 
I use it everywhere. :3c
 
user142019
 
Albeit it's only to import namespaces from other parts of my engine into the current namespace.
namespace Arf { namespace Meow {
    using namespace Arf::Woof;
}
I already went through and purged any and all using namespace std.
 
user142019
And suddenly, everywhere: Arf::Meow::SomethingThatBelongsInWoof();.
 
I wish there were directives that only lasted "for the file"
@Zoidberg'-- The good thing is most of my namespaces have no free-functions, save for the top-namespace Arf.
 
user142019
3:38 AM
It's the same for class names.
 
I don't see myself naming something the same, even across any of my namespaces.
 
user142019
 
user142019
xd
 
She must have a serious black eye.
That sandbag smashed her face
 
@ThePhD using only lasts for the file
 
3:39 AM
@AndreiTita Yes, but you can't using a whole namespace for a file.
 
@ThePhD The splatter is actually her brains being ejected through her ear
 
@ThePhD why not?
 
Also, no gifs please
 
@AndreiTita using namespace lasts beyond the file, whether .cpp or .h .
 
BBBENCIL
 
3:41 AM
@ThePhD wtf.
That doesn't make any sense.
 
Unless you use an anonymous namespace, the using namespace directive will go beyond whatever while you have it in and spill into another file.
 
@ThePhD So that's how Neo could stop the sentinels outside of the Matrix!
 
    // File Arf.h
    using namespace PartyPooper;
    /* Do dee dooo, doin' work, da boo de badda, yeah... */

    ---------- Many Files Later ----------

    #include "Arf.h"

int main ( int argc, char* argv[] ) {
    AFunctionOnlyFoundInPartyPooper(  ); // <--- Legit, yo.
}
 
Header file.
 
@AndreiTita You can also #include .cpp files. Not that people would, but you can. :3c
 
3:44 AM
@ThePhD That's a watermelon.
 
@Rapptz Like I'm supposed to be able to tell.
 
It's pretty obvious.
Maybe the using namespace std is getting to your head.
 
@ThePhD In that way you can say that any using directive lasts past the end of any file as long as you so happen to include that file somewhere else
Sane people don't include .cpp files.
 
@Rapptz Maybe your namespace is getting to you, eh? EH?!
 
3:47 AM
Someone messaged me saying they liked my CSS and wanted to steal it
Should I say yes or no (hint: I don't care)
 
Say you don't care?
 
"Eat a dick."
 
user142019
@Rapptz say yes then sue them :P
 
Say "Indubitably."
Or "Exorbitant!"
 
Or say I like your wife...?
 
3:51 AM
I told him okay and if he needed help he can message me
 
WOW
What a nice guy.
 
user142019
> In exchange for your first-born.
 
God. You don't know how to have any fun.
@Zoidberg'-- Zoidberg has the right idea.
 
He's a moderator at /r/learnprogramming and that place is full of weirdos.
 
user142019
lol
 
user142019
3:52 AM
Just like this place, eh?
 
you know how you guys always talk about how php always sucks?
 
user142019
Yes.
 
Well over at /r/learnprogramming they always talk about how amazing python is how many babies they would have with it if it were a human being
 
user142019
It does.
 
user142019
PHP is terrible.
 
user142019
3:53 AM
@Rapptz lelz
 
...
I need an adult.
 
user142019
The python would rather strangle them.
 
user142019
And Guido would sue them. xd
 
Guido?
 
user142019
Guido van Rossum (born 31 January 1956) is a Dutch computer programmer who is best known as the author of the Python programming language. In the Python community, Van Rossum is known as a "Benevolent Dictator For Life" (BDFL), meaning that he continues to oversee the Python development process, making decisions where necessary. He was employed by Google until 7 December 2012, where he spent half his time developing the Python language. In January, Guido will be moving to Dropbox. Biography Van Rossum was born and grew up in the Netherlands, where he received a masters degree in mathemat...
 
3:56 AM
Dat Dropbox.
 
4:44 AM
0
A: Extract string from string containing with date/time

shiplu.mokadd.imUse int to read Integers, NOT char. int day, year, hour, min, sec; sscanf(line,"%s %s %d %d %d:%d:%d %s", traceDirection, month, &day, &year, &hour, &min, &sec, peripheralName); See Ideone To read only prefipheralName use this, sscanf(line,"%*[^:]%*s %s...

 
user142019
Or don't use scanf/sscanf at all.
 
user142019
import io

main = ->
    name = gets()
    if name == "Zoidberg"
        puts("Whoop whoop whoop!")
    else
        puts("Hello, {0}!", name)

    puts("{0} = {1}", 2#11111111, 16#FF)
 
@Zoidberg'-- thats a different language I think
 
@shiplu.mokadd.im It wouldn't be the first time something not C++ related was typed here.
 
5:04 AM
I hate food which tastes like soap.
 
@AndreiTita It happens if the plate or bowl or glass your are using is not washed well. There are still soap or detergent in it. Yack!
 
@shiplu.mokadd.im It was BREAD.
 
@AndreiTita you sure its not washing sponge? :P
---
I am trying to move completely from C to C++.
For some reasons, it seems memory management is much easier in C++ than C. Or I haven't seen any that type of code yet.
6
 
user406009
5:34 AM
RAII makes a lot of resource management issues simpler in C++.
 
I just saw that on Reddit, haha
 
That is one cool picture.
lol
 
user406009
Just rediscovered this:
 
user406009
 
user406009
5:41 AM
Best programming joke video I have seen so far.
 
@Lalaland Brilliant.
 
That dinner scene is fantastic
Shutdown jingle lol
 
lmao
 
"...a masterpiece!" -- James Gosling :))
 
 
1 hour later…
Overrated.
 
I actually quite liked that show
 
Good for you.
Wasn't there a sequel, though?
Hmm. Only a movie, apparently.
Meh apparently I managed to forget the syntax for my own console implementation
 
7:56 AM
@Zoidberg'-- oh no!
 
8:19 AM
Holy shit, this is awesome:
template<typename T>
typename std::remove_reference<T>::type* operator&(T&& x) {
    return std::addressof(x);
}
Now you can take the address of temporaries!
 
8:33 AM
@Pubby i think i must have posted that code at least 8 times on SO, but without the silly remove_reference. note that i chose to not post it for the question at hand.
 
@Cheersandhth.-Alf Oh, I hadn't seen it before
 
in C++03 the same just involved a const_cast and relying non-portably on the compiler not introducing extra temporary for argument...
 
Anyway, I'm off to bed. Night.
 
oh good morning! :-)
it's 9:36 AM in norway
 
I just shit bricks, this is why I wanted to be a programmer. To make cool stuff like this.
 
8:40 AM
Cool stuff.
 
So you've wanted to be a graphics programmer?
 
It's one of the things I consider(ed) yes
But what I meant to say is that... what made me want to be a programmer is this idea that you can come up with a cool piece of software that'll blow people's mind
 
I prefer blowing my own mind. :P
 
9:01 AM
I hear getting blown is more fun than blowing yourself :P
 
 
2 hours later…
10:34 AM
i learning through beej guide for socket programming
 
guides are for noobs.
 
i m a begiiner
i was asking ...there is a program called selectserver.c
hw to run it ???
gcc selectserver.c
after dat ./a.out deos not shows any result .....
stuck up ...
help
 
rtfm
 
sir ... i read
 
Ell
Hi guise
 
10:53 AM
hi
 
@Borgleader That joke blows :)
Ohai
 
Ell
Hmm. Can anyone suggest a way to define charge?
I have a property which determines the electromagnetic interaction of a particle atm but I don't like that
 
it's the unit of the electromagnetic force
 
Ell
That is good
meh I'll just hand in whatever and ask teacher to change :3
 
@DeadMG tesla? I forgot
 

« first day (812 days earlier)      last day (4139 days later) »