Saving space with booleans

Hi,
I have a prog with an array with many strings.
It takes up a lot of space so I would like to compress each string to a boolean.
Then each string will only take up 2 bits and I will save a lot of space.
Please give me the code for this.
regards

patumaire wrote:
Hi,
I have a prog with an array with many strings.
It takes up a lot of space so I would like to compress each string to a boolean.
Then each string will only take up 2 bits and I will save a lot of space.
Please give me the code for this.
regards1) What makes you think you can store your strings as booleans? Do they have only two distinct values?
2) What makes you think a Java boolean consumes only two bits?
3) What makes you think two bits are required to hold a boolean value, rather than 1?
4) This whole thing is a joke, right?

Similar Messages

  • Saving space with 8gb limitation

    About 3 or 4 years ago i bought a 40gb hard drive for my imac333.Because of the 8gb limitation on the first partition
    I want to move iphoto and itunes folders to my 2nd partition
    but i cant find where i got the info on how to do it. Does anyone know how to do this or point me in the right direction as i need to re-install panther.
    imac 333   Mac OS X (10.3.9)   512m ram 40gig 7200 harddrive

    Hello huggs2.
    In addition t hte great advice offered by Neil.... a couple of thing come to mind. You could keep the apps on the fit partition and save your work to the second partition. This way the first partition isn't clogged. Another thought si that you may consider buying an external for storage. Look at http://www.dealmac for inexpensive externals. Even with 40 gig...space will probably become an issue sometime in the future.....Just some ideas.......HTH.............mGb..........Jim

  • Filename: Replace spaces with underscores

    Greetings,
    I have searched the forum and online and have not found an
    answer.
    So posting here for assistance.
    What is the proper syntax for replacing spaces in file names
    with under
    scores prior to cffile upload? -or- what is the best method
    to accomplish
    this process?
    Example:
    document name.doc >> document_name.doc
    Thanks
    Leonard

    you can't change the filename before the file has been
    uploaded to your
    server.
    upload a file using cffile.
    #cffile.serverfile# variable will contain the name with which
    the file
    has been saved on your server.
    check if the name contains any spaces using find() cf
    function.
    if it does, use cffile action="copy" to copy the file as a
    file with no
    spaces in the name (use replace() cf function to replace
    spaces with
    whatever you want).
    [you may want to make sure prior to copying the file that
    there is not
    already a file with same name (with no spaces) in that
    folder, otherwise
    the copy action will overwrite existing file]
    delete original file.
    details of all the functions are in the CFML Reference. if
    you do not
    have one - download free from adobe.com
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/

  • When generating layers it replaces spaces with underscores

    Hi All,
    I am working now with RH8, and when I am saving projects and give the name, let's say "my file.chm" it replaces the space with an underscore and the name becomes "my_file.chm". Is it possible to do anything about that?
    Thank you

    I think that what I said means you cannot generate with spaces.
    Bug? It has done it that way for several versions and I believe it is important if you are creating merged CHM help.
    Submit a bug request or feature change request according to your point of view.
    Please follow this link.
    http://www.Adobe.com/cfusion/mmform/index.cfm?name=wishform&product=38
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • Replacing multiple spaces with a single space

    Hi friends,
    I have a string. It can have zero/one/multiple spaces. I want to make the multiple spaces to single space.
    Here are the cases:
    1. ' a b c d efg h' should be changed to 'a b c d e f g h'
    2. ' a b c d e f g h ' should be changed to 'a b c d e f g h'
    3. 'a b c d e f g h' should not be changed
    4. 'abcdefgh' should not be changed
    Both REPLACE and TRANSLATE do not help. I don't want to go for LOOP logic. Please help me to get it in SQL query.
    Thanks in advance!

    Hi,
    964559 wrote:
    Hi friends,
    I have a string. It can have zero/one/multiple spaces. I want to make the multiple spaces to single space.
    Here are the cases:
    1. ' a b c d efg h' should be changed to 'a b c d e f g h'One solution is to post your string on this site, and then copy it back again. (See below for a more serious solution .)
    This site is doing exactly what you want the function to do: it replaces multiple consecutive spaces with a single space. As a result, it's hard to see what you mean.
    To preserve spacing on this site, type these 6 characters
    \(small letters only, inside curly brackets) before and after each section where you want spacing preserved.
    2. ' a b c d e f g h ' should be changed to 'a b c d e f g h'
    3. 'a b c d e f g h' should not be changed
    4. 'abcdefgh' should not be changed
    Both REPLACE and TRANSLATE do not help. I don't want to go for LOOP logic. Please help me to get it in SQL query.
    Thanks in advance!Regular expressions make this easy:SELECT TRIM ( REGEXP_REPLACE ( str
    , ' +'
    ) AS compressed_str
    FROM table_x;
    You can use nested REPLACE calls to get the same results, but it's messy.
    Edited by: Frank Kulash on Feb 5, 2013 10:18 AM
    Added TRIM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Check box with Boolean data type is not behaving properly

    Hi,
    I create a sample application with one entity driven view object with two attributes. One is of String data type [Value will be Y/N] and another (transient) attribute with Boolean data type. I planned to bind this boolean data type attribute to UI. I overridded the view row impl class and included setting of boolean attribute inside the setter of String attribute. Also in the getter of boolean attribute, added code to check the string attribute and return true/false based on that. Everything is working fine in application module tester. But when i test the same in view controller project in a page, it is not working. Always Check box component is not checked eventhough when i explicitly check it.
    [NOTE: I have given the control hint of Boolean attribute as check_box. Also i don't want selected/unselected entries in the page def file. That's why followed this approach]
    Have i missed out anything? Why this behaviour.
    Thanks in advance.
    Raguraman

    what is the value that is going in when u check it.. did u debug it.. is the viewRowimps setter and getter getting called.. and is it having the right value set and got.. and ur sure that ur using selectBooleanCheckBox..
    ur binding the checkbox to the transient value right??

  • Spaces with Multiple Displays

    I have been using Spaces with my MacBook with an external display, without mirroring to extend my desktop. Overall, it works really well and has certainly made things less hectic when I have 1-8 windows open per application and up to 5 applications.
    One thing I figured out by playing is that you can have windows from the same application in different spaces. For example, I have FireFox open with three windows, and can position one FF window in each of three spaces. The only way to do this that I have found is to drag the individual windows from the Spaces view (F8), but it's really useful for me to have web-pages organized by Space (personal, work, Google, etc.). By the way, if I shut down FF or restart the machine, the windows do not "remember" which Space they were in, which is not surprising to me. I assume that is a limitation of FF, not OS X.
    Now here is the issue/problem I have experienced several times: Every so often, I will completely "lose" one or more windows. For example, I have two FF windows open in Space 4, then upon switching to another space and going back to Space 4, the windows are gone. They still show up in the list of FF windows (from the "Windows" menu in FF itself), so I think they are still open, but it's like they were assigned to Space 0 or something. There is no way to get to them or bring them back that I have found. There is also no good explanation for why this is occurring or any reproducible set of circumstances.
    I can accept that I am pushing the envelope on Spaces using both multiple displays and splitting windows from one application across Spaces, so I am not expecting this to work flawlessly (yet). However, it sure would be useful to be able to recover from this when it occurs.
    By the way, as a tip I have mapped my mouse button 3 (external mouse with a scroll wheel that has a button) to show Spaces, which has been very handy for me.
    One last thing: Does anyone else think it would be cool to have Spaces act more like true individual Desktops? In other words, be able to set background image per Space and maybe even have different files on each Space/Desktop? Files would be more involved since Spaces are less permanent than a real Desktop, but background images seems like an easy thing to be able to code for.

    Just to be clear, you CAN run an application and split its windows across different Spaces by dragging those windows in the Spaces view. So open Firefox in Space 1, open a second FF window in Space 1, then F8 and drag the second window into Space 2 and voila. It's somewhat random what happens when you click on the application icon in the dock when you do this, but it does work.
    Good point about the background being very resource-intensive. Never mind.

  • Rplacing space with &nbsb; in html using regular expressions

    Hi
    I want to replace space with &nbsb; in HTML.
    I used  the below method to replace space in my html file.
    var spacePattern11:RegExp =/(\s)/g; 
    str= str.replace(spacePattern," "
    Here str varaible contains below html file.In this html file i want to replace space present between " What number does this  represents" with &nbsb;
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <b><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" style = 'font-size:10px' COLOR="#0B333C" LETTERSPACING="0" KERNING="0"><B></B></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" style = 'font-size:10px' COLOR="#0B333C" LETTERSPACING="0" KERNING="0"><B> What number does this Roman numeral represents MDCCCXVIII ?</B></FONT></P></TEXTFORMAT></b>
    </body>
    </html>
    But by using the above regular expression i am getting like this.
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head><body>
    <b><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" style = 'font-size:10px' COLOR="#0B333C" LETTERSPACING="0" KERNING="0"><B></B></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P A LIGN="LEFT"><FONT FACE="Verdana" style = 'font-size:10px' COLOR="#0B333C" LETTERSPACING="0 " KERNING="0"><B> What number does this represents</B></FONT></P></TEXTFORMAT></b>
    </body>
    </html>
    Here what happening means it was replacing space with &nbsb; in HTML tags also.But want to replace space with &nbsb; present in the outside of the HTML tags.I want like this using regular expressions in FLEX
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>What number does this represents</body>
    </html>
    Hi,Please give me the solution to slove the above problem using regular expressions
    Thanks in Advance to all
    Regards
    ssssssss

    sorry i missed some information in above,The modified information was in red color
    Hi
    I want to replace space with &nbsb; in HTML.
    I used  the below method to replace space in my html file.
    var spacePattern11:RegExp =/(\s)/g; 
    str= str.replace(spacePattern," "
    Here str varaible contains below html file.In this html file i want to replace space present between " What number does this  represents" with &nbsb;
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <b><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" style = 'font-size:10px' COLOR="#0B333C" LETTERSPACING="0" KERNING="0"><B></B></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" style = 'font-size:10px' COLOR="#0B333C" LETTERSPACING="0" KERNING="0"><B> What number does this Roman numeral represents MDCCCXVIII ?</B></FONT></P></TEXTFORMAT></b>
    </body>
    </html>
    But by using the above regular expression i am getting like this.
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head><body>
    <b><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" style = 'font-size:10px' COLOR="#0B333C" LETTERSPACING="0" KERNING="0"><B></B></FONT></P></TEXTFORMAT><TEXTFORMAT LEADIN G="2"><P ALIGN="LEFT"><FONT FACE="Verdana" style = 'font-size:10px' COLOR="#0B33 3C" LETTERSPACING="0" KERNING="0"><B> What number does this represents</B></FONT></P></TEXTFORMAT></b>
    </body>
    </html>
    Here what happening means it was replacing space with &nbsb; in HTML tags also.But want to replace space with &nbsb; present in the outside of the HTML tags.I want like this using regular expressions in FLEX
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>What&nbsb;number&nbsb;does&nbsb;this&nbsb;represents</body>
    </html>
    Hi,Please give me the solution to slove the above problem using regular expressions
    Thanks in Advance to all
    Regards
    ssssssss

  • I have a 64GB iPad2 and selected to "Automatically fill free space with songs".... will it have to download that 60GB of music to my ipad everytime I sync?  It took about 8 hours to sync the music to it

    I have a 64GB iPad2 and selected to "Automatically fill free space with songs".... will it have to download that 60GB of music to my ipad everytime I sync?  It took about 8 hours to sync the music to it.
    I did this last night at 10pm thinking it would take 30 minutes to sync these 10,000 songs or so to my ipad to take up the 64 GB.  I went to bed because it was taking so long and woke up at 6am and it was just about to finish.  It finished around 630am.  So it took a good 8 hours to sync.
    I unhooked it and used it for an hour or so and then hooked it backup so that I could update a few apps on it.  When i did that it acted like it was re-adding all of those songs again and it took about 8 hours again to sync all the music.  Was that just a fluke because I made changes to the ipad?  or will it always calculate and then re-sync alllllllllllllllllll of those 10,000 songs?
    Thanks so much for any help!!!
    -Michael

    Anyone?

  • CLOB to BLOB replacing spaces with Â

    I have a CLOB that we are converting to a BLOB using DBMS_LOB.CONVERTTOBLOB and then serving it up as a file using WPG_DOCLOAD.DOWNLOAD_FILE. When you open the file, it is replacing the spaces with a Â.
    Any thoughts?

    Most likely, the spaces in the original CLOB were not regular spaces (0x20) but rather non-breaking spaces (0xA0).
    What's the target encoding used to convert to BLOB? I suppose UTF-8?
    UTF-8 encodes non-breaking spaces as 0xC2A0, where 0xC2 is specifically the codepoint for "Â". So I think the tool you're using doesn't support UTF-8, or doesn't recognize the file as being properly encoded.
    Edited by: odie_63 on 14 août 2012 14:26

  • ? How do I delete large blocks of empty space with Adobe Acrobat Pro?

    How do I delete large blocks of empty space with Adobe Acrobat Pro?

    How can you delete "empty space"? If you mean that you want to delete lines,
    like in Word, so that the text afterwards will go "up the page", then you're
    out of luck. You should do that in the original file, and then re-create the
    PDF.

  • Filling a rectangle space with a photo image in an applet

    I'm creating a web page that will display an image of a persons wall and I want to be able to use the mouse to draw a rectangle on the image of the wall and fill the space with a selected photo image.
    I have found out that you can use the MousePress and MouseDrag events to draw a rectangle and "paint" the rectangle in a componant inside the applet. But I'm not sure how to fill the rectangle with an image instead of a color. Can someone tell me if there is an AWT or Swing method that can do this?
    I was thinking of filling the applet window with a label component and then filling it with the wall image. Then some how using the coordinates given from the drag event to creat a new label component and filling it with the photo image. Hope I'm on the right path. Thanks for all the help.

    Great thanks, I looked it up in the docs and I found one that will work for me but I'm not sure how to use the arguements. It's the drawImage method that uses the scalebility. This would work perfect seeing as though the image to be posted will be various sizes. Can any one explain this method in more detail for me. Thanks again.

  • Problem saving attachments with longish filenames

    We're having a problem saving attachments from Mail that are 25+ characters in length. ie. If we click on the "Save" attachment button in Mail, we get an alert that the file can't be saved because it's too long. We can drag the file to the desktop, but then can't move it without getting the "name is too long" alert. We have to change the name, deleting a bunch of characters. Using HFS+. Anyone have a solution?

    When you drag the attachment to the desktop you should be able to click on the file's name then edit it so it's less then 25 characters. Try saving it again after deleting some characters.
    We just switched from OS 9.4 to OS 10.4 (Intel) and found that Photoshop did not recognize any of the pics in our folders because we haven't been saving them with the file extension (i.e. jpeg, eps, etc.) We had to open all our pic files then add the extension. Apparently our old Macs could recognize a photo file but our new ones need the extension to be able to read the file. So if your file name is too long it's probably cutting off the extension - your computer won't let you save it until you make room for the file extension at the end.
    Hope this helps.
    Intel Mac Pro   Mac OS X (10.4.7)  

  • I saturated all the available iPad (3rd. generation) screen space (home screens or desktop space) with apps, and the apps that got bumped out of the last screen, mysteriously disappeared? Where are those missing quick lauch app icons?

    Running my 3rd generation iPad on iOS 7.0.4, I saturated all the available iPad screen space (which would be the 15 home screens or desktop worth of space) with apps, and the apps that got bumped out of the last screen space mysteriously disappeared. Where are those missing quick lauch app icons now? The apps are still installed and can be searched/accessed through the finder, but they no longer have a user friendly access. How can I solve this problem?

    Christopher Doryan wrote:
    Hi Hexonxonx, thanks for trying to help, but next time please read the entire discussion, in oder to better comprehend what is being asked. The reason being is that your answer added nothing to what had already been mentioned.
    Like I said, I was aware it was possible to access the apps through the finder, but the question revolved around how to recover the quick launch app icons for certain vanished apps.
    Wow, kind of a snotty response to someone who was taking their own time to offer help.  Whether you thought it was helpful or not, didn't deserve such an unkind retort.  Maybe when you realize we all just users here trying to help others like you, who have issues and we don't get anything in return for the countless hours some people here spend offering that assistance, you'll maybe be a little less quick to be critical.
    Just sayin.......
    Oh and Meg offered the right answer.  Put your Apps in Folders, which will create extra space for the apps which have disappeared.

  • Why can't get my photos in photo stream to transfer to I photo, shows up as black space with name only

    How do I select then send Photos from photo stream to I Photo to edit? My photo ends up not transferring or is shown as black space with name below, without photo in I Photo. Any one have an answer?

    Hi there Harvest 61,
    You may find the troubleshooting steps in the article below helpful.
    iCloud: My Photo Stream troubleshooting
    http://support.apple.com/kb/ts3989
    -Griff W. 

Maybe you are looking for

  • Please help i have a Quick time video problems

    I am currently working on a mac and have created an application that displays video. The format im using is quick time and i have imported the video into director and placed it on the main stage. When i test the project on the mac it works fine but w

  • Order of Albums under Music-- Albums

    When I go to Music-->Albums to view albums on my iPod, they are in alphabetical order. On iTunes, they are sorted "Album by Artist". Is there a way to sort the Albums on the iPod by Artist? Thank you for any assistance.

  • Using Dynamic SQL to populate ALV

    Hi, Does anyone know if it is possible to use the Runtime Type Services to obtain the structure definition for the results a dynamic select statement? I am looking to create a simple web dynpro app that that will populate an ALV grid with the results

  • Problem in Data Upload

    Hai Guys, I am facing one problem when i am uploading data. Now only we have created R3 production source system. In the R3 system datasource having data. But when i am uploading the data in BW system, it is giving only 0 records. Any settings is mis

  • Color conversion to 16-bit Lab

    Hi, I have rasterized a document using the AIRasterizeSuite and got the colorspace (ai::ColorSpace) and pixel data (AIImageComponent *) from the raster object. FYI, the color space at this point is kAIColorSpaceFamilyNChannel (process + spot). Now I