« first day (891 days earlier)      last day (4283 days later) » 

09:00
namespace detail { std::function<void()> foo; } "Error: already defined in foo.obj"
@jalf right, shame on me :-/
make it a typedef and the same effect
clean rebuild?
@FredOverflow irrelevant, if the problem is multiple definitions at link-time
@FredOverflow #pragma once at the top
@FredOverflow I tried that yesterday, had no effect
09:01
er, would we expect this to work?
I don't know :/
extern it in the header, and define it in a .cc file, IMO
user142019
Meh.
if you're creating it at namespace scope
@TonyTheLion Is that code from a header file or an implementation file?
09:02
I thought it should work
@FredOverflow header
user142019
WHY IS EVERYTHING UNDER ELEKTRICITY
@TonyTheLion You can't have object definitions in a header file. As soon as you include it more than once, you get multiple definition errors at link time.
I mean, you're basically just creating a global variable foo every time that code is read
It's nothing to do with std::function. The same would happen if it was an int :)
Why global variables in C++ are a pain, #23
Why C++'s lack of modules sucks, #42
but but,typedef std::function<bool(string,string)> comparator; I have a map<int,int, comparator> declared in a header? How do I get the comparator known in that header if I define it in the CPP?
user142019
09:04
Why C++ sucks, #65
// header file:
extern int x;
// one cpp file:
int x;
@Zoidberg only 65?
user142019
@StackedCrooked 42 + 23 :v
@TonyTheLion A quick fix is to make the definition static, but then each translation unit gets its own comparator. And I'm not 100% sure this is kosher.
user142019
09:05
Another quick fix is to not use a global.
Or create a function which defines both the map and the comparator as statics, and which returns a reference to the map
user142019
Use a singleton. \o/
@Zoidberg That would be more of a refactoring than a quick-fix :)
aaaand make the function inline
user142019
@FredOverflow it increases future life by a factor of ten.
09:06
What life?
user142019
Tony's life.
Your mom's.
user142019
Or at least, the code's maintainer's life.
@Zoidberg what
user142019
> implying I'm serious.
09:07
What's a singleton?
user142019
A moronic design pattern.
@StackedCrooked The result of adding two half-tons.
Never heard of it.
user142019
Vuile leugenaar!
@Zoidberg What's a design pattern?
09:08
@FredOverflow the antonym of benign pattern
user142019
@FredOverflow a halfton?
@Zoidberg Two halves make one single.
@FredOverflow no its ok, I'll use extern
@FredOverflow Metric or Imperial?
@BrettHale I'm pretty sure 0.5+0.5 = 1 holds in any system, even IEEE754.
user142019
09:09
T* get_instance() {
    static T x;
    char* data = new char[sizeof(T / 2)];
    memcpy(data, (char*)x, sizeof(T / 2));
    return (T*)data;
}
user142019
Halfton!
@FredOverflow Imperial it is.
How do I get the other half? And how do I add them?
fuck C++ up the arse hard
Which one? C++ has multiple arses.
user142019
09:10
@FredOverflow call get_instance twice and put both in a buffer of size sizeof(T).
@FredOverflow ALL THE ARSES
2
Ew, yellow looks really weird on my new monitor.
Anyway, you may want to read this. Yours is problem 4.
oh, this is cute. If LANG=<some-invalid-locale>, boost::filesystem throws an exception at load-time
09:16
ahoy maties
Three day course for me
Writing 'better' java
/me burns @thecoshman at a stake for his unfaithfulness.
Is how I earn my daily rum
:)
And to be fair, java is one of the better parts of my job
Sad isn't it
user142019
Kill yourself.
09:23
Yeah. But I can relate, I think. While I do C++ now, there has been a time when I have been doing Windows Batch Files programming (if we can call it programming) and Apache Ant scripting with bits of PowerShell, Perl and Java sprinkled all over, maintaining an ad hoc continuous integration build system. :)
Unfortunately, the batch files were really the meat of the system. There were thousands and thousands of lines of batch files for everything.
When you grow up zoid, you will learn to earn money
@thecoshman Still its better than PHP :(
user142019
I'd rather write PHP than Java.
user142019
At least it's actually expressive.
So I was just learning to use the STL in C++ and started with Algorithms after finishing the sequential containers chapter in C++ Primer. Suddenly I realized that I didn't know how push_back() and insert() were implemented if it comes down to write code to construct them.
The authors always told that using built in arrays is redundant and so I never cared to learn DMA and learn Data Structures before using the STL containers like deque and list. What should I do? Start with learning DMA and DS and then use the STL or just continue what I was doing originally?
09:26
DMA as in Direct Memory Access?
Dynamic Memory Allocation
DS?
Someone not on a phone link this man somewhere
Data Structures
Data structures
09:27
Learn to use the STL
@ChosenTorture: You should certainly learn about memory management and data structures at some point.
user142019
Why do you need to specify fields when doing SELECT COUNT(fields) FROM Table? Doesn't it count the number of rows?
Then afterwards, look into how they're implemented/how you would implement something like it yourself
@ChosenTorture Why do you want to know implementation of push_back?
@Zoidberg because you want the result of the query to be the number of rows
09:28
@Zoidberg IIRC it counts different values
@VinayakGarg I want to understand something that I am using.
user142019
@Abyx Oh. Then it makes sense.
@Zoidberg You give long term survival advice, don't you? :P
@Zoidberg: Can you say SELECT DISTINCT COUNT(fields) or SELECT COUNT(DISTINCT fields)? I vaguely seem to remember some such thing.
user142019
@jalf Then how are fields relevant? Each row has the same number of fields.
09:29
@ChosenTorture And you should. But you don't need to understand everything right now
@Zoidberg because SQL
user142019
T_T
SQL is dull
You have to choose something to count, and COUNT(*) may be slower in some cases according to some
@jalf So you're what saying is that I should continue learning STL and understand it later?
09:30
@ChosenTorture yes
user142019
> The COUNT(column_name) function returns the number of values (NULL values will not be counted) of the specified column.
user142019
Oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo‌​ooooooooooooooooh.
The alternative is trying to understand how the STL is implemented now, and not learn how to use it until later
user142019
Source: W3Schools, so still not sure. :(
they not that bad
user142019
09:32
@jalf if at least one column is UNIQUE NOT NULL, that can be O(1) given the database stores the number of rows per table and it has at least a semi-decent optimizer.
SQL is pretty good, IMHO, for what it is designed for. Too bad that RDBMS do not track the standard that well.
It may be, but it's still dull as all hell
Heh.
user142019
I like SQL.
user142019
For the most part.
09:33
@jalf But I don't think that would be efficient. I am learning C++ right now to implement DS and Algorithms in the future. If I just keep using STL why would I want to learn how to sort? I would just use the sort() function from the STL. So my point is that I want to understand how these functions and containers work before using them.
I find the theory behind RDBMS fairly entertaining.
Xeo
Xeo
FUUUUUCK
user142019
If only the convention wouldn't be ALL CAPS.
Xeo
Xeo
I didn't hear my alarm again
user142019
@Xeo connect it to a timer and a bucket of water.
09:33
@ChosenTorture: Because you cannot really become a good programmer without understand the fundamentals of CS.
user142019
If you don't wake up in one minute, bucket water over your head.
@ChosenTorture: That includes at least vague understanding of basic algorithms like sorting.
user142019
You'll wake up immediately.
Or drown
user142019
09:34
Or both.
user142019
Maybe you'll drown in your hydrated pillow.
@wilx Exactly. And that's the reason I want to learn DMA and DS before using the STL. So what do you think? Is that approach correct?
@ChosenTorture agree. You should know sorting for certain. I got so used to std::sort, I couldn't write merge_sort quickly in a competition.
Any hoops, course don't ignore itself
Later
@ChosenTorture: Well, I guess it is viable. :) But I would not be too hard on myself with the ordering. You can learn both at the same time, I think.
user142019
09:36
Bye.
@VinayakGarg See! There's a problem right there. That's what I am afraid of :D I wouldn't want to be in a position like that
My unicode small white triangles look like shit in my browser
◃▿▹▵
@wilx I guess. Thanks for the suggestion! :)
@ChosenTorture BTW you may ask why was I writing merge_sort instead of std::sort? Because I had to count inversions in array.
@thecoshman In other words, "read Effective Java"?
@VinayakGarg std::sort isn't implemented as merge sort. If you're looking for that, you probably want std::stable_sort or something.
09:40
@FredOverflow Yeah I know std::sort isn't merge sort. See my last post.
@VinayakGarg Yes there's always a issue where you have to use the STL functions as an extension for a problem rather than using them as a norm. I think that if someone isn't aware of how things are implemented he wouldn't be able to use them properly.
@ChosenTorture: You probably do not want to look at the actual std::sort implementation. I suggest that you learn these from either a good book or at least from Wikipedia articles on sorting algorithms. Standard library implementations are too complicated for basic understanding of sorting.
guys
consider:
double d = numeric_limits<double>::max();
d += 1.0;
@wilx Yeah I realize that and that's why I intend to use Introduction to Algorithms for understanding things.
now Y isn't d infinity? :/
user1357851
09:42
@BartekBanachewicz or d+=0.01;
user142019
I want to generate random names (for imaginary planets) that are pronounceable.
multiplication works, though d *= 1+1e-20 is too small still
@BartekBanachewicz: IMHO, because 1.0 is under the precision of the max().
user142019
Is there a known algorithm for that?
@Zoidberg yea. Don't overcomplicate. generate syllables and random from them
user142019
09:44
Of course, thanks.
@wilx ouch.
floating-points suck
@Zoidberg: See the APG utility, it somehow does generate pronounceable passwords. Maybe you could use that. IIRC it points at some documents related to that as well.
@BartekBanachewicz: Was this a theoretical question or is there some other problem that you are trying to solve?
@BartekBanachewicz Because infinity is too far away, so the number gets rounded down again.
If you set to round up, it will probably end up infinity.
@Zoidberg Markov chains
user142019
1> voxx_planet:random_name().
"bobabi"
2> voxx_planet:random_name().
"biba"
3> voxx_planet:random_name().
"bubibeby"
user142019
LOL
user142019
10:01
Consonants = "qwrtpsdfghjklzxcvbnm",
Vowels = "eyuioa",
AllSyllables = [[C, V] || C <- Consonants, V <- Vowels],
%% randomly concat syllables
user142019
^ This is good enough.
10:12
B game with all names starting with B? :)
user142019
It could generate a name "Nazi" or something like that lol.
user142019
> Dumodikaguqyruku
Faith in humanity restored
Heap corruption how I hate thee. Fuck C++.
user142019
Now I must make the name generation unique. :v
Xeo
Xeo
10:17
@R.MartinhoFernandes You suck :D
user142019
Hmm.
@TonyTheLion: WTF?!
user142019
I will just append "II", "III", "IV" etc… if the same name gets generated multiple times.
@Xeo I just commented all calls to my code and am now running a barebones project. All I changed was linker options and #defines :'(
@wilx What?
Why is that WTF?
10:22
@TonyTheLion: I mean, the mother forcing the kid to sleep on a floor, that's the WTF.
user1357851
@TonyTheLion faith in humanity restored on reddit? Woah :O
@ChosenTorture because you stated that you want to learn it
@wilx that is wtf indeed, but the bit I was referencing was the cops giving the kid something for xmas
I mean, you already said that you wanted to learn it, so why worry about "what if I suddenly don't have a reason to learn it"
That awkward moment when your answer gets unaccepted 23 months later in favour... of the other answer that was posted at just about the same time.
10:29
Fuck, now it's gone. I lost my repro.
Xeo
Xeo
lol
@sehe OP is a faggot
user1357851
@R.MartinhoFernandes robot, you avatar ...
user1357851
The subject of the damsel in distress, or persecuted maiden, is a classic theme in world literature, art, film and video games. She is usually a beautiful young woman placed in a dire predicament by a villain or monster and who requires a hero to achieve her rescue. She has become a stock character of fiction, particularly of melodrama. Though she is usually human, she can also be of any other species, including fictional or folkloric species; and even divine figures such as an angel or deity. The word "damsel" derives from the French ', meaning "young lady", and the term "damsel in di...
user1357851
looks pretty pornographic to me
10:32
I have no idea what to say today, someone initiate a conversation
user1357851
@TonyTheLion read the wikipedia entry above
user142019
Erlang lists y u one-based.
user142019
WHAT THE FUUUUUUUUUUUUUUUCKKKKKKKK
Ah, fuck off.
10:34
^ What a fearsome dragon
oh @kbok hi
@R.MartinhoFernandes erm?
Hi!
How is you?
user1357851
@kbok I know, it is kind of smallish for a dragon isn't it?
@TonyTheLion so, which is your favorite brand of cookies?
10:36
Well, my job is a bit meh somehow, but I'm okay
@jalf ohhhh jaffa cakes, yours?
@TonyTheLion Wasn't meant for you.
@Telkitty Also no arms
@kbok well, same here.
Also piggyback tail
@TonyTheLion Finding a cool job is like the quest of my life
10:37
@kbok yea. Its a hard quest, imho
Yeah... third job in two years and still not happy
user1357851
@kbok one would wonder how did the dragon capture the girl
I know the feeling
Its kinda hard to figure out what I want from a job
@Telkitty She doesn't look much captured actually
so for now I'm just sticking with it, but I'm always on the lookout
10:39
Yeah, same here.
hello
anyone knows here c#?
sorry for asking coz in c# room they said its for java :( and i badly needed a help for c#
user1357851
@kbok that's what I thought, she could be the joker in disguise! Happy enough to watch the fight.
Actually I'm just waiting for my loan to be fully reimbursed and I'll consider pretty much anything
@Elegiac They said C# is for Java?
10:41
lolwut
Dude, you have just been trolled.
nope i just read the definition of their room
w8
lulz
and no ppl there :(
C#

We lied. It's actually JavaScript room. The JavaScript room is actually just trollbait.
Says here there are 18 users there.
well, frankly, we don't care about C#
Y U NO USE Stack Overflow?
10:42
i have question but
its still not been answer
I have many questions
but I don't ask them here
and i badly need help for c#
because they don't belong
Your question is inintelligible
10:43
0
Q: String cannot be zero length .Parametername: oldValue error c#

ElegiacRelated to this topic: How to replace last comment by SelectedText I want to replace lasttext in richtextbox from a combobox. Like in a code-editor and context-hint senario. 2box named: richtextbox = rtb combobox = lb when I type keyword in richtextbox sample I type "as" Then conte...

this???
:(
nope i mean
0
Q: Unique value of string

ElegiacHello i'm working on some replacing code using TrimStart||RemoveFromStart; public string RemoveFromStart(string s, IEnumerable<string> strings) { foreach (var x in strings.Where(s.StartsWith)) { return s.Remove(0, x.Length); } return s; } and scenario would be the...

here ...
The boss wants us to track our time
anyone pls?
I mean, we're a 5-programmers shop and our boss wants us to track our fucking time on this shitty webapp
we have to fill in our time
10:45
thats bad
who knows here c#?
well, your question needs to be phrased in English and understandable for anyone to answer it
Ha, it's back!
what do you mean sir?

 Tamil mobile app developers

“To accomplish your mission, first sharpen your tools.” Succes...
lol what
10:46
We've seen that question before.
can you help me boss?
FFS, I bet it's the damn PCH messing me up.
CHAT FFS WILL YOU FUCKING SCROLL DOWN
user1357851
@R.MartinhoFernandes You can change your avatar, can you not? I mean every other dumb/useless chick needed to be rescued in that wiki article (except for one that looked like the joker) have stripped themselves naked in order to attract the attention of heroes, I am sure the chick in your avatar has done the same?
10:49
@Elegiac What problem are you actually trying to solve with that?
how to make string unique
because I suspect you're writing about a problem you're having with solution X whereas you should be writing about your actual problem you're trying to solve (XY problem)
@Elegiac use hash function
string.hash
wat hash
MD5
whichever fits your use
can you tell me the code
10:50
Google it
its out there, and its not uncommon
there you go
tony, man, don't help the help vampires, then they'll just come back
2
its for windowsform c#?
meh, I thought I was being nice
ahaha thanks :( ill read your nice man
@Elegiac its for whatever you want to use it for, also you need to get a book (on C#) and read it
10:52
@Elegiac "can you tell me the code"? GTFO
We don't serve your kind here.
user142019
plonk_list.push_back(&Elegiac);
lol
anyways, moving on
sorry martinho, dont be mad :)
Look, Monday, I don't think you know who you're fucking with here.
10:57
That's exactly how I feel right now.
can isay badwords here like -> ,,i,,?
yea makes sense
Mar 21 at 19:18, by Lightness Races in Orbit
Welcome to the Lounge! Here are some handy hints. Enjoy them with salad.

« first day (891 days earlier)      last day (4283 days later) »