« first day (794 days earlier)      last day (4380 days later) » 

How do you know they are the right bits, i.e., the bit endianness is what you expect?
I'd rather use shifts and masks.
user142019
I'm using them for the paging structures. I didn't think of bit endianness. :c
user142019
OSDev had this diagram and I'm always confused when it comes to numbering bits:
user142019
1 << n is the mask for bit n.
user142019
14:04
That I know, and you can set it with |= and query it with &.
user142019
IIRC. :P
So, what confuses you about numbering bits?
yeah... it's not hard
bool isBitNSet = bitField & 1 << n;
user142019
In the diagram they say 0 and 31, but say I have a 32-bit entity, how do I know which of the bits is bit 0 and which one is bit 31?
what do you mean?
14:07
1 << 0 is bit 0, 1 << 31 is bit 31.
as we would write in diagrams?
user142019
@thecoshman the way they are stored in memory. Or shouldn't I care about that?
I think he means on the drawing bit 31 is on the very left
@R.MartinhoFernandes add one to which bit is which
@Zoidberg'-- The shifts know.
user142019
14:08
You have 32 flip-flops, which of the one is 0 and which one is 31?
@thecoshman Wut?
@Zoidberg'-- depends what order bits are stored
user142019
@R.MartinhoFernandes ah okay.
@R.MartinhoFernandes well, I guess 0 index makes more sense
@Zoidberg'-- what order are they stored in?
user142019
@thecoshman that is what I don't know. :P
14:09
You can also craft the masks with hex by hand, if you want: 0x80000000 is bit 31, 0x00000001 is bit 0. But using a left shift is more scalable.
user142019
@R.MartinhoFernandes In that case I prefer shifts; much more readable.
@R.MartinhoFernandes and readable
user142019
Compiler will do constant folding anyway.
Screw readable.
unless you are autistic and can read hex values
Xeo
Xeo
14:10
ITT: Windows decided to shut down my laptop right after I said it's holding on for another 10mins. :)
Fuck Windows
user142019
@R.MartinhoFernandes says a robot.
@R.MartinhoFernandes unmaintainable code is the worst thing ever
Xeo
Xeo
@Tony: Yeah, my download had 30 seconds left! :(
constexpr uint32_t bit(unsigned n) {
    static_assert(n < 32, "hey, too many bits!");
    return 1 << n;
}
// you are thinking about readability at the wrong level
14:12
@R.MartinhoFernandes now you're thinking with portals :P
@R.MartinhoFernandes You can static assert that? constexpr is cool..
user142019
I have this now. I'll use bitshifts for it for correctness' sake, but what about the 10-bit address? github.com/daknok/sulfur/blob/master/kernel/arch/x86/paging.h
Xeo
Xeo
Hm, train's departing in 10mins here from Essen... beetter get going to the platform. See y'all from Berlin in another 6h. :)
@Stacked: Last I heard, you can't.
user142019
@Xeo Essen, isn't that near The Netherlands?
@StackedCrooked Ah, no, you can't.
user142019
14:13
There is also an Essen in Flanders. :P
Lemme rewrite that.
@R.MartinhoFernandes Dammit.
user142019
You can use std::enable_if. :P
user142019
I think.
Xeo
Xeo
@Zoidberg: depends on your definition of "near", I guess. :) But yeah, it's somewhat close.
14:14
Make it a template parameter.
Or...
template <unsigned N>
constexpr uint32_t bit() {
    static_assert(N < 32, "hey, too many bits!");
    return 1 << N;
}
// or
constexpr uint32_t bit(unsigned n) {
    return n < 32? (1 << n) : throw "hey, too many bits!";
}
user142019
heh
You used to be cool.
Xeo
Xeo
I like abusing throw for static assertions in constexpr.
Which compilers support constexpr at the moment? Only gcc?
Xeo
Xeo
Clang
And I really gotta go, see ya!
14:15
ty
user142019
@Xeo Spater!
GCC has at least some support for constexpr.
user142019
C also has constexpr. It's called #define. :P
Moet je op je mulle ebben?
user142019
KOMDAN
user142019
14:16
DURF JE TOCH NEIT
@Zeta obviously referring to the man page
@Zoidberg'-- Wacht maar.
@Zoidberg'-- ikke wel
user142019
@sehe kom chillen in Rotterdam op school. :P
@Zoidberg'-- classy
14:17
room topic changed to Lounge<C++>: Gibberish overload. [c++] [c++11] [c++-faq]
@Zoidberg'-- Zit je daar nu te kernel programmeren? I reckon that gets you all the attention of all the ladies.
@R.MartinhoFernandes phatagen
user142019
@R.MartinhoFernandes Gibberish? What are you smoking? The last time we talked about C++ was almost an hour ago already.
@Abyx what should i use then?
user142019
@sehe Ladies? On an informatica-opleiding? Zeer schaars.
14:18
@Tuntuni php.
@thecoshman Is that your attempt at pronoucing "fhtagn"?
Just checking.
@Zoidberg'-- "all the ladies". That could be the empty set
@R.MartinhoFernandes yesum :(
user142019
The building I'm in is dedicated to CS.
@thecoshman von Nazareth?
14:19
@Abyx ah sorry i edited my question ...
user142019
@sehe In that case I also get the attention of all the ladies! WIN!
though in my defence, it is a spelling that aims to approximate the sounds...
@thecoshman I pronounce it more like "fatine".
@sehe huh?
@Tuntuni nevermind
14:19
@thecoshman nevermind
@sehe That was terrible.
@R.MartinhoFernandes are you aware the HPLHS...?
so should i use "int& a" or "int &a". when dealing with pointers i normally put the star near the name of the variable (btw, how do i escape this italic style when using the asterisk?)
One of the worst attempts at jokes ever seen in the lounge, I'd say.
user142019
@Tuntuni int& is more common.
user142019
14:20
int &a looks really weird.
@thecoshman Yes.
@Zoidberg'-- and when it comes to pointers? i've put the star near the name of the variable my whole life. :l
user142019
@Tuntuni I do T* t in C++ and T *t in C.
user142019
T* in C++ because that's consistent with T& and T&&.
reference<int>!
14:22
@R.MartinhoFernandes they have a song, a parody of the song the meercat and warthog from lion king sign. They pronounce it 'fah-tag-un' (or close enough to that)
user142019
@Pubby typename std::add_lvalue_reference<T>::type!
@thecoshman Which one? Haven't seen that one.
@Zoidberg'-- that seems good. :) thanks! ;)
@R.MartinhoFernandes it might be on one of there two xmas cd's
I like this one.
user142019
14:23
In Objective-C I do T *t because that's the convention and that's what clang autocompletes to (and if you use Objective-C without autocompletion I can't say how much of a moron you are).
oh yeah :D
¬_¬ and now it is stuck in my head for the rest of the day
@thecoshman hehe.
My job here is done.
"Shoggoth, shoggoth, shoggoth, we played and now I'm dead!"
user142019
If I use bitshifts instead of bitfields, how would I set values that are e.g. 10 bits wide? Doing it bit by bit seems terrible.
user142019
Oh wait I can use |= for that.
@R.MartinhoFernandes have you got the albums?
14:25
Make a mask for those 10 bits.
@thecoshman No.
Mask to clear, then mask to set
user142019
aarg yes that :P thanks
I've heard a bunch of them on Youtube.
@R.MartinhoFernandes you should :P
user142019
I want bit manipulation class instead of Java class.
14:26
@thecoshman Have you watched their latest movie?
@R.MartinhoFernandes not watched any of them, but just got my GF jsut got one for xmas, and oen for here brother
I watched the first one.
we just got dunwich horror and cthulhu
if you by the physical discs, they come with fancy things
@R.MartinhoFernandes oh, sounds awesome :P
I do like how you are not only better at English, but you are better at made up English words
14:30
lol
That sound also has "frabjous" in the lyrics, which is also a made up word, but made up by Carroll, not Lovecraft.
@R.MartinhoFernandes s/by/but/
Oops.
I just realized I know most of Jabberwocky by heart.
oh right, as in the frabjous day :P
> O frabjous day! Callooh! Callay!"
He makes a pun by replacing "Callooh" with "Cthulhu"
raleigh?
user142019
Changed the code to use uint8_ts rather than bitfields.
and technically, replacing words like that is not a pun, I looked it up :P
> Still I await that frabjous day! Cthulhu! Callay!
> A pun differs from a malapropism in that a malapropism uses an incorrect expression that alludes to another (usually correct) expression
@thecoshman lol
14:37
@R.MartinhoFernandes what so funny :(
> The pun, also called paronomasia, is a form of word play which suggests two or more meanings, by exploiting multiple meanings (...) of similar-sounding words, for an intended humorous or rhetorical effect.
I think it counts as pun.
@R.MartinhoFernandes hmmm... perhaps
Thought the two or more meanings part is a bit of a grey are since we are talking about nonsense.
user142019
Man.
user142019
This C code on OSDev looks so evil.
14:39
Which one?
user142019
Hard-coded pointer values, casts between void* and unsigned long. Bit arithmetic on pointers.
What is that for? Video memory?
user142019
void *get_physaddr(void *virtualaddr) {
    unsigned long pdindex = (unsigned long)virtualaddr >> 22;
    unsigned long ptindex = (unsigned long)virtualaddr >> 12 & 0x03FF;
    unsigned long * pd = (unsigned long *)0xFFFFF000;
    unsigned long * pt = ((unsigned long *)0xFFC00000) + (0x400 * pdindex);
    return (void *)((pt[ptindex] & ~0xFFF) + ((unsigned long)virtualaddr & 0xFFF));
}
user142019
In Hell-C that would invoke funny behavior.
14:42
That probably won't work if you have 4meg pages.
user142019
I have 4MiB pages. :P
user142019
But I'll figure that out later.
user142019
First I need a building and testing environment.
user142019
I'll make that now so I don't procrastinate that again.
Is there a way to use SublimeClang with MinGW
user142019
14:43
Is MinGW Clang?
user142019
(Hint: highly unlikely.)
k quick google search says yes
a little bit of me wants to get one of those old fashioned printers that hammer out each character and use it to log access attempts to my pi :P
user142019
Does MinGW do code completion? o.o
I don't know but these guys seem to be doing it.. now if only I knew how..
user142019
14:44
I want to use Vim with Clang. Let's see what happens to exist...
Aw man, recursive iterators are very "so not gonna implement this shit; I'd rather have a sub-par interface".
hmm
the LLVM headers spew so many warnings
the only way I'd be able to compile is with /W0
Doesn't VS have an option to silence warnings from particular directories?
With GCC or clang you add -isystem whatever_folder and it shuts up about it.
Otherwise you would never be able to survive with -Wall -Wextra -Werror -pedantic
1
Q: -isystem for MS Visual Studio C++ Compiler

MathiasI usually like to have a lot of warnings enabled when programming. However, some libraries contains code that easily causes warnings (.., python, Qt, ..). When compiling with gcc I can just use -isystem instead of -I to silence that. How can I do the same with the MS compiler? I know of the warni...

@DeadMG Seems you are screwed.
@R.MartinhoFernandes You mean people don't generally do them because they're a pita to implement?
Because once again... VS sucks.
user142019
14:49
@DeadMG can't you do #pragma push #pragma disable-warnings #include shit #pragma pop or something? I don't know the exact syntax.
9
Q: How to suppress warnings in external headers in Visual C++

Bob WhitemanI'm starting a new BREW project, and I'd like to compile with Warning Level 4 (/W4) to keep the application code nice and clean. The problem is that the BREW headers themselves don't compile cleanly with /W4. In gcc you can differentiate between application and system headers by using -I and -is...

Seems the pragmas are your only option.
user142019
Or manipulate the compiler using a debugger!
Btw, I am laughing right now. VS is really laughable as the best thing ever.
@Zoidberg'-- Yes.
@Zoidberg'-- "or just patch it"
14:52
you can #pragma warning(push, 0) stuff #pragma warning(pop)
user142019
@Abyx Patch the compiler with a binary diff!
user142019
@DeadMG well problem solved.
what's that no warnings from the Standard library macro?
0
Q: Member variable of type std::array<T, ?>

clsHow do I declare and set a member variable for a template class AClass which is of type std::array<T, ?> (with undefined size)? The actual std::array is to be created in the constructor, where the size of the array is a constructor parameter. In pseudo-C++ code: template <typename T>...

WTF, newing up std::array
@Borgleader Yeah.
It's not abnormal for newbies to expect that an array has a runtime-determined size.
14:55
Why can't he just do template<typename T, size_t N> std::array<T,N> a; or whatever the fuck he wants to do
user142019
@R.MartinhoFernandes and now answers say std::vector and he will do new std::vector. :^)
Instead I wrote a function that takes an output iterators and goes depth first on it.
@Zoidberg'-- lol
user142019
@ScottW better than u as ai ain't hungry
user142019
There isn't a moment at which you're not hungry.
Oh someone took my answer.
user142019
14:56
Such a thing simple doesn't exist.
Lame.
adding the size_t template parameter
user142019
Compile-time/run-time distinction with templates is difficult to get used to in the beginning.
user142019
I had trouble with it at least.
14:58
Yeah, but you suck.
user142019
That said, I'm dumb.
user142019
oh my yes
<- places breakpoint; launches the crappy VS debugger; wonders why breakpoint is not hit; realizes function is not called
You are eating?
I suggest you fix that
right
user142019
What is the difference between linear addresses and physical addresses?
@Zoidberg'-- Physical addresses are in RAM. Linear addresses, I'm not totally sure, but that sounds more like a property of virtual memory to me.
now all I have to do is link
user142019
@R.MartinhoFernandes Intel's manual uses both in the same sentence, saying that 32-bit paging translates 32-bit linear addresses to 40-bit physical addresses. If they are the same, that seems idiotic to me.
user142019
> Linear addresses are calculated from virtual addresses by segment translation.
why dafuq does Clang and LLVM have about 1 billion libs?
user142019
> Flat memory model or linear memory model refers to a memory addressing paradigm in low-level software design such that the CPU can directly (and sequentially/linearly) address all of the available memory locations without having to resort to any sort of memory segmentation or paging schemes.
15:04
oops I just retagged a month old question
@Zoidberg'-- Oh well.
user142019
Meh, those two sentences seem contradictory. Let's see if Intel's manual defines both terms somewhere in the >3k pages (pun not intended).
man
the more libs I link to, the more unresolved externals I get
isn't it supposed to be the other way around?
@DeadMG lol, you fail.
user142019
Even the definitions of physical address and linear address suggest they are the same. :/ Or more-or-less the same.
15:08
Ugh, my code is dereferencing pointers to deleted objects.
user142019
Huh? I'm suddenly pregnant.
8
@Zoidberg'-- Well, there is no actual UB involved, in fact. There is a smart pointer and it causes a dialog to popup in InDesign when shit like this happens, instead of merrily dereferencing everything to doom.
So you may want to check with your doctor.
@Zoidberg'-- I have no idea what you mean but I starred because it sounds funny out of context. :D
user142019
@R.MartinhoFernandes oh cool.
user142019
@Rapptz The message above it suggests UB, which is well-known to be a possible cause of male pregnancy.
15:12
@ScottW breathe() or die();
user142019
Ohh wait
waaaatr
it linked!
user142019
Linear address space can be paged, physical address space cannot.
I resolved 741 externals
5
user142019
lol
15:14
ARGH
@R.MartinhoFernandes sorry. I'm terribad
Clang, you're so, so bad
it asserted that I provided a DiagnosticsEngine
@DeadMG You should wear that on a T-shirt.
@ScottW too late. Nice knowing you
user142019
I'm going to read this entire manual. It's interesting.
15:15
if you need me to provide one, why don't you just take one as a constructor parameter?
"I resolved 741 externals and all I got was this lousy T-shirt"
I resolved to resolve resolutions
@DeadMG Singleton?
@sehe Nope.
So, what are you guys choosing for your new year externals?
user1182183
hm anyone here got a 32bit system?
user1182183
15:17
(windows)
user142019
x86 = PHP
@R.MartinhoFernandes Sounds like a cool library. Of course, it can't be fool proof, but sounds usefuller than MS debug thingies (and SCARY)
user142019
So much crap but it all seems to work on some magical way.
@R.MartinhoFernandes lol
user1182183
I need nvidia physx 32 bit ... but when I access the physx download page I only get a 64 bit download -.-'
user142019
@GamErix how unfortunate.
gmx::exception("Entitlement Violation")
@GamErix Wut - "nvidia com object" is the url. Can't obejct to that
@R.MartinhoFernandes Not to waste my time on resolutions I never care about on January 2nd
@sehe It also warns about ref-counting hazards: when InDesign quits, if anything still has a positive ref-count, I get a popup.
@R.MartinhoFernandes A single collective one, I hope?
15:20
No. It can be annoying if I mess up real bad.
(As I think... Murphy? would say: a leaked reference hardly comes alone)
user142019
@R.MartinhoFernandes Are those pop-ups only in debug mode?
@Zoidberg'-- ... sigh. It's InDesign. Adobe(R) InDesign(TM) I wager
@Zoidberg'-- Yes, I use a debug build of InDesign. Can't debug in the release build.
user142019
Neat.
user142019
15:22
Objective-C has zombie objects in debug mode. When you release an object once too often, it becomes an instance of NSZombie and you can track those. In release mode it's just UB. :P
In this new machine it isn't slow as fuck anymore.
InDesign. Adobe(R) InDesign(TM): Your apple fanboyism instincts should tell you that in Release builds it will not bother the user, unless he/she opted in and then it comes up with shiny pink/green wizards that guide the user into mailing their personalia and private data to a bug reporting service. All the while the user is overwhelmed with warm fuzzy feelings about customer care.
user142019
Aarrggh stupid manual.
user142019
Anyway, time to go. I'll speak when I'm in the train.
@Zoidberg'-- To whom, we'll be left forever wondering
15:28
hmm
I have linked to 60 libs, it appears
more than I'm used to
@DeadMG OMG WIDE IS BLOATED
3
lol
Wide?
Pups, you should have a page with FAQs.
The first Q being "Wide?"
man
why the fuck does LLVM have a class that can stream to std::string but not std::ostream?
I must be hardly the only person that wants to attach their error stream to std::cout.
15:35
> You must have a positive number of text characters selected. Please try again.
randomly stumbled upon this
@R.MartinhoFernandes UX?
That was worf the onebox
@Zeta Woooooaaaaaaaah.
@DeadMG the Wide home page looks fucking ugly.
@R.MartinhoFernandes It still has a home page?
This isn't wide-language at all.. This is... C++!
I've been lied to
@R.MartinhoFernandes: Puppy had the specifications on the same site too, but he removed them :/
oh that shouldn't be there
Oh wait, that's the same as codepuppy.co.uk.
15:42
@Zeta Probably because they were kinda awful.
I'll put them back when I've gotten around to fixing them
@Zeta Oh interesting /cc @DeadMG:
> If the parse fails, val is still in scope and could be used by anybody erroneously
^ are you implying the value could be undefined? Not in CLR
> The principle issue here is that there are only three ways to handle an error.
@DeadMG: Well, I don't remember. All I remember is that I viewed the specifications.
You are wrong, and we told you this countless times before.
Also, "wolfeinstein" - lol
15:44
So I won't rehash the same old things.
@R.MartinhoFernandes By that, what you mean is that you said "Why am I even talking to you about this?"
at which point I decided that you were not worth talking to for a while
@DeadMG And, were you right?
"Why am I even talking to you about this" is a very useful question that goes to the heart of the issue 9/10 times there is a communication breakdown. More people should make a habit of asking this honest question ( /@(.*a(lf|pe)|.*)/, I'm looking at you) :)
@DeadMG Dammit, I remember saying something like that, but now I can't find it.
Well, snow storm today.
It's slightly warm, so it turns into water at some places.
Ah.
Dec 12 at 13:28, by R. Martinho Fernandes
I have no idea why I am discussing this with you.
Anyway, my key point was, and still is this:
Dec 12 at 13:15, by R. Martinho Fernandes
Your whole argument hinges on a crappy interface for tryParse.
15:52
out parameters...
@R.MartinhoFernandes In case you hadn't noticed, I don't really care.
there's no way I'm gonna go looking for any meaning in what you said
@Pubby Try const int &x = s::A; after that, and use x somewhere. Chances are you'll get a linker error. — hvd 2 mins ago
Is that true?
Just misread DATA_COUNT as DATA_CUNT.
@R.MartinhoFernandes What's the explanation?
15:54
@Pubby Something about odr-used and whatnot. I am not really versed in those bits.
Mind you, there is no technical reason for it.
It's just an obsolete idiosyncracy of the standard.
Heh, I don't really care enough to investigate
I suppose that means you can't pass a static const int into a function taking const ref?
That sounds broken to me
one box! I curse you!
15:58
@TonyTheLion looking forward to the season?
@Pubby Nah, that's not right, you can definitely pass one, just as you can pass a const literal.
@TonyTheLion why you lol, 'is serous question
no.
I don't like all this fake xmas tripe.
especially cause I gotta go stand between family and pretend I like having them around

« first day (794 days earlier)      last day (4380 days later) »