> >> I am trying to use bitwise operators on chars. What is the simplest
> >> way to make this work? The only way that came to my mind was:
[quoted text clipped - 12 lines]
> Also, futzing with bits on as char is probably a bad idea, unless you
> fully understand UTF-16 and Unicode. What are you trying to do this?
> I have a homework to implement RUDP[1] in Jasper[2]. Now, Jasper uses
RUDP = reliable UDP. Cool, thanks for the pointer, I didn't know such a
thing existed.
> a specific format for packages, namely all data is a String (which
> makes sense, since it abstracts all headers and the like). However, my
Ugh. No, it doesn't make sense to use Strings. They should use classes
with the UDP fields defined appropriately. Stuffing random data into a
String is utter laziness and horrible design.
> homework is to also implement the package header; hence my char
> troubles. I agree that it is not a very healthy way to work, and I
> blame the teacher who gave the homework, but I am unable to find a
> different solution.
Between your teacher, and whatever grad student that wrote the mess that
is Jasper, I'd consider a new school.
You may want to check out a book by Douglas Comer called Internetworking
With TCP/IP, Volume II. It contains a full TCP implementation. At no
point does he do anything lazy like stuff fields in to byte arrays. He
defines a full, complete, well documented C struct for each and every
packet he uses. Much better design philosophy, imo.
Wojtek - 15 Mar 2008 21:14 GMT
Mark Space wrote :
> whatever grad student that wrote the mess that is Jasper
I am in the process of deciding whether to use BIRT or Jasper.
What is it that you do not like about Jasper?

Signature
Wojtek :-)
Mark Space - 15 Mar 2008 23:04 GMT
> Mark Space wrote :
>> whatever grad student that wrote the mess that is Jasper
>
> I am in the process of deciding whether to use BIRT or Jasper.
>
> What is it that you do not like about Jasper?
Well, I have not used Jasper. I was just going from the OP's
description that, apparently, the IO interface consists of passing UDP
packets encode as arrays of bytes, plopped on top of a String. That's
just ugly, if it's correct.
Jasper looks like a simulation, and they could have spent some time to
actually encapsulate the various packets that are used for the simulator.
Just going from a quick look at the docs though...
Wojtek - 16 Mar 2008 18:22 GMT
Mark Space wrote :
>> Mark Space wrote :
>>> whatever grad student that wrote the mess that is Jasper
[quoted text clipped - 10 lines]
> Jasper looks like a simulation, and they could have spent some time to
> actually encapsulate the various packets that are used for the simulator.
Ah, ah, ...
Ok, I should have paid more attention to the topic I guess.
There is a Java reporting tool named Jasper, used for making pretty
reports from database values.
http://www.jasperforge.org/jaspersoft/opensource/business_intelligence/jasperreports/
Thanks...

Signature
Wojtek :-)
Vlad Dogaru - 16 Mar 2008 11:09 GMT
> > I have a homework to implement RUDP[1] in Jasper[2]. Now, Jasper uses
>
[quoted text clipped - 15 lines]
> Between your teacher, and whatever grad student that wrote the mess that
> is Jasper, I'd consider a new school.
I know it's off topic, but it's my intention to /become/ the teacher
and stop making this kind of mistakes.
> You may want to check out a book by Douglas Comer called Internetworking
> With TCP/IP, Volume II. It contains a full TCP implementation. At no
> point does he do anything lazy like stuff fields in to byte arrays. He
> defines a full, complete, well documented C struct for each and every
> packet he uses. Much better design philosophy, imo.
Well, as far as I could tell, Jasper is more about seeing how the
protocol actually works. Actual data is not usually transmitted and
the user decides the actions taken (such as timeouts, CRC fails,
medium losses, etc.). Still, that's no excuse to hand out a homework
like the one I am facing.
That being said, I got the answer to my question. Thank you all and
apologies if this turned offtopic.
Have a nice day,
Vlad
Mark Space - 16 Mar 2008 18:02 GMT
> Actual data is not usually transmitted and
> the user decides the actions taken (such as timeouts, CRC fails,
> medium losses, etc.). Still, that's no excuse to hand out a homework
> like the one I am facing.
Yes, I understand how simulations work. I'm saying, regardless of the
type of project (simulation or real thing) stuffing data into an
unstructured buffer is the worst way of organizing a design.
In other words, your education is being cheated by giving an example of
bad design, and telling you that it doesn't matter because it's not
real. Simulations and academic projects are real designs too, and
should be treated as such. There's no excuse for sloppiness.
> On Mar 15, 5:56 pm, Daniel Pitts
> <newsgroup.spamfil...@virtualinfinity.net> wrote:
[quoted text clipped - 14 lines]
> homework is to also implement the package header; hence my char
> troubles.
I would treat the header (when finally rendering it to the wire
format from some higher-level format, like an object) as byte[].
Then you avoid all the character set issues because you're not
working with characters; you're working with bytes, which is what
you want to work with anyway (right?).
- Logan
bugbear - 17 Mar 2008 11:18 GMT
>> On Mar 15, 5:56 pm, Daniel Pitts
>> <newsgroup.spamfil...@virtualinfinity.net> wrote:
[quoted text clipped - 20 lines]
> working with characters; you're working with bytes, which is what
> you want to work with anyway (right?).
Yes; mapping strings (e.g. user level data) into byte packets
is a likely operation in this context, but it must be done explicitly;
simply assuming that String is nearly equal to byte[] will lead
to all manner of trouble.
BugBear