« first day (318 days earlier)      last day (4625 days later) » 

12:00 PM
but in many cases, you actually do not need that ram at all
 
It doesn't make sense theoretically. But in practice some applications require a swap file. So it my have practical sense.
 
@StackedCrooked It wouldn't work, swap file is supposed to be a file written to disk to write out pages in RAM that haven't been used and there needs some space be created
 
What applications?
 
@TonyTheTiger it would work.
 
If application requires a swap file, then it probably overallocates large amounts of memory, which will likely result in OOM condition if you try to put swap inside RAM, or disable it altogether.
 
12:01 PM
@RMartinhoFernandes I don't know. But I read somewhere that disabling swap files can cause some programs to not work anymore.
 
@StackedCrooked but it serves no purpose, as then you're using your RAM for swap file
 
See e.g. Varnish cache.
 
@TonyTheTiger Performance is the purpose.
 
It practically relies on swapping.
 
@StackedCrooked: what if you want to swap the pages where your swap ramdrive is mapped on?
 
12:02 PM
You won't gain performance by putting swap inside the RAM.
 
@StackedCrooked sorry but sounds silly
 
You will likely lose more than by disabling swap.
 
> @DeadMG are we supposed to be clear in designing our memory leaks? :D Also, it is simple... new int returns a pointer which can be evaluated to a boolean... – Luchian Grigore 10 mins ago
 
@TonyTheTiger speed improvement is nice, even if it is achieved by silly means.
 
@StackedCrooked meh, but putting the swap file in RAM defeats the purpose of the swap file imho
 
12:04 PM
@TonyTheTiger having plenty of RAM also defeats the purpose of swap files.
 
can you actually use a ramdrive as a swap partition? I don't think it's even possible
 
Good lord. Swap is not an extension of RAM.
 
@KillianDS It probably won't work on Windows.
Perhaps I should give it a try.
 
@CatPlusPlus: no, but enugh RAM will probably defeat the benefits of a swap file (however, we can't be sure who of us is right before some actual measuring is done).
 
The benefit is clear — you free RAM by keeping unused pages out of it.
 
12:06 PM
@StackedCrooked: I think we have swap disabled on our headless VM's (linux) for that reason, but not sure
 
It doesn't depend on how much RAM there is.
 
Guys! Facts please.
 
yes catplusplus, it is clear
but what if you do not need that ram
then you freed it, good for you :)
 
You don't lose anything either way.
 
yes
enabling a swap is a possible vulnerability :p
and it wears your HDD or SDD
 
12:09 PM
@KillianDS it might be possible to hack a specific OS into doing that, but it makes no sense. The swap file is a backing store for RAM. So you're basically saying that when your data overflows RAM, put the rest of it in RAM
modulo all the complex algorithms to make this fast and efficient
 
"Operating systems such as Windows XP, Windows 2000, Windows Server 2003, Vista and Windows Server 2008 rarely crash" - LIES
 
at least they don't put ME in that list
 
@jalf It's actually very simple to do that with linux.
 
@kbok yeah, probably. I'd imagine it's doable on Windows too. But it's still a conceptually nonsensical operation
 
@TonyTheTiger Well, they do rarely crash. Number #1 cause of bugchecks are faulty third party drivers. Number #2 is faulty hardware.
 
12:11 PM
@jalf Sure.
 
@CatPlusPlus lol, IMHO, a BSOD IS a crash!
 
@TonyTheTiger right
 
what the cause is, is irrelevant, the system is no longer running at that point
and I know that's mostly caused by faulty drivers
 
@TonyTheTiger BSOD is called a bug-check, and it's a condition under OS cannot continue to run.
 
@CatPlusPlus I do know that
so it's a crash, so the user has to restart the system
 
12:13 PM
Drivers run in ring 0, so if they e.g. overwrote some critical memory, it's best to just halt rather than risking corrupting user data.
 
in windows you have so-called mini drivers. as i recall they don't run in ring 0
 
@CatPlusPlus yes I agree, but we're talking about the frequency about that occuring here, not why it occurs
@AlfPSteinbach you have drivers that run in User mode these days, the WDK supports that
 
@TonyTheTiger yeah, but it's the driver crashing, not the OS
also, do you often get BSOD's?
I got one last time I tried to install Chrome. And some years ago, because of a defective sound card
 
@jalf true, but the OS bug checks on the faulty driver, causing the system to be unusable until rebooted
 
honestly can't remember the last time I experienced an OS crash
 
12:16 PM
nowadays, I don't see many bug checks anymore, however back in the XP days, and even Vista, it was not uncommon
 
Even on XP, I really didn't see them a lot
 
I've had some on my Win7 machine, caused by my graphics card driver
 
btw, any news regarding your interviews yet?
 
@jalf well, the one yesterday, they said I could start immediatly if I wanted, they gave me some time to make up my mind
and the one on thursday, I'm still waiting on feedback
cause if that were positive, I would want that job :)
 
Heh, Windows has an API function which returns an unsigned int as a bitmask representing which drives are available. First bit is set if a:\ exists, second bit if b:\ exists and so on.
That's an... interesting way to do it
 
12:19 PM
hmm
 
@TonyTheTiger Which is a good thing.
 
well, I guess as long as all the drives can only have one-letter names
 
It's not the OS fault.
 
which is no longer true, I believe
 
at least it avoids the whole "passing strings across API boundaries" fiasco in C code
 
12:20 PM
@jalf The even more interesting thing is that both commands to list the drives are complicated long-winded ones, and the fsutil one requires administrator rights
 
@CatPlusPlus yes, I never said that was a bad thing, but a normal user doesn't understand that and gets frustrated, that's my point
 
Well, who cares about normal users. :P
 
yeah, those scum!
 
:P I do when I have to solve their issues for them
which I get asked on a regular basis :(
 
@AlfPSteinbach which commands?
command line ones? Or API stuff?
 
12:21 PM
fsutil (with proper arguments) and wmic (with proper arguments), command line commands
 
@DeadMG DOS devices are limited to one letter AFAIK. Everything else lives in the object namespace and can be named however they want.
 
ah
 
sbi
@AlfPSteinbach See here. I haven't looked at the promo video (I'm too lazy to search for my headphones and I'm at work), but the books were pretty good.
 
however, in windows xp wmic may refuse to run if the process has reduced rights (e.g. started with runas)
@sbi ah politics! :-)
 
sbi
@AlfPSteinbach ??
 
12:23 PM
those books, about intergalactic politics
fun :-)
 
sbi
@AlfPSteinbach Ah, is it in the video? I see what you mean. Yes, it's part of it. But the books are actually quite personal, looking very closely at the humans involved.
@AlfPSteinbach Now you made me search for my headphones...
 
@TonyTheTiger: is it your first job?
 
@KillianDS no
 
sbi
@TonyTheTiger You do have a job?
 
no
I have an offer though, but waiting on feedback from another interview first
 
sbi
12:25 PM
@TonyTheTiger Oh, I thought... Well, you had an interview yesterday, right?
@TonyTheTiger I see.
 
@sbi yep, and they said I could start there, if I wanted
 
sbi
@TonyTheTiger What a job would that be?
 
@sbi writing software that controls these devices.
industrial stuff, basically
 
and the other one? (that was the one with the tricky interview question, right?)
 
@KillianDS yes
that was more game dev and motion controlled hardware
which I personally find more interesting :)
but I think my chances of being accepted there are lower
 
sbi
12:30 PM
@TonyTheTiger What programming language?
 
@sbi C and their own language they created on top of that, but they are looking at moving towards C++
 
why owuld anyone create their own language on top of C?
that's been kind of done to death
 
Maybe they like macros.
 
possibly
 
sbi
@DeadMG Because other languages to base it on didn't seem to be the right choice to them? At least that's what Stroustrup lists as his motivation.
 
12:34 PM
considering that C spawned a massive family of languages, you would think that an existing language or subset of would be just fine
 
@DeadMG aren't you basing yours on C++?
 
sbi
@DeadMG Would you want to program autonomously driving robots in Java?
 
@sbi I hope not
 
@jalf Yeah- i.e., not re-treading C -> C++ route
@sbi C++ is based on C as well, y'know
 
sbi
@Tony Do you have any idea how old that language is they created? This knowledge might considerably shorten this discussion.
 
12:36 PM
@sbi no idea
 
Yeah, I was just thinking, this sounds potentially scary
 
@jalf in what way?
 
1: C instead of C++
 
sbi
@jalf If you have a clean parser, generating C might be easier than generating C++.
 
2: home-made languages
not necessarily a bad thing, but it's something I'd be wary of, and at least try to snoop out a bit more information
 
sbi
12:37 PM
@jalf In a sense, Spirit also is a "home-made" language. So?
 
^ We are the ROBOTS.
 
@sbi Too often, proprietary "custom" languages are buggy, badly-designed abominations with no tool support, no documentation, written by someone who has no clue how to write a basic parser
 
anyways, see what happens, kinda anxious to hear back from the other shop
 
but like I said, it might be fine. It's just something I'd try to get a bit more information about. It could be something that makes PHP look good by comparison
 
12:40 PM
that was an interesting interview, with lots of tech questions, which was a good test for me :)
 
could always give them a call and hear what's up
 
sbi
@jalf Yes, indeed. But usually they have a very limited purpose, which they often meet nevertheless, despite their shortcomings.
 
makes you look interested, which is good. Reminds them who you are, which is also good
 
sbi
It seems RSA employs a bunch of idiots. (Getting infected through a fake recruiter email? How stupid is that for "the premier provider of security, risk, and compliance solutions for business acceleration"?)
 
and of course, being able to say "I've got another offer, but I'd rather work for you, so if you could hurry things up a bit I'd be much obliged" might not be a bad move either
 
12:43 PM
@jalf ohh, I'm very tempted :)
 
sbi
@jalf Once you go that route, you might just as well announce that you got two other offers. :) Sounds even better.
 
@sbi heheh :)
 
@sbi except that if he sticks with "one", it has the added bonus of being true ;)
 
I'm learning the ways of the job hunt here :)
 
sbi
@jalf And what's that good for? It's not like he's cheating his grandmother when doing so. :)
 
12:45 PM
@sbi it sounds less like an exaggeration :)
 
lol, not sure you'd want to bring my grandmother to this discussion :P
 
(She didn't get the job.)
 
she's also not a programmer
 
sbi
@TonyTheTiger Just as someone you might have a problem to cheat. That company wouldn't mind not telling you yet as long as another candidate they'd prefer hasn't replied. So why would you do it differently?
 
@sbi not sure I can parse that
 
sbi
12:49 PM
@TonyTheTiger They wouldn't be honest to you if it was in their interest. ("We have three other candidates here willing to take the job, who would all take less money. We'd rather have you, but you're to expensive. What do you think?") So why should you?
 
@sbi yea sure
 
sbi
You should have scruples cheating your grandmother, though.
 
I don't think I'd be very expensive to them though
@sbi depends which side of my family, lol
 
sbi
@TonyTheTiger That was just an example!
 
"I can live on tea and instant noodle soups!"
 
12:50 PM
@sbi lol
 
hmm, supposing you've got a buffer of null-terminated strings (I guess that'd make them null-separated, really), is there some super simple trick to split them into something sensible like a vector<string>?
 
@CatPlusPlus what's that got to do with anything?
 
sbi
Mhmm. Why is "Android is the best." flagged as offensive? Was it posted in the iPhone room?
 
flag wars again?
 
sbi
@TonyTheTiger Not here, though.
 
12:52 PM
people being anal, but if it's not in this room, it kinda surprises me
 
sbi
@jalf That's a good question. I'd upvote it.
@TonyTheTiger Ha, it's indeed in the iPhone room!
I decided for "not valid", of course. :D
 
/me checks out the iphone room
 
I almost always pick "not sure"
unless it's something obvious like "FUCK YOU NIGGA"
 
@jalf I'd be curious about that too
 
Iphone seems full of trolls
 
sbi
12:54 PM
9
A: More information is needed in chat Flagged Posts

sbiThe room a message appears in is urgently needed. Java bashing would be offensive in the Java room, but might be fine in the C# room, so when I see a message bashing Java, knowing the room is absolutely necessary to know whether this message is offensive. However, as Anna pointed out, the room ...

 
"@dark I am still spicy cuz I am around so many Indians ;p"
wtf???
 
sbi
@kbok Yeah, make it a question on SO, @jalf!
 
I'll prepare my answer.
 
sbi
@kbok You have an answer?
 
I sense repwhores
 
12:56 PM
@TonyTheTiger Is an iPhone full of trolls?
 
phones4trolls
 
@StackedCrooked oh damn, I meant Iphone ROOM
lulz
 
iPhones are tightly packed with trolls. If you open one they all pop out.
 
damn, I sneezed so hard yesterday, I hurt my back :(
 
@sbi I'll have one soon :)
 
sbi
12:58 PM
The only thing I could think of was creating an iterator. Not really satisfying.
 
@jalf Boost.Tokenizer with custom tokenizer function?
 
vector.push_back(std::string(p));
p += std::strlen(p);
It's not pretty, but I can't think of something simpler.
 
p += vector.back().size();
 
Yes, that's better. Also, +1 ?
p += vector.back().size() + 1;
 
if (!vector.back().empty()) p = &vector.back()[vector.back().size() - 1];
A little overblown.
 
1:05 PM
That's not simple at all.
 
I don't even know what the original question was.
 
That's not even correct.
15 mins ago, by jalf
hmm, supposing you've got a buffer of null-terminated strings (I guess that'd make them null-separated, really), is there some super simple trick to split them into something sensible like a vector<string>?
 
I'm not paying damages.
 
sbi
@kbok Well, yeah, of course, that works, but I assumed that @jalf was looking for something to replace this mess.
 
I don't know of a super-simple trick. You'll need to do a little coding.
Or you could write a function that does what you want. Calling that function is a super simple trick :)
 
1:08 PM
@sbi I don't think a simple two-liner shall be called a "mess", but yes, i see what you mean. I'm curious about a simple trick too.
 
yeah, ended up writing a 10-line loop to do it
 
sbi
@jalf Please ask the question on SO. I want to see if someone comes up with something clever!
 
I use the Poco::StringTokenizer sometimes. But that would a really heavy dependency foro something as trivial as this.
 
> questino
> foro
Are you Spanish ? :)
 
sbi
@kbok You asking whom?
 
1:11 PM
@StackedCrooked.
 
@kbok I find your message significantly enlightening.
 
I'm just bad at typing.
 
oh, ignore me, never mind
 
Keep your enlightenment to yourself next time!
 
aye m'lord
 
1:13 PM
Good.
 
@DeadMG Thank you.
 
0
Q: Simple way to split a sequence of null-separated strings in C++

jalfI have a series of strings stored in a single array, separated by nulls (for example ['f', 'o', 'o', '\0', 'b', 'a', 'r', '\0'...]), and I need to split this into a std::vector<std::string> or similar. I could just write a 10-line loop to do this using std::find or strlen (in fact I just d...

 
sbi
@jalf You're a star!
 
@sbi amazing that people bother. They've mutilated explorer so badly already, how could a ribbon make it worse?
 
1:15 PM
They'll (MS) probably do it anyway, and they'll (screaming people) forget about it in few weeks after release.
@jalf Have an up⛵.
 
In this regard MS listens to the users more than Apple does. Apple just shoves new features down the users' throat (hard).
 
sbi
@jalf The ribbon is a new "quality", though. Until now, you can always find everything in the menu, which you can reach using the keyboard. With ribbons, you definitely need the mouse, and it's always like "what I'm looking for ought to be in that ribbon, unless, of course, it's deemed important, in which case it's buried on the first one." That's about the stupiest idea of UI design I ever saw.
@CatPlusPlus I was first!
 
Ribbon is directed at people who have no idea how to use computers.
Which is, like, 90% of them.
 
sbi
@StackedCrooked If they do it well, though, people will swallow smoothly without complaining.
 
Apple tends to do stupider UIs than MS.
 
1:19 PM
@sbi People accepting new features without complaining? I've never heard of that.
 
Mac fanboys worship every change.
 
that ribbon makes it look like it's part of the MS Office suite
meh
 
They could replace entire UI with a photo of Jobs, and there'd people defending its usability.
 
I know a lot of normal users that got very confused when they added the ribbon to Office
so I guess this can only add to the confusion
 
honestly, it seems like it'd be a lot better than the Windows 7 explorer
 
1:20 PM
why don't they stick to what people are used to?
 
you can just turn it off if you don't like it
 
Office was a clusterfuck of menus before ribbon.
 
now it's a clusterfuck of ribbons
 
@TonyTheTiger If you go this way, you stop improving altogether.
 
Perhaps there should be two kinds of explorer applications. One for the mob, and one for the advanced users.
 
1:21 PM
I can never find anything
 
Well, I cannot find stuff either in Ribbon menus.
 
@StackedCrooked The second one is called Total Commander.
 
Total Commander sucks.
 
I guess I should checkout TC next time I boot into Windows.
 
I don't use Office at all, but I couldn't find anything in the menus either.
 
1:22 PM
@CatPlusPlus well there surely is other things to improve that are more important then the effing ribbon shit
 
So the ribbon can only be an improvement in this regard.
 
sbi
@CatPlusPlus I just wanted to say that! :)
@wilx If you don't like TC, you're too young.
 
never used TC
 
@TonyTheTiger What is there to improve about Explorer, if not UI?
 
sbi
16 hours ago, by sbi
@RMartinhoFernandes Me neither. But then I learned to use NC early on (on CPM, mind you), and since the days of Win95 I almost exclusively use TotalCommander. F3 for view, F4 for edit, F5 for copy, F6 for move, F7 for create folder, F8 for delete. Not that that would make any sense, but I have been using it for more than 25 years.
 
1:23 PM
@CatPlusPlus the search option, never finds anything you're looking for
 
TC sucks. I like Altap Salamander.
 
the fact it opens slow even on a fast machine
 
I haven't used Explorer in ages, but isn't search part of Windows Search, not Explorer itself?
 
I like how you can press the Start button on the keyboard and then start typing the name of an application followed by enter to launch it.
 
let's go back to command shell for file browsing, UI's are overrated
@StackedCrooked I like that too
 
1:25 PM
It was a missing feature for a long time.
 
I use Locate32 for searching anyway.
 
in Linux, I use bash to browse the filesystem, much faster
 
@StackedCrooked There were third party programs for that, for ages.
 
sbi
@wilx That looks like TC.
 
@CatPlusPlus I heard about those.
 
1:26 PM
Except that it does not suck. :)
 
sbi
@CatPlusPlus I have a 64bit machine.
 
It's like 4 times more expensive than TC. What does it do, shit golden bricks?
 
Aargh, I should redo my typing lessons. fff jjj fff jjj fff jjj fff jjj
 
every damn night :P
 
God! TC is ugly
 
1:27 PM
@sbi Me too, so?
 
why does my image not show up?
 
@kbok: Yes. And the UI is IMHO hard to use as well.
 
What.
 
It has a face only a mother could love.
 
That Altap thing looks exactly the same.
 
1:28 PM
@StackedCrooked What ?
 
they probably just copied it and renamed it
 
sbi
@CatPlusPlus Is it? It costs $30, whereas TC costs $46.
 
they're all clones of old norton commander
i liked norton commander
for a while
 
sbi
@AlfPSteinbach A decade, like me? :)
 
1:31 PM
yes
 
sbi
@AlfPSteinbach I knew it.
 
i think mr norton stopped making software and became a porno film actor
not sure though
 
Ah, I was looking at wrong license. I got TC for about 90PLN, so it's about the same.
But still, a clone.
 
I never really used a virus scanner on Windows. Only occasionally checked it using an browser-based scanner.
 
sbi
1:33 PM
@CatPlusPlus The most important difference is: I bought my TC license in the late 90ies, and have gotten free updates ever since. That's a bargain, no matter how you look at it. That must be 15 years of free updates, and I paid DM100 back then.
 
that's supposed to be pickup line?
wtf?
LOL
 
it's a put-off line.
If you love porn, then the cycle is complete.
 
lol
this is an interesting weather forecast system :p
 
look at the comment at the end
i love those kinds of comments
 
istream separates words with spaces, can you use a different separator character?
 
1:38 PM
yes
 
NSFW hahahah
 
Wow, someone suggested that_function_which_must_not_be_named on @jalf's question.
 
Downpoo. DOWNPOO!
 
1:49 PM
LOL, my answer is the most voted on and apparently "certainly elegant".
 
@AlfPSteinbach so could this be used to answer @jalf 's question?
 
@RMartinhoFernandes -6 votes on first question... Poor guy.
 
Well, not only he mentioned that thing, but it won't work.
 
And copypasted irrelevant example.
 
sbi
Do you guys see a way to fold this into a for loop?
    const char foo[] = "meh\0heh\0foo\0bar\0frob";

    std::vector<std::string> result;

    const char* p = foo;
    while(p != foo+sizeof(foo))
    {
        result.push_back(std::string(p));
        p += result.back().size() + 1;
    }
Then it would be a two-liner.
Well, this _should work, IMO:
for( const char* p = foo; p != foo+sizeof(foo); p += result.back().size() + 1 )
    result.push_back(std::string(p));
Or is there a way for result.back() being accessed without a result.push_back() first?
 
2:00 PM
Post it! (No, there's no way you can have an increment without running the loop!)
 
I'd rather have a five-liner than a 78-columner.
Also, for increased robustness, I advise p < foo+sizeof(foo) instead :)
 
sbi
0
A: Simple way to split a sequence of null-separated strings in C++

sbi#include <iostream> #include <string> #include <vector> int main() { const char foo[] = "wrgl\0brgl\0frgl\0srgl\0zrgl"; std::vector<std::string> result; for(const char* p = foo; p != foo+sizeof(foo); p += result.back().size() + 1) result.push_back(st...

@kbok I used to believe in that, too, but nowadays I think that this might actually hide a bug.
 
0
Q: c++ php and static library

sunsetI've created a library.a that contains a .cpp and .h files with a lot of classes, nested classes and methods. I would like to include this static library inside a php example and try to work with it. I would like to mention that I am new to php. I've tested my libray.a inside a test.cpp file and ...

 
@sbi I didn't think about it that way.
 
sbi
@kbok That loop is actually 70 chars. Not bad, if you ask me.
 
2:06 PM
I don't really like the "several statements per line" approach for the for loop, but I have to admit that it's nicely put.
It sure deserves more boats than the other answers.
 
@kbok Don't confuse robustness with tolerance of bugs!
 
:1354060 meaning?
 
xoffe axxident
 
sbi
@kbok Yeah, I shouldn't have boasted about the number of lines of code. This isn't codegolf, after all. But I think that they express a certain reduced complexity. If you can read a for loop, this is simple code. Or so I believe.
@AlfPSteinbach Are you drunk again?
 
@sbi your code is ok, except that i think you're maybe adding a zero-length string at the end?
 
2:18 PM
omg I laughed hard :)
 
no, it's just ok
 
What would youtube be without french peeing dog videos ?
 
sbi
@AlfPSteinbach Not according to my logic, nor according to the test output at the end.
 
(french ((peeing dog) videos))
 
you mean it's not ok
oh well
 
2:20 PM
It's ok.
 
The compiler will probably even generate the same code it does for @kbok's answer.
 
Not french people peeing videos about dogs. God, that "Englisch" language is so ambiguous.
Yay, badge.
 
Seems like @DeadMG either borked something, or he is repwhoring in the most dishonest way possible ;) stackoverflow.com/questions/7244363/…
 
because I totally need more rep
 
2:25 PM
What is it about that answer that makes it "repwhoring"?
 
because there used to be two identical answers
 
You more answers you can get more votes!
 
oh, it looked accidental to me
 
be interesting to know who upvoted the dupe
it was
 
2:38 PM
Good morning people
 
it's 15:39
 
It's 10:40 here.
 
16:42!
 
Time! Time is running out!
 
u guys has all wrång klåkks
16:49
 
2:52 PM
Frikkin' Uropeans.
 
Well I just woke up so good morning to you!
 
Woohoohoo
 
@LucDanton I thought you were in Europe.
Though that doesn't prevent you from waking up in the middle of the afternoon.
 
Real men wake up late.
Or really early.
 
Well I was quite surprised by the time myself.
 
2:57 PM
What time is it? Adventure Time!
 
Real men wake up so early, that it's still late yesterday.
 
Isn't that redundant?
 

« first day (318 days earlier)      last day (4625 days later) »