Comparing Binary between languages

Hi,
if one were to serialize the same object to binary in multiple languages, would one expect that the resulting Binary byte stream and length would be the same in all languages?
for example:
MyKey original = new MyKey(414041167, 3, "R");
SimplePofContext pofContext = new SimplePofContext();
pofContext.registerUserType(1003, MyKey.class, new MyKeySerializer());
Binary binary = ExternalizableHelper.toBinary(original, pofContext);
can I then compare the results from binary.length() and binary.ToByteArray() to those from dotnet and C++ for the same object?
thanks

HI JK,
Thanks, that's what I thought, just that a problem I am having has made me question what I previously thought. For a simple object with three fields I see different binary representations.
where :
MyKey = new MyKey(414041167, 3, "")
I get the following representations
dotnet:
{Binary(length=15, value=0xAB0F0000418F91EE8A03016C026240)}
java:
Binary(length=17, value=0x15AB0F0000418F91EE8A03016C024E0040)
The MyKey Class is a simple object with two int members and one string member.
dotnet serializer:
class MyKeySerialiser : IPofSerializer
#region IPofSerializer Members
public object Deserialize(IPofReader reader)
var key = new MyKey(reader.ReadInt32(0), reader.ReadInt32(1), reader.ReadString(2));
reader.ReadRemainder();
return key;
public void Serialize(IPofWriter writer, object o)
var key = (MyKey)o;
writer.VersionId = 0;
writer.WriteInt32(0, key.int1);
writer.WriteInt32(1, key.int2);
writer.WriteString(2, key.string);
writer.WriteRemainder(null);
#endregion
java serializer:
public class MyKeySerializer implements PofSerializer {
     @Override
     public Object deserialize(PofReader in) throws IOException {
          in.getVersionId();
          MyKey key =
               new MyKey(in.readInt(0),
                                   in.readInt(1),
                                   in.readString(2));
          in.readRemainder();
          return key;
     @Override
     public void serialize(PofWriter out, Object oKey) throws IOException {
          MyKey key = (MyKey) oKey;
          out.setVersionId (0);
          out.writeInt (0, key.getInt1());
          out.writeInt (1, key.getInt2());
          out.writeString     (2, key.getString());
          out.writeRemainder(null);
I believe something strange is happening with the empty string as when I use a key that has the string member variable populated then the binary matches exactly.
MyKey(683242439, 9, "R"); // works fine
Any ideas what is going on?

Similar Messages

  • Ctrl+Shift do not shift between languages in Firefox and Opera browers

    Pressing Ctrl+Shift on the keyboard do not shift between languages when typing in Firefox and Opera browsers, but it works fine in Word and other applications. I have Windows XP SP3. My browsers are updated.

    Firefox has menu items that use the Shift and Ctrl modifier keys (e.g. Ctrl+Shift+Z = Redo) and those can interfere, especially when typing in a text area.
    You might have more luck with Alt and Shift instead.
    Try to assign different keyboard shortcuts to each of the installed languages instead of using a key sequence to cycle between installed language layouts.

  • How to compare data between two tables?

    Hi,
    My team is trying to develop a SAP data migration tool (DMT) using ABAP.
    One of the functionalities in the DMT is to validate the data in the staging area against the loaded SAP data.
    The tables in the stagin area are customer tables (i.e. user-defined tables starting with Y, Z).
    How do I compare the data in the staging area against data that are loaded into SAP tables? Are there some built-in SAP functions to do this? Or, are there some better ways of doing this (e.g. instead of comparing against data in the SAP tables, we compare with some INTERNAL tables)?
    Any help would be greatly appreciated, thanks!

    Hi Kian,
    Use <b>SCMP</b> transaction to compare data between two tables and you can not use this for comparing internal tables.
    Thanks,
    Vinay

  • How to compare date between 2 file?

    hi there...
    is there any possibility to compare date between 2 file and the file that is latest to open?
    thank you

    i need help urgently..... i type tis code
    <%
    String file = ("C:/");
    File f = new File(file);
    String [] fileNames = f.list();
    File [] fileObjects= f.listFiles();
    %>
    <UL>
    <%
    for (int i = 0; i < fileObjects.length; i++) {
    if(fileObjects.lastModified()){
    %>
    <LI>
    <a href="<%= fileNames[i %">"><%= fileNames[i] %></A>
    <%
    %>
    my purpose is to list out all the file in the folder but not to the user just for the system to check all the files than when i click a link it will open the latest file
    Message was edited by:
    n_dilah</a>

  • Comparing Table between two dbs DBMS_RECTIFIER_DIFF.DIFFERENCES

    We have streams replication between two databases db1 & db2 (table level streams replication).
    We would like to compare tables between these databases.
    we can use DBMS_RECTIFIER_DIFF.DIFFERENCES to find out differences. However what is value to be passed for REFERENCE_SITE & COMPARISON_SITE parameters?
    Is it DBLINK or TNSNAMES entry ?

    Its the DBLINK.

  • Compare settings between plants

    Hi,
    Is there any transaction code to compare settings between 2 plants.For eg Quantity/Value update was done for plant X but not for plant Y.Or else what are the tables used to compare the settings

    >
    nevinphilip wrote:
    > Hi thanks for the reply..Can you tell me which all tables are to be checked.
    Please check this answered link:
    plant table

  • Is there any way to toggle between languages in 10.5.8?

    I write emails in Japanese {Hiragana and Kanji) a lot but I need to frequently transfer between English and Japanese for that.
    On an older OSX version there used to be a way to toggle between selected languages using the space bar and another key (I think it was the Apple key) but that doesn't work in 10.5.8.
    Is there another way to toggle selected languages in 10.5.8?

    Someone (called rick) made a video tip on this.
    http://www.tiptrickmod.com/mac/how-to-switch-between-languages/

  • Compare data between two tables

    Hey Experts
    I am having two tables both are having same structure.
    Both r having 210 columns
    I want to compare data between these two tables.
    I used follwoing query
    select * from t1
    MINUS
    select * from t2but even if thr is diff in 1columns .. i need to search 210 columns which is the exact columns and data
    how can i find the exact columns out of these 210 columns ?

    SShubhangi wrote:
    but even if thr is diff in 1columns .. i need to search 210 columns which is the exact columns and data
    how can i find the exact columns out of these 210 columns ?This is not a trivial problem to solve. Consider a much simpler data set. In table 1 (four columns) we have
    1 A B C
    2 D E F
    3 A B Dand in In table 2 (four columns) we have
    2 X Y Z
    3 A B ENow
    select * from table1 minus select * from table2gives
    1 A B C
    2 D E F
    3 A B Dwhereas
    select * from table2 minus select * from table1gives
    2 X Y Z
    3 A B ENow clearly the first row in Table1 (ID=1) doesn't match any row in Table2 but it's only two columns out from the last row in Table2 (ID=3). However, the row in Table1 with ID=3 only doesn't match on one column.
    So, how do you represent the output?
    Clearly what you want can only be achieved if there are some columns which ought to be the same in both tables i.e. key columns. In which case you can use a full outer join link teh two tables, and case statements to display only the values which don't match:
    select t1.id as t1_id
             , t2.id as t2_id
             , case when t1.col1 != t2.col1 then r1.col1 end as t1_col1
            , case when t1.col1 != t2.col1 then r1.col1 end as t2_col1
            , case when t1.col2 != t2.col2 then r1.col2 end as t1_col2
            , case when t1.col2 != t2.col2 then r1.col2 end as t2_col2
            , case when t1.col3 != t2.col3 then r1.col3 end as t1_col2
            , case when t1.col3 != t2.col4 then r1.col4 end as t2_col2
    from table1 t1
          full outer join table2 t2
         on t1.id = t2.id;Handling nulls is left as an exercise for the reader :)
    I agree that typing all this would be extremely tedious for a table with 210 columns, but that's why Nature gave us the ability to generate SQL statements from teh data dictionary.
    Cheers, APC

  • Compare data between two tables of same schema

    Folks,
    I have one very intresting query which i would like to share with you all and looking forward for the solution asap.
    Scenario
    I have two table say TableA and TableB, both having same structre say as below
    TableA
    Col1 Var(10)
    Col2  INT
    TableB
    Col1 Var(10)
    Col2  INT
    I want to compare data between these two tables and store compared data into third table, let me expalin the whole scenario.
    TableA
    ColA          ColB
    INDIA          1
    PAKistan      2
    TableB
    ColA          ColB
    INDIA          1
    PAK             3
    I want result like
    Difference
    ColA          ColB
    True            0
    False           -1
    I want to store this difference in thrid table.
    i.e. when comparing text, i need TRUE when compare 100% else False, Caption is not considered.
         When comparing numeric value, simple sub is requried , TableA-TableB
    Note - I dont want to use any external tool to compare the table data, i required sql query to do the same.
    Thanks
    Amit Srivastava
    Amit
    Please mark as answer if helpful
    http://fascinatingsql.wordpress.com/

    Whereas the abbreviation of countries that exist in Table2 table are the first three letters of the name of the country*, here's a suggestion:
    -- code #1 v2
    INSERT into [Difference] (Col1, Col2, ACol1, BCol1)
    SELECT case when A.Col1 = B.Col1 then 'true' else 'false' end,
    (IsNull(A.Col2, 0) - IsNull(B.Col2, 0)), A.Col1, B.Col1
    from TableA as A full outer join
    TableB as B on (A.Col1 = B.Col1
    or Left(A.Col1, 3) = B.Col1);
    Is the COLLATE database case insensitive? If not, the code #1 above will have to be modified, using the upper () function or using COLLATE case insensitive in A.Col1 and B.Col1 columns.
    But if the abbreviation of the country follow the
    ISO 3166-1 alpha-3 standard, will require a fourth table containing the symbol and name of countries.
    -- code #2 v2
    ;with
    TableB_2 as (
    SELECT case when Len(Col1) = 3
    then (SELECT Country_name from [ISO 3166-1 a3] where Cod = Col1)
    else Col1 end as Col1, Col2
    from TableB
    INSERT into [Difference] (Col1, Col2, ACol1, BCol1)
    SELECT case when A.Col1 = B.Col1 then 'true' else 'false' end,
    (IsNull(A.Col2, 0) - IsNull(B.Col2, 0)), A.Col1, B.Col1
    from TableA as A full outer join
    TableB_2 as B on A.Col1 = B.Col1;
    Structure and data to test:
    use tempdb;
    CREATE TABLE TableA (Col1 varchar(10), Col2 int);
    CREATE TABLE TableB (Col1 varchar(10), Col2 int);
    CREATE TABLE [Difference] (Col1 varchar(10), Col2 int, ACol1 varchar(10), BCol1 varchar(10));
    INSERT into TableA values ('INDIA', 1), ('PAKistan', 2), ('China', 12);
    INSERT into TableB values ('INDIA', 1), ('PAK', 3), ('Bhutan', 3);
    go
    CREATE TABLE [ISO 3166-1 a3] (Cod char(3) primary key, [Country_name] varchar(30));
    INSERT into [ISO 3166-1 a3] values
    ('IND', 'India'), ('PAK', 'Pakistan'), ('CHN', 'China'), ('BGD', 'Bangladesh'),
    ('BTN', 'Bhutan'), ('MMR', 'Myanmar'), ('NPL', 'Nepal');
    go
    (*) If the short form of the country name using the first three letters of the country name,
    false positives can occur. For example,
    Mali and Malta or
    Angola and Anguilla.
    José Diz     Belo Horizonte, MG - Brasil

  • Can I use Intermedia to compare documents between each other?

    Hi pplz,
    Can I compare documents between each other using Intermedia?
    The idea is to compare document to itself to receive certain figure to use as 100% and then to compare this document to any other one to receive something like 'relevancy percentage'.
    Thank you in advance.
    Alex.

    interMedia Text does not support that feature.

  • PC - Switching Between Languages?

    I've looked around and found some solutions to switching between languages for OSX (at least in prior versions, changing system display language seemed to be enough), or changing to English via "ae_force_english," but what about changing to other languages from English?
    It was mentioned that there are separate installers for each language, however switching the download page language to another and triggering that just launched Cloud and asked if I wanted to overwrite my current install with the alternate language, which I certainly do not.
    So-- is there any way to either have multiple languages installed simultaneously, or to quickly switch between languages on the fly, on PC, with CC?
    Thanks!
    (cc @Todd_Kopriva)

    The simple answer is "no".

  • Easily switching between languages

    Hi, I'm new to Macbooks. I used to have (and still do, just never use it) a ThinkPad. One great thing about it is that I could easily switch between languages by pressing a couple of buttons (Control and Shift). Is it possible to do that with a MacBook or to make it possible? Or am I stuck with going to the top bar and manually switching between the languages? Thanks

    Look in the International system preference and the input pane. You'll see it at the bottom.

  • Quickly switching between languages

    I wanted to know if there were keyboard shortcuts available to switch between languages quickly. I'm taking a foreign language class that requires that certain things be typed in the native foreign language. I find it a bit of a hassle to go over to the flag icon on the upper right to switch between languages (I switch in and out of English and the foreign language alot, especially when I need to research online). Any advice?

    Cmd-Space and Cmd-Option-Space are the standard keyboard commands for cycling forwards and backwards through the enabled languages.
    You can change the keys through System Preferences -> International -> Input Menu

  • A Comparative analysis between WebCenter and Sharepoint

    Hi All,
    Do you have any readily available comparative analysis between Sharepoint Freeware, MOSS and Webcenter is support of KM Functions. the major parameters that I wanted in comparison are as follows:
    Ability to pre-fill metadata
    Security to allow right people for right content
    Ensure Single Source (Check-in & Check-out)
    Desktop Integration for quick Uploads
    E-Mail Integrations
    Feedback
    Metadata for quick retrieval
    Ease of entry of Metadata
    Intelligent Search
    Flexible access of content
    One location for one asset
    Content organizing
    Document centric collaboration
    Information rights Management
    Document capturing
    Ability to provide Audit data
    Ability to recommend the downloads
    Ability to alert based on non-use of assets
    Best regards,

    Hi All,
    Do you have any readily available comparative analysis between Sharepoint Freeware, MOSS and Webcenter is support of KM Functions. the major parameters that I wanted in comparison are as follows:
    Ability to pre-fill metadata
    Security to allow right people for right content
    Ensure Single Source (Check-in & Check-out)
    Desktop Integration for quick Uploads
    E-Mail Integrations
    Feedback
    Metadata for quick retrieval
    Ease of entry of Metadata
    Intelligent Search
    Flexible access of content
    One location for one asset
    Content organizing
    Document centric collaboration
    Information rights Management
    Document capturing
    Ability to provide Audit data
    Ability to recommend the downloads
    Ability to alert based on non-use of assets
    Best regards,

  • How to STOP OS X from automatically changing between language input methods

    I want to know if there is a way in OS X Leopard to stop the system from automatically changing the language input method. I use English and Japanese on my computer, but this would apply to anyone using more than one input method.
    For example, when I click on a Japanese-language file, the system automatically changes input to Kotoeri (the Japanese-language input method). When I then click on an English-language file it usually, but not always, changes back to English input. But I almost never want to TYPE in Japanese. I just need to be able to read Japanese and to cut and paste from Japanese language files. It is very annoying when I start typing in an English-language file and find the input method has been changed to kotoeri without me realizing it—everything comes out in meaningless Japanese. When I want to type in Japanese, I want to manually change to the Japanese input system. That is, I want English to always be the default input method even if I am manipulating Japanese-language files.
    So, I’m wondering if there’s a way to set the computer so that it never AUTOMATICALLY switches between the input methods. I want to be able to switch only manually. In the old days of System 7, 8, and 9, there was a third-party control panel you could get that would do this (I think it was called Stay There!) and I don't remember this being a problem in Tiger or earlier versions of OS X. Is anyone aware of any way to do this in Leopard?
    Thank you!
    Colin

    Well, I do have it set that way, and I can look up there to see where I am, but in the work I do time is critical and I move back and forth between the two languages frequently. It is really a pain and a waste of time to have to look and make a change that should be unnecessary. The problem is not so much that I don't know where I am. It's that I don't want to ever have to think I MIGHT be in anything but English input unless I specifically want to be. In other words, I need to be able to forget about this problem even being a possibility.
    Message was edited by: Colin Talcroft

Maybe you are looking for

  • Its very urgent ...Rfc deffinately rewarded with 10 points....

    Hi Experts....this is my requirement...plz help me in this ...case here we have TWO Databases: Db1 , db2 (this intereact with the Third Party), In SE38 ABAP Editor : we have to write a programme in this we have to SELECT-OPTION is Used Four Fields an

  • BPM process documentation

    Hi all, I need a helping hand. Would you know how to make use of Documentation View inside Oracle BPM suite?? Is it possible to export them into word document? Or is there any documentation tool for Oracle BPM? For define the work flow, input, output

  • Help with no os installed!

    Hello! Recently I reset my macbook pro due to it running extremely slow. I did a full system wipe and lost all my files which is fine. But, I get prompted to a meny with several options: 1. Restore from time machine back up (Which I don't want) 2. Re

  • Bapi to add componentes in Project

    Hello All, I have to add compoments in project can anyone suggest me BAPI for that ? Edited by: yogesh Kothavade on Apr 8, 2009 12:02 PM

  • [SOLVED] Messages (errors?) when exiting openbox

    I start openbox from the command line with the startx command. My .xinitrc consists of: exec openbox.session After exiting I have the following two lines on my console that I don't understand: which: no hsetroot (/usr/local/bin:/usr/bin:/usr/local/sb