im trying to write a simple packet sniffer the only thing im having problems with it figuring out where I have
Parse error
(1 / (negate 0))
-Infinity
who the HELL is "baughnie" - kill one or the other
Baughnie?
I can't help if our parents lacked imagination
(4 / 2)
2.0
\o/
:P
…. I thought Baughnie was *your* bot
no, I'd never blame the child for abuse - I might kill the child.
not your parents' bot
So If I'm only sending one byte through a socket, send() should always return 1 unless there's an error, right?
No, Baughnie is my user's bot.
Depends. Is the socket non-blocking?
I didn't know you were a computer program
Because for some reason, it seems like my program is not actually send()ing until the next call of recv()
Also, send()'ing one byte is a waste.
what should i do isntead of sending one byte
Mostly I'm not, but the tab-completion now uses markov chains and stuff..
come on, clean it up - too many inputs
Do you have a lot of data to send, but are sending one byte at a time?
xystic:No. I only need to send one byte.
In many cases, if the window size is not big enough, you could be at a stage in congestion control where the sender will delay until it accumulates a big enough window size or a timeout expires.
And then one byte is sent in the reverse direction
Interesting protocol…
Said timeout is usually on the order of milliseconds
You should flush the kernel buffer once you're done writing, really
I'm writing a very simple Connect Four game to play with my friends, and the only data it needs to send is the column in which to move.
I'd step back and ask again.. (I presume I focus this rightly, family yak and screen-clean)
Then the other client sends its move in the other direction.
PoppaVic, didn't understand
Well, if you're certain that the mechanisms that prevent SWS will not interfere with you sending one byte at a time, you should be fine. If not, you'll notice your one byte not going through fast enough.
"real simple" ususally isn't - folks expect too much w/ too-little
Calling send() (by the way, you should call write() instead unless you actually use any options) does not actually force the kernel to send data.
addio
thow us the last puzzle, but expect chuckles.
It's oonly going to be ~250-300 lines when I'm done.
PoppaVic, ???
SWS?
It is possible he's working on a platform for which write() does not work on sockets (e.g. Winsock) - in which case he can get the same behaviour using some more complicated routine, like WSASend() with appropriate ioctl.
nm.. I got confused over all the posts for the last five
Silly Window Syndrome.
I'm using Mac OS X, so everything should be the same as in FreeBSD in terms of sockets.
Implementations of the sender-window involve not sending until accumulated enough, and of the receiver-window involve not reply with an ACK until much of the window has been filled.
PoppaVic, ok, I'm scared.
Yes, and all OS' network stack implementations attempt to solve the SWS using those means.
I needed to recycle, and the screen got crowded as well
/msg me the last few lines, IF you are still confused
yeah, I was afraid of that
PoppaVic, nah, I undestood that memcmp is not the way to go; and probably, the only safe way is to no make a generic function at all.
PoppaVic, but thx!
but basically, if you feel that you are the victim of those control mechanisms in TCP then you can: sufficiently (rather, decently) pad your one-byte.
well, I'd think of layering
PoppaVic, well, I don't know about that, heh.
But if you're not noticing anything irregular, then you should be fine.
make sense?
Mostly.
(I assume you understand what I mean by padding the one-byte)
the OTHER part that folks never care to admit is the idea that _everythin_ is interpreted. So… writing an interpreter and coming up with a decent "dictionary" aka "namespace" aka "vocabulary" aka "wordlist" - this is nothing unusual or strange.
The problem is that when one player goes, his screen does not update (the other's does) until the other player plays, which could only AFAIK be caused by the kernel buffering the socket data until it gets to the next recv call.
Maybe it's a blocking problem…
Stick a tcdrain(socket); in there
PoppaVic, I think I need to read about that; not sure what you are talking about.
folks can't even understand source/sink
Actually, on second thought, I think it may be a blocking problem
So you are using non-blocking sockets, and you are getting EWOULDBLOCK / EAGAIN?
most of those terms I used came from years of forthish, like I have years of Cish.. You'd need exposure and reading. Suffice to say that there are multiple 'time' slices and vocabularies/namespaces all over.. It is NOT trivial.
no, the sockets are blocking
PoppaVic, heh; do you work as a programmer?
I never meant to be obscure, but honestly.. Folks need to realize the whole idea of whom-does-what-via-whom
eh, I'm going to think about this tomorrow. See you all later.
never been paid to do so.. I've been so screwed over the years, I doubt I'd take such a job.
PoppaVic, so what's your job?
my "job"?? Nowadays, I take care of the homestead and Ma' on her walker, plus the sibs. I can't leave her with them or TO them.
PoppaVic, Ma' == mother? sibs == siblings?
So, I guess my "job" is to allow her "dignity" and play "monitor" for sillieness.
yeah
I'm getting a undefined reference to dlopen error but dlfcn.h is included and in the same directory as stdio.h. Any ideas?
My "job" is one notch up from changing diapers
peter_12, library at command line?
Don't remember if you had to add something.
I don't understand your question
use errno and whatever else: sounds like it's not a path or not a plugin
It's a linker problem, specify -ldl when building.
peter_12, what xystic said.
thanks
peter_12, do that if you use gcc.
I'm trying linux for the first time. the -ldl is not necessary on OS X
crap, I presumed he did -ldl - bad llama
I forgot about -ldl
Those -l are confusing.
there is no -ldl on osx - you'd need an install
It would be better to -l stdio too.
So it would be clearer.
hello all, I have two values in a sub routine I need to pass back to main
osx has no dlopen()
osx does have dlopen!
Dustin, pointers.
have fun
old os x did not have it
"old"?
10.2 or something
It's been a few years
ahh
10.4 has it
i'm trying to keep a log (independent of syslog) but fprint keeps delaying io actions until i close the stream , any tips ?
So does 10.5
LV-426: For output, you can flush with fflush(stdout);
so I should store them into an array?
you mean the latest and greatest adopted what everyone else had to install that was normal elsewhere?
LV-426: or fflush(file); where file is FILE* file;
Dustin, no, read about pointers.
xystic, thanks , that's what i needed
int foo(int *a, int *b)
adel, I need to return them back to main though
like I had the function and my return value needs to be something like return num1, num2;
Dustin, foo(&var_1, &var_2) // Use this in main, and the two values are modified "inside" main.
No.
ohhh
okay, I think I can use that and my book as a good starting point
thanks adel
Even if you don't return something "important", it's a good idea to return 0 or 1 for errors.
is void a datatype?
Dustin, no problem.
I don't think so.
void a; // works ?
i have to count the number of compares and moves for an insertion and quick sort, and where I have the compare++; and move++; seem to be wrong
its a basic sort, http://linux.wku.edu/~lamonml/algor/sort/insertion.html
Hey — I am looking for a suggestion on how to "load balance" a call to select() — I have a couple network sockets in my fd_set that all get lots of data pretty quickly, but for some reason when I call select, FD_ISSET is true for the first socket, not the second socket and the loop continues calling select and returning FD_ISSET on the first socket as true
It is odd, because if I comment out the code which adds the first socket to the fd_set, then the second socket has its data pulled out
so I'm not sure if I'm using select incorrectly or I need more complex logic
load balance and select and wtf are you talking about
?
Paste your code to a pastebin.
xystic, well it's kind of really long.
good lord
ok, don't paste it; don't ask.. Figure out what to ask
xystic, i can probably capture what its doing in a small amount pf code i guess
PoppaVic, chill dude.
Just the logic of the select() loop, where you make use of FD_ZERO,FD_SET and FD_ISSET
I was serious, kid
PoppaVic, dude CHILL.
xystic, ok will do
http://rafb.net/p/kTk2SE85.html
Your problem is that select() alters the fdsets, you have to call FD_SET before each call to select().
ah ok.
thanks.
or maintain a master copy, and then assign to 'set' before each call to select()
dlopen() seems to be avaliable now with the -ldl but I'm getting a runtime problem in that dlopen is returning NULL handle
am I building the .so properly? http://rafb.net/p/6u4xti87.html
it is in my directory
it looks like it is built ok
Try moving the four lines beginning with FD_ZERO(…) and ending with FD_SET(master_sock2, &set) after the opening brace of the while loop.
osx has no .so
I'm on Ubuntu now
..so is 100% elf
xystic, yep i'm doing that now
Also, you do not want to break if select() == 0 do you? Because that means select() timed out after 1second and 0 microseconds.
jdude1284, that should be fine for this — I'm just running a test
heh
oops
elf has other issues; like where to look for the .so and when to reconfig the look, etc
Ok.
xystic, that timeout should be OK
nahh.. I like a lot of folks, I like what I do. But, the other? yeah.. that hurts
I have the so in my project directory. Where do you think it should be?
0) { … } else { if (result == 0) puts("Timed out"); break; }
ahhhhhhhhhhhh.. ELF is weird that way. I refuse to remember more
xystic, setting the fd_set each time was the problem — i made the changes you suggested and it seems to work
PoppaVic, :/
xystic, thanks.
np.
there are a lot of .so in /usr/lib/ so I'm going to try there
b) {foo, bar, baz};
Cool
Like a weird if.
look at the upside: I've folks I like and/or respect I can talk with; I can try to help teach/tutor.. But, folks can always catch me short - where I need to stop trying to help some goon. I feel bad for a bit, but I tried.
b) &
PoppaVic, yeap, I understand; plus, it's cool to have mates to chat with.
sure
where else are we gonna' talk C and programming? Pillow-talk? a bar?
"contexts"
PoppaVic, heheh; I do at college, mostly.
But even there, there aren't guys who try to learn _C_.
So void main is just fine.
We have that Turbo shit at college.
I asked to do my final exam with gcc && ncurses; they didn't like it.
I've been to a few "college" or "uni" or "school" - usually, yer better off drinking beer and taking dating/girls.
talking
Hehe.
ahh - did you run the chain up thru the dept-head/dean?
Well, at my college there aren't too many girls.
PoppaVic, nah, my professor said I couldn't.
Didn't try anymore.
ok, therein lie the probs with most folks
I will just write a wrapper, not that problematic.
So it will behave in some way with Turbo and in some another in… any POSIX + XCURSES implementation.
*SUS
Well, they are the same.
most folks come to college/university believing it's the same system as they had in elementary/jhs/hs - well, it ain't: you get to pay for the moot "privelege"
public school is a "right", here, to a certain extent.
Yeap, here too.
…once you are paying for it, and they can ruin your life: fight, man - fight.
I think I should.
UP that damned chain.. Ruin careers with evidence.. Make their day.
Hahah.
the idea of "audit a course" is never, ever mentioned - feel free.
I wonder who cares about POSIX in a collegue.
Audit a course?
yes
What's that?
you don't pay money, you don't get grades, and the course doesn't show up on your transcript
Anyone is allowed to AUDIT a course. It doesn't apply to a _grade_ unless you pay extra or "test out"
It's quite possibly the most powerful, underplayed card in the idiotic "education" deck.
Ahhhhh.
You mean, go just for learning?
sure
yeah, that
Well, in my case that wouldn't help at all.
I learn more in my house, alone.
At least regarding C
You get exposure, you can do the assignments and get "graded", etc - and none of it _matters_ to your GPA
well, okay, so maybe you can get graded
probably depends on how busy the teacher is
I've no issues with fokks "learning at home", but somewhere you get "graded", adelfino
PoppaVic, yeap.
and possibly on whether or not the teacher likes you
SamB, assuredly.
I'd say.
yeppers, praise unto Bog for "audit" or "Fuck you AND yer grades, you-miserable-bitch"
Hahah.
though I suppose auditing a course is a good way to get a professor to start off thinking you might be a pretty cool student
I don't know.
like "wow, he wants to take my class *just to learn stuff!*"
I've said before, I took some courses one year with my sis… To insure SHE got the degree.. omg, Thank Bog *I* didn't care - she and the class finally learned and passed.
What was the class about?
when yer willing to scream to the skies and lose some GPA, it's amazing what happens when you climb the ladder
it was a stupid accounting course for food-service.. The idea was worksheets. The bitch was not teaching accounting at all: and I called her dizzy ass on it. Shit, had she gone on: no one in the class would have made use of $50+ of books/workbooks.
Hahah.
So, let me get his clear.
In your country, you gain points in education.
….and you can lose them?
well, there was at least one more course that semester, but it was again specific and wouldn't translate well to C - suffice to say… She passed well.
G)rade P)oint A)verage.. I always found it odd you can DIE fast, but you can't get reborn.
Ah.
the way they calulate it sorta' screws you for years.
you need to recall: here in the US? They _want_ to deny you funds and they would _love_ to ruin you forever - and deny funds. So, you play the game thru pain or learn it w/o pain.
It's depressing, and I am sure there is topspin on it all, but that's the game.
location of the .so was that problem. Thanks
once yer out of HS, yer fucked.. I sure hope you learned-to-learn before then, and I hope folks learn these audit-type tricks before they blow their scholarships/etc
was that ldconfig or what?
I just put the .so into /usr/lib/
ahhh
beware, see the FHS about basic dir uses.. Should maybe have been /usr/local/lib
It seems that an absolute path is far safer way to go and is working for me also
FHS?
or use LD_LIBRARY_PATH?
PoppaVic, hehe, good advice, thanks!
File Heirarchy Standard
I'll go to have dinner.
I hope it helps
stay well, adelfino - I shall call it a knight asap
Can a function in a .so call a function in the main program?
elf is strange anyway..
ahh
callbacks are possible.
yes, if you use -rdynamic on the main executable (iirc)
wcstok I'll look it up
yes well, what isn't really (and it beats what it replaced)
as a rule, you don't want to have a plugin dlopen the root to get access to search to callback
folks just need to be aware - most are not
I'd reconsider who does what to whom - and why
XMMS does it. not that that's an indication that it's a good idea
one day Z really explained it well to me.. Can't recall all his work, but - yeah, I am mostly a paranoid
"paranoids live longer"
ahahahaa
sure!
? Shouldn't the tm_mon property in struct tm only be allowed as 0 to 11?
rdynamic works! thanks
what testcase?
Id did see warnings on google about doing this
what is the problem with callbacks from a dynamic library?
yeah, beware - it can come back and bite yer nuts off - KISS principle.
I want user definable plugins for the app. I don't want to burden them with pointers back to the main app
well, one is that you can't really control what that callback is going to do to your program
ahh
..hmmm "pete" bothers me, vuz I is. Right, as wcstok sez
remember that a LINKER is involved all the way, with dynamics
it will be their program so they can shoot themselves if they wan to
If everyone can rely on -lc, fine.. if everyone rely on -lfoo, fine: it's when each starts doodling between with "assumptions" that screws you to the wall
remember "dlopen" and friends support _plugins_ - no more or less.
The only reason I even mention this is because ELF systems see shlib/.so exactly the same as plugin/.so - they are not the same. Don't think that way if you ever plan to port code
where can i find documentation of how to set the timeout limit of raw sockets to a longer time period
why does it matter? set a timeout or block: yer call.
there is no "raw socket" as windows users think of it.
didnt think this was a widows C dedicated channel
my bad
it isn't
a lot of what you say is over my head.
Ruby allows user defined extension written in C that can load at runtime. They use dlopen and I imagine the need to allow callbacks.
we discourage doze here, if anything.
PoppaVic, call what a knight?
I can't help if you _think_ in ruby.. Sorry "free your mind"
I don't want Ruby in my life, actually. I just want a similar plugin style
PoppaVic#/ ok im using inet raw sockets. how can i change the timeout
"A knight is a night, but you are a king forever"
no idea what you are doing, I never had a prob.
PoppaVic#/ my connection times out
so what?
wondered how i can make the timeout sequence longer
PoppaVic, didn't understand
yeah, missed it somehow
look, I use socks about once every 5 years. There are folks here better qualified to help. BUT, watch what you ask.. a sock is tcp or udp, and "raw" is a weird idea.
PoppaVic#/ raw tcp sockets
I'd rant at you about that view, but I am non-current. While you await folks here to save you, I really recommend google
have tried
er, raw isn't such a weird idea…may be a bad idea, but not especially weird
cant hit the right keywords
So setsockopt() for changing the timeout doesn't work for you?
non sequitor - you didn't ask that. Dude, I am NOT JOKING: folks will get _bent_ because you are a failure. So, work as hard as you can there before expecting feedback… Really.. Think about it.
damn, you shoulda' waited 20 sec - and he STILL needs to learn to ask google
ok, you too!
I was typing the above when you chimed in.. I ain't the issue, he is.. But, yeah.. I've issue with the "raw socket", because it _seems_ to mean something else to dozers.. I can't control it, but I am really tired of trying to figure out what folks mean.
@google raw sockets
http://en.wikipedia.org/wiki/Raw_socket
Raw socket - Wikipedia, the free encyclopedia
amen
it means "the thingy I can use on windows to write all those funky network exploits" there, doesn't it? I guess I default to assuming unix meanings unless otherwise prodded
honey? Yer a bot - bad llama.. Either spank me and get in bed and active, or stfu.
it's the same thing though
yeah, I tend to wonder and presume the same. A socket is a socket, it is unix, UDP or tcp - folks need to start there and I don't need to know more.
"raw socket" suggests "I want to screw with a packet-build"
…not, mind you, a "packet read"
it's just that for some reason some people think that windows users shouldn't be trusted with raw sockets
they shouldn't be trusted with chewing-gum
of course, I'm sure they generally aren't since NT, when they haven't got admin privileges
when haven;t they got admin privileges though
hehe
in Vista, they have this annoying dialog box thingy
THEY "who 'they
that makes them click "okay" before they do anything crazy
''"?
windows users
no
and those are the ones who have priviliges…
yer missing the point, and it'd be nice if we could
every doze user is root.
you must be living in Windows 95 land
which just offloads the issue upstream
yer turn
I tried running as a limited user for a week on my system, I probably could pull it off if I was setup like that from the time the system was installed
I'd never trust one of them with rubberband-gun
what library does GNU gcc use for math functions such as Sine and Cosine?
libm
There is nothing on this earth that would ever suggest I trust a dozer. Not entering my machine as data or person.
ah. thanks wcstok
if by "use" you mean "output references to into compiled programs"
I like the way yer getting more paranoid
heh, well not sure what you mean by output references to, but i was thinking of actually performing the math functions on data.
are you talking about the gcc program itself or some random program it may have generated
i am getting 'No such file or directory' when i try both libm and libm.h
-lm
i am talking about libraries that gcc uses to compile code that uses math functions.
it doesn't.
-lm. it still doesn't recognize the libm header file.
the header file is generally math.h
where's your book?
Hi all, is there a simple (e.g. standard library function) that can validate a date given just integers for year, month and day (e.g. not allowing a day of greater than 31)?
i just have digital ebooks which i am referencing. sigh.
hi twkm been a lon day w/o you.. ;-/ I've tried to be polite and usefu;, but yer in the saddle, dude
you reference functions, such as sin, in your code which the compiler leaves for the linker to resolve. the linker then finds the reference in your code and goes looking for a definition, wherever it looks by default and where you tell it explicitly. the math functions on unix-ish systems, and others, are in a library not searched by default, so you need to tell it to use the math library, e.g., -lm at the end of the cc command.
mktime
The man pages I have indicate that the GNU extension, getline, in stdio.h is the best function for getting a line of text. Is the true?
s/the/this
fgets not good enough for you?
That's why I'm asking; I have no idea
Actually, that's what I thought too. However, according to the manpage: "If structure members are outside their legal interval, they will be normalized (so that, e.g., 40 October is changed into 9 November)."
indeed, so check for a change.
Forgive me folks.. I've been thru this at least twice today and played-well-with-others.. I need a night
it is not very portable. only you know whether that makes it "okay".
Stay well folks.
But if portability isn't an issue, is there anything about it that makes it "better"?
Ahh!
thanks for the help
…
it allocates memory for you. some people find that comforting.
Thanks for the info.
Howdy.
http://vaniketamer.miniville.fr/
a href="http://vaniketamer.miniville.fr/"http://vaniketamer.miniville.fr//a
&& and || also accept anything other than 0 as true and 0 as false?
It will accept true as true, and false as false
0 && (*p++ = *ct++) != ''?
It's just that "true" isn't a single value
(Nor is false)
No, you have to have the outer parantheses
The != 0 is redundant, yes
And '' == 0×0 == 00 == 0
The standard is clear about , , = and = evaluating to 1 if 'true' and 0 if 'false'.
(They're all ints. That's octal-in-quotes, hexadecimal, octal and decimal.)
The same applies for == and !=.
xystic yes, but i'm afrid that anything other than 1 might be a error for && and ||
No… any non-zero value placed in that condition will evaluate to 1, and any zero will be zero. So you can do 5 && 6 and it will yield 1 etc.
Unless that is not what you meant.
that's exatcly what i mean
Whether it evaluates to 1 or not is a matter of metaphysics. Realistically, the assembly checks whether it's 0, so no 1s anywhere.
ooooo metaphysics
This has to do with C, how?
bne
nso
It's /C/ metaphysics. ^_^
my compile does some cool stuff… i am convinced that gcc aligns bits to the alignment of the stars
You should look at ICC output sometime
ping
i heard it produces sludge that runs fast on P4 & C2D
ping
go to hell
Runs pretty fast on AMD too, but nobody knows why. It's… unreadable. Totally.
is that directed at me?
What, that's not a proper response to ping? You're partial to 'pong'? Well, fine, be that way.
i have long been convinced that the field of compilers is driven by gremlins which know everything but don't want to share
ok. My dylib problems are over and I have you and PoppaVic to thank. So do you have a favorite Open source software project to which I could donate?
wcstok ^^
donate to OpenSSH
wcstok gets to make the call
they produce code that runs on hundreds of millions of systems (hosts and embedded systems)
Being a compiler gremlin myself, I'm convinced that ICC and GCC are produced by squamish, tentaculated Great Old Ones.
I know Squamish the place but not squamish this word. Baughn what does it mean?
Works better if you don't know
strange you spell it just like the place
I never heard of the place.
British Columbia, Canada
near Vancouver
i have a world of respect for people like you. you make my job easy. i don't have to worry about the constructs that i use because of your work
And I apparently just made up the word. Well, no matter.
Just think Lovecraft.
I doubt you've used any of /my/ stuff. I just think it's an interesting field to learn about.
My focus is on high-level analysis, though. THe transformations ICC does… make no sense at all.
every time i delve into compiler magic, i remember just how much i hate low-level translation of algorithms
the whole idea of lexing code makes me cringe
Wait. Lexing?
I take it you're not referring to parsing source. I think I'll stick to high-level stuff, then.
i am!
That's /not/ the hard bit.
Good evening all.
I have a question, if you don't mind me asking.
i mind.
Two strikes already..
depends on what the question is
the optimization code is probably the most complex… so many different arches, so many different opcodes…
Realistically, everything that isn't the parser is effectively the optimizer
I am trying to manipulate this code so that I can print out certain characters in an array of a string, but I'm not quite sure where to start.
http://rafb.net/p/h1aIH137.html
optimizations are not always specific to the instruction set
And the parser is a /very/ small, well understood part of the compiler. So it's all about optimizations.
If I change the printf to a %c, and string[3], for example, it doesnt work
well, i was thinking along the lines of MMX, SSE1,2,3, etc.
you don't want MAX_LEN + 1 in fgets
Hrm…
So I should take out the +1?
just in the x86 case, you have cpus that do 3DNow, but not SSE, others that do MMX and not the others, etc. after a while, that has to look like a big spaghetti bowl
And leave MAX_LEN?
ah, vector stuff. compilers don't do a very good job with those, IIRC. hand coding still wins.
vorpal, there are some research compilers that do a pretty good job of it
there's a vector pascal compiler, for example, that boasts speeds of up to 32x faster than C implementations for some particular image manipulation algorithms that lend themselves nicely to vectorization
(where there's hardware support, that is)
I am so confused…
i figured as such. there are some things that can easily be implemented using the vector processing units, while others, not so much so
i'm so hungry
yes, but i will speculate that those results are limited to specific types of algorithms.
confusion always starts with 'c'
So does catastrophe
Yes, I see that.
so does Cha-ching
which is not saying much, since vectorization is not always a gain.
vorpal yes, those that make extensive use of vectors?
;-)
what really amazes me is floating point math and how the FPUs are given the work…
at some point, someone way too intelligent came up with "fastmath"
and that's where my understanding goes bonkers
even with "friendly" algorithms, it's often a trade-off between throughput and memory latency
have a look at http://developer.nvidia.com/attach/6290 for the craziness that i am referring to
So nobody can help me?
and this trade-off often seems to be obliviouos to people who are looking for huge performace
Whats your problem?
I can't figure out how to printout certain characters stores in an array.
define 'certain characters'
Like, if the user types in "I smell good", and I wanted the output to print out just the word "good"
ah, parsing
I thought it would be substrings or something, but I've been googling around and can't get much help…
Assembly really is nice.
Try explaining what you want to do in words and in some detail. A solution may present itself to you.
OBCT:
The user inputs a sentence, such as "I smell good", and the printed output is going to be each "word" on it's own line, followed by how many characters each word is
I is 1 character, (newline) smell is 5 characters (newline), good is 4 characters
But I am having a great deal of trouble dealing with arrays that involve characters/strings, but I do understand how to use them with integers
?
what book are you even reading
How are you defining your array?
K&R 2nd Edition, in PDF form
hmm, what chapter is this
i heard the pdf had many errors, not sure though.
Just loop til you find a "space" and output \n instead
Well, I was doing like, words[i], but I'm not really sure Im doing it right
Hrm…
could you paste your src
i don't even know what your problem actually is
What is the line your using to read user input?
you could use getchar() to read user input, character by character.
and when it encounters a space, you can do whatever..
what is the excersise?
Yea just paste the source and describe the purpose behind what you are trying to do.
exercise*
This exercise isn't in the book.
so what are you trying to do then.
Just something I am playing around with to get a better understanding
Describe the purpose behind what you are trying to do.
Or what you want to have happen.
Okay, I'm gonna pastebin it
the code, or what you're trying to do
Preferably both
http://rafb.net/p/N8eEfZ52.html
That has my current code, which isn't much, and what I'm trying to do
Ok I'll look
I wanted to make it maybe so that, in the "if" statement, if the user types in a space, it takes everything in the array before the space and stores it
Okay, I appreciate it greatly
Are you talking about in real time?
Yes
Hmm
I don't know if that is possible, if the user is inputting everything on one line.
It's possible, just very complicated
Oh…
Like, I didn't want the user to have to do "Men" hit enter, "like" hit enter" to" hit enter, "play" hit enter.
When writing a console program, the standard format for user input is input entered then return key hit.
Oh…
the easiest thing to do is have the user enter a sentence, press return, then you print out the lengths of all of the words in the sentence, imo.
if you want to delve into advanced data structures, hashtables or tries would work well here
Hehe, I don't think I'm that advanced yet.
Ok. I see what you're trying to do…
Oh?
advance an index into the line looking for whitespace doesn't seem too advanced.
Lemme see if I can write it real quick
Thanks scottDkoDer, I appreciate it very much.
No prob. lemme boot up the ol compiler
Hehe, okay.
oh… i misread his objective. thought he was counting word frequency
sorry
this is a trivial problem
Oh, hehe.
It has got me stumped.
and yet you should not let people do your homework for you
where did you get your k&r pdf from
Well, I was trying to look for example so I can trace it, but I really can't find anything similar to what I was trying to do.
bah.
My internet buddy sent me the PDF
and feh.
But I have the 2nd edition book coming through amazon
yay!
Him and I are trying to learn it together.
I chose free shipping, so I couldn't wait to start
so = but
read the first five chapters, and then come back
Well, I am also in a class, and this is about where we are in it.
oh alright
what other languages have you programmed in?
Our project is to read and write to a file, doing a whole bunch of things with strings and characters, so I needed to make a simple program to understand the gist of it.
This is my first languae.
language*
when you get the book, you may find chapter 1 provides plenty of insight.
I went over most of chapter 1 in the PDF, but yeah, the arrays are killing me.
When dealing with characters
And the book for my class is just horrible.
I am waiting for the movie to come out
on programming?
:P
sure why not?
Hehe.
this is why in five years you will be writing advanced programs and lordollie will still be waiting
people tend to have problems with the exercises in the k&r
Hehe, I hope so.
I'm workin on it
consider reading the book in order, and not worrying about arrays until you get there.
so takey our time with it.
twkm, I would like that, but unfortunately in my class, we are dealing with arrays already
oh well.
Once class ends on August 1st, I can read K&R at my own pace.
I hate having to rush into learning concepts in weeks (but it was my fault for choosing a summer class)
I was just anxious to get into programming.
in the time it takes to read the book I could have hacked it together in php or java or something
so use php hosting or java then
coursework helps expose you to concepts, but ultimately your education rests in your own hands. the good grades are just a symptom
sounds like an undercurrent of palm greasing in vorpal's world
Yeah, I can see that now.
I think I'll learn programming by books rather than classes in the future.
BlueHippo, classes help instill good practice and theory, books and self learning are better for the practical aspects
Oh.
I suppose that makes sense.
With a good mix of both you will be on your way.
I hope so.
how do I break out of a function?
return
will it work even if I return an integer
it doesn't seem to work
that depends on what you have declared your function to return
volt, a book might help
anyone know how to neutralize lighting effects on an image?
keram, wrong channel?
I shall take a look at it scottDkoDer!
LordOllie, meh, cant find the right one so i figured someone here might know
this is a ##C…
So??
keram, have you tried #gimp ?
Maybe I can translate it into C, hehe
your solution is a C++ program
LordOllie, ah
So??
we tend to favor C solutions, seeing as this is a C channel
Quit being anal. I'm trying to help.
scottDkoDer, there is a reason a #C++ channel exist
When I compile, I get a bunch of numbers.
Maybe I messed up…
how are you helping? he is presumably taking a course on C programming.
If you want any more help I'll be in the #c++ channel.
Okay, thanks. I'm still looking over it.
Hrm, this is some weird stuff!
Gah, my internet keeps bugging out too.
hey guys
is there a way i can get this site http://www.eskimo.com/~scs/cclass/notes/top.html (summit's notes) .. into one html/pdf file?
wget will slurp it for you. then you can do whatever you want with it
wget theurl
?
or is there some –recursive flag needed
man wget. i would use something like wget -r -l 1 theurl
alrighty
thanks!
np
is there a quick way to initialize all my variables to 0?
depends
on?
on what you are trying to do, obviously
euh, well say I want to do some basic math with integers
I have int a, b, c, d…. z
is there a quick way to initialize all of them to 0??
if you have 26 ints ranging from a-z, you're doing it wrong, use an array.
arrghh
that was just an example
a = b = c = d = … = z = 0;
int foo = 0, bar = 0;
static int foo, bar;
also, objects are initialised to zero implicitly if they're of static storage duration.
ya
struct { int foo, bar; } mystruct = {0};
heh
int foo[2] = {0};
volt, there are probably more, but, it depends on what you are trying to do
I was waiting for a calloc() example
hehe
vorpal, which section in my c book would I look up on how to initialize my variables to 0 usint a struct?
the struct section?
but that will only initialise the struct members to zero
(vorpal's struct example)
http://pastebin.com/d5e7d65db but if I move the int i declaration into the default block, gcc on i686 gnu/linux suddenly starts to throw errors.
is it illegal to declare variables within default blocks in C?
compilation performed with gcc -ansi -O2 -pedantic -posix -Wall -o power power.c and run with ./power
only C99 allows declarations anywhere
otherwise it has to be at the start of a { } block before any statements.
also, only C99 allows for (int i = 0; …
ah, thanks. i first ran into that issue of for (int i = 0;…) not working when i was first learning C coming from a C++ background
right. actually IIRC gcc allows for (int i = 0; as a gcc extension outside of C99 mode, but it certainly won't allow it with -ansi
so -std=c99 ?
indeed
or -std=gnu99 ?
either should work in that particular case
sc
you've been very helpful, thanks again Chris
okay
i'm off for bed. goodnight
how do I make my printf output xxe05 instead of xxe0005
eh?
the exponent
like, for example, i'm getting 1.0e+0005 I want my output to be like 1.0e+05
volt, which format specifier are you using?
%e
is %E any different?
doesnt say on the site
printf("%e\n", 100000.0); produces 1.000000e+05 on my system
it produces 1.000000e+0005 on yours? that's strange.
if you want 1.0e+05, %.1e should be what you want
ok
well for example
hi. how do I combine two .a files into one? I tried 'ar crv libAB.a libA.a libB.a', but it didn't work.
in my case
unpack one.
would you please tell me the instructions?
my output gives 4.823e+005 I want it to output 4.823e+05.
volt, the printf docs don't specify any way of choosing the number of digits in the exponent, the only thing i can see is that it will be "at least 2 digits"
ar x
maybe iit's compiler dependent?
tkx very much..
could be
volt, c library dependent, actually.
so, is there a way to fix my problem then?
select a different c library.
you'll have to somehow format the number yourself instead of using printf's builtin :/
e.g., use sprintf the diddle the results.
hm, the instructor suggested using %le
still doesn't work, err, I don't care, i'll just tell the instructor he's an ass
with c99 an l length modifier is not undefined behavior, but it doesn't change the output.
let me try it on his compiler
BlueHippo?
I wrote it but it uses c++.
Howdy!
Yeah, I seen, hehe.
Oh
try that
okay, I will see how that works!
The numbers output was a debug thing
lemme know
for c++ help/instruction i suggest ##c++
If you want anymore help, I'll be in #c++
okay
yes, it works on the compile hosting my instructor uses
how do I find out what compiler he's using
ask him.
err, her.
who's using?
is there a gcc operator i can use to find the version?
gcc -v?
omg
gcc 4.0.3
if your teacher types "gcc …" then, why, of course sie's using gcc.
i'm using devc++
Me too
DevC++ uses GCC, no?
it's good
dev-c++ is an ide.
usually it uses mingw, a port of gcc.
devc++ using gcc compiler
or something like that
ah yes, mingw
um, i can't seem to find a chapter in my c book relating to header files
volt, which C book is it?
C for engineers and scientists
Gary
o.O
Bronson
I think it's a good book, I like it
its got so many examples i could rip off of it
oh, engineers and scientists have no need for headers.that looks like a C++ book
volt, what makes it a good book?
its got so many examples i could rip off of it
that makes a good book?
in my opinion, because it lets me finish my labs quicker
Lol.
ok seriosuly, this book sux ass, has no info on header files
reuse is a fine thing, though you should find what license covers the code.
hi
if none is specifically provided it would have the same copyright as the book itself, i.e., most likely illegal to copy.
headers are typically used to modularize code, with the headers providing the interface details. thus you can omit the use of them when that module does not provide facilities needed.
it's part of the lab criteria
then it would have been explained, possibly in the non-lecture course materials.
twkm, do you write C code full time?
no.
good night all
why would you need an entire chapter on header files?
just curious
a "chapter" is rather ambiguous. can you demonstrate a comprehensive treatment of C header files that does not constitute a "chapter"?
just curious
I haven't seen any C book which goes into great detail explaining header files
what sort of detail do you need
precisely my point
in my opinion, header files deserve more explanation, seeing as so many people misunderstand their "proper" use
I want to write a header file that contains prototypes from a specific function
or *for a specific function
then you ought to look at the part of the book that covers function prototypes
I would also like have a seperate source file containing that function
it also mentions something about using #ifndef.. #endif directives to prevent header from being included more than once in a program
why would anyone use sa_onstack to run the signal handlers on diffrent stack, what good is it give me?
ok nvm, I think ifound what I need
those are to guard against recursive inclusion of a header
volt, did you get the URLs ?
yes
reading
ok
BTW, volt, this design concept is called data encapsulation, sometimes also information hiding
so you will probably find more conceptual material (how to use headers to design APIs) in a book on software web design and architecture, the C books typically cover just the techniques (not necessarily how they fit into design)
so you will probably find more conceptual material (how to use headers to design APIs) in a book on software http://www.oxxus.net/web-design/index.htm">web design and architecture, the C books typically cover just the techniques (not necessarily how they fit into design)
ideally, the header file is the public interface, and the .c file is its private and hidden implementation
iota, a project I am working on from which I posted 2 URLs as examples for volt
what sort of project
a library project
http://www.sunrise-tel.com/software/devtools/sunrise-data-dictionary.shtml
hashtable for any type of data, with built-in reference counting
you can see data encapsulation being used a lot in that project
alright
all open source, no secrets
(;
I had to go through some horrible code a few days ago
I always have to go through horrible code, I work on a project which forked Asterisk, the most horrible shit you can imagine
you don't know how irritable it is to see code that isn't written properly
but yours is pretty decent
hah
alright, well i'm going to go back to studying some stuff
so i'll talk back in about an hour
their so called API is to expose what they call "private structs" to the public and everybody is poking around in those "private" structs
ttyl
messy
sounds like a large company. how many employees?
Asterisk is an open source project, run by a company in Alabama, called Digium, they're not so big, maybe 20-25 employees, but they have an army of fanboyz contributing (horrible) code
i meant sunrise
nah, we're small, 5 ppl here in Tokyo and some representatives in OZ and EMEA
you design your own boards?
we are the Japanese reseller for Sangoma's ISDN boards, we also have board manufactured for us from reference designs of Cologne Chip, a company in DE which makes BRI ISDN controller chips
still, that's impressive.
lot's of mac-osx references at your website
for the embedded PBXes and the Mac ISDN adapter box we use off-the-shelf available single board computer boards and stick BSD on them with our own heavily improved version of the Asterisk software
benjk, are you familiar with eon and nortel?
I used to work for Nortel, like 10 or 12 years ago
any linux host based products?
well, Asterisk is essentially linux based, but we chose BSD for the embedded devices so we don't have to keep source for every version of the firmware available for 3 years, keeping and managing the sources of the last 3-6 months is already work enough
also our SS7 stack and all the published libraries work on Linux just fine
balso our SS7 stack and all the published libraries work on Linux just fine/b
hey, i'm new at C…
and?
a good book should help.
i don't understand difference between char * t or const char * t
yeah - all say so…
do you know what a char * is?
pointer to char
ok, do you know what const does?
nope it's kinda constant but…
dunno!
it's the c keyword for a constant
like, const int i = 10;
const is a promise that you won't modify the object.
hmm so i can't change i after that right?
via that alias.
not by that name, and there are no names by which you may.
but consider int a; const int *p; p = &a;
you may change a via 'a', but not via '*p'.
ok i see!
i wouldn't exactly call it a promise, more of a verbal agreement
more like a contract etched in stone
it's hard for me the & * stuff too …
though, it's probably non-standard if you get around the const-ness of it
the consequences are undefined if you do that.
heh ok
c can try to promise you whatever it wants, but the fact is you can still modify it as long as the hardware allows you
)
that's not meant to be a joke
i understand that!
just sounds funny - bu true
*but
Hello world
moo
ok - i can add pointer to variable &var - how to do reverse thing? like simple add to variable info that foo points to ?
with &var
ehh sorry for my english
Zhivago ?
char * i that comes from function parameter, inside function i have char l = (something to do with i)
char l = i doesn't compile host ofcorse
*of course
what does your book say about what you can do with a pointer?
http://home.netcom.com/~tjensen/ptr/pointers.htm
sad. but anyway, what does it say?
well point to address
incrase pointers
and what is it you do with a pointer that is pointing at something?
reading?
chapter 1 discusses it. perhaps you should read it again.
or even changing
maybe
Fleck, yay brute for learning C FTW
*force
what?
nevermind
Zhivago, regarding population, there is one definition I can't work out "Population Doubling rate"?
populations generally change by some factor of the population size.
say that from T1 to T2 population increases by 1.02
in this case, how many such transitions will be necessary for the population to have increased to 2.00?
that is that population doubling rate.
Ooh, thanks
bbl
bryno
wozi
:o
does anybody know of a light weight IRC framework? single threaded, that can only join a channel would be ideal
(in C, but I guess that is implied in this channel)
H264, google does.
mmm
just wondering if anybody knew
Sorry H264 not of the top of my head
oh well… it's just that I'm probably not searching for the right key words
http://www.google.com/codesearch
holy smokes… I'll play around with that to see if I can find what I want
Very handy
I'm… seeing that
Hey guys
hi
i got a question
which is?
how to flush a buffer when reading from socket ?
read until no more comes? Or until you hit EOF?
sci3ntist, what socket library anyway?
sci3ntist, unless the socket is blocking
obey the protocol.
i wander why i was able to join here now? does using ircatwork.com makes me banned on this channel?
Hey
hi
guys i got a question
probably.
how to flush the buffer when reading from a socket ?
obey the protocol.
tsk..sad fact, it's the only way i can prolly on irc at work.
flush the buffer when reading?
change jobs?
lol
give me IRC or give me unemployment!
twkm; yeah
it could be worse. your so might not let you irc from home either.
Greetings
May I ask for some help?
don't ask to ask, just ask
thanks….
I need some help with this
http://ubuntuforums.org/showthread.php?t=381545&highlight=a2mp3
yeah guys glush the buffer
Takmadeus, asked in #ubuntu ?
flush the buffer
indeed
no answer
it is kind of difficult to find coders at this time in there
y no answer
I don't see how it's strictly C related
well
Do I have to read the entire thread?
let us say that I am not picky
it is more like a favor
nope
just the first porst
I tried to do it in GAMBAS
but it was not easy
actually it is quite difficult
Guys plz answer about socket
i have. twice.
twice
Hi … I have a working server app which compiles OK on linux's gcc, but I would like to run that app on windows. I downloaded windows SDK, visual c++ express and I tried to compile it on windows, but it doesnt work . Can somebody pls take a look at it and tell me which changes should I do to it to make it work? Thanks a lot… http://rafb.net/p/gNWdiH72.html
Takmadeus, get the gtk+ libs, go son go!
so I guess C would be more powerful yet I do not understand C
Takmadeus, power is not really an issue here
Takmadeus, looked into bash?
Takmadeus, Bash would be your best bet
you have a lot of work ahead of you.
cannot understand it…. I am very clumsy when it comes to coding
so I thought
my best bet would be to get to the place coders gather
twkm, can you help me with that pls?
I hope I am not bothering you
ask a question.
twkm, what should I do to make my app from linux compile on windows
learn winsocks.
Administrator, work from the errors VC spits, and you'd probably need new signal + sockets
keep on keeping on
Takmadeus, your on Linux, bash is practically made for things like that
Administrator, does that express studio comes with help files ? you need to check windows sockets
Administrator, there is not much work , if you just have that one file
zacs7, at first it spit errors about not finding libs, so I erased the lines with that libs and added new line with winsock2.h
b00, which file?
your casts on 29 and 30 are funny.
b00, that help file?
Administrator, the one you said to look at ?
Yes, I am on linux, and I intend on keeping on trying yet, I have a huge urge on this, but rest assured that my intention is to learn. But time is kind of an issue here
ahh, homework.
Administrator, and check the windows 'posix layer' (if that is whats it called). (_close(), _open(), _write() … )
b00, that file doesnt compile on win32
Administrator, read http://tangentsoft.net/wskfaq/articles/bsd-compatibility.html
nope, nothing like that
I am not even studying anything PC related
Takmadeus, find some bash tutorials
curious thing, I study medicine :p
then what's the rush? get a book, learn c, write program.
Administrator, I gathered that
and read the link I posted
b00, excuse me, what did you gather?
that it doesn't compile on windows!
moin
the bsd compatibility article?
Administrator, budeme vykonavat prikaz — whats that? bulgarian ?
Administrator, you're not going to get it working by bruteforce
he probably doesn't have the posix layer installed.
Takmadeus, sorry that was directed at Administrator, you should learn bash
b00, its czech .. it means: we will do this command
Administrator, ja znau chto eto, na russkij poxoge
hmm I'll try to find some books on it :p
thanks guys
See ya' around
b00, I understand you a little
first Administrator should learn sockets. then perhaps winsock.
Administrator, anyway, please go read some windows sockets lib docs
b00, I wrote this app reading the BeeJs guide on sockets. It worked on linux and I wanted to port it to windows
Administrator, and twkm kinda things that you should learn sockets for starters
Administrator, why do you bother with porting, if you just started learning sockets ?
b00, because only guide for making client/server apps I could find was that of Beej
Administrator, its prob the best guide for starters, but its *NIX bases,
based
b00, thats right
b00, and since I could not find anything else for win32 then I wrote linux server and wanted to port it to windows
recv then null terminate then system shows that not enough has been learned as yet.
Administrator, if you are on windows, and have VS, try to start with their docs ? unless they don't come for free in "express" edition
msdn has essentially beej but for winsock. almost anyone can find it.
yea
twkm, thats right, I did not learn much; but the app is working on linux and I was hoping to port it…
"working" is subjective.
if you send two lines in fairly quick succession from the client i don't think you'll like what the server does.
twkm, ok … it does what I want from it
ahh, "good enough". figures.
twkm, ok
its poor quality. I just started yesterday
http://msdn2.microsoft.com/en-us/library/ms740673.aspx
twkm, thx … I will take a look at it
twkm, hm … there is a complete code for working server on that MSDN … when I copy paste it into VC++ it doesnt compile …
twkm, it complains about undeclared identifiers
declare them.
which likely means you need an #include or two.
can you pls take a look at that source code? I thought that when it was from m$, then there will be no errors
http://rafb.net/p/oyi44K42.html
http://rafb.net/p/hWff0i48.html
since you are writing c++ you should ask in ##c++
hello
moo
i have a little problem with a program that i write, it returns a Illegal seek for the second and further send calls
http://nopaste.debianforum.de/6224
maybe someone have a little time
to look over the sources
someone said me that this error messages occure if i i.e. run out of an array
if (sent==-1);
yes?
if sent is -1 do nothing. in the following block, which is always executed, perror even if no error occurred then return.
i see that sending doesn't return a specific value unless there is an error. that's probably not smart either.
ditto init_conn.
if i understand you, i should better take this partes out of the source?
no.
you should learn what ; does.
could i get any help on RPC?
if have read that send return -1 if there an error occure and the amount of bytes when there is succed
there are many types of rpc
like unix with sunrpc
yes, and what do you feel if (sent==-1); { perror(…); return -1; } does?
that he should return -1 if there an error
the first semi-colon is important. consider your if in init_conn, why don't you have a ; after if (…) there?
since you seem to want esp before help, i would guess that you won't get any help, all the espers being on vacation.
i am a little bit confussed about which line we are talking in the moment?
i refere to standar rpc
i've got this structure on my .x
which os?
linux
typedef int res;
typedef opaque datos;
union ticket switch(res resultado){
datos contenido;
!pastebin
anyway, use pastebin hardchup!
the bot msgs the info needed.
*i
ooh sorry
sorry
i've got a opaque data
i init on my server stub and set data on it
but client always receives null
i dont know what to do to receive correct data
huh?
what the hell.. isn't itoa() part of stdlib?
moshisushi, sprintf is
wobster, aah that's true
moshisushi, y cant u use str() function
str() ?
str() converts objects to string
if that is what u looking for
sprintf(str, "%d", num); works fine for what i gonna do
return_of_neo, please shut up.
a) there is no stdlib; b) no.
what str function?
twkm, ok the ansi standard library then
or isn't there such a standard either?
in that case, see (b).
str(1)
'1'
get it ?
are you sure you are in the right channel for that suggestion?
It seems not
what fricking language is that?
a person might write such a function, in c. but it isn't standard so you'd have to ask them for their code / happen to share that library.
twkm, maybe you can explain where is my mistakes in my sources
i don't really see my bug
anyone good with the ncurses lib?
i tried.
moshisushi, I'm okay
i just have this strange problem with ncurses menus.. seems like if you have a string containing any "not so common" charaters, that menu item will disappear
ncursesw
omg
i realy supid
characters that would work fine with printw() etc
moshisushi, as twkm said, ncursesw
twkm, thank you
zacs7, aha so it has full charater set support?
UTF-8 would be neato for us non-english people
yes it has wide-character support, twkm already answered your question. Research ncursesw.
ncurses=multiple curses??
a library to swear at you
new curses
bah
all new cussing!
int curse_user()
?
i was joking offcourse
Oh, ha ha
but it really is obscure
who thought that printing is "adding characters"
i'm trying to write a simple packet sniffer, the only thing i'm having problems with it figuring out where I have to convert from network-byte-order to host-byte-order, are there any 'general' rules to this matter ?
rvsjoen, endian issues
is ncursesw extremely obscure or what?
moshisushi, pretty straight forward actually.
no but i mean.. hard to find
moshisushi, you on Unix/Linux I presume?
writing a packet sniffer without knowing basics of networking? :/
zacs7, yes fedora
it's pretty easy to find
try the fedora offical repos
why use move for moving the cursor? move is unix syscall
none. you must read the protocol specifications for each protocol you want to "decode".
i'm trying to figure out why the tot_len of the ip header needs to be converted with ntohs and the ihl,version and protocol fields do not
Goran__, because it's common
ok
no it isn't.
i figure it's a good way to start learning
zacs7, aaah sorry i got it now
it's included in the ncurses package
you just have to change the linker flag
"just".
yes, just
twkm,
you don't have to install anything, that's what i mean
ahh.
gnight
linking agains -lncursesw and -lmenuw worked like a charm!
i see all my weird swedish letters now, hooray
0) ? f : n ", float or int ?
where's your book?
???
do you have a book?
a pdf version.
sounds like theft — and thus no wonder you don't value it enough to read it.
twkm why do you send all to read books? Can't you help?
that is help. some don't appreciate it. *shrug*
Fleck, books own
z
i know
but to find something - it takes hrs…
i like books
pdf also spend my bandwidth.
and i do read them
Fivestar give me url
Fleck well i usually get frustrated when I'm in a hurry trying to fix something and people just tell me to google for it, which i of course did 100 times before asking the damn question
better not, unless you don't like using ##c.
sometimes you need help to understand what you're looking for
eh
moshisushi true
for your question, why not just try ?