How to write a stream using a 3 symbol alphabet into a normal bitstream?

I have a three symbol alphabet which i would like to convert to a bit
stream.
The intuitive way of using two bits per symbol would introduce an
unused 2 bit combination that will unecessarily inflate the bit
stream.
I am wondering what methods exist to let me use 1.5 bits per symbol?
On average the probabilities of each symbol are: 0.25, 0.375, 0.375.
In my mind this would equate to bit lengths of 1.248, 0.873, 0.873
I understand Artihmetic Coding uses non integer bits to represent its
codes. I have been trying to understand how Arithmetic Codes does it
so i can use/modify its method to my case... however comprehension is
eluding me :( could someone explain it in more layman terms?

I agree that will work, infact i am/was using huffman codes... however in my particular case it is not close to the optimal bit length due to the fact that for huffman codes the codes have to be of integer length bits. This is because i have two equal 'high' probablilities (0.375) and only the one 'low' probablility (0.25) and thus the huffman codes would be:
0 (0.375) -> 01
1 (0.375) -> 10
2 (0.25) -> 11
And thus still need the 2 bits to encode each symbol. If the probabilities were much different then huffman coding may work , however with the realativley close probablilites there is no saving of the bits :(

Similar Messages

  • How to write a file using mod pl/sql

    hi,
    i am having a submit button in my procedure. which should inturn create .sql file in a file path.
    is there any way to create a fileusing htp and htf methods.
    Thanks in advance
    Hari

    >
    i am having a submit button in my procedure. which should in turn create .sql file in a file path.
    is there any way to create a file using htp and htf methods.
    >
    Why are you wasting your time coding from scratch using the PL/SQL Web Toolkit instead of the APEX framework?
    From Re: how to write a file using mod pl/sql it appears that you are not using APEX, so a number of the approaches APEX offers are not relevant. You appear to be looking for a file download solution using the <tt>wpg_docload.download_file</tt> method, such as:
    create or replace procedure download_file (
        p_filename  in     varchar2
      , p_mimetype  in     varchar2
      , p_content   in out nocopy blob)
    is
    begin
      -- Set up HTTP header.
      -- Use "application/octet" as default MIME type.
      owa_util.mime_header(nvl(p_mimetype, 'application/octet'), false);
      -- Set the size so the browser knows how much to download.
      htp.p('Content-length: ' || dbms_lob.getlength(p_content));
      -- Filename will be used as default by the browser in "Save as..."
      htp.p('Content-Disposition: attachment; filename="' || p_filename || '"');
      -- Close header.
      owa_util.http_header_close();
      -- Stream the file content to the browser.
      wpg_docload.download_file(p_content);
    end download_file;

  • How to write a application using WDJ with the adobe form ?

    Hi, experts,
    I don't know how to write a application using !!webdynpro for java!! with the adobe form so that I can fill data to the adobe form and get data from the adobe form.
    Note: I have configed the ADS(adobe document services),and I can create a application with a interactiveform in webdynpro for abap and run it successfully, so that I can  fill data to the adobe form and get data from the adobe form.
    Do you give me some hint?
    Thanks a lot.
    Best regards,
    tao
    Edited by: wang tao on Sep 9, 2008 8:59 AM

    Hi,
    Refers the following links.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4fd2d690-0201-0010-de83-b4fa0c93e1a9
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5f27e290-0201-0010-ff82-c21557572da1
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/70c9a954-aa20-2a10-64bb-ea0835204e03
    Thanks
    Abhilasha.

  • How to write SELECT statement using tables ekko,ekpo and eket?

    Hi,
    I got a problem in  performance tuning using below tables?
    how to write SELECT statement using tables EKKO,EKPO and EKET and in conditon ( WHERE clause)  use only fields 
                        ekko~ebeln       IN ebeln
                       ekko~loekz       EQ ' '
                       ekko~lifnr       IN lifnr
                       ekko~ekorg       IN ekorg
                      ekko~ekgrp       IN ekgrp          
                       ekpo~werks       IN werks
                       ekpo~pstyp       EQ  '3'
                       ekpo~loekz       EQ  space
                       ekpo~elikz       EQ  space
                       ekpo~menge       NE  0
                     eket~rsnum       NE space.
    Thanks in Advance.
    bye.

    Hi,
    ekko~ebeln IN ebeln
    ekko~loekz EQ ' '
    ekko~lifnr IN lifnr
    ekko~ekorg IN ekorg
    ekko~ekgrp IN ekgrp
    ekpo~werks IN werks
    ekpo~pstyp EQ '3'
    ekpo~loekz EQ space
    ekpo~elikz EQ space
    ekpo~menge NE 0          " Remove this from where clause
    eket~rsnum NE space.    " Remove this from where clause
    ' instead delete the entries after fetching into the table
    DELETE it_itab WHERE menge EQ '0' AND rsnum EQ ' '.
    Regards
    Bala Krishna

  • How to write a log using abap mapping

    Hi all.
    in PI 7.1 environment I need to use abap mapping and I wish to write some XML data into a table that I created for logging the data.
    I know that using the abap mapping I can parse an XML file. My question is how to write this table defining a specific method, if it is necessary.
    Any help or suggestion is well appreciated.
    Many thanks in advance for your kind cooperation.
    Regards,
      Giovanni

    hi,
    >> My question is how to write this table defining a specific method, if it is necessary.
    just like to normal table (insert statement)
    parse XML and get the data you need and just insert into the DB table
    there are many tutorials showing how to parse xml file inside abap mapping
    so just do a little search on sdn
    Regards,
    Michal Krawczyk

  • How to write Block ALV using Object-oriented methodology?

    Hi all,
    How to write a Block ALV without using 'Reuse_ALV.....' FMs? I want to use the CL_GUI....' methods. What is the procedure? Any sample block ALV?
    Thanks,
    Charles.

    Currently there is not an OO method of implementing the block ALV, it is only available using the REUSE function module.
    Regards,
    RIch Heilman

  • How to write the query using Index

    Hi All,
    I have to fetch the records from Database table using Index, how can i write the query using Index. Can any body plz send me the sample code.
    Help Me,
    Balu.

    Hi,
    See the below Example.
    select * from vbak up to 100 rows
    into table t_vbak
    where vbeln > v_vbeln.
    sort t_vbak by vbeln descending.
    read table t_vbak index 1.
    Regards,
    Ram
    Pls reward points if helpful.

  • I Want to make an app.. but i dont know how to write code or use Xcode... where I can begin?

    Hey!
         I just graduate from high school.. im gonna study Computer Enginnering. Im working for my family and they need an app that works like iBook. We have the eBooks and then they want me to do an app where they can sell the eBooks and read them. I have Xcode, but I dont know how to write codes or where to begin in all of this. I want to make the app first for iPad but if it can be for both iPad and iPhone better. I just want recommendation and help. Please and Thanks!! 

    hello i hope your having a good day but can you reply to me if you got the codes to make an app because i want to make an app too  thanks

  • How to setup bidirectional streams using OEM.

    hi,
    can anyone guide me in setting up bi-directional streams using OEM??
    Thanks in Advance.

    Click on the database --> data Movement --> setup under streams. Follow the steps whether you want schema replication / table replication / etc. You need to populate the host credentials for oracle.

  • How to write printing function using JSP?

    dear all,
    i want to add a printing function in my project but i do not know how to do it? could anyone teach me how to do it?
    thanks
    eric

    salut eric,
    you can do it this way :
    1 - create a html link in your code to this javascript
    function : (I am using Struts, but you can write it in
    pure html
    <html:link href="#bodyStart"
    onclick="openWindowForPrinting()"
    titleKey="msg.status.print">      <bean:message
    key='app.print' />
    <script language="JavaScript">
    <!--
    window.open = SymRealWinOpen;
    //-->
    </script>
    </html:link>
    >
    >
    2 - here is the javascript function : it open a window
    with the "print.jsp" page.
    function openWindowForPrinting(){
    window.open('/your_project/pages/common/print.jsp','',
    'left=150, top=150 , status=no, directories=no,
    toolbar=no, menubar=yes, location=no, scrollbars=yes,
    resizable=yes, dependant=yes');
    3 : here is the print.jsp page : You have only to
    create a session variable called
    "currentBodyRelativeLocation", which content the
    relative URL to the page you want to print (for
    example, the boby of the current page).
    <%@ taglib uri='/WEB-INF/tlds/perso.tld'
    prefix='perso' %>
    <html>
    <head>
    <perso:csslink page='${cssRelativeLocation}' />
    </head>
    <body onload="var SymTmpWinOpen = window.open; window.open = SymWinOpen; printPage();; window.open = SymTmpWinOpen;">
    <body>
    <jsp:include page="${currentBodyRelativeLocation}"/>
    </body>
    <script language="JavaScript">
    <!--
    window.open = SymRealWinOpen;
    //-->
    </script>
    </html>
    <script language='javascript'>
    function printPage(){
    window.print();
    window.close();
    </script>
    hai,
    i'm not very understand how is your code work. when i write html code, do i need to mind about this code: "msg.status.print" ? what is this code mean?
    i have too much question on this thing. would you mind to be further explain to me? or is it any reference for me to refer? i'm really new to write printing function on JSP.
    i never write this function before. i'm feel so lost.....:(
    thanks again
    eric

  • How to write chart application using netcharts.server.api ?

    Hi to all.
    i need to write a chart application in Java, which makes use of netcharts.server.api.
    Iam having only jar files. Which are netcharts.jar, chartworks.jar, commons-httpclient.jar, commons-logging.jar and ncstoolkit.jar in my hand.
    I need to make use of above jars only to build line graph or charts or any thing.
    That application has to work in html or jsp or servlets, if possible in swings.
    can any buddy please help me in this regard and guide me.
    I am very much thank full for any reply.
    please help me.
    Thanks in advance.

    Hi su,
    Thanks for your reply.
    can you tell me in detail where you have used those jar files and how?
    Comming to my basic application,
    iam in the way to find first basic application using netcharts.server.api package.
    I came to know many things.
    I found the how to build application in JSP's
    But when iam executing that, it is throwing error like
    {color:#ff6600}netcharts.server.api.NSToolKitException: java.net.ConnectException: Connection refused: connect{color}
    at the time of calling
    {color:#ff6600}String thechart = toolKit.getChartAsImageAndMap(
    "/CDXExamples/barxDATAvariable.cdx";,
    chartParams,
    request,
    true);
    {color}at first i have created
    {color:#ff6600}NSWebToolKit toolKit = new NSWebToolKit("Examples");{color}
    toolkit object with out errors.
    But in other reference i found the code like
    {color:#ff6600}NSWebToolKit toolKit = new NSWebToolKit(NETCHARTS_SERVERNAME, 8001,"MyFirstProject");{color}
    Here it is saying
    replacing {color:#ff6600}NETCHARTS_SERVERNAME{color} with the machine name where NetCharts Server is installed:
    Iam getting doubt, is it necessary to install netcharts server to make use of netcharts.server.api classes?.
    can any buddy please help me in this regard.
    Thanks in advance.

  • How to write the quires using into corresponding fields?

    Hi,
      How can i write the below quires using into corresponding fields statement.
    DATA :ws_d_budat TYPE bkpf-budat,
               ws_c_artnr TYPE ce10001-artnr,
    1) SELECT SINGLE budat
                        INTO ws_d_budat
                        FROM bkpf
                        WHERE awtyp = 'VBRK'
                        AND   awkey = wa_vbeln-vbeln.
    2)SELECT vbeln posnr matnr
                   FROM vbrp
                   INTO TABLE i_matnr
                   FOR ALL ENTRIES IN i_vbeln
                   WHERE vbeln = i_vbeln-vbeln
                   AND   matnr = ws_c_artnr
                   AND   posnr NE ' '.
    3) SELECT bukrs belnr gjahr budat awkey
                   INTO TABLE i_budat
                     FROM bkpf
                     FOR ALL ENTRIES IN i_awkey
                       WHERE awtyp = 'VBRK'
                       AND   awkey = i_awkey-awkey.
    Sudhakar

    1) SELECT SINGLE budat
    INTO ws_d_budat
    FROM bkpf
    WHERE awtyp = 'VBRK'
    AND awkey = wa_vbeln-vbeln.  -
    > <b>Not possible</b>
    2)SELECT vbeln posnr matnr
    FROM vbrp
    INTO corresponding fields of TABLE i_matnr
    FOR ALL ENTRIES IN i_vbeln
    WHERE vbeln = i_vbeln-vbeln
    AND matnr = ws_c_artnr
    AND posnr NE ' '.
    3) SELECT bukrs belnr gjahr budat awkey
    INTO corresponding fields of TABLE i_budat
    FROM bkpf
    FOR ALL ENTRIES IN i_awkey
    WHERE awtyp = 'VBRK'
    AND awkey = i_awkey-awkey.
    Reward points if helpful.
    Regards.
    Srikanta Gope

  • How to Write a PDF using File Adapter

    Hi All,
    Can anyone please let me know how to create a PDF file at the receiving end using a File Receiver Adapter. The source is an XML file. The scenario is as follows.
    XML-File ---> XI --->PDF-File.
    Any help would be highly appreciated.
    Thanks in Advance
    Anil.

    hi ,
    if u r using pi7.1 you  can  use agents concept.
    please find the links.
    http://help.sap.com/saphelp_nwpi71/helpdata/en/43/fc39c16bfb025ee10000000a1553f7/frameset.htm
    How to get started using Conversion Agent from Itemfield
    More on the SAP Conversion Agent by Itemfield
    Integrate SAP Conversion Agent by Itemfield with SAP XI
    Conversion Agent a Free Lunch?
    How to get started using Conversion Agent from Itemfield
    https://websmp102.sap-ag.de/~sapdownload/011000358700001090982006E/ConvAgentDocSP16.zip
    https://websmp102.sap-ag.de/~sapdownload/011000358700004921152005E/ConversionAgent.pdf
    XI: Generate PDF file out of file adapter
    XI: Read data from PDF file in Sender Adapter
    The specified item was not found.
    regards,
    navneet

  • How to write a procedure using collections

    how can we define collections inside procedure and use it
    i am getting an error executing this proc
    create or replace procedure p_collections
    is
    type calendar is varray(366) of  date;
    calendar c1;
    begin
    for i in 1 .. 100
    loop
    select sysdate bulk collect into c1 from dual;
    end loop;
    DBMS_OUTPUT.PUT_LINE(c1);
    end;Edited by: Rahul_India on Sep 12, 2012 2:54 PM
    Edited by: Rahul_India on Sep 12, 2012 3:07 PM

    That's because you only have one value in the array.
    Here is sample code that you can test in the SCOTT schema.
    set serveroutput on;
    declare
      cursor my_cur is
      select empno from emp;
      type my_type is table of emp.ename%type;
      type my_type2 is table of emp.empno%type;
      dizi my_type;
      dizi2 my_type2;
      query VARCHAR2(100);
    begin
      open my_cur;
      fetch my_cur bulk collect into dizi2;
      close my_cur;
      for i in dizi2.first..dizi2.last
      loop
        dbms_output.put_line(dizi2(i));
      end loop;
    end;
    /Or another sample using a LIMIT clause
    The FETCH does a BULK COLLECT of all data into 'v'. It will either get all the data or none if there isn't any.
    The LOOP construct would be used when you have a LIMIT clause so that Oracle would 'loop' back to
    get the next set of records. Run this example in the SCOTT schema and you will see how the LIMIT clause works.
    I have 14 records in my EMP table.
    DECLARE
      CURSOR c1 IS (SELECT * FROM emp);
      TYPE typ_tbl IS TABLE OF c1%rowtype;
      v typ_tbl;
    BEGIN
      OPEN c1;
      LOOP                                                 --Loop added
        FETCH c1 BULK COLLECT INTO v LIMIT 3; -- process 3 records at a time
            -- process the first 3 max records
           DBMS_OUTPUT.PUT_LINE('Processing ' || v.COUNT || ' records.');
            FOR i IN v.first..v.last LOOP
                DBMS_OUTPUT.PUT_LINE(v(i).empno);
            END LOOP; 
        EXIT WHEN c1%NOTFOUND;
      END LOOP;
      DBMS_OUTPUT.PUT_LINE('All done');
    END;In the FOR loop you would do any processing of the nested table you want to do
    and could use a FORALL to do an INSERT into another table.

  • How to write nested queries using DB Adapter?

    I want to write following nested query using DB Adapter can any one help...
    SELECT INVOICE_ID,FILE_NAME FROM  BILLING_INVOICE_PDF_V where FILE_ID =(
    (SELECT MAX(FILE_ID) FROM  BILLING_INVOICE_PDF_V WHERE  (INVOICE_ID = ‘12345’)));
    Thanks,
    Ram.

    Hi Ram,
    Most likely it is the semicolon at the end of the SQL statement that's causing the db adapter to throw the error; just enter the custom sql statement without a semicolon at the end.
    SELECT INVOICE_ID,FILE_NAME FROM  BILLING_INVOICE_PDF_V where FILE_ID = (SELECT MAX(FILE_ID) FROM  BILLING_INVOICE_PDF_V WHERE INVOICE_ID = '12345')

Maybe you are looking for

  • Adding a markup field to a map?

    Hello, I am looking to add an image of a map to a form, where people could put a mark where they want to. I have tried making 100's of check boxes, but that is.... cumbersome. Is there a way to have a field that will place a mark wherever they click?

  • Parsing Suffix from a Name

    Hi All, I want to parse a Name with patterns You can see the patterns in Name Column. I want the Middle Name has null which has suffix ('JR','SR','II','III','IV','VI','VII','VIII','IX') <font color="red"> No need to consider after 'AND' / '&' name </

  • Add ESSR Object in a DMS Object Link

    Hi everybody, i am trying to create an object link to Service Entry Sheet. (tcode: ML81N, ESSR-LBLNI) by sap instructions i did this step: "You must create two new screens with the same number for the module pools SAPLCV130 and SAPLCV140 . The proces

  • How to Connect Owa on Outlook 2010 client

    i want to connect OWA's appoinment from Outlook 2010 client. I custumized ribbon menu. Button's name is iwanttoclickthenhttpxxxcom.   I want to that I click iwanttoclickthenhttpxxxcom button(last button on image) then i will go to https://www.compute

  • Hi, My iPhone 4s does not work properly with the sound.

    Hi, My iPhone 4s does not work properly with the sound. It just ring. Any other app it doesn't make sound unless I have my headset or bluetooth. And it make me choose between "DOCK CONECTOR" or my "APPLE TV". Why? Or any sugestion plz