Loading a binary string How do i do it?

Hi,
I have saved a string as binary data so that there are no spaces between each letter. I am trying to work out how to load it but the book I have is awful. I don't want to restrict the length of the data that can be read in. Is there any way to get the size of the incoming file in bytes and then create a char buffer big enough to then copy the loaded data into?
Any help would be much appreciate but please be really clear and step by step as this area is completely new to me.
Many thanks
Dylan

1. All strings are saved as binary data, so you haven't done anything special.
2. You didn't say what the actual encoding scheme is that you used. But in general, the answer to your question is "no". The reason is that many encodings require a variable length for each character that depends on the actual character encoded.

Similar Messages

  • How should load sensitive connection strings

    ok so when i need to connect a swf to some sort of data
    source on the server be it XML, a .NET DLL, a CFC or what ever so
    that i can load data from a database or what ever, everyone is
    always saying that i shouldn't hard code the connection string into
    my actionscript as anyone can get it and do malicious things with
    it.
    So how should i load the connection string into flash. if i
    put them on the server in an XML file or somthing like that then i
    still need to put a connection string into the actionscript in
    order to load in my main connection strings into the actionscript.
    Basically i need to know how to load an external string into
    a swf without anyone else being able to get hold of that string for
    them selves.
    i realy need help with this because i am developing an app
    for somone and i need it to connect to a database and i need it to
    be secure. i have everything sorted except making the connection
    string to the database unstealable.

    Hi
    1. The "GLOBAL.ASA" in ASP3 become "GLOBAL.ASAX" on ASP.Net and it is not the equivalent of web.config. ASP3 do not have an equivalent as this is dynamic tech and By default there is no precompile/compile action as in Dot.Net
     2. You can just move a text file which include the connection string outside the site's folder as we used to do 15 years ago when we used Microsoft Access as a database (When we need small database, before the SQL EXPRESS). This way there is no direct
    URL to get to file!
    * There are several option of restrict the use of a file in ASP3 and in the IIS configuration. check if this is what you want (restrict the use of a specific file/folder) 
    3. robot.txt is only for searching engine which keep "nice behavior". it do not stop any application including search engine from getting the file.
    Have fun :-)
    [Personal Site] [Blog] [Facebook]

  • How can I convert a U32 array into binary string?

    Hi
    I would like to find an efficient way to convert an array of 8192 U32 into a single binary string!!!
    the solution below  last 550 ms on an RT target to convert 8192 U32.
    The same code running on Labview (not RT) last 100ms. I don't understand why there is such a difference.
    I've tryed to replace the inner loop and convert by a format string whith U32 on entry and %032b as parameter but it lasted same time.
    Thanks a lot

    Your picture of your code didn't come through. You can't link to a picture that's on your computer, as a server on the internet cannot access your computer to display the picture for others to see. You have to upload the picture as an attachment. Then, if you want to actually display the picture in the message you have to edit your post, insert a picture, and when it asks for the URL you enter the URL of the picture. You can get the URL when viewing the message, as the link is within the message itself.
    As for your question, can you just use the TypeCast function?

  • How to convert binary string to ascii

    Hi,
    See i have a string like this,
    String str = "10011100110001011001110011000101";
    Now i want to find exact ascii value of the binary string.
    Thanks in advance.

    First want to convert these bits to corresponding
    characters and then have to find ascii of the same.... corresponding to what? I think converting these "bits" to the corresponding chars is the whole story. But what about the original format?
    Guessing mode on ... does this help?
    String input = "...";
    StringBuffer result = new StringBuffer();
    for (int i = 0;i < input.length();i += 8) {
      result.append((char) Integer.parseInt(input.substring(i, i + 8), 2));
    System.out.println(result);

  • Evaluating binary strings with "Don't care" conditions

    I frequently have to evaluate binary strings or register values for particular bits. Does anyone have a better way? And if not, perhaps this is a suggestion for NI.
    To this point I've used two methods:
    1. I turn the data into an actual string in my CVI code and inject X's in the necessary positions. I then perform a string evaluation for equivalence, the string now consisting of '1's '0's and 'x's.
    2. Bring the data into the teststep and applying an expression to the data source, masking the appropriate bits. Then evaluate as a numeric with a value that assumes the offended bits "zeroness" or "oneness" depending on how I've implemented.
    The first was one requires specialized code, but allows for a little more visibility (in the code at least) of which bits are designated as DCs. But translating a multiple byte and variable length of amount of information into a string is cumbersome. Sure the code is reusable, but I'm not convinced the translation is necessary or best.
    The second buries the mask in a window that is, seemingly, infrequently used. I've had colleagues work on a project behind me trying to figure out where the value was being manipulated because I've applied a mask via the source. My original explanation of "ninjas" wasn't well taken...
    It seems like it would be ideal for the limits window to allow the use of "X"s when defining a "binary" type comparison so that the mask is clearly defined in the limit itself, and the data as it's passed to and from teststand remains untouched. Also, if this were to be implemented I would hope the property loader would support it.
    Am I missing a much easier way to do this? Anyone have a better way?
    Thanks in advance!
    Colt.
    P.S. Why isn't "NI" and "CVI" built into the spell checker?

    So in that first case where I am using CVI to "insert" I am building a string type vector that contains ASCII '1's '0's and 'x's. Where the Xs are in the binary position for what I am considering as "don't care".
    So say for instance I was converting a piece of data that was 0xEB, with bit 0 being considered a DC for evaluation, I would build a string like "1110 101X" . This string is what I would pass back to teststand. In teststand I would then perform an equivalence test between the two strings.
    For the second question about an implementation for the limit, say I open the test step, click on "Edit Limits" then from the drop down in the bottom right I select "Binary". I could then compose a limit in a similar form as described above. Where the limit box could contain something like "0b1110101X". But as for the data I hand to teststand, it would still be just a scalar value, with no masks applied. In the code, or in teststand.
    Sorry if I'm not making any sense! I hardly ever do...
    Colt.

  • Conversion of Decimal to Binary String

    Hello Labview People:
    I'm rather new to Labview, so this may be a simple-minded question . . .
    I would like to take a numeric control and have the decimal input
    converted to a binary string of 8 bits. So, for example, if I were to
    put in the number '127', I would get out (on an indicator) the string:
    01111111
    The number '128' would show on the indicator as:
    10000000
    It seems to me that this should be simple, but somehow I cannot figure
    out how to do it. Must an array be built bit by bit to accomplish this?
    (I'm afraid I don't yet know how to build arrays.)
    Thanks in advance for any help you provide!
    Sent via Deja.com http://www.deja.com/
    Before you buy.

    Or, you can go under the numeric function, and look for conversions, get
    decimal to byte array conversion.
    Then what you need to do is to get an array selection vi, and index to zero.
    I don't remember the exact name of the VI's because I don't have LabView
    here with me.
    Perhaps this complicates things
    Steven
    "Timo Miettunen" wrote in message
    news:[email protected]..
    > use format into string VI from string palette
    >
    > format string should be "%08b" for 8 bits, "%016b" for 16 bits etc.
    >
    > timo
    >
    > Ananda Dave wrote:
    > >
    > > Hello Labview People:
    > >
    > > I'm rather new to Labview, so this may be a simple-minded question . . .
    > >
    > > I would like to take a numeric control and have the decimal input
    > >
    converted to a binary string of 8 bits. So, for example, if I were to
    > > put in the number '127', I would get out (on an indicator) the string:
    > >
    > > 01111111
    > >
    > > The number '128' would show on the indicator as:
    > >
    > > 10000000
    > >
    > > It seems to me that this should be simple, but somehow I cannot figure
    > > out how to do it. Must an array be built bit by bit to accomplish this?
    > > (I'm afraid I don't yet know how to build arrays.)
    > >
    > > Thanks in advance for any help you provide!
    > >
    > > Sent via Deja.com http://www.deja.com/
    > > Before you buy.
    >
    > --
    > -------------------------------------------------
    > Timo Miettunen
    >
    > Fincitec Oy Production Department
    > e-mail: [email protected]
    > Address:
    > Lumikontie 2 Tel: +358-16-2151245
    > PO BOX 11 Fax: +358-16-221561
    > FIN-94600 KEMI Finland
    > -------------------------------------------------

  • Converting a binary string to a number...

    Hi guys,
    I'm trying to convert a binary string into a decimal integer. I'm not sure if LabVIEW has a VI that does that. I haven't found one yet. Basically, say I have the string '0101'. I want to convert that to the value '5'. Or say I'm using hex, I want '10101111' to be converted to 'AF'. So that's my dilemma. I'm hoping I'm not going to have to make my own VI. Thanks a lot!
    -Mike

    LabVIEW has exactly what you want even if it can be hard to find it.
    To convert a binary text string like "0101" to a decimal value can easily be done using the Scan Value function found under the String/Number conversion section. If you provide the format %b to it (not mentioned in the manual) you will get the decimal value of your binary string.
    Also, on your front panel you can change the format of your numerical indicators by right clicking on it and selecting Format & Precision. If you have a numerical indicator you can set it do display the numbers in e.g. hexadecimal form.
    However, if you want to convert a number to a hexadecimal text string you can use the Number to Hexadecimal String function also found under the String/Number conversion section.
    I
    attached a simple example, Conversions.vi, that shows how it works. I hope this helps. /Mikael
    Attachments:
    conversions.vi ‏14 KB

  • Mail Excel as attachment with input as binary string

    Hi Experts ,
    I want to design BAPI which will have one string as import parameter.
    I will get binary data in this string.
    Now i want to mail this binary data string as excel attachment.
    Anyody knows how to convert this binary string to internal table and then send this as attachment?
    Thanks & Regards ,
    JIgar.

    check these sample programs
    BCS_EXAMPLE*

  • Decoding binary strings from 10 bit A/D converter

    Hi all,
    I'm working on a project for school that requires me to take data from an A/D converter ( the A/D is on a Motorola HCS12 microcontroller) and send it to a PC running LABVIEW to decode the binary string into a numerical value.  The value will be plugged into an equation.  I planned on using the serial port on the PC for the comm port.  Are there any examples available or any advice to get me started in the right direction. 
    While I have programmed with LABVIEW in the past (academically) I am not proficient.  And this type of interfacing I have not done before, only GPIB.
    The A/D is 10 bit.  How quick LABVIEW decodes the binary string and returns a value is not important. 
    If any more info. is needed let me know.    

    Be confident. That should not be a big problem, since you'll get the help of the LV community
    The most difficult part will be to establish the communication with your micro-controler. But if you can do that with Windows hyperterminal, then you are nearly done ! There are examples of serial com in the examples shipped with LV.
    The string to decimal conversion will not be a problem, whatever the string format : the conversion is done using functions also shipped with LV.
    Hope to see you soon with more specific questions.
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • Store binary string

    How can I save the following encrypted password to Oracle
    database? What datatype should the field be defined? (varchar2?
    long raw? etc.) I did try to insert it into a field of varchar2
    type and got the error 'Input truncated to 87 character'.
    The binary string is:
    QqV&#8221;&#8482;&Q/pmW5/S&#8224;j$O+(u!Q6w&#8211;#/oy&#8221;N_F.0,=b&#338;4Xr&#710;& }]5%+
    I've been looking up Oracle books and found nothing related to
    this. Please give me some helps if you know.
    Thanks.

    I'd like to thank every one for the very helpful inputs. I just
    found down that varchar2 type will work just fine. The problem
    that I had earlier is SQLPlus - it does not recognize non-
    printable characters (it's a 100% text editor!). However, I was
    able to insert the string through ODBC. Again, thank you.

  • Scan arrays from binary string

    I have TCP connection that is sending a great number of fixed size arrays that I need to convert. Is there a simpler way to do that than the one I have attached?
    Attachments:
    Scan from binary string.vi ‏16 KB

    Sorry, I didn't write my question clear enough.
    I know how to do TCP data transfer. I also know how to unflatten the binary string back to data, but I was hoping there was a clearer way to do it than the way I suggested. For scalar values one can make a cluster containing the data in the binary string and only one "unflatten from string" is needed.
    However, if the binary string is composed of arrays (even though they are fixed in size) I need one unflatten string for each array. In my case I have many small arrays. The attached example with only three arrays was only to illustrate what I wanted to do.
    I have now found a way using a cluster of clusters. I don't know if this is the ideal way of doing this, but it works, and when enabling "view cluster as icon" I can make the code much more compact and easier to read
    Attachments:
    2012-07-04_120216.jpg ‏385 KB

  • Binary Strings

    Im trying to follow this tutorial - http://www.ai-junkie.com/ga/intro/gat3.html
    It represents the following values as binary strings e.g:-
    1 = 0001
    e.t.c
    9 = 1001
    * = 1100
    I can have worked out how to convert integers to binary string and visa versa,
    for(int i =0;i<10;i++){
                System.out.println(Integer.toBinaryString(i));
    }however I cant convert chars to binary of visa versa
    I have tried the folling buts its not working
    System.out.println(Byte.parseByte("1010" , 2));Thanks in advance
    Calypso

    calypso wrote:
    >
    What does this output, and what do you expect it to output? For me it outputs 10, and I expect it to output 10.
    >
    {noformat}
    In this tutorial, it is stated that
    "+" is equal to 1010
    How can I convert "+" --> 1010
    and
    how can I convert 1010 --> "+"
    {noformat}Well, you certainly didn't obtain "1010" by passing in a plus-sign to any method/Constructor of Integer, so I would suggest that you reverse whatever process you used to get 1010 in the first place.
    A simple method would be to use a map:
    Map<Character, String> toBinary = new HashMap<Character, String>();
    Map<String, Character> fromBinary = new HashMap<Character, String>();
       toBinary.put('9', "1001");  fromBinary.put("1001", '9');
       toBinary.put('+', "1010"); fromBinary.put("1010", '+');
    public String encode(char c) {
       return toBinary.get(c);
    public char decode(String binary) {
       return fromBinary.get(binary);
    }

  • Dissapeared footer (where is written what page is loading and so on) how to restore it?

    Dissapeared footer (where is written what page is loading and so on) how to restore it?
    there is the screenshot ( http://j.imagehost.org/0213/Clipboard03.jpg )

    View > Statusbar = click it

  • I have an older Ipod shuffle with many songs loaded on it. How can I transfer these songs to a new computer since the old computer is no longer available

    I have an oder Ipod shuffle with many songs loaded on it. How can I transfer ths songs to a new computer since the old computer is no longer available?

    I had the same problem with my iPad, i couldn't get the newer version of itunes because the computer was too old and my iPad couldnt sync with the old itunes. I got a PC from school a few months later so that solved the problem for me. Unfortunately i don't think there would be a program to put your music on your iPod, iTunes should be the only way to transfer files to Apple devices. What operating system are you running and what version of it is it?

  • A family member gave our kids their old iphone with music already loaded for them.  How do we add the music to our library? It won't transfer purchases from the phone and if I sync it, the music is erased.  Can someone walk me through this?

    A family member gave our kids their old iphone with music already loaded for them.  How do we add the music to our library? It won't transfer purchases from the phone and if I sync it, the music is erased.  Can someone walk me through this?

    No one here will help you violate iTunes terms of service or steal music.

Maybe you are looking for

  • Can I install Panther & OS 9.2.1 on a Firewire partition?

    From reading other posts, it seems that Panther/Classic can be installed on a partitioned Firewire drive. Not quite sure how do do that as other posts were about different issues. Info There's a G3 beige tower that there is no space for, but I'd like

  • Photoshop Elements 4.0 aus Diashow VCD brennen

    Hallo, Mit Photoshop Elements 4.0 Diashows zu erstellen ist sehr einfach und macht richtig Vergnügen. Nur wenn ich unter Ausgabe eine VCD brenne bin ich mit der Qualität gar nicht zufrieden. Kann ich an den Einstellung etwas änder, damit das Ergebnis

  • Old format won't open in CS3

    I have an old format files that won't open in either 1.0 or CS3.  Any hints? or do I have to find Version 1.5 or 2.0 to open.  Only want to create a PDF from them. thanks

  • Upgrade XML Publisher from 5.5.0 to 5.6.2

    Hi All, I am using Oracle Application 11.5.10.2. and XML Publisher 5.5.0. Now i want to Upgrade XML Publisher from 5.5.0 to 5.6.2. What patch sets i need to apply for this? Thanks XMLP User

  • Simple Question to Stupid Mistake

    Hello, I filmed some video with my digital camera. I thought if you rotate the camera the image rotates as well. This may be true with stills but it did not happen with video! Is there a way to rotate the video without having to rotate the monitor or