- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
i was thinking of putting the file on a 8mm DAT tape.
or a DVD-DL, but that's sacrificing a bit of the point to make it more accessible.
I think @raceprouk would disagreeAdmin
But I did find this: [image] Which is weirdly appropriate to the search terms, when you think about it…
Admin
Admin
Conversation complete. :giggity: entry logged for future conversations.
Admin
This analysis seems quite misleading. Byte.valueOf(x) does not create a copy for every value input, it uses a cache internal to the Byte class for recycling values, so at most 256 Byte objects get created, regardless of file size. In a 32-bit JVM, addresses cost 4 bytes so, so the memory required by the vector to store the Byte pointers is about 4fileSizeBytes (which isn't really mentioned), and the final byte[] array would be just fileSizeBytes, so only ~5fileSizeBytes is needed in memory, discounting constant factors. I wonder how this 9-10 number was computed.
Admin
Won't work. The PipedInputStream and PipedOutputStream classes are a matched pair; you can't cast in and out in any useful way. That's because the two classes poke around in each others' implementations, so there's no point in trying shenanigans to work around it; you just need to hold your nose and spawn a thread to copy stuff. (A thread! To copy I/O buffers! In 2015! :confounded:)
Java's IO is chock full of miserable stupidity and lack of vision, and they've not yet managed to unfuck it. Nor has any of the third-party libraries really done any better either. I can't even do trivial things like selecting on subprocess pipelines! That's trivial and they fail at it.
Admin
This was actually called "I am going to modify working production code which I have not been asked to work on because I do not understand the Dunning-Krueger effect."
Admin
I am so tempted to :fa_flag: now!
Because there's no way I'd play the file.
Admin
you, you i will email 500 copies of that file.... yep.
Admin
You and what botnet?
Oh, wait...
Admin
I like that you think you have a valid email address for me that has a quota large enough. :smile:
Admin
ther are ways, and ways,
as for the quota, that is rather the point, no?
Admin
And we have had lecturers keep telling us since memory is so cheap, writing memory efficient code is no longer important.
:facepalm:
Admin
Well, it's more Microsoft's problem than mine, especially as I have other email accounts. :smile:
Admin
/me makes a point to multi send the payload to @frostcat's other email addresses too.
/me makes a point to find out what they are first.
/me decides it's simpler just to send the files to everyone in the world... that will guarantee delivery and make sure that everyone else that gave her flags gets what's comming to them too
/me decided it given such an email job would bring the internet to its knees it would probably be just as legal and effective to override the launch codes for a couple dozen nukes and detonate the warheads in the ionosphere causing a massive EMP that wipes out most of the electricity grid world wide.
/me hiccouchs
/me takes another sip of her third rum and coke
/me giggles at the thought of global destruction/domination
Admin
/me is slightly worried by the sound of a fox cackling manically
/me is at least comforted by the thought that she will be protected while @accalia executes her plan
Admin
Admin
PipedInputStream and PipedOutputStream don't do what you think they do: You create them and pass them to APIs that expect streams. Data written to the PipedOutputStream comes out the PipedInputStream. They are analogous to the
pipe()
call in C.To hook streams together you need to read from one and write to the other. You might need to do this from another thread (have Now problems. two you) because blocking IO. It's not fun.
Admin
That won't stop her :P
Admin
But surely if the keyboard and typist are in moving reference frames, (and the keys have their own), then there'll sometimes be disagreement about which key made contact first?
Admin
With relativistic speeds I meant that once you type sufficiently fast, the key hits race the propagation delay in the copper medium. It's all about variance in the distance between key and decoder chip. If we take the tyops example, you have to wait out the 50ps, otherwise it depends on circuit layout which key will be registered first. Of course once you get used to your keyboard model, you can adjust your habits.
Why'd you think ZXC were chosen for copy-cut-paste? That's right, because the keyboards of the time had their decoder chip top-left, which meant that CTRL and ZXC are approximately equidistant from it. That's why people want their IBM Model M and nothing else.
The shift keys are particularly hard because there are two of them and you have to adjust your timing just right so they don't catch a letter before or after. It's a failure of education really, because we are taught to use the opposing shift-key when learning to touch-type. I'm currently switching to same-hand shifting and you wouldn't believe the improvement in typing speed. Unfortunately changing habits takes its time, so sometimes I fall back to the other hand when shifting, but with incorrect delay. Still I'm almost back at the 108.605WPM I had before switching.
Admin
Beats me...is TRWTF that I can't post an acronym in the forum? :-P
Admin
I thought it was because on early Macintoshes F1 was for Undo, F2 for Cut, F3 for Copy, and F4 for Paste, and the simple keyboards didn't have function keys, so they mapped that functionality to the leftmost letters on the bottom keyboard row.
(Not that I'm really sure, but I definitively noticed when Windows 95 adapted the behavior I was used from MacOS for years.)
Admin
It's all lies spread by people wanting to sell us shitty slow keyboards. Why, they're even using low-grade copper nowadays, so the delays are worse!
Admin
EBCDIC?
<Like this?
Admin
THE FORUM DOESN'T ALLOW ALL CAP POSTS.
Edit: That went thru cause punctuation. And there are other :evil_laugh: ways...
Admin
NOT SO
THAT WENT THROUGH BECAUSE QUOTE
Admin
As I said...
Admin
DISCOURSISTENCY...
<!-- HTML comments do count -->Admin
The original post was:
EBCDIC.
with a trailing perod.
Admin
You'll get used to it...
Admin
It depends on the punctuation you pick. I find an ellipsis character works just fine, and a non-standard type of whitespace (Unicode's got all sorts of evilness!) might work too, but I've never got around to testing it. Failing that, some FauxTML (e.g.,
<discotoaster denied!>
) does perfectly as it will be sanitised out after the shoutiness check.Admin
Someone practicing magic without a license again? [image]
Admin
As bad as the code looks, with its cast from byte to Byte, the JIT will see right through the dumb cast and skip it entirely. If the code is not run enough to be JITed, then there isn't a performance problem anyway. So...eventually this won't be a problem, or the code isn't called enough to be a problem.
Admin
I wonder if there are any statistics on gender ratio in plumbing profession that would warrant feminine pronoun use in a generic case.
Admin
You didn't miss much, it was pretty disappointing. Well, maybe apart from this:
(NSFW) http://i.eprci.net/badger-meatspin
Admin
Maybe @gleemonk chose to use the opposite of the expected gender.
Admin
I'm not much of a plumber and I'm mostly male. Working from this knowledge I deduce that plumbers are statistically more likely to be female. The one plumber I met once was quite male by my standards, but I'm not gonna rely on anecdotal evidence.
Admin
seems logical to me.
Admin
http://phe.rockefeller.edu/barcode/blog/wp-content/uploads/2008/09/red-herring-final.gif
Admin
this code is indeed stupid, but the analysis isn't quite right; there are only 256 possible
Byte
objects, and so on Android, all 256 are created at system-initalization time, kept around forever, and re-used as appropriate. an array ofByte
objects is still less memory-efficient than abyte[]
, and there are plenty of other stupid things about the code, as mentioned in the article.Admin
No, you can always call
new Byte(…)
yourself because the constructor is public, and the general contract ofnew
guarantees an identity-distinct object in that case. You'd be idiotic to do it (and the code in the article doesn't) but you can if you insist.Admin
I think he is talking about the coder should have used Byte.valueOf() instead of new Byte() if he really need to use Byte as object, so the cached Byte objects of the runtime will be used all the time.
Admin
http://pbs.twimg.com/media/CBEZLg1VAAAU9Um.jpg
Admin
Admin
So... instead of allocating an 8-bit byte location, it allocates a 32-bit (?) pointer to one of the 256 static 8-bit byte locations?
Why not replace the pointer with an 8-bit offset and add it to a fixed base address? If the bytes are stored in binary order, this'll result in the 8-bit offset conveniently being equal to the 8-bit byte it's pointing to...
Admin
It's not a pointer, it's a pointer-divided-by-word-size. All Java objects are aligned on the heap so it can have a heap larger than 32 bits.
Admin
Belgiumer?
Admin
YOU SHALL NOT CAST!