« first day (535 days earlier)      last day (4639 days later) » 

00:28
0
A: Do not show console window in release but show in debug

Cheers and hth. - AlfThis is an answer to the second part of the question, “but I can't pass parameters to the program”, i.e. how to obtain the command line arguments in a Visual C++ Windows app. The simplest but also most limited way is to use the arguments of a standard C++ main, int main( int argc, c...

^ I again posted an answer to half of a question, yay!
00:45
posted on April 03, 2012 by Herb Sutter

Referring to C++ AMP, a reader emailed me to ask: Are you going to replace restrict keyword with new C++11 attribute feature [[]] ? No, because restrict is a language feature and [[attributes]] are specifically designed to be ignorable and shouldn’t be used for things having language semantic meaning. During the ISO C++11 process, I [...]

^ Hah, [[noreturn]] is a counter-example. Depending on whether a function is marked as noreturn (via Visual C++ __declspec( noreturn )), code will compile, or not.
@CheersandhthAlf [[noreturn]] doesn't require compilation failure.
Returning from a function marked [[noreturn]] is undefined behaviour.
@RMartinhoFernandes I know. I'm talking about Visual C++ behavior for noreturn. Herb's argument applies: it is not ignorable.
To be fair, I think it should result in compilation failure.
I mean, it's very un-ignorable when it (or its absence) causes a compilation failure.
01:15
posted on April 03, 2012 by Herb Sutter

In the comments on last week’s interview, MichaelTK asked: @Herb: You mentioned two things I don’t fully understand in your talk. 1) Why would C++ be a better choice for very large scale applications than NET/Java? I mean the zero abstraction penalty (which is more a JIT compiler issue and not intrinsically hardwired into C#) [...]

01:49
> The hauling changes have begun. This afternoon there were dwarves running around with bins, bags and barrels, vacuuming up items. Seeing a single dwarf clean up a seed-ridden dining room as a single job is a beautiful thing.
!
02:37
Sounds awesome.
Random question, is new/delete really that discouraged in c++?
@jozefg yes.
can you explain why? in c++ primer, new/delete is introduced and used.
Because it means you're back into manual memory management.
so what would you use instead?
02:48
Smart pointers. std::shared_ptr, std::unique_ptr, container classes, …
The primer is trying to introduce all the operators. You shouldn't be writing bitshifts everywhere, either.
Every explicit new that actually performs allocation should be wrapped in a try … catch ( std::bad_alloc & ). That's a lot of work if you make a habit of it.
ok, but aren't there some situations where new is necessary? like your creating something inside a function and need to access it after the function has returned, this means that it has to go on the heap so shouldn't you use new?
Or, use nothrow_t… but exceptions via nullptr are still a pain.
i had a friend who says everytime he gets a null pointer a small part of his innocence dies
@jozefg It's almost never necessary. Find an object ownership pattern that fits. Really, there's always something.
so its like a goto statement in a way? always there to use but strongly encouraged to be avoided?
02:53
Ah, new is used in the argument to unique_ptr, but that's widely acknowledged now as a hole in C++11.
Exactly. Even std::unique_ptr<T>(new T) is potential leak.
@jozefg goto is far less dangerous than new. C++ has strict rules to prevent goto from corrupting the initialization state of objects.
so how come you hear programmers rant about goto but new is never even mentioned
I guess that's because Dijkstra didn't write a "new considered harmful" paper.
@jozefg goto has been around longer, more are familiar with the danger. goto is ugly more than it is dangerous.
02:55
:)
More seriously, new gets a lot more use than goto.
Yah... and ugly it is. It does, but hopefully once i become more farmiliar with th std lib i can avoid it a bit more
@jozefg That's the spirit!
and theres a lot of it!! that thing is freakin massive and its not the best documented library ive worked with...
as in free online docs
I think en.cppreference.com is pretty good, but its goal is to work as reference not as learning material.
@jozefg The relevant part is the memory library. It's documented in N3242, which is linked from the C++11 Wikipedia page. It's very close to its ancestor, the Boost Smart Pointer Library, boost.org/doc/libs/1_49_0/libs/smart_ptr/smart_ptr.htm
03:01
coolio. is it bad that i kinda miss javadocs? java may have been slow and had a bit too much abstraction but it had javadocs
@jozefg In C++ (and many other languages) we use doxygen. Of course the main problem is remembering to actually use it.
of i get it dox sounds like docs haha... and is that an opensourced?
@jozefg Yeah, it's open source and incredibly well ported, but not part of the language.
ahh so its just considered a very very good practice to install and use it on any projects published?
@jozefg Exactly. It will win users' hearts.
03:08
if my wifi connection wasn't incredibly slow id download it now (curse you airport wifi)
 
1 hour later…
04:19
@RMartinhoFernandes I forget about all that alignas business, but isn't the Align parameter of std::aligned_storage enough for most purposes?
@LucDanton The only advantage of alignas is that it can be specified on a per-instance basis.
That doesn't sound like a common need though.
In this case I was finding the wording of std::aligned_storage somewhat confusing.
-3
Q: Bitwise Operator is it useful?

paxdiablocommented: @minitech, the file formats that store binary information are the sane ones. All that XML rubbish is an insidious plot by harddrive manufacturers to sell more product.

@LucDanton Why?
@RMartinhoFernandes I found the "for some type T" esoteric.
04:34
I guess it's a way of saying "Align shall be a valid alignment".
And since it's a requirement I was wary of producing an incorrect program just because I put some invalid alignment in there.
Facepalm...
0
Q: Java: BigInteger floor and ceil functions

Athanasia NottaI'm trying to implement an RSA attack in Java and I need to compute math operations like floor and ceil to BigInteger variables. As we know math.ceil and math.floor only apply to double variables, do you know any other way I can compute floor and ceil for BigIntegers? Thank you.

I stick to alignof or specific alignment values, in the case of SIMDs.
I'm revisiting (hah) my variant, so it's a pretty innocent max(alignof(T)...) in this case.
Actually, it seems GCC reports the alignment of SIMD vectors correctly, so I can go with alignof always. I have recollection of that not being true, but I'm not entirely certain about it.
I get a feeling I was doing something wrong.
04:49
GCC supports many different SIMD architectures, so there's a large incentive for everything to work as advertised.
The problem is that GCC's SIMD is only for GCC. If I was doing SIMD across different architectures, x86, PowerPC, ARM, then yeah, GCC SIMD is nice
but if I was doing SSE, but I wanted it to be compilable on multiple compilers - Intel SSE intrinsics is the way to go.
__m128 and friends?
Those work fine too.
although I usually #define my own macros to those
If the code I'm writing doesn't use anything too specialized (and are all vertical instructions that would be on every SIMD processor), then I'll #define everything so keep it portable.
05:11
Well… you're pretty well qualified at writing that kind of code.
Well, that's how I do it. I've yet to see any real professional do SIMD. So I can't say whether I'm do it "right" or not.
Though I'd imagine that most professional applications of SIMD don't try to do it portably at all. It's probably for a game or something - so everything can be hardcoded x86 SSE or such.
05:32
after watching pictures of forests in Canada, Germany and Austria. The green mountain ranges of Nepal, Pakistan and China. In short, all the greenery there is in the world, I've started to despise the damned desert I live in. :(
Just tried growing some onions about a week ago. I thought if I water them they might grow. But they shrivelled up and went yellow bec. the damned desert soil-sand thing doesn't have any nutrients.
@IntermediateHacker You do understand the best place to grow plants is in the desert because of the direct sun light?
Just need to learn how to use it to your advantage
Well growing anything in sand is not going to grow that well. So you need to research the amount of sun light and nutrients the plants you want to grow need
Eg.. trip down to the local hardware store, to pick up soil mixture, fortilizer and also shade canopy. Water pipes, and timers ect...
@ScottW by desert, I don't mean I live in a nomad-camp or something. I'd die in the desert too. I am currently surviving in my air-conditioned apartment. :D
@Chad wouldn't that be terraforming, rather than gardening?
@IntermediateHacker No that is gardening
05:38
Terraforming (literally, "Earth-shaping") of a planet, moon, or other body is the hypothetical process of deliberately modifying its atmosphere, temperature, surface topography or ecology to be similar to the biosphere of Earth, in order to make it habitable by humans. The term is sometimes used more generally as a synonym for planetary engineering, although some consider this more general usage an error. The concept of terraforming developed from both science fiction and actual science. The term was coined by Jack Williamson in a science-fiction story ("Collision Orbit") published durin...
simple, hydroponics
@ScottW damn, I'm jealous. :(
@IntermediateHacker Unless you're going to Terraform the planet, then I can saftly say its gardening/farming
Yeah, the moon doesn't have enough mass to hold an atmosphere against the solar wind... :(
@Mysticial Actually it doesn't have unuf magnetic field to do that.
05:40
@Chad both actually
@Mysticial Not really, depends
@ScottW well, I haven't ever actually been in the cold, so I wouldn't know. Is it uncomfortable?
@ScottW I think its better than sweating in a bus on a 105 degree summer day :)
It's more than just charged particles hitting you
the magnetic field will deflect charge particles, but you still need enough mass to hold in your atmosphere
*I think
@Hoxieboy dude, most buses are air-conditioned. unless you live in the 1960s.
05:41
@IntermediateHacker I'd like to see an air conditioned school bus :)
@IntermediateHacker Unless you live in Vietnam
@Chad Vietnam is still in the 1960s? Did it fall in a time-warp or something?
@IntermediateHacker I think it still is ;)
lol a bit drafty?
@ScottW woah. People start wearing jackets here if it's below 20 degrees C. I bet the Arabs would die at 5 degrees.
05:43
terraforming Mars... sure
it has more mass, and is further from the sun
20 more seconds -.-
holy shit that would be amazing but sadly no
Nah, depends on how fast you're moving. :P
20 seconds left to learn of the 7 minute long dwarf fortress theme on my guitar lolz, its the hardest 20 seconds of learning I have ever experienced
It takes light more than 20 seconds to reach Mars from Earth - even at closest approach.
> Before you marry a person you should first make them use a computer with slow Internet to see who they truly are.
2
^ wise advice.
05:51
lol
The one that steals your neighbors wifi :)
06:30
My head is spinning, I think I coded too hard. That or I need food badly.
-3
Q: "Programming" a Batch file, IF statements inside IF statements?

IntermediateHackercommented: _Programming_ a Batch file Is this sarcasm? If you call batch files programming then my 9-year old sis is a professional.

@IntermediateHacker Does your sister program make batch files for a living? That's child labour, to begin with, and general molest because it involves batch files
@ScottW I'm in the process of achieving that.
@Mysticial Last time I checked every game that's issued these days runs on Wii, PS2, Xbox, and a variety of phones. Oh, and on Windows PCs
@sehe I guess that makes it a lot more complicated then. :-P
that's what I was thinking
4 hours ago, by Potatoswatter
@jozefg goto has been around longer, more are familiar with the danger. goto is ugly more than it is dangerous.
wow. You have 'shades of lazy'. I have reached plateau
When I was about 22
@ScottW Yup. In a good way, I like to think
07:13
oh wow wtf...
I just spend about 10 min. trying to figure out what this didn't compile:
int *x;
new (x) int();
It should compile just fine :|.
error C2660: 'operator new' : function does not take 2 arguments
It needed <new.h>...
<new> actually.
both works
<new.h> is specific to your implementation and/or system.
> fatal error: new.h: No such file or directory
07:17
ah, yeah, you're right...
MS extension
What is really dumb is that when I wrote my test case I added the #include <new> as a matter of fact, just like I added a main.
07:41
@ScottW I have waves of productivity and inspiration. Regardless, my attitude is lazy: if I can do it without extra work, I'll do that
7
A: Using "template" and "typename" disambiguators when they are not needed

John CalsbeekIt's valid in conforming C++03/C++11 compilers, for some definition of "valid." C++03 ISO/IEC 14882:2003 §14.2.5: [ Note: just as is the case with the typename prefix, the template prefix is allowed in cases where it is not strictly necessary; i.e., when the expression on the left of the -&g...

see comments
oh boy, long time no see. Morning all
morning
where you been?
@JohannesSchaublitb Can I ask you a few quick questions regarding aliasing? I'm reimplementing a variant<T...>.
@thecoshman ohai
Gotta love this one:
-3
Q: Hello damir about Time Recognition from Analog Clock

Magnus Johanssoncommented: Dude, SO is not an IM system, nor an email client.

07:54
I was on a course last week, and had yesterday booked off. I was lovely and relaxed... that lasted about five minutes ¬_¬
wow, he wants the source code for .NET
does that even make sense?
@thecoshman Of course it does
@sehe is it not sort of the same as asking for source code to openGL
08:19
@sehe she doesn't make batch files for a living lol. She just likes making them to fool me. You know, she makes one containing the shut-down command and renames it as 'play.bat' and puts it on the desktop and then I open it and the PC shuts down and then I cuss' her and she laughs. :(
@IntermediateHacker you mean... you run random .bat files on your desktop? you deserve worse then a shut down
@thecoshman curiosity kills the cat. I open them bec. I'm curious.
she once made one with an mkdir loop. I spent the next half hour deleting the millions of folders created on the desktop. :(
@IntermediateHacker or, right click -> edit
...I'm an idiot.
@IntermediateHacker yes, yes you are
if I where her, I would do one that formats you drive, just to make you learn
08:24
good thing she doesn't know how to do that.
or at least, I think she doesn't know. Maybe she's just saving it as a secret weapon.
pain is just a few clicks away, for you
curse these dangerous batch file commands.
they should require a admin password, like in Linux.
fairly sure that a) you would just enter your password anyway and b) you can probably find a away to make it run with out user intervention
guess no authentication or passwords can save you if you're a hopeless idiot. :'(
@IntermediateHacker yeah, your screwed
and for the record, I have nothing against you, but you run random bat files that appear on your desktop
I kind of think we should ban you from computers, or possibly... yes, this will work. Hook the case speaker to a 'mild' electric shock system, and then just leave bat files all over you computer that call a system beep, you should learn fast enough
08:34
lol.
though I'm not that big of an idiot. I usually run the batch files I know my sis created to make her think her evil plan worked. This will make her not lose interest in batch files and other scripts and eventually pave the way to making her a programmer.
@ScottW ***physics?
@IntermediateHacker or give her something worthwhile to do with her time?
well, it could just be some C programmer wanting to do 3D arrays...
link!
wait...
I don't see how any one comes to the conclusion that that is a good way to write code...
I certainly hope not
08:49
seems to be all gonna sleep
@ScottW woah, the second time this question is posted here
must be something about it
actually looked through that code, sweet lord is that a vomit of bad code
so yeah, last week, I learnt perl
not sure if I will ever use it, but at least I know it
yeah, perl is actually fairly simple, just very cryptic
I especially love the $_ is some random magic variable that floats around unseen
lol Perl
I don't think I want to learn Perl
I would not advise trying on your own
I think that main objective when developing perl was to make it as obsuficated as possible
09:03
mawnin nubbins
noobsical
mawnin puppy
woof woof
what you doing today?
@TonyTheLion as little as possible :P
09:09
writing Lua scripts and bindings, mostly
script ALL the things!
nah
just the UI atm
ALL the things >_<
what you using for UI any ways?
09:16
I'm using something for UI?
is that not what you just said?
yes, I'm writing scripts to do my UI
your statement implies that I have some external UI-centric library which I am using
which I do not
that was what I was asking :P
so it's your own UI code?
yep
hard to find a pre-built library that will play nice with your hardware rendering and existing operating system abstraction
and doesn't consist of 999999 Singletons
@thecoshman Ow man, don't you love how user cough friendly they made Windows:
> if you omit the double quotes, you need to make sure that 'Save as type' is set to 'All Files', otherwise notepad will append the .txt extension.
Obvious. That
09:19
seriously, what the fuck is it with UI libraries and Singletons and XYZManagers?
hmmm... looks like I will make my own UI lib after all
the plan I had in my head made no use of singletons of factories
eh, I'm not toooo bothered by factories
although I do think that their use should be limited
well... maybe a factories of sorts, just that the UI engine can keep track of what you make
it's mostly the Singletons and the Managers
mostly just UIElement UIElement.make(UIElement::type)
probably some sort of smart pointer there
09:22
uh
why UIElement::type?
I meant, passing in a ENUM value, so "radio button" "text area" "tab group" etc.
yeah
why the hell would you do that?
what's wrong with just MakeRadioButton, MakeTextArea
I've only had vague thoughts about this man :P
lol
few things I have thought about, is that UIElements will be stored in a tiered fashion, and it will be awesome!
will probably render it in a sort of sprite sheet fashion, making use of PNG files so you can have alpha, every one loves alpha :D
09:26
@thecoshman ?? You want a UI framework to make fossils?
@sehe you lost me :S
sbi
sbi
@IntermediateHacker I like that a lot!
it will also be done in openGL
@DeadMG it consists of 1000003 singletons, because a prime number is more singleton than nonprime
morning @sbi
09:28
a UI framework that uses files? PNG files?
That **is** awesome.
For specific values of awesome
sbi
sbi
@thecoshman Hi.
@sehe oh right :P well, I'm not sure how else to make it so that it is easy to change the look of the UI
@ScottW Start a room.
@ScottW Just keep on reading this. You'll get there
you got any suggestions @sehe
@thecoshman For what? Create PNGs with alphas? Cairo, imagemagick, gd, whatnot. What do you need?
I got the impression you wanted an interactive UI framework
Which is why your remark on 'PNG files for sprite layers' nearly made my sip of coffee exit via my nose, to put it more vividly
09:48
I was thinking I would use PNG to store texture data, and things like slides would use part of the texture to draw them self... put perhaps I have overlooked somethnig
sbi
sbi
My admins just informed me that, since they are currently on a campaign to "go clean", they want me to switch my MSDN-licensed Win7/64 Ultimate to an officially bought license. I support that. However, the company only bought Win7/54 Pro. Ok, so that is fine with me, too, I don't think I really need Ultimate. However, one cannot officially downgrade Ultimate to Pro, so we had to hack the registry. Sigh. This is also fine with me, also it's a bit of a nuisance.
However, the setup just spent 25mins analyzing my machine's compatibility, only to come up with the message that I need to reboot first. Ok, this is fine, too. Grinds, teeth. However, there's about a dozen updates waiting for me. Well, I had to install them anyway, sooner or later, so I suppose I'll survive this. However, updates just died with not even 50% of the updates installed, so I'll have to rebooot and do it again. FFS! Well, this starts to be less Ok at this point.
However, before I can do that, I'll first have to attend this meeting... IOW, I suppose it will be afternoon until I will be able to do any actual work. Damn. Fuck.
Rebooting.
first windows world problems
Ell
Ell
hi guys
Haha I always install update asap
good for you
@sbi What a waste of time, lol
10:17
any one up for some network security theory?
:(
i have a quick algorithm question..
i have a small subset of items
i have an iterative loop going
they are randomly mixed items*
i need to find latest item (has time value for each), and remove the older ones.
so you want to find one item out of the set?
yeah.. one with latest time value
if they are in a random mix, you cannot do any better than linear probe
yeah.. there's a small set of items
10:23
assume the first one is the one you want. Loop through all of them, starting with the second. if this one has a lower value, set this as the one you want. keep going until you have checked them all. You will be left with the one you want in your holder
with another subset of items
i am running a loop on the larger set
if I understand O notation, it's an O(n) problem
is it an 1D array of data?
or is it something like a map?
I love it, you try to help, and they fuck off
i see
it's obvious it's O(n), i am trying my best to re-read the code so i can explain it to you
Ell
Ell
post some code?
if it's obviously O(N) then what's the problem?
10:31
how is the data stored
i can't post the code, it's one gigantic loop
and does filter checks and stuff
so i just wanted to see if i can get some logic
Ell
Ell
okay, how about some pseudo code maybe? or a version without all the filter checks and stuff?
9 mins ago, by thecoshman
assume the first one is the one you want. Loop through all of them, starting with the second. if this one has a lower value, set this as the one you want. keep going until you have checked them all. You will be left with the one you want in your holder
been making one right now :)
ah ha
thanks, i just re-read what you wrote
now it makes sense LOL
no worries
next time, if you don't understand something, don't just ignore it
10:35
sorry
by saying you don't understand something, it helps people learn how to explain things better, lets you get an explanation and most importantly saves you looking like a twat for asking the same thing over and over whilst ignoring people giving you the answer
New laws to allow monitoring of emails, texts and web use will be brought in "as soon as time allows" - UK Home Office http://bbc.in/H9raNC
:O
what the holly hell!
lol
:P
10:52
funny, I never associated hell with holly
@DeadMG really? you never associated a religious construct with religion?
holly is a plant
Ilex (), or holly, is a genus of 400 to 600 species of flowering plants in the family Aquifoliaceae, and the only living genus in that family. The species are evergreen and deciduous trees, shrubs, and climbers from tropics to temperate zones worldwide. Description Ilex is a genus belonging to the family Aquifoliaceae, native of Afro-Eurasia, Australia and the Americas, established by Carl Linnaeus. It has over 300 species in the subtropical regions of both hemispheres. The genus includes species of trees, shrubs, and climbers, with evergreen or deciduous foliage and inconspicuous f...
oh for fuck sake
meh, lunch time :D

« first day (535 days earlier)      last day (4639 days later) »