Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!

Andrew Watson

Greenhorn
+ Follow
since Dec 02, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Andrew Watson

Does somebody need a good skilled Swing Developer?

Contact me via PM

Thanks

6 years ago
Hello

Is there a vacancy for remote Swing Developer? The project based work which I can do from home?

Any comment is appreciated

Thanks
7 years ago

Bear Bibeault wrote:Have you debugged your loop as I suggested?



Yes

I want to show you the decipher code:

the decipher defined the same as for encryping...:



How you think maybe there is a problem? I heard that to decrypt there should be some differ alg parameters but I am not sure...
7 years ago

David O'Meara wrote:BeForthrightWhenCrossPostingToOtherSites
http://stackoverflow.com/questions/5505418/downloaded-txt-file-become-shrinked



It is not . They don't answer for long time so maybe they simply don't know how to help me with the question. So I hope you can
7 years ago
here is the original text:

I don't know when it happened.
I don't know when she came,
But, she's the one I always knew,
Grandma was her name.

She taught me how to tie my shoes.
She taught me how to talk.
And, though I can't remember,
I think she taught me how to walk.

When all the other kids in school
Would talk about Mom and Dad,
I wondered where my parents were,
That made me kinda’ sad.



here is the downloaded text:

I don't know when it happened.
I don't know when she came,
But, she's the one I always knew,
Grandma was her name.

She taught me how to tie my shoes.
She taught me how to talk.
And, though I can't remember,
I think she taught me how to walk.

When all the other kids in school
Would talk about Mom and Dad,
I wondered where my parents were,
That made




Why the code doesn't download the whole txt files ? As you can see the downloaded file missing text How to fix it?
7 years ago

Bear Bibeault wrote:Have you compared the files? Could the difference be perhaps in how lines are terminated?



Yes, I opened it and watched its content... I don't know why but I get lost the final bytes Please help me to understand why
7 years ago
Hello

I am writing servlet which is to download files to my desktop app and then save it on my hdd. I have tested the code and it works fine for binary files like video ot images or even doc files but it doesn't work with txt. It looses text.

Here is the problem code:



For example I have just downloaded a txt file so its original length is 1722bytes but the downloaded version contains 1696bytes ... So where I could lost its final 26 bytes ? I suspect the final chunk occures the problem but I don't know how to fix it. Please help


Any useful comment is appreciated.
7 years ago

Rob Spoor wrote:I still don't see the code I asked for.

Anyway, if you need to write a 67MB file into 4MB chunks, that should require 16 files of 4MB each and one file with the remaining 3MB. I get a feeling that you're forgetting that last file. 17.3MB gives you 4 files of 4MB which merged together gives you the 16MB from your starting post. If you forgot the file with the remaining 1.3MB then you'll miss that 1.3MB when merging.



That's right. I get missed the remaining Mbs because it is pretty hard to calculate as for me Especially if all writing is in while loop... The problem is I canot predict the file length so it can be any length... Even smaller than the standart chunk I couldn't find any algorythm which handles the task... So I guess I need some theory advise
7 years ago

Henry Wong wrote:

Andrew Watson wrote:
I have found this code
http://java.sun.com/developer/technicalArticles/Programming/PerfTuning/

but it reads and writes file by 1byte per iteration but 4Mb



It does it a byte at a time with the first example. The article goes on to using the input and output stream methods that use arrays to improve performance, along with a lot of other stuff. What was wrong with the other examples?

Henry



Well I want to make RandomAccessFile read and write file by 4Mb pieces but not 1 byte long
I don't know how to devide the 67Mb file by 4Mb right without loosing the final bytes because that makes file corrupted
I couldn't find any standart example in this area so I hope you can help me.
7 years ago
To present my question more clearly I want to show you an example

I have found this code
http://java.sun.com/developer/technicalArticles/Programming/PerfTuning/

but it reads and writes file by 1byte per iteration but 4Mb

How to make this code read each 4Mb from A.dat and write these each 4Mb to file B.dat with no data lost?

7 years ago
Hello

I am trying to use RandomAccessFile to read and write big binary file A.dat by parts of 4Mb and write in into file B.dat (by parts too)... But my problem is I get wrong file B.dat length and its data is corrupted.

For example
- file A.dat length is 17.3Mb
- then I write file B.dat with 16Mb length but it should be totally like A.dat (17.3Mb) because I just want to copy A.dat with RandomAccessFile into B.dat

I know I should work around position or seek but I have no idea how to get correct file B length and correct file content.

The problem is I want to copy big files which can be copied by parts so I need to use RandomAccessFile only...

Please give me an example how to use RandomAccessFile in such a case being able to copy file A to file B correctly?

Please help...
7 years ago

Jesper de Jong wrote:Well, if your computer has only 512 MB RAM, then that might very well be the problem. If there is not enough memory, the OS will start swapping things to disk, and all that swapping can make your machine react extremely slowly. Have a look in the Windows Task Manager, at the Performance tab, and see if it's using all your RAM.

If possible, try to add more RAM to your computer, so that you have at least 2 GB.



Wow does GWT demands 2 GB RAM to run?

Well I watched the TM and it shows eclipse takes <=150MB memory to run with GWT . But I also hears that 1GB RAM behaves the same slow with GWT so maybe there is a walk around?

5 browsers compilation at once decrease to just one for example?
You mean you checked control panel as checked (General - Temp internet files (temp files settings) - keep temp files on my computer)
Is the checkbox selected?


this phrase as

Could not launch from cache. Will try online mode. [Some of required resources are not cached.]


means you don't have the app required classes or resources installed on your computer. So as a
case... you can redownload the updated version into tour cache by getting in
(General - Temp Internet files (Views) - (find youp app in the list) and start it with Run button)
that should upgrade the cached app classes I guess

Report if that helps

PS
and as a case watch the cache available size.


7 years ago

Amandeep Singh wrote:I would recommend you to uninstall milyn plugin or all unused plugins. This would help to remove unnecessary load on eclipse.



And I noticed the GWT design is always touches HDD but there was no save or compile command
WHy GWT is sticking to hdd and how to fix this?

I did no additional settings just downloaded eclipse and GWT essencial plugins so maybe I missed something? Give me a hand please