Multilinguism on complicated reportings

Hi,
as the title says I'm searching for some ideas to make my reportings accesible for more than one language.
Scenarion:
The company's default language is French, as second language I activated English. The majority of the users have French as default language but some of them use English.
As CRM On Demand standard the fieldnames (column names) are translated in reporting as indicated in the application. But: The picklist values remain always in the company's default language. So I have some english reportings with french values.
In addition to this: When I begin to do some calculation or case statements on a report's column the header will remain fix on the name that I have chosen, no possibility to do a translation.
I found 2 solutions by now:
1. create reportings seperately for french and english users in doing case statements to translate the picklist values (It's pretty long if you have picklists containing 90 values)
2. Create 1 reporting with the original column plus the translated column (translation by case statement, eg. for the sales stage). Then go to Step 2 and Create 2 pivot tables. in the first I met all columns but the translated sales stage. In the second I met all the columns but the non-tanslated sales stage. After that I created a view selector and renamed the to pivot tables in "Français" and "English". So the user can choose the report in order to have all columns in his language.
Unfortunately neither of the two solutions is really ergonomic. Either there are tons of reports to create or the user has to search manually the right language.
I tried to get some closer solutions with the valueof(nq_session.user_lang) but its not really fun. In the end it remains the same as solution 1 or 2.
Has anybody other ideas for an ergonomic workaround. I think solution 2 is only practicable with 2 languages. From the third on it will be really heavy to maintain the reporting.
Cheers Myriam

Hi,
If i understand rightly the system shows exactly in the same language the user entered data. A France user enters the picklist value in France and English user chooses in English. So the report which has combination of both data, would show a mix of French as well as English values. The system doesn't treat this different from other text fields
I have one suggestion in addition to what you listed below. Does it help to write a one time work flow to do the conversion to 2 different languages and store it in internal fields which you can later use to expose in reports conditionally depending on use language settings?
Hope this helps
-- Venky CRMIT

Similar Messages

  • New Calculated field question. Complicated I think.

    I have managed to create this table from a MySQL database: http://ppbm5.com/DB-PPBM5.php
    The field 'Total' is a calculated field using this SQL query:
    $query_Recordset1  = 'SELECT *, `Disk I/O`+`MPEG2-DVD`+`H264-BR`+IFNULL(`MPE On`,`MPE  Off`) As Total, `CPU`*`Cores` As Phys_Cores FROM `Personal_data` WHERE 1  ORDER BY (`Disk I/O`+`MPEG2-DVD`+`H264-BR`+IFNULL(`MPE On`,`MPE Off`)),  `Date & Time` ASC';
    So far, so good, but as you may have  noticed, there is a next field called 'Rel. Perf.' which only contains  blanks. And that is where my problems start.
    The table is sorted by 'Total' and the first record shows these figures and field names that are relevant for my question:
    Fields: 'Total'  'Disk I/O'  'MPEG2-DVD'   'H.264-BR'   'MPE On'   'MPE Off'
    Values:  131,        67,              21,                  37,              6,              64
    In addition, I use four 'weight' figures, let's say these are 0.27 , 0.30 ,  0.20 and 0.23 denoted as W1, W2, W3, W4.
    First step is to calculate four temp values, using a formula like this resulting in T1, T2, T3 and T4:
    T1 = W1 x  Total /Disk I/O; T2 =  W2 x Total/MPEG2-DVD ; T3 = W3 x Total/H.264-BR ; T4 = W4 x Total/(IFNULL(MPE On, MPE Off)
    Note that this only applies to the top record and here the SUM(T1, T2, T3, T4) results in 131, equal to the Total.
    The result of 100 x SUM(T1, T2, T3, T4)/ Total = 100 should be the 'Rel.Perf.' result for the top record.
    Now  is gets difficult. Let me call the records R1, R2, R3, ..., Rx. Now, in  the previous step we have established that the figure 100 should into  R1.
    For R2 the result of the 'Rel.Perf.' is 100 x SUM(T1 x Disk  I/O(2), T2 x MPEG2-DVD(2), T3 x (H.264-BR(2), T4 x (IFNULL(MPE on, MPE  Off)))/ Total(2)
    For R3 the result of the 'Rel.Perf.' is 100 x  SUM(T1 x Disk I/O(3), T2 x MPEG2-DVD(3), T3 x (H.264-BR(3), T4 x  (IFNULL(MPE on, MPE Off)))/ Total(3)
    etcetera for all the rest of the records in the table.
    A  complicating factor is that the reference point of the top machine  should remain fixed at 100, but when doing queries, the top machine may  not be in the query results, but all the query results for the Rel.Perf.  should be derived from these scores. Life would be infinitely easier if  one would be certain that the top machine is fixed, but that is not the  case.
    Sorry to make this such a long and complicated post, but  for those who have struggled through this long message, if you have any  suggestions on how to make this work, I would appreciate it.
    Thanks in advance.
    Harm, while non is intended.
    PS. I have been trying to generate a SQL query, using the following code:
    $query_Recordset1 = 'SELECT *, FORMAT(`Disk I/O`+`MPEG2-DVD`+`H264-BR`+IFNULL(`MPE On`,`MPE Off`),0) As Total, FORMAT((54.661*`Disk I/O`+161.25*`MPEG2-DVD`+71.66666*`H264-BR`+645*IFNULL(`MPE On`,`MPE Off`))/129,1) As RPI,`CPU`*`Cores` As Phys_Cores FROM `Personal_data` WHERE 1 ORDER BY 54.661*`Disk I/O`+161.25*`MPEG2-DVD`+71.66666*`H264-BR`+645*IFNULL(`MPE On`,`MPE Off`), `Disk I/O`+`MPEG2-DVD`+`H264-BR`+IFNULL(`MPE On`,`MPE Off`) ASC';
    For static work it is OK, but not when a new top performer submits his data.

    Hi William,
    Per my understanding that you want to count the number of the value in the field wait which is smaller then 15, right?
    I have tested on my local environment and that you can add the calculated field (Count) using the expression as below:
    =IIF(Fields!wait.Value<15,1,0)
    Insert an outside group row and then get the total count by using below expression:
    =SUM(Fields!Count.Value)
    Preview you will get the result like below:
    If your problem stil exists, please try to provide some sample data and the exprect count result you want.
    Any problem, please feel free to ask.
    Regards
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • Group by languages in multilingual table in sql server

    Hi ,
    I am having a multilingual table in SQL server 2008 , the table has two columns ID and Text
    The text column has English, Chinese and other language texts.
    I need a resultset grouped by the languages and count of id like
    Language   count_of_id
    English          25
    Chinese         10
    other languages 3
    Is this possible? Can you please help me?

    Good day SqlServer_learn
    I have a saying that I always uses: anything is possible in developing, if you have the appropriate resources (change the existing solution could be part of the way to solve...)
    regarding your question, there is simple solution, but for most cases, I highly recommend to change the table structure and add a column for the culture of the text (like: en-us for english,
    he-il for Hebrew and so on..).
    Since you are using unicode column like nvarchar to store multi language text,
    we can get the language from the text itself, as long as it include characters from that language (text which include only numbers for example we we consider as default language since it is the same in all languages). 
    step 1: First you need an accessory table (Named like UnicodeMapping) which include all unicode characters and the number of the char in unicode (a mapping unicode table). You can use ranges as well, but
    it will be faster for the queries if you actually have all the characters, and not just range.
    For example this table (I added English and Hebrew... Do the same with all the languages that you need):
    create table UnicodeMapping (Charecter nchar(1), UnicodeNum int, CultureN NVARCHAR(100), CollateN NVARCHAR(100))
    GO
    -- fill the table with main Hebrew characters, using a number table
    insert UnicodeMapping (Charecter, UnicodeNum, CultureN, CollateN)
    select NCHAR(n), n, 'He-IL', 'Hebrew_CI_AS'
    from _ArielyAccessoriesDatabase.dbo.ArielyNumbers
    where
    n between 1488 and 1514 -- Hebrew
    or n between 64304 and 64330 -- Hebrew
    GO
    -- fill the table with main English characters, using a number table
    insert UnicodeMapping (Charecter, UnicodeNum, CultureN, CollateN)
    select NCHAR(n), n, 'En-US', 'SQL_Latin1_General_CP1_CI_AS'
    from _ArielyAccessoriesDatabase.dbo.ArielyNumbers
    where
    n between 97 and 122 -- En
    or n between 65 and 90 -- En
    GO
    -- Do the same with all the languages that you need, and all the UNICODE ranges for those languages
    select * from UnicodeMapping
    GO
    Step 2: You can create a function which get NVARCHAR as input and return the culture as output, or work directly on the data using JOIN your table and this table.
    Assuming that each row is in specific language, In order to recognize the language, you just need to check 1 character from the original string (a text character and not a number for example which might be in any language) and examine which language this
    single character is, using the our UnicodeMapping.
    You can check this thread to see an implementation of this idea: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/ccc1d16f-926f-46c8-8579-b2eecf661e7c/sort-miultiple-language-data-in-sql-serevr-by-collation?forum=transactsql
    * dont forget to add to the table all the characters like numbers and chose them as your default language
    * in the link above I just select the first character using LEFT, but if the text start with number for example then you will get default language. If you sure that the text must start with real language character then it is best solution, but if not, than
    It is better to use a "user defined function" which will find the first character that is not in the default language. if the function do not find any char in non-default language than it return default language, else it check the language using
    the UnicodeMapping and return it.
      Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]

  • Trying to scan photos from my photo album to a folder on my desktop.  Have been trying to figure out for over an hour.  Seems very complicated and cumbersome,  Can you help?

    Trying to scan photos from my photo album to a folder on my desktop.  Have been trying to figure out for hours.  Seems very complicated and cumbersome.  Can anyone help?  It's got to be much quicker (fewer key strokes) and simpler than what I've been able to discover.

    Open the file, parse it, populate an ArrayCollection or XMLListCollection, and make the collection the DataGrid dataProvider:
    http://livedocs.adobe.com/flex/3/html/help.html?content=Filesystem_08.html
    http://livedocs.adobe.com/flex/3/html/help.html?content=12_Using_Regular_Expressions_01.ht ml
    http://livedocs.adobe.com/flex/3/html/help.html?content=dpcontrols_6.html
    http://livedocs.adobe.com/flex/3/langref/mx/collections/ArrayCollection.html
    http://livedocs.adobe.com/flex/3/langref/mx/collections/XMLListCollection.html
    If this post answered your question or helped, please mark it as such.

  • Photostream overly complicated, can't save photos to Camera Roll

    For those of us who like to manage our photos manually, why is it so overly complicated to manage images between Photostream and Camera Roll?
    First, I just want to save photos from my old iPhone, which I added to from iPhoto to my Photostream because it seemed to be the only way, to my Camera Roll. This is not possible though. When I go to Photostream and select photos then select "Add To" it shows Camera Roll but it does not allow me to select Camera Roll and add them. The only option I can select is to create a new album within Photostream. If I just select an image in Photostream and then hit the share button, it also does not give me a save to Camera Roll option.
    I only want to use the Camera Roll, yet even with Photostream turned off, photos I take on my iPhone still show up in the Photostream.
    I just don't understand why this is so complicated. I've seen forum discussions that say it's easy to save Photostream photos to Camera Roll, but I've tried every way mentioned but it never gives me the option of saving to Camera Roll.
    Help please. Thanks.

    Create an album for your old photos.  Connect your phone to iTunes on your computer. On the phone's summary page tap the Photos tab. Check the Sync photos from checkbox. Click the button next to the checkbox.  Navigate to the folder on your computer where the pictures are located.  Add them to your album.
    Doing this in reverse is the only way to get these pictures back off your phone.
    I agree iCloud / Photostream for photos is way to complicated and useless, but it is locked down to keep people from trying to use it to share commercial videos and music via the shared photostream. At least that is my guess.

  • Idk why i made my password complicated, but i did and now i cant unlock it! help!

    Well, i had a fit and decided to change my code from simple to complicated. Being that i was mad, i just put a long, emphasizing long, passcode, but when i cooled down i didnt remember what it was! I tried at least 6 tmes to unlock it while it was still locked.. i failed miserably, but luckily, i had it unlocked (at the time). So, i changed it from auto lock 1 min to autolock never. Stupid of me to think that that would solve anything.. So im reading catching fire, and i click the top button, force of habbit, and put it in my pocket so i can get a drink of juice. i sit down to open my phone and continue reading and it tells me its locked! I tried every password i could think of! I've been trying to figure this out for at least 6 hours! i dont want to restore it because its going to take away all my text messages and i have over 30, 13 before i locked the stupid phone and the rest after! Besides, if i restore it, i'll lose my page in my book, and i totally dont wanna do that since its such a hassle to skip continuously page by page until i find where i was at. what about my contacts? i get new ones all the time and i would hate to lose them all! do you think, maybe.. possibly.. theres anyway that apple can tell me my passcode? My phone is registered to my account and its on this computer, do you think that they could possibly understand my stupid mistake and unlock it for me? not to mention the music and the apps! Oh gosh, i have a headache just thinking about the apps and the music! just ugh! i really hope that they can.. i've been using siri to call people and text people for me, but she wont read the book to me! its painful to hear all those text messages coming through but not being able to see one! When i ask siri to please read my unread text messages, she says i have NONE! maybe she says it just to protect my privacy, but i dont care! Now i'm thinking i shouldnt have changed it so i wouldnt be able to see the banner for my text! At least i couldve read them and replied! Gosh, my life *****.. Sigh..

    ... do you think, maybe.. possibly.. theres anyway that apple can tell me my passcode?
    No. They don't know it. Siri knows but she is sworn to secrecy.
    If you synced your phone with iTunes you will only have lost whatever you did since. Your apps are fine.
    If you cannot remember its passcode you will need to restore the iPhone using the computer with which it was last synced. This allows you to reset your passcode and resync the data from the computer, or restore the device from a backup.
    Refer to Updating and restoring iPhone, iPad and iPod touch software.
    iOS: Wrong passcode results in red disabled screen
    iOS: Unable to update or restore

  • Multilingual URL is not working in IE11

    Multilingual URL is not working in IE11 same URL is working with other browser. Would like to know whether Arabic URL is supported in IE11? 

    Hello,
    See this http://windows.microsoft.com/en-gb/windows-vista/change-your-internet-explorer-language-settings and follow the steps given
    there. After that let us know whether it is working now or still not.
    "Solution is to enable Send
    IDN server names for non-Intranet URLs under
    advanced settings. " This is also a solution.
    Thanks Prakash
    Varghese!
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • I have upgrade ios 6 to ios7 on my iphone 5.  I do NOT like it.  I want to come back to the previosu version.  why is it so complicated.  Why can I not find the instruction strait from apple? This is the worst possible upgrade ever.

    I have upgrade ios 6 to ios7 on my iphone 5.  I do NOT like it at all.   I want to come back to the previous version.  why is it so complicated? Why can I not find the instruction strait from apple? This is the worst possible upgrade ever.  It make me think of when ericsson got sold to Sony....drastic PC change.
    I would like to have simple instruction on how to downgrade.
    It feel like a change that I did not ask for , ok I push the upgrade buttom, but really this is the worst update aver!
    HELP!

    iPhone User Guide (For iOS 7 Software)Sep 20, 2013 - 23 MB

  • Complicated problem: Laggy Macbook Pro, now not booting

    I am facing a very complicated issue with my unibody Early 2011 15" Macbook Pro (2.2 ghz core i7, 4gb 1333mhz ram, amd radeon 6750m, if you need hardware details).
    I guess the issue started after my computer started to get laggy for no reason at all: it was never the GUI that lagged, but whenever I would perform some data-dependent tasks such as playing a video, or trying to open a big file. This lagging did coincide with some of my friends playing around with magnets around my computer (which may have possibly corrupted hard disk data).
    After it got laggy, another major problem hit my MacBook, where I plugged in an old, broken USB into one of the ports by accident, and the computer suddenly shut it self off. The computer then seemed to have no power at all, with no response to pressing power button, or the battery indicator button. I feared the worst: that my logic board had been fried, so I immediately took my computer to the Apple Reseller. The technicians there said it was no problem at all, just that my motherboard had shut itself of in order to protect itself from a USB power shortage, and he unplugged and replugged this one small component on the logic board, which I am guessing is the Power Management Unit, and my computer miraculeously started booting.
    So then, I get back home, and the laggy problem is still there. I just had to cope with the problem for a few days, until I go back to the Apple Reseller, but then suddenly, after a restart, the computer started not even booting. The grey apple icon would blink, and turn into a circle with a cross icon. Checked online, and this is apparently related to corrupted system files. This is where I began to suspect that the USB shut-off from few days ago, did more damage than the technicians thought: maybe related to the hard disk, or RAM.
    But then again, it could have just been a coincidental corrupt hard disk from my actions, so I wiped/repartitioned my hard disk, and restored the OS and my files from a TIme Machine Backup. Again, the problem was still there, so I thought it might be to do with my backed up system files, so I did a fresh install of Lion.
    The fresh install of Lion seemed to eliminate all lagging problems, but after I started copying my files and installing applications from Time Machine, the lagging problem gradually returned. So another question arose, was it a faulty hard disk, or a corrupt file or application that was making it laggy? To check if it was my hard disk, I did a zero-over erase of the entire disk with Disk Utility, and sure enough, the writing process failed in the middle.
    After thinking I zeroed in on the problem, I replaced the hard disk in my Macbook Pro with another 750gb Toshiba SATA drive, and did a clean install of Lion. Once again, the laggy problem was gone, but just like the old hard disk, the laggy problem returned after I started copying files over and installing applications. Switching applications would take forever, and accessing folders on my hard disk would also be laggy. Playing videos was impossible, but the GUI (dock, spaces, etc) were all very responsive.
    Now, I thought the problem is either with faulty RAM, or my hard disk reader is broken (since two hard disks, although the original one was faulty, both failed). I read online that the Apple Hardware Test (AHT) can help identify and pinpoint hardware problems, so I inserted the 2nd disk that came with my computer (Applications Install), and pressed D, but then nothing came up. After countless attempts, I maybe thought it was the wrong disk, so I inserted the 1st disk (OS Installer), and held D while booting, but still, AHT would not load.
    After countless attempts at loading AHT, all of which led to me forcing shut down/holding power button after seeing the Apple logo, brings the problem to where I am at now: my Macbook does not boot into the login screen. After the Apple logo, and the spinner wheel have appeared, the screen turns white and the display becomes an infinite loop of switching from a gray color, to a white color.
    This problem is frustrating me very much, because there are so many possible causes, and the problem persists even after reinstalling the OS, and even replacing the ard drive. The logic board shutoff could be the cause, but then again, the lagging problem started way before it happened. Somebody please tell me what is the problem, and what I should do? Thanks in advance.

    novaria wrote:
    Didn't know my magnets were strong enough to corrupt hard disks.
    Yes, it's a method used to destroy data on a hard drive as it's recorded using magnetic fields, either "on" or "off" to represent the 1's and 0's that make up the basic building blocks of your data.
    But, the magnet does not explain why the hard disk reported an error when being erased with zero-over option.
    When the driver software has a problem reading the data on the drive, it assumes it's a bad sector, then maps it off and uses a spare. You likely ran out of spares.
    I just tried zero-over erasing the second, good hard disk that replaced the original, but again, it fails. Is this a common problem with the zero erase option?
    No.
    or is it something to do with my hard disks, or some sort of damaged hardware in my computer?
    Well this is drive #2 and it's new, and you get the same problem.
    It's either something your doing, (like moving the hard drive/ computer while it's operating thus the heads are striking the platters) or it's a hardware defect, or perhaps the magnets did other damage we can't see, perhaps it's magnatized the computer and that's affecting the hard drive or electronics.
    May be a loose or defective cable.
    It's time for a hardware evaluation at this point.

  • How complicated is it to implement Robohelp Server for multiple authors?

    I am presently the lone techical writer in my company and I use Robohelp HTML V8 to generate WebHelp for our software. The RH software has been upgraded from an original V5 Robohelp full license, to a V7 upgrade and then a V8 upgrade.
    I am investigating the use of Robohelp Server to open the possibility of adding another author, and would like to know how complicated it is. Do we still need to buy two seat licenses for Robohelp V9 as well as Robohelp Server V9, or are they included with the Server license?  Also, are there any concerns for upgrading V8 project to V9? 
    If this information is already covered somewhere in the forums, please feel free to point me in that direction. I have not been able to find it myself. Thanks in advance!  

    Hi Sheryl
    Indeed what you likely want is some form of source control. And certainly, splitting the project up and making different folks "captain of their own ship", is one way to roll.
    But it sounds like you may have either misunderstood or had the RoboSource control misconfigured. With any source control system, the way it usually works is by storing all the content on the server in the source control database. But for each client connecting to the database, you establish what is called a "Working Folder". And that is usually on each local PC. When you check files out, they are copied to the working folder. So you work locally, but the application handles copying them back and forth to and from the server as you work. That way, you shouldn't be seeing performance issues.
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7, 8 or 9 within the day!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • I need a solution of this complicated problem to finalize my final project

    Introduction
    This project revolves around an important text processing task, text compression. In particular, you will be required to encode a sequence of words read from a source file into binary strings (using only the characters 0 and 1). It is important to note that text compression makes it possible to minimize the time needed to transmit text over a low-bandwidth channel, such as infrared connection. Moreover, text compression is helpful in storing large documents more efficiently. The coding scheme explored in this project is the Huffman Coding Scheme. While standard encoding schemes, such as Unicode and ASCII, use fixed-length binary strings to encode characters, Huffman coding assigns variable-length codes to characters. The length of a Huffman code depends on the relative frequency of its associated character. Specifically, Huffman coding capitalizes on the fact that some characters are used more frequently than others to use short codewords when encoding high-frequency characters and long codewords to encode low-frequency characters. Huffman coding saves space over state of the art fixed-length encoding and is therefore at the heart of file compression techniques in common use today. Figure 1 shows the relative frequencies of the letters of the alphabet as they appear in a representative sample of English documents.
    Letter     Frequency     Letter     Frequency
    A     77     N     67
    B     17     O     67
    C     32     P     20
    D     42     Q     5
    E     120     R     59
    F     24     S     67
    G     17     T     85
    H     50     U     37
    I     76     V     12
    J     4     W     22
    K     7     X     4
    L     42     Y     22
    M     24     Z     2
    Figure 1. Relative frequencies for the 26 letters of the alphabet.
    Huffman coding and decoding
    Huffman’s algorithm for producing optimal variable-length codes is based on the construction of a binary tree T that represents the code. In other words, the Huffman code for each character is derived from a full binary tree known as the Huffman coding tree, or simply the Huffman tree. Each edge in the Huffman tree represents a bit in a codeword, with each edge connecting a node with its left child representing a “0” and each edge connecting a node with its right child representing a “1”. Each external node in the tree is associated with a specific character, and the Huffman code for a character is defined by the sequence of bits in the path from the root to the leaf corresponding to that character. Given codes for the characters, it is a simple matter to use these codes to encode a text message. You will have simply to replace each letter in the string with its binary code (a lookup table can be used for this purpose).
    In this project, you are not going to use the table given in Figure 1 to determine the frequency of occurrence per character. Instead, you will derive the frequency corresponding to a character by counting the number of times that character appears in an input file. For example, if the input file contains the following line of text “a fast runner need never be afraid of the dark”, then the frequencies listed in the table given in Figure 2 should be used per character:
    Character          a     b     d     e     f     H     i     k     n     O     r     s     t     u     v
    Frequency     9     5     1     3     7     3     1     1     1     4     1     5     1     2     1     1
    Figure 2. The frequency of each character of the String X.
    Based on the frequencies shown in Figure 2, the Huffman tree depicted in Figure 3 can be constructed:
    Figure 3. Huffman tree for String X.
    The code for a character is thus obtained by tracing the path from the root of the Huffman tree to the external node where that character is stored, and associating a left edge with 0 and a right edge with 1. In the context of the considered example for instance, the code for “a” is 010, and the code for “f” is 1100.
    Once the Huffman tree is constructed and the message obtained from the input file has been encoded, decoding the message is done by looking at the bits in the coded string from left to right until all characters are decoded. This can be done by using the Huffman tree in a reverse process from that used to generate the codes. Decoding the bit string begins at the root of the tree. Branches are taken depending on the bit value – left for ‘0’ and right for ‘1’ – until reaching a leaf node. This leaf contains the first character in the message. The next bit in the code is then processed from the root again to start the next character. The process is repeated until all the remaining characters are decoded. For example, to decode the string “0101100” in the case of the example under study, you begin at the root of the tree and take a left branch for the first bit which is ‘0’. Since the next bit is a ‘1’, you take a right branch. Then, you take a left branch (for the third bit ‘1’), arriving at the leaf node corresponding to the letter a. Thus, the first letter of the coded word is a. You then begin again at the root of the tree to process the fourth bit, which is a ‘1’. Taking 2 right branches then two left branches, you reach the leaf node corresponding to the letter f.
    Problem statement
    You are required to implement the Huffman coding/decoding algorithms. After you complete the implementation of the coding/decoding processes, you are asked to use the resulting Java code to:
    1.     Read through a source file called “in1.dat” that contains the following paragraph:
    “the Huffman coding algorithm views each of the d distinct characters of the string X as being in separate Huffman trees initially with each tree composed of a single leaf node these separate trees will eventually be joined into a single Huffman tree in each round the algorithm takes the two binary trees with the smallest frequencies and merges them into a single binary tree it repeats this process until only one tree is left.”
    2.     Determine the actual frequencies for all the letters in the file.
    3.     Use the frequencies from the previous step to create a Huffman coding tree before you assign codes to individual letters. Use the LinkedBinaryTree class that we developed in class to realize your Huffman coding trees.
    4.     Produce an encoded version of the input file “in1.dat” and then store it in an output file called “out.dat”.
    5.     Finally, the decoding algorithm will come into play to decipher the codes contained in “out.dat”. The resulting decoded message should be written to an output file called “in2.dat”. If nothing goes wrong, the text stored in “in1.dat” and the one in “in2.dat” must match up correctly.

    jschell wrote:
    I need a solution of this complicated problem to finalize my final project The solution:
    1. Write code
    2. Test code3. If test fails, debug code, then go to step 2.

  • Upgrade to Multilingual firmware using another carrier's firmware

    I have a Curve 8310 by Essar Vodaphone (India). I need to install a multilingual support package which my carrier does not have but others (such as AT&T, Vodaphone) have. Can I use an AT&T support package on my 8310?
    Message Edited by rami on 05-01-2008 03:14 PM

    Was the disk meant to only operate on one Mac
    Yes.
    (52892)

  • Transferring Aperture from my Macbook Pro 5,5 to a new MacBook looks complicated.  If I purchasea new, updated Aperture, can I open my old vault on an external disk in the new Mac?

    Transferring Aperture from my Macbook Pro 5,5 to a new MacBook looks complicated.  If I purchasea new, updated Aperture, can I open my old vault on an external disk in the new Mac?

    Mac OS X 10.7 Help: Troubleshoot a network printer

  • How can I use XStream to persist complicated Java Object  to XML & backward

    Dear Sir:
    I met a problem as demo in my code below when i use XTream to persist my Java Object;
    How can I use XStream to persist complicated Java Object to XML & backward??
    See
    [1] main code
    import java.io.BufferedReader;
    import java.io.BufferedWriter;
    import java.io.FileReader;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.util.ArrayList;
    import com.thoughtworks.xstream.XStream;
    import com.thoughtworks.xstream.io.xml.DomDriver;
    public class PhoneList {
         ArrayList<PhoneNumber> phones;
         ArrayList<Person> person;
         private PhoneList myphonelist ;
         private LocationTest location;
         private PhoneList(String name) {
         phones = new ArrayList<PhoneNumber>();
         person = new ArrayList<Person>();
         public ArrayList<PhoneNumber> getphones() {
              return phones;
         public ArrayList<Person> getperson() {
              return person;
         public void addPhoneNumber(PhoneNumber b1) {
              this.phones.add(b1);
         public void removePhoneNumber(PhoneNumber b1) {
              this.phones.remove(b1);
         public void addPerson(Person p1) {
              this.person.add(p1);
         public void removePerson(Person p1) {
              this.person.remove(p1);
         public void BuildList(){
              location = new LocationTest();
              XStream xstream = new XStream();
              myphonelist = new PhoneList("PhoneList");
              Person joe = new Person("Joe, Wallace");
              joe.setPhone(new PhoneNumber(123, "1234-456"));
              joe.setFax(new PhoneNumber(123, "9999-999"));
              Person geo= new Person("George Nixson");
              geo.setPhone(new PhoneNumber(925, "228-9999"));
              geo.getPhone().setLocationTest(location);          
              myphonelist.addPerson(joe);
              myphonelist.addPerson(geo);
         public PhoneList(){
              XStream xstream = new XStream();
              BuildList();
              saveStringToFile("C:\\temp\\test\\PhoneList.xml",convertToXML(myphonelist));
         public void saveStringToFile(String fileName, String saveString) {
              BufferedWriter bw = null;
              try {
                   bw = new BufferedWriter(
                             new FileWriter(fileName));
                   try {
                        bw.write(saveString);
                   finally {
                        bw.close();
              catch (IOException ex) {
                   ex.printStackTrace();
              //return saved;
         public String getStringFromFile(String fileName) {
              BufferedReader br = null;
              StringBuilder sb = new StringBuilder();
              try {
                   br = new BufferedReader(
                             new FileReader(fileName));
                   try {
                        String s;
                        while ((s = br.readLine()) != null) {
                             // add linefeed (\n) back since stripped by readline()
                             sb.append(s + "\n");
                   finally {
                        br.close();
              catch (Exception ex) {
                   ex.printStackTrace();
              return sb.toString();
         public  String convertToXML(PhoneList phonelist) {
              XStream xstream = new  XStream(new DomDriver());
              xstream.setMode(xstream.ID_REFERENCES) ;
              return xstream.toXML(phonelist);
         public static void main(String[] args) {
              new PhoneList();
    }[2].
    import java.io.Serializable;
    import javax.swing.JFrame;
    public class PhoneNumber implements Serializable{
           private      String      phone;
           private      String      fax;
           private      int      code;
           private      String      number;
           private      String      address;
           private      String      school;
           private      LocationTest      location;
           public PhoneNumber(int i, String str) {
                setCode(i);
                setNumber(str);
                address = "4256, Washington DC, USA";
                school = "Washington State University";
         public Object getPerson() {
              return null;
         public void setPhone(String phone) {
              this.phone = phone;
         public String getPhone() {
              return phone;
         public void setFax(String fax) {
              this.fax = fax;
         public String getFax() {
              return fax;
         public void setCode(int code) {
              this.code = code;
         public int getCode() {
              return code;
         public void setNumber(String number) {
              this.number = number;
         public String getNumber() {
              return number;
         public void setLocationTest(LocationTest bd) {
              this.location = bd;
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(location);
            f.getContentPane().add(location.getControls(), "Last");
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
         public LocationTest getLocationTest() {
              return location;
         }[3].
    package test.temp;
    import java.io.Serializable;
    public class Person implements Serializable{
         private String           fullname;
           @SuppressWarnings("unused")
         private PhoneNumber      phone;
           @SuppressWarnings("unused")
         private PhoneNumber      fax;
         public Person(){
         public Person(String fname){
                fullname=fname;           
         public void setPhone(PhoneNumber phoneNumber) {
              phone = phoneNumber;
         public void setFax(PhoneNumber phoneNumber) {
              fax = phoneNumber;
         public PhoneNumber getPhone() {
              return phone ;
         public PhoneNumber getFax() {
              return fax;
        public String getName() {
            return fullname ;
        public void setName(String name) {
            this.fullname      = name;
        public String toString() {
            return getName();
    }[4]. LocationTest.java
    package test.temp;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class LocationTest extends JPanel implements ChangeListener
        Ellipse2D.Double ball;
        Line2D.Double    line;
        JSlider          translate;
        double           lastTheta = 0;
        public void stateChanged(ChangeEvent e)
            JSlider slider = (JSlider)e.getSource();
            String name = slider.getName();
            int value = slider.getValue();
            if(name.equals("rotation"))
                tilt(Math.toRadians(value));
            else if(name.equals("translate"))
                moveBall(value);
            repaint();
        protected void paintComponent(Graphics g)
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            if(ball == null)
                initGeom();
            g2.setPaint(Color.green.darker());
            g2.draw(line);
            g2.setPaint(Color.red);
            g2.fill(ball);
        private void initGeom()
            int w = getWidth();
            int h = getHeight();
            int DIA = 30;
            int padFromEnd = 5;
            line = new Line2D.Double(w/4, h*15/16, w*3/4, h*15/16);
            double x = line.x2 - padFromEnd - DIA;
            double y = line.y2 - DIA;
            ball = new Ellipse2D.Double(x, y, DIA, DIA);
            // update translate slider values
            int max = (int)line.getP1().distance(line.getP2());
            translate.setMaximum(max);
            translate.setValue(max-padFromEnd);
        private void tilt(double theta)
            // rotate line from left end
            Point2D pivot = line.getP1();
            double lineLength = pivot.distance(line.getP2());
            Point2D.Double p2 = new Point2D.Double();
            p2.x = pivot.getX() + lineLength*Math.cos(theta);
            p2.y = pivot.getY() + lineLength*Math.sin(theta);
            line.setLine(pivot, p2);
            // find angle from pivot to ball center relative to line
            // ie, ball center -> pivot -> line end
            double cx = ball.getCenterX();
            double cy = ball.getCenterY();
            double pivotToCenter = pivot.distance(cx, cy);
            // angle of ball to horizon
            double dy = cy - pivot.getY();
            double dx = cx - pivot.getX();
            // relative angle phi = ball_to_horizon - last line_to_horizon
            double phi = Math.atan2(dy, dx) - lastTheta;
            // rotate ball from pivot
            double x = pivot.getX() + pivotToCenter*Math.cos(theta+phi);
            double y = pivot.getY() + pivotToCenter*Math.sin(theta+phi);
            ball.setFrameFromCenter(x, y, x+ball.width/2, y+ball.height/2);
            lastTheta = theta;  // save theta for next time
        private void moveBall(int distance)
            Point2D pivot = line.getP1();
            // ball touches line at distance from pivot
            double contactX = pivot.getX() + distance*Math.cos(lastTheta);
            double contactY = pivot.getY() + distance*Math.sin(lastTheta);
            // find new center location of ball
            // angle lambda = lastTheta - 90 degrees (anti-clockwise)
            double lambda = lastTheta - Math.PI/2;
            double x = contactX + (ball.width/2)*Math.cos(lambda);
            double y = contactY + (ball.height/2)*Math.sin(lambda);
            ball.setFrameFromCenter(x, y, x+ball.width/2, y+ball.height/2);
        JPanel getControls()
            JSlider rotate = getSlider("rotation angle", "rotation", -90, 0, 0, 5, 15);
            translate = getSlider("distance from end",  "translate", 0, 100, 100,25, 50);
            JPanel panel = new JPanel(new GridLayout(0,1));
            panel.add(rotate);
            panel.add(translate);
            return panel;
        private JSlider getSlider(String title, String name, int min, int max,
                                  int value, int minorSpace, int majorSpace)
            JSlider slider = new JSlider(JSlider.HORIZONTAL, min, max, value);
            slider.setBorder(BorderFactory.createTitledBorder(title));
            slider.setName(name);
            slider.setPaintTicks(true);
            slider.setMinorTickSpacing(minorSpace);
            slider.setMajorTickSpacing(majorSpace);
            slider.setPaintLabels(true);
            slider.addChangeListener(this);
            return slider;
    }OK, My questions are:
    [1]. what I generated XML by XSTream is very complicated, especially for object LocationTest, Can we make it as simple as others such as Person object??
    [2]. after I run it, LocationTest will popup and a red ball in a panel will dsiplay, after I change red ball's position, I hope to persist it to xml, then when I read it back, I hope to get same picture, ie, red ball stiil in old position, How to do that??
    Thanks a lot!!

    Positive feedback? Then please take this in a positive way: if you want to work on persisting Java objects into XML, then GUI programming is irrelevant to that goal. The 1,000 lines of code you posted there appeared to me to have a whole lot of GUI code in it. You should produce a smaller (much smaller) example of what you want to do. Calling the working code from your GUI program should come later.

  • Custom column in a list view web part for a multilingual site does not take on custom language labels. Stays in default language.

    Hello all,
    I have what so far appears to be a fairly unique problem.  We are running a multilingual SharePoint 2010 environment with English as the default language and French as the secondary.  We have setup the sites in a variance relationship, but the
    issue I am discussing happens outside of a variant as well.
    We have created a library outside the variant (but within the collection) that the two sites must share.  A list view web part was created via Designer to add to each site to provide a quick view into the list.  If we are in the libary and switch
    to French, then update the column label it will remember the setting (because of the resource file) and maintain it as the language is flipped back and forth.  Where it doesn't work is as a web part in a variant or where the language is different.
    If the language is different, the out of the box columns work find, but the custom columns (all site columns not library\list columns) remain as the english label.  It doesn't matter if within a variant or outside with the browser language changed. 
    It always reverts back to English.  It's like it isn't using the same resource file that was used in the list itself.
    I created a custom view and modified it with xslt as per
    http://sharepoint.stackexchange.com/questions/50004/how-to-change-column-title-for-a-view-but-not-modify-the-list but this only worked within the list and did not occur in the list view either.
    I can't be the first that has come across it, either I am not performing my searches properly, no one has ever documented a fix for this or this is something we just can't fix with OOTB tools.  That's the other thing, the solution has to be accomplised
    OOTB or with minor client side changes.  I can't fire up Visual Studio because they are piloting Office 365 and have put a "No custom code" mandate on for migration.
    Thank you all in advance.

    Ok, I have come up with a solution.  I edited the XSLT for the web part on the page.  I did the following:
    1.    Create the variants in the Site Ccollection
    2.    Create the library outside of the variants.
    3.    Add all the columns you require for the library.  It is very important all the columns are there before you move on.
    4.    Create a French and English view.
    5.    Create the list view web part via designer.
    6.    Add the list view web part to each site selecting the appropriate view to use.
    7.      Edit the page in SharePoint Designer 2010.
    8.      Place cursor in the column you wish to modify.
    9.      Click Design in the List View Tools on the ribbon.  
    10.     Then click Customize XSLT and select Customize Item.  Select this option otherwise you will generate a **LOT** of unnecessary XSL code.
    11.     You are looking for a piece that resembles the following:
            <xsl:with-param name="fieldtitle">
              <xsl:value-of select="@DisplayName"/>
            </xsl:with-param>
    12.      Modify it by typing in the actual column name you want.  You should end up with something like this:
            <xsl:with-param name="fieldtitle">
              New Column Name.
            </xsl:with-param>
    13.      Now, for this page only, the column will be renamed.
    There are some caveats:
    1.    Doesn’t appear to work in a publishing portal.  I think this has to do with how SP stores the pages in this case.  In a publishing portal you can only modify the page layout which won’t work as we need to modify the content.
    2.    If you add another column, you will need to repeat the XSLT modification
    Anyways, I hope this helps out any others with the same issue or need as I had.

Maybe you are looking for

  • SAP DMS server installation Query

    Guys, I would like to share my plans on DMS server installation under DEV,Quality,prod stage and requesting you all to validate and send me any comments if I am wrong anywhere. -        We have 1 external DMS server of (250Gb capacity) -     We are n

  • How to find multiple entries in the Directory

    Hi, my directory contains lot of multiple entires and I want to find out is there a easier method by a script or command to find out all the mutiple entries in the directory. Thanks!! Message was edited by: Sun_One@TCS Message was edited by: Sun_One@

  • Illegal Region Number

    After months of trouble free running, I'm getting "Illegal Region Number" error messages popping up with no clue as to which region or any other information. Usually (but not always) it happens when I've hit stop after recording an audio track. It do

  • Check writer XML not working.

    We are using the oracle provided Check writer XML program for HR Payroll check printing. Check writer XML program is getting error ed out when we attach MICR font set up to the Check writer XML Template in template definition, works fine if we remove

  • Gridcontrol 10.2.0.1 install error on 10.2.0.1 database

    Error looking for DBMS_SHARED_POOL package when installing on 10.2.0.1 I was looking for a work around to get to GridControl 10.2.0.4 on 10.2.0.4 database Soo... now it looks like hours and hours to install to get to the latest version of grid and DB