@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8



Comments:

<0> I haven't implemented code to do it yet in C, but it'd be something like while(*c) { c = strchr(',') + 1; /* Read crap in */ }
<0> well, swap the "read crap in" and the "strchr"
<0> and yeah.
<1> spaw str1 with str2 in str? like this: str = my maya amya; str1 = my; str2= gog ==> gog maya agoga
<1> howto?
<1> well?
<2> oh god
<1> what?
<1> well?
<0> jackreplace?
<2> well, it LOOKS like you could read each line into a std::string
<1> and..
<3> jack007: string::find and string::replace
<3> vic was talking to bronaugh
<2> then turn it into a istringstream and extract elements by using getline and ',' as the deliimeter
<1> yea



<1> how to do this?
<3> string::find returns a position, string::replace takes a position, what's the issue?
<0> vawjrwrk: interesting... ok.
<0> that sounds cleaner.
<2> or use any of the "split up strings" using any of the libraries out there
<2> since you even have , at the end of the line
<3> what about nexsted ,?
<3> erm nested
<0> vawjrwrk: yeah, that sounds like it'd work.
<3> "foo, bar", foo, bar
<2> there aren't any
<2> no " in the file
<0> peterhu: fortunately not an issue.
<0> I'll personally eviscerate anyone who does that to this file.
<2> personally I think they should have used '\t' instead of ','
<0> yeah, well, there's a certain amount of code that depends on it being csv, unfortunately.
<0> what about using get instead of getline?
<0> seems like I can throw things in a streambuf then.
<2> no
<2> huh???
<2> why would you want them in a stream buf?
<0> could then throw that directly into a string, no?
<2> getline will let you read until the newline
<4> why is LAPACK in fortrann???
<2> because it was written ages ago
<0> dextre1: because it's written by "scientific" programmers.
<4> ok, so uBLAS offers a subset implementation of LAPACK in c++?
<0> dextre1: I don't know.
<2> dextre1 I've not used LAPACK in over 20 years, why don't you go look at the docs for uBLAS
<3> escaped_list_separator will tokenize CSV, i'd probably use that
<3> also handles escaped quotes
<0> ahh, boost. ok.
<2> does it handle quoted , ??
<3> yeah
<2> I may need to take a look at that
<2> brb, It looks like a reboot is in order <sigh> vs2005 isnt' making an ASP web page very well, and WinXP isn't helping it much
<2> brb
<3> bronaugh: or the char_separator functor if you want simplistic (but customizable) strtok behavior, as well
<5> for some reason I thought vawjr worked on unix
<0> peterhu: yeah, both useful.
<0> alright, so I can read lines in then throw them at the tokenizer.
<0> that should work.
<3> it would probably be more efficient to read the whole file into a string, depending on size
<0> size is fairly small.
<0> 68 lines of text, maybe 1-2kb
<3> yeah, i'd probably read the whole thing in as a string, and then p*** that to the tokenizer, and then i'd have an iterator for the whole file's contents
<0> ok, so dumb q. how would you read the whole file into a string?
<0> I ***ume you mean a C++ string, not an array of chars.
<3> string str(file.size(), '0'); file.read(&str[0], file.size()); is one way, and likely the most efficient
<0> ok.
<3> where file.size() is the file size, that is
<0> yeah...
<0> ... ok, that's the strangest way I've ever seen of getting the size of a file.
<0> size = pbuf->pubseekoff(0,ios_base::end);
<2> why would anyone want the size of a file
<2> it's likely to be invalid as soon as you get an answer
<0> that's kind of like asking why someone would want to know how many files there are in a directory.
<2> same thing, in a multi(tasking/user) machine the numbers don't stand still
<0> nope, they don't.
<2> if you're reporting the data, then ok, it's just an approximation
<0> it's not something you store, obviously. in this case I'm just using it to allocate an input buffer.



<2> why bother?
<2> std::string handles all that stuff for you
<0> read entire file into string.
<0> then parse.
<3> i suggested that it would be probably more efficient to read in the entire contents of the file, because it's small, to p*** to the tokenizer at once
<2> do you really think that will be faster than nested getlines() ?
<0> it's small and it doesn't change all the time.
<0> in fact, it's basically read-only.
<2> so why not just construct a std::string w/ the contents
<2> instead of trying to allocat a buffer
<0> yeah, that'd be nice. how?
<2> std::string file((std::istreambuf_iterator<char>(yourfstream)), std::istreambuf_iterator<char>());
<2> that ***umes that you've actually opened the file and called it yourfstream
<0> yeah, I gathered that much.
<0> sounds like a nice way to do it. OK.
<0> no pointers flying around.
<2> ifstream yourfstream("C:/blah/halb/gorph/snitz.csv")
<0> yup.
<2> anyone know where vs2005 keeps the location of what it thinks is the default browser? mine is picking up a rather ancient one (which isn't there any more
<0> isn't that some kind of Windows default? or does VS have its own ideas?
<2> it must
<2> because I"ve set the default browser and it wants to use something I don't recall having installed
<0> hum.
<3> control panel -> add remove programs -> set program access and defaults perhaps?
<0> can't be any help there unfortunately.
<2> set program access for what?
<3> it's the mechanism that windows uses to set default web brower, amoung other application
<3> i'm not sure if visual studio uses it though
<2> it already says "use my current browser"
<2> it's just got the wrong ****ing path to it
<3> no idea then
<2> just a nice "can't find file" OK ****ing dialog box
<3> what kind of project?
<2> no mention of WHERE the file was specified
<6> Hmm
<2> ASP.web
<6> Is there any "authoritative" (whatever you spell it and whatever I'm trying to mean) reference somewhere about how to make manpages, which number (man 1/3/4/8) to use, etc?
<2> well the 1/3/4 is from the section in the overall manual... e.g.(iirc) 5 is system functions, 1 is utilities, etc
<6> But is there some www.unix.org/manpages/howtopublishthem/ ? :D
<2> have you tried man man ?
<6> Don't have access to a UNIX machine at the moment
<6> (hotels don't have servers :/)
<2> nor I
<3> man 7 man lists the man sections for me
<6> How about generating pages?
<6> I mean, the "file format"
<3> 1 - commands, 2 - system calls, 3 - library calls, 4 - special files, 5 - file formats, 6 - games, 7 - conventions and misc., 8 - system management commands, 9 - kernel routines
<3> that man page appears to have macros relevant to man page creation
<6> Well, I need to create them using xsl, so I guess macros won't help me :D
<6> But thanks for the #s
<3> http://www.die.net/doc/linux/man/man7/man.7.html
<3> that's the one i had
<6> So boost, for example
<6> It'd be 3?
<6> Or that's reserved for the CRT/STL?
<2> no, any library
<6> Awkay
<2> or so I learned waaaaaaaaaaay back when
<6> Anyway there's nothing else that looks close
<2> and not well enough to remember that library was 3 not 5
<2> and system calls 2
<2> oh well
<7> I remember a school cl*** fellow of mine later did his undergrad in CS, and as a final project wrote "The Documentation of Unix"
<7> i.e. what it does etc.
<6> Sounds like a weird project
<6> What's undergrad, when you're 16?
<7> Whats the point of such a project?
<7> Normally undergrad == bac + 5
<6> Hah
<6> And for his doctorate he'll explain what MSDN is?
<7> lol
<8> lol Ashe`
<7> If he gets into a doctoral program
<7> He is probably sitting in a real estate office now, if he can handle the complexity of that work.


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #c++
or
Go to some related logs:

reltuk
#AllNiteCafe
idilis2
Girls Love Girls ru
#AllNiteCafe
#gentoo
#php
Peanuts character clings to a security blanket
nisma, xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ubuntu activate root



Home  |  disclaimer  |  contact  |  submit quotes