Faulty calculation

I'm using PB kernel (see below) in an AIR / Flex application to speed up some calculations. The data I supply is a Vector.<Number> of floating point precision pixels. Every pixel is stored as three consecutive Numbers respectively for R,G,B channels, which corresponds to image3 and pixel3 data types (well, if you forget the conversion between IEEE 754 double and float). I only need to store the result of my calculation on G-channel which I chose for luminance. However, only the first four pixels are computed correctly. Starting from the 5th one there seem to be a problem with incorrect offsets of the channels, I suppose. To make matters worse, after removing the last division "... / div" from my kernel this partial result is fine. Identical code in AS3 works as expected. Here's a sample output of both methods:
ActionScript 3
Pixel Bender
0.31890034675598145
0.8537830501553823
0.32749107480049133
0.31890034675598145
0.853783130645752
0.32749107480049133
0.3187195956707001
0.8779068260949753
0.3277072608470917
0.3187195956707001
0.8779069185256958
0.3277072608470917
0.3195112645626068
0.8675161312801771
0.32622960209846497
0.3195112645626068
0.8675161600112915
0.32622960209846497
0.31998929381370544
0.8910256334295363
0.3283438980579376
0.31998929381370544
0.8910257816314697
0.3283438980579376
0.32212474942207336
0.8751980313098534
0.3289455771446228
2.47822642326355
0.5179606080055237
2.1203341484069824
0.32434457540512085
0.8869450816322106
0.3317764401435852
2.673691511154175
0.5195903778076172
2.147810220718384
0.32753363251686096
0.8913912862998146
0.3324755132198334
2.75229811668396
0.5199907422065735
2.1358659267425537
0.3291414678096771
0.8930972521677654
0.33320507407188416
2.7831685543060303
0.5204076170921326
2.1631364822387695
0.3270454406738281
0.9043374247870719
0.33148670196533203
2.9969263076782227
0.5194242596626282
1.8038333654403687
0.3232068419456482
0.9140460786037383
0.3305985629558563
3.197050094604492
0.5189139246940613
1.8051812648773193
The kernel:
<languageVersion : 1.0;>
kernel Foobar
<   namespace : "Your Namespace";
    vendor : "Your Vendor";
    version : 1;
    description : "your description";
>
    input image3 src;
    output pixel3 dst;
    parameter float avgY;
    parameter float maxY;
    parameter float exp;
    parameter float div;
    void evaluatePixel() {
        pixel3 p = sampleNearest(src,outCoord());
        float Y = p.g / avgY;
        p.g = (log(Y + 1.0) / log(2.0 + pow(Y / maxY, exp) * 8.0)) / div;
        dst = p;
Equivalent ActionScript 3 code:
for (i = 1; i < data.length; i += 3) {
   var Y:Number = data[i] / avgY;
   data[i] = (Math.log(Y + 1) / Math.log(2 + Math.pow(Y / maxY, exp) * 8)) / div;

Further analysis revealed classic symptoms of the buffer overflow error. First of all, using a literal value rather than parameter for avgY yields correct results. Adding a dummy variable results in a shift of the intermediate values. Declaring yet more variables leads to overwriting one of the channels with the given dummy value (example below).
At first I thought it might be due to erroneous PB compiler so I disassembled the kernel code using haXe (http://ncannasse.fr/projects/pbj) and Tinic's Uro C++ tool (http://www.kaourantin.net/2008/09/pixel-bender-pbj-files.html). However, I carefully scrutinized the assembly code and have to admit it's perfectly fine. Perhaps the problem lies with the implementation of Shader class within Flash? Or maybe I'm utterly wrong?
Desperately looking for a solution.
Example:
p.g = p.g / avgY;
2 dummy float variables
4 dummy float variables
0.31890034675598145
35.5465202331543
0.32749107480049133
0.31890034675598145
0.853783130645752
0.32749107480049133
0.31890034675598145
0.853783130645752
0.32749107480049133
0.3187195956707001
41.44520950317383
0.3277072608470917
0.3187195956707001
0.8779069185256958
0.3277072608470917
0.3187195956707001
0.8779069185256958
0.3277072608470917
0.3195112645626068
38.77558898925781
0.32622960209846497
0.3195112645626068
0.8675161600112915
0.32622960209846497
0.3195112645626068
0.8675161600112915
0.32622960209846497
0.31998929381370544
45.1257209777832
0.3283438980579376
0.31998929381370544
0.8910257816314697
0.3283438980579376
0.31998929381370544
0.8910257816314697
0.3283438980579376
0.32212474942207336
40.729286193847656
0.3289455771446228
2.47822642326355
0.5179606080055237
35.5465202331543
2.47822642326355
0.5179606080055237
2.200000047683716   // one of the variables was 2.2
0.32434457540512085
43.94172668457031
0.3317764401435852
2.673691511154175
0.5195903778076172
41.44520950317383
2.673691511154175
0.5195903778076172
2.200000047683716
0.32753363251686096
45.233612060546875
0.3324755132198334
2.75229811668396
0.5199907422065735
38.77558898925781
2.75229811668396
0.5199907422065735
2.200000047683716

Similar Messages

  • Java double

    hi reader
    am doing some exercises and wonder about calculations based upon java double. Is there any known issue regarding to faulty calculations utilizing double values ?? have attached my sample code..
    public abstract class Drink {
         String beschreibung = "Unbekanntes Getr�nk";
         int groesse = 0;
         int KLEIN      = 0;
         int NORMAL = 1;
         int GROSS      = 2;
         public String getBeschreibung(){
              return beschreibung;
         public int getGroesse(){
              return groesse;
         public void setGroesse(int groesse){
              this.groesse = groesse;
         public abstract double preis();
    public class Espresso extends Drink{
         public Espresso(){
              beschreibung = "Espresso";
         public double preis(){
              return 1.99;
    public abstract class TopicDecorator extends Drink{
         public abstract String getBeschreibung();
    public class Milk extends TopicDecorator{
         Drink getr�nk;
         int groesse = 0;
         public Milk(Drink getr�nk){
              this.getr�nk = getr�nk;
         public String getBeschreibung(){
              return getr�nk.getBeschreibung() + ", Milch";
         public int getGroesse(){
              this.groesse = getr�nk.getGroesse();
              return this.groesse;
         public double preis(){
              double preis = getr�nk.preis();
              if(getGroesse() == getr�nk.KLEIN){
                   preis += 0.15;               
              else if (getGroesse() == getr�nk.NORMAL) {
                   preis += 0.20;
              else if (getGroesse() == getr�nk.GROSS) {
                   preis += 0.25;
              return preis;     
    }whenever i test the application, the result of calculated price is not correct.

    result returned should look like 2.xx �
    but result is 2.xxxxxxxxx �
    test app:
    public class TestFrame {
         public static void main(String[] args) {
              Drink drink1 = new Espresso();
              System.out.println(drink1.getBeschreibung() + " " + drink1.preis() + " �");
              Drink drink2 = new HouseLabel();
              drink2.setGroesse(drink2.GROSS);
              drink2 = new Chocolate(drink2);
              drink2 = new Chocolate(drink2);
              drink2 = new Milk(drink2);
              System.out.println(drink2.getBeschreibung() + " " + drink2.preis() + " �");
    Message was edited by:
    digit-x

  • Stuck in calculating time remaining, what do i do, its my second airport time capsule that i purchased as the first had a faulty hard drive, why is this soo hard!

    This is my second airport time capsule as the first i purchaed had a faulty hard drive, so now, its been a while i keep trying hoping it will work but its always stuck in 'calculating time remaining'. i thought it was my wifi so i connected directly to the capsule using an ethernet cord, bought an adaptor as i have the new macbook air (4m old) 13 inch, still not working. Help please,i am thinknig of just returning it and getting a less expeecsive and easier one to use.
    D

    Mavericks is the pain here.
    It can lose the network connection half way through a backup.
    When you connect by ethernet (good to get that.. hope it is the thunderbolt to ethernet).. did you turn off the wireless.. this is important.. nothing changes if the wireless is still on.
    I recommend you start over. Keep the wireless on for this part.
    Stop the backup.
    Factory reset the TC.
    Redo the TC setup but this time use all short names, no spaces, pure alphanumeric.
    I know the airport utility will suggest apple names..
    Fred Blog's Airport Time Capsule.
    Don't fall for it.
    Use TCgen5
    For wireless name use TCwifi (or if you want more control, TC24ghz and change 5ghz to TC5ghz).
    Wipe the current TM setup.
    Use A4 to reset it. http://pondini.org/TM/Troubleshooting.html
    With wireless off now and just ethernet connection try the backup again.
    No luck manually mount the TC hard disk in finder. Go/Connect to Server.
    AFP://TCname.local (replace TCname with your new nice short name.. and use the domain which is local by default).
    OR
    Use AFP://10.0.1.1 (Replace with whatever IP the TC uses.. but it must be static.. easy for router mode.. not so easy if the TC is in bridge mode).
    The Computer will request the password.. type in whatever password you used for disk access.. by default it ithe device password. If you did not change it then default is public.
    This setup has worked for other people.
    https://discussions.apple.com/thread/5951390?tstart=0
    I cannot guarantee you won't need to reboot the TC oocasionally as it does fall over.
    There are other bits that I keep forgetting..
    Make sure ipv6 is set to link-local for both wireless and ethernet in the computer.
    Once you finish the main backup the short incremental backups can work over wireless.. so just turn wireless back on.

  • MBP-mid 2009-T-style MagSafe charger faulty?

    Ok... I've read through several of the 'issues' folks are having with their MBPs and charging. My mother has a brand new MBP--bought this month--September 2010, and it came with the newer L-style MagSafe charger. My husband and I, each have a one year old MBP with the older T-style MagSafe charger.
    Noticing odd charging results, and what appeared to be a very shortened battery 'life,' I feared that my MBP was having some serious charging/battery issues. But, I thought I'd try some simple troubleshooting tactics before I drove 50 miles to our nearest Genius Bar. So, I plugged my charger into my MBP and a 'safe' wall outlet and watched it over several days. Here's what I've discovered so far...
    The little LED indicator light on my MagSafe charger will come on Green, turn Amber, go off, come back on, etc... all the while it is sitting securely--undisturbed--at an outlet that is working properly. My MBP will announce that it is 'Not Charging,' or 'Calculating,' and/or show inconsistent time left to charge. My T-style MagSafe charger will charge when inserted only one way--top up and bottom down... I've 'marked' it so I can tell which way will work... if I insert the charger with the 'bottom' up then the little LED light does not light up at all. There are no dirty/broken/bent connectors or connections. This is not how it worked originally, and it is not how my husband's T-style MagSafe charger works currently. In fact, the charger he has works without hesitation in my MBP, regardless of which side is up or down. With no unexpected changes in the LED light or the status while it is plugged into the same outlet on the wall and the same female receiver on my MBP.
    My mother's L-style charger works perfectly in my MBP also... again, regardless of whether I point the cord toward the back of the MBP or toward the front of the MBP. It lights up wonderfully and charges quickly. We also purchased *speck clear hard-shell covers to protect the outside of all three of our MBPs. My husband and I bought ours along with our MBPs last year -- and my mother purchased hers at the same time she bought her MBP this month. Oddly, the *speck cover has been modified to fit the newer MagSafe power connectors, to ensure that the cord curls behind the MBP.
    So, it appears that the battery in my MBP is capable of charging and holding a charge just fine as long as I use these other chargers available to me. The obvious conclusion is that the MagSafe charger I received with my MBP is faulty. And, I also believe that this is something Apple must be aware of, since the style of the MagSafe charger -- and the *speck covers have been modified and/or redesigned.
    In the following 'support' article, it seems that Apple could be admitting this possibility when they mention that the cord may be replaced whether in or out of warranty? I just thought folks should know that for some of these continuing power problems... you might want to have the MagSafe chargers checked before you decide the problem lies in the MBP?
    http://support.apple.com/kb/TS1713
    If Apple is aware of this problem, it would be noble of them to simply admit that some of the MagSafe chargers are faulty--it happens, no big deal--and offer customers a replacement. If I had not discovered what was at the root of my problem -- and instead -- had taken my MBP in for repair, calibration, etc. and then found out that it was basically just the 'power cord' at fault... GRRRR... I would be very frustrated.
    Good luck!

    The older T-style adapters (that originally came with the non-Unibody MBPs) definitely had problems with their strain relief failing. My friend and I had to replace ours within about 3 months of buying a MBP. Apple actually kindly replaced this for me through AppleCare even before that article existed.
    My new T-style connector does not seem to be failing yet, but I have not owned the laptop for that long.
    As for your charging problem, it does sound like the MagSafe connector is faulty. However, I would bring your laptop along to the Apple Store anyways and verify that the replacement charger actually works with your laptop. While it may not appear externally there is anything wrong with the charging port on your laptop, even microns of misalignement due to various factors (Magnet strengths, manufacturing tolerances between the connector pins, etc) can potentially cause the electric flow to stop.

  • Quantity Conversion Error in Net Price Calculation

    We are currently using SRM 5.0 ECS where we created a material PO and had a problem with the product not having the language E maintain in the material master. This caused the PO to have status of "error in process"  Once we fixed this issue and tried to reprocess the PO we're not getting the following error message in the Application Monitor:
    No Instance of Object type PurchaseOrder has been created. External Reference
    Puchase Order still contains faulty Items
    Quantity Conversion Error in Net Price Calculation
    Has anyone seen this or know what we can do to resolve this so that the PO gets replicated in R3?
    Thanks in advance.

    Hi Robert,
    Regarding this backend error E 212 06 Quantity conversion error in net
    price calculation.         
    This error is because in the PO Order price unit is empty. And          
    quantity is null. So, please enter the quantity and order price unit          
    for this PO and order the PO again. Or you can retransfer the      
    PO manually using the FM BBP_PD_PO_TRANSFER_EXEC. (for this fm you need       
    to input the PO header guid, which you will get it from tx.BBP_PD             
    by providing PO number and object type as BUS2201).
    This has worked for other customers.
    Hope this helps,
    Kind Regards,
    Matthew

  • 3rd gen ipod touch faulty screen??

    i have a 32gb ipod touch that i bought on the 10th of this month. i got GTA: chinatown wars for it but for some reason my punch/use gun button (on the right side) doesn't work. i've found that if i flip my ipod to it's other side the punch/use gun button works but then i have problems with my character movement button not working correctly. i've noticed not being able to click items in other games i have as well (on the right side) unless i flip my ipod around but then i have the same movement problems as before. do you think its a Faulty screen? i've never dropped my ipod and it still looks brand new 0 scratches.

    Welcome to the discussions,
    did you try the suggestions in this article about troubleshooting touch screen response? http://support.apple.com/kb/TS1827
    Tip: If you are going to take your device into a Apple Retail Store for evaluation, follow these steps to help the Mac Genius understand where your Multi-Touch display is experiencing unresponsiveness.
    Open the basic calculator application to test all but the top row of the screen. Press each button on the calculator and verify activity.
    To test the area at the top of the screen, rotate the device to change to the scientific calculator and press all the buttons in the left two rows.

  • Strange double calculation result with JDK 1.4.2

    Hi,
    I've written a small benchmark to test the power of a Sharp Zaurus PDA. Wanting to compare it with my workstation, I ran it on the PC with JDK1.4.2 Beta and was really surprised to discover that the double calculation of Pi gave a non-correct result: Pi = 3.1413934230804443!!!
    I've tried to isolate the bug without success at the moment. It only happens when run from the Zjb program in JDK1.4.2, either from the command line or from Eclipse.
    The result is correct when run with JDK1.4.1, JDK1.4.1_01, JDK1.1.8 that are also setup on the PC. I extracted the faulty loop and executed the sniplet, but the result is OK. I added the previous lines (running the Ackerman function to test recursivity and stack management): still OK, from Eclipse and command line.
    I think the problem must be a configuration one on my computer: a 2xPII 350, Win2K SP3. Perhaps the 1.4.2 JVM is using an old library... I can't imagine that the Beta JVM would have such problem.
    Or there is a bug in the program which make the stack or the FPU registers break, but I can't find where: all other platforms I tested gave correct results.
    Could someone with a JDK1.4.2 installation test my program and post what were the results for the Pi calculation?
    The 10KB source is available on http://www.alterna.tv/zjb/Zjb.java
    Thanks.

    Yes, it was the Pentium, at the time when 100MHz was top speed...
    My CPUs are supposed not to suffer from that old disease.
    But if it were the case, new JVM can't drop software patches like this. Today, Intel started again the release of the new P4 at 3GHz, after adding a software patch for the hardware defect they had detected...
    I post the code for my small program here as my Web site is frequently down this week:
    import java.awt.BorderLayout;
    import java.awt.Button;
    import java.awt.Color;
    import java.awt.Dialog;
    import java.awt.Dimension;
    import java.awt.FlowLayout;
    import java.awt.Frame;
    import java.awt.Graphics;
    import java.awt.GridLayout;
    import java.awt.Label;
    import java.awt.List;
    import java.awt.Panel;
    import java.awt.TextField;
    import java.awt.Toolkit;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.io.BufferedInputStream;
    import java.io.BufferedOutputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.math.BigInteger;
    * Zjb: Zaurus Java Bechmark
    * @author GenePi
    class Zjb
         extends Frame
         static Zjb _mainWindow;
          * Number of benchmark runs.
         private final TextField _runs;
          * Results list
         private final List _results;
          * Wait, program is thinking...
         private final Label _wait;
          * Start button
         private final Button _start;
          * Benchmark running
         private volatile boolean _running = false;
          * Layout the main window.
         Zjb()
              super("Zaurus java benchmark 1.0");
              setLayout(new BorderLayout());
              // Input fields
              Panel top = new Panel(new GridLayout(1, 0));
              top.add(new Label("Number of runs"));
              _runs = new TextField("1");
              top.add(_runs);
              add(top, BorderLayout.NORTH);
              // Results list
              _results = new List();
              add(_results, BorderLayout.CENTER);
              // Start button
              final Panel bottom = new Panel(new FlowLayout(FlowLayout.RIGHT));
              _wait = new Label();
              bottom.add(_wait);
              _start = new Button("Start");
              _start.addActionListener(new ActionListener()
                   public void actionPerformed(final ActionEvent evt)
                        if (!_running)
                             // Clear previous results and start benchmark.
                             _results.clear();
                             _start.setLabel("Stop");
                             _wait.setText("Running...          ");
                             bottom.validate();
                             _running = true;
                        else
                             _start.setLabel("Start");
                             _wait.setText("");
                             _running = false;
              bottom.add(_start);
              // Quit button
              final Button quit = new Button("Quit");
              quit.addActionListener(new ActionListener()
                   public void actionPerformed(final ActionEvent evt)
                        System.exit(0);
              bottom.add(quit);
              add(bottom, BorderLayout.SOUTH);
              // Exit when main window closes
              addWindowListener(new WindowAdapter()
                   public void windowClosing(final WindowEvent evt)
                        System.exit(0);
              Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
              setSize(dim);
              validate();
          * The benchmarks
          * @param runs Number of runs
         private static void runBenchmarks(final int runs)
              long start;
              long end;
              long totalStart;
              long totalEnd;
              // Integer arithmetic
              start = System.currentTimeMillis();
              totalStart = start;
              int resultInt = 0;
              for (int i = 0; i < runs; i++)
                   resultInt = ackerman(3, 9);
                   // resultInt = ackerman(3, 7);
              end = System.currentTimeMillis();
              _mainWindow._results.add("Integer arithmetic: " + ((end - start) / 1000.0) + " s [Ack(3,9)=" + resultInt + "]");
              if (!_mainWindow._running)
                   return;
              // Float and double
              start = System.currentTimeMillis();
              double resultDouble = 0.0;
              for (int i = 0; i < runs; i++)
                   resultDouble = 0.0;
                   for (int j = 1; j < 1000000; j++)
                        resultDouble += 1.0 / ((double) j * (double) j);
                   System.out.println("resultDouble=" + resultDouble);
                   resultDouble = Math.sqrt(resultDouble * 6.0);
              end = System.currentTimeMillis();
              _mainWindow._results.add("Double arithmetic: " + ((end - start) / 1000.0) + " s [Pi=" + resultDouble + "]");
              if (!_mainWindow._running)
                   return;
              // Big operations
              start = System.currentTimeMillis();
              BigInteger resultBig = new BigInteger("1");
              for (int i = 0; i < runs; i++)
                   resultBig = fact(3000);
              end = System.currentTimeMillis();
              _mainWindow._results.add("Infinite arithmetic: " + ((end - start) / 1000.0) + " s [3000!=" + resultBig.toString().substring(1, 20) + "...]");
              if (!_mainWindow._running)
                   return;
              // Strings
              start = System.currentTimeMillis();
              String resultString = null;
              for (int i = 0; i < runs; i++)
                   final String alphabet = " qwertyuioplkjhgfdsazxcvbnm0789456123./*";
                   StringBuffer buf = new StringBuffer();
                   for (int j = 0; j < 100000; j++)
                        int pos = j % alphabet.length();
                        buf.append(alphabet.substring(pos, pos + 1));
                   resultString = buf.toString();
              end = System.currentTimeMillis();
              _mainWindow._results.add("Strings: " + ((end - start) / 1000.0) + " s [" + resultString.substring(1, 20) + "...]");
              if (!_mainWindow._running)
                   return;
              // Drawing
              start = System.currentTimeMillis();
              for (int i = 0; i < runs; i++)
                   final int size = 200;
                   Dialog dialog = new Dialog(_mainWindow, "Drawing...", true);
                   dialog.add(new TestPanel(dialog));
                   dialog.setSize(size, size);
                   dialog.show();
              end = System.currentTimeMillis();
              _mainWindow._results.add("Drawing: " + ((end - start) / 1000.0) + " s");
              if (!_mainWindow._running)
                   return;
              // File copy
              start = System.currentTimeMillis();
              String resultIO = "OK";
              loopIO:
              for (int i = 0; i < runs; i++)
                   final String tempName = "/tmp/Zjb.tmp";
                   try
                        BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(tempName));
                        for (int j = 0; j < 1000000; j++)
                             out.write((byte) j);
                        out.close();
                        BufferedInputStream in = new BufferedInputStream(new FileInputStream(tempName));
                        for (int j = 0; j < 1000000; j++)
                             int r = in.read();
                             if ((byte) r != (byte) j)
                                  resultIO = "Failed";
                                  System.err.println("Content mismatch at " + j);
                                  break loopIO;
                        in.close();
                        new File(tempName).delete();
                   catch(IOException ioe)
                        resultIO = "Failed";
                        System.err.println(ioe);
                        break loopIO;
              end = System.currentTimeMillis();
              _mainWindow._results.add("Files I/O: " + ((end - start) / 1000.0) + " s [1MB written/read/deleted: " + resultIO + "]");
              totalEnd = end;
              _mainWindow._results.add("");
              _mainWindow._results.add("Total: " + ((totalEnd - totalStart) / 1000.0) + " s");
          * Utility functions: Ackerman function
          * @param m
          * @param n
         private static int ackerman(final int m, final int n)
              if (m == 0)
                   return (n + 1);
              else if (n == 0)
                   return (ackerman(m - 1, 1));
              else
                   return ackerman(m - 1, ackerman(m, (n - 1)));
          * Factorial of big numbers.
          * @param n
          * @return
         private static BigInteger fact(final int n)
              final BigInteger one = new BigInteger("1");
              BigInteger num = new BigInteger("1");
              BigInteger fact = new BigInteger("1");
              for (int i = 2; i <= n; i++)
                   num = num.add(one);
                   fact = fact.multiply(num);
              return fact;
          * Benchmark entry point.
          * @param args Command line arguments
         public static void main(String[] args)
              _mainWindow = new Zjb();
              _mainWindow.show();
              synchronized (Zjb.class)
                   while (true)
                        try
                             Zjb.class.wait(500L);
                        catch (InterruptedException ie)
                             // Wake
                        if (_mainWindow._running)
                             try
                                  runBenchmarks(Integer.parseInt(_mainWindow._runs.getText()));
                             catch (NumberFormatException nfe)
                                  _mainWindow._runs.setText("1");
                                  runBenchmarks(1);
                             _mainWindow._running = false;
                             _mainWindow._start.setLabel("Start");
                             _mainWindow._wait.setText("");
    class TestPanel
         extends Panel
          * The dialog containing the panel.
         private final Dialog _dialog;
         TestPanel(final Dialog dialog)
              _dialog = dialog;
         public void paint(final Graphics g)
              Dimension dim = getSize();
              g.setColor(Color.white);
              g.fillRect(0, 0, dim.width, dim.height);
              for (int i = 0; i < 1000; i++)
                   Color color = new Color((int) (Math.random() * Integer.MAX_VALUE));
                   int x = (int) (Math.random() * dim.width);
                   int y = (int) (Math.random() * dim.height);
                   int width = (int) (Math.random() * dim.width);
                   int height = (int) (Math.random() * dim.height);
                   g.setColor(color);
                   g.fillRect(x, y, width, height);
              g.setColor(Color.white);
              g.fillRect(0, 0, dim.width, dim.height);
              for (int i = 0; i < 1000; i++)
                   Color color = new Color((int) (Math.random() * Integer.MAX_VALUE));
                   int x = (int) (Math.random() * dim.width);
                   int y = (int) (Math.random() * dim.height);
                   int width = (int) (Math.random() * dim.width);
                   int height = (int) (Math.random() * dim.height);
                   g.setColor(color);
                   g.fillOval(x, y, width, height);
              // Hide dialog when finished
              _dialog.hide();
    }

  • Vendor evaluation score calculations.

    Hi Guys,
    I urgently need your assitance here.
    May someone explain to me how the how the system calculates the scores for the automatic criteria "Quality" and "Service"
    I understand the score calculation for criteria "Delivery" - the system looks at the delivery date on the PO v/s the GR date as well as the quantity on the PO v/s quantity on at GR.
    please assist.
    thaks

    u2022Quality - Scoring method 7
    - Calculated with the information of the quality notification.
    - Each time a GR is posted for quality inspection a score should be introduced manually for this audit lot.
    - First system computes a score for the lots that were inspected.
    - If there is a GR without inspection it will receive the maximum score.
    - Then system compares the number of GR for the period (table S012 field ALIEF) against the information from the quality notification.
    Automatic EvaluationShop floor Complaint
    u2022Shop Floor Complaint - Scoring method 8
    - From the on-line documentation:"During the vendor evaluation process, the system checks whether the costs associated with the faulty delivery exceed the maximum percentage of business volume defined in the Customizing system."
    - The "cost associated" are based on the information from Quality Notification (transaction QM03). This information is saved on table QMEL.
    - The "business volume" is determined by the invoice value for the period defined on the purchasing org. vendor evaluation customizing: T147-STAGE.
    - The sums of invoice's values are taken from table S012 for the period.
    - Check if the USER-EXIT is not active.
    - Check if there are invoices for the period.
    Automatic EvaluationQuality Audit
    u2022Quality Audit - Scoring method 9
    - Based on the information of Quality Management.
    - The scores for an Audit lot are introduced in the Quality Management system.
    - When an evaluation is carried out system check the parameter Quality audit in customizing.
    - If the indicator is set, the system calculates the average score for all the quality audits in the validity period.
    - The result is the vendor's score for the quality audit.
    - If the indicator is not set, only the most recent audit lot is included. This then represents the vendor's score for the sub-criteria
    - Check if the USER-EXIT is active.
    For services
    u2022     The scores for semiautomatic criteria come from informastion entered  in the service entry sheet (for an externally performed service).
    u2022
    When you define a scoring method "C" - Determination from quality ratingor "D" - Determination from timeliness rating of service then you can  enter a manually score in the Entry Sheet under Vendor Evaluation

  • Nokia 6233 lost calculator

    hello everybody: I lost the calculator, which used to be part of Organizer menue, it used to be NO.5 on the menue. I updated the phone firmware, but it is still missing. anybody know how do i get it back. I wont to thank nokia team for adding 6233 to the list of phone updater, I'm more satisfied with the device now, it's faster and more reliable.

    The Nokia 6233 Can be Updated or re-insstalled using the Nokia Software Updater here:
    http://europe.nokia.com/link?cid=PLAIN_TEXT_14905
    Back up your phone and then download the updater and re-install the software on your handset.
    This should then restore the software to its factory default settings.
    If the updater says that no software is available, this does not matter, just tick the box shown in the display and download and re-install it.
    This should then put all the applications back in the original places and your calculator should have returned.
    If this is not the case then the handset is faulty and you should follow Psychomania's advice and take your handset to a Nokia Service Point.
    lamtapioca - Do not post your IMEI number in an Open forum as this comprehmises your handset - unless one of the moderators sees it then you should remove it.
    Shunts...
    I will mostly be communicating with a Nokia E72 Zodium Black
    Nokia E72-1 with Vr 051.018.207.04 Software
    If this post helped... Add some kudos!!

  • Sap pp - Scrap Calculation

    Hello SAP-Guruu2019s
    Can anyone tell me How Scrap Calculation is performed or maintained in PP.

    HI,
    Calculating Scrap
    Use
    You can calculate and plan the scrap quantity that will result from production. These scrap quantities are then included in the planning run and in the calculation of production costs.
    Prerequisites
    Which calculation the system uses depends on the settings in the material master record or in the BOM.
    Features
    The scrap quantity is settled against the net requirements quantity.
    Three calculation procedures are supported by the system:
    Assembly scrap
    Component scrap
    Operation scrap
    Assembly Scrap
    Use
    You use this function to plan the scrap that results from the production of an assembly.
    Prerequisites
    You have maintained the assembly scrap in the material master (MRP 1 view) as a percentage in the Assembly scrap field for the assembly header material.
    Features
    The system automatically increases the quantity to be produced by the percentage of scrap.
    However, the system always uses the estimate yield for the availability calculation for the assembly. Furthermore, the estimate yield of the assembly is always displayed in the MRP list or in the stock/requirements list.
    Assembly scrap increases the order quantity of the assembly and subsequently increases the order quantity for corresponding components. The dependent requirements of the material components are therefore increased correspondingly.
    Example
    Estimate yield
    200
    Assembly scrap
    10%
    This results in a scrap quantity of
    20 pieces
    and a required quantity of
    220 pieces
    Component Scrap
    Use
    You use this function to plan the scrap of a component that may break during production of an assembly.
    Prerequisites
    You have entered values for calculating component scrap in the material master or the BOM:
    in the BOM on the Item Detail Screen: General Data (data block for quantity data). This component scrap is only relevant for the individual BOM.
    in the material master (view MRP 4) in the Component scrap field. This component scrap is relevant for all BOMs.
    The component scrap quantity maintained for a material component in the BOM has the higher priority.
    Features
    Component scrap increases the dependent requirements quantity of the component.
    If a scrap quantity was planned for a higher-level assembly, assembly scrap and component scrap are added to the component level.
    Example
    Estimate yield
    200
    Assembly scrap
    10%
    Component scrap
    10%
    This results in a scrap quantity of
    42 pieces
    and a required quantity of
    242 pieces
    Operation Scrap
    Use
    Before high-value components are built into an assembly, the system carries out a quality control check of the assembly, if necessary. Faulty materials that were taken into account in assembly scrap are not passed on to the next operation. They are removed.
    Therefore, for a high-value component, you plan using operation scrap instead of general assembly scrap.
    Prerequisites
    You have maintained the operation scrap in the BOM, on the Items Detail Screen: General Data, under quantity data. You must also set the operations scrap net indicator at the same time.
    Features
    This scrap quantity refers to the quantity of one component that is to be processed in an operation meaning that the planning run is more exact and you can determine service and quantity consumption more precisely.
    I
    f the component is contained in an assembly, for which an assembly scrap quantity has been maintained, the system only takes the operation scrap into account.
    The net indicator instructs the system to calculate the component operation scrap without taking assembly scrap into account (net usage scrap).
    You should also set the net indicator, if operation scrap has not been maintained and assembly scrap has been entered. The assembly scrap should not, however, be taken into account.
    Example
      Quantity to be produced (required quantity)
    1,000 pieces
      Assembly scrap
    10 %
    Component 1
    Operation scrap
    No entry
      Net indicator
    Not set => assembly scrap is taken into account
      => Scrap quantity
    100 pieces
    Component 2
    Operation scrap
    1%
      Net indicator
    Set => assembly scrap is not taken into account
      => Scrap quantity
    10 pieces
    Before component 2 is built into the assembly, the incorrect assemblies are rejected and the system only takes the smaller operation scrap quantity into account. Therefore, component quantity of component 1 refers to 1,100 pieces to be produced; and the component quantity of component 2 refers to 1,010 pieces to be produced.
    HOpe this helps.
    Regards,
    Tejas
    Edited by: Tejas  Pujara on Sep 26, 2008 8:26 AM

  • Jetstress 2013 found the following faulty logical disk performance counters

    I'm using Jetstress 2013 to test the storage disk subsystem for Exchange 2013. After the db build completed I click run test & got this error. I'm only getting this error on this VM. The other 3 VMs are fine. I also reformatted the disk & rebuild
    the db but got the same error. Anyone seen this before?
    Jetstress testing failed. Error: Jetstress found the following faulty logical disk performance counters: C:\jsdb\db4. Ensure that all logical disk performance counters are working correctly with System Monitor. Error: Instance 'C:\jsdb\db4' does not exist
    in the specified Category.

    As reinstalling the VM is not always possible, and the time to recreate the databases quite considerable, the actual answer to this issue is to find the path that the logical disk counters are using and then update the path to the databases in JetStress
    to match this.
    On your test machine open Performance Monitor and click the Performance Monitor node.
    Click the green + icon and select the "Logical Disk" row.
    In the Instances of selected object you will see the paths that the logical disk counter is using to find the databases. For example C:\ExchangeVolumes\ExVol1 and C:\ExchangeVolumes\ExVol2.
    Update the JetStress config to use these paths and not the paths that you might be using such as C:\ExchangeDatabases\DB01.db.
    The problem is due to the autoreseed scripts in the perf calculator mounting the C:\ExchangeVolume path first (and so that is the logical disk counters path) but the operator of JetStress using the more obvious C:\ExchangeDatabases path.
    There is an update to JetStress post the original date of this question that resolves this issue so you can use either path, but if you add disks to a server or recreate some of the disk arrays and not others you might find that JetStress needs to use C:\ExchangeVolumes\...
    to reach some databases and C:\ExchangeDatabases to reach the others.
    If you get the error in the original post for some of your databases and not all of them, then this is the fix and use Performance Monitor to see the paths needed and use only those in JetStress.
    Brian Reid C7 Solutions Ltd (www.c7solutions.com)

  • Tax Calculation of free goods

    Hi
    We have a requirement where the client wants only VAT to be posted in GL accounts and not the price.For this I tried free goods condition type R100 with AltCBV 28.But the VAT value is also coming zero. I want the VAT to be calculated on Pricing condition and then give 100% discount.
    Apart from this I also tried to make pricing condition statistical and calculate VAT on it but then also system gives zero value for VAT.
    Also wondering if the scenario can be addressed with Free of Change Dellivery.

    Hi
    Normally in scenario where you are dealing with samples , there are cases you have to charge only TAXES / EXCISE part.
    Here my SUGGESTION is you can handle this through a simple sales order process, where you have to configure a new pricing procedure.
    1. Create a new document type to handle samples.
    2. Create a New pricing procedure where you can keep the basic price condtion as Statistical and rest all same as wht is is there your main pricing procedure. Just juggle with the TO-FROM to capture the TAX part in the total.
    3. Doc pricing procedure will help you to pick the new Pricing procedure
    4. Now Process this as a normal sales order
    5. This new document type will help you to have a proper reporting.
    The only constraint here is USER has to punch a fresh order seperately for such scenario. He cannot give a free good in the same sales order which is used as standard.
    The other way is you can configure a FREE GOOD Determination procedure as suggested  where you need to then have your Single pricing procedure accomodating the same scenario.
    Thanks
    RB

  • IF statement in Calculated Field for Share point, doesnt calculate sum in my Excel Pivot table.

    Hi Everyone
    I used this in SP calculated column field.
    =IF([Shift Sched]="1pm to 10pm","0",IF([Shift Sched]="2pm to 11pm","1",IF([Shift Sched]="3pm to 12am","2",IF([Shift Sched]="4pm to 1am","3",IF([Shift Sched]="5pm to 2am","4",IF([Shift
    Sched]="6pm to 3am","5",IF([Shift Sched]="7pm to 4am","6",IF([Shift Sched]="8pm to 5am","7",IF([Shift Sched]="9pm to 6am","8",IF([Shift Sched]="10pm to 7am","8",IF([Shift
    Sched]="11pm to 8am","7",IF([Shift Sched]="12pm to 9am","6",IF([Shift Sched]="1am to 10am","5",IF([Shift Sched]="2am to 11am","4",IF([Shift Sched]="3am to 12pm","3",IF([Shift
    Sched]="4am to 1pm","2",IF([Shift Sched]="5am to 2pm","1",IF([Shift Sched]="6am to 3pm","0",IF([Shift Sched]="7am to 4pm","0",IF([Shift Sched]="8am to 5pm","0",IF([Shift
    Sched]="9am to 6pm","0",IF([Shift Sched]="10am to 7pm","0",IF([Shift Sched]="11am to 8pm","0",IF([Shift Sched]="12pm to 9pm","0"))))))))))))))))))))))))    
    it was able to work fine however my issue is when i extract the information to excel and use a pivot table the table is not able to calulate the sum of the value for this field. Can you please help me with this. this is for an Attendance traker for Night
    Differential pay for employees. they create a daily log of their shift schedule and if i summarize this in pivot the value in the calculated field for this is not getting the sum.
    Thanks,
    Norman

    Hi Everyone
    I used this in SP calculated column field.
    =IF([Shift Sched]="1pm to 10pm","0",IF([Shift Sched]="2pm to 11pm","1",IF([Shift Sched]="3pm to 12am","2",IF([Shift Sched]="4pm to 1am","3",IF([Shift Sched]="5pm to 2am","4",IF([Shift
    Sched]="6pm to 3am","5",IF([Shift Sched]="7pm to 4am","6",IF([Shift Sched]="8pm to 5am","7",IF([Shift Sched]="9pm to 6am","8",IF([Shift Sched]="10pm to 7am","8",IF([Shift
    Sched]="11pm to 8am","7",IF([Shift Sched]="12pm to 9am","6",IF([Shift Sched]="1am to 10am","5",IF([Shift Sched]="2am to 11am","4",IF([Shift Sched]="3am to 12pm","3",IF([Shift
    Sched]="4am to 1pm","2",IF([Shift Sched]="5am to 2pm","1",IF([Shift Sched]="6am to 3pm","0",IF([Shift Sched]="7am to 4pm","0",IF([Shift Sched]="8am to 5pm","0",IF([Shift
    Sched]="9am to 6pm","0",IF([Shift Sched]="10am to 7pm","0",IF([Shift Sched]="11am to 8pm","0",IF([Shift Sched]="12pm to 9pm","0"))))))))))))))))))))))))    
    it was able to work fine however my issue is when i extract the information to excel and use a pivot table the table is not able to calulate the sum of the value for this field. Can you please help me with this. this is for an Attendance traker for Night
    Differential pay for employees. they create a daily log of their shift schedule and if i summarize this in pivot the value in the calculated field for this is not getting the sum.
    Thanks,
    Norman

  • If statement in Custom Calculation Script

    I have 16 fields and if even one of them ="1" I have to list it in another field.  I do not want to count or sum.  If one of those fields has a 1 in it I just want the other field to display Y and if none have a 1 I want that field to display N.
    Please help.
    Thank you in advance~mjc

    You need to write a compound logical statement to evaluate all of the values and that statement needs to evaluate to true or false.
    Do you know how to write JavaScript?
    Do you know how to enter JavaScript calculations into a form field?
    For custom calculation of the text field I could write something like:
    // define an array of the field names to check
    var aNames = new Array("Text1", "Text2", "Text3", "Text4",
    "Text5", "Text6", "Text7", "Text8",
    "Text9", "Text10", "Text11", "Text12",
    "Text13", "Text14", "Text15", "Text16");
    // define a logical variable that is true if any field has a value of 1 - default is false or no field has a value of 1
    var bMatch = false;
    // value for text field
    var TextValue = 0;
    // logical value of field being equal to 1 test
    var FieldIs1 = false;
    // loop through all the fields and test the fields value
    for(i = 0; i < aNames.length; i++) {
    // logically OR the result of field i value equal to true with bMatch
    // get the value of field
    TextValue = this.getField( aNames[i] ).value;
    // test the value of the field
    FieldIs1 = Number(TextValue) == 1
    // logically OR the 2 values
    bMatch = FieldIs1 | bMatch;
    } // end field processing
    // set the field value
    if(bMatch == true) {
    event.value = "Y";
    } else {
    event.value = "N";
    You will need to change the field names to match your fields. You can add more field name or remove field names as needed and the script will adjust for the number of field names.

  • If statement in calculated batch characteristic (dependencies)

    I have a little problem with calculating a certain batch characteristic.
    The situation is the following:
    I have batch char A, batch char B and batch char C. Batch char C is the result of the sommation of char A and B. The problem I have now is that batch char C only should be calculated when batch char A and B are different from 0.
    I have a custom build interface that imports QM data to the batch chars. Default, all my batch chars are set to 0 so if I just say $self.charC = $self.charA + $self.charB, I always get a value.
    Is it possible to some sort of IF statement to check if the value is different from 0?

    Dear,
    You need to try with variant table
    take all the combination and enter in a variant table and see the result...it works
    example
    A     B      C
    0      0      space
    0      1      sapce
    1      1      space
    I hope you got it

Maybe you are looking for

  • How do you invoke the wlpackage prompt

    I need to create an earfile with this wlpackage. I have the required build.xml created with java.... weblogic.BuildXMLGen, but I do not see any additional command to display the wlpackage If you have any clue, please let me know. wlpackage toFile="\p

  • Process industry master data creation

    Hi, In discrete manufacturing if we have alternate bom or routings then it can be used through production version. But in process industry it seems bom has to be created first and bom has to be assigned in production version and through production ve

  • Printing with  hp B9180pro

    I have a hp 1730 running vista 32 bit and a nikon d70s shooting raw. I have 2 G ram and am printing to a HP B9180pro printer. I have a W19b LCD monitor and have recently profiled both the monitor and printer with Spyder 3 studio. I have removed the o

  • Silent install for adobe acrobat professional verstion 8 how to.

    Hi Guys, I need to perform of adobe acrobat professional version 8 silent install for mass deployment of windows 7 purpose. but i cant find a customization wizard that works on my professional version 8 . i have tried version 10 and 11 and its not wo

  • Does Photoshop   Lightroom program include Typekit?

    Hello, I've recently purchased a Photoshop Pohotgraph program (Photoshop + Lightroom). I was wondering if there's a typekit subscription attached to this program, as it is for "single CC app" subscription. Thanks in advance.