« first day (367 days earlier)      last day (4564 days later) » 

5:00 AM
lol
hooray for inconsistency, eh. :)
 
no, it's just that i've done this a few times, so it's no problem for me. but at least some minutes ago, as i understood it, you failed to see how it could be done.
 
not how it could be done, but what would make it any simpler.
 
argh, maybe i should patent it, in the US.
 
and i still don't see it.
 
have you done any Windows API level programming?
 
5:03 AM
yeah, a bit
 
ok then, consider GetMessage apparently retrieving a WM_PAINT from the thread's message queue
that message was never there
it's generated on demand by GetMessage (and PeekMessage), when the "wm_paint" bit is set in the message queue status
and GetMessage will retrieve any number of WM_PAINT messages until that bit is cleared
 
k...with you so far
 
likewise, for keyboard handling, if the keyboard didn't do auto-repeats itself, then GetMessage could have synthesized WM_KEYDOWN and WM_KEYUP. it would simply note that there's a WM_KEYDOWN alone in the queue, with old timestamp.
to do this at application level one just needs to discard (ignore) the real keyboard auto-repeats, which is easy.
 
but doesn't that mean key repeat becomes an app-level thing?
 
as long as Microsoft doesn't fix Windows, yes
and logically also
because while the app is hanging, no auto-repeats are generated
 
5:13 AM
also means each app can (and probably will) do repeats its own way, though
and that you no longer get repeats for free
 
as long as MS doesn't fix Windows, and Apple doesn't fix OS X, and so on, yes
but you do get repeats for free
i do not understand how you can think otherwise
 
because the keyboard wouldn't be doing the repeats anymore -- the os would. and from what i'm hearing, the os would pass that job off to the app
 
5:30 AM
hi any body can help me regarding c question
 
probably, assuming chat works
 
@AlfPSteinbach hi can u help me in C question?
i have one string , string str = "101010" , i want to store this value in any variable in bits so we save some memory . because we save this string in bits insted of bytes
@AlfPSteinbach i have one string , string str = "101010" , i want to store this value in any variable in bits so we save some memory . because we save this string in bits insted of bytes
 
english plx
 
@cHao i have one string , string str = "101010" , i want to store this value in any variable in bits so we save some memory . because we save this string in bits insted of bytes
 
@saurabh_k try that again, comprehensibly
you want to store "101010" as, say, 42?
 
cpx
5:37 AM
I had a dream where i'm trying to find a matching overloaded function template. amazing lol
 
@saurabh_k if you want to convert easily from a string of "101010" to integer (say), you can use a std::bitset. as I recall it has a constructor taking a string. and some method that gives you the integer value.
@saurabh_k oh sorry i answered as if you were asking about C++. in the C language, you'll have to code up a loop, computing the integer value.
 
in C, there probably wouldn't be a string str = "101010". i'm thinking he just doesn't know what language he's coding in. :)
 
Just use 0x18A92
Or something :)
You don't have binary literals, but you can use array literals to emulate them.
 
@AlfPSteinbach thanx a lot so first of all i have to convert that binary value to decimal and store that decimal value to any variable so i can reduce memory size
@cHao dear i have a character pointer that points to this type string
 
@saurabh_k huh
 
5:52 AM
@cHao i want to use this code in huffman encoding and decoding after encoding i want to store that binary types value in bits
 
@saurabh_k quit overcomplicating things. you are not handling that much data.
 
@AlfPSteinbach but integer also take 4 bytes in GCC so may b we have to take int16 to store this value?? i am right?
@AlfPSteinbach i have to implemented Huffman Encoding and Decoding Algo
 
Hmm.. @saurabhk wouldn't you be better off asking a proper question on the SO site?
 
@StackedCrooked ok i will
@AlfPSteinbach there is no other way to handle this things ?? without convert to decimal?
 
what were you expecting?
fairy dust?
everything's a number. you're just getting rid of all the 0011000's.
 
6:05 AM
@saurabh_k there is no decimal representation involved, so i'm not sure what you mean. using std::bitset is an easy way to convert to integer. however, if your strings can be arbitrary length (arbitrary number of zeroes and ones) then you'd better use a std::vector<bool> or something. std::vector<bool> is optimized to use just 1 bit per value.
 
@AlfPSteinbach thanx a lot but see, i have different different string array which contains all binary type strings only 0 and 1. but they all occupy 1 bye for each 1 and 0 so i want to convert them in to bits and save to different array which contains only bits. for example str[50] = "1001" here str [50] occupy 4 bytes but i want to store this 1001 string in bits and optimized to 1 bye. my main goal is this... And one thing std::vector<bool> and std::bitset is for C or C++?? i want this thing in C..
 
anything that starts with "std::" is for c++, not c
does c even officially have bool yet?
i forget
 
struct {
    char c;
    int n[1000];
};
^ Array is at non-aligned position. Does this mean reading the values from the array will be slower?
 
the compiler will insert padding
 
@AlfPSteinbach Padding between the character and the int array?
 
6:15 AM
yep
 
it is required to store c and n in that order, but will just add e.g. 3 bytes between them
 
Interesting.
Is this C++ spec or compiler behavior?
 
@cHao Yes, although you have to include <stdbool.h> for that to be in effect.
 
@AlfPSteinbach u got my question na? so std :: we cant use because its for C++..:(
 
6:26 AM
@StackedCrooked you seem to really like that album
 
I like most albums by Yuki Kajiura.
Fav album would probably be "Le Portrait de Petit Cossette". But I've heard it a little too much, unfortunately :D
 
@AlfPSteinbach please rply me
 
@user654842 yes
 
Ok, I'll stop spamming now.
 
@AlfPSteinbach so tell me pls
 
6:40 AM
@user654842 think about this: at best you're talking about a factor of 8 saved, for very small amount of data. the complication isn't worth it. however, if it is a requirement of homework assignment, then I suggest starting with simple exercises converting an integer to binary representation in string, and vice versa. Like, define a function foo such that foo(42) returns a pointer to malloc-ed string "101010".
 
@AlfPSteinbach ok i will thanx a lot for help
 
6:55 AM
'http://www.youtube.com/watch?v=y5WIXnYkWTY
 
^ @vivek clickable link paste
 
ohh..
I was reading the faq for that :)
thanx
 
pretty awesome mountains
 
yes, suits the song
 
 
1 hour later…
8:20 AM
hi
 
What's up?
 
Where have the newbie hints gone?
 
Oh, probably expired again.
If you are new here, please read the newbie hints. Thank you.
15
 
8:50 AM
Hi
Does any of you have an well-written article explaining how to implement the Rapid Spanning Tree Protocol ?
 
never heard of it :)
 
It is a protocol designed to prevent loops in bridge-connected networks.
I'm currently reading the RFC but it is a real pain...
 
hi all
anyone know a good tool for performance analysis with GCC 4.7 on Mac OS?
Shark really just can't handle C++11
 
Valgrind if that's available.
If it is it's not tied to GCC but to the file format.
 
9:06 AM
I thought Valgrind was for correctness analysis, not performance, because it interprets the object code
 
@Potatoswatter it's a suite of different tools, some of which relate to performance :)
 
I'm looking now at Callgrind... is there another component to look at?
 
There's at least another one related to memory performance but most likely that's not useful for your application.
Or maybe it's cache use. Not sure.
There's Cachegrind indeed. Try Callgrind first.
 
Yeah, Cachegrind apparently. I should really use it either way.
 
Confusingly kcachegrind is a good visualizer tool that works with callgrind...
 
9:20 AM
@Potatoswatter You can use callgrind and then vizualize the results using kcachegrind. On Mac OS X I use a native callgrind build and use VirtualBox Linux to create the visualized output with kcachegrind. (Native kcachegrind on Mac doesn't work well, I don't remember which issues I had exactly.)
@Potatoswatter Btw, on Mac you can use Shark as well.
 
@StackedCrooked Shark chokes on my program, which is heavy on C++11.
I might just start developing entirely in a Linux VM, since the OS X binary issues will only get worse, and XCode sucks.
 
hi
 
Hello
 
sup
 
same old same old
 
9:28 AM
touche
 
touche? what's up with u?
 
same old same old
 
9:47 AM
How're you both (still suffering from cold @DeadMG ? ) ?
 
yeah, but it's not kicking my head in as much as it was
 
Been better. Actually I've moved to Southeast Asia for a few months to try and save money. So my understanding is MG and me both have some weird accommodations.
 
^ A haunted football stadion in Norway
:)
 
@AlfPSteinbach Image not found !
 
oh i fix
 
9:51 AM
@DeadMG try some tea ? :D
 
^ accessible image
^ That's from the middle of the Carina nebula
These faces etc., they like to hide in clouds
 
What faces?
 
Well right southwest of text "Pernille" there is a kind of doll face. it helps to have seen the doll on Norwegian television, of course.
 
Oh, I think I see them now.
 
9:58 AM
The text "Pernille" is in her hair, her left side of head (our right)
Only the child has a full body... I don't know if that's visible.
@Potatoswatter he he, it has a name... :-)
(I mean "stadium" not "stadion" -- my latin sucks)
 
10:34 AM
 
lol
 
10:53 AM
@AlfPSteinbach Did you plan a chapter 2 for your pointer tutorial?
 
11:06 AM
well the problem was the pointer tutorial got too big, it didn't fit in with general C++ tutorial
 
I hate Mondays so much I hate Tuesdays, too.
 
@AlfPSteinbach With 170 pages you probably hold the official record for the longest C++ pointer tutorial. :)
 
probably a book? and publish it in wikibooks :)
 
Ugh, wikitext.
 
11:22 AM
 
12:05 PM
Hi, I'm confused what's the difference between a File descriptor and pointer in C?
For example `FILE * fp = fopen("filename.txt","w+") ;` Does that actually create a file object and returns the pointer to the object?
Apparently FILE is a wrapper....that holds the file descriptor...
Interesting...must be sleeping
 
hi
 
hi
@DeadMG did you see my ?
 
it's a C question
i saw that and then stopped reading
 
Ah right lol
 
FILE is a struct
I think
 
12:15 PM
so fopen creates a struct
 
yes
 
You're just supposed to treat a FILE* as an opaque handle. The system might just treat the address stored in the pointer as a unique identifier which can be used to look up the file information in the system's own data structures
 
opaque?
 
yeah, "can't see inside"
 
see inside what, the struct?
 
12:21 PM
he means that it could point to any type, but it doesn't matter what the type is
 
the pointer to the struct. I haven't looked at how FILE is actually defined, but it need not contain anything
A FILE* doesn't even have to point to an allocated FILE struct. It might just be a unique integer key casted into a pointer value
that's how Windows' handles work
To the type system they're pointers, but they don't point to anything, and you can't meaningfully dereference them. They're just unique keys that the OS can use to look up data in its internal data structures
 
windows handles aren't really pointers?
 
mmn, ok. Thanks..
 
There's no reason for them to be. They don't point to anything in your own process' address space. They identify abstract/system-level resources. If you had a pointer to the actual data structure associated with an open file, for example, then that would allow you to overwrite it and corrupt it. No one wants that
so instead you get something that looks like a pointer, but which doesn't really point to anything
 
That's interesting
 
12:27 PM
I believe handles are something like struct HANDLE { void * actualPtr; };. But the API only exposes a forward declaration to the HANDLE struct so you can't access the real pointer.
 
no
HANDLEs don't even point to objects in our address space
they are an index into an array of kernel-mode pointers
 
@StackedCrooked It's defined as typedef PVOID HANDLE;
The void pointer is not a real pointer.
 
or struct {int unused;};, depending on macros and things
 
@jalf How come it works when you dereference it
 
@LewsTherin It doesn't.
 
12:31 PM
You cannot dereference a HANDLE.
Because it's not a valid pointer.
 
you cannot de-ref a HANDLE or a FILE* or anything like that
 
@LewsTherin for the same reason it sometimes appears to work if you create an uninitialized pointer and dereference it
 
I'd be amazed if it even compiled
 
is FILE* defined as a true handle? Or is it implementation specific?
 
unless you did something silly like FILE& ref = *fp;
 
12:33 PM
@DeadMG Why shouldn't it compile when you deref a FILE*? As far as the type system is concerned, it is a pointer
 
hold on let me check how to read a file
 
it just won't do anything sane
 
because a FILE is an incomplete type
 
ah, true
 
mmmn you are right, we don't actually use it directly
 
12:35 PM
you can't do FILE f = *fp;
or anything like that
and HANDLEs are void pointers according to the type system, so you can't de-reference them at all
 
How does fread figure out the correct address then
or fgets
 
meh
 
implementation magic
they're allowed to know what's under the covers
and you're not
that's the whole point of encapsulation and interfaces
 
The standard library has access to the definition of FILE. You only get a declaration.
 
12:38 PM
@RMartinhoFernandes but depending on the implementation, they might not need the definition.
 
yeah lol that's true not my buiswax or beeswax? :P
 
the library could simply contain something like a std::map<FILE*, ActualFileData> internally
 
@jalf Yes, the address can be significant.
It's explicitly stated that a copy of a FILE object (I wonder how you could obtain one) cannot stand for the original.
 
there's an fcopy, I think
 
I don't remember that.
 
12:42 PM
writing up my massive letter of complaint about my university now
 
cool
 
You cannot know its size, so even in C you can't memcpy around it.
 
who are you sending it to?
@RMartinhoFernandes sure can, just come up with a reasonable upper bound estimate. I bet it's less than 2MB, so memcpy'ing 2MB of data starting with its start address is sure to get the sucker ;)
 
the university
and if they decide against me, which is quite ridiculous, there are independent complaints procedures
the thing is, when you start listing everything, then it's actually quite insane and obviously going to go wrong.
like
"Oh hey, we won't release your results, so if there's a problem, you can't sort it out, because we won't tell you about it! Also, we won't release your results because there's a problem with your finance, but the finance office can't sort it out! Also, the only guy who can isn't in the office. No, we won't leave him a message."
 
-10
Q: Need help of experts. Flash on Windows Phone 7 by my own hands. Flash internals

Ai_boyHeres the deal. I tired to wait Flash on Windows Phone 7 so i desided to create my own flash player for this phone. If anybody can help me and give some info about Flash, how it works (iternals), how to create one, any advices about codes, audio, video ect. I can promise two things - this progr...

> I have read Moonlight source from begining to the end.
 
12:53 PM
damn
my complaint letter is starting to look more like I'm writing a lawsuit
:P
 
@RMartinhoFernandes I read Moonlight too. Didn't have a very interesting plot.
 
Er, is that one of those silly vampire stories?
 
No, that's Silverlight. Moonlight is about killer penguins.
 
It's about a dude who does a job without paying his taxes.
 
WTF are you talking about?
 
12:57 PM
lool
 
Isn't that what "moonlighting" means?
 
sbi
@StackedCrooked No. "Moonlighting" is the job of that guy who lights the moon every night (unless it's cloudy). I dunno whether he pays his income tax, though.
 
Oops, apparently it simply means having a second job.
 
Moonlighting is an American television series that aired on ABC from March 3, 1985, to May 14, 1989.
 
@sbi That makes sense.
 
1:00 PM
@sbi I don't think Sol pays taxes.
 
sbi
@RMartinhoFernandes Sol? Is that the guy? I never met him.
 
I heard she's hot.
 
1:12 PM
hmmmm
you guys want to view my complaint? I want to make sure there are no obvious mistakes
 
"want to" or "willing to"? Reading complaints isn't exactly my idea of a fun time, but I don't mind doing it to help you spot mistakes
 
works for me
the financial cost is a lot, plus the rest, so it's a lot of money for me
 
You could ask reddit for advice.
 
it's only three pages (only?) long
 
looks fine to me
 
1:21 PM
awesome
all of my family members have Law degrees, or have experience working in legal fields, so I'm sending it to them
and the Student's Union people as well
 
yeah, sounds sensible
 
then it's off to the University
in hope of receiving a nice large cheque to compensate me for how incredibly incompetent they are
 
heh
somehow I don't think it'll be that easy ;)
 
me neither
but it would be nice
 
the degree of sloppyness at an organization is usually directly proportional to the amount of effort they're willing to put into fighting against complaints
 
1:30 PM
that's true
 
@DeadMG convenient family
 
however, there's an Ombudsman for Universities
and those guys do not take bullshit
@StackedCrooked It kind of is, actually. My father works as an Ombudsman for the financial industry. My mother worked for Trading Standards. My sister just graduated from a top university, doing Law.
uh, Ombudsmen are like, mini-judges that specialize in small areas, they exist to hand down legal judgements and be cheaper than a full court
and Trading Standards is a consumer complaints thing about e.g. buying products and they break in 1second
 
there is already a visible comment with (abbreviated) similar content
saying his answer was wrong
I voted both comments, fyi
 
Oh, yes, I had voted Björn's comment as well. But the OP accepted Björn's answer and then changed to this bad one. That's why I made my comment.
 
1:44 PM
he changed his answer
 
1:55 PM
I'm half-way through to Epic.
 
Does the line stack.Delete(item) make any sense in C++? Is there some stack that allows directly removing an object?
Because otherwise this algorithms book is full of shit
 
item could refer to the item on the top of the stack
 
That algorithms book looks full of shit.
 
there's nothing at all wrong with stacks allowing access to items in the middle
 
@DeadMG it does specifically stack.Delete(p) and stack.Delete(q)
 
1:58 PM
but erasing them is quite another story
then it just becomes an array
 
Exactly, wtf. Dropping this class now.
 
@robjb That doesn't mean that p and q aren't the top of the stack now
 
If it's a function that only works when you pass the top of the stack, it's a silly interface.
 
@DeadMG True but in this case I don't think they're guaranteed to be.
 
stack.Pop()
 
1:59 PM
Lol. throw std::runtime_exception("No, try again, with a different item.");.
 
However, the mechanism of the algorithm is to keep looping until the stack is empty, so I'm not sure what's popped really matters.
 
silly interface, sure
 

« first day (367 days earlier)      last day (4564 days later) »