Bit Calculator - Criticize please

After teaching myself basic java, I've created my first useful java app. A bit calculator.
first off what data type should i be using?? I used a Float type.
Second any critisizm on my code is welcomed. change it and make it your own. I will only learn from it.
Third I compared it to a Perl bitcalculator which i find superior to the one I've created. http://www.matisse.net/bitcalc/ Is it fair to compare the two? Perl I assume you don't have to choose the data type.
I challenge you to improve my code.
Part 2 of my question is that i sometimes see multiple class files for the same program. Can anybody point me to a good tutorial that would explain when i should use more than 1 class file and why I should.
thanks in advance amigos.
import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
public class BitCalculator extends JApplet implements ActionListener {
private JButton but1;
private JComboBox combo1;
private JTextField textfield1;
private JLabel label1;
private float size;
private String s;
private double intBitsSize;
  public void init() {
      Container content = getContentPane();
     content.setLayout(new BorderLayout());
    JPanel jp1 = new JPanel();
    JPanel jp2 = new JPanel();
    but1= new JButton("Calculate");
    but1.addActionListener(this);
    textfield1= new JTextField(10);
    label1 = new JLabel();
    combo1 = new JComboBox();
    combo1.addItem("Bits");
    combo1.addItem("Bytes");
    combo1.addItem("Kilobits");
    combo1.addItem("Kilobytes");
    combo1.addItem("Megabits");
    combo1.addItem("Megabytes");
    combo1.addItem("Gigabits");
    combo1.addItem("Gigabytes");
    content.add (jp1,BorderLayout.NORTH);
    content.add (jp2,BorderLayout.CENTER);
    //jp1.setBackground(Color.white);
    jp1.setLayout(new FlowLayout());
    jp1.add(textfield1);
    jp1.add(combo1);
    jp1.add(but1);
    jp2.add(label1);
//content.setVisible(false);
public void actionPerformed(ActionEvent e){
      s = (String)combo1.getSelectedItem();
        size = Integer.parseInt(textfield1.getText());
     // label1.setText(size + " " + s);
        if (s=="Gigabytes"){
            size = size * 1024* 1024 * 1024 * 8;
           doCalculate (size);
     else if (s=="Gigabits"){
         size = size * 1024* 1024 * 1024;
           doCalculate (size);
     else if (s=="Megabytes"){
            size = size * 1024* 1024 * 8;
           doCalculate (size);
     else if (s=="Megabits"){
         size = size * 1024* 1024;
           doCalculate (size);
     else if (s=="Kilobytes"){
            size = size * 1024* 8;
           doCalculate (size);
     else if (s=="Kilobits"){
         size = size * 1024* 1024;
           doCalculate (size);
     else if (s=="Bytes"){
            size = size * 8;
           doCalculate (size);
        else if (s=="Bits"){
         doCalculate(size);
public void doCalculate( float number){
   String strFinal;
   strFinal = "<html>" + ("Bits - " + number) + "<br>";
   strFinal = strFinal + ("Bytes - " + (number/8) + "<br>" );
   strFinal = strFinal + ("Kilobits - " + (number/1024)) + "<br>";
   strFinal = strFinal + ("Kilobytes - " + (number/8/1024)) + "<br>";
   strFinal = strFinal + ("Megabits - " + (number/1024/1024)) + "<br>";
   strFinal = strFinal + ("Megabytes - " + (number/8/1024/1024)) + "<br>";
   strFinal = strFinal + ("Gigabits - " + (number/1024/1024/1024)) + "<br>";
   strFinal = strFinal + ("Gigabytes - " + (number/8/1024/1024/1024)) + "</html>";
   label1.setText(strFinal);
}

Just for fun, I reworked your code. This is my solution:
package server;
import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
public class BitCalculator extends JApplet implements ActionListener {
private JButton but1;
private JComboBox combo1;
private JTextField textfield1;
private JLabel label1;
  enum BitSizes{
       Bits{
            public long getSize(){ return 1;}
       Bytes{
            public long getSize(){ return 8;}
       Kilobits{
            public long getSize(){ return 1024;}
       Kilobytes{
            public long getSize(){ return 8 * 1024;}
       Megabits{
            public long getSize(){ return 1024 * 1024;}
       Megabytes{
            public long getSize(){ return 8 * 1024 * 1024;}
       Gigabits{
            public long getSize(){ return 1024 * 1024 * 1024;}
       Gigabytes{
            public long getSize(){ return 8 * 1024 * 1024 * 1024;}
       public abstract long getSize();
  public void init() {
      Container content = getContentPane();
     content.setLayout(new BorderLayout());
    JPanel jp1 = new JPanel();
    JPanel jp2 = new JPanel();
    but1= new JButton("Calculate");
    but1.addActionListener(this);
    textfield1= new JTextField(10);
    label1 = new JLabel();
    combo1 = new JComboBox();
    for(BitSizes bitSize : BitSizes.values()){
         combo1.addItem(bitSize.name());
    content.add (jp1,BorderLayout.NORTH);
    content.add (jp2,BorderLayout.CENTER);
    //jp1.setBackground(Color.white);
    jp1.setLayout(new FlowLayout());
    jp1.add(textfield1);
    jp1.add(combo1);
    jp1.add(but1);
    jp2.add(label1);
//content.setVisible(false);
public void actionPerformed(ActionEvent e){
      String selection = (String)combo1.getSelectedItem();    
     final BitSizes selectedSize;
     for(BitSizes bitSize : BitSizes.values()){
          if(bitSize.name().equals(selection)){
               selectedSize = bitSize;
               long number = Long.parseLong(textfield1.getText());
              number *= selectedSize.getSize();
              doCalculate(number);
               return;
public void doCalculate(long number){
      StringBuilder stringBuilder = new StringBuilder();
      stringBuilder.append("<html>");
      for(BitSizes bitSize : BitSizes.values()){
           stringBuilder.append(bitSize.name());
           stringBuilder.append(" - ");
           stringBuilder.append(number / bitSize.getSize());
           stringBuilder.append("<br>");
      stringBuilder.append("</html>");
      label1.setText(stringBuilder.toString());
}As you can see, it is not really shorter than your solution (and it still contains some flaws. long is just not big enough for the full scale), but the complexity is moved to a completely different location. All specific information now lies within the enum, everything else is just processing it.
The advantage of this is, that you can easily expand your program without repeating similar code.

Similar Messages

  • Warning: An error occurred during tax calculation. Please correct the problem or contact your system administrator.

    Hi All
    We are creating POs from interface program "Import Standard Purchase Order Program". Only for few of the POs, we are encountering the error 'Warning: An error occurred during tax calculation
    . Please correct the problem or contact your system administrator.'
    This error is happening for few PO's, other POs with same vendor, ship to and bill to location created successfully by the program
    Any inputs on how to resolve this error is greatly appreciated.
    Regards,
    Brajesh

    Hi Hussein,
    Thank for the prompt response.
    We have already applied the patch related to doc 1272684.1.
    Below are the environment detail.
    Database: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    Application : 12.1.3
    Diagnostic tool output :-
    INTERFACE_
    TRANSACTION_ID
    INTERFACE_TYPE
    COLUMN_NAME
    PROCESSING_DATE
    TABLE_NAME
    ERROR_MESSAGE_NAME
    ERROR_MESSAGE
    100148
    PO_DOCS_OPEN_INTERFACE
    09-Aug-2013
    PO_HEADERS_INTERFACE
    PO_PDOI_TAX_CALCULATION_ERR
    Warning: An error occurred during tax calculation. Please correct the problem or contact your system administrator.
    Log file :-
    +---------------------------------------------------------------------------+
    Purchasing: Version : 12.0.0
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    POXPOPDOI module: Import Standard Purchase Orders
    +---------------------------------------------------------------------------+
    Current system time is 09-AUG-2013 21:09:04
    +---------------------------------------------------------------------------+
    +-----------------------------
    | Starting concurrent program execution...
    +-----------------------------
    Arguments
    STANDARD
    N
    INCOMPLETE
    12805
    +---------------------------------------------------------------------------+
    Start of log messages from FND_FILE
    +---------------------------------------------------------------------------+
    To get the log messages for PDOI, please use the following id to query against FND_LOG_MESSAGES table:
    AUDSID = 12076063
    +---------------------------------------------------------------------------+
    End of log messages from FND_FILE
    +---------------------------------------------------------------------------+
    +---------------------------------------------------------------------------+
    Executing request completion options...
    Output file size:
    69
    +------------- 1) PRINT   -------------+
    Printing output file.
                   Request ID : 55116524
             Number of copies : 0
                      Printer : noprint
    +--------------------------------------+
    Finished executing request completion options.
    +---------------------------------------------------------------------------+
    Concurrent request completed successfully
    Current system time is 09-AUG-2013 22:27:42
    +---------------------------------------------------------------------------+
    Brajesh

  • Windows 7 Pro 64-bit Action Pack - please, need download

    Hello, I have a current Action Pack subscription and valid installation keys. Our file server crashed and we lost a lot of our software library. We have Windows 7 Pro 32-bit on disc, but not 64-bit. Since Windows 7 is no longer offered in the Action Pack,
    we cannot again download the 64-bit version.
    We are only looking for a download of Windows 7 Pro 64-bit for Action Pack, English, please. This is not an attempt to pirate any licenses.
    Thank you!
    Jerry Seigel
    2/8/2014

    Hi,
    For Official version, you can download it from TechNet subscription site. We need to have the registered account.
    Welcome to Subscriber Downloads
    https://technet.microsoft.com/en-us/subscriptions/securedownloads/hh442904#searchTerm=Windows%207%20Enterprise&ProductFamilyId=0&Languages=en&PageSize=10&PageIndex=0&FileId=0
    Kate Li
    TechNet Community Support

  • Can't start virtualbox windows 7 32 bit image anymore please h[SOLVED]

    Hello guys,
    Just recently, I upgraded my system by executing "sudo pacman -Syu". It upgraded my kernel and kernel header files and mesa devu etc... including virtualbox-ose 3.2.10-3.
    Someoutputs that could be useful:
    (Please note I picked up only installed ones from the output)
    pacman -Ss virtualbox
    community/virtualbox-additions 3.2.10-1 [installed]
        Guest additions for VirtualBox
    community/virtualbox-ose 3.2.10-3 [installed]
        Powerful x86 virtualization for enterprise as well as home use (Open Source Edition)
    pacman -Ss kernel26
    core/kernel26 2.6.36.1-3 (base) [installed]
        The Linux Kernel and modules
    core/kernel26-headers 2.6.36.1-3 [installed]
        Header files and scripts for building modules for kernel26
    core/linux-firmware 20101108-1 [installed]
        Firmware files for Linux
    extra/nvidia 260.19.21-2 [installed]
        NVIDIA drivers for kernel26.
    I also recompiled the new virtualbox modules by doing:
    sudo /etc/rc.d/vboxdrv setup
    Password:
    :: Unloading VirtualBox kernel modules                                                                                                                                    [DONE]
    :: Removing old VirtualBox netadp kernel module                                                                                                                           [DONE]
    :: Removing old VirtualBox netflt kernel module                                                                                                                           [DONE]
    :: Removing old VirtualBox kernel module                                                                                                                                  [DONE]
    :: Recompiling VirtualBox kernel modules                                                                                                                                  [DONE]
    :: Reloading VirtualBox kernel modules                                                                                                                                    [DONE]
    On my archlinux (64-bit) system, I installed windows 7 (32-bit) using virtualbox-ose. It was working fine before I did the upgrade. Now, whenever I try to start the windows 7 (32-bit), it starts the windows 7 until the windows logo comes (just before the login mask of windows 7 comes), my computer restarts itself without giving any error or something. My pc just restarts itself. I think this is only related to virtualbox. When I do not try to start virtualbox, arch linux itself is working fine so far. Only when I try to start the windows 7, my pc gets restarted. Have you guys had any problem of this kind? First, I will wait for your responses. The options that I could think of right at the moment are:
    1. Downgrade the kernel back (I do not know how to and do not see it as a good choice)
    2. Downgrade the virtualbox-ose only (I also do not know how to do that.)
    3. Uninstall the virtualbox-ose and reinstall it again without removing my windows 7 OS (32-bit) (I hope I can continue using it)
    4. Delete the existing windows 7 OS and try to install freshly new Windows 7 OS again
    Guys, please help me. I really need to use windows 7 sometimes. I would be really grateful if some of you guys can help me.
    And again thanks for reading my long post.
    Thanks in advance.
    Last edited by Archie_Enthusiasm (2010-12-08 19:25:30)

    Hi guys, thanks for your responses.
    What is this vboxnetflt for? Which modules are the essential modules for virtualbox? What I mean is: do those nice features like mouse point integration, full screen supportment etc... rely on vboxnetflt and vboxnetadp?
    What I have in my configuration file is:
    MOD_AUTOLOAD="yes"
    #MOD_BLACKLIST=() #deprecated
    MODULES=(vboxdrv vboxnetflt vboxnetadp)
    I think vboxnetadp is used for networkiing. and vboxnetflt sounds like network filtering stuff. Can someone please confirm me? I think the problem was the sequence of upgrading. Firstly it updated the kernel and then installed the new version of virtualbox. I think if it could install the new version of virtualbox first and then the kernel, it would go without any problem, just my opinion as I said.
    Let's keep tracked on this. Maybe someone will find a solution before virtualbox developers :-)

  • Thinking of BT Vision - Bit of help please

    Just joined BT for broadband, due to go live on Friday. Have also been offered Vision however my Sky contract isn't up until 22 May. However, if I can get a good deal I don't mind overlaping the two for a month.
    I have been doing a bit of research into BT Vision to see if it fits my needs. I am finding myself watching the same old channels and same old programs on sky. I tend to record most of my TV now and very rarely watch 'live', so I think the on demand aspect of BT Vision would suit me perfectly.
    My main feature would be Sport and more specifically football.
    Both sky sports 1 & 2 channels are on different media. Virgin, BT Vision and now top up tv freeview.
    My question is does anyone know where the majority of football games will be shown next season? Will it be on Sky sports 1 & 2 or will they move it over to 3 and 4 so that people on other media cannot watch without subscribing to Sky?
    At the moment majority of games are 1 and 2 with the odd game on 3 and 4.
    This will have an impact on wether I chose BT or not. Mainly interest in premier league, but would like as much football as possible. I also like the idea of the fee ESPN as well, which would save £10 per month compaired to Sky.
    Any other tips anyone can give before making the switch?
    Help is appreciated. Thanks in advance.
    Solved!
    Go to Solution.

    I don't think anyone will be able to tell you what Sky plan to do with football.
    TBH if Sport is the main reason for watching TV you should stick with Sky.
    Life | 1967 Plus Radio | 1000 Classical Hits | Kafka's World
    Someone Solved Your Question?
    Please let other members know by clicking on ’Mark as Accepted Solution’
    Helpful Post?
    If a post has been helpful, say thanks by clicking the ratings star.

  • FRM-40039 error post 32 bit to 64 bit migration. Please help.

    Hello,
    I'm facing the a problem where during runtime I get error:
    'FRM-40039: Cannot Attach library Ofgtel while opening Form XXX'
    I'm facing this issue post migration of my environment from 32 bit server to 64 bit server.
    One more thing I noticed is that after copying and compiling the ofgtel.pll file from production, the pll file size is changing. I agree that this would happen based on platform change, but this change in filesize is happening only with this library and not with few more which exist in the same path.
    Can someone please please help me fix this issue.

    The file Ofgtel.pll (plx) is a Designer module. Therefore I will suspect that your application was originally created using Designer and not directly from Forms. You need to ensure that ALL of the Designer modules which your application uses are re-generated in v11 on the machine where they will be used. Do not generate them and attempt to move them to another machine. Also, it is important that you ensure that the file locations are included in FORMS_PATH (default.env).
    As for running the Builder on Linux64, this can be done, but is not supported in R1 (11.1.1). A simple modification to the frmbld.sh file will allow the Builder to start on x64. But again, this is NOT supported so please do not contact Oracle Support when/if you have problems doing this. If you need to reattach libraries or make any application changes, I recommend you do this on a supported platform. Save your changes then move the source files (fmb, mmb, pll, olb) to the runtime machine. On the runtime machine, you will need to generate the X files as I mentioned earlier.
    If you continue to get messages which suggest that a file could not be attached, it likely means that you did not generate the X file, the X file cannot be found, or there is a permissions issue on the file. Remember that on Unix (Linux) case sensitivity can be an issue.

  • Do we have Jinitiator 1.1.8.19 version in 64 bit. Urgent please. regards.

    Hi
    I have requirement to install Jinitiator 1.1.8.19 in 64bit machine. Is this version available in 64bit.
    regards.

    I've been trying to find the Oracle reference, but things have gotten harder to find ever since Oracle started the redesign of their site. I can tell you this, Jinitiator is based on Java 1.2 and 1.3 and Oracle has openly stated that they will not be supporting Jinitiator any longer and Sun (now Oracle) is not going to produce a 64 bit version of these Java versions. Therefore, your only option is to use the latest 64 bit version of the Sun/Oracle JRE (1.6.0_XX).
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • 64-bit Smart View + Excel 2010 64-bit Issues - Help Please

    Hello everyone.
    First, I am not an "IT guy" so please bare with me as I am not technical but need help.
    I am running Windows 7 64-bit Professional and Excel 2010 64-bit. I installed Oracle Smart View for Office, Fusion Edition 64-bit as an add-in within Excel.
    I have worked with our "Hyperion Admins" to connect to the right server so that my "private connections" are set correctly (hopefully that makes sense).
    However, when I attempt to refresh my Smart View query I end-up retrieving no data. The "refresh" button under "Smart View" in Excel will proceed as a refresh is occurring but then not return data (I know this Smart View template works as I've used it many times on 32-bit Excel).
    Our admins have informed me that I cannot use 64-bit Smart View because our "server" is on a 32-bit O/S (or something similar to that). To me, the logic doesn't make sense and I'm hoping that there is a solution the admins are not aware of.
    Happy to answer any questions and appreciate any help.

    JDN wrote:
    We had a similar experience as JTF, HsGetValues would not work but the AdHoc function worked fine. I put in an SR with Oracle and they refereced the below document. We ended up having IT install 32 bit office on the machine along with 32 bit Smartview (11.1.2.2.300) and now it is working fine.
    Regards,
    Jason
    Some Smart View Functions Do Not Work in Excel 2010 64-bit. [ID 1463814.1]
    To Bottom
    Modified:Aug 30, 2012Type:PROBLEMStatus:PUBLISHEDPriority:3
    Comments (0)
    In this Document
    Symptoms
    Cause
    Solution
    References
    Applies to:
    Hyperion Financial Management - Version 11.1.2.2.000 and later
    Information in this document applies to any platform.
    Symptoms
    When using Smart View (SV) with Microsoft Office 2010 SP1 some SV functions do not work or cause Excel application to crash.
    Cause
    In 64-bit versions of Excel 2010 SP1, the presence of Smart View functions may cause Excel to terminate abruptly and may prevent Copy Data Point and Paste Data Point functions from working. This has been identified as a defect in Microsoft product.
    Solution
    Use the 32-bit version of Smart View until Microsoft issues fix for their 64-bit Office products.
    References
    @ BUG:13606492 - USING HSSETVALUE FUNCTION CAUSES EXCEL CRASH
    14091219
    Related
    Products
    •Enterprise Performance Management and Business Intelligence > Enterprise Performance Management > Financial Management > Hyperion Financial Management > Smart View > Smart View
    Keywords
    BIT;CRASH;EXCEL;HSGETVALUE;MICROSOFT;OFFICE 2010;SMART VIEW;SMARTVIEW;SP1;DYNAMIC ADV PROBLEM SOLUTIONCan you use the 32-bit Smart View with 64-bit Office? Unfortunately, 32-bit Excel cannot handle my files so I am forced to use 64-bit so going back to a 32-bit Office will not work for me.

  • Looking for an online bit calculator

    What's the best way of determining bit rate for long form jobs. I do between 1 1/2 hours to 2 hours 20 minutes?
    I am interested in 2 pass mainly. I will be using FCP6 & converting to m2v-ac3 in compressor then bringing into DVD studio pro4 for authoring. 3 pages of 12-15 chapters motion menus.
    NTSC, DV, 8 core mac, 8 gigs ram, 3 drives raid0
    What on line calculator could you suggest??
    Steve from NY.

    Steve:
    ... and if you want an online option: * Bitrate Calculator *.
    Hope that helps !
      Alberto

  • Can someone help me get a 64-bit Windows dll please?

    Hi all,
    I'm not a C++ developer (C# instead) and am looking to get hold of a 64-bit version of the Windows XMP dll. I've tried compiling the source myself, but I'm way out of my depth here and can't make it happen.
    Truth be told, I don't even know if there is such a thing as a 64-bit version of the dll, but that's where my research has lead me.
    I'm trying to use the C# wrapper on 64-bit windows, but it doesn't work and the info I've found is that it's because the XMP dll is compiled for 32-bit platforms, and so won't work.
    Can I ask if someone here can supply me with a 64-bit Windows XMP dll please? If so, please mail it to amethi [at] gmail dot com.
    I'm frustrated as it all works fine on my development machine which are 32 bit, but on deployment to our super-spanky 64-bit machine, it didn't work. Doh! Any help appreciated.

    Hi,
    Font is one of your problems. Going into the XML Source and doing a find and replace; changing Times New Roman to Myriad Pro reduced the form from 860kb down to 440kb.
    Also because you have brought this in from another programme (possibly Word) there are lots of objects making up the form. I would recommend changing the font and then working through the form replacing multiple textfields with a single textfield.
    It should be possible to get a 1-page form down to size. Just bear in mind the logo. Whatever size that is will be added to the overall form size.
    Good luck,
    Niall

  • Unable to get 64-bit dowload. Please link!!

    I try to download for Vista 64 and nothing downloads. User agent string:
    Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Win64; x64; .NET CLR 2.0.50727; SLCC1; Media Center PC 5.0)
    The download page recognizes this as 64-bit vista, but i get no actual download, just a thank you page. Please help!
    (Note: I installed the 32-bit installer but the AMDS keeps saying it needs to be newer. I'm going to assume that it's a 64-bit issue until i see otherwise. My ipod touch worked before; now it just errors on AMDS every time.)

    Are you dual-booting? The software message suggest you have a software problem.
    AMD and Microsoft are not the same kind of buddies Intel and Microsoft are, especially when it comes to 64bit systems.
    Is this you?  :D http://communities.vmware.com/message/1504136

  • Issue with calculation script - please help

    There is a script that I am working on that needs to track the changes made by the user on the data form and push the entered value down proportionally to the lower levels.
    It’s a signal dimensional spread. It needs to spread the parent level values entered by the users for the product dimension to below levels. The Products are in rows.
    The issue is that the users can enter their data at any level for the product dimension i.e. either at Level 0 product members, Level 1 product members or at Level 2 product members. I am using two accounts A & B in sync to track the changes made.
    The structure of Product dimension that shows up on the form is similar to this –
    ~ Products (The user can enter starting at this level and also the below levels)
    ~ Product A
    ~ Product A1 (Level 0)
    ~ Product A2 (Level 0)
    ~ Product A3 (Level 0)
    ~ Product B (Level 0)
    ~ Product C (Level 0)
    ~ Product D
    ~ Product D1 (Level 0)
    ~ Product D2 (Level 0)
    This is what I came up with so far but it’s not working in all the cases yet. Please give your suggestions to modify this script further to make it work the right way.
    FIX(P, Y, H, E, B, D, C, V, C, S, @Relative(“Products”,-1))
    Account(
    IF(“AccountA”->@Parent(@Currmbr(“Product”)) <> “AccountB”->@Parent(@Currmbr(“Product”)))
    AccountA=AccountB->@Currmbr(“Product”)/AccountB->@Parent(@Currmbr(“Product”)))*AccountA ->@Parent(@Currmbr(“Product”));
    ENDIF;
    ENDFIX;
    FIX(P, Y, H, E, B, D, C, V, C, S, @Relative(“Products”,0))
    Account(
    IF(“AccountA”->@Parent(@Currmbr(“Product”)) <> “AccountB”->@Parent(@Currmbr(“Product”)))
    AccountA=AccountB->@Currmbr(“Product”)/AccountB->@Parent(@Currmbr(“Product”)))*AccountA ->@Parent(@Currmbr(“Product”));
    ENDIF;
    ENDFIX;
    This is not working right in all cases and I am sure I am going wrong somewhere. Please let me know your ideas on how can this be achieved.
    Thanks in advance.
    -Krrish
    Edited by: 928844 on Apr 19, 2012 11:23 AM

    Well... sort of fixed it.  Apparently my system doesn't like editing images with a color depth of 16bit.  If I convert it down to 8 when I'm converting it from RAW, then it allows me to add layers... Is this normal?
    Thank you for your time,
    -Tony

  • Optmization of calculation script Please help urgent

    hi all,
    I know three ways to tackle the block creation issue.
    1. Set CreateBlockon equation.
    2. try some data copy.
    3. calcualte a member via sparse dimension.
    I have a calc as shown below:
    Set CACHE HIGH;
    Set UPDATECALC OFF;
    SET AGGMISSG ON;
    FIX( @Relative("Entity",0),
         @Relative("Business Unit",0)
         @Relative("Branch",0),
         &CurScenario,
         &CurVersion,
         &CurYr,
         "M00",
         "P00000",
         "I000"
    FIX("AAAA")
    "DH" = "Gross Sales"->"External sales"->"MEU" * "Freight Out Percent"->"U000"->"D00000"->"B000"->"00";
    ENDFIX
    ENDFIX
    This is the third method that i mentioned above i am trying to apply to this calc that is calcualtion it via sparse dimesion as first 2 are not working good.
    "AAAAA" is dense dimesion member in accounts and rest every member is sparse.
    The member gross sales, External sales and MEU are all dynamic calc.
    This Calc run for 45 mins just to calculate one account and i have 4 accounts that need to be calculated by this in the same manner and i am trying to optimize this script so that i can reduce its run time.
    However i made another copy of this script in the following way:
    Set CACHE HIGH;
    Set UPDATECALC OFF;
    SET AGGMISSG ON;
    FIX( @Relative("Entity",0),
         @Relative("Business Unit",0)
         @Relative("Branch",0),
         &CurScenario,
         &CurVersion,
         &CurYr,
         "M00",
         "P00000",
         "I000"
    "DH"
    IF (@ISMBR("AAAAA"))
    @CALCMODE(BLOCK);
    @CALCMODE (Bottomup);
    "DH"= @Round((("Gross Sales"->"External Sales"->"MEU") * ("Freight In Percent"->"U000"->"D00000"->"B000"->"00")),2);
    ElSEIF (@ISMBR("BBBBB"))
    @CALCMODE(BLOCK);
    @CALCMODE (Bottomup);
         "DH"= @Round((("Gross Sales"->"External Sales"->"MEU") * ("Freight Out Percent"->"U000"->"D00000"->"B000"->"00")),2);
    ENDIF
    ENDFIX
    In th above version of the script it runs very fast but dont calculate any value :( for the account "AAAAA" & "BBBB"
    I have tried almost every way to do this and running short of ideas to optmize this.
    Is there any other way in which i can tackle the block creation issue or a way in which i can bring down the run time of this calculation
    Any suggestion regarding this would be great
    Thanks for help!
    Edited by: user4958421 on Jun 29, 2009 10:18 AM
    Edited by: user4958421 on Jun 29, 2009 10:18 AM

    For block creation issue:
    SET CREATEBLOCKONEQ equation will only work if the left side of an assignment statement is sparse.
    If the left side of an assignment is dense, you need to use SET CREATENONMISSINGBLK ON.
    For example:
    1.
    FIX("DH")
    SET CREATENONMISSINGBLK ON;
    "AAAAA" = "Gross Sales"->"External sales"->"MEU" * "Freight Out Percent"->"U000"->"D00000"->"B000"->"00";
    ENDFIX
    With the above, try to fix as little as possible. For example: do you really need to run the above
    formula for @Relative("Entity",0),@Relative("Business Unit",0), and @Relative("Branch",0)? Or
    actually the above formula is only needed for specific entity, business units and branch.
    2.
    FIX("AAAA")
    SET CREATEBLOCKONEQ ON;
    "DH" = "Gross Sales"->"External sales"->"MEU" * "Freight Out Percent"->"U000"->"D00000"->"B000"->"00";
    ENDFIX
    Another technique you can try:
    3.
    FIX("AAAA")
    "DH" = 0;
    "DH" = "Gross Sales"->"External sales"->"MEU" * "Freight Out Percent"->"U000"->"D00000"->"B000"->"00";
    ENDFIX
    And, you can also consider to change member "AAAA" to dynamic calc, and
    put the formula in the member. With this, you will not have calculation performance issue.
    If you use a calc like this:
    Sales (
    IF (@ISMBR(Jan))
    Sales=100;
    ENDIF)
    You do not need to repeat sales, so,
    it will be:
    Sales (
    IF (@ISMBR(Jan))
    100;
    ENDIF)

  • CS3 will not open on my 64 bit Vista.  Please Help

    Hello
      I just picked up Phot Shop CS3 installed it on my Lap Top  with Vista Ultimate 64 bit.  It installed fine,  but when I try and open it a windows error message comes up in encountered and error and closes the program.   I have another laptop with Vista Home 32 bit and I installed it on there and it opens no problem.     I do have Dreamweaver CS3 on my 64 Bit  could that be causing a issue?  Thank you for reading and any iput you can give.  Corey

    Hmmm... now we are getting somewhere...
    To Dec7... I think you might be onto something here...
    What if there is no entry on the startup tab called Adobe CS3 Service Manager? I have Gamma Loader and updater... But nothing like you are talking about...
    I do see FLEXnet Licensing Service... but dont see how to set it to manual... uncheck it?
    The thing is... I don't think windows sees it as an error... Windows thinks its (after effects) running fine.
    Looking through the error log, Photoshop is different though... since the application actually opens and then freezes... it sees that as an error...
    Not really sure how to read it though...
    Process ID: a28? What am I looking for?
    Thanks for your help Dec7!

  • CALCULATING--HELP PLEASE!!!

    I have fixed everything in my code that was wrong; but I still cannot get it to do the calculation:
    When I enter the amount and click the calculate button I get nothing; just 0.0.
    pTax = tax * value;
    Here is my code:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Debug1Application
    public static void main(String args[])
    PropTax myCalc = new PropTax();
    class PropTax extends JFrame implements ActionListener
    // Computes property tax
    // as 3.25% of property value
    private JTextField propVal;
    private JLabel title, countyName, prompt, taxBill;
    private JButton calcButton;
    public PropTax()
    Container c = getContentPane();
    c.setLayout(new FlowLayout());
    title = new JLabel("Property Tax Calculator");
    countyName = new JLabel("Opulent County");
    calcButton = new JButton("Compute Tax");
    prompt = new JLabel("Enter the value of your propoerty");
    taxBill = new JLabel("Your County Collector");
    propVal = new JTextField(8);
    c.add(title);
    c.add(countyName);
    c.add(prompt);
    c.add(taxBill);
    c.add(propVal);
    c.add(calcButton);
    propVal.setText("");
    setSize(300,200);
    setVisible(true);
    public void actionPerformed(ActionEvent event)
    CalcTax myCalcTax = new CalcTax ();
    double value = Double.parseDouble(propVal.getText());
    myCalcTax.calculate(value);
    taxBill.setText("Property tax is $" + myCalcTax.getTax());
    class CalcTax
    final static double tax = 0.325;
    static double pTax;
    public static void calculate(double value)
    pTax = tax * value;
    public static double getTax()
    return pTax;

    I don't see any code that would cause the actionPerformed method to be called. You would need an ActionListener or something like that, if I'm not mistaken. And by the way, this line:
    CalcTax myCalcTax = new CalcTax ();
    is unnecessary. Since all the variables and methods of CalcTax are static, you can simply call CalcTax.calculate() and CalcTax.getValue(). You don't need an object.

Maybe you are looking for

  • Runtime error in sales order creation

    Hai,When I am trying to create sales order one run time error is occured.The error is CALL_TRANSACTION_NOT_FOUND  TRANSACTION "%_GS" IS UNKNOWN.TRANSACTION "%_GS" IS NOT LISTED IN TABLE OF T.CODES.CURRENT ABAP PROGRAMME HAD TO BE TERMINATED BECAUSE O

  • Update is taken via creative cloud

    Hello, There was a pending update that I had not done. When I took the update it installed the creative cloud, then I was asked to login and then I was able to take the update for that software. I have not signed in for any creative cloud membership.

  • Xdg-open is slow opening files

    Whenever I use xdg-open to open an application it takes a while until the application is shown, but if I try to open it with the application itself it works almost instantaneously. While using xdg-open I can notice a high increase of the cpu usage. W

  • Can't log in using windows control panel

    Hello, I have a Mac with a virtual machine where I run Windows Vista. In Lion, iCloud is working fine but in Windows (where I use Outlook) the iCloud login screen is frozen (seems like trying to validate the username) without any progress. I know it'

  • Error 404 wwv_flow.accept was not found

    I'm on Apex 3.0 and Oracle 10.2.0.1.0 Suddenly my applications started to behave strangley: In tabular forms when I am deleting row(s) I'm getting Error 404 and it says The requested URL /pls/apex/wwv_flow.accept was not found on this server. I have