« first day (1463 days earlier)      last day (3484 days later) » 

6:04 PM
I've also used their Process library.
I don't know of any other portable C++ library that provides this.
 
user1804599
I want a function that launches an editor and returns the string saved by that editor.
 
user1804599
It's pretty easy to implement.
 
One problem I had though was that on Windows it created a console window. I had to modify the source code to disable that. (That was back in 2008 though, so it's probably fixed by now.)
 
@rightføld How does it know where the string is saved?
 
Via global bool
 
user1804599
6:06 PM
@AndyProwl The function creates a temporary file, launches the editor with the path of that file as argument, waits and then reads the file and returns its contents.
 
oh, I see
 
user1804599
And deletes the temporary file through RAII.
 
@StackedCrooked +1, always a good idea
 
user1804599
Poco::TemporaryFile :D
 
yep
It's full of useful stuff.
As opposed to boost :P
Which is full of iterator categories and shit.
The code is not really modern though. Most of the code was developed in the mid 2000s.
It's kinda postmodern.
Hehe, it uses volatile int in it's Semaphore class.
However, increment and decrement is always done under mutex lock.
 
	Void();
		/// Creates the Void.
	~Void();
		/// Destroys the Void.
 
Ell
@Sofffia woah don't post that jailbait in here
(I'm kidding just fyi)
 
@Sofffia at least she's not 10
 
@Sofffia How's the experiment
 
user1804599
6:21 PM
@StackedCrooked She's at least 10.
 
@Loopunroller boooring
 
@rightføld damn you
 
In 2 days I'll be able to go back to being Jefffrey
 
@rightføld Thank you for teaching me about std::getenv
 
user1804599
:v
 
user1804599
6:23 PM
I have to handle the case where it returns nullptr, though.
 
user1804599
And default to "vi".
 
user1804599
Also, not yet sure how to handle EOF in Baka's I/O streams.
 
user1804599
Currently it just returns the begin iterator, indicating no data has been read.
 
> Modifying the string returned by getenv invokes undefined behavior.
Then why the fuck aren't you returning a const char* you fat function
 
user1804599
Backwards compatibility.
 
user1804599
6:26 PM
getenv is older than const.
 
I wish user switching was faster. Can't they use coroutines for that? :)
 
const char* is perfectly backward compatible
 
user1804599
No, it's not.
 
user1804599
char* x = getenv(…);
 
that's not const char* silly
 
user1804599
6:26 PM
(Yes, getenv is older than auto.)
 
I live in a gentenv.
 
user1804599
@StackedCrooked Jefffrey is complaining getenv returns char* instead of char const*. I gave this example because it demonstrates how changing it to return char const* breaks existing code.
 
@rightføld you are dumb if you took a char* from getenv
 
@Sofffia or you wrote your code before const existed
 
@AndyProwl burn code that you wrote before const existed
seriously
 
user1804599
6:28 PM
No, it's used in production.
 
user1804599
And rewriting it is too expensive.
 
2 mins ago, by rightføld
Backwards compatibility.
 
If you write to the char* does it set the environment variable of the host process? :)
 
i don't give a crap about code that existed before const
 
user1804599
No, it invokes UB.
 
user1804599
6:28 PM
And it probably doesn't.
 
UUBUUU
 
@Sofffia The designers of C++ do though
 
user1804599
@Sofffia And the standards committee does. You lose.
 
@LightnessRacesinOrbit <3
 
they shouldn't
 
6:29 PM
@rightføld I'm pretty sure it would be an issue if it did.
 
user1804599
@Loopunroller What? Is Trollmalak back?
 
no, he is gone
get over it
 
user1804599
Should I make null_stream seekable?
 
user1804599
I think I should; seeking would just be a no-op.
 
@rightføld A nop.
 
6:30 PM
also why the fuck do we have to keep backward compatibility between C++11 and earlier versions?
C++11 is a completely new language
if you don't want breaking changes in C++11, you simply don't compile for C++11
Also deprecating stuff in C++14 that existed before C++03, seems reasonable enough
 
user1804599
I think mutable environment variables are retarded.
 
user1804599
getenv should not exist, nor should putenv, and environment variables should be passed to main.
 
user1804599
If they are mutable then you instantly give up all thread-safety.
 
user1804599
Same with working directory.
 
we are in moment in time in which we can't afford to keep every single error, we made in language design, for 30 years
 
6:33 PM
@Sofffia Yeah, exactly. So how is a firm supposed to change to the newer, better version if their codebase would just be completely uncompilable?
 
user1804599
For Styx I thought of doing it that way, and opening files can only be done with absolute paths.
 
@Loopunroller they don't
or you change it all the way trough
 
user1804599
If you want to do it with a relative path, you first have to append it to directory which is passed to main.
 
@Sofffia Lol, so you think the majority of C++ users is hobby professionals?
 
Ell
@rightføld what is seeking?
 
6:34 PM
i don't give a crap who is the majority of C++ users tbh
 
user1804599
@Ell Change the location within the stream from which the next read will read.
 
the more you keep some stupid shit in the language, the more people will depend on that stupid shit
 
@Sofffia But the standard comitee does.
 
cut the shit immediately and don't bring shit from other eras
 
It's all bullshit, but that's the way it is.
 
Ell
6:35 PM
Meh I don't know what a stream is anymore
 
@Loopunroller yeah, I got that
 
Ell
I used to think they were source/sinks
 
@Ell An abstract, type-safe interface for a streambuffer that encapsulates a device?
 
Ell
but they are more like files
 
seriously though
how hard can it be?
 
user1804599
6:36 PM
 
just make a search in your project of all the uses of std::getenv and fix char*
if you have it in too many places then you broke DRY and then you suffer
rule 01 of software developing is to make it so software is easily modifiable
 
user1804599
No, that doesn't provide any job security.
 
if you can't change something as simple as that and break everything, then give up now
@rightføld just introduce controlled bugs then
 
user1804599
During financial crisis we should write bad code in order to create jobs.
 
6:39 PM
@rightføld except that those that introduce less bugs gets employed more
natural selection is a bitch
 
Ell
@StackedCrooked it couldn't compile hello.c for me :S
 
I could create named pipes and they worked as expected.
 
or maybe those that get stuff done fast gets employed more
i don't know anymore
 
user1804599
@StackedCrooked Fifo de clown.
 
lol :D
 
user1804599
6:40 PM
I want mkfilo.
 
mkpipo
 
user1804599
mkpijp
 
mkpedo
 
user1804599
Draai "regenpijp" om. :D
 
nee, dank u :P
 
user1804599
6:41 PM
Does mkmkpipe make mkpipe?
 
user1804599
» which mkpipe
mkpipe: aliased to mkfifo
 
mkpipo() { echo pipo; }
 
user1804599
Erlang returns {error, EISDIR} when trying to open a FIFO.
 
user1804599
Same for device files, except /dev/null which has been special-cased.
 
user1804599
It's not easy to fix since the function that opens the file also reads the file's length.
 
Ell
6:43 PM
why? :S
 
user1804599
And making it return a bogus file length n with a FIFO would just read n bytes.
 
I think I need to learn awk.
 
user1804599
AWK is a great language.
 
When I don't know how to transform something I often resort to saving it to file and using a Vim macro.
Which is uncool.
 
user1804599
 
user1804599
6:45 PM
@StackedCrooked I often use a combination of grep, AWK, sed, perl and ruby.
 
user1804599
Typically with several chained seds.
 
Ell
I'm confused. why does it need special casing?
 
user1804599
Because the person who designed that function was a moron.
 
user1804599
A function that opens a file should not return the files' size.
 
user1804599
It's a completely different thing.
 
6:47 PM
@rightføld I only know perl -pe as a replacement for sed.
 
user1804599
I don't.
 
user1804599
But Perl regex > sed regex.
 
> cmd.exe is rated NSFW in my area code
Haha. I had the same kind of humor in 2011 already
 
@rightføld perlre ⋙ any_other_re ≫ sed_re
@rightføld severed chainsaws
 
user1804599
6:51 PM
Oh I just noticed Yosemite's transparency.
 
That's a feature requested by NSA
 
user1804599
What's outside of a scrollable area appears behind the toolbar.
 
user1804599
Blurred.
 
@StackedCrooked ghettenv
 
user1804599
@sehe dat pun
 
6:52 PM
Input stream send lines containing a number and two strings. e.g "4269 foo bar". I want to divide the number by 10 and forward the line.
 
user1804599
> Happy Halloween, witches!
 
I can find a solution but it's so convoluted.
 
while read a b c; do echo $(($a/10)) "$b $c"; done
 
Read can take multiple variables..?
That's useful.
 
in fact, s/b c/b/
@StackedCrooked man bash +/IFS
 
user1804599
6:54 PM
» echo 4269 foo bar | awk '{ print $1/10, $2, $3 }'
426.9 foo bar
 
that's ^ better, since bash knows only integer arithm
 
user1804599
AWK operates on each line, so don't have to pipe all lines separately.
 
@rightføld cool
 
@rightføld those were all builtins, so there was no such thing
 
user1804599
> Input stream send[s] lines …
 
6:57 PM
Still, awk was better. It's a bit like perl but always using split
 
user1804599
And less advanced.
 
Does the awk process restart for every line or does it stay alive?
 
To me, AWK is like a shorthand for certain Perl use cases. (Sed is like that but worse)
 
user1804599
@StackedCrooked Same process.
 
@StackedCrooked There's only one, why would it restart
 
user1804599
6:59 PM
You can do BEGIN { … } and END { … } to do setup and teardown for the whole AWK process.
 
@StackedCrooked The same applied to the bash oneliner though (chat.stackoverflow.com/transcript/message/19493304#19493304)
@rightføld just like in perl
 
@rightføld lol
 
I suppose $(bla) will create a new process per line.
 
Preciously following the question you're right of course. But in the last sentence (s|)he said that it would be nice to have a simple 32 bit representation for storage and reconstruction. And I thought it might help. — Oncaphillis 5 mins ago
oh god. Yeah, let's fix a problem by building our own representation. Because, we need shady bitshifts more!
 
user1804599
» cat hello.awk
BEGIN { print "I'm an AWK program!" }
/[02468]$/ { print $0, "is even!" }
END { print "I was an AWK program!" }
» printf "11\n12\n13\n24" | awk -f hello.awk
I'm an AWK program!
12 is even!
24 is even!
I was an AWK program!
 
7:01 PM
What is /[02468]$/ ?
 
user1804599
A regular expression that matches only lines ending with even numbers.
 
Is that a D&D incantation??
:P
@rightføld Oh, I see it now.
 
user1804599
AWK program is sequence of patterns each followed by { executable code }. For each line of input the code belonging to the first matching pattern is executed.
 
Looking that regex I'd think it only matches single digits.
 
user1804599
Then I'd do /^ instead of /.
 
7:03 PM
Doesn't it require a \+ at the end.
 
user1804599
No.
 
user1804599
12 is even, even though 1 is is not in the set [02468].
 
user1804599
I want to match only the last digit.
 
Ell
what do I use for iterating over a range and I don't want to modify stuff? for(auto&& item : container)? or auto& const or what?
 
Oh, right.
@Ell You can use const auto& for that.
 
user1804599
7:05 PM
@Ell auto const&
 
or auto const& if you want
 
user1804599
Just assume immutability and use container.foreach(…)!
 
user1804599
I could write Hexapoda in AWK, though it would be pretty awkward.
 
@Ell But if you don't want to change it then you should make the object const.
 
Ell
inside the vector you mean?
 
user1804599
7:07 PM
Though I can certainly use AWK for reporting features of Hexapoda.
 
@Ell Or use const vector<T>&
 
Ell
yah
 
@rightføld lol
1e0 is not an even number.
but yeah, it ends with an even number
 
user1804599
Assume the input contains only lines with single numbers.
 
@Sofffia someone has been paying attention in class yesterday :)
 
7:17 PM
half-of-2 also not an even number
 
Ell
guys, please tell me std::make_unique got into c++14?
clang is complaining for some reason
 
are you using -std=c++14 and -stdlib=libc++ ?
 
Ell
I'm using the former but not the latter
I'll try with gcc
 
unique_ptr is a library feature
 
Ell
oh yeah of course
 
7:19 PM
but what is typeid?
 
Ell
an operator
Oh lol. I'm such a noob I just realised what I did
 
hello operator
I mean, the strange thing about typeid is that it's language feature that returns a library object.
 
Ell
yeah I find that strange about c++
those things which are magic libraries
 
user1804599
This is also nice: Perl regex grep
 
user1804599
perl -ne 'print if /^issue: \d+$/' .hexapoda/issues/*
 
7:29 PM
I wonder if you could to template instantiation at runtime by generating the template code, compiling it with an embedded compiler, and then load that as a shared library or something.
 
Ell
@StackedCrooked surely you'd have to ship the programmes source as well though right?
 
user1804599
@StackedCrooked You can.
 
@Ell Probably a header at least. Which can be embedded a string.
But all it needs is the signature info I'd think.
 
user1804599
No.
 
user1804599
It also needs the templates' definitions.
 
7:32 PM
Hm, right.
 
Dicsourse that?
 
user1804599
Discord was trolling.
 
@StackedCrooked Modules on steroids!
 
@sehe not sure if pun or typo
 
@StackedCrooked half-of-2 is not a number either
 
ah i see
 
@sehe Just thinking.. isn't that basically a jit?
 
@StackedCrooked Sorta kinda
 
Ell
@StackedCrooked why don't you give this a go?
 
hahaha
 
7:34 PM
@Ell Ok, give me 30 min.
 
Ell
it'd be interesting :P
 
Some people don't waste time fighting windmills
 
user1804599
Karate match http://twitter.com/UnexpectedGifs/status/522827151607738368/photo/1
 
bwahaha xD
 
Ell
@Borgleader he's telling dad jokes already
 
7:43 PM
It's the correct answer IYAM
 
Brutal (there is a punch line btw)
 
The punchline is "ARARARARRARARARARGHJGARARARARARARARARAAAAAAH!!!"
 
user1804599
Is India a nice place to live?
 
8:05 PM
Only one way to find out
 
user1804599
Hmm.
 
@milleniumbug this guy...
 
Oh, he revenge-downvoted my answer.
What a child.
 
user1804599
8:15 PM
@FredOverflow I always like the hallucinating green plus signs.
 
user1804599
I think they do that to make people dizzy so they buy medicine.
 
Ell
hallucinating? :P
 
user1804599
 
user1804599
This shit.
 
user1804599
Saw them a lot in Spain.
 
8:16 PM
> This answer was just a mess. I should not have written it. This is a filler. Prowl (10k+)
@rightføld Also in Belgium
 
user1804599
They're probably illegal in the Netherlands.
 
@Benjamin Lindley It means only that the library has a bug and nothing more. — Vlad from Moscow 39 secs ago
almost fell from a chair
 
Ell
Yeah they're on every pharmacy in spain
it's a pain that doesn't stay on the plane
 
Lol, The Vladerator is back.
 
user1804599
If I moved to India I'd be a millionaire.
 
user1804599
8:21 PM
I'd have pretty much almost exactly 1000000 rupees.
 
So you had a machine with 1mb of RAM. And half of it was free!
 
You have more rep than ny first box had RAM.
 
That's an interesting comparison
 
@VladfromMoscow can you please desist from posting this kind of misinformation. People might believe it. C++ has a bad rep as it is. No need to steer people into carnage. — sehe 10 secs ago
 
8:25 PM
1
Q: Where to go from here

SilvanusI have a basic understanding of C++ (and cicual basic, but I dont like it). I know the syntax, classes inheritance, pointers,m stuff like that. I can answer most basic exercises I come across and make simple programs like imperial/metric conversions and things like that. Best program I wrote (and...

lol cicual basic
 
user1804599
Oh wait, I'd have one and a half million rupees.
 
Wonder what he looks like during a code review
 
@JohanLarsson He's unemployed. Go figure
 
user1804599
@JohanLarsson lol
 
Was that supposed to be 'visual.'?
 
user1804599
8:27 PM
@JohanLarsson who?
 
@rightføld the faint guy, I'm thinking maybe he does the AAARGH -> faint if he spots something ugly
 
user1804599
:D
 
I need to disambiguate Nm torque & Nm Energy somehow
 
user1804599
Yahtzee Ploes Ploes
 
user1804599
Yahtzee is fun.
 
Ell
8:30 PM
@JohanLarsson in code?
 
user1804599
@JohanLarsson No, you don't.
 
@JohanLarsson Oh I assumed you talked about Vlad
 
user1804599
I want to see Vlad and Tomalak in a single code review.
4
 
@rightføld I think I do, they are not the same
@Ell yep
has Vlad ever chatted here?
 
Ell
You could tag values with a quantity
 
user1804599
8:32 PM
No. :'(
 
Evening inferiors and Robot
 
user1804599
I approve of porque only.
 
user1804599
I give my pig a bird.
 
Moving tomorrow: Oh the huge manatees
But holy shit: The fat Internet pipes
 
8:35 PM
@JohanLarsson relevant: boost.org/doc/libs/1_56_0/doc/html/boost_units/… (but perhaps that's what you got it from)
> Because Boost.Units includes plane and solid angle units in the SI system, torque and energy are, in fact, distinguishable (see torque). In addition, energy is a true scalar quantity, while torque, despite having the same units as energy if plane angle is not included, is in fact a pseudovector. Thus, a value type representing pseudovectors and encapsulating their algebra could also be implemented.
 
I have not looked at any code, actually turned out okish
 
user1804599
wat do
 
All my life packed into a tiny car
 
@rightføld the units lib
 
user1804599
@Puppy I want mana and I want tees.
 
8:38 PM
@sehe nice docs, thank for the link
 
You want to tee on a golf course or something?
 
user1804599
 
user1804599
OP is once again a massive faggot.
 
Bah cant flag on mobile
 
user1804599
I want to fix a Bohr bug.
 
8:41 PM
What, the reproducing conditions are boring?
 
@sehe actually my code generator pointed me to the problem.
 
:)
 
it is wpf so you can't play with it
 
user1804599
Can you teach me how to be a good programmer?
 
user1804599
ok i open tumblr y is there anal prolapse on my screen
 
8:50 PM
What even is anal prolapse
 
user1804599
Used unqualified, the term rectal prolapse often is used synonymously with complete rectal prolapse (external rectal prolapse), where the rectal walls have prolapsed to a degree where they protrude out the anus and are visible outside the body. However, most researchers agree that there are 3 to 5 different types of rectal prolapse, depending on if the prolapsed section is visible externally, and if the full or only partial thickness of the rectal wall is involved. Rectal prolapse may occur without any symptoms, but depending upon the nature of the prolapse there may be mucous discharge (mucus...
 
Ell
when your inner butte becomes an outer butte
 
im sure you can find that out on your own, or ask @Rapptz
 
Also, you owned yourself when you opened tumblers
 
user1804599
Tumblr is a great porn site.
 
8:51 PM
lol wtf did I just walk into?
 
@rightføld the slow process where eventually the entire body is turned inside out
 
user1804599
But apparently things go wrong once you start following people who reblog anal prolapses.
 
As long as its anal prolapse porn huh
 
user1804599
@StackedCrooked topologically impossible.
 
topologically your mom is fat
 
8:52 PM
@rightføld I can, bit it would mean clearing your brain and resetting it to zero.
 
That would be trivial then
 
user1804599
I'm Zoidberg, not Bender.
 
user1804599
I cannot do that.
 
@rightføld Just don't be a bad programmer.
 
user1804599
8:53 PM
I'm pro-grammar.
 
Ell
someone clear my mind please
 
In other words don't be yourself
 
user1804599
I AM MYSELF
 
user1804599
If I were anyone else I'd suck.
 
Sure, ell, just take a moment to think of how great your life would be if you were me
 
8:54 PM
@Puppy How is your new place?
 
Fine really but I don't properly move in until tomorrow
 
Tag search doesn't seem very reliable in SE meta.stackexchange.com/q/242284/159703
@Ell reset();
 
My machine I packed so mobile interface it is
 
@JohanLarsson how can a Units library "be" WPF?
 
user1804599
I feel feminine.
 
8:57 PM
It is not, the code for the generator is though. I use T4 that reads from a settings file to output the unit types in the real project.
 
@Mysticial hi
 
Wrote an editor for the xml file in wpf
 
@Puppy Yeah. Mobile much suckage. I'm at the club beer festival so android:(
 
Personally I don't feel particularly of either gender
 
@sehe hi
 
Ell
@StackedCrooked haha this should work
 
@rightføld there's no guarantee that the current configuration chosen by fate yields any different outcome, though
 
Ell
@StackedCrooked hmm. the third girl
 
@sehe pic probably explains it better.
 
Ell
reminds me of pon pon pon
I might just be being racist though
 

« first day (1463 days earlier)      last day (3484 days later) »