Hey guys, i need help with serialization and collections. Can you help me out?
Name:
Anonymous2007-09-12 9:28 ID:FwKReFJr
Yes. But will we?
Name:
Anonymous2007-09-12 9:30 ID:J6AeckUE
I would help you guys out if i could. I always deliver whenever the situation allows me to.
Just give me some tips about them both, i will find a way to reward you guys. With cool things, not DEVELOPERS DEVELOPERS DEVELOPERS DEVELOPERS and etc.
Name:
Anonymous2007-09-12 9:33 ID:FwKReFJr
PROTIP: One turns objects into bytes, the other holds objects and allows for iteration.
Name:
Anonymous2007-09-12 9:36 ID:J6AeckUE
I guess that asking for more (i mean, some code blocks) wouldn´t mean you´d deliver, aight?
ObjectOutput oo = new ObjectOutputStream(new FileOutputStream("/home/hitler/srslization"));
oo.writeObject(c);
oo.close();
And that's how you serialize.
Name:
Anonymous2007-09-12 10:06 ID:J6AeckUE
its quite shallow, but, it´s something already. can you help me with this one?
so i have to load a truck, and there are 3 different types of loads: boxes, liquids and some other shit i can´t remember the name.
i must load the content to a registered truck i have, and it must follow these rules
a truck type must be loaded with it´s corresponding load type (boxes in a chest, liquids in a tank, shit in a stuff)
the ammount loaded must be allocated to a truck that has the closest capacity to it (which means, if i will load 100 of liquids, the best choice and THE choice must be the truck that can load at least 100, but it´s closer to that value. (aka, not a 500 load truck, but a 200 load truck would do it)
the trucks capacity must be lowered by the ammount just loaded
the load instances must be saved in the truck´s instance, through a collection
Name:
Anonymous2007-09-12 10:14 ID:TLpee3Dh
>>9
What course is this? ``ENTERPRISE Asshattery 101''?
>>9
I'm new to functional programming, but I can already tell that you get your answer by filtering out trucks that don't carry your load type, then by trucks that are strictly below the load capacity, and then reduce by the min function.