« first day (1501 days earlier)      last day (3450 days later) » 

8:20 AM
fuck fuck fuck
project overdue classes in 3 hours
driving lessons in 2
work not done
beng project end coming faster than ever
HALP
 
user1804599
> Don't like the cops? Next time your house gets broken into, call a crackhead.
 
user1804599
Nice.
 
user1804599
@JoachimSauer the most horrible part is the singleton. — rightføld 7 secs ago
 
@FredOverflow I like how he uses Hell & World
 
user1804599
@Ell buy me Coca-Cola.
 
8:26 AM
fuck fuck fuck
i have so much to do I dunno where to start
 
Xeo
lol
bad planning?
 
user1804599
@BartekBanachewicz make a list of things to do in no particular order, shuffle it and start at the first task in the list working your way through the last one.
 
@Xeo kinda
 
user1804599
It's relatively cold outside.
 
user1804599
Three degrees. Hmm.
 
user1804599
8:32 AM
It felt more like eight.
 
Xeo
> Temperature: 1.19°C
 
user1804599
Apparently Google also calls such widgets oneboxes.
 
user1804599
@FredOverflow You can also just translate it to bytecode and then use a decompiler. The result won't have gotos.
 
@BartekBanachewicz Too much lounging and not enough grinding. :D
 
8:41 AM
ugh fucking ui
fucking everything
 
user1804599
Play video games instead.
 
well fuck panic plan
we won't turn it in today
one week more, so less points but doable
exam today
speak english hard
 
user1804599
Speaking English is easy.
 
user1804599
users also following
33.3% Sex and Intimacy
 
user1804599
top kek
 
8:55 AM
If I want to look up an item in a vector with std::find(), what type is the returned object of and how can I access the found element?
 
Looked it up there, I know I get an iterator
but how can I get the element from the iterator
 
user1804599
*it, duh.
 
the iterator points at the object?
 
Xeo
that's generally what iterators do, yes
 
8:57 AM
never worked with STL before, thanks
I am used to java's collection interface where every container class has "contains" and "remove" operations that work without knowing the index of the object I want to check or remove
 
@tony ^
 
(implementing an observer pattern here)
 
user1804599
You can write contains and remove functions in C++ if you want.
 
don't use the p word here
 
@BartekBanachewicz pattern?
 
8:59 AM
shhhh
 
McBeth!
 
user1804599
template<typename It, typename T>
bool contains(It begin, It end, T const& x) {
    return std::find(begin, end, x) != end;
}
 
user1804599
like that
 
user1804599
Though static_cast<bool>(count(x)) is possibly more efficient but requires certain kinds containers not iterators.
 
.count isn't present on n-lookup containers, no?
 
9:01 AM
doesn't count() walk trough the whole container where find stops at the first element found?
in worst case both walk through the whole thing but count() always takes O(n)
 
user1804599
No, that would be silly on e.g. hash tables.
 
@salbeira depends on the container
in general count is present where it can be efficiently implemented, so on set/map
 
user1804599
I guess you can use SFINAE to call count if it exists and use std::find otherwise.
 
SFINAE?
 
9:03 AM
@rightføld OTOH I sense specialization for find for iterators of associative containers
 
user1804599
can't
 
@salbeira Template exclusion based on static condition.
 
user1804599
different container types can have the same iterator types
 
I feel this is getting very Meta
 
user1804599
9:04 AM
Yes, so specialization is unportable; you can't specialize twice for the same parameter.
 
user1804599
So you may get an error on one platform.
 
@rightføld yes, and find is a library function.
 
user1804599
find is irrelevant to specializing for iterators.
 
or is it?
 
user1804599
Indeed: it is.
 
9:05 AM
also container::find
 
user1804599
Oh that find.
 
well the other one too.
It's messy.
std::find
std::map::find
std::set::find
std::string::find
std::wstring::find
std::multimap::find
std::multiset::find
std::u16string::find
std::u32string::find
std::char_traits::find
std::basic_string::find
std::unordered_map::find
std::unordered_set::find
std::unordered_multimap::find
std::unordered_multiset::find
 
9:19 AM
uh UML is so shit
it's like formalizing making pretty diagrams suddenly made software design a well-defined topic
"describe entities, describe behaviours, describe data, bam done"
putting so much effort on the form of it instead of the contents is typical for unis, really
process over results.
 
user1804599
Yes we know this has been told many times before.
 
user1804599
Is there a tool that crawls a website and reports any 404 or 500 errors it finds?
 
user1804599
It'd be rather nice during development.
 
user1804599
> The IN-predicate on "arrival_protocols.id" was invoked with an empty sequence. This results in a contradiction, which nonetheless can be expensive to evaluate. Consider alternative strategies for improved performance.
 
user1804599
wut. why would a DBMS not optimize out IN ()?
 
9:27 AM
@salbeira the standard library*
 
user1804599
> x IN () is invalid SQL
 
user1804599
Oh. :v
 
@salbeira Macbeth*
@rightføld yes
hi
 
hi
 
user1804599
@LightnessRacesinOrbit link
 
9:29 AM
grr trying to follow lessons while thinking about keyboard button abstractions is tiring
also sleeping only 3hours is tiring
also thinking about weather or not i wrote tiring right is the same
 
gaming.stackexchange.com banned by office proxy
@rightføld no. dead link checkers have been commonplace for two decades. find one yourself!
@salbeira whether*
this is fun
ok i'm bored now
 
I feel like I need to write my own util library for std::vector that wrapps it so it has the same functionality as java's List<T> interface
I am so used to using that ...
 
get used to using std::vector
 
2 messages moved from Lounge<Factorio>
¬_¬ we'll ignore how old those are
 
we'll ignore how off-topic they are
 
9:40 AM
>.< the thing is it doesn't really do what I want though everyone uses it as what I would use an ArrayList for
 
what do you want that it doesn't do?
and if so, why are you using it?
 
Have a remove(Object) function
 
Xeo
Pro-tip: Forget Java
 
and I am using it as a container for listeners on a subject
 
9:41 AM
find-and-erase OR use a set instaed
 
subscribe(Observer obs){ this->obs_list.push_back(obs);}
 
built-in remove(Object) makes no sense on a vector
 
unsubscribe(Observer obs) { this->obs_list.remove(obs);}
 
Holla amigos :D
 
Why do you need an ordered list for subscribers? Can you have more than one identical subscriber? Do you need to iterate over subscribers in the same order that they were added?
 
9:43 AM
in no way
 
then you're using the wrong container bruh
no wonder it's not working out for you!
 
Though a way to iterate through the list is indeed needed
 
@salbeira what the heck is -> ?
(n00b here)
 
It's like '.' on Pointers
 
9:43 AM
std::set<Observer> observers;
observers.insert(obs);
for (auto& el : observers) { el.observeSomething(bruh); }
observers.erase(obs);
@Nick: a->b is (*a).b.
it is called the indirection operator
 
since 'this' is not a reference to the object you are working within but a pointer to that object you need to use (*this).operation or this->operation
 
@LightnessRacesinOrbit and b is defined globally?
 
Sometimes I wish this were a reference.
Wait; why is this not a reference?
 
Xeo
this was before references were added to the language
 
this is insane.
 
9:46 AM
it would be easier to go from java to c++ if this would be a reference
 
(My previous comment was a movie reference)
 
I am still used to always write the '.' and then get compiler errors
 
@salbeira Old habits die hard. (Gosh, that's another movie)
 
Xeo
Pro-tip: Just drop the this->.
 
there are bigger differences between Java and C++ that you need to understand, than the partial change from . to ->
 
9:47 AM
@Xeo also an old habbit
 
Xeo
6 mins ago, by Xeo
Pro-tip: Forget Java
 
@Xeo Why do I keep thinking Java the Hutt?
 
It's Jabba though.
 
Also it improves readability a bit by causing code highligting and also making it abundandly clear that you are calling a member function and nothing globally defined
 
@Rapptz It's all gibberish to me :D
 
9:49 AM
@salbeira it's just noise
 
Thats opinion
 
it's pretty obvious you're not going to be calling something "globally defined" because you're not supposed to put things in the global namespace
people use namespaces here
@salbeira Common opinion.
 
@salbeira As much as your 'improves readability' claim.
 
true that
though C libs don't have that afaik
 
9:52 AM
@Nick b is a member of a.
@Xeo orly
they could have changed it in 1998 ;p
class.staticmember used to be a thing; :: was a relatively late addition
I'm quite tempted to ask it on SO so people can provide facts about the evolution of the language w.r.t. this
 
it's a duplicate
 
inevitable "closed as subjective" though
aw
 
urgh ... people with years of exp ... scary ...
 
77
Q: Why 'this' is a pointer and not a reference?

NaveenI was reading the answers to this question C++ pros and cons and got this doubt while reading the comments. programmers frequently find it confusing that "this" is a pointer but not a reference. another confusion is why "hello" is not of type std::string but evaluates to a char const* (point...

 
@Rapptz Yes.
 
9:54 AM
@salbeira No, it's a jackpot.
 
@LucDanton Not sure.
 
@Rapptz doubtful
oh, in C++
 
It’s a keyword. It’s never going to work.
 
9:55 AM
So a C program can't use C++ keywords?
 
It can.
 
He said "speaking of C" so I thought he was asking about C
The key is that extern "C" does not make the encapsulated code turn into C code; it is still C++ code
no C program there
 
I'm asking because I use a C library that uses new and operator without compile errors.
in C++
 
You could compile void func(void* this); in C, of course
@Rapptz nope
 
well I compiled it with g++ m80
 
9:56 AM
it's either a C library or it's in C++ :/
 
so unless some black magic is going on
 
Can you take a closer look at the compile command?
 
hmm can u to show
 
lemme show you the file
and you can try it
 
inb4 printf("%s", "I made a new operator"); // omg why does this compile
 
Xeo
9:57 AM
extern "C" only changes linkage, so you can't use C++ keywords for that part. which might be nasty, if an external library has void new(stuff) or something. hm.
 
I will have to find it first
 
ok
I am rapptz with anticipation
 
Adjective: rapt (comparative more rapt, superlative most rapt)
  1. (not comparable, archaic) Snatched, taken away; abducted.
  2. Sir H. Wotton
  3. (not comparable) Lifted up into the air; transported into heaven.
  4. 1906, Ford Madox Ford, The Fifth Queen; And How She Came to Court, Works of Ford Madox Ford, 2011, unnumbered page,
  5. 1908, Kenneth Grahame, The Wind in the Willows
(6 more not shown…)
Verb: rapt (third-person singular simple present rapts, present participle rapting, simple past and past participle rapted)
  1. (obsolete) To transport or ravish.
  2. (obsolete) To carry away by force.
Noun: rapt (plural rapts)
  1. (obsolete) An ecstasy; a trance.
  2. (obsolete) rapidity
  3. rapt m (plural rapts)
 
good; you got it
 
9:58 AM
Random n00bie Question: .exe files are run in a DOS prompt, yes?
2
 
no
 
what is it, then? it's something to do with DOS
 
Xeo
no
hm, damn. My position transformation isn't roundtripping. Ugh.
 
.exe files are executed by your system's shell. a command prompt is one such method of gaining access to a shell. Windows Explorer is another example. DOS has nothing to do with it since 1920
 
FYI, Say no on more time and I'll sing the Bohemian Rhapsody.\
 
9:59 AM
pet peeve: people calling it "the DOS prompt"
 

« first day (1501 days earlier)      last day (3450 days later) »