« first day (475 days earlier)      last day (4466 days later) » 

3:00 AM
@CatPlusPlus Right. I'll stop complaining about scanf.
 
We all know stdio sucks. :P
 
It taking me 4 hours to do this and I'm not even close to finishing it. It was given to me during a 15minute quiz...
 
input is compared, not scanf return value.
 
So since scanf() will not detect '\n' how else will I stop it?
 
@LearningC What host are you compiling on?
 
3:02 AM
gcc gnu it think.
 
(I know, dumb question)
 
scanf takes care of whitespace for you.
 
i don't know really
 
No, windows? *nix?
 
At least it's not "Dev-C++".
 
3:03 AM
gnu
 
When you know the difference between IDE and compiler, there's hope for you.
 
honestly I'm not sure. How do I find out?
 
But then again, when you don't know the difference between compiler and OS...
 
Type uname -a
 
3:04 AM
SunOS
SunOS y.glue.umd.edu 5.10 Generic_147440-07 sun4v sparc SUNW,SPARC-Enterprise-T5220
@CatPlusPlus lol sorry
 
ok. after typing your integers, type control D. That's Ctrl and D at athe same time.
Sorry. That was condescending.
Running on a Sparc. That's a blast from the past. Relish it.
 
it just repeat
ctrl+d just repeats the command
 
OK. If you have code that looks for input == '\n' then type 3 4 5 10. Cat was right.
 
I prefer to just redirect from a file. It makes it easier to repeat the test, and is portable.
 
printf("Please enter some integer: ");
scanf("%d", &min1);
while((scanf("%d", &input) == 1) && (input != '\n')){
if( input < min1){
min1 = input;
}
}
printf("%d", min1);
 
3:09 AM
No kidding. Tell C how to use <.
 
why wont that code work?
 
AFAIK program < file works on pretty much any shell worthy of the name.
 
@LearningC Give it a list of integers followed by a 10.
 
ok that worked
 
@RMartinhoFernandes C wasn't sure what OS he was using.
 
3:12 AM
Then what if a user enters 10 as the smallest integer it will not return 10.
 
@LearningC You need some way of terminating. A special value, (10 == '\n') -1, or something.
Right. Use a different, non-user entered value.
like -1.
 
@RichardPennington So I have to tell the user to enter -1?
 
There is no way of coding a patch?
what else can I use other than scanf
 
That's a different question. What is the problem statement?
(Or the homework question)
 
3:16 AM
It not a homework. It was today's quiz but I couldn't get it. Quesion: The user should be able to enter any amount of integer. It will find the two smallest integer in the set and print it out. Printing the smallest number and then printing the second smallest.
 
the uttermost supreme for loop c++ has ever seen
 
@LearningC If you type stty -a at the command line, what does it say the eof charcater is?
 
desmond.imageshack.us/Himg823/… I am going off, very tired. :) See you later.
 
@RichardPennington eof = ^d;
 
Right. But you said that repeated the line.
Type ^d at the beginning of the line following the line with your integers.
 
3:25 AM
^d == ctrl+d ?
 
yea
 
That sends EOF to the program.
Which should cause scanf not to return 1.
and exit the loop.
 
so I type "18 29 17 28" then I pressed ctrl+d
`Please enter some integer: 18 29 17 28^D
*
17y:~/enee150/quiz1:`
 
And? (drum roll)
ok
 
3:27 AM
Sounds like it worked.
 
I had to press * to exit
this is what happen when I don't press *
 
ok, use *. It doesn't match a %d. It works. Go for it.
 
Oh I see now
I have to press ^d multi times
ok moving on to the next issue. How do I get the 2nd smallest number?
would I have to loop through again?
 
Keep two values. An exercise for the reader. ;-)
 
3:33 AM
Hi
Are any of you familiar with WPF & Visual Studio?
 
3:45 AM
We've heard of it, yes.
 
I'm not exactly sure how WPF interfaces with Visual Studio
In other words, as I go into Visual Studio and click "New Project", I can create a new WPF form.
Do I base my entire project/application off of that form and create additional classes, etc. on the side?
Or does it really matter where I begin; can I start with my classes/code and then create the WPF form and combine everything?
Ah, I may see how this works.
Just typing it out helps ;)
But am I correct?
 
you can combine them
 
0
Q: Making Lists of **Pointers in c++

user1186656What I was trying to do was make a list of them with Item *itm = new Item(); _lst.push_front(&itm); lst was made made in the header std::list<int> _lst; I am trying to learn c++ on my own so any advise would be great.

 
Are you using Avalon?
 
Woah. I'm not really sure where to begin.
 
3:51 AM
Cool, thanks.
 
just put path to your project so that it can scan for deps and lib needed in WFP building
I would like to troll it, but I'm afraid I will be banned.
how to earn comment option?
I guess I will need someone to help. :)
 
4:31 AM
???
 
 
2 hours later…
user406009
6:11 AM
> When I try to call the constructor from Bar's constructor I get and unresolved sexternal.
 
user406009
First time I saw it called that.
 
7:06 AM
Still need to watch Alexandrescu's talk.
 
It's not that interesting, really.
He showcases variadic templates, and a typesafe-ish printf.
STL's is much better.
 
STL was quite good.
 
cpx
I just started to learn STL from a book.
 
But I liked Stroustrup's because it's very relevant for the codebase at work. I have to convince my coworkers to watch it.
@cpx His diary? :)
 
@StackedCrooked Is it up for download yet?
 
7:13 AM
morning
 
Wow, it actually is morning.
 
@RMartinhoFernandes You can still start the stream and scroll back (but you probably know that). I haven't found downloadables yet.
 
I KNOW
it's a bit WTF that I'm actually saying "morning" in the morning
 
cpx
 
Did you update your online spec already?
@cpx Ah, we were talking about Stephan T. Lavavej (STL for short), the maintainer of the STL that ships with Visual Studio, not the standard library.
 
7:16 AM
no, but I'm just about to
I created a bunch of new pages and then didn't make any links to them :p
right
let me just uploadit
oik
there we go
although there are still many empty page
 
Hmm, I see that there's no dot (.) as punctuation but there's an arrow (->). Oversight, or something else?
 
heh
remembered to do "..." but I thought I'd already done "." so I skipped it
 
> As such, any given implementation is obliged to implement only those libraries which are feasible.
heh lol.
 
^^
it's difficult, because I want to include e.g. GUI libraries, but I also don't want to make it impossible to have an implementation for e.g. phones
so that's the best wording I could come up with right now
 
7:32 AM
Hmm, what does this mean to_range(Pred) -> { to_range.ReturnType = RangedInteger(Pred); };?
 
template<function Pred> RangedInteger<Pred> to_range()
I've been thinking about re-working the grammar (again!) to provide a more natural expression of the return type
 
Ow, yeah, that's a bit verbose.
 
but it's hard because the function grammar has to do a lot already
definitions, declarations, prologs, etc
I could introduce a var -style keyword and clean it up
or make some other efforts
but for now, I'm not too bothered about it
 
What's the exponentiation operator?
 
I have an exponentiation operator?
 
7:36 AM
The text on ArbitraryInteger mentions it, but it doesn't seem to be on the interface code.
Got carried away?
 
well caught
no, I was going to offer it as a member function
I think
 
Division is also missing.
 
but it seems silly to have a multiplication operator and not an exponentiation operator
 
But that I guess it's /.
 
yeah
 
7:37 AM
@DeadMG Is ^ xor like in C?
 
I might just steal the one from... is it Python? and use **
yes
 
Dunno if it's Python, but yeah, some languages uses **.
K, now there are a couple keywords that got me curious.
What's a filter_cast?
 
yep
it's const_cast
 
Ah, I remember that.
 
but const is now a filter provided as Standard, not a language feature
 
7:40 AM
I suppose partial is for C#-like partial classes. And dynamic?
Interop?
 
yes
dynamic module = DLL import/export
and also, I changed virtual to be dynamic
although on reflection, I probably totally forgot that production
 
and static, too
I cut the old block syntax because it just didn't scale well, and then I never replaced it
actually
I have no need of static or dynamic because those could simply be set in the function prolog
flexibility for the WinRAR
oh that reminds me
I forgot to provide import and export as keywords
for the dynamic module functionality
 
0
Q: As the delete operator deallocates memory, why do I need a destructor?

Anisha KaulFrom c++ FAQ: http://www.parashift.com/c++-faq-lite/dtors.html#faq-11.9 Remember: delete p does two things: it calls the destructor and it deallocates the memory. If delete deallocates the memory, then what's the need of the destructor here? Or have they stated it wrongly? Delete doesn't d...

 
Woah, what's special about that post, @Feeds?
 
7:51 AM
I ignored feeds long ago
 
Poor thing :(
Oh, it was tagged .
 
cpx
Didn't we used to have feeds posted above a notification bar?
 
There was a discussion about that a while ago. I missed it.
 
mawning
 
suppages
 
8:00 AM
not much, it's cold
 
Speaking of cold, I'm going out to buy sustenance.
 
it's fooking freezing in here
I'm gonna go turn the heating on
 
meh
the heating in the house doesn't work currently
so it really is darn cold
 
sbi
#GoingNative, I love listening to Stephen. He is my favorite pirate.
 
Never underestimate the power of an extremely pissed off woman.
 
sbi
8:02 AM
@RMartinhoFernandes Shuddabeen . Fixed.
 
"C plus plus minus minus", lol
 
sbi
@RMartinhoFernandes I was already fixing it. :-/
@DeadMG Don't worry. This is an international chat. Somewhere in the world it's always morning.
 
so who here has already watched the entire first day of GoingNative2012 ?
 
sbi
1 message moved to bin
 
Tidying up the house?
 
8:06 AM
lol
 
wtf is c++-faq-lite
 
ah
 
"That site with the yellow titles." That's how a friend of mine refers to it.
 
meh
looks as old as C++
lulz
 
sbi
8:09 AM
@RMartinhoFernandes Yeah, someone dropped some dirt here. Meh. Swept it to the bin.
@DeadMG O.M.G. You guys really are too young. Why don't you just shut up, watch, and learn?
 
no, I've seen it a hundred times
 
sbi
1 message moved to bin
@TonyTheLion Fine with me.
 
just never associated it as "c++ FAQ lite", as opposed to just "C++ FAQ"
 
@sbi lol, that was fitting.
 
8:11 AM
@sbi lol
 
sbi
@DeadMG You know, saying that just makes you look a fool all over again. If that's even possible.
 
in bin, 1 min ago, by Tony The Lion
bin ALL the things
 
just for the record
 
sbi
@RMartinhoFernandes Where?
 
8:12 AM
lulz
ok, today I need some inspiriation
 
What do you want to be inspiriated for?
 
@RichardPennington huh I thought I had this learning guy on ignore. Apparently that is per-session
 
so I can find a solution for my problem
 
@TonyTheLion What problem?
 
@RMartinhoFernandes Wut?! No! impossible. They're tooo similar
 
8:17 AM
I'm trying to write a automated system that will detect whether a new USB device is connected to the system, and connect to the system so the software can communicate with it. At the same time I also have to detect whether connection was lost with any devices and act appropriately
 
Think about the sky and the clouds. Boobs. The sea, the sound of the waves breaking. Boobs. Seagulls flying up above. Does that inspire you?
 
@TonyTheLion OS? Type of device bus?
 
now, the USB drivers code I have only shows the changes in USB devices, so my find_usb_devices call returns an int saying how many devices lost or added since we last checked
@sehe windows, USB
 
sbi
@TonyTheLion "Genius is one percent inspiration, ninety-nine percent perspiration." Thomas Alva Edison
 
@sbi So, that leaves zero percent for inspiriation then.
 
8:19 AM
lol
the detected USB devices are being added to a linked-list by the USB library
I already have quite a bit of infrastructure and stuff to get this system working, but it's got quite a few bugs still, meh
 
sbi
@RMartinhoFernandes Other than you, we humans can think fuzzily, making us file such trivial errors as, erm, well, trivial errors, and go on. :b
 
sbi
@LewsTherin I'll try. Just spill it out here.
 
@TonyTheLion So, that leaves zero percent for inspiriation then.
 
@sbi How can you program like that?
 
sbi
8:22 AM
2 mins ago, by R. Martinho Fernandes
@sbi So, that leaves zero percent for inspiriation then.
@RMartinhoFernandes Barely.
 
It's an echo chamber!
 
meh
I'm freezing my ass off in here
 
@sbi I saw that. I just thought it was more apt as a response to chat.stackoverflow.com/transcript/message/2532585#2532585. Sadly, can't re-target someone else's comment
 
man
today's Daily WTF
 
8:31 AM
wtf
 
@DeadMG Sigh.
I hope he wasn't paid by LoC.
 
lol
 
Seriously, how can anyone be that stupid?
 
haven't read The Daily WTF
 
the hilarious thing is that he even used the ToString function to get the string in the first place
 
8:36 AM
Yeah!
@TonyTheLion Here, thedailywtf.com/Articles/The-Percent-Conversion.aspx. It's a bit "long", but it reads fast. ;)
 
@DeadMG you mean yesterday's? That sent me over to google reader to recheck, and even to tdwtf - no new post
 
oh, yeah
they usually post at the equivalent of about 4am British time
 
@RMartinhoFernandes WTF
 
I think
 
Today's xckd is a sequel to Monday's.
 
8:43 AM
rofl
 
Is snprintf only for safety? Can't use it for printing set number of characters?
 
@RMartinhoFernandes Tesla became the Cat's waterloo
 
Tin
good morning guys! i was wondering, which is the way to check whether a file exists or not in c++ (ideally without using boost and in a cross-platform way).
 
@Tin No such thing.
the default io streams do not contain such a function
 
8:48 AM
@Tin stat(2)
 
they can only report that they failed to open it, which is not the same thing
@sehe "cross-platform".
 
Tin
@sehe, I found also stat, but it seems, it works only on linux, right?
 
@DeadMG stat POSIX IEEE Std 1003.1, 2004 Edition - portable enough for me
@Tin Nope should work on windows just as well. It isn't the native API, but it should be available as part of the posix layer
 
Tin
@DeadMG, so, one way to do it is to open the file and if there're any problems while opening it, then it exists, otherwise, not.
 
@Tin anyways, alternatives for boost: PoCo
 
8:50 AM
@sehe Well, I hate to break it to you, but "portable" means at least Windows and Linux and Mac for everybody else.
 
@Tin Not necessarily. It may be locked by another program.
 
Dunno why they decided to stick a freaking underscore on it.
 
@DeadMG Sooo. stat works on windows, mac, solaris, aix, linux, BSD and probably even minix
 
apparently not
 
Tin
8:51 AM
@DeadMG, how would you do it?
 
I'd just use Boost or write a wrapper of my own
@sehe What's the difference between "Use Boost" and "Use Poco"?
 
@DeadMG You want Hamming distance or Levenshtein distance? Stop trolling? If you can't tell the difference, just have a look for yourself you know
 
Tin
@RMartinhoFernandes, so in windows it's the _stat function while in linux it's the stat. how could i switch between both of them depending on the OS I'm running the code?
 
sbi
Friends don't let friends use PHP. In fact, friends kidnap friends who use PHP and lock them in the basement for counterprogramming.
 
Tin
8:54 AM
@sehe, thanks for the link, but I would like to avoid using other extra libraries, that's why i also mentioned, not boost
 
@sehe As they are both external third party libraries, I'm going to go for "Zero, however you measure it."
 
@DeadMG So, I reckon today is your day for re-imaging the unasked question :)
 
I think you will find that Tin's latest statement completely validates my interpretation
 
7 mins ago, by Tin
good morning guys! i was wondering, which is the way to check whether a file exists or not in c++ (ideally without using boost and in a cross-platform way).
 
8:55 AM
@Tin I would first check if they don't actually have a no-underscore stat on Windows. Probably it's a macro or something. They seem to like that on APIs.
 
@DeadMG So? That's hindsight. Meh
 
well, "Use Boost" and "Use Poco" have a hell of a lot more in common than "linkage" and "inlining"
 
See you around guys, I don't need this. Bye
 
huh
 
> open: This POSIX function is deprecated. Use the ISO C++ conformant _open instead. (from msdn.microsoft.com/en-us/library/ms235491.aspx)
WTF does this mean?
 
8:59 AM
no idea#
 
It's all over the place.
 
probably it just mean that standard library functions should start with _
 

« first day (475 days earlier)      last day (4466 days later) »