« first day (1077 days earlier)      last day (3876 days later) » 

6:00 PM
ok have fun
 
6:11 PM
> To the mods: I added the C++ tag because this is also relevant to C++
> NOTE THAT *I must use C standard libraries not C++
╯°□°)╯︵ ┻━┻
 
where?
 
0
Q: How to locate the first occurrence of a string in a string

user2400925I need a function like memchr() but it should be able to locate a substring(string), not an only single char. And it should return the first occurrence found in string. For example p1 = afunclikememchr(str1,"here the function can localize this substring",200); To the mods: I added the C++ tag...

I already removed the tag.
 
What a twat
 
"Yes but it stops whenever it founds a '\0'"
So should all c string algorithms.
 
@DavidKron Which it's why a shame they can't use std::string.
 
6:17 PM
Thanks for answer I added this because you can use C libraries in C++ projects. — user2400925 3 mins ago
T_T that's his explanation for why he tagged his C question with C++
 
lol
strstr
that's just hilarious
 
@Rapptz I hate the C string function names
 
Isn't any name starting with str<letter> reserved in C or something?
 
Like... strrchr what the hell possessed them to name something this way
did they not have vowels on their keyboard?
 
6:25 PM
Is there a difference between T foo = { /*...*/ }; and T bar { /*...*/ }; (no equals sign)?
 
@Tuntuni yes
 
T foo = { ... }; won't compile with explicit constructor.
 
Is that the only one?
 
T foo = {} theoretically creates a temporary on the right side of the expression.
 
i assume an optimizer would get rid of it
 
6:28 PM
Ahh, right.
 
Yep, in sane cases, hence "theoretically" ;P
 
It still requires a copy ctor right?
Even though the optimizer is smart.
 
@Xeo 172... :-)
 
Xeo
aw
 
first try since I logged on this evening
 
6:31 PM
Hi guys
I have a question
 
i need help
 
user1804599
You can get help on Stack Overflow.
 
Call emergency
 
6:37 PM
all you'll get here is ridiculed
 
all you'll get here is loneliness
 
@chris Yes. Anything starting with str followed by a lower-case letter is reserved (§7.26.11/1 of C99).
 
user1804599
What happens when you call a virtual function in a dtor? Works just fine, right?
 
Not from base object.
 
user1804599
Why not?
 
6:41 PM
@JerryCoffin Good to know, thanks.
 
The derived object is already destroyed.
 
so youll get the base version
 
Hi guys
 
@TemplateRex 171 :D
 
user1804599
Ohh right.
 
6:42 PM
I have a question
 
user1804599
Arghh fuck.
 
ABBA pattern. B is already dead once you enter destructor of A .
 
What does the fish say when it hits the wall?
 
user1804599
 
user1804599
@kbok nothing; fish don't talk.
 
6:42 PM
@kbok Fish don't talk.
 
Okay, when does it think then?
 
@Tuntuni I am at 172 now
 
@TemplateRex :3
 
@Borgleader You'll get UB.
 
@kbok When it hits the wall.
 
6:43 PM
you just have to hit it at the top-right point of the star
 
@Tuntuni Yes
 
user1804599
kbok is drunk today.
 
@kbok I was answering your question. :D
@not-rightfold I agree. :D
@TemplateRex 173!! :D
 
crap
It's not like I said "Why does the fish say when it hits the wall?"
 
@Tuntuni @#$@#$#@$!
 
6:45 PM
2 mins ago, by kbok
Okay, when does it think then?
 
user1804599
> when
 
when
 
Oooh
 
@TemplateRex And I started literally 10 minutes ago.
 
Let me fix that
What does the fish think when it hits the wall?
 
user1804599
6:46 PM
That walls hurt.
 
@Tuntuni I just got 161 with 1 mishit :((
 
@kbok It thinks "I'll bet my cousin the walleye would have seen that one coming."
 
@kbok That it fucking sucks at swimming.
 
@JerryCoffin I had to google that
 
@TemplateRex :-/ Keep trying.
 
6:49 PM
^ Charming
 
user1804599
Are pointers affected by SIOF, or does it apply only to objects of class types?
 
some dude got 177
 
@not-rightfold SIOF?
 
185 even
 
177
yaay
 
user1804599
6:53 PM
@kbok static initialisation order fiasco.
 
192 yay :)
 
3rd time today
 
@FredOverflow Twice wasn't enough?
 
@not-rightfold maybe this answer helps with your SIOF question stackoverflow.com/a/17443575/2148672
 
7:05 PM
@GamesBrainiac wow!
 
Can't reach it anymore though
I'm stuck on 185 now.
 
@JerryCoffin Sorry, I wasn't in the Lounge today.
 
hahaha
 
Xeo
@Tuntuni whee, 178
 
@Xeo What are you playing?
 
7:07 PM
@Xeo nice :-) i can't get any higher, i'll try again later
@Borgleader google's pinata game
 
@GamesBrainiac I solved the 8 queens problem in Karel today. It was an absolute nightmare without variables and user-defined predicates.
 
@FredOverflow I'm just worried that with three posts about programming in one day, people may start to think programming would be topical here. :-)
 
@FredOverflow I have no clue as to what Karel is
 
> Karel is an educational programming language for beginners, created by Richard E. Pattis in his book Karel The Robot: A Gentle Introduction to the Art of Programming. Pattis used the language in his courses at Stanford University, California. The language is named after Karel Čapek, a Czech writer who introduced the word robot.
 
Sep 13 at 20:03, by FredOverflow
user image
 
Xeo
7:11 PM
182~
 
Do C++ standard library functions (the ones in <algorithm> in particular) provide guarantees like "won't make a copy of the argument" if they take it by reference or is it all impl-def?
@Xeo Woah. :3
 
@Tuntuni algorithms only make complexity guarantees
what's a single copy among friends? :-)
 
@TemplateRex Heh. ;) So if I have an object that's non-copyable do I use std::(c)ref?
 
@TemplateRex The C++ standard is not my friend.
 
@Tuntuni which algorithm do you have in mind?
 
7:13 PM
@FredOverflow I still haven't finished last week's homework =/
 
@Borgleader I haven't even started :-/ Somehow I'm not motivated at all. Dunno why.
Maybe my mind is too preoccupied with thinking about which monitor I should buy next.
 
@TemplateRex std::shuffle. I'm not sure if <random>'s engines are non-copyable but I had problem with their copy ctor being deleted a few weeks (maybe even months) ago.
 
@FredOverflow I was thinking of implementing kd-trees because theyre useful in game engines, but... idk ive been so busy
 
e.g. output iterators will be initialized with a reference to a container, but copying the container would violate the O(1) guarantee of iterators
 
@FredOverflow Looks like Java.
 
7:14 PM
@FredOverflow Heh, I have 3 of these: 24" VE248H
 
@Tuntuni I'm pretty sure std::shuffle does not copy the random engine. STL had a talk about rand at Going Native about random numbers.
@GamesBrainiac No, if it were Java, it would start with public class XYZ ;)
 
@FredOverflow Yeah, I think so too but there's no guarantee right?
 
@FredOverflow Still, looks like a java app.
The start and stop buttons look java-ish
 
It's Scala Swing ;)
 
Wait, Fred is using scala, I thought he only used Haskell
 
7:17 PM
Fred has been using Scala ever since I was here
 
hmmmmm
 
so... over a year
IIRC anyway
 
@Tuntuni Well, the standard says "In the third shuffle form of the function, the object g shall serve as the implementation’s source of randomness." which pretty much implies that g won't be copied.
 
@FredOverflow Ohh. Thanks for the quote. :)
 
@Tuntuni It's in 25.3.12 §4.
 
7:19 PM
@FredOverflow What's that "s sign" called?
 
@Borgleader You remember correctly, I have been programming in Scala for about 15 months or so.
@Tuntuni paragraph
 
I was talking to someone about Scala Lift the other day and now I want to work with it again =/
 
So what's stopping you?
 
The Steam Controller
Worst controller design I've seen in my entire life.
4
 
@FredOverflow The more than horrendous documentation
 
7:21 PM
That's gotta be an achievement.
 
@FredOverflow Using that I managed to find that's it's actually called the Section sign?
 
@Borgleader Scala has support for documentation?
 
THIS MONSTROSITY.
 
@FredOverflow liftweb.net No i mean the documentation for the library is total shit.
 
7:23 PM
@Borgleader And I meant that every time I peeked at Scala's documentation, I was thoroughly underwhelmed, mildly put.
 
Ohhhh you were taking a jab at scala xD my bad
 
I should have put a smiley. My bad.
;)
My judgment on Scala is that it's way too big and has too many special cases and obscure language rules. But you can get stuff done. So, pretty much like any other mainstream language.
 
@Rapptz looks terrible
 
@Rapptz Wait, that's a controller? I thought it was a boombox.
 
Yep. Steam's controller.
 
7:26 PM
@FredOverflow So §4 is called a section. What is the terminology for 25, 3 and 12? Clause?
 
@FredOverflow It's the Steam Controller
 
@Tuntuni I honestly don't know.
 
@FredOverflow Aw. :c Meh, I'll just call them that. ;)
 
according to dutwit, c++14 gets [[deprecated]], so now a whole new line of answering retard questions becomes available :-)
 
Good, they can deprecate atoi.
 
7:29 PM
lol
 
@TemplateRex :O I CALL DIBS
 
how can you call dibbs if I was the one mentioning it first, lol
 
You can call dibs as long as no one else has :P
 
yeah right, so if a boy shows a new toy to his friend, they get to call dibbs on that?
 
-.-; You have no sense of humor...
 
7:31 PM
nah, just messing with you
 
void dibs()
{
    static bool was_called_before = false;
    if (was_called_before) throw "Nope!";
    was_called_before = true;
}
 
To pledge or not to pledge... (is the question that's been bothering me for about a week)
 
@FredOverflow lol
 
@FredOverflow haha
 
@Borgleader Too late.
 
7:33 PM
@Borgleader Only €163 for a 24" monitor? Is it any good? Probably not the best Panel technology?
 
user1804599
Okay. It’s weekend and I don’t want to be bored.
 
user1804599
What shall I write?
 
@FredOverflow you forgot that dibbs takes a parameter Toy*
 
@chris T_T
 
@TemplateRex make it a template
@not-rightfold You could solve the 8 queens problem in Karel and mail me your solution. Mine is about 150 lines long, and I'm not proud of it.
 
7:34 PM
@Rapptz lol, yes, it's ugly as fuck, but as far as it works, who cares?
 
@not-rightfold a symphony
 
user1804599
@FredOverflow Easy: brute-force.
 
@FredOverflow Friend of mine recommended them to me. Said they were being used in tournaments. I'm pretty happy with them so far. But then again, monitor preferences can vary a lot from one person to another
 
@Jefffrey "Yes this knife is rusted and can barely cut, but as long as it works who cares?"
Bad logic
 
@Borgleader What kinds of tournaments? Games or programming?
 
7:36 PM
@Rapptz The "barely cut" part is not present in my message.
 
@Rapptz Doesn't that also apply to C++? :)
 
@FredOverflow Fighting games i think it was
 
@Jefffrey You can leave it out and it conveys the same message.
 
@Borgleader Okay, gamers have special monitor needs that I don't have.
 
user1804599
Guido van Robot (GvR) is an educational tool to help students learn the Python programming language, named after the creator of Python, Guido van Rossum. GvR uses the idea behind Karel the Robot, making the learning of Python programming more interesting. Using GvR, a student writes a program that controls a 'robot' that moves through a city consisting of a rectangular grid of streets (left-right) and avenues (up-down). Guido van Robot uses a minimalistic programming language providing just enough syntax to help students learn the concepts of sequencing, conditional branching, looping and...
 
user1804599
7:37 PM
lol
 
@Rapptz Nope. A good example would be "This knife is purple (ugly as fuck), but as long as it work, who cares?". "Rusty" can be related to "Damaged" which is really not what I was looking for.
 
@GamesBrainiac Oh wait, I confused you with @not-rightfold, sorry :( Must be the avatar. Or my stupid brain.
 
@Jefffrey this is how you logic
 
user1804599
@FredOverflow lol
 
@Jefffrey Oh you... :3
 
7:39 PM
@Jefffrey Cognitive bias towards what you believe is your logical standpoint.
 
@not-rightfold Anyway, it was you who couldn't start it due to lack of Java :)
 
Anyway for the record the logic is flawed.
 
user1804599
@FredOverflow :P
 
@Rapptz Can I buy the record?
2
 
@Rapptz Your logic is flawed.
 
7:41 PM
@Jefffrey No, yours is. "Who cares if it's shitty! As long as it works I don't care!" is basically what you're saying.
A lot of things do in fact work, what a surprise. That doesn't mean you can't have criticism or statements over the fact that you think it's shitty.
 
@Rapptz No. You failed to understand. Again. I'm saying that the look of a controller is not that important. It is more important that it works and is handy and easy to use.
@FredOverflow lol
 
Java to Scala converter. Now all we need is a Java-programmers to Scala-programmers converter.
 
I didn't even mention the look, I mentioned the design.
Do you not know that engineers go through design too or do you think design == looks?
 
"Design", what a broad term.
 
If you don't know English, sure.
 
7:46 PM
This conversation is flawed.
 
couple more days until Homeland, season 3
 
@Jefffrey I don't like Design. It reminds me too much of Design Patterns.
 
user1804599
@BartekBanachewicz Would it be a reasonable idea to implement a dynamically typed language on top of Lua, given its flexible type system?
 
@not-rightfold Lua is dynamically typed.
 
user1804599
I know. :P
 
7:47 PM
@not-rightfold Would it be reasonable to implement a dynamically typed language -> NO
 
@not-rightfold Terra is much better to write languages in it
 
Xeo
"Don't Ever...." design a language where it is nigh impossible to find leaks without resorting to such mechanisms. The argument that this is "bad" is absurd. It's only bad if there is a alternate method. If you have no alternate, then telling us to "Don't Ever" doesn't really solve the problem now does it? I KNOW why it is a bad solution. Now show me a good solution that does what I want. — Lloyd Sargent 20 mins ago
 
Within the thousands of definition of "design":
> Something designed, especially a decorative or an artistic work
 
> Design is the creation of a plan or convention for the construction of an object or a system (as in architectural blueprints, engineering drawings, business processes, circuit diagrams and sewing patterns).[1]
 
user1804599
@BartekBanachewicz Can I generate Terra code at runtime and run it?
 
7:48 PM
@Rapptz You just took one of the many definitions of the word. Congrats.
 
user1804599
Also, I finally get why Terra is called Terra. :lol:
 
Xeo
...
@Jefffrey "Design" - "something designed" -- yeah, recursive definitions sure help
 
@not-rightfold yes
 
@Jefffrey You can't be that dense can you?
 
user1804599
@BartekBanachewicz Cool.
 
7:50 PM
> organization or structure of formal elements in a work of art
 
@not-rightfold most Terra programs utilize runtime Lua run to generate the actual code. In a way, Terra is metaprogrammed in Lua.
 
Better?
 
Design is the creation of a plan or convention for the construction of an object or a system (as in architectural blueprints, engineering drawings, business processes, circuit diagrams and sewing patterns). Design has different connotations in different fields (see design disciplines below). In some cases the direct construction of an object (as in pottery, engineering, management, cowboy coding and graphic design) is also considered to be design. More formally design has been defined as follows. :(noun) a specification of an object, manifested by an agent, intended to accomplish go...
 
@Rapptz Yup. I can be that stupid thickheaded sometimes. Not today though.
 
@Xeo where did that comment come from? what a buffoon
 
7:53 PM
buffoons gonna buffoon
 
> Designing often necessitates considering the aesthetic, functional, economic and sociopolitical dimensions of both the design object and design process.
lol
... aaaand I'm out. * mic drop *
 
I read the Design of Design by Fred Brooks (the mythical man-month dude)
it goes on an on about the redesign of his summer house
 
@Jefffrey What's wrong with that?
 
@Jefffrey You really are dense.
 
lol
 
7:57 PM
we should nickname you "bitfield"
@BartekBanachewicz wanna call dibbs on that nick? ;-)
 
@TemplateRex hem, Brooks is the author of another book I own
@TemplateRex why should I?
 
@FredOverflow There really is no one "best" panel technology. IPS variants give very accurate color. AMOLED gives blacker blacks and higher contrast ratio. You have to choose based on your needs, not one being clearly better than the other.
 
@BartekBanachewicz which book?
 
AMOLED is a crap used to extensively market samsung shitty devices
@TemplateRex Head First Object Oriented Analysis and Design
 
Any idea what causes this?
It is still there :\
 
7:59 PM
Windows. Uninstall it.
 
@BartekBanachewicz do you have some technical knowledge of touch screens? I have some weird thing wiht my NExus 10
 
@Rapptz But seriously, you suck at logic. "Design" can also be correlated to the "look" of something. When I read your message I understood that definition (also because in italian it is used mostly in that sense) and I've commented accordingly. Don't take it that hard.
 
@Pawnguy7 density
 
@TemplateRex I don't build them, if that's what you're asking :).
 
user1804599
I presume it's also possible to use Lua with C++ types?
 
8:00 PM
@not-rightfold elaborate. show example, presumably.
 
Xeo
Oooh, an actual Trailer for 1.2
 
user1804599
@BartekBanachewicz Say, struct foo {}; and then storing a foo* in a Lua table.
 
here's my thing: whenever I scroll really fast (e.g. on this chat), then when the scrolling ends, the bottom of the screen has a blueish hue for about 1 second
 
@not-rightfold you can store a pointer, sure. But Lua won't be able to read it.
 
@JerryCoffin I need to buy the best programming monitor :) I watch Simpsons episodes and stuff casually. No gaming, no graphics design.
 
8:01 PM
@Pawnguy7 Mass and volume.
 
Xeo
Guess I will have to take next Friday off for a 4-day weekend.
 
@TemplateRex that's by design (I think) /cc @Jefffrey
 
like the pixels are sort of braking really hard from the scrolling
 
@Jefffrey This is the last time I'm commenting before I plonk you out of idiocy, but "Design" is the thought process that goes into making something. This includes everything including the look of something but not limited to it. Don't argue semantics when you don't know about it.
 
user1804599
@BartekBanachewicz The latter is obvious. :P But I can extract it again in C++ and then use it, right?
 
8:01 PM
@not-rightfold yup. It's called userdata.
 
@FredOverflow In that case, buy something cheap so you can get as many/large as possible (as long as it doesn't bother your eyes).
 
user1804599
Ok. :3333
 
@BartekBanachewicz is there a way to turn it off?
 
@not-rightfold as a footnote, Lua can detect such types, and type(v) == "userdata"
 
@Rapptz Don't care enough.
 
8:02 PM
@TemplateRex Not without interfering with the Android insides, I'm afraid.
 
@JerryCoffin So the panel technology doesn't matter at all in my case? Cool. So what 24" with 16:10 would you recommend? It should have VGA, DVI and HDMI, just in case. And it should be rotatable and height-adjustable and stuff.
 
@BartekBanachewicz oh ok, i thought my screen was malfunctioning, because my Nexus 7 doesn't do that
 
@TemplateRex and yes, it's completely by design, I've just tried on my N4 and it's the same there
 
who made the N4?
 
Isn't buying a 27" with the same resolution as a 24" stupid? I mean, I don't get any more pixels, they're just larger...
 
8:03 PM
@TemplateRex LG
 
cuz the N7 is by Asus and the N10 by Samsung
 
@FredOverflow it is. 2560x1440 or GTFO
 
@BartekBanachewicz So what is an awesome 27" programmer monitor?
 
@FredOverflow No, I wouldn't worry a lot about the panel tech in that case. I haven't looked at those monitors enough to recommend anything though (I do a fair amount of photo-editing, so that's about the only monitors I look at).
 
@FredOverflow Why VGA?
 
8:04 PM
@Rapptz notebook
 
Do modern monitors come with VGA?
 
@FredOverflow after your read this, Dell UltraSharps are ok in both 24 and 27 variants
 
@BartekBanachewicz How about 2560x1600?
 
@Rapptz some of them, yes, but it's just for legacy obviously
@FredOverflow I thought you prefer 16:9
 
@BartekBanachewicz I'm not too sure anymore. I have an U2412M at work, and I like the 16:10 :)
 
8:06 PM
@FredOverflow well those are imho the best bang for the buck
 
At least IMO, for programming, the vertical size matters more than horizontal, so I'd go for 16:10 over 16:9.
 
or by a 16:9 that can swivel and make it a 9:16 :P
 
I will buy a 3rd one someday
and pivot them all to vertical
 
Xeo
8:15 PM
> Use # or \ as a digit separator?
 
user1804599
@Xeo @!
 
What if you had \0...?
Wait nvm.
I haven't C++ed in too long it seems.
 
user1804599
1˘000˘000
 
fortran vs erlang`?
 
8:19 PM
1‮000҉000‮҉
That took me so long to make.
It's hard when you type something and have no idea where it's going to appear and where the other characters move.
 
user1804599
@DavidKron Comparing Fortran to Erlang is like comparing C to AutoHotkey.
 
Xeo
^ I got that idea at work today, when we talked about our bitstreams, how we should use overloaded operator<<, and how to nicely insert debug-names for values with that.
 
@not-rightfold Some folks still writes simple macro bots in C as-well as full programs in ahk.
 
8:37 PM
jvmOptions[0].optionString = (char *)("-Djava.class.path="+classPath).c_str();
jvmOptions[0].optionString = (char *)("‑Djava.class.path="+classPath).c_str();
Yay, I successfully used a non-breaking hyphen. I'm so great.
 
Y U cast c_str() to char*?
 
@FredOverflow Not me, some OP.
You especially don't want to do it here because it's dangling.
 
@chris s/OP/faggot
 
Well, I'm assuming it's a dangling char * and not put into a std::string or something.
 
8:43 PM
std::string s = (char*)some_string.c_str();? Nobody could be that stupid :)
6
 
user1804599
@FredOverflow Indeed. Any sane person would use ( and ), not =. :)
 
@not-rightfold lol
 
user1804599
I need a symbol for the concatenation operator in Kreeft.
 
@not-rightfold Kreeft? Is that an abbrev.?
 
user1804599
No. It's a Dutch word. :V
 
8:46 PM
meaning?
 
@not-rightfold +
 
Xeo
@not-rightfold `cat`
 
user1804599
@Tuntuni + is for adding two numbers. :P
 
user1804599
I like .. :P
 
user1804599
@FredOverflow lobster.
 
8:50 PM
@not-rightfold It's pretty intuitive when it comes to strings IMO
 
@not-rightfold Is it exclusively lobster? I thought it could also be "crab".
 
user1804599
Or &.
 
@not-rightfold Concatenation of what?
 
user1804599
@JerryCoffin No, that’s “krab.”
 
user1804599
Kreeften and krabben are both kreeftachtigen (“lobsterlike”).
 
8:52 PM
@not-rightfold That's bitwise and :<
 
user1804599
@FredOverflow arrays, strings, bytestrings, etc.
 
@not-rightfold Okay -- if I ever get a chance, I'm going to have to demand a refund on the horoscope my girlfriend of the time got for me that gave that was my sign.
 
@not-rightfold How about ++? ;)
 
user1804599
@FredOverflow Increment by one. :P
 
@BartekBanachewicz Have you used the U2713HM?
 
user1804599
8:54 PM
I’m going with .. There will also be .~ akin to +~, *~ and friends.
 
@FredOverflow nope
 
@BartekBanachewicz Any other 27"?
 
user1804599
I’m hungry.
 
user1804599
Time for crisps.
 
8:55 PM
@not-rightfold Don't define operators at all -- just define functions with names, and let the user define operators of their choice (arbitrary name, precedence and associativity) and function with which each is associated.
 
user1804599
Sounds like a perfect recipe for undocumentable code.
 
How large is your user base?
 
user1804599
One person.
 
@not-rightfold Seemed to work pretty well in ML.
 
Xeo
Or Haskell
 
user1804599
8:58 PM
Haskell defines operators in base package. :V
 
Xeo
But you can define your own perfectly fine
 

« first day (1077 days earlier)      last day (3876 days later) »