« first day (2086 days earlier)      last day (2855 days later) » 
00:00 - 13:0013:00 - 00:00

12:00 AM
@Borgleader alas! It was not to be. They were out.
 
NUUUUUUUUUUUUUUUUUUUUUUUUUUU
 
and you know what?
It wasn't just an ice cream sandwich.
 
rip more
 
It was an ice cream sandwich where the ice cream was between two chocolate chip cookies
 
Look at this fun question :P
-2
Q: Need help encoding C++ strings by increasing ASCII value

Spencer StephensI've looked around everywhere for a C++ code that takes a message from the user, and encodes it by increasing the ASCII value of each character (obviously not very secure, but simple enough). I've managed to put together a program that returns a character of a few values higher, but can not figur...

 
12:04 AM
std::transform(str.begin(), str.end(), str.begin(), [n](char c){return char + n;});
amusing
 
> Although it is usually unnecessary, It won't yield incorrect results. I don't think I deserve the downvote :(
> In Visual Studios, you can force all strings to be wide. In which case, input.size() won't return the length of char.
 
Hey guys, I have a couple of approaches to the escape character thing: 1. Use a static regex function to just brute force change all escape chars into \escape_char. 2. Create a wrapper for std::string which overloads << and streams in escape_char bytes when detecting a delimiter. 3. Make a static function that loops through string and construct new string to pass as return. 4. Go home and make myself a sandwich and call it a day
Which one do you think is most efficient?
 
~~purrformance~~
 
@jaggedSpire omg that sounds so good
 
12:19 AM
should I answer the low-hanging fruit y/n?
 
You should get an 8ball for that @jaggedSpire
 
no Lounge is plenty good
 
lol
 
I'd never replace Lounge <3
 
nah
well, yeah if you don't mind
otherwise let him go to Stack Overflow
 
12:22 AM
?
 
why would you have a camera
whyyyyyyyyyyyyyyyyyyy
 
otherwise the world cannot see you on the john
 
Should probably have renamed 8ball to ball really, but meh
 
baller
 
no u
 
12:27 AM
do I include the decoder too
 
> Why are you wasting your time reading this?
Decoder for what?
 
the low-hanging-fruit
 
wut
 
@Darkrifts Ew, why aren't you using a case?
 
Lounge's silence on the matter means do what I please
 
12:28 AM
It means gimme a basic design for another fractal
 
@jaggedSpire I mean if you want, but it's literally doing the same thing with a negative sign
 
no I'm pretty sure it means hit a newbie with template logic
@Aaron3468 it was a nice half-second of copy-pasting
but it looks like the poor unfortunate soul doesn't quite realize it
and is planning to do it later
 
@Aaron3468 Im not using a case because cases are for things that take more than 10 sec to make
 
so really the question is do I crush his hopes now or later
 
tbh, I want to see a bit of an easier tool for long case statements, but I can't imagine what it would look like aside from either being a break-free case, or a dictionary
 
12:30 AM
Function Name	Number of Calls	Elapsed Inclusive Time %	Elapsed Exclusive Time %	Avg Elapsed Inclusive Time	Avg Elapsed Exclusive Time	Module Name
?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEBD_J@Z	32	77.67	77.67	983.61	983.61	MSVCP140.dll
Well ... i know what to optimize for now /cc @Mysticial :P
 
lol
 
@Aaron3468 I don't use switch statements
 
Got a new fractal seed made
 
Mainly because it's too often the case that I need to refactor it into a chain of if/else ladders later anyway.
 
12:34 AM
Yeah, I write a lot of if-else ladders in my code; I do interpretters quite often lately
 
using strings now? refactor. want to break out of the loop inside switch? no, you can't.
 
Who cares about switches :P
 
also having fallthrough by default is a ridiculous feature from the perspective of a language user.
 
I'd love them if they were a bit more expressive/better implemented, but alas...
 
Had another good fractal seed idea
Gonna be like an hour to get it posted though lol
 
12:49 AM
@Borgleader replaced the std::cout <<, with printf and i went from 35s to 2s.
 
iostreams are just so lovely aren't they
 
In a lot of languages, iostreams are costly abstractions
 
yeah i just saw that question
 
If you need to do a lot of output, maybe use a buffer object to store it temporarily, then spit it out a few nanoseconds later all at once. Stringstream comes to mind as one implementation
 
@Aaron3468 I'm outputting 27 big ass strings.
The resulting text file is 1390KB
 
12:57 AM
lolrip
Why such a big string?
 
I'm parsing the game files for an old game i wanna see whats in it
this just in: games use a lot of assets
 
lol
Any simple designs I can base a fractal off of?
 
#define RGBIO(FUNC, R, G, B) FUNC(RPIN, R); FUNC(GPIN, G); FUNC(BPIN, B);
^ugly preprocessor abuse
 
How would abusing the preprocessor be useful like that though?
 
You can say RGBIO(pinMode, 1, 1, 1), where void pinMode(bool pinOn); //set pin to input or output
And then later, to write an RGB value to a set of pins, you can apply the analogWrite(pin, value) function to all three: RGBIO(analogWrite, 196, 255, 0) //outputs yellow to an RGB light
 
1:09 AM
Debug build > 8mins, Release build: < 3secs
just wat
 
VS pls
 
highfive, that's awesome!
 
Just don't get an error like "no" from using "->"
 
heh
once I was using their priority queue for some stuff and it turned out it had O(n^2) performance for my use case in debug
which...er...*well*
I wound up just using a sorted vector
so I didn't have to deal with multiple minute long processing times in debug
 
Lets profile the debug build and see whats taking so long. Maybe its something i can fix.
like avoiding using operator[] for asserts and such.
 
1:14 AM
Strange how GCC generates entry 7 and 8 of the jump table before the rest.. Maybe it is trying keep the bottom part of the code hot in cache?
 
lol the profile ran out of buffers or something
gg
 
the vs profiler?
 
yes
 
that happened to me once when I was spawning lots of threads
and then I stopped being a noob and used std::async instead
because I could
 
did you ignore its return value?
 
1:17 AM
@jaggedSpire I'm using boost::async, because std::async has a bug in it (doesnt handle non-default constructible types)
also my pc hiccups everytime i launch it xD
 
@Borgleader huh
 
yeah the VS implementation has a bug
 
@StackedCrooked don't recall. I hope not.
 
my return type is non-default constructible and it tries to do so and it doesnt compile. boost::future doesnt have that problem
 
combine a thread with an io_service (asio) and you have an executor
POWER x100
And you can basic task based programming.
 
1:19 AM
Should make a ton of threads and not close them :D
 
yes
 
perhaps
 
Ask again later
Just now referenced the library I'm making with the primary project using it
 
can't close a thread
 
1:26 AM
One of my monitors is dying. The top emits a buzzing noise and overheats. Time to start shopping for a new one
 
before you start the thread you fork your process. you can then get rid of the thread by killing your process and resuming from the forked one.
 
Function Name	Inclusive Samples	Exclusive Samples	Inclusive Samples %	Exclusive Samples %
std::addressof<char>	90,133	51,108	37.38	21.19
std::allocator_traits<std::allocator<char> >::destroy<char>	90,891	49,657	37.69	20.59
std::_Wrap_alloc<std::allocator<char> >::destroy<char>	135,006	46,216	55.98	19.16
std::allocator<char>::destroy<char>	42,219	42,219	17.51	17.51
std::_Addressof<char>	40,120	40,120	16.64	16.64
 
Probably just going to get one second-hand
 
i have no clue how im gonna optimize that =/
 
> std::allocator
 
1:27 AM
Maybe if i create less temporary shit... my to_string code is really dumb right now
 
One of the first bottlenecks is always memory allocation.
 
@StackedCrooked Did I mention the code runs in < 3 secs in release -.-;
 
Dunno if that's supposed to be fast or slow :)
What does it do?
 
19 mins ago, by Borgleader
Debug build > 8mins, Release build: < 3secs
 
It's quick for parsing large files
 
1:28 AM
Oh.
 
Thats the profile data for the debug build. I would like to get it down to hopefully sub 1 min, because 8 is just ridiculous
 
How would a curry a lambda for a function like void X(int, int)
 
I can spend money on a fancy soil moisture sensor ($10-20), or I can hack together my own (<$1) for my project, but I can't find good documentation on converting measured values into anything more absolute than more-less moist. As far as I see, the ones in that price range aren't much better...
 
so why not calibrate it
 
Yeah, I can calibrate it to normal soil. Then throw on a knob or two to fine tune the calibration to other soils
T.T I'll need a lot of interrupt routines for this project. It'll sleep for ~30 min, then wake up to measure battery voltage and soil resistance. Then after it sets led values, it'll go back to sleep. Ideally, it'll go months or years without needing a new battery
 
1:49 AM
Finally getting somewhere.
But the dots aren't showing up for certain results.
 
Can't be good, when parts of it vanish
 
Looking good so far, but you'll want some sol dots to show up. If you can, maybe tilt the text at an angle to fit
 
Yeah.
 
@Borgleader You can simply copy this into your main.cpp and rebuild the code. It implements memory allocation using the fastest possible way. It will also crash after you reach 1GB. But it's useful to see if the performance is much better than otherwise.
 
Much better
We only skip the plots that don't have values
I might need to put some indicator that it doesn't support said feature
like an x mark or something
 
2:00 AM
The 4th one from the left is clipping a little offscreen
 
How is oolua faster than C?
 
@StackedCrooked Had to compile as x64 because i was gtting bad_alloc around 2GB
 
Could be a variety of reasons.
 
@Borgleader Ah. Still on 32-bit?
 
I'm honestly not going to analyze every single codebase for all 9 categories across all 12 frameworks.
 
2:02 AM
Btw, you can reduce the storage size if you want :P
 
@StackedCrooked Well not anymore. But you said it would crash at 1GB, I'm above that so I cant really use it.
 
Well, then increase it?
 
I could try. But first I'm going to avoid temporaries in my string building code.
 
Btw, the buffer rotates. So it will start reusing the early allocations. It will totally corrupt your program, but it might keep running for a while.
 
> It will totally corrupt your program
Sounds like fun
 
user5058091
2:06 AM
Hello
 
Lot's of small allocations and deallocations in a short period of time aren often less slow than expected. I suppose it helps that malloc's internal data structures remain hot in cache.
 
How could I potentially turn a lambda like (a, b) => {} to a => b => {} ?
 
Outsource the code.
 
meh
 
2:58 AM
I managed to get it down by 1 min... (not to 1min, by 1 min)
 
3:13 AM
Why string_view vs const std::string&?
 
Why why string_view vs const std::string&?
 
Every day I wake up and ask this question, and so far haven't gotten an answer
 
user406009
3:26 AM
@Mikhail Passing in char* or char[] or slices of a string.
 
I cant find the talk but its more generic also. I think it was eric niebler who was saying like you can make conversions to string_view from all string types (homebrew, const char*, std::string, etc) and your function will work for all of those.
 
user406009
@Borgleader IIRC, the main requirement is continuous memory.
 
user406009
Which forbids all the "cool" string types.
 
So then it's just an easier interface for const std::string&?
 
user406009
Like cord or rope or whatever.
 
user406009
3:29 AM
@Aaron3468 It allows you to avoid memory allocation in a lot of places because you can use char* constants or slices of other strings.
 
@Lalaland Right, but even if you get rid of the "cool" string types, you still have a more generic interface.
 
user406009
I just can't wait for the copy elision improvements.
 
user406009
I mean, the compiler knows that a copy is never going to occur there, so why would I possibly have to write a copy constructor?
 
3:57 AM
Well you need the length so raw, const char* is probably out of the picture (idk, use sizeof?), so that leaves std::string&
 
user406009
@Mikhail strlen(). And you can get the length from char[].
 
Yeah buts thats O(N), and assumes its correctly terminated, etc
 
user406009
Yeah, but pretty much anything on a c string is O(N).
 
Wait... no. If you have a char array, you can just use the size of the array directly. How is that O(N)?
 
user406009
@HWalters Yeah, that's what I said. If you have a char[], you can get the size at compile time.
 
4:05 AM
@Lalaland Exactly... I was addressing the counter to what you said
 
^ Hell no. Asking marketing for approvement for fixing a bug.
 
but why wouldn't you want incremental improvements to a code base to drown in a mire of red tape and assorted bureaucrats?
 
Hm, you're making me rethink my position. Maybe I should be more open to the idea.
 
4:31 AM
Anyone has some experience with C?
And can help me?
 
5:14 AM
say something
 
5:49 AM
> Static allocation? Its often the case that programs are initilized on core 0, and then moved to core 20 (where core 20 is on a different cpu socket). This makes any level 3 miss a reach into a different NUMA node, with all the pain that involves.
Hm, I never considered that.
 
6:00 AM
Isn't that beautiful
typedef union Word{
	/*Binary structure: 15 bits basic cell*/
	struct{
		unsigned int cell:15;
	}word;

	/*Binary structure: |DUMY|GRP|OPCODE|SRCAR|DESTAR|ERA|*/
	struct{
		unsigned int ERA:2;
		unsigned int destar:2;
		unsigned int srcar:2;
		unsigned int opcode:4;
		unsigned int grp:2;
		unsigned int dumy:3;
	}command;
	/*Binary structure: |DUMY|PARAM2|PARAM1|ERA|*/
	struct paddress{
		unsigned int ERA:2;
		unsigned int src:6;
		unsigned int dest:6;
		unsigned int dumy:1;
 
Ven
6:56 AM
@sehe please
 
std::alcoholic
:p
 
#floof
 
8:02 AM
 
Ven
8:26 AM
> I don't understand the advantage of if constexpre over plain if. Shouldn't the optimiser strip out unused code during compilation?
 
heh, just uninformed
 
> Men are used to rejection generally in life
 
Ven
who writes stuff like that
 
Hm, 50% off Manning ebooks today... so tempted to buy a shitload of ebooks I'll probably never read :)
 
Ven
8:31 AM
how can you be so retarded as to write stuff like that
does he also browse /r/theredpill ?
 
How do you know Brru is a man? ;)
 
Ven
8:46 AM
because it's obvious
 
user1804599
Diversity-above-all masturbation is literally AIDS
 
Literally?
 
@JohanLarsson it's true to a point. Just like girls are encouraged to be all emotional and thin and shit, boys are encouraged to be tough and not let adversity affect them. "Man up".
 
user1804599
@fredoverflow Hitlerally
 
@R.MartinhoFernandes Yep, it is like that for most species. Females can choose, males have to fight etc.
Somewhat interesting perspective.
Also sjw does not hold for pedantry in general.
 
8:54 AM
But rational animals have a choice of how to groom their offspring.
 
Have you met a picky bull moose?
 
user1804599
Rational animals are super rare
 
Cubing today.
 
user1804599
I want an office full of Tesla coils and Faraday cage cubicles.
 
I'm stuck today, spilled over from yesterday
 
user1804599
8:58 AM
To keep the flies out whilst the door is open.
 
6 messages moved to bin
@Bassie Why did he multiply with 22?
 
user1804599
To make the joke or accidentally
 
He must have gotten confused with prefix vs. postifx notation.
 
user1804599
It was hilarious nonetheless
 
His reaction seemed like genuine surprise.
 
ASR
9:04 AM
Not like that
 
morning
> Women might just suck at job interviews, according to a new report by an interview matchmaking service.
totally not biased outcome
 
user1804599
My neck hurts
 
9:23 AM
> sqrt(17) is actually 4.123105626 not 4.121105626 but that's just a display error.
> The right numbers are there, waiting for the user to discover them. The missing parts of the digits are the first breadcrumbs on the trail of the user's journey into the world of true calculation.
rofl
 
user1804599
@fredoverflow you should try Wolfram Language
 
user1804599
It doesn't approximate, so Sin[Pi] == 0.
 
user1804599
And Sqrt[2] doesn't reduce at all, it stays Sqrt[2].
 
I have thought about making an unboxing video... about java.lang.Integer ;)
13
 
user1804599
Awesome!
 
user1804599
9:34 AM
@fredoverflow I like C#, where unboxing is just a downcast
 
C# doesn't have a distinction between int and Integer, right? Just int and Object?
 
Boxing and unboxing is transparent there
 
What exactly do you mean by "transparent"?
 
value types are boxed into the same type, the generics box them
List<int> involves boxed instances, but you can otherwise declare int as local variable and it's unboxed
 
@JohanLarsson I don't think List<int> does any boxing, does it?
 
9:47 AM
MSDN has a list of cases where the values are boxed, but AFAIU you don't need to worry about it unless you have mutable structs
 
@fredoverflow nope
 
@sehe I like his trip reports. They are easy to read and there are lots of descriptions of the things he saw, ate, etc... that have nothing to do with the actual committee work :)
 
Maybe Java 10 will finally catch up with C#'s generics concerning primitive types :)
 
If you do List<IComparable> and store ints in it it will box
 
And the boxed type is...?
 
Ven
9:48 AM
@fredoverflow thank god it doesn't :D
 
ok, but are larger structs boxed?
 
Ven
no
 
@fredoverflow dunno, ask rightfold, he has the language spec tattooed on his back :)
 
IIRC C# has bastard generics that are sometimes like C++ templates and sometimes like Java generics, right?
 
Yes. Homogeneous translation for reference types, heterogeneous translation for value types.
 
9:50 AM
Ok.
 
ok I was wrong
 
now you have to finish the line of business app kata
 
Ven
@milleniumbug it's not about mutable or not
 
No need to be so harsh on yourself. Let's just say you have an agile approach to understanding C# generics.
 
Ven
the rule is simple: "cast to an interface, get boxing"
 
9:52 AM
@milleniumbug don't think so
But there is some rule about not making structs big, don't remember the rule of thumb limit in size
perf suffers from copying or something that you metal guys know about
 
I wouldn't worry about copying 16 or 32 bytes or something...
 
Could be fun to benchmark for different sizes
 
My rule of thumb wrt types in C# is "When in doubt, make it a class"
 
but another day, stuck today
^ is pretty nice
@milleniumbug yeah, structs are maybe 5%
and most c# devs don't even know they exist
 
Most C# devs seem to think that structs "go on the stack" :)
 
Ell
9:57 AM
I thought that structs went on the stack too :P
 
Eric Lippert had a great blog series about structs IIRC.
 
Eh~, too many things to eat in my coffee.
 
I have no idea when they go on the stack and when they don't
 
Local variables that aren't captured by lambdas go on the stack, but that's an implementation detail.
 
Ell
Is it an implementation detail?
 
10:03 AM
Eric's point is that "X goes on the stack, Y goes on the heap" is not a useful distinction for C# programmers.
 
Ell
Isn't one of the reasons for putting things in structs to increase performance?
 
struct members of a class most certainly don't go on the stack.
Unless escape analysis kicks in.
But does that change the semantics? No!
From a semantic point of view, "stack" and "heap" are completely useless distinctions.
 
Ell
@fredoverflow right
I mean non members I guess
 
@Ven sorry i had /just/ gone to bed
 
Ven
@sehe my timings are always bad
@sehe i'm surprised you sleep so little, btw
 
10:19 AM
That's indeed pretty strange for a polar bear.
 
10:35 AM
maybe a bipolar bear?
 
Ell
haha
 
If anyone's interested.
Got four new personal bests already :)
 
Ell
404 :(
 
Ell
yep :)
man that is crazy fast
well done :3
 
Got an accident on the first 2x2 attempt, so I had to start over :(
And the last Pyraminx attempt was a fuckin' easy scramble.
Not gonna complain
 
Ell
I can't understand how a pyraminx even moves when I look at it at first :P
 
Pyramix sounds like a character from Asterix and Obelix
 
11:05 AM
Got my 2x2 average down 3 seconds and the best down 4s
Woot
 
@R.MartinhoFernandes nice
@Ven me too :)
 
11:20 AM
@StackedCrooked It is both funny and stupid at the same time.
 
@StackedCrooked kabaneri strated great and ended shit, lol
 
yeah
what a stupid ending
so forced
 
11:36 AM
also wtf was wrong with the main bad guy
so first he wanted to take revenge on his father
than on pretty much everyone in the world
then he wanted to kill Ikona
then save him with white blood
but then he wanted to kill him one last time
and also, they explained nothing about the virus (which I have high hopes that SnK will, eventually)
 
@ScarletAmaranth That's racist :o
 
@Morwenn what race has white blood?
 
Channichthyidae.
A fish with no hemoglobin.
 
I would need to be the said fish to be racist towards other species then
and while I may resemble the specie intellectually, physically I do not
 
Nah, you can use the transitive racism road.
 
11:40 AM
You don't have to be the race you promote to be racist.
 
interesting
 
That's essentially an ad hominem argument.
 
is hostility against my own race racist?
 
Yes.
"Blacks are dumb" is racist regardless of the speaker.
 
blacks on IPS and TN panels are indeed dumb
I'd rather have a PVA then
 
nwp
11:50 AM
would this count as racist?
 
@R.MartinhoFernandes Half of the US would disagree with you about that, I think.
Not specifically "Blacks are dumb", but moreso that hostility against one's own race is exactly racism.
See: "Nigger v. Nigga" argument that makes me laugh my ass off.
 
That's different.
It's semantics.
 
12:14 PM
Oh, well okay then.
Python is making me a bit upset.
Why does it keep iterating in some random order?
It's not even a goddamn dictionary where that behavior can't be explained
It's a fucking list
and I'm calling enumerate() on it.
 
12:34 PM
Wooooo, I passed to the Skewb final.
 
Skewb?
 
Ooh.
Skew-cube.
That looks dangerously hard.
 
@nwp Without watching it, these days for sure.
@nwp lol, that's hilarious. :D
 
nwp
12:50 PM
it's not as old as it looks
 
But yeah, that would start riots these days. :)
 
yum yum
 
@Telkitty Is that your cooking?
 
I wish ...
 
@fredoverflow This is awesome.
 
00:00 - 13:0013:00 - 00:00

« first day (2086 days earlier)      last day (2855 days later) »