« first day (727 days earlier)      last day (4237 days later) » 

12:00 AM
folks
 
guys
randomly flag some useless post
say "lol"
 
Greetings
 
@LuchianGrigore Dammit, that cache question with the bounty is a homework question.
 
Which cache question?
If I might ask
 
15
Q: Writing a program to get (L1) cache line size

Jiew MengAs a school assignment, I need to find a way to get the L1 data cache line size, without reading config files or using api calls. Supposed to use memory accesses read/write timings to analyze & get this info. So how might I do that? In an incomplete try for another part of the assignment, t...

 
12:01 AM
You already did
 
So I can't just give the OP a working answer.
 
@HansPassant based on your name I'm willing to doubt myself. But I'm pretty sure I have seen it on more than one occasion. I get a log directory structure nicely split in 'Native'/'Managed' IIRC — sehe 18 secs ago
 
But the top answer is pretty much what I'd say anyways without giving a working answer.
 
@DeadCicada I think your original avatar (you know, the nice one :)) even had a hint of Dutch tilt:
Feb 15 at 20:00, by Johannes Schaub - litb
what's a dutch tilt
 
@sehe Which one?
 
12:04 AM
Oh cool, I was thinking the same thing as what is in the top answer. /me feels less dumb
 
So the Dutch have a patent on photgraphy angles. My my.
 
@DeadCicada I don't have it cached :( My browser cache is on tmpfs
@DeadCicada They don't. It's just another genre/style feature
 
If I can figure out when the OP's assignment is due, then I might post a fully working solution afterwards - if I feel like it.
 
@Mysticial Oh, you.
 
@DeadCicada What were you responding to?
 
12:07 AM
I was implying that's evil.
 
oh... haha
I'm doing the exact opposite from what I (unknowingly) did on the matrix question.
 
Thats not evil, giving him a working example now would be, if he gets caught using it.
 
@Mysticial What, you are getting 4539 downvotes now?
 
@sehe huh?
@sehe Oh, that. That's different.
 
The difference would be about (10*4539)-(-2*4539) = 54468
 
12:11 AM
assuming no repcap
 
obviously. I'm talking raw currency
Note to downvoters: if my attempt at helping you pissed you off for some reason then surely you can find something else to downvote? I posted over 10,000 answers, plenty of opportunities. — Hans Passant Sep 11 at 0:04
^ Dat. Class.
 
That's his only question too.
 
@Mysticial Now you know how I found it :0
 
Personnaly, if I was about to downvote a guy and saw he had 289k rep I'd just assume I'm wrong and not do it.
 
Kinda like my only question.
It's just another not-so-special question. But because it's the only question, it gets a lot of views from my profile.
along with a slow trickle of upvotes.
 
12:18 AM
How's it going?
 
@Mysticial I have 5 'pseudo' questions. I posted them on behalf of others. There was a time when I preferred SO vastly over user groups so I even 'transplanted' questions to SO to answer them on a 'nice' site... I might delete those, I guess.
This one can stay
 
"How about improving your accept rate?"
haha, jk
They're all really detailed. They should stay.
 
@Mysticial Where can I even +see+ my accept rate ? :)
 
:)
Had to say that cause of all the fuss on meta about getting rid of it.
 
I've got a quick question, if anyone would be up for it... Would have posted it on SO, but it's not exactly a question that has a real answer, it's more philosophical...
 
12:21 AM
@sehe 20% accept rate?
 
i read code wrong, argh
 
oh five questions!
@Serge There is no spoon
 
@Mooing close, but I'm not sure what spoons have to do with angles!
 
@sehe and they're all about spirit
 
3 mins ago, by sehe
@Mysticial I have 5 'pseudo' questions. I posted them on behalf of others. There was a time when I preferred SO vastly over user groups so I even 'transplanted' questions to SO to answer them on a 'nice' site... I might delete those, I guess.
 
12:23 AM
I was just wondering... why do programmers still use radians or degrees to represent angles?
 
@Serge there's room for exactly 37 angles on head of a hairpin
 
@Serge what else?
 
What else would you have us use...
 
@Serge in norway we measure angles in litres
6
 
Well, I mean, I know they're the standards for angles... but, thinking in terms of computers, wouldn't a 0.0 to 1.0 range be... better?
 
12:24 AM
@Serge tau?
 
@Serge Radians make oodles of mathematical sense. Degrees... not-so-much
@Serge Nope
 
Why not?
 
It's a lot easier to program something if you're working with quantities you can relate to
 
@sehe degrees make a lot of sense, because it's the babylonian base 60 system
60 is divisible by 2, 3, 5
 
@Cheersandhth.-Alf 60 is nearly arbitrary. pi is not
 
12:25 AM
@Serge because it is still going to be an approximate, floating point, binary representation of the same ratio
 
35degrees speaks to me, pi/2 radians speaks to me. 0.5? well half a turn? maybe but not nearly as much
 
0 to 360 is strange, and 0 to Pi ends up having everyone use irrational numbers...
 
@Borgleader I've always liked tau/half a circle best. But everything takes radians
 
@Cheersandhth.-Alf So, that's what I said: not-so-much math sense. Not like atan(1)*4 = pi and stuff
 
@Serge no irrational numbers in a computer
 
12:25 AM
and I liked the ideas behind Tau, in terms of mathematics, at least
 
Mooing: That's exactly why I question using it... although with angles we'll always have issues.
 
@Serge historical reasons at this point.
 
When I was doing OpenGL (1.0) for school, I would use degrees and had a macro to convert to radians because thats what was easiest for me.
 
@Borgleader avoid converting at runtime, do all conversions at compile time
 
12:27 AM
someone would probably kill someone else if they invented another standard for angles, too...
 
"The Babylonians sometimes used the unit pechus of about 2° or 2½°."
 
@MooingDuck: It was simple OpenGL homework, rotations, scale and basic shaders. Runtime conversion isn't going to be a problem.
 
@Serge I suppose google will. And there are many already. Geodesians should know
 
@Serge Because it makes no actual difference. Being different from what everyone uses for no benefit is not worth it.
 
user406009
@MooingDuck Wouldn't a macro convert at compile time anyways?
 
12:29 AM
stupid beuracracy. I did some audio stuff, but they want my time logged under 4 different tasks by why the audio was changed. Im' not sure how to log this :/
 
still, it was... just a thought to me. And Sehe is right about the approximation thing... although, if it were a 0 to 1, then (accurately) representing any binary fraction of a circle would be pretty simple... Still, like I said, not a question with an answer. just provoking thoughts.
 
@Lalaland yes
 
"The binary degree, also known as the binary radian (or brad), is 1/256 of a turn.[5] The binary degree is used in computing so that an angle can be efficiently represented in a single byte (albeit to limited precision). Other measures of angle used in computing may be based on dividing one whole turn into 2n equal parts for other values of n."
 
@Serge And then it stops being accurate as soon as you do any math with it.
If you're dealing with something that deals only in exact halfs of circles, use a different notation.
 
@R.MartinhoFernandes truth.
 
12:31 AM
And in any case... constexpr full_circle = 2*pi; does wonders.
 
Unless you have a fraction class and you do all your math as operations on fractions
 
full_circle/2 is clearly half a circle, 0.5 isn't.
 
@R.MartinhoFernandes you're going to want a type/unit there
well angles have no type. but still!
 
Heh. I could always just have some extremely complicated algebra structure that stored numbers as expressions, only reducing the expression when there's no loss in precision =P Someone would slap me for that
 
there should be a pseudo-type there.
 
12:32 AM
@MooingDuck I honestly don't think it's worth it. Only legacy OpenGL uses degrees, right?
 
@R.MartinhoFernandes I dunno. I was just imaging sin(myvector.size());
 
But if you want you can abuse std::chrono::duration (poor name for something sooo generic :(
 
@R.MartinhoFernandes typedefs/using fixes all naming issues
 
chrono seems useful but its so verbose
 
anyways... thanks for running with my question. =)
 
12:33 AM
@Borgleader You're doing it wrong.
 
@R.MartinhoFernandes auto angle = 45_deg;
 
how so?
 
Give me an example of such verbosity.
Judicious use of auto and one or two convenience functions for particular scenarios do wonders.
 
Uh.. where can i paste code? ideone wont work because it wont compile on gcc
 
Doesn't need to compile.
 
12:37 AM
Hi again all.
 
just uncheck run-code
 
And you can uncheck "Run code" if you want.
 
hey
 
@JerryCoffin Howdy.
 
http://ideone.com/Wy6eb
Near the bottom, around the ifdef/else/endif
 
12:38 AM
@Borgleader typedef/using fixes that easy
 
It's code I wrote to compare single threaded matrix multiplication with gpu accelerated version
 
@MooingDuck No less verbose. Just less intrusive in the actual code body
 
using namespace std::chrono;
auto end = high_resolution_clock::now();
std::cout << "Process time: " << duration_cast<milliseconds>(end - beg).count() << " ms" << std::endl;
@sehe it's slightly less verbose. Definitely less in the body
 
@MooingDuck the clock is a class, not namespace. auto.
 
@R.MartinhoFernandes pft
 
12:40 AM
If anybody cares, it's C++ AMP
 
Anyway, <chrono_io> is missing from the standard. Use it.
 
Hmmm...perhaps a quick reply to the message on the starboard: How to install shit on your Mac (note the crucial paraphrase there). 1) uninstall OS/X. 2) Install an OS that isn't quite such a complete POS (i.e., anything else) 3) Proceed without problems.
 
@JerryCoffin POS X?
 
wheels::stopwatch?!?
 
@R.MartinhoFernandes MacPOS/X, I guess.
 
@R.MartinhoFernandes he's a classy kinda guy
 
o.O Wow that's pretty cool
Probably not much but how long did it take you to come up with it?
 
I discussed it with Kerrek in this chat one day, so I could check that.
Nov 29 '11 at 3:41, by R. Martinho Fernandes
A stopwatch class similar to the one in .NET? (we'd make it a template!)
Hmm, in that ideone code I forgot to call sw.start().
 
When I wrote the matrix multiplication code I thought of doing something similar to your stop watch class. You just saved me the trouble. Plus its more complete than what I would have done
 
Yeah, I kind of... went overboard with the laps and all.
 
12:55 AM
I wouldnt have made mine a template :P
 
It is a template.
basic_stopwatch takes a clock type parameter.
 
Thats what I meant, if I'd written it I wouldn,t have made it a template
 
Ah, misread.
Having a configurable clock was handy for testing: bitbucket.org/martinhofernandes/wheels/src/…
It would be really difficult to test with an actual clock.
 
@R.MartinhoFernandes with mine, the constructor and reset members took a enum dorun {start_clock, dont_start}; as well
 
Ah, I use stopwatch::start_new() to start a running one.
 
12:59 AM
of course, I started with assertions, but found it was nice to simply timer.restart(start_clock); everywhere.
@R.MartinhoFernandes I was mislead by the comment
 
And I have both reset and restart.
 
@R.MartinhoFernandes my oversight.
 
@MooingDuck Yeah, I just noticed that right now.
Ooops.
 
GOING HOME NOW BAI
 
1:10 AM
Do you have other fancy handy classes like that? ;)
 
Browse around the repository and check for yourself.
Checking the test folder may give better insight about the purpose of some of the things.
There's a short summary of most things here bitbucket.org/martinhofernandes/wheels/wiki/Home
 
will do :)
 
1:30 AM
Ok, so... cut a hundred lines out of value_ptr, cut three hundred lines out of tuple, or work some more with Unicode? Choices, choices.
 
Whats a value_ptr?
 
> wheels::value_ptr is a smart pointer that always copies the pointee. It can handle polymorphic classes without slicing and allows custom cloners and custom deleters.
 
@R.MartinhoFernandes What are you doing with Unicode?
 
Are you looking for a job or jobs? I wish I were free to work on my C++ parser project…
 
1:33 AM
I have a hard time believing value_ptr doesnt already exist
 
Well the idea is anathema to many C++ folks
 
@Potatoswatter I was until last week. I'm starting a new job soon :)
@Borgleader There's a proposal for the next standard.
 
So now you're in a hurry to finish all the personal projects :D
 
Xeo
Wtf Youtube, prompting me to use my real name instead of my nick. oO
 
1:46 AM
Hm, I'd really like to have is_lossless_convertible right now.
 
@R.MartinhoFernandes What are you using to identify encodings?
Did you tell Dead about this so he can spec his programming language so similar-looking grapheme clusters alias?
 
@Potatoswatter Yes, he is aware.
@Potatoswatter There's a class for each.
I have most things already documented somewhere, but implementing it all takes forever :S
 
Xeo
2:24 AM
I... really don't know what to make of the deck in this answer:
0
A: Why would I prefer using vector to deque

MehrdadYou do not need deque if you just need O(1) prepending. It offers more guarantees which you probably do not need, but which harm performance. The same exact algorithm that vector implements for the back, you can implement yourself for the front. But, it's a bit of work, so it's worth not re-in...

I mean, who thinks it's a good idea to combine the bloated interface of basic_string with anything?
Also, the code is... woah.
 
That looks like it was grabbed from the standard library and tweaked into the desired shape.
 
Xeo
Not really. The code is nothing like I've seen before.
I mean, runtime tests on whether a type is trivially destructible?
Oh, hey, found a bug.
 
@Xeo Where?
It's kind of ok, because the dead code detector will drop the unused branch.
 
@Xeo LOL. Not having read the answer but maybe that's an attempt at something like my "powerdeque"
 
But if the idea is to make a vector, but start from the middle, it sounds cool.
 
2:30 AM
Like a regular deque but each successive block on either end is twice the size of the last, so there are O(lg N) memory blocks instead of O(N)
 
Xeo
static bool is_default_constructor_suppressed()
{
return cpp11::is_trivially_default_constructible<value_type>::value;
}

static bool is_destructor_suppressed()
{
return cpp11::is_trivially_destructible<typename cpp11::wrap_basic<value_type>::type>::value;
}
 
@Potatoswatter NAh, "The same exact algorithm that vector implements for the back, you can implement yourself for the front."
 
and if you use it for a circular buffer it becomes O(1) blocks
 
Xeo
@R.MartinhoFernandes Yeah, but implementing that basic idea shouldn't look so convoluted. :/
 
@R.MartinhoFernandes Yes, well that's how I achieved it… one normal vector for growing forward (at the back), and a second backwards vector to grow at the front.
 
Xeo
2:32 AM
@Potatoswatter He wanted to achieve contiguous memory
 
Hehe. I did something like that in Haskell before to represent an open-ended bra*nfuck memory tape.
Hmm. How do I default-construct any_text.
 
Xeo
Can anybody tell me why I'm still awake? I need to get up in less than 3 hours and see the doctor... crap.
Which means, g'night and wish me luck waking up...
 
Good... two hours of sleep.
 
lol, night
 
hm
 
2:40 AM
0
Q: C++ How do I convert Hex Integer to String?

tony gilIn C++ how do you convert a hexadecimal integer into a string representation of the decimal value of the original hex? Let us say we have an integer whose hexadecimal representation is a1a56 (which in decimal equals 662102) and you want to convert this to a string "662102" How would you solve t...

By "Hex Integer" he means int.
 
and this is a dupe no doubt
 
Yep. I'm editing the question and looking for one.
 
a lot of people seem to have a misunderstanding about "hex integers"
 
About numbers, you mean.
 
well what he refers to hex integers
 
2:42 AM
I honestly don't get it. I was taught this in elementary school.
 
Kids these days run screaming from any mention of binary. (And by that I mean college grads)
 
bbg
hex integers just a represent
 
Any help finding a dupe?
I get a lot of "string to integer" posts instead.
 
bbg
in memory , the integers is bytes
 
http://stackoverflow.com/questions/5100718/int-to-hex-string-in-c
This?
 
2:45 AM
Nope, it's to convert to decimal.
 
but but the title says to hex string T_T
 
There's no hex-related anything in the question, only the part fabricated by the OP's lack of understanding of numbers.
@Borgleader Not anymore.
Ah, dupe found. It was actually a .
Close votes welcome.
 
30
Q: c++ integer->std::string conversion. Simple function?

Paul NathanProblem: I have an integer; this integer needs to be converted to a stl::string type. In the past, I've used stringstream to do a conversion, and that's just kind of cumbersome. I know the C way is to do a sprintf, but I'd much rather do a C++ method that is typesafe(er). Is there a better way...

how much rep does it take to be able to vote for close?
 
3:00 AM
it does that automatically after a certain amount of back and forth comments iirc
 
@Rapptz But it only creates the room if you accept the suggestion.
I really don't want to argue this.
 
Also did you misunderstand the question or am I misunderstanding?
int can be in the form of a hexadecimal?
 
int is a number. It's not hexadecimal, nor binary, nor decimal. It's a number.
 
LOL as soon as others join the chat he switches to Portuguese
 
3:02 AM
He's asking how to turn a hexadecimal number (a1a56) into a string of the decimal representation (662102)
 
== 0b1 and so on
 
He's a master of inconvenient formatting, if nothing else
 
@Rapptz See the comments. The "hexadecimal number" comes as an int.
 
user406009
Is there an easy way to parse hexadecimal numbers?
 
In that case, it comes as a string.
 
user406009
3:03 AM
Manual parsing for hex isn't to hard, but is there a built in format specifier or something?
 
I think so.
std::hex
 
I think you're just confusing him even more lol
Where would he get the hex from if it's an int type?
 
@Rapptz He probably did int x = 0xa1a56;
 
So he's just doing int a = 0xa1a56;?
What's the point?
 
How would I know.
 
3:05 AM
ehhh stupid.
 
Anyway, I rolled back my edit. I trust that other SO folks know that it is truly a dupe and will close it anyway.
 
Isn't that guy Jesse Good from the committee?
 
@Rapptz I see that guy a lot on SO. He's on the C++ committee?
 
I vaguely call hearing so.
 
3:21 AM
Dunno.
 
I can't guarantee it, but I seem to recall a hint that he may be a bit (thankfully, not a lot) like Schildt -- has paid dues so he's officially a committee member, but nobody can recall ever having seen him at a meeting. I know I remember hearing that about at least one semi-popular author (other than Schildt); I'm just not certain he's the one.
 
Anyone mind if I secretly put the @pe back on the owners list? I think it's been long enough.
 
He left?
 
Don't say the A-word. I have a suspicion he greps for it.
 
@R.MartinhoFernandes are you serious?
 
3:32 AM
@Mysticial Everytime I use it to avoid plinking and he has something to say, he finds it.
 
lol @pe
 
@R.MartinhoFernandes: juste use 4p3 instead :P
 
As the most recent addition to the list, I'm in no position to object to what those more senior than I may do (even if I was the first to suggest it...) :-)
 
@JerryCoffin More senior, lol
 
@R.MartinhoFernandes Well, @Mysticial was (fairly) recently a senior in college. The last time I was in college...well, it's been a while.
 
3:36 AM
 
I think we've had this conversation before.
 
I figured nobody was gonna take the initiative.
Now we need to talk about random shit to make this scroll off.
 
I need to get work done but don't feel like doing it
 
We can't bin audit messages :(
 
Any suggestions?
 
3:40 AM
@Rapptz no idea...
@R.MartinhoFernandes I've tried before.
I tried binning the bin messages before. lol
 
binception
thats like deleting the recycle bin
 
I remember a friend of mine said he tried to demolish a landfill in Sim City.
 
Well, to be fair, you can delete the recycle bin icon in the desktop.
 
Hmmm. Template virtual functions.
What are the alternatives?
 
I didnt say delete the icon, I said delete the recycle bin, or maybe I should have said try to delete the recycle bin
 
3:43 AM
@R.MartinhoFernandes PHP
 
I'm scared to ask why you even need them.
 
I'm writing any_text, a type-erased variant of my basic_text template.
 
http://www.gametrailers.com/videos/3wp98f/star-citizen-developer-walkthrough
Hyped or not hyped
 
I think I need an any_container or something.
 
3:46 AM
The ad it made me watch seems more interesting than the thing itself.
 
There are ads? Oh right I have adblockplus
 
The only other time that happens in during the super bowl.
@Borgleader It's embedded in the video. It wouldn't let me skip it.
 
no ad here.
 
Well thats weird because I didn't get any...
 
Speaking of any, does boost::any have moves?
 
3:48 AM
Looks a bit like Crysis.
 
Seems not :(
 
but with less awesome graphics.
@R.MartinhoFernandes I think all the "real" C++ people are out right now besides you.
 
@Mysticial :)
 
@Mysticial: it is the cryengine so yeah it'll look like crysis
 
@Borgleader haha... lol
Crysis 1 was one resource machine.
Crysis 2 was disappointingly not taxing on my machine.
Even my laptop could handle it.
 
3:51 AM
Oh yeah... I still remember the claims of "it'll take 4 video cards to run this game"
As for Crysis 2, the reason it wasn't taxing is it was aimed at consoles
 
@Borgleader I DL'ed Crysis 1 for the sole purpose of testing if my server could handle it.
 
iirc they reduced the draw distances and a few other things
 
Xeon X5482 @ 3.2 GHz + GeForce 9800 GTX+ was able to handle Crysis 1 on medium. At gamer, FPS dropped below 20.
1680 x 1050
 
yep...
 
My i7 920 @ 4.2 GHz with a GTX 275 could barely manage 20 FPS on enthusiast. 1680 x 1050
 
3:54 AM
i should try it on my current desktop, i7-3770 @ 3.4Ghz + GeForce GTX 670
 
@Borgleader That's definitely better than my machine.
My 2600K will (used to be able to) run at 5 GHz.
But anything above 4 GHz and Crysis 1 became GPU bound.
Granted, I never tried to put in my good video card in that machine.
 
So far I've played GW2, WoW, Batman Arkham City and BF3 on this thing and booyah pretty pixels everywhere
 
It was never intended to be a gaming machine.
 
Hello
I got some question to ask
My friend has 210 reputation
 
go on
 
3:58 AM
I think I'm going to run this benchmark with GPU enabled and see what I get
 
in total all in the sudden his reputation minus 30 reputation from him
 
what is happening
he check graph
no downvotes
 
@Furry Are you two serially upvoting each other? That's what it looks like from your page.
 
yeah just checked
looks like you two serially upvoted each other.
 

« first day (727 days earlier)      last day (4237 days later) »