« first day (1841 days earlier)      last day (3200 days later) » 

7:01 PM
Oh, C++ people, if I'm using calloc, do I need to free up the memory when I'm done with it?
 
@SaintWacko I only know C, but I think so.
 
@SaintWacko I don't remember for calloc, but for malloc you absolutely do.
 
From the looks of it yes.
 
Unless you like memory leaks!
 
@twobugs Apparently the difference is that calloc initialise the list to 0.
 
7:04 PM
Thanks! I'm not used to working with memory like this
 
@SaintWacko I know, it sucks.
I think most compilers will unallocate memory at the very end of the process, but I'm not 100% sure.
 
Ahahaha
input = "@0" + input + "@E";
	cout << input << '\n';
	char * contents;
	contents = (char*)calloc(sizeof(input), 1);
I couldn't figure out why the function kept saying that there was no text being sent to the api
Just realized that while I set the length of contents, I never actually put "input" in it
 
so how broken is Win10 anyway, is it "safe" to upgrade to yet?
 
Whatever happened to smart pointers?
Learning C++ through one thousand cuts, by @SaintWacko
 
smart pointers?
@badp And yeah, that sounds about right
Now I'm trying to figure out how to put input in contents
 
7:16 PM
@SaintWacko reference counted pointers to know when they can Actually be deleted or not.
 
smart pointers don't leak
 
@Rapitor Yeah they do
 
Ahh
 
well.. yeah, but not as much.
 
591
Q: What is a smart pointer and when should I use one?

Alex ReynoldsWhat is a smart pointer and when should I use one?

 
7:16 PM
If you dont clear up the references they leak just like any other pointer
 
I'm not entirely sure why you're using C++ tbqh
 
They are more to make sure that you dont delete something something Else in the code is still referencing
 
if you were using Python you'd have been done by now :P
 
@badp Uh.. I am pretty sure python is an acronym for wanting to stab your eyes out.
 
user15026
slams head against wall
 
7:17 PM
I just cant figure out the words to make it work :)
 
@James You must first learn the zen of Python to unlock its secret acronym.
 
@badp ha, Nope
Used that language for a year in a job
 
user15026
NEVER EVER EVER RESET YOUR ROUTER
 
Nevar Again!
 
p - wanting
y - to
t - stab
h - your
o - eyes
n - out
nailed it
 
7:19 PM
 
@AshleyNunn actually I have to reset the router our ISP gave us. I "bricked" it somehow while trying to set it properly to use 192.168.0.0/24 instead of 192.168.1.0/24 and now it won't respond to any request
 
@Unionhawk I am James and I approve of this message.
 
@badp Because I don't think the API works with Python
 
user15026
@badp Okay, yeah, but you know what you are doing
 
@James I've also worked professionally on Python and I have been quite happy with it, despite the codebase showed some age.
@AshleyNunn Bricking a router doesn't sound like knowing what I'm doing
also there is no reset button
 
7:20 PM
@badp I shall leave that work to you :D
 
so I have no idea how to bring it back to factory status.
 
@badp RIP
 
@James Very gladly
 
So does anyone have a preferred way to load a string into a char pointer?
 
@SaintWacko load from where?
 
7:20 PM
.c_str() is not an option?
 
Scream and ask why am I using C++?
I've not used C++ in like a year >_>
 
Co-Worker and I had a nice discussion about the language Rust recently
 
I just look at how much time poor @SaintWacko is wasting doing the most basic of shit done and cry
 
I use all 3 C's on a nearly daily basis
 
user15026
@badp Well, you know more than other people I know.
 
7:21 PM
@James What's the third C?
 
C/C++/C#
 
@James I have a string. I have a char* calloc'd to the length of the string. Now I just need to get the contents of the string into the memory of the char*
 
C, C++, C# yeas
 
pleasedonttellmeitscobolpleasedonttellmeitscobolpleasedonttellmeitscobolpleasedo‌​nttellmeitscobol
 
7:21 PM
@SaintWacko strncpy?
 
@SaintWacko memcpy
 
@badp It isn't cobol
 
@KevinvanderVelden @SaintWacko or that
 
@KevinvanderVelden .c_str() has to be a const char*, and that isn't compatible with LPSTR
 
7:23 PM
@SaintWacko strncpy(dest, string.c_str(), len) should work
 
@Unionhawk No, it's COBOL.
 
@Yuuki Nope.
That's the 4th C that shall not be named
 
It's not cobol, it's COBOL.
 
Oh, well, meh
MEH
 
Pedantry level: Bridge
 
7:25 PM
you know what I mean
 
@James That looks like it's working
 
Hmm... how do I write a Chrome extension in Python?
 
Going to add the memory freeing and thentest it
 
0
Q: Using /effect on people with a certain amount of points on a scoreboard

FireGuardianSo I am trying to make a double jump for my server and i want to give people the jump boost effect when their score on the objective "Jumping?" is 1. I tried /effect @a[score_Jumping?=1] 8 3 10 but that didn't work. Please help!

 
@Lazers2.0 oh god why did you name your objective with a question mark
oh god
 
7:28 PM
@Lazers2.0 So he's implementing double jump by tying it to a score?
 
And that won't work since you can't perform a second jump input even if you suddenly have jump boost in the air
 
@Yuuki Yeah unfortunately.. Common Object Business Oriented Language...
 
@djsmiley2k thx 9gag
 
@Yuuki You almost definitely can't
 
7:31 PM
@djsmiley2k HAHAHAHAHAHA THAT IS FUNNY HAHAHAHAHA
 
@murgatroid99 Hmm... then I need to either convert my Python code to JavaScript/jQuery or figure out how to make JavaScript/jQuery call a Python script.
 
@Yuuki What browser-based operation could you possibly be doing that's easier with Python than JS?
 
@murgatroid99 Not easier or anything, I already have it in Python.
I wrote it awhile ago while building the chatbot.
 
Okay, here's what I'm doing
 
@Yuuki Brython?
 
7:34 PM
strncpy_s(contents, sizeof(contents), input.c_str(), sizeof(input));
 
although support is limited
 
So, yay, our contractor is going to "eat" the cost of testing their program on Oracle Weblogic using a version of our choice (Read: currentVersion (which is 12.1.3))
 
It keeps saying the buffer is too small
 
0
Q: PS4 external hard drive for game updates?

JacobSo I have a PS4 with the 500 gb hard drive and all from 2014 when they were being first released, and as of late I have had to delete updates for games (NOT dlc's / add-ons ) so I could update games or download a new one because I am lacking space. I have a good 7 games that I really like to play...

 
It sounds like it's something to do with the null terminator, but I'm not sure exactly what
 
7:35 PM
@SaintWacko Strings take up n+1 bytes, where n is the length
 
I feel like sizeof(contents) may be doing something stupid but I have no clue
 
@Unionhawk this, too
 
It might be an off by one though
 
@murgatroid99 So the string is null terminated, but the char* is not
So should I have it like this instead?
strncpy_s(contents, sizeof(contents), input.c_str(), sizeof(input) - 1);
 
@SaintWacko Sorry, C mode. The char* is null-terminate. I don't know how the string is implemented
 
7:36 PM
@SaintWacko Should that second sizeof be input->size instead?
 
Oh, okay
 
Pause for a moment
What types are contents and input?
 
@Powerlord I have no idea
 
 
input is std::string, contents is a char*
 
7:37 PM
@SaintWacko Yes, and std::string has a size element on it.
 
And this is why if you have porn saved on your hard drive, you don't put it in the My Pictures folder. You utter moron.
 
@SaintWacko OK, sizeof(contents) is 8, and sizeof(input) is however big a string object is
They're not useful values
 
@Powerlord Oh, and I can access it with that ->size?
@murgatroid99 Why is it 8?
 
er... actually, it's probably .size since std::string may not be a pointer.
 
I've never fully understood -> versus .
 
7:38 PM
@SaintWacko Because that's how many bytes are in a char *
 
I'm not a C programmer by trade.
 
@SaintWacko How did you create contents?
 
@murgatroid99 So when I used calloc, it's not actually setting any size to the char*, it's just allocating memory at that location?
 
@Unionhawk -> is for pointers, . is for non-pointers.
 
char * contents;
contents = (char*)calloc(sizeof(input), 1);
 
7:39 PM
Oh God
 
I'm not sure why you'd want to calloc anyway when you can just char contents[100] to get a 100 character string.
 
@Powerlord I thought the point was that we don't know how long input can be
 
@murgatroid99 Yes
 
@SaintWacko Why aren't you just using input.c_str()?
 
@murgatroid99 Because then it has to be a const char*
And the api function doesn't accept that
 
7:41 PM
Makes me wonder what the api function does.
 
@Unionhawk syntactic sugar
 
@SaintWacko Do a const_cast
 
Do a barrel_roll
 
@Powerlord Sometimes it takes what you give it and puts something there
 
As a general rule, in C and languages close to it, when you're just consuming a string and not altering it, you want to accept a const char *
Mainly because you can pass a char * or a const char * to something that wants a const char *, but not the other way around.
 
7:43 PM
@Powerlord Oh, right, that's a good point. Maybe there's a reason it's not supposed to be const
@Powerlord I think that's different between C++ and C
 
@Powerlord That's the problem, it is being altered
@murgatroid99 What do you mean?
 
@SaintWacko OK, you are passing a string that already contains data, and it's getting modified?
 
@murgatroid99 In this case it is not getting modified
 
I don't use C a lot, but I use languages derived from Pawn, which is based on C and has some of C's... limitations.
 
But sometimes the string passed to the api does get modified
 
7:44 PM
But you just said it's being altered
 
@AshleyNunn I'm having Sushi for supper
 
@murgatroid99 In some cases it is. There's a single api function for all api calls
It's kinda weird
 
@SaintWacko And they alter the input string instead of having a separate output buffer?
 
@Yuuki I am fine with saturday not happening because I can't make it Saturday and I don't want anyone else to experience happiness.
 
...and one lib that's pretty common (it's called TF2Items) takes a char[] when it should take a const char[]
 
7:45 PM
hllapi(&HFunc, contents, &HLen, &HRc);
@murgatroid99 Right
 
@SaintWacko that doesn't mean anything
What are the types of those arguments?
 
@murgatroid99 hllapi(LPINT, LPSTR, LPINT, LPINT)
It's from IBM
 
OK, wow. Anyway, yeah, it does look like you want to use that contents buffer
 
...so, you ARE using that hllapi.
 
@murgatroid99 Yeah :) I've been through a lot of what you're going through right now already :P
@Powerlord Yep
 
7:47 PM
The one to talk to ye olde IBM Mainframes.
 
Wait, is LPSTR a char * or a char **?
 
it accepts a char *
@murgatroid99 I don't know
 
Never mind, I was just misreading the typedef
 
Oh, okay
 
7:49 PM
Sweet. MLP Season 5 is now on Netflix.
 
So it looks like the way I'm doing it now is the best way to do it?
 
@SaintWacko So, yeah, you want contents = calloc(input.size + 1, 1)
 
@JasonBerkan That reminds me, I ned to watch season 6.
Oh wait, no season 5
 
@murgatroid99 Okay
 
huh, I'm so behind.
I'm such a monster.
 
7:50 PM
Then do I need to change the strncpy_s, too?
 
@Wipqozn Season 6 won't out for a LONG time.
 
@SaintWacko And then use that value for both numbers in the strncpy_s
 
@Wipqozn I only watch it on Netflix, so I'm just as far behind as you are. Monster.
 
Heck, they're not showing the second half of season 5 until fall.
 
@JasonBerkan I didn't even realize you were an MLP fan.
 
7:51 PM
#1 Thing I Want In Fallout 4: if you have 10 in INT, random NPCs should mention that you are "wicked smaht".
 
@JasonBerkan So, you haven't seen the episode where Princess Celestia turns into DayMare Sun?
 
@Yuuki you're fired
 
@Wipqozn Not really a fan, but I had to watch it given how often it is discussed. I honestly only really like the episodes with Discord.
 
@JasonBerkan John De lancie is pretty rad
 
I find most episodes are generic kids programming. Especially the Cutie Mark Crusaders. I hate them.
 
7:53 PM
@murgatroid99 I forgot, it's making me cast it
 
@JasonBerkan Cutie Mark Crusaders are basically the worst
 
contents = (char*)calloc(input.size + 1, 1);
 
Incidentally, I may have been lying about the DayMare Sun thing.
You won't know until you finish watching them!
 
And... hmmm
It's complaining that input.size is an unsigned int, and so I can't add to it?
 
@SaintWacko Try casting the 1 to a size_t
And, you might want to just stick string.size + 1 in a size_t variable so you don't have to do that 3 times
 
7:56 PM
@Powerlord I assumed you were. Well, actually, at first I was confused about whether that was something that had happened in an episode I watched, but that my memory is going due to my old age.
 
@JasonBerkan ...you got me, DayMare Sun is fake. Nightmare Moon may make an appearance in season 5, though. Or I could be lying. Again.
 
@murgatroid99 It still doesn't like that
error C2296: '+' : illegal, left operand has type 'unsigned int (__thiscall std::basic_string<char,std::char_traits<char>,std::allocator<char>>::* )(void) throw() const'
 
@SaintWacko input.size()
And then you shouldn't need the size_t cast
 
@murgatroid99 I tried that too
Still the same error
Oh hang on
No it didn't
There we go!
 
8:01 PM
Since @GnomeSlice isn't around: Race the Sun is free today.
4
 
And now I'm back to the buffer being too small
Espression: (L"Buffer is too small" && 0)
 
@SaintWacko What's the error message?
OK, what's the context of the message?
Or, rather, what's the documentation for the API you're calling?
 
The error is on this line, I think strncpy_s(contents, size, input.c_str(), size);
The File is tcsncpy_s.inl
 
@SaintWacko Try replacing the second size with input.size()
 
@murgatroid99 still getting the debug assertion failed
 
8:08 PM
It looks like strncpy_s automatically NULL terminates, and expects the last parameter (the number of characters to copy) to be smaller than the size of the output buffer
 
Hmmm
 
@SaintWacko And size is input.size() + 1?
 
This is a wonderful reminder of why using a language with a sane String class makes programming so much more enjoyable.
 
@JasonBerkan The problem here is converting between C++ strings and C character arrays
 
hahahahaha right
 
8:09 PM
With a mutable buffer thrown in there too, just because
 
@murgatroid99 size_t size = input.size() + 1;
 
@murgatroid99 .c_str()
 
char* is like the bane of my existence.
 
@JasonBerkan is const
Can't be const
 
25 secs ago, by murgatroid99
With a mutable buffer thrown in there too, just because
 
8:09 PM
@murgatroid99 Oh right, strncpy_s is defective on windows.
 
You've reached the limits of my C and C++ knowledge.
 
Because old APIs are !!FUN!!
 
@Powerlord ha ha what
 
@murgatroid99 The standard says that strncpy_s should put in the \n and truncate by one if it has to to do so.
 
0
Q: How do I Put an External Drive into My Xbox 360 Slim?

NickHow can I put a Microsoft Xbox 360 external hard drive into my Xbox 360 slim without messing up anything else on my Xbox?

 
8:11 PM
Windows, instead, just plops all the characters in and doesn't terminate the string if the destination is smaller than the source.
 
@Powerlord The only strncpy_s documentation I could find was MSDN, and I don't see that mentioned anywhere
@Powerlord Anyway, in this case the destination is larger than the source
@SaintWacko Are you sure that the assertion failure is coming from strncpy_s?
 
Isn't the (in)correct solution to put in a cast to shut up the compiler?
 
@murgatroid99 I guess not 100%, but it comes during the first call of the Send function, and the file it says it occurs in is a cpy function
 
@murgatroid99 My bad, I was thinking snprintf.
(which is defective on Windows)
 
It occurs somewhere in here
void Send(string input)
{
	cout << "Sending: \"" << input << "\"\n";
	size_t size = input.size() + 1;
	input = "@0" + input + "@E";
	char * contents;
	contents = (char*)calloc(size, 1);
	strncpy_s(contents, size, input.c_str(), input.size());
	int HFunc = HA_SENDKEY;
	int HLen = sizeof(input);
	int HRc = 0;

	hllapi(&HFunc, contents, &HLen, &HRc);
 
8:17 PM
@SaintWacko You get the size of input, then make input bigger
 
@murgatroid99 oh god
/facepalm
 
@murgatroid99 I was just about to say that.
 
I put that in the wrong place
 
Maybe do those in the other order
 
Yep, that fixed it
Well, I feel stupid
Sorry for wasting your time
 
8:19 PM
Well, we still fixed several other issues, like the sizeof thing
 
sizeof is dumb
 
i have to hold this adapter precariously while it copies 1.5gb
 
@Unionhawk only if you use it wrong
 
if i let it move it will unmount
help me
 
@murgatroid99 This is true
 
8:20 PM
@murgatroid99 That is true
 
18 minutes left.......
:(
 
It tells you how big a type is, which is important for doing things like allocating memory to hold an item of that type
 
It's not crashing on anything now, but there are a few weird characters at the end of the char *
 
Wait, why do you have a sizeof in that code up there?
 
Yep, just fixed that
That was why there were weird characters
 
8:23 PM
holy fuck
 
When I passed the string length to the API, it was still using sizeof
 
@SaintWacko yeah
 
@badp I couldn't agree more
 
that moment when you suddenly realize one of your party in an RPG is 10 levels behind everyone else
and there is really nothing you can do about it
(except hit the level cap with everyone else)
 
@badp Neptunia?
 
8:27 PM
@twobugs yep
 
user15026
throws herself off a cliff, eats lunch
 
Noire is at 51, IF at 60
I don't even play IF
 
Is that just from uneven required exp to level, one of the cardinal RPG sins?
Because wow.
 
no. She has missed out on some required grinding
She's spent the most time being off party overall.
There's only two ways not to earn XP from battles in this game: be dead and be off-party.
You can't do anything about the latter.
 
@AshleyNunn finishes preparing trampoline at the bottom of cliff for catching jumping ladies
 
8:30 PM
also I guess hitting level 99
 
user15026
@Arperum Aww, thanks.
 
Okay, I converted all the functions in my API header based on what I've learned today
Thank you so much for all the help, @murgatroid99
 
@SaintWacko Ew.
 
user15026
I just spent an hour and half with someone who managed to reset their modem and router to factory to get them set up again.
 
@SaintWacko no problem
 
8:31 PM
The game sucks donkey balls.
 
@Frank It looked pretty bad
 
@SaintWacko It really, really is.
It does zero justice to the series.
 
@Frank It was fun to watch the speedrun, though. So glitchy
 
Was it a part of an awful games block maybe?
 
@SaintWacko It was built off of the original Unreal Tournament engine, I think.
And they turned the whole thing into a super shitty shooter.
Like...Call of Duty shooter. Only worse.
 
8:33 PM
@Frank Yep
@Unionhawk It might have been
 
I know some marathons had a "WTFJapan" block which sounds like fun times
 
0
Q: I cant buy the property in falkreath

miiraks baneim having trouble buying the land in falkreath. I've already received the letter from siddgeir but he wont show the dialog option for purchasing land...help me people, your my only hope.

 
8:55 PM
What big mouths you guys have
 
@badp What the f--k is going on with STT right now?'
 
Just got back from sleeping
 
I just went up against a team who had 2 Giant Kritzkrieg Medics and 1 Giant Rapid-Fire Demo.
 
And the chat is over 500 messages!!!!
 
Nobody on my team stayed alive for longer than 3 seconds.
 
8:56 PM
Giant medics?
 
@MadMAxJr It's a mod thing.
 
@MadMAxJr lol i love to mod stuff
 
@Yuuki Which mod would that be?
 
@MadMAxJr Have you never played TF2's Mann vs. Machine mode?
 
@MadMAxJr Stop That Tank.
 
8:58 PM
Stop that Tank is basically swiping the idea and using it in normal TF2.
 
I've played MvM, but not STT.
Sounds interesting.
 
@MadMAxJr You've probably seen giant bots in MvM before, then.
 
Right, those!
Giant scout, bane of my existence.
 

« first day (1841 days earlier)      last day (3200 days later) »