« first day (731 days earlier)      last day (4234 days later) » 

Weirdest question of the day:
0
Q: Single query to win32 api that always returns same value

Joao MendesinoI am looking for a win32api call, that will always return the same value, preferably a value viewable as a string, but other types are ok also. It must return the same value whether executed from Windows XP SP2 in Spanish or Windows 7 in English. I couldn't find any, and was hoping to get some he...

 
@Insilico just got wierder
 
@MooingDuck Just saw that comment.
> I'm trying to hide strings in a C++ application by finding a constant variable from the API that will be equal across XP/7 & different languages, to serve as the base of the encryption.
What is this I don't even...
 
@Insilico he's trying to salt an encryption algorithm with a salt that's in the OS rather than the program so a hacker can't find it
(I think that's the right word, I know you salt some sorts of things, does that apply here correctly?)
 
@MooingDuck But wouldn't it be trivial for said hacker to find what the salt is?
(ignoring the fact that salts doesn't need to be private knowledge anyway)
 
12:27 AM
@Insilico I'm going to go on a limb and assume an average hacker could easily break the whole encryption this guy is designing. Such as xoring the data with the "mystery number"
 
It's one of those questions that make you ask "WTF are you doing?!"
@MooingDuck I'm going to assume the OP doesn't know what a one-time pad is. :-P
 
Actually, I'm going to posit that he is doing an XOR "encryption". (or ROT)
 
security by obscurity
 
Is it even possible to really "hide" strings in an exe? I mean if it runs I can extract the memory of it myself.
 
let's say that when it runs it provides a sim of sand falling, where at one point the colors of the grains form a string of letters, just sort of randomly appearing and then disappearing again
 
12:52 AM
wow this room suddenly got quiet
 
1:10 AM
Yeah, most regulars are Europeans, so it's bound to happen.
 
Viva Europa
 
@Rapptz It's a bit cold there. And it lacks a suitable atmosphere.
 
I cannot sleep.
 
@EtiennedeMartel You live in Canada and think Europe is cold?
 
Europa (Jupiter II), is the sixth closest moon of the planet Jupiter, and the smallest of its four Galilean satellites, but still one of the largest moons in the Solar system. Europa was discovered in 1610 by Galileo Galilei and possibly independently by Simon Marius around the same time. Progressively more in-depth observation of Europa has occurred over the centuries by Earth-bound telescopes, and by space probe flybys starting in the 1970s. Slightly smaller than Earth's Moon, Europa is primarily made of silicate rock and probably has an iron core. It has a tenuous atmosphere compose...
It's a pun.
 
1:16 AM
Ah I knew you were going to bring in the moon. :(
 
Lang leven Nederland! Fixed that topic for you.
@EtiennedeMartel For some reason I read that as Europa (moron).
I’m in the mood to kill belittle somebody.
 
@daknøk Go ahead. I'm tired and enjoying a glass of wine. See if you can pierce my aura of calm!
 
Wine is terrible and you drink it therefore you are terrible.
 
@daknøk I'm sure you can do better than that!
 
I can, but I’m afraid some morons won’t notice the context and will flag me to death.
And Dutch swearwords are considered extremely offensive by many. Especially when translated.
 
1:22 AM
@daknøk More likely moon you, which I'll admit might ruin the mood. Get mooned by an attractive enough woman, and suddenly you're too happy to belittle people.
@daknøk Oh, go ahead -- couldn't be worse than Dutch food!
 
Bacon is much better than Dutch food.
 
Oops -- wife calling. I have to dilute my wine with supper.
Later, all.
 
Dutch swearwords translated? “Cancer sufferer” comes to mind.
@JerryCoffin Später.
Dutch profanity can be divided into several categories. Often, the words used in profanity are based around various names for diseases. In many cases, these words have evolved into slang, and many euphemisms for diseases are in common use. Additionally, a substantial number of curse words in the Dutch language are references to sexual acts, genitalia, or bodily functions. Religious curse words also make up a considerable part of the Dutch profanity vocabulary. Aside from these categories, the Dutch language has many words that are only used to describe animals; these words are insulting w...
^ :D
 
2:11 AM
good evening :)
 
std::partial_sum y u no support a proper accumulator type??
@ITNinja good morning
 
2:26 AM
@Potatoswatter If I had to guess, I'd say it was probably a result of being in <numeric> instead of <algorithm>, so it was seen primarily as having a fairly specific, restricted use.
 
@JerryCoffin Actually it's the other way around. It uses the "wrong" accumulator type because an OutputIterator provides no information about underlying types so the InputIterator argument is used as a fallback.
Numerically, the correct approach would be to do everything and anything to avoid overflow.
Which is why it's numerically useless… I'm writing a numeric program now and can't use it because it would overflow every time.
It should still support a way to work around this broken default behavior, though…
 
 
4 hours later…
6:08 AM
@EtiennedeMartel it's real tempting to respond to each of them just calling them idiotic twats
 
The ice is finally broken.
 
@Mysticial huh?
 
4 hours
 
Alright, I'm never going to be unmotivated again.
 
@Mysticial ah right
 
6:20 AM
I made something that plays the Rocky theme as you type, but stops when you stop typing. If that isn't motivation to write an essay or something, I don't know what is.
 
@chris that would get on my tits so fast
 
You should advertise it as doing that, but make it Rickroll the user instead.
But seriously, an audio driver or iTunes hack to silence the music when the keyboard stops would be pretty cool
 
could be a very effective way of training people to type properly and fast
 
The only way to answer the question "Is language X fit for my needs?" is to write a non-trivial project in language X and see for yourself. — FredOverflow 22 secs ago
 
@FredOverflow not so
 
6:33 AM
so so!
 
for the most part yes
but there might be details of a language that clearly mark it out as not suitable for you rneeds
 
@daknøk GIRL
 
for example, if you want to do browser 'stuff' you more or less only have JS as an option
 
What about Dart or TypeScript?
Or Flash? Or Silverlight?
 
Now, the real challenging part is keylogging what they type and deciding whether it's work or other, and only playing the music if it's work :p
 
6:37 AM
well, I guess you could make your life more difficult if you want, but my point is not so much that JS is suitable for browsers, but that something like C++ is not
 
mawning
 
@chris In that case, make it so that when you sing, it writes code for you
 
@sehe that would be my career over
 
7:11 AM
mornin
 
evenin
 
Building your own 8 bit computer, now that sounds like fun!
 
7:28 AM
@FredOverflow Fun like pulling out your own teeth
What's fun is programming one perhaps, but not building one, at least not for me
 
well, the designing one part could be fun, but all that soldering will soon loose its appeal
 
-2
Q: Why does this program keep crashing?

Anirudh SudarshanI am new to C and tried to write a sort program. It however keeps going into an infinite loop and crashes. What might cause this and how do I solve it? #include<stdio.h> #define max 100 inline int fast() { int a=0; char c; while(c<48) { c=getchar(...

 
Garbage in garbage out.
 
hi
 
7:32 AM
hi
 
hi
 
hi
 
combo breaker
 
7:35 AM
@thecoshman (╯°□°)╯︵ ┻━┻
 
@Neil ┬──┬◡ノ(° -°ノ)
that's my job `_¬
 
┻━┻ ︵╰(°□°)╯︵ ┻━┻
 
flip all the tables
 
Need another room owner to bin the last 6 messages and replace it with "hi". :)
 
7:38 AM
lol
 
no!
 
(╯°□°)╯︵ ┻━┻
 
ʕノ•ᴥ•ʔノ ︵ ┻━┻ staaaawwwp it
 
7:41 AM
(╯°□°)╯︵ ┻━┻ STAHP
 
who the fucked starred Rapptz ಠ_ಠ
 
what
 
@Rapptz this does not deserve stars ಠ_ಠ
 
can't say I really care.
 
@Rapptz me neither, but I feel like kicking up a fuss
 
7:54 AM
Hm. I got nothing
 
8:11 AM
Got me some Raspberry Pi ordered, with 512 ram :D
 
I always wondered, why do people get Raspberry Pi? Is it because it's cheap?
I thought it was mostly for people who couldn't afford a computer and wanted to do stuff with it, like develop and stuff.
 
it's VERY cheap, and can just about run as a media centre silently
it is also a really good candidate for a robotics platform, much like Arduino
though sadly it's not quite as cheap when you don't live in the US and need to use more local retailers
I wonder how well it work for me to use as a SSH server... so I can log into from work and do fun stuff...
 
@thecoshman very cheap being?
 
@sehe supposedly $35 which is currently around €25, but I just got one for £35 about €40
@Rapptz hmm
 
8:19 AM
@Rapptz 512 mb?
 
well, the 512 mb is supposed to cost the same
 
512 mb is supposedly $35.
 
maybe $25 is for one of older models
 
> The downside of this suggestion for us is that we’re very attached to $35 as our highest price point. With this in mind, we’re pleased to announce that from today all Model B Raspberry Pis will ship with 512MB of RAM as standard
I'm not sure what this implies actually lol.
 
the 512 upgrade is only on one of the model B, which is a little bit more advanced then the model A
not sure if they even make the model A any more
 
8:21 AM
Yeah, Model A is $25, Model B is $35 per the FAQ.
 
not sure what the difference is, or if the extra ram will really be that much use
 
@thecoshman cough. 640k ought to be enough, right
 
@thecoshman Model A has 128Mb of RAM Model A has been redesigned to have 256Mb RAM, one USB port and no Ethernet (network connection). Model B has 256Mb RAM has 512Mb RAM, 2 USB port and an Ethernet port.
 
but apparently, the cost of the larger ram chips is not really any more then before, so they are not charging more for it
 
There are supposed to be some striked text there but lol formatting
 
8:24 AM
@Rapptz ah right, though IIRC the ehternet port does not have a dedicated chip, so using it requires more work from the CPU
@sehe indeed :D
I wonder how fancy you can take the graphics on the Pi
 
> That is, graphics capabilities are roughly equivalent to Xbox 1 level of performance. Overall real world performance is something like a 300MHz Pentium 2, only with much, much swankier graphics.
I still think it's weird it comes with no case lol. I understand why though.
 
yeah, I think I am going to gheto it, and use a cardboard box :P
I wonder how well @deadcicada can take sexism
 
When I wake up in the morning, I predict that there will be a Java question with a shit-ton of votes.
 
8:39 AM
sigh... outlook is wanked, time to restart
 
@thecoshman I use box-files for my embedded development. I can just lift the lid to see all the flashing lights.
 
Man,
I just arrived at school and I already want to go home.
 
@daknøk You're really hooked on travelling?
 
What do you mean?
 
@daknøk You seem to enjoy the trip to school so much that you straightaway want to travel back.
 
8:45 AM
Now, I enjoy being home more than being at school.
I would rather just teleport than travel by train, but that’s not (yet) possible in practice.
 
8:58 AM
@daknøk "Now" -- ?
Urff. The title
 
Befunge is a stack-based, reflective, esoteric programming language. It differs from conventional languages in that programs are arranged on a two-dimensional grid. "Arrow" instructions direct the control flow to the left, right, up or down, and loops are constructed by sending the control flow in a cycle. It has been described as "a cross between Forth and Lemmings." History The language was originally created by Chris Pressey in 1993 as an attempt to devise a language which is as hard to compile as possible — note that the p command allows for self-modifying code. Nevertheles...
> As stated, the design goal for Befunge was to create a language which was difficult to compile.
 
> I am not an authority on lightning safety. I am a guy who draws pictures on the internet. I like when things catch fire and explode, which means I do not have your best interests in mind. The authorities on lightning safety are the folks at the US National Weather Service What If 16
 
@thecoshman "Hi I'm sexist, and welcome to my pussyless life"
4
 
9:13 AM
Sorry. You'll have to put more effort in such a broad question. This is unanswerable. Hint: look at /proc and /sys filesystems. — sehe 11 secs ago
 
9:34 AM
Strange...
2
A: StackDeck - desktop application written in Qt

Chris SI just spent around 30 minutes mocking up a TweekDeck app I was considering making in WPF and also targeting Silverlight for Windows Mobile 7 - but it looks like you beat me to it. I think TweetDeck is WPF but I might be wrong, but the mockup I came up with is below. My own view is this would be...

 
@MartinJames box-files?
@DeadCicada but I have a cat?
@daknøk it's possible, just not practicle
 
> Dirtying new pages
 
@thecoshman That would be practical, but not very particle
 
this could be interpreted in different ways
if a girls said to you "oh baby, you dirtied my pages" it means something entirely different than if a programming talks about "dirty new pages".
oh my gawd. How do I come up with this crap?
 
@thecoshman Those cardboard boxes with a hinged lid and a spring-clip to hold papers inside.
 
9:41 AM
@TonyTheLion If a girl would say that to me I really wouldn't understand.
 
@MartinJames ah, I know the yokes
 
@kbok your mind isn't dirty enough
 
hmm... I wonder why it didn't one-boxed =\
 
@Abyx you have to remove the other bits like embeded
 
9:47 AM
2
uhm... it works, thanks
 
I think I once saw something like "using foo = bar<int>;" but can't get it right, do you know what it could have been?
 
@thecoshman It's fairly easy to cut notches for network etc. cables with a box-cutter. Also make holes for cable-ties to hold down boards - no nuts, bolts, spacers etc.
 
@MartinJames yeah, think I am going to stick to cardboard box, at least for now. Have one at home that will do the job, assuming it has not been disposed of yet... or whilst the Pi is in it :P
@MichaWiedenmann yes, it means that you can have foo myIntBar; rather then then bar<int> myIntBar which can come in very handy when you are dealing with stupidly long types because of buckets of templates
 
@thecoshman but my code is wrong and I want to find the correct syntax. (At least gcc 4.5.3 doesn't accept it)
 
the alternative is to use typedef
 
9:52 AM
@MichaWiedenmann update you compiler
 
I know about typedefs and use a typedef instead, I just want to learn more C++
 
speaking of which, what version is GCC on now?
 
4.7.2 is the latest.
 
then go read up on 'using'
 
also I looked at the C++11 Draft and could only find namespace names, but not types
 
9:56 AM
IIRC GCC has been supporting using for aliases from 4.7 on.
 
Well in what chapter of the standard/draft are they defined?
 
I wouldn't worry to much about reading the spec, you want to know the practical implications of using 'using'
 
Dunno. You can search for 'alias'.
 
in particular, with regards to type alias
AFAIK the main advantage to 'using' over 'typedef' is that it can be used to alias template calsses
 
It's not as braindead: int typedef const (*foo)[42];
 
10:09 AM
@thecoshman IMO it works just as well as placebo.
 
@thecoshman Homeopathy does work - many peer-reviewed studies done on placebo effect.
 
Has nay of you ever seen this sort of thing before? SFW
strangely enough, placebos can work, even when people know they are 'placebos'
 
Yeah, there's a placebo placebo effect.
 
@DeadCicada It works better than a placebo as a revenue earner for the scumbag water-salesmen.
 
@MartinJames peer-review is void if the peers are equally idiotic
 
10:15 AM
I think you wooshed a bit.
 
@Rapptz huh?
 
@sehe “well”, in Dunglish.
 
bool is_negative(float x) {
    unsigned int *ui = (unsigned int *)&x;
    return (*ui & 0x80000000) != 0;
}
eek
type punning in a fairly dangerous form
not portable
 
It's not just unportable, it's UB.
 
oh in C too?
I got it from the Wikipedia article on type punning
 
10:23 AM
Yes.
 
it violates pointer aliasing rules?
bool is_negative(float x) {
    union {
        unsigned int ui;
        float d;
    } my_union = { .d = x };
    return (my_union.ui & 0x80000000) != 0;
}
 
Right.
 
I guess this is a "better" way of doing the same thing?
 
Yes.
 
but isn't reading from union member that was never initialized UB?
 
10:24 AM
Well, really you want to use whatever FP classification(?) function applies, but if you were to implement it then yes do that.
@TonyTheLion Yes.
 
so how come they get away with it here?
maybe it relies on specific implementations or something
 
Yes. In comparison, aliasing rules are never going to go away. They're too important.
A conforming way is to read whichever bit of whichever byte is the sign btw.
 
I like how the puppy's description of compilers is so biased towards VS
> Present more clear arguments why VC++ debugger is the winner
totally balanced opinions coming from that site
bias aside, I do like how clean and simple his site looks
 
I wonder if he's ever even used GCC or whatever for anything more than 5 mins.
 
probably got to the first problem, and gave up
I find that MS software is designed for a certain type of person who I clearly am not. I get aggravated by more or less every aspect of every bit of MS software, whilst my friend is almost like a fan boy for MS
 
10:40 AM
@thecoshman bias aside, the VC++ debugger is extremely good. Powerful, stable and easy to use
 
@jalf don't give him any slack :P
 
Most of the rest of the IDE can drive me nuts, but the debugger specifically is the best I've seen. And in a whole other league than gdb
 
still, I am some what in the camp of "don't use the debugger"
 
@thecoshman why not
 
@thecoshman Most non-VC++ users are, which kind of proves my point
if the only debugger you have is a pain to use, then you pretty quickly form a habit of not using the debugger
3
 
10:44 AM
well, ideally you code should report what it is doing well enough that you do not need to pull out the debugger. It should log things
 
@thecoshman ideally your code shouldn't have any bugs either
And sometimes, it's nice to have more than a log file
but perhaps just as importantly, with a good debugger, I find it easier to use that than to trawl through the logfile. With a bad debugger, well, a logfile suddenly becomes a lot more essential, but I don't see why it's more "ideal"
 
@thecoshman Meh - you have to have both - a good debugger to remove stuff that never makes it to any logger and good logging to fix teh system problems that never appear until SIT or after delivery.
 
well yes there are going to be times where you need to actually debug code, so far I have yet to actually try non VS debugger
 
I know I'm late to the party, but translationparty.com/#10527595
 
A logger and no debugger is going back to the seventies - printf debugging. No thanks.
 
10:50 AM
@thecoshman gcc doesn't have template aliases AFAICT. clang does
 
oh yeah, I wouldn't want to rely purely on debugger
 
@melak47 meh
 
@MartinJames I find it to be rather painful. However, in certain circumstances you can't do nothing else. Think certain types of threading bugs.
 
@TonyTheLion actually, when I had to debug a race condition, I found the VS debugger more useful. Inserting tracepoints via the debugger was less disruptive in terms of changing the timing than inserting printf calls. :)
but I don't think anyone is claiming that a log file is irrelevant. If nothing else, the debugger can only tell you what's happening in the current execution. The log file can tell you what happened when you ran the program yesterday. :)
 
indeed
 
10:54 AM
but I'd also argue that when you're debugging, it's often information about the current execution that is most important. ;) And, not least, debugging is hard, so I personally want to use every tool at my disposal
so I'm in the "give your debugger a big hug" camp
 
@jalf I completely agree. VS debugger is just wow
 
unless your debugger sucks, in which case you punch it in the face instead
 
@DeadCicada I'm so debugger spoiled :S
 
I don't get many bugs specifically concerning threading. I get plenty the usual kind - forgot to initialise var, bad logic, OBO etc. If I need to trace through three class instances via. member refs, it's a pile easier with a debugger than some nightmare logging call.
@jalf Give it a hug from me - I'm in love!
 
I love how you can explore the memory with VS
 
10:58 AM
@user1567909 Arrays decay. You cannot pass them by value. Pass by reference (see my code), so void sodoku::copy(int (&array1)[9], int (&array2)[9]) sehe 1 min ago
 
I guess it's debugger appreciation day in the lounge... :)
I'd put that in the room title if I could
 
@jalf If only there was more debugger appreciation before many SO questions.
 
@jalf Weren't you room owner?
 
He gave it up for a good cause.
 
How that
 
11:00 AM
room topic changed to Lounge<C++>: It's debugger appreciation day! [c++] [c++11] [c++-faq]
done
@DeadCicada long story.
 
@TonyTheLion I want to know!
 
read the transcript
I can't be arsed to tell that story again.
 
Date pls
 
no idea.
few weeks ago
 
@honk, well, it's a c++ question, right? It is kind of tricky to assume the OP knows not to use memcpy if the element type stops being a POD type. std::copy knows :) — sehe 3 mins ago
 
11:03 AM
Chat search failing, okay, I give up.
workin on ur problemz
 
@DeadCicada Hmm. Always. See
9
Q: Chat search is broken, round III

R. Martinho FernandesNow that I can search for all the times I mentioned in the C++ lounge that chat search sucks, it seems I can't search for something actually useful for our general procrastination, like the link to some neat xkcd 1110 viewer that Mysticial posted yesterday. All I get is the 500 lolcat. I have con...

And related
 
Meta doesn't care
 
sbi
@sehe What are you talking about??
@R.MartinhoFernandes Want moar pix?? :D
 
@sbi It wasn't you who used to post the 'Boobs' lemma?
You need the parentheses. Why don't you just try the code I've given (repeatedly)? — sehe 1 min ago
^ Man this is annoying. Can someone upvote the comment linking to the arrays question?
Perhaps it will draw his attention.
 
sbi
@sehe I don't know about any boobs lemmas. I only know dilemmas. (If that's a bird, then I might know it by its German name, and might have dug out the English for some reason or another, and that might involve boobs. If so, I forgot.
@sehe Done. Where's my cookie?
 
11:16 AM
@sbi Here. I hope you like crumbly cookies with a hint of chocolate and cinnamon
By the way, anything wrong with my answer? I'd think it is mostly correct and helpful. Perhaps I can mention array decay on pass-by-value in the post
 
sbi
@DeadCicada my search showed that there must have been an incident in the (European) night from Sep 10th-11th, that resulted in a long discussion the following (again, European) day, which in turn resulted in this. IIRC, someone fell off the owner list for some reason a little while later, so that @Tony was enthroned again.
@sehe I hadn't looked at the answer. :-/
This is answered in the array FAQ. Voting to close this one. — sbi 51 secs ago
 
@sbi It wasn't overly clear what the issue was at the time of writing
@sbi enthroned. cough
The lion has been put back under the yoke
 
sbi
It's in the array FAQ anyway. Please vote to close this one.
 
@sbi Done
 
now it looks more like machine code, but i wish the microsoft assembler could be a bit less primitive
 
11:27 AM
@sehe ahem
 
Oh well. Let it slide
 
is there a way to make the assembler do arithmetic with extern function addresses, so that it generates thing that can be fixed up by linker?
 
@TonyTheLion Public duty
@Cheersandhth.-Alf Assembly constexpr?
 
sbi
@sehe The lion's the king of us animals, no?
 
11:28 AM
@sehe yes! i want
 
@Cheersandhth.-Alf LEA?
 
sbi
Anyway, I'm back to work. See you!
 
Woah, the ape does work.
 
@Cheersandhth.-Alf I think that's pretty standard, right? You could just do external + 5? Perhaps you need to define a label for that. Anyways, that would be syntax/flavour/assembler dependent.
 
@TonyTheLion well i want this in DD data declaration
 
11:29 AM
@TonyTheLion runtime != load time
 
@sehe i tried, it didn't like that
 
what's making you toy with assembler?
 
@Cheersandhth.-Alf AFAIR fixup records require the OS loader to add the base address to the hardcoded offsets in the binary image. So technically I don't see a reason why you couldn't offset into known static data areas.
 
@TonyTheLion i wanted to illustrate coding in machine code. this is the closest i could think of, just using DB, DW and DD directives (and no assembly symbolic instructions)
but i think the call forwarders are ugly, and also technically unnecessary! if i could just make the assembler Do What I Want
 
11:34 AM
@Cheersandhth.-Alf or just write your own. assembler :)
 
me too. The funny thing was, I didn't even have a computer back then
And I wrote it in Amiga Basic. I never did own an Amiga
 
@Cheersandhth.-Alf you can write a whole .exe file only with db/dw/dd
but what's the point to do such thing?
also you actually don't need a linker to make a program in an assembly language
 
@Cheersandhth.-Alf If you just want an example of how truly horrible such a thing is, why not just disassemble a short app that has been built 'normally'? Some disassemblers you can instruct to output only DB etc - no instruction mnemonics.
 
btw it's kinda strange to use high-level stuff like .code and don't use assembly instructions
 
11:48 AM
@DeadCicada I gave my ownership spot to someone else to get a more even distribution of owners across timezones.
 
@Abyx .code isn't level anything, as i see it. for DOS you had to struggle with segment directives and all that. in flat model it doesn't make sense to do that, so it's not that those directives are "lower level", they're just inappropriate and mostly meaningless except for very special purposes
 
@Cheersandhth.-Alf .code creates a PE section with specific flags
 
@Abyx thanks for trying to help, though. :-)
 

« first day (731 days earlier)      last day (4234 days later) »