« first day (401 days earlier)      last day (4551 days later) » 

cpx
5:12 AM
@FelixDombek I don't think you can know the number of online users. but you may want to look it up on meta-discussion for a possible question regarding this feature.
 
I don't really know of a better place to ask this (but this chat was quit OT earlier): If you were interviewing for a junior RoR engineer position after a Skype video chat interview that went ridiculously well and didn't get an immediate offer, but the founder of the company gives you a Rails development book, is that good news or consolation prize?
 
It's RoR. You're doomed either way.
 
5:28 AM
@JoshuaClark I can't imagine that it's a consolation prize unless it's a bad company
who would waste time and money (or books) on people they didn't want unless they were kind of a wuss who probably wouldn't run a company very well
 
It's an early stage startup and they know I'm interviewing with other companies, so I wonder if they're trying to woo me. But I was a little surprised by them not making me an offere then.
But I don't know if that's common. This is first round of interviewing for Real Jobs
 
Well, you'd think that an early stage startup wouldn't have all the HR red tape and could just pull the trigger. But you never know, they might want to finish their interviews even if you're their #1 guy
@JoshuaClark you go to Southwest Texas?
 
Something like that. It's Texas State University. And I don't think they were interviewing anyone else, since I just emailed them and asked for an interview. That's what they were so impressed by.
 
Oh I forgot, they changed the name since I was around there
 
You an alum?
 
5:33 AM
I went to Rice
I was in Texas forever though
I was just stationed at Ft Bliss for like 9 years
 
It's actually less of a joke than when it was SWT. They're trying to turn things around and hiring some really good CS faculty
 
I have a strict policy of not knocking any school...as long as it's not online
 
I try to stay close to Austin if I'm going to be in Texas
I subscribe to the belief that you get out of it what you put in.
 
I spent like 3.5 years at Rice then quit, and I still have no degree
 
CS is meritocratic enough that it probably doesn't make much of a difference if you're good
 
5:36 AM
I agree completely...many times I've wished I'd gone somewhere else. If you've been around Rice you'd know what I mean
I'd like to hope so
But then, I'm busy trying to finish a degree and do a MS, the paper is important to some people, but just to get your foot in the door.
Then you can really prove your merit
The internet generation is amazing...some of you guys are so young and know so much already
 
I dunno, reading SO and HN and makes me feel like I know so little. But then compared to my peers, I'm generally way ahead of them.
 
That's the fun part...there's so much to know
Take @CatPlusPlus for example...he's like 12 years old and can quote the c++ standard
:)
 
I'm just jealous because I'm old...
 
5:42 AM
Not like I'm quoting from memory.
 
And because my brain and ability to solve problems has rotted away in a job I didn't like
See? I've never even laid hands on the standard, and I'm not paying for it any time soon
@CatPlusPlus how's the studying?
@JoshuaClark good luck with that job hunt, I'm sure you'll find something you like, and that's pretty awesome (and rare) these days
 
@keithlayne Gave up two hours ago. I'll write something, get back and finally get some sleep.
 
I'm lucky to like and be good at one of the few marketable skills right now
 
@CatPlusPlus well good luck anyway
 
I should probably slap myself and get to work, though, to pull through and get that stupid degree in the end. It's just so full of boring. I'm feeling completely demotivated.
 
5:48 AM
@JoshuaClark It's easy to tell the people that have the programming bug...and others will never understand how you could possibly enjoy it
 
I'll never understand how people can enjoy writing essays about poetry.
I guess I'm glad so few people like it. More job market power for me.]
 
@CatPlusPlus very, very seriously: I'm the guy who didn't pull through. I'm probably a lot better at programming than you would ever guess, and I love it...but not having a degree has painfully impacted my life. I couldn't sleep either. I only got by as long as I did by being smarter than my peers. I'm sure you could do fine without it, but please finish that degree.
 
Webdev is pain and sorrow.
 
Okay I'm done with that
 
I disagree. I think it's fun and it's where most of the new, exciting tech is.
 
5:52 AM
Well, I want to get out of webdev ASAP.
 
@JoshuaClark I never understood how everyone doesn't think it's the most awesomest thing ever...the poetry is great, but it doesn't have defined syntax and semantics
 
I can enjoy art. I just can't make art for the life of me.
 
One art, please!
Okay, gotta catch a bus.
 
Yeah, the web stuff is super fluffy to me...like the dude earlier who wondered how you do a GUI in C++ without HTML
But programming is a different medium, but there is plenty of room for creativity
 
@k
@keithlayne using C++ with HTMl5?
 
5:55 AM
I do enjoy the low-level, "hard" programming. I didn't just pick the C++ room at random. But I think that the industry is moving away from traditional desktop computing.
 
@Thomas this kid came in and wanted to learn C++ from a PHP background
@Thomas I don't know much about the c++/html5 interaction, but I know the "C++ html5 project" in QtCreator is just a webkit in a window.
 
wow, why not using php with php, then related to html5
 
sorry,wow, why not using php with c++, then related to html5
 
His only concept of a UI was a web one
@JoshuaClark I just think that people have too much hardware power in front of them to really buy the SaaS / web app phenomenon being the only thing around
 
6:00 AM
A lot of it is still being rendered client-side. For instance, there's exciting gaming possibilities with HTML5 canvas and webGL, and that's all rendered client side.
But I agree. I think consumer desktops will plateau in power in the next 5 years or so
 
@JoshuaClark Are you familiar with Moore's Law? Many a person have made similar predictions, and all have been wrong.
@JoshuaClark I am curious about the canvas thing though...right now, isn't it all JS though?
 
in china,a company has applied html5 to desktop app, qplus.com
haha, i'm chinese
 
@keithlayne That wiki page says that it is expected to start plateauing around 2013. But I may well be wrong. exciting times.
 
@Thomas Thank God for google translate, but I don't know what that does still...
 
And I think the JS dominates a lot of the new web tech, but you're not limited to using JS that I'm aware of
 
6:05 AM
@JoshuaClark that's what I get for not reading the link
Empirical evidence suggests that the 2013 prediction will be just as wrong as all the others before it...something always happens to renew the progress
 
@keithlayne i think Q+ use an embedded browser core which supports html5.
 
yeah, that was what I was talking about...webkit I think
 
the embedded devices is good at html5
 
6:35 AM
0
A: C#'s operators' order of operation

FredOverflowAre you sure that begin < end is correct? You will miss one element at the end, if I'm not mistaken. Here is how I would write it in C++: for (; begin <= end; ++i) { buffer[i] = temp[i & 1 ? begin++ : end--]; } But if you think about it, the conditional inside the loop really is...

 
it's easy to create complexity, difficult to make things simple
 
@AlfPSteinbach hence C++ ;)
 
0
Q: C#'s operators' order of operation

tlgI am porting a C++ utility to C#. When I run the following statement in C++, I get the correct operation. When I run the same statement in C#, however... Does anyone know why 'begin++' is executed? The crazy thing is that if I run (i % 2) == 0 with i=0, the Immediate Window returns true.

> In case you are wondering, the compiler is VC6 w/o dinkumware.
ouch
 
the only reason i can think of is that a lot of schools or persons still have PCs with severy limited RAM
 
6:43 AM
How about Code::Blocks then?
 
too new on the scene?
 
2005 IIRC
By the way, what does he mean with "VC6 w/o dinkumware"?
 
cpx
6:56 AM
Will it be good to have visual studio 2010 compared to visual C++ express edition 2010 If I only want it use for C++?
 
no matter
 
I think the express edition is missing some resource tools stuff (like adding little window icons to your executable or something). You won't notice anything missing language-wise or library-wise.
 
cpx
7:22 AM
Microsoft Visual Studio Express is a set of freeware integrated development environments (IDE) developed by Microsoft that are lightweight versions of the Microsoft Visual Studio product line. Express Editions were conceived beginning with Visual Studio 2005. The idea of Express editions, according to Microsoft, is to provide streamlined, easy-to-use and easy-to-learn IDEs for users other than professional software developers, such as hobbyists and students. History The first versions of Visual Studio 2005 Express were released on October 2005 and the Service Pack 1 versions were release...
 
The reason it's called express is because it's not laggy and bloated like the professional version
 
cpx
hm I hope the intellisense won't the issue as most people say its a memory hog.
 
sbi
@RMartinhoFernandes Could we, maybe, settle for parental issues?
 
@sbi: I like your list. Pretty much matches my pet peeves with iostreams
except it's a bit more comprehensive and detailed than what I'd come up with on my own :)
 
sbi
@jalf Actually it was rather too much off the top of my head for my taste.
But I'm surprised we overlap so much. Good.
When do we start? :)
 
7:36 AM
@sbi you seem to get a little riled up over iostreams...
 
I guess manipulating the state of an object should be done through some kind of RAII-like scoped object, so it gets natural push/pop semantics
 
I would prefer stateless IO like printf.
 
sbi
@jalf Either that, or take it further, and keep that part of the streams state in this secondary object altogether.
@FredOverflow Yeah, my idea would somewhat do this, in a way. But I think outputting should be done using operator<<, because otherwise nobody would use this.
 
yeah, would have to think about interoperability with existing streams
 
sbi
@jalf Something like std::ostream& operator<<(std::ostream&, const my_type&) working with a new streams lib?
I'm not sure that's feasible.
 
7:43 AM
yeah, I'm not sure, I just mean that it's something to think about. Even if it's just reusing some of the same syntax
need to consider that a streams lib already exists, and how to deal with the fact that it's in use already
btw, how much of it would you template, and how much OOP/runtime polymorphism?
I can see the value in the user of a stream not having to know whether or not it points to a file, but on the other hand, I also think IOStreams' abuse of derivation and virtual functions is a big part of what makes it so painful to extend
 
sbi
@jalf Yeah, outputting has become a clear and undisputed meaning of left-shifting. If we are to do something new, we will need to ride that wave in order to create something familiar enough to be attractive.
@jalf Mhmm. The streams we know do IO with the console, the file system, or a dynamically allocated buffer. I'm not convinced that the cost of one (or even two) virtual function calls really matters for that.
 
@sbi if it's per char, it could end up fairly noticeable. IOStreams are sloooow in most implementations
but then the stream shouldn't operate per char in any case, that's just silly
but it's more of a design issue to me. It just feels really constraining trying to extend something that operates in terms of virtual functions and subclassing
 
sbi
@jalf Oh yeah, that's a good point. So at least until that char ends up in a buffer, virtual function calls should be avoided. But is that possible?
 
well, for output streams, it should be simple enough, no? Going with your peeve that you shouldn't have to write new buffers all the time, make the buffer part of the stream type as a template parameter
the othe side, going between buffer and whatever device you have on the other side is trickier
 
sbi
@jalf I know that ever since Andrei published his first book, policies are the new sub-classing. And I do not hesitate to do this, when appropriate. (Usually that means: when speed is at a prime, but there's other reasons, too.) But deriving from a base class (or an interface) has its values, too (not the least of which is that it's familiar to almost all programmers).
@jalf That sounds good, but then everybody has to templatize their output operators on the stream type. Ugh. Believe it or not, but I think that would be a considerable hurdle for many C++ programmers.
 
7:59 AM
@sbi maybe not those who see as much need for a replacement to iostreams as you...
sorry for lurking, I find your conversation to be interesting
 
@sbi the way I see it, any proficient C++ programmer can write an iterator or STL container without too much trouble, but practically everyone feels like puking if they have to write a stream buffer. So clearly there's a big difference in terms of extensibility
ok, afk 10 mins
 
sbi
@keithlayne Yes, but there's only a few who think like we do. (Of course, many programmers coming from Java or C# will find IO streams appalling, but that's not for the reasons we object, and the solutions they propose make my toenails curl.) And unless we convince the "general public" that whatever we do is worth bothering with, this isn't worth even starting.
 
Okay guys, dumb question: is whatever boost does equally bad? I haven't played with it.
 
@KerrekSB: Re: @sehe: Thank you for helping us help you help us all
ROTFL
@jalf Would star that, but it turns out too big for the shoutbox.
jalf: "but practically everyone feels like puking if they have to write a stream buffer" - hear hear
 
sbi
@jalf Well, I propose you hang out at microsoft.public.dotnet.languages.vc for a few weeks and have look at what kind of questions programmers are asking there. To be fair, I haven't been there myself in quite a while, but I'd bet a lot that there's still plenty of people around still using VC6, and still considering it the best "compiler" (while really they are referring to the IDE) MS ever made.
These developers have certainly never ever written an iterator or let alone a whole STL container. (And heave forbid they ever try!) And they are an army.
Yes, to us writing an iterator is certainly easier than tying IO streams to some device, but getting to the same level is far from being enough. What most who try this actually need is an interface to plug two functions into (one to write and one to read). Whether that's done by replacing policies, virtual functions, or function pointers is to a considerable extend down to taste and fashion, and I suppose as much as we agree that using policies is cool and elegant, others disagree vociferously.
 
8:14 AM
@sehe This discussion will be for the best for one of both of us...
 
sbi
@keithlayne I haven't had a chance to toy with boost in a long time (what with earning my money writing C#), but AFAIK they have a type-safe replacement for printf() (Boost.Format) plus something that builds atop the IO streams to more easily tie them to some new device. Good, helpful work, but nothing revolutionarily new, AFAICS..
 
@sbi well, tough luck for them. ;)
 
sbi
@jalf As I said, I'm not going to pour energy into something that's not going to appeal to the masses.
 
@sbi Well, does std::vector have enough mass appeal?
 
sbi
@jalf That's not pluggable.
And note that I didn't say we ought to avoid policies at all cost. All I said is that requiring everybody to write a templatized operator for outputting their types is a trade-off that shouldn't be made light-hearted, since it is going to hurt popularity of an IO lib.
 
8:22 AM
and it's not a stream either, I know. ;)
@sbi yeah, I agree with that
 
sbi
@jalf What I mean is that you rarely have to interface with it. You do not have to write templates to use it, you merely have to stuck your type into angle brackets and use the thing. My students could do that before they so much as heard the term "Template".
 
Maybe the question is how to make it more appealing...if it works well (with objective data to support that) and the user docs are Barney-style, then it could be a win.
 
@sbi yeah, and I agree with you. it should be easy to use and easy to extend
 
Then you could open the eyes of many young programmers as well by exposing them to those concepts, and make the world a better place.
 
@keithlayne I think @sbi is right though in that requiring `operator<<´ to be templated is a no-go
not just because it'll scare people off, but also because I think it's pretty icky design
 
8:27 AM
hmmmm...
I had a thought
Boost and Qt for example use retarded macros a lot...they could hide the complexity perhaps for a lot of people while making syntax weird but simple. Not that I like preprocessor macros, but it's a thought.
but that does not address the ickyness of that particular design
I'm sadly lacking in knowledge about using policies, etc. I want to read the book @sbi mentioned, but it seems no one is selling it in digital form. :(
 
sbi
@keithlayne If anything is more icky than requiring everybody to implement output for their simplest types by writing templates, it's to require them to write macros to hide those templates. :)
 
You need someone to throw out bad ideas for comic relief every now and then...
I apologize though, I shouldn't really be butting into your conversation. I learn a lot here in passing, but even though I'm more knowledgeable and competent than the guys you were talking about on that newsgroup, I still have so much to learn. By the way your [c++-faq] tag has some really good refresher material, I've appreciated it.
@jalf By the way your arguments back then on Meta kind of swayed me too. I'm now not so quick to flag and gentler on question-askers.
 
sbi
@keithlayne No no, it's not generally bad to consider macros. I've used them, too, when I felt that it improved the code. But once we're talking (well, I am, anyway) of templates being a hurdle for many programmers, wrapping them in macros is not going to help them to swallow the bitter med^Werror messages they are flooded with if they fail for some reason.
 
@keithlayne you're not butting in. There's a reason we're discussing this here. Thoughts and ideas are more than welcome. At the moment we're really just discussing what we'd like a stream lib to look like
 
sbi
@keithlayne There's no need to apologize. We're discussing this in a public chatroom, rather than in private message, for a reason.
 
8:42 AM
I have an affinity for << and >> operators
 
Wim Vansevenant (born 23 December 1971 in Diksmuide) is a Belgian former professional road bicycle racer. In his early years he was active mainly in Bovekerke - where he lived with his parents - and its surroundings. Later he moved to Torhout where he has a small farm. Vansevenant turned professional in 1995. Vansevenant has been lanterne rouge of the Tour de France three times, in 2006, 2007 and 2008. He is the only man ever to have finished last three times. Vansevenant retired after the 2008 season with plans to take over his parents' farm. In June, 2011, Vansevenant was accused o...
^ Somehow this is funny. I randomly found this article. It reads like the story of a loser, esp with the facial expression in the photo.
 
sbi
@keithlayne And that FAQ isn't mine. Actually, I have contributed rather sparsely to it. In fact, even the idea isn't mine (alone).
 
Random question: How often do people drop-in here asking for help with homework?
 
@sbi I realize that, you just seemed like the spokesman
 
@keithlayne my arguments about what? I've argued for and against a lot of things ;)
 
8:45 AM
@jalf sorry, out of context...the [c++-faq] tag and related the related discussion
 
sbi
@Jonny I don't have any statistics at hand, but I suppose you're not after those anyway. :) Read the newbie hints (linked from the right-hand panel), especially the part about asking questions, and follow the general homework guidelines on SO (do not ask others to do it for you, but rather ask for help on specific problems your ran into while tackling the issue yourself).
 
@Jonny About four times a week.
 
sbi
@StackedCrooked Are you the ersatz-robot when Martinho is recharging his batteries?
@keithlayne I am not Uncle FAQ! Sigh.
 
Cool
 
sbi
 
8:49 AM
Hmm, what's the idea behind stream buffers?
 
@sbi Looks more like masturbation.
 
Hmm, a FAQ for attending cocktail parties would be useful: 1. What is your name? 2. What do you do? 3. What do you think of the new Captain America movie?
 
cpx
@Jonny people with unique-id/visitors?
 
@StackedCrooked At least they have windshield wipers, but they might not be enough
 
@sbi Can a human serve as a substitute for a robot? I guess I can, but I'll be less accurate.
 
sbi
8:51 AM
@Pubby Buffering data before in/outputting and reading from/writing to the device the data comes from/is to go to.
Yes, that's two tasks this type has to do, and that's a pretty good indication for a questionable design.
 
@keithlayne Or maybe it will work really well and a new product has been invented.
 
sbi
@StackedCrooked How do we know you are human? For all we know, you might be @RMartinho's conspirator in his plot to overthrow us and implant a robot dynasty.
@StackedCrooked You mean this is an ad for windshield wipers? Ick.
 
@sbi I think I'm more like his alter ego. Or rather, his evil twin.
I'm not making much sense. Need more coffee. Oh I already had too much. Switching to cola.
 
wow...as overly complicated as the autotools can be to set up for your project, they usually just work
 
We despise it when Java programmers start coding C++ without learning the language but just figuring it out as they go. However, I'm also guilty of this, but in the opposite direction.
@keithlayne That statement seems inherently contradictory.
 
8:58 AM
there's nothing better than downloading source, following the instructions, and having a build fail immediately for a well-established, commercially-supported program on it's biggest platform
@StackedCrooked works on the user end, at least, at deployment
 
btw, I'm not opposed to virtual calls at the high levels of the API (say, each operator<< invocation results in a virtual call). That would let you abstract away the buffer type. It's mainly the way virtual functions infest the internals of iostreams that drives me nuts (both because of the performance implications and because it makes it so hard to follow what's actually going on in there)
 
by the way, what's nmake's equivalent to -j for make?
 
@keithlayne IMO, ideally, in a *nix environment, the build process consists of "./configure && make". This is not the case with automake.
 
@StackedCrooked huh? that's what I'm talking about...did I say the wrong tool?
 
sbi
@jalf Yeah, but as you said, a virtual call per character is about as bad as it gets. And I hate it that I have to think about collecting characters before passing to a buffering output facility, because that facility is too slow to allow me to just throw individual characters at it when my algorithm happens to produce such.
 
9:03 AM
@keithlayne On automake you have to call autogen.sh first I believe.
 
@StackedCrooked I haven't in a while, but that shouldn't have to be done on the user end
 
Well, you could write a configure script that call autogen for you. So that's not too bad. But I do think that automake is way to complex to setup.
 
@sbi I haven't been following the discussion too much, but why not have << use a common object?
 
I think if you make all your c++ classes extend java.lang.Object it will just work :)
 
I mean like passing a string and having raii flush it
 
sbi
9:17 AM
@Pubby Sorry, but I have no idea what you are trying to say.
 
@sbi Not exactly sure, but something like this: stream::out() << "hello " << "world"; where out() constructs a stream object that converts to a string ref
Does that make sense?
 
sbi
@Pubby Why would you want to create stream objects on the fly? That would require them to be light-weight (or at least easily movable), since they have to be returned from out() per copy. Also, each output operation would need a new one, which would probably screw performance, since its buffer needs to be set up each time (including memory allocation). Those could all be overcome, but at the cost of a complex design, for which a considerable merit would be required.
And I do not see any advantage in creating a string, which then needs to be streamed, rather than streaming directly.
 
@sbi I suppose you're right. Was trying to think up a way that didn't require templates or virtual.
 
9:56 AM
morning nubbinses
 
10:08 AM
is operator++() prefix or postfix?
 
prefix
always better to use friend style, though
 
don't think that these operators can be
 
they can
 
well, whatever, because this is a private type anyway
 
it makes less difference for unary operators vs binary, but recently i was bitten because I wanted ++ to invoke a conversion function.
 
10:18 AM
I most assuredly don't
 
sbi
@DeadMG Most unary operators are prefix, so postfix ++ and -- are the odd cases, which is why they require the odd syntactical quirk of the superfluous int parameter. That's how I remember this, anyway.
 
WinRAR
 
sbi
@Potatoswatter I disagree. Operators that modify their operands should, IMO, be members. (That's a guideline, not a hard rule, though.)
 
writing a Unicode string type backed by WinAPI
apparently it contains proper functions for Unicode equality, and is_letter for Unicode
 
@sbi The conversion function was std::reference_wrapper<T>::operator T&. So it really was surprising. I'm gonna stick to friends whenever possible.
 
sbi
10:21 AM
Everyone complains about the economy & yet a movie about sparkling vampires made $200 million internationally in three days.
Right on spot.
 
Damn vampires takin all mah mahneh
 
cpx
Hm, I think postfix ++ and -- comes from postfix expr. which is included in unary expression.
 
mahneh, lol
anyway, I'm off, got a six-hour train to catch
 
Visiting the Continent? Have fun!
 
cpx
Should you trust the ibm resource for c++? i think they got the relation between postfix and unary wrong.
 
10:25 AM
What I don't understand is why people watch a soap opera with installments a year apart.
@cpx Unary expressions are not postfix expressions. Postfix binds one step tighter.
 
sbi
@Potatoswatter You can cut the "with installments a year apart" right out of that sentence, if you ask me.
 
Well, someone with time to kill every day will watch a daily soap opera.
 
@cpx if they got it wrong, then no, you shouldn't trust them :)
 
sbi
@Potatoswatter Enough time to kill to watch a daily soap opera? What a fascinating, alien, incomprehensible concept! I now have something to look forward to for when I retire.
 
it's like watching a train crash in slow motion
or more precisely, watching a fast-forwarded rendition of Problems With Singletons Throughout the Ages
 
sbi
10:47 AM
@jalf: Given that we both don't like the requirement to templatize all output operators, that would leave us with only virtual functions (or function pointers, which are, actually, wannabe-virtual functions) if we want the buffering strategy to be customizable, right? Or am I overlooking something? I very much hope so, because I don't like the idea of calling a virtual function just for putting a single char into a buffer.
 
oh sorry, just to avoid confusion, those last two comments were about something here at work. Nothing to do with the stream discussion :)
 
sbi
@jalf Ah. I was applying it to my retirement comment, and was wondering which train had hit you to be so off the mark.
 
just watching two coworkers who've been fiddling with a few singletons in our code base, and who keep running into problems because of it.
now they're at the "but now the initialization of our singleton depends on another singleton" stage
 
sbi
After some RL distraction here, I went back thinking about what we discussed. Hence my message.
 
yeah, I agree, the high level "serialize object into buffer" function will probably have to rely on something being virtual
 
sbi
10:54 AM
Ugh.
 
anyone ever wrote an image decoder?
 
IMAGE compression?
 
sbi
@Thomas A decoder, so it must be image depression. SCNR.
 
no just reading an image file ,e.g a bitmap
and converting it to C code
 
@IntermediateHacker i'm using CXiamge, or opencv
 
11:00 AM
I said wrote
Did u ever write an image decoder? i.e programmed an image decoder?
 
sorry
 
sbi
@jalf Well, if the buffer type should be pluggable, there has to be some kind of indirection. And that either happens at compile time (templates) or at run time (virtual functions or function pointers). There seems to be no way around that.
 
I need some tips or help or resources.
 
it's not a simple processing
 
Google isn't giving any.
 
11:01 AM
btw, just a stray thought, iostreams is kind of designed so that anything other than the top-level operation (operator<<, basically) feels super faraway and esoteric. I'd like to find a design that exposes the different areas of responsibilty more as a sequential pipeline, where data is passed from one stage to the other, and each stage is fairly easy to get to if you want to extend/modify the stream
not very concrete, I know, just an attempt at describing the kind of flavor I'd like it to have... ;)
anyway, off to lunch!
 
sbi
@IntermediateHacker Waitaminute. Did you just ask for advice regarding reading a bitmap image and converting it into C code? OMG, that would lead to a whole new order of magnitude in C obfuscation!
 
@IntermediateHacker You insert the binary as an array literal.
 
sbi
@jalf Yeah, that sounds like a very reasonable design criterion.
 
@StackedCrooked I see. But what about the colors? Should I create an RGB struct?
 
sbi
@StackedCrooked Ah, now I understand! He had me there...
 
11:05 AM
@sbi ???
 
2
Q: Unpacking an executable from within a library in C/C++

MarcI am developing a library that uses one or more helper executable in the course of doing business. My current implementation requires that the user have the helper executable installed on the system in a known location. For the library to function properly the helper app must be in the correct ...

 
sbi
@IntermediateHacker I now see that you want to embed a picture into your code. I thought you wanted to generate C code from an image...
 
xxd -i x.binary converts a binary to a C-style array.
$ xxd -i x.binary
unsigned char x_binary[] = {
  0x01, 0x02, 0x05
};
unsigned int x_binary_len = 3;
 
@StackedCrooked are 0x01 etc. memory addresses?
Oh no. I think decoding is embedded programming all over again....
 
11:10 AM
@IntermediateHacker they're bytes
 
wait a sec. I think I've got it. @StackedCrooked thanks.
 
needs know how the image compress,like jpge, png. bmp
 
If only the GameBoy Advance SDK wasn't 120 OMR... I would have bought it instead of going through all this low level stuff...
 
11:47 AM
@IntermediateHacker what do you mean by an "image decoder"?
I know some people think there are different kinds of magic involved in different application areas.
Some of my colleagues once asked me about some photo processing work I'd done. They pressed me real hard on whether I'd been doing things at the bits and byte level. That would have been really silly, given the availability of tools such as Image Magick, so I was completely baffled. I just said no, no of course not, no no?!? I learned later that they were looking for someone for a project where there was some image processing work. If they'd but asked, instead of trying to be "smart" about it.
 
What, you didn't understand "Hi"? It's a greeting.
 
@AlfPSteinbach Do you really want to work for/with anyone who can't ask for what they want?
 
no
oh, hi
i think the japanese "hai" is more like "yes", yes?
 
11:55 AM
I really wouldn't know. I don't know a word of Japanese.
(Well, except for Portuguese words that I've been told they adopted)
 
Ouch.
> Cantonese equivalent for English 'cunt'. Usually used with adjective 'chau'/'chow' (smelly). Pronounced with high note ending.
I think it's a dangerous greeting.
 
sbi
@AlfPSteinbach Hai!
 
are you cantonese or japanese?
 
12:01 PM
i am having a problem with int cin.get() i want to check for input if user had pressed int or space char , '\n' not working :(, what do i do?
 
@MrAnubis read one line at a time using std::getline from the <string> header
 
@AlfPSteinbach can't use getline ()
 
Test if it's == ' ' || >= '0' && <= '9'?
 
why not
 
@AlfPSteinbach i just don't want to , my choice
 
12:03 PM
@MrAnubis well, if you don't want it to work, it would be unkind of us to spoil that by somehow making it work
 
i had done something like : while ((temp=std::cin.get()) != '\n' && temp!= ' ')//
 
Make a function.
 
@RMartinhoFernandes to make that all work i think i'll have to directly mess with buffer?
 
@MrAnubis What? No.
 
@AlfPSteinbach Don't get me wrong please but i just want to use get() this time
 
12:08 PM
Are you on Windows?
 
@RMartinhoFernandes yes:)
 
get() is unformatted input.
I'm not sure if it converts CRLFs to LFs.
Anyway, what's going wrong?
 
Line endings are converted at the filebuf level, so yes.
 
@RMartinhoFernandes std::cin.get returns the '\n' when pressed enter? it is left in buffer?
 
"Left in the buffer" isn't an alternative. Either it's returned or discarded.
(And it will be returned.)
 
12:11 PM
aah
so how do i make this work : while ((temp=std::cin.get()) != '\n' && temp!= ' ')
 
But what's the problem? I still don't know much other than "it's not working"!
 
Are you trying to receive the characters before the user presses return? Because that's impossible without nonstandard terminal configuration.
 
@RMartinhoFernandes the problem is when i press return or space , it's not exiting the while loop
 
And what value does temp have when that happens?
 
OMG, i had putted the whole code in another while loop , that's why it wasn't working :(
I really pardon for pestering you guyz with such mistake of my own.
@Potatoswatter can you tell me what you mean by discarded?
 
12:19 PM
@MrAnubis For example, getline does not return the newline character; it is discarded.
 
@Potatoswatter aah thanks
@RMartinhoFernandes But why did say not to mess with buffer directly? it isn't good? or it's too hard to handle?
 
@MrAnubis It's overkill.
 
@RMartinhoFernandes you're right , that code was right from starting without messing with buffer but it was my mistake. Thanks again :)
 
What's this about "messing with the buffer"? get is buffered exactly the same as getline.
 
12:36 PM
Hai(嗨), hola
 
ciao hai.
 
12:48 PM
So… this Saturday, one Mars lander will actually overtake another in space.
 
@Potatoswatter Team America FY! Was that supposed to happen?
 
now i remember. :P Anyway it's a bit sad the way Russians lose. There's no news of a fixup plan or requests for assistance.
 
what, the space station? I'm not tracking.
 
I'm completely lost. What are we talking about?
 
The Russians launched a Mars lander last week, and it promptly got stuck. It will fall back down in a couple weeks, unless they fix it somehow.
To fix it, they need a powerful radio transmitter, such as only NASA has. But they haven't asked NASA to "borrow the phone." So they're just being losers.
 
12:55 PM
oh, that one
 
space mud, it's gets 'em every time
 
seems failed
 
I didn't realize that would help. From what I heard, the engine was just no worky
 
Funny, we have to rely on them exclusively for trips to the space station, right?
 
Well, when they do make something good, it's bulletproof. They're just no good at asking for help.
 
12:56 PM
@keithlayne well, they're doing a pretty good job there
 
Their safety record is way better than ours… the Shuttle should have been grounded after Challenger IMHO.
 
I spent a summer working at NASA (I went to school in Houston) and it was like being in Apollo 13.
Not exciting like that, I mean it was like they're stuck in the '60s
 
Ah. Lots horn-rimmed glasses?
 
pocket protectors too
 

« first day (401 days earlier)      last day (4551 days later) »