@# 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



Comments:

<0> until V42 is released I'll avoid the platform.
<1> I'm currently trying to get down to make those 4 disks a raid-5
<2> cyberfrg: this is the prototype: http://www.thebestpageintheuniverse.net/c.cgi?u=anime_nerd
<1> there's this wierdest eisa card in this netfinity
<3> eisa? in a netfinity?
<3> are you sure it isn't like a 64-bit pci card?
<3> ;-)
<4> hehe
<1> if I stick your nose into this box, you'd say, eisa
<5> So, what's the best/easist way to parse strings like "123k", "6M", 1G" (et al) in C?
<5> where the letter is optional.
<1> it's equipped with 2 DB9's and some type of mini din
<5> it seems that scanf isn't quite suited for this...
<5> (not automatically, at least)
<2> Hawson: well, you need to write some code to parse the string
<5> haohmaru: right, I'm wondering if there's a fairly straightforward way...I can build my own code, but I'd rather copy it form somewhere else.



<5> this is the sort of thing C isn't so good at--it's possible sure, but it's much more trouble than in other languages
<1> found out what my strange eisa card is, Netfinity 7000 Adv Mgmt Adapter
<2> Hawson: wouldn't it be enough in your case to simply check the last character of the string?
<5> yes, and that's what I'm going to write
<5> I'm just hunting for something that already exists.
<5> All I need a function that takes a string, and returns an in
<5> an int
<5> I'd expect that sometone's already written that. ;-)
<2> yeah, it's called scanf ;-)
<5> can scanf handle optional formmating?
<2> seriously, just use scanf, check the last character and multiply the number depending on the respective character
<5> I (ultimately) want something that can handle "2048" and "2k" in exactly the same way.
<5> Yes, I know. I'm just looking for someting already written. I know the logic, I know how to use scanf in a simple way (I don't claim to know all the dark corners)
<5> I'm being lazy--I admit. Just trying to reuse code, instead of rewriting (and retesting)
<2> I don't think there's something already made that you can just cut and paste
<2> at least, searching for that and then adapting the code would probably take longer than writing your own for something as simple as that
<5> I'd be suprised at that--this seems like it'd be a very frequent problem to solve
<2> it shouldn't really be more than 10 lines
<5> probably
<2> just scanf, a simple switch statement for the last character, that's basically it
<5> found something to parse roman numerals :)
<2> awesome ... just switch all your programs to roman numerals
<5> ah well, I'll write my own
<5> yeah, specifiying quotas in roman numerals...
<5> that'd be amusing
<5> :)
<2> just to **** with them :-)
<5> yep
<6> evening folks :)
<7> howdy
<1> pbug :)
<6> I'm so glad tonight :) I did my taxes
<6> kern.version=OpenBSD 3.9-beta (GENERIC) #435: Tue Jan 24 03:25:59 MST 2006
<6> pvalchev@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC
<6> I got some problems with this thing..
<6> simple.. vvvery simple programs are crashing and they shouldn't be
<8> if it doesn't happen today, I'll probably tell my boss it will get done tonight and do it myself and tell coworker he can do it some other time and probably reduce his "training" to lab only stuff when he has the incentive to do it.. which I'm not seeing any right now. I think some are hoping he moves on to "bigger and better" things when he graduates.. At the same time I hope I can handle someone working under me when he leaves.
<8> oops
<9> hey hawson, I was bored and actually wrote that code
<5> I forgot main() in a stub I was writing. :)
<5> haohmaru:
<5> haohmaru: nifty
<9> http://www.rafb.net/paste/results/avagUm31.html
<9> check it out
<9> it actually works
<5> It occured to me, that scanf might work alone...I was testing
<5> clever
<2> yes, I guess I am
<5> :-P
<5> no error checking. :)
<2> it's an expert system
<5> I was checking if 'scanf(%d%c)' would work
<5> to just drop the character if it isn't there
<5> initalize it to something that wouldn't be used, like '_' or something
<2> scanf discards all non numeric characters anyway when you use %d
<5> yeah, but this would combine it into one call.
<2> i.e. if you enter 234234fsdf34f34 you get 234234
<5> but scanf() will wait until you've entered all of the fields it's looking for
<5> right
<5> but I was hoping that if it's looking for %d%c, and you only entered "123", it would leave the %c variable alone



<5> but it doesn't, so I can't
<5> yay fallthrough. :)
<5> of course, that's actually less efficient...
<5> http://www.devrandom.org/p/paster.php?id=12
<5> is what I had
<5> (untested)
<5> the compiler can't optimize that as well as explicit 1024*1024, etc
<2> should work the same
<5> yes
<10> anyone know what replaced the cisco 2924M-XL?
<5> http://www.devrandom.org/p/paster.php?id=13
<5> final copy
<7> whers rnd
<5> usually on in evenings
<7> what kind of geek doesn't IRC from work ;)
<5> He works at CERT.
<5> You hsould give *them* more credit than that
<8> 1 out of 20 people are HIV positive in D.C.!?!?!
<7> DC is the new south africa
<11> does %varname represent an array in perl?
<7> @varname
<11> so, what the hell is this?
<11> my(%Whitelist, %Blacklist);
<12> % is a hash
<11> perl is so weird to read...
<11> hrm..
<8> these muslim religous freaks aren't going to be able to make it in the real world acting like this.
<5> That's really bad perl, BTW
<5> wettoast: did you write that?
<11> nope
<5> good, it's broken
<11> trying to debug it...
<5> oh, wait..hehe, sorry. :)
<5> that's okay
<11> yeah, its fun reading it
<5> I thought it s was a sub call
<5> if it was, *THEN* it would be broken
<5> since hashes are "flattened" into arrays when p***ed to subs
<5> so if you have: sub(%a, %b) {}
<11> okay
<5> the sub would only see one long array.
<5> (which can be useful, but usually isn't what you want)
<3> Mr_You: Huh?
<5> Those /(Christian|Jewish|Hindi|Arab|.+) freaks aren't going to be able to make in the real world acting like this.
<11> what does = @_; mean? the value thats being p***ed to the sub?
<5> Yes.
<5> @_ is "all the arguments"
<5> similar to $* in shell
<11> okie, thanks
<5> you'll probably see "$_" as well
<5> which is the "default" variable. Usually used in loops of various sorts
<11> okie, one mor ething if you please :)
<11> while($sth->fetch()) {
<11> $BlackWhite->{lc($to_address)}{lc($from_address)} = 1; # Store entry
<11> }
<11> so this takes value from bd, and stroes it in $blackWhite array right?
<5> Okay.
<11> err bd- db
<5> kinda.
<11> what does lc do?
<5> LowerCase
<11> and why is there a = 1 at the end?
<11> ah
<5> it's building a complciated hash
<5> of to/from pairs
<5> and simply ***igning something to that hash table entry
<5> it could say = "catsndogs";
<5> but that'd take more space. :)
<11> how could i clear all value of $BlackWhite? can i go undef $BlackWhite ?
<5> %blackwhite = ();
<11> great, thanks again.


Name:

Comments:

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






Return to #unixhelp
or
Go to some related logs:

#solaris
#nhl
#beginner
#windows
FengBlao
#c
#red
#windowsxp
#computers
#red



Home  |  disclaimer  |  contact  |  submit quotes