« first day (665 days earlier)      last day (4299 days later) » 

6:00 PM
yeah.. who the fuck cares if an addon is non-free?
 
Debian motto: let's draw up guidelines making our job impossible, our project generally unforkable (due to branding issues) and serve no other functional purpose whatsoever.
And have I brought up glibc maintainer friendliness today?
ugh. I should restrict myself to the fun part of the Internet.
Is there a BSD/Linux (as opposed to GNU/Linux)?
 
Hey guys I need to ask something
 
@rubenvb That wouldn't make sense. Just install BSD then.
 
Do functions like strcpy and strcat work with pointer strings?
Anyone??
 
if pointer strings == cstrings(that is, char*), then yes
if pointer strings == std::string*, then no
 
6:10 PM
@kbok sure it would make sense. Linux Kernel (+drivers!!), BSD libc, BSD coreutils? and all the rest the same.
 
@mfontanini I made this and it didnt work: char* p = " hello"; strcpy(p,"bye");
If anyone can help then pleas do :(
 
first of all, you shouldn't assign a string literal to a char*, it should be a const char*
 
you should read about pointers and dynamic allocation
 
im a beginner
 
6:13 PM
oh, and
Jul 28 at 13:09, by Cat Plus Plus
If you are new here, read the code of conduct now. Thank you.
 
but can you tell me why this isnt working
 
@bamboon my screen.
@MohamedAhmedNabil use std::string. All problems solved.
 
but i want to intentionally use strcpy
 
@MohamedAhmedNabil You have UB. You cannot modify a string literal. Try char p[] = " hello";.
 
@RadekSlupik funnybot
 
6:17 PM
@bamboon okay, my IDE. I was feeling evil.
 
@MohamedAhmedNabil Then I give you neither sympathy nor my assistance.
 
@RadekSlupik I know that and I have been using char arrays for a while and they have been working perfectly but why not pointer chars?
 
lol @"pointer chars"
 
@DeadMG XD :D ok
 
@MohamedAhmedNabil You can do it with char pointers, but not when they are initialized with a string literal.
 
6:18 PM
@rubenvb what every they are called :D
 
Xeo
@MohamedAhmedNabil Get a book
 
Modifying a string literal is UB.
 
@Xeo im using one now
 
Xeo
assigning it to char* is UB
 
Also use std::string. Or [Char], even better.
 
6:19 PM
@RadekSlupik Why not and when can i?
 
@RadekSlupik is that obj-c?
 
Xeo
@MohamedAhmedNabil If you didn't learn that using char* for string literals is bad/illegal, burn it
 
@MohamedAhmedNabil Because the standard says so and when they are not initialized with a string literal.
@rubenvb Haskell.
 
@Xeo clearly he's writing C, where string literals are decay to char*
 
Objective-C has NSString, but the class can be changed with a compiler setting if you want to use another class for strings.
 
6:20 PM
@RadekSlupik what can they be intiallized with besides string literal
 
@RadekSlupik oh, the braces confused me.
 
@MohamedAhmedNabil other char pointers.
char *p;
char *q = p;
 
@RadekSlupik now i can use strcpy witth q?
 
@MohamedAhmedNabil no.
It has an undefined value because p is not initialized.
You can do something like this:
char *p = malloc(strlen(" hello") + 1);
if (p == NULL) exit(-1); // or whatever error handling you want
strcpy(p, "bye");
// use p
free(p);
(Assuming C. In C++, use std::string.)
 
someone move that to the bin XD
 
6:23 PM
@RadekSlupik that seems alot better than all theese headaches
 
eww
 
Since when does the server side need the explicit agreement of the user for storing cookies on the client end :o ?
 
@MohamedAhmedNabil with std::string it would be this:
 
Im using a book called C++ without fear second edition . Any thoughts on it?
 
6:23 PM
in europe
 
std::string p(" hello");
p = "bye";
 
@RadekSlupik Thank you
 
@MohamedAhmedNabil If it teaches strcpy (or, at least, before std::string), burn it and kill the writer.
 
@RadekSlupik Im halfway through it :(
 
1427
Q: The Definitive C++ Book Guide and List

grepsedawkThis question attempts to collect the few pearls among the dozens of bad C++ books that are released every year. Unlike many other programming languages, which are often picked up on the go from tutorials found on the Internet, few are able to quickly pick up C++ without studying a good C++ book...

Pick one of those. :)
 
6:25 PM
@RadekSlupik after studying so much from this one. Do you think I will go through it fast?
 
I don’t know the book you are reading.
If it only teaches C with Classes, it won’t really help. You are basically learning C.
 
@RadekSlupik There is an entire chapter for stl
 
Read it before continuing on the pointer and strcpy crap.
 
@RadekSlupik maybe it just wants to make a good foundation for the language
 
How was the book called?
 
6:27 PM
@RadekSlupik In case i ever wanted to program OS
@RadekSlupik C++ without fear
 
@MohamedAhmedNabil lol @one chapter for STL. The standard library is more than half of what C++ is.
 
@rubenvb it is used throught the book
@rubenvb but more concentrated in one chapter
 
@MohamedAhmedNabil That book is horrible.
 
@RadekSlupik Why?
 
Because it is not listed on The Definitive C++ Book Guide and List.
 
6:28 PM
C++ without fear: "Have no fear, we'll just be reiterating everything C"
 
@RadekSlupik ok got ya
Nature calls
XD
 
Knowing how to shuffle pointers into crappy libc functions has no relation to OS development.
 
Here is also a slide show made by @KonradRudolph you should go through before continuing with C++, since your brain is now filthed by that book: tinyurl.com/fuck-pointers.
 
guy!
 
6:32 PM
stop the hate!
 
no
 
your mean :(
 
I am mean, read my bio.
My bio really attracts employers on Stack Overflow Careers. xD
@R.MartinhoFernandes you use Jekyll, right? Does it allow for different layouts per page?
 
@RadekSlupik his SO name has a dot after the R.
 
6:36 PM
@rubenvb Oh yeah, right. That is important these days. :<
 
@RadekSlupik Yes.
Well, if you mean what I think you mean.
 
@CatPlusPlus Different style sheets per page, preferably.
 
@JohannesSchaub-litb I have my own cookies.
 
mine are nicer!
 
6:37 PM
How would you know?
 
@JohannesSchaub-litb I dislike cookies.
 
@rubenvb theyre always nicer!
 
@JohannesSchaub-litb If your grammar/spelling is an indication of how you're overestimating the deliciousness of your cookies....
 
what is it with these programming language names, like cat++ and rubenvb?
 
6:40 PM
my cookies are herb and bjarny
 
I'm officially lost.
 
I'm really bad at this tank game.
 
little brainfuck <- codenamed LITB, my next language
 
IM BINAR vector<ints>; <- explicit instantiation syntax xD
 
6:45 PM
greetings
 
will be a mix with lolcode syntax and c++ semantics
 
I think someone just broke @litb.
 
woohoo i can finally comment everywhere :@
 
Only litb can break litb
 
6:47 PM
@CatPlusPlus confirmed. Very nice this is.
 
0
Q: why compilers dont support c++11 thread_local storage?

NoSenseEtAlAFAIK both g++ and cl both support compiler specific TL storage... so Im wondering is C++11 TLS different from what they support now? Thread Local Storage (TLS) is the method by which each thread in a given multithreaded process can allocate locations in which to store thread-specific da...

^ I am guessing that most folks here will agree with the closing of that question (which is purely about facts). Assuming I'm right about that, doesn't this mean that SO is now restricted to purely RTFM questions, or retarded person's questions?
@Papergay yay!
 
7:05 PM
xD
 
user457812
I'm not actually sure why that question would've been closed O_o
 
user457812
It's not exactly subjective, though it is broad to say 'compilers' instead of, say, 'G++' or 'Clang' specifically, but still.
 
I came to SO because i thought it was not a RTFM board
They should rather close threads where the only problem is the OP's syntax
 
user457812
Or a segfault.
 
user457812
Especially if it's because you tried to dereference NULL or something.
 
7:14 PM
Well there can be segfaults that are hard to locate
 
user457812
It would have to be limited to stupid segfaults.
 
im fighting with a random segfault currently xD
 
there's this thing, I don't know if you've heard of it, it's called a debugger.
 
user457812
Pfft those just add bugs
 
lol @KeithLayne
 
7:20 PM
Does anyone here use Codeblocks?
 
as you can see, that so called debugger doesnt help
 
Did you try turning it off and back on again?
 
I do use it!
 
Or you could kick it until it works. Doesn't often work, but when it does it's legendary.
 
@KeithLayne what do you mean? all i can do is run the debugger and at best with arguments xD
what do you mean? my program runs 95% of the time
only 5% it crashes
 
7:22 PM
 
user457812
I use a text editor because pfft, IDEs.
 
i use an IDE because of the highlighting xDD and auto-alignment
 
user457812
I get that in a text editor. Your IDE has no legs to stand on, sir.
 
:o
 
user457812
Insert Monty Python Black Knight joke here.
 
7:24 PM
no IDE that I've used that claims support for c++11 does anything but screw up formatting and fill my screen with red squiggles.
I guess there's VS, I don't use it often, but there's no point in using that.
@Papergay Is your program multithreaded?
 
it is
 
well then, that's probably it :)
 
hmm?
simply the fact that i create threads?
 
no, that if a multithreaded program crashes nondeterministically, it's a good place to start looking.
 
the point is, my program crashes at a point where it actually should not even work
 
7:27 PM
sounds like it's working as expected then. :P
 
lol
okay, i will give you that one xD
 
maybe you have a race condition and are unexpectedly dereferencing something that you shouldn't....
 
How can one develop plugins for an IDE like codeblocks
 
very carefully
 
7:30 PM
im not sure, im calling pthread_cond_wait with parameters that are already initialized but not used
 
There are some very small features that I want it to have? For instance, I want to give codeblocks a stdin input as a copyable text. Currently I use freopen in my scripts for that
 
or maybe in the background, a thread crashes 5% and then causes my pthread_cond_wait to fail
 
how do i use pointers with cin.getline() ?
 
i really dont know -_- i will have to rewrite the whole multithreading related code
 
7:31 PM
anyone?
 
Jul 28 at 13:09, by Cat Plus Plus
If you are new here, read the code of conduct now. Thank you.
 
@MohamedAhmedNabil did you read this? en.cppreference.com/w/cpp/io/basic_istream/getline
 
@rubenvb Thank you. I will keep it my mind.
 
@MohamedAhmedNabil you really should study more on pointers
 
hello everyone :)
 
7:42 PM
Aloha
 
how goes everything today? :)
 
You know, google "rundll32", check the DOCUMENTATION (i.e., RTFM), and just do it. OK, I will do just that and present result as an "answer". But really, finding out such things is very much part of what programming is about, it is a fundamental skill, which you should train! — Cheers and hth. - Alf 37 mins ago
Mystery: I got in better mood just by doing that (both the comment and actually doing the OP's work)
 
alright, lets see if this runs fingers crossed
woot, all the get methods work, now to test posts.....
 
user457812
I generally don't ask questions because most of what I'd ask about is something I can work out by reading documentation (or it's already on SO). The other things I'm doing are too subjective, so they're probably programmers.se- or gamedev.se-fodder. Always kind of disappoints me that I don't write questions on SO.
 
most of my rep is earned from me asking questions haha
but i dont really see that as a bad thing. since ive joined SO ive learned sooooo much
 
user457812
7:50 PM
All of my rep is from editing and answering questions. I have written zero questions so far.
 
you get rep for editing questions/answers?
 
user457812
Yes, to a point, anyway.
 
hey everyone
can anyone tell me how this works
`char* p = "Hello";
cout<<p[3]<<endl;`
 
user457812
It'd be easier if I could just edit questions without waiting for someone to approve the edits, but that's how it goes when your reputation is as low as mine (in other words, under 2k).
 
@MohamedAhmedNabil this outputs the 4th character
 
7:53 PM
@Papergay but p isnt an array
 
@MohamedAhmedNabil p is a pointer to an array of chars.
 
user457812
Well, p is a pointer to an.. damn it.
 
p[x] is equal to *(p + x).
 
user457812
Wouldn't it be more accurate to say p[x] is equivalent to *(p + x)?
 
@RadekSlupik you again:D Thanks
 
7:54 PM
@MohamedAhmedNabil this pointer/array C business is confusing. If possible, use std::string and standard library containers.
 
@nil Slowpoke, again.
:p
 
user457812
One day..
 
@nil isnt that a string literal not an array of chars
 
@nil …I will be still be faster than you.
 
user457812
@MohamedAhmedNabil It's an array of chars.
 
7:55 PM
@MohamedAhmedNabil String literals are char arrays. "Hello" is of type char const[6].
 
@RadekSlupik You win again :D
 
lol
 
Just like Strings are Char lists in Haskell.
 
poor nil
anyway, good night guys
 
*nil — UB in Objective-C.
 
user457812
7:56 PM
Why would you ever do that? O_o
 
user457812
I just look at *nil and my brain kind of rejects it as something that should not exist.
 
You never need to dereference an Objective-C object, but well, you can.
If you really want.
 
user457812
If you're a horrible person.
 
Maybe if you want to access public member variables, but that is usually done through properties.
But then you would use ->.
-> is not nil-safe. Properties are.
 
Is haskell worth learning?
 
8:00 PM
Yes.
 
user457812
Anything is worth learning unless it's Perl.
 
It will give you a different perspective on programming.
 
how diffrent?
 
I am now blogging about I/O in Haskell.
@MohamedAhmedNabil It’s a functional language, most languages are imperative.
 
user457812
Imagine if I took your brain and threw it in a meat grinder and fed it to you. That's your brain on Haskell.
 
8:01 PM
@nil hmmm not sure if that is good or bad. hmmmm
 
// map in JavaScript
function map(f, arr) {
    var ret = [];
    for (var i in arr) { ret.push(f(arr[i])); }
    return ret;
}
-- map in Haskell
map :: (a -> b) -> [a] -> [b]
map _ []     = []
map f (x:xs) = f x : map f xs
 
user457812
Far as I'm concerned, it's a good thing.
 
@nil its just being without a brain for a while is what im afraid of
 
user457812
Brains are overrated.
 
user457812
You need to learn to think with your big toe.
 
8:04 PM
oooooooooooooooooo
nah thats not gonna work
 
user457812
Your big toe has seen more than you'll ever see. Just look at the callouses you have on your feet. Imagine the horrors they've seen.
 
Probably none. Since they don't have eyes.
 
user457812
Oh, but where they've been, they don't need eyes to see.
 
@RadekSlupik Needs more yield ;)
 
8:21 PM
@NikiC JavaScript has yield? That’s rather awesome.
 
@RadekSlupik I know that Firefox has it, if you specify that you're writing JS 1.7 ;)
Never cared enough to check whether V8 supports it ^^
 
user457812
Because every browser does something different and weird.
 
I’d use yield if Chrome and Safari support it. They are the only browsers I care about.
Woohoo my new site is up.
 
@RadekSlupik Just checked, looks like they don't support it
Firefox generally has a lot of very cool JS extensions
Which are now slowly coming in with Harmony
 
8:26 PM
Oh it is a language extension?
 
E.g. Harmony will also have generators
 
Oh no it’s new in new in JavaScript 1.7.
Cool, also array comprehensions.
 
yeah, but JavaScript isn't standard ;)
 
JavaScript is standard.
 
Not that kind of JavaScript ;)
 
8:27 PM
JavaScript is a dialect.
 
The Harmony proposal is here btw: wiki.ecmascript.org/doku.php?id=harmony:generators
 
> JavaScript was formalized in the ECMAScript language standard.
So it is standard.
 
@RadekSlupik What I mean is that "JavaScript 1.x" is not standard ;)
 
Whatever.
Python and Haskell are better anyway.
 
That's also why you explicitly have to provide the JS version when using those features ;)
 
8:29 PM
They have logos.
 
@RadekSlupik Yeah. Main thing JS is good at over the other two is performance ;)
I still find it incredible just how freakin fast JS is (for a very dynamic scripting language)
 
Ehm.
Depends on the implementation.
 
radek sup man
 
I am not sure if V8 is faster than code generated by GHC, for equivalent code.
 
@RadekSlupik Sure. It's just that all JS implementations right now are really fast ;)
 
8:31 PM
1) Stop winking.
2) Code generated by PyPy and GHC is also really fast.
 
If i increment in the while loop condition will the increment happen before the while loop gets excuted
while(*p++){
 
@RadekSlupik Sure, they are quite fast. But they don't have the competition benefit as much as JS has
 
the incremnt here happens before the commands under while?
 
@MohamedAhmedNabil That’s the same as while (*p) { ++p;
 
i know but here the incremnt here happens before the commands under while?
 
8:33 PM
You probably want while(*++p) {
@MohamedAhmedNabil Yes.
Also try it out. You have a compiler and a text editor.
 
i was just making sure
 
If you want to be sure, read the standard.
 
what does *++p do?
 
Increment p, then dereference it.
Also.
Jul 26 at 21:11, by jalf
If you want reliable, high quality answers quickly, use SO. If you want to gamble and maybe get a useful answer, maybe get a good answer, and maybe waste your time, feel free to ask questions here :)
I.e. I am not sure what I am saying—I rarely use pointers, but when I do I don’t do pointer arithmetic.
Except in C, but C is a piece of shit.
 
so it is still the same
 
8:35 PM
It is not the same.
 
@MohamedAhmedNabil Read up on what pre- and post-increment are
 
*p++ increments then derefrences
 
*p++ first dereferences p, then increments it. *++p first increments p, then dereferences it.
 
@MohamedAhmedNabil with *p++ you have to know the operator precedence rules. With *++p is is clear what happens first. But you should be aware of post and pre increment
 
8:37 PM
I was testing it in a while loop so i couldnt see the diffrence
 
Hey Haskellers, a nice exercise for you: go step-by-step through the boobs operator and explain what it does by looking at the end result.
 
To iterate a C-string, you probably want *p++.
@CatPlusPlus Give an example with an end-result.
 
@CatPlusPlus That's a really evil operator. It's rather mindfucky
 
user457812
@MohamedAhmedNabil You really ought to be learning this stuff from a book/the standard.
 
@RadekSlupik ((.).(.)) abs (-)
But that's not really important.
Go from definition of (.) and see where you end up.
 
user457812
8:39 PM
Ah, the cat is a goon as well.
 
((.).(.)) takes f and g
makes (f . g)
which is f $ g
so ((.).(.)) abs (-) is abs (-)
Probably wrong. :P
 
No, it's not identity operation. :P
 
Aaargh.
 
What you wrote is actually a type error.
Hint: substitute one argument at the time.
 
Prelude> :t ((.).(.)) abs (-)
((.).(.)) abs (-) :: Num c => c -> c -> c
 
8:42 PM
It's equivalent to \x y -> abs (x - y).
@FredOverflow You might be interested, too. Fun little exercise.
 
I don’t understand why abs . (-) $ 4 5 doesn’t work.
Oh wait.
4 is not a function.
 
Because (.) :: (b -> c) -> (a -> b) -> a -> c.
Both arguments must take one argument.
(-) takes two.
 
Boobs are always messing with your mind ;)
 
It is the same as ((abs .) . (-)).
 
8:52 PM
Yeah, that's after some rewriting. But it's easier to just go from simple compose f g x = f (g x) and rewrite by substituting compose as f and then as g.
Welp, and I did this and I'm out of fun things to do. Let's be bad at tanks some more.
 
((.).(.))
= ((abs .) . (-))
= abs $ (-)
Is that correct?
They do yield the same result when applied. :P
 
Nope. It'd be the same as abs (-) and abs doesn't take function as an argument.
 
((.).(.)) abs (-) 4 6
= ((abs .) . (-)) 4 6
= abs $ (-) 4 6
 
(abs $ (-)) 4 6
 
@RadekSlupik That's because (-) 4 6 is evald first
 
8:57 PM
Point-free notation isn't just removing variables.
 

« first day (665 days earlier)      last day (4299 days later) »