« first day (796 days earlier)      last day (4155 days later) » 

1:00 PM
btw, IIRC I saw translated character names in MS Word
 
Your font selection sucks.
 
@R.MartinhoFernandes There are text-to-speech browser plugins that you can try :)
 
In C++03, can this code fail the following assertion ?

std::string ab = "ab";

assert(&ab[0] +1 == &ab[1]);
 
I think so.
Or maybe it can only fail in C++98.
 
How can it fail?
 
1:04 PM
Damn... so I really can't rely on the fact that std::string storage is contiguous ?
 
@ereOn Absolutely you can.
 
@DeadMG: In C++03 ?
 
@StackedCrooked Hell++98 strings store the contents in reverse.
 
I have to support old compilers.
 
1:05 PM
@ereOn In practice.
 
the reason the Committee Standardized the guarantee in.. 11, I think, or 03, is because they determined there was absolutely no other possible implementation that could meet all of the other requirements but was not contiguous.
 
So while possible, its rather unrealistic that I will ever face a situation where this can cause real harm to my program ?
 
I guess I can live with that.
 
IIRC, there were never any implementations that were not contiguous.
 
1:06 PM
Thanks.
 
there's no harm in an emergency "assert"
but this is definitely something you can reasonably rely on
 
You know, sometimes I am scared by the things I come up with for Hell++.
 
I guess I could use std::vector<char> instead... but it feels wrong.
 
@ereOn Are there any compilers that do not implement it contiguously?
 
Not sure why.
 
1:07 PM
You could put the assert there as a means to enforce it as a requirement. assert(&ab[0] +1 == &ab[1] || !"No weird compilers allowed!");
 
really, you won't come to harm depending on std::string's contiguity.
 
@StackedCrooked: I'm not sure how I would have to write this assertion: the one I gave was an example, but I deal with strings of undefined lengths, and I can't reasonably test the whole memory to be contiguous.
 
I suppose you could implement a fucked up string that has SSO, and when the string is large uses SSO for the start, and the heap for the rest.
 
assert(&s[0]+(s.size()-1) == &s[s.size()-1])
 
@ereOn In that case back to my prev question: are there any implementations that don't use contiguous memory? If yes, do you need to support those?
 
1:10 PM
@StackedCrooked Are implementation that don't use contiguous memory standard compliant?
 
operator[] would do return i < sso_size? sso_buffer[i] : heap_buffer[i-sso_size];
 
@StackedCrooked: I absolutely don't know. I don't have an exhaustive list, and even if I did, I wouldn't know where to check for that.
 
@Griwes Not anymore.
 
Damned enter.
 
Isn't it implementation dependant ?
 
1:10 PM
@R.MartinhoFernandes Since data(), right?
So, problem solved!
 
If you are a bad person you could implement your own string like this: struct string : std::vector<char> { /* add std::string methods */};
 
@StackedCrooked: I believe std::vector guarantees contiguity even in C++03
 
@ereOn Yes.
 
@StackedCrooked No.
 
I guess no worries then.
 
1:14 PM
That's actually the reason of my question : is it worth going through such crazy constructs or is std::string contiguity good enough in practice.
 
it's definitely good enough in practice
 
@ereOn I think you got your answer already.
 
Absolutely.
;)
Also, since I'm on the topic : is it okay to use std::string to store "raw" bytes (I mean, not text) ?
I would say yes, since std::string doesn't really deal with text or encodings anyway.
 
@ereOn Use vector<uint8_t> for those.
 
I wonder, how does deque::push_front work?
 
1:16 PM
It always seem more correct sematically.
 
@ereOn You can, but I would prefer vector for that.
Poco libraries use std::string to store incoming socket data (IIRC).
 
@StackedCrooked It puts an element at the start of the current first array, or pops up a new one if that is full.
I prefer vector for that.
 
@ereOn No
 
Basically because of overloading.
 
@R.MartinhoFernandes So the other elements need to move one position to the right?
 
1:18 PM
Functions that take string usually assume some semantic meaning of text.
@StackedCrooked No.
 
It starts filling at the end of the first array?
 
@jalf so in theory, you could submit a request to the manager, perhaps setting the password, and you will get an email saying what machine to connect to and what username
the manager should be able to set up a user account on the machine, and get everything set up for you to log-in to
 
How often do you actually remember to #include <utility> for std::forward and std::move?
 
user142019
I always do that.
 
in stdafx.h ?
 
1:26 PM
crap on a cracker!
 
user142019
FUCK YOU SO CHAT IF I HIT ESCAPE I DON'T WANT YOU TO DELETE MY FUCKING MESSAGE YOU PIECE OF SHIT
 
the last of the people on my team who have the faintest idea how shit works are now leaving
 
Wait, that person is not you?
@Zoidberg'-- ^Z?
 
user142019
@R.MartinhoFernandes Doesn't work. :^(
 
Your browser/OS sucks.
 
1:28 PM
@R.MartinhoFernandes I remembered it yesterday for the first time.
 
user142019
I know.
 
no, I recently moved to a new team, about 2 months ago. Just as two of the experienced people left, and now the other two who know how this shit works are leaving
that just leaves a bunch of us fuck wits who wouldn't know ass from elbow about how this system works
 
user142019
@StackedCrooked Third attempt after accidentally hitting escape twice: Wat. That seems weird to me since char may be signed and may not represent an octet. I'd use std::vector<std::uint8_t> at all times for incoming and outgoing network data.
 
Weren't you planning to run away back to Great Britain?
 
@Zoidberg'-- Same here.
 
user142019
1:30 PM
I'm going to reconfigure my keyboard in Linux so ~ is next to shift rather than under escape like it always was on my machine.
 
@Zoidberg'-- char is required to be able to hold all the UTF-8 code units.
 
@R.MartinhoFernandes I was, but I did a phone interview and didn't anything since
 
How could it not hold an octet?
 
user142019
@R.MartinhoFernandes but it may be more than 8 bits.
 
1:30 PM
and the GF has made it quite clear that she doesn't want to move, unless we ahve
 
However, once if the user only interfaces with HTTP then std::string would be more convenient.
 
user142019
Networking (at least the sane protocols) are based on octets.
 
@Zoidberg'-- If it is more than 8 bits, uint8_t does not exist.
 
@Zoidberg'-- get a proper keyboard :P then you can give the ¬_¬ eyes
 
user142019
@thecoshman option+L does that on OS X.
 
1:32 PM
So, you are saying that your solution is better because neither of them works in non-existent scenarios.
 
Yup exact-width types are optional and might not exist
 
user142019
I'd rather have a compile-time error than buggy code.
 
I'd rather not care about crazy platforms.
 
@Zoidberg'-- this
 
user142019
And std::uint8_t is more representative since it actually means octet.
 
1:33 PM
@Zoidberg'-- 'option' what sort of crappy key is that, bleh
stupid time-outs
 
user142019
@R.MartinhoFernandes I want a compile-time error on those. :)
 
typedef unsigned char octet; // where is your uint8_t now
4
 
user142019
@thecoshman alt
 
@Zoidberg'-- I know, I know :P
 
user142019
You can also do static_assert(CHAR_BIT == 8, "Fuck your architecture.");, of course. :^)
 
1:34 PM
Also nobody is going to compile your code on platforms like that
 
@CatPlusPlus assumption is the mother of all fuck ups
 
Seriously.
 
user142019
BUT DCPU-16!
 
You make ton of assumptions on every step while writing anything
 
user142019
That's why all software is fucked-up!
 
Ell
1:35 PM
ahh can't marshal a List in c# :'(
 
@Zoidberg'-- You cannot run normal code on that anyway.
 
Quick do all calculations several times in different ways, your CPU might have bugs in it
 
@CatPlusPlus Then to pick the right one compare them several times in different ways.
 
you have got your logic all messed up, silly cat
 
user142019
Time to write a server in Erlang!
 
1:37 PM
you also seem to not quite get the 'turn of phrase'
 
The point is that having a compiler error on such platforms is worthless because you need to do fuckload of considerations anyway. If you are expecting compiler-aided porting, hahahahahaha how naive.
 
And compiler-aided refactoring
:v
 
It has to be carefully thought out and designed, not fed through a compiler to see what needs fixing.
 
nah, compile, see the first error, fix that, repeat
 
"I wonder where all those segfaults come from"
 
1:41 PM
@Zoidberg'-- good luck writing a hello world program without making any kind of assumptions
 
Assumption #1: your output actually goes somewhere visible.
(Under Visual Studio, assumption #1.1. that somewhere visible is visible for long enough for the output to be visible :P)
 
¬_¬ clearly that expression was lost on you furners
 
@Ell .ToArray() and marshal the array?
 
Ell
@R.MartinhoFernandes well I need to add to it, but arrays are fixed length (I think?)
 
The function you are passing to adds to it?
 
Ell
1:47 PM
yeah
 
Do you have an upper bound on that?
 
Ell
No
actually I'll just look to see if I can get one. It's the EnumWindows callback
I could just use 100 or something
it's pretty much never going to be greater than that
 
damn
it would practically be easier to write my own C++ implementation than use Clang at this rate
 
Can't you pin the list, grab a pointer, pass that, and magic the list back on the callback?
 
famous last words :)
 
1:52 PM
@DeadMG why are you using clang?
 
@DeadMG So all that waiting time was wasted? You lazy fuck.
 
lol
 
@R.MartinhoFernandes don't be so harsh, I'm surprised he's even putting in the effort to get annoyed with clang :P
 
tbh
it's all about the fact that Clang is effectively a C API when it comes to ownership
on the odd occassion they'll take an LLVM intrusive ref counted pointer, but apart from that it's a shit and a giggle as to who owns what
 
@R.MartinhoFernandes finally, something worth doing on the pi
 
1:56 PM
What? A MOTD?
 
yeah :P
 
How... interesting? Useful?
 
well, the MOTD does seem to be putting in a fair bit of nice info
lol, one of the comments asks how to tweak one of the fields, to which to OP responded 'come on, read the source'
 
hmm
seems that Clang does not correctly propagate the Preprocessor object to the Sema
 
@thecoshman I have a putty session saved for ssh rmf@calypso htop.
 
1:59 PM
and they don't even set it to NULL
worthless fuckers
 
@R.MartinhoFernandes huh?
 
To get the same info on that MOTD, I use htop.
It's realtime.
(Well, not the weather info, but seriously)
 
god damn it, every time I refresh chat, it reminds me that @R.MartinhoFernandes told me he just shut down server
 
Xeo
Because nostalgia, bitches.
 
2:05 PM
@Zoidberg'-- if you accidentally hit esc - hit ctrl+z and then ctrl+y
 
whilst I wouldn't care for the weather my self, a nice idea some one has there is using a cron job to cache it every so often
 
@thecoshman Well, Imma stick with htop.
 
user142019
@irrelephant you are my hero.
 
Ell
unsafe c# is confusing >.< I don't know whats a pointer, what's a reference
c++ is so much easier :o
 
2:07 PM
@R.MartinhoFernandes this htop?
 
I recently discovered webmin. Installing it on my (local or remote) linux machine provides me with a nice webview that allows me to do things like scheduling cron jobs.
 
14 hours ago, by R. Martinho Fernandes
It's probably easier to just write a C++/CLI wrapper.
 
Ell
@R.MartinhoFernandes Yeah I knew you would bring that up :P
 
@R.MartinhoFernandes you just fire that up every time you login?
and my god does that look sweet for 64 cores :P
 
Ell
2:10 PM
heh awesome
 
with nearly a TB of ram
beastly :P
 
Ell
@thecoshman I take it this isn't one machine?
 
@Ell no I think that is one machine, one beastly machine
¬_¬ what was that...
 
@thecoshman I have PuTTY session that runs htop instead of a shell. Whenever I want to check that I fired it up or Alt+Tab to it if already open.
 
@thecoshman It was a message for your female parent.
 
2:13 PM
@StackedCrooked oh, well, she doesn't tend to come by here often
@R.MartinhoFernandes oh right
does htop run on the pi?
 
Steam on Linux went into open beta
 
can I apt-get it?
@CatPlusPlus keep up grandpa
 
@thecoshman Probably.
I pacman'd it.
 
oh, it's found it a htop
what distro you use for your pi?
 
2:15 PM
Arch.
 
Ell
I'm looking at server boards now :D
 
Why is it that people like to argue that auto hurts readability by showing examples with terribly named functions?
 
Ell
I want to run a minecraft server farm thing
 
oooh, you want a beastly server for minecraft :P
 
@R.MartinhoFernandes Because they're stupid
 
2:16 PM
@R.MartinhoFernandes auto HELPs readability, it's a little flag saying 'look, it doesn't matter what you get from this function call, just use it'
 
Ell
@thecoshman I want to rent minecraft servers
ahh nobody steal my idea!
 
BUT STATIC TYPING MEANS SPELLING EVERY SINGLE TYPE OUT HURR
 
Ell
phew. ;)
 
user142019
@Ell Don't worry, I don't steal bad ideas.
 
@CatPlusPlus You forgot the DURR.
 
2:17 PM
@Ell That's already been done
 
Ell
@CatPlusPlus oh >.<
 
user142019
Doesn't mean you can't do it better.
 
Ell
Yeah
 
user142019
Tutorial y u indent poorly.
 
Xeo
Man, listening to old sonic theme's really invokes nostalgia. I wish I still had my Sega Mega Drive. :(
 
I'm keeping this one.
 
@TonyTheLion bleh, all in ones consoles
 
@CatPlusPlus Seriously, there was someone saying that auto hurt readability with auto ret = DoSomethingWeird(); as an example of that. "You cannot clearly see the type so you have to go check DoSomethingWeird".
Stupidity does seems like an appropriate explanation.
 
Xeo
ITT templates considered harmful because you can't see the type.
 
@R.MartinhoFernandes Uh... get a decent development environment? ^^
 
2:23 PM
@DeadMG What?
No. Rename DoSomethingWeird to something decent.
 
Ell
@R.MartinhoFernandes DoSomethingDecent?
 
Xeo
With auto, I think we should stop programming against specific types and instead code against interfaces - and I don't mean the OOP meaning.
Same as we do with templates.
Because it's just the same.
Anyways, shopping.
 
Ell
http://www.compsource.com/pn/632682L21/Hewlett_Packard_Hp_195/Xeon-Dp-HexaCore-X5675-306ghz-Fio-Processor-Upgrade-632682L21/ - $3,857.00 (Hp Xeon Dp X5675)
Seems awefully expensive :O
 
@Xeo Is exactly what I do with it.
 
@Xeo preaching to the converted I think :P
 
Ell
2:27 PM
Wouldn't automatic static duck typing make that easier?
 
4
Q: Does auto make C++ code harder to understand?

FelicsI saw a conference by Herb Sutter where he encourages every C++ programmer to use auto. I had to read C# code some time ago where var was extensively used and the code was very hard to understand - every time var was used I had to check the return type of the right side(some times more than onc...

Anyway, can we get the last close vote?
@Ell You mean templates?
 
Ell
@R.MartinhoFernandes yeah - but it was with everything automatically, but when you do void myfunc(string s) and s doesn't have the interface you want, compiler complains saying s doesn't have string-like interface, doesn't support method foo, method bar etc.
everything is a template, but uses your types as hints
I don't know, that's just my idea
 
You mean concepts?
 
Ell
yes
by default though
you don't have to explicitly write the concept though
it would automatically take the interface of the concrete type you suggest
it's sort of like concepts
 
In Hell++ that prints "I'm a moron"
 
hmm
been thinking about a #pragma clean
 
How so?
Id est, what would it do?
 
cleans the preprocessor state
(to be uncleaned when the file is exited)
 
Meh, modules.
 
2:45 PM
mh
 
What would you clean? Everything, including defines set on the command line when the compiler was invoked?
 
@jalf Unlikely. But since defines set on the command line aren't covered as Standard, then each implementation would have to choose.
 
It is also kind of dangerous what with include guards and all.
 
nah
you put the #pragma clean inside the include guard.
 
And cannot include anything else safely after that point.
 
2:47 PM
@DeadMG and then you clean the include guard you just created, and risk including your own file again
 
tis true
#pragma once would be helpful
 
About that they bitch about symlinks and hashes and shit and whatever.
I never really bought those arguments, but it seems some people think #once is hard to spec.
 
@DeadMG note very semantic
 
@jalf Nah, it gets restored at the end.
but you're right that it doesn't play well with them
 
Type inference is always good
 
2:50 PM
What?
I mean, sure, but how is that relevant?
 
something like #pragma stack_defines would make a bit more sense to me, it's clearly something to do with defines
 
That's for bit up there ^^
Shush
 
@CatPlusPlus and pie!
 
@thecoshman Probably a better name
 
@DeadMG I guess it would work if you combine it with a #pragma push and #pragma pop. So you can clear the state temporarily, and choose when to restore it to its earlier state
 
2:54 PM
Just replace the preprocessor with something better
 
although that might end up tripping you up because then you would lost any new state created between the push and pop operations
 
@jalf ah now, that's just what I said more or less :P
 
@jalf Upside, not downside.
 
@TonyTheLion Nothing to see there.
 
2:56 PM
@CatPlusPlus yeah sure, if you want the nice, easy solution...
pfff
 
Moodles
 
what kind of sissy are you?
 
@R.MartinhoFernandes how do I get it give me a link?
 
2:56 PM
@TonyTheLion No idea.
Use Coliru.
Modyuls.
 
’ello
 
LWS sucks, won't let you share code snippets
wtf
 
Ell
aghh after all this, I'm gonna have to write a cli/c++ thing >.<
 
So, what is the nasty?
 
2:58 PM
I’m trying – and failing – to think of ways to make the interface on stacked-crooked more minimal
 
@TonyTheLion What?
Nah.
Seems that markdown removes $ from URLs.
 
murkdown sacks
 

« first day (796 days earlier)      last day (4155 days later) »