I am building a application in j2me where i will receive an image via a Wireless connection. I want to know what can be the maximum length of the filename when i save it. My main motive is to store some information about the image via its filename.
The maximum size of data that you want to store in RMS can be set in JAD file using MIDlet-Data-Size attribute. If the phone is JTWI profile complaint, the application can store 30 K data in RMS.
If this attribute is set, the AMS will check for the availability of space requested by application before downloading it. This way you can be safe that if the phone downloads the application, it would run successfully.
May be you can find some useful information in this discussion:
http://discussion.forum.nokia.com/forum/showthread.php?125151-Min-size-of-RMS-on-MIDP-2.0-Devices
Related
My webpage automatically creates a .pdf file and a link to go with it. I want the user to be able to download the file from the link-- but only once (or maybe 5x or whatever I decide later).
Is there any easy way in IIS of limiting the number of times files in a particular folder are served before requests will be refused?
There is no relevant configuration in IIS that can limit the number of user downloads.
You can completely implement your needs in your program. Add the code to count the number of downloads by the currently logged in user. Restrict users according to the limit times you set.
Is there an efficient method to find specific data in the memory of a running application on Linux?
So far, I found that I can use /proc/[pid]/maps to access the memory of the running application. But how can I find specific data in it? For example, if the running application is firefox, how could I find the html code of the current window? Or how could I at least find the title of the current firefox window?
Is there a solution to find virtual addresses of variables containing known data? Could I use D-bus to achieve any of this?
In most cases, the data I would like to fetch is displayed in a GUI, if that makes it any easier.
If I have an executable file (no source file/header file and pdb file), and I want to steal or get any possible information from that exe file via analyzing dump file (both raw or through a tool), is it possible? And in what should I do in the code to prevent anyone from getting any sensitive information from my application?
In a dump (User Mode memory dump) you have all process virtual memory as is. So, let's say, if you store some passwords or credit card data in memory, this data can be extracted from memory. If it's not a .Net app and you don't have proper pdb files it makes is a bit difficult but not impossible to find this information.
If you want to protect you data in memory - use appropriate technics like System.Security.SecureString in .NET or DPAPI directly.
I want to upload a file that is >16GB. How can I do this in JSF?
When using HTTP, you'll face two limitations. The one on the client side (webbrowser) and the one on the server side (webserver). The average webbrowser (IE/FF/Chrome/etc) has a limit of 2~4GB, depending on the make/version/platform. You cannot control this from the server side on. The enduser has to change the browser settings itself (sometimes this isn't possible at all). The average webserver (Tomcat/JBoss/Glassfish/etc) in turn has a limit of 2GB. You can configure this, but this still won't and can't remove the limitation on the webbrowser.
Your best bet is FTP. If you want to do this by a webpage, consider an applet which utilizes Apache Commons Net FTPClient. There are several ready-to-use opensource/commercial ones by the way.
You however still need to take into account that the disk file system on the FTP server side supports that large files. FAT32 for example has a limit of 4GB per file. NTFS and several *Nix file systems, however, can go up to 16EB.
I posted this question a while ago regarding where to store non-user specific application data on Linux.
As you can see, I intended to use "/Library/Application Support” on Mac and perhaps "/var/lib" or "/usr/share" on Linux.
On an existing application (currently Windows only) we use “\ProgramData” on Vista & Windows 7 and “\Documents and Settings\All Users“ on Windows XP (both obtained using System.getenv("ALLUSERSPROFILE"), which does not work on Mac or Linux).
The problem I am finding with the Mac & Linux locations (unlike the Windows ones) is that they are not accessible by non-root/admin users, which sort of defeats the purpose of using them.
What is the best practice is this case? We could simply store the application data in the user's home directory. I wouldn't actually be dead against this, as it seems reasonable for the application to appear completely 'new' when a new user tries using it. The main problem this gives us is that each user would have to enter the serial number in order to activate the application (the activation info is part of the 'application data' we need to store). This isn't really ideal.
That said, if there is no real alternative then I suppose it will have to do.
What do you mean by non-user specific application data?
Read-only resources needed by application, such as localization strings or button icons:
on Mac they are stored in application bundle itself, in Resources subfolder
on Linux, they can be stored near application binary, in /opt/<app>/etc for instance.
Read/write properties, such as serial number:
you can consider this information as user-specific application data, so it should go somewhere in $HOME directory
you can consider this information as computer-wide application data, in which case its setting should be perfomed during software installation process, i.e., with administrative privileges.
/Users/Shared/ is writable for everyone. That said, if you need to support computer-wide licenses, the best place for serial numbers, IMHO, is indeed /Library/Application Support. You would have to use Authorization Services once to ask for an admin password and save the serial number there. If a user fails to enter the admin password, save the serial number in ~/Library/Application Support instead.