IllegalArgumentException in SQLiteDemo on CodeSigningKey (int, String)

Hi all

I am trying to run the SQLiteDemo on my BlackBerry Simulator (5.0) (using Eclipse plug-ins, JDE). The project will build without any problem. When I try to launch the project of the Simulator, however, I get an IllegalArgumentException on CodeSigningKey.get (int, String) on line 308 of CodeSigningKey.class (whose source is not found).

I suppose it comes from the following line of code in SQLiteDemo.java:

// Retrieve the code signing key for the XYZ key file
        CodeSigningKey codeSigningKey = CodeSigningKey.get(CodeModuleManager.getModuleHandle( "SQLiteDemo" ), "XYZ");

The values of int, String at this stage are:

moduleHandle = 0

signerId = XYZ

I use the XYZ.key provided in the BlackBerry sqlitedemo.zip. Anyone know why I get this error?

Thank you!

My project was not «enabled for BlackBerry»

Tags: BlackBerry Developers

Similar Questions

  • CodeModuleManager... the SQLiteDemo and why can't I encrypt my own DB

    I was at this days and am very sad. I was never that much of a loss to understand how to do something.  In hell how this code works... its basically an exact copy / paste of the SQLiteDemo

    CodeSigningKey codeSigningKey is CodeSigningKey.get (CodeModuleManager.getModuleHandle ("ModuleName"), "NDT");.

    I have absolutely no idea of what to put in place "ModuleName" I tried my eclipse project name, the name of the class where the code is located, the file name of cod... I don't know whatelse I can get to keep this thing from throwing an exception to non-compliant argument... im literally begging for help on this.

    When you use CodeModuleManager.getModuleHandle ("ModuleName"), the modulename is the name of the file without the extension .cod COD.

  • Convert number like 1, 2 strings 01 and 02?

    Can convert us integers [] as 1.2 in 01 and 02 channels, I need these numbers as a text to a TextField.

    That converts the phone number provided to a string of length specified adding the 0 prefix as required

    private function convertNumberToPaddedString(num:Number, length:int):String
    {
        var numString:String = num.toString();
    
        if (numString != null && length > 0)
        {
            while (numString.length < length)
            {
                numString = "0" + numString;
            }
        }
    
        return numString;
    }
    

    for example the trace (convertNumberToPaddedString (3, 2)); Converts the number 3 in a string of length 2

  • IllegalArgumentException When config on an enum TimeUnit

    Hello

    Just started using BDB I 4.0.92 on Ubuntu 9.10 x86_64. It configures properly, I see that there is an obvious bug.
    com.example.Test at localhost:33768     
         Thread [main] (Suspended (exception IllegalArgumentException))     
              Enum<E>.valueOf(Class<T>, String) line: 196     
              TimeUnit.valueOf(String) line: 43     
              PropUtil.parseDuration(String) line: 101     
              DurationConfigParam.validateValue(String) line: 52     
              DurationConfigParam(ConfigParam).<init>(String, String, boolean, boolean) line: 62     
              DurationConfigParam.<init>(String, String, String, String, boolean, boolean) line: 34     
              EnvironmentParams.<clinit>() line: 120     
              EnvironmentConfig(EnvironmentMutableConfig).setCacheSize(long) line: 301     
              Example.setup(File, boolean) line: 28     
              Test.main(String[]) line: 358     
    This is the calling code:
    26        EnvironmentConfig envConfig = new EnvironmentConfig();
    27        envConfig.setAllowCreate(!readOnly);
    28        envConfig.setCacheSize(134217728); // 128 x 1024 x 1024
    The error is in the call to validate the value TimeUnit, which is installed here
        public static final DurationConfigParam ENV_BACKGROUND_SLEEP_INTERVAL =
            new DurationConfigParam
                (EnvironmentConfig.ENV_BACKGROUND_SLEEP_INTERVAL,
                                   "1 ms",          // min
                                   null,            // max
                                   "1 ms",          // default
                                   true,            // mutable
                                   false);          // forReplication
    1 'ms' is divided, and when 'ms' are evaluated as an enum TimeUnit that it fails, it should be '1 MILLISECOND"that I see.

    But somehow I doubt my logic because otherwise, there would be a flood of the message here on the forum?

    THX Dave

    The javadoc is here:
    http://www.Oracle.com/technology/documentation/Berkeley-DB/je/Java/COM/Sleepycat/je/EnvironmentConfig.html#timeDuration

    Look at the code in PropUtil, and you will see it is catch the exception and manipulation. Modify the source code is not the solution.

    Something is wrong with your system configuration, but I don't really know what it is. We have never seen an error that you stated.

    I go on vacation now, but someone else will try to help you with this.

    -mark

  • problem during decryption of password encrypted

    Hello to all that I am saving the password encrypted in the database. And decrypting the password attached to the url. But while I'm decrypting it gives me the Exception BadPadding exception. I used this class to encrypt and decrypt the password.

    public class CryptAes {
    
        // First create the AES key based on the bytes in secretKey using  keyLength bits as the length
        static AESKey keydec = new AESKey("A3$1E*81234567891111111111111111".getBytes() );
        static AESKey keyenc = new AESKey("A3$1E*81234567891111111111111111".getBytes() );
        static AESKey keyenc128 = new AESKey("A3Q1EF8123456789".getBytes());
        static AESKey keydec128 = new AESKey("A3Q1EF8123456789".getBytes());
    
        private static byte[] iv = { 0x0a, 0x01, 0x02, 0x03, 0x04, 0x0b, 0x0c,
            0x0d, 0x0a, 0x01, 0x02, 0x03, 0x04, 0x0b, 0x0c, 0x0d };
    
        public static byte[] plainText= new byte[10000];
    
     public static String AESEncryption(byte[] plainText) {
    
            String resultString = null;
    
            try {
    
                 AESEncryptorEngine engine = new AESEncryptorEngine( keyenc128 );
    
                 CBCEncryptorEngine cengine=new CBCEncryptorEngine(engine, new InitializationVector(iv));
                    PKCS5FormatterEngine fengine = new PKCS5FormatterEngine( engine );
                    ByteArrayOutputStream output = new ByteArrayOutputStream();
                    BlockEncryptor encryptor = new BlockEncryptor( fengine, output );
    
                    encryptor.write(plainText);
                    encryptor.close();
                    byte[] encryptedData = output.toByteArray(); output.close();
                    String st=new String(encryptedData);
    
                    byte[] base64 = Base64OutputStream.encode(encryptedData, 0, encryptedData.length, false, false);
    
                          //Base64Coder.encodeString(Byte.toString(plainText));
                          resultString = new String(base64);
    
            } catch (CryptoException cryptoException) {
                // TODO: handle exception
                System.out.println("Exception is "+cryptoException.getMessage()+"And the exception is"+cryptoException.toString());
            }
            catch (CryptoTokenException e) {
                // TODO: handle exception
                System.out.println("Exception is "+e.getMessage()+"And the exception is"+e.toString());
            }catch (CryptoUnsupportedOperationException e) {
                // TODO: handle exception
                System.out.println("Exception is "+e.getMessage()+"And the exception is"+e.toString());
            }catch (IOException e) {
                // TODO: handle exception
                System.out.println("Exception is "+e.getMessage()+"And the exception is"+e.toString());
            }
            return resultString;
      }
    
        public static String AESDecryption(byte[] cipherText, int dataLength ) /*throws CryptoException, IOException, CryptoTokenException, CryptoUnsupportedOperationException*/ {      
    
            String reString = null;
            try {
    
                ByteArrayInputStream in = new ByteArrayInputStream( cipherText, 0, dataLength );
    
                // Now create the block decryptor and pass in a new instance
                // of an AES decryptor engine with the specified block length
                BlockDecryptor cryptoStream = new BlockDecryptor(new AESDecryptorEngine( keydec128 ), in );
                byte[] T = new byte[dataLength];
    
                // Read the decrypted text from the AES decryptor stream and
                // return the actual length read        
    
                int length = cryptoStream.read( T ); //Here i am getting exception BadPadding
                reString = new String(T);
                int i=reString.indexOf("");
                reString = reString.substring(0,i+6);      
    
            } catch (CryptoException e) {
                // TODO: handle exception
                System.out.println("Exception is ="+e.getMessage());
            }catch (CryptoTokenException e) {
                // TODO: handle exception
                System.out.println("Exception is ="+e.getMessage());
            }catch (CryptoUnsupportedOperationException e) {
                // TODO: handle exception
                System.out.println("Exception is ="+e.getMessage());
            }catch (IOException e) {
                // TODO: handle exception
                System.out.println("Exception is ="+e.getMessage()+"333333333333"+e.toString());
            }
            // Create the input stream based on the ciphertext        
    
            return reString;
    
        }
    

    Help me with this.

    I was trying to encrypt and decipher passing on it but only has failed, so I just change how to encrypt or to decrypt the password. I had just use Base64Coder class to achieve this. And thank you for your concern. And here is the Base64Coder class, if someone needs it.

    //Copyright 2003-2009 Christian d'Heureuse, Inventec Informatik AG, Zurich, Switzerland
    //www.source-code.biz, www.inventec.ch/chdh
    //
    //This module is multi-licensed and may be used under the terms
    //of any of the following licenses:
    //
    //EPL, Eclipse Public License, http://www.eclipse.org/legal
    //LGPL, GNU Lesser General Public License, http://www.gnu.org/licenses/lgpl.html
    //AL, Apache License, http://www.apache.org/licenses
    //BSD, BSD License, http://www.opensource.org/licenses/bsd-license.php
    //
    //Please contact the author if you need another license.
    //This module is provided "as is", without warranties of any kind.
    
    /**
    * A Base64
    * r/Decoder.
    *
    * 

    * This class is used to encode and decode data in Base64 format as described in RFC 1521. * *

    * Home page: http://www.source-code.biz">www.source-code.biz
    * Author: Christian d'Heureuse, Inventec Informatik AG, Zurich, Switzerland
    * Multi-licensed: EPL/LGPL/AL/BSD. * *

    * Version history:
    * 2003-07-22 Christian d'Heureuse (chdh): Module created.
    * 2005-08-11 chdh: Lincense changed from GPL to LGPL.
    * 2006-11-21 chdh:
    *   Method encode(String) renamed to encodeString(String).
    *   Method decode(String) renamed to decodeString(String).
    *   New method encode(byte[],int) added.
    *   New method decode(String) added.
    * 2009-07-16: Additional licenses (EPL/AL) added.
    * 2009-09-16: Additional license (BSD) added.
    */ public class Base64Coder { //Mapping table from 6-bit nibbles to Base64 characters. private static char[] map1 = new char[64]; static { int i=0; for (char c='A'; c<='Z'; c++) map1[i++] = c; for (char c='a'; c<='z'; c++) map1[i++] = c; for (char c='0'; c<='9'; c++) map1[i++] = c; map1[i++] = '+'; map1[i++] = '/'; } //Mapping table from Base64 characters to 6-bit nibbles. private static byte[] map2 = new byte[128]; static { for (int i=0; iin. * @return A character array with the Base64 encoded data. */ public static char[] encode (byte[] in, int iLen) { int oDataLen = (iLen*4+2)/3; // output length without padding int oLen = ((iLen+2)/3)*4; // output length including padding char[] out = new char[oLen]; int ip = 0; int op = 0; while (ip < iLen) { int i0 = in[ip++] & 0xff; int i1 = ip < iLen ? in[ip++] & 0xff : 0; int i2 = ip < iLen ? in[ip++] & 0xff : 0; int o0 = i0 >>> 2; int o1 = ((i0 & 3) << 4) | (i1 >>> 4); int o2 = ((i1 & 0xf) << 2) | (i2 >>> 6); int o3 = i2 & 0x3F; out[op++] = map1[o0]; out[op++] = map1[o1]; out[op] = op < oDataLen ? map1[o2] : '='; op++; out[op] = op < oDataLen ? map1[o3] : '='; op++; } return out; } /** * Decodes a string from Base64 format. * @param s a Base64 String to be decoded. * @return A String containing the decoded data. * @throws IllegalArgumentException if the input is not valid Base64 encoded data. */ public static String decodeString (String s) { return new String(decode(s)); } /** * Decodes a byte array from Base64 format. * @param a Base64 String to be decoded. * @return An array containing the decoded data bytes. * @throws IllegalArgumentException if the input is not valid Base64 encoded data. */ public static byte[] decode (String s) { return decode(s.toCharArray()); } /** * Decodes a byte array from Base64 format. * No blanks or line breaks are allowed within the Base64 encoded data. * @param in a character array containing the Base64 encoded data. * @return An array containing the decoded data bytes. * @throws IllegalArgumentException if the input is not valid Base64 encoded data. */ public static byte[] decode (char[] in) { int iLen = in.length; if (iLen%4 != 0) throw new IllegalArgumentException ("Length of Base64 encoded input string is not a multiple of 4."); while (iLen > 0 && in[iLen-1] == '=') iLen--; int oLen = (iLen*3) / 4; byte[] out = new byte[oLen]; int ip = 0; int op = 0; while (ip < iLen) { int i0 = in[ip++]; int i1 = in[ip++]; int i2 = ip < iLen ? in[ip++] : 'A'; int i3 = ip < iLen ? in[ip++] : 'A'; if (i0 > 127 || i1 > 127 || i2 > 127 || i3 > 127) throw new IllegalArgumentException ("Illegal character in Base64 encoded data."); int b0 = map2[i0]; int b1 = map2[i1]; int b2 = map2[i2]; int b3 = map2[i3]; if (b0 < 0 || b1 < 0 || b2 < 0 || b3 < 0) throw new IllegalArgumentException ("Illegal character in Base64 encoded data."); int o0 = ( b0 <<2) | (b1>>>4); int o1 = ((b1 & 0xf)<<4) | (b2>>>2); int o2 = ((b2 & 3)<<6) | b3; out[op++] = (byte)o0; if (op

  • HTTP connection problem. What is going on?

    I am trying to write a simple program to test the validity of the URL via a http connection.

    For the good URL, the program works very well.

    Bad URL however found two ways:

    1: no answer at all (program runs as if nothing happened, waiting for user input.) The text in the EditField is the same incorrect url intentionally being tested)

    2: IllegalArgumentException in RIMConnector.open (int, int, String, boolean, FirewallContext) line: 76.

    What is going on?

    Here is the code:

    import java.io.IOException;
    import javax.microedition.io.Connector;
    import javax.microedition.io.HttpConnection;
    import net.rim.device.api.ui.*;
    import net.rim.device.api.ui.component.*;
    import net.rim.device.api.ui.container.*;
    import net.rim.device.api.ui.UiApplication;
    
    final class UrlCheck extends UiApplication {
        private EditField urlField;
        public static void main(String[] args) {
            UrlCheck theApp = new UrlCheck();
            theApp.enterEventDispatcher();
        }
    
        public UrlCheck() {
            MainScreen theScreen = new MainScreen();
            LabelField title = new LabelField("URL Check");
            theScreen.setTitle(title);
    
            urlField = new EditField("URL: ", "", Integer.MAX_VALUE, BasicEditField.FILTER_DEFAULT);
            theScreen.add(urlField);
    
            FieldChangeListener listenerCancel = new FieldChangeListener() {
                public void fieldChanged(Field field, int context) {
                    String URL = urlField.getText();
                    HttpConnection conn = null;
                    int response = 0;
                    try {
                        conn = (HttpConnection)Connector.open(URL);
                        conn.setRequestMethod(HttpConnection.GET);
                        response = conn.getResponseCode();
                        if (response == 200){
                            Dialog.inform("URL OK");
                            return;
                        }
                        if(response == 401){
                            Dialog.inform("URL Requires Authorization");
                        }
                    } catch (IOException e) {
                        e.printStackTrace();
                        Dialog.inform("Bad URL");
                    }
                }
            };
            ButtonField checkUrl = new ButtonField("Check");
            checkUrl.setChangeListener(listenerCancel);
            theScreen.add(checkUrl);
            pushScreen(theScreen);
        }
    }
    

    Okay, that was stupid.

    I caught the IllegalArgumentException as well and it fixed the problem.

  • I need help to create an AppleScript to autoclicking.

    I just started using AppleScript, so there is still a lot of things I don't know. Currently, I'm doing a script where I can click in an infinite loop / repeat. I received this understood part and now I want to step up a notch by making a condition where in when I right click with my mouse, I'll be able to enable / disable this script. Or even shut down the loop with a right click. In addition, I would also add a bonus dialog box once I finished the script by right-clicking.

    Here's my working process.

    say application "System events".

    -a loop (# repeat, repeat times)

    repeat 10 times

    -trigger system event are asked to use the button code 87 (left click on the mouse)

    say application 'System events' in the key code 87

    delay 1

    end Repeat

    end say



    -Right click

    say application 'System events' to code key of {command down} 87

    -closing of the script

    display the dialog box "Do you want to exit this script?" buttons {"Exit", "Continue"} default button 1

    If result = {return button: "Exit"} then

    return

    end if


    The upper part of the script, this is what I mentioned the first where I get an infinite loop to the left, click the mouse button. The two scripts from the bottom is what I would like to integrate the above script to get the result I want. An infinite loop with condition (right click) to disable the script and a message if poster after the script has stopped.

    Hi Cloud4846. One option is to create a small utility to detect a mouse button for use in an AppleScript script. Copy and paste the following in a text editor Swift code as text Sublime and record your desktop with a file extension .swift using a name such as mouse.swift:

    import of Foundation

    import AppKit

    TranslateButtonState(buttonState: Int)-> {String Func

    If (buttonState == 1 < < 0) {return "left" ;}

    If (buttonState == 1 < < 1) {return 'right' ;}

    go back to 'none '.

    }

    buttonState var = NSEvent.pressedMouseButtons)

    Print (TranslateButtonState (ButtonState))

    With Xcode installed, compile the code above with the Swift compiler in Terminal using the following command, which places the binary file in usr:

    xcrun - sdk macosx swiftc ~/Desktop/mouse.swift o/usr/local/bin/mouse

    You can test the utility in a Terminal before control of the mouse with a delay and press left mouse button to the right:

    sleep 1; mouse

    Output returned is one of the 'left', 'right' or 'none '. The utility also works with a finger or two mechanical depression of a trackpad for the primary and the secondary finger click respectively.

    You can use the utility in an AppleScript script to display a dialog box message when a mouse button is released, in this example the right button of the mouse. Keep in mind it's because of the single-threaded nature AppleScript and that the 'do shell script' in the loop with delay, is really only practical with time short longer times require holding down the mouse button longer:

    Tell application "system events".

    Repeat 10 times

    the mouseDown value (the shell script ' / usr/local/bin/mouse ")

    If mouseDown = "right" then

    button code 87

    dialogue box "Do you want to exit this script?" the default button buttons {'Exit', 'Continue'} 1

    If result = {return button: "Exit"} then

    return

    end if

    on the other

    delay 0.5

    button code 87

    delay 0.5

    end if

    end repeat

    tell the end

    Instead of using a mouse button down event to trigger a dialog box, you can use a key as a modifier key. Copy and paste the code Swift following in a text editor and save it to your desktop with a file extension .swift using a name such as modKeys.swift:

    import of Foundation

    import AppKit

    TranslateModifierFlags(modifierFlags: NSEventModifierFlags)-> {String Func

    Let rawModifierFlags = modifierFlags.rawValue

    var pressedButtons = [System.Security.Permissions.SecurityPermission

    If ((rawModifierFlags & NSEventModifierFlags.ControlKeyMask.rawValue)! = 0) {pressedButtons.append ("Control")}

    If ((rawModifierFlags & NSEventModifierFlags.AlternateKeyMask.rawValue)! = 0) {pressedButtons.append ("Option")}

    If ((rawModifierFlags & NSEventModifierFlags.ShiftKeyMask.rawValue)! = 0) {pressedButtons.append ("Shift")}

    If ((rawModifierFlags & NSEventModifierFlags.CommandKeyMask.rawValue)! = 0) {pressedButtons.append ("Command")}

    If (pressedButtons.count > 0) {}

    return pressedButtons.joinWithSeparator("")

    }

    go back to 'none '.

    }

    var modifierFlags = NSEvent.modifierFlags)

    Print ((modifierFlags) TranslateModifierFlags)

    With Xcode installed, compile the code above with the Swift compiler in Terminal using the following command, which places the binary file in usr:

    xcrun - sdk macosx swiftc ~/Desktop/modKeys.swift o/usr/local/bin/modKeys

    You can test the utility in a Terminal before control of the mouse with a delay and pressing one of the four control, Option, shift, and control modifier keys individually or in combination:

    sleep 1; modKeys

    Output returned is one or more of 'Control', 'Option', 'Shift' and 'order '. An example of the usefulness and the SHIFT key, used in an Applescript script:

    Tell application "system events".

    Repeat 10 times

    the keyDown value (the shell script ' / usr/local/bin/modKeys ")

    If keyDown = 'Shift' then

    button code 87

    dialogue box "Do you want to exit this script?" the default button buttons {'Exit', 'Continue'} 1

    If result = {return button: "Exit"} then

    return

    end if

    on the other

    delay 0.5

    button code 87

    delay 0.5

    end if

    end repeat

    tell the end

    More appropriate to use modifier keys are shift and Option.

    Tested with OS X Yosemite 10.10.5, editor Script 2.7, 2.4, Xcode 7.2.1 AppleScript

    AppKit framework reference > NSEvent Class Reference

    The fast programming language

    Introduction to AppleScript Language Guide

  • Graph.DefaultPlotRenderers.ReplaceAll () does not change to GUI

    WPF C#

    Hello

    I don't know what I'm doing DefaultPlotRenderers example provided with NEITHER Studio differenly.  I see in the debugger that DefaultPlotRenderers object contains nothing or my custom settings (based on the option that select).  This is what it looks like the debugger in the example of OR.

    Here is my code and any help would be appreciated to greately.

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Shapes;

    using NationalInstruments.Controls;
    using NationalInstruments.Controls.Primitives;
    using NationalInstruments.Controls.Rendering;

    namespace FireflyMmwDiagnostics
    {
    partial class GraphLinear: window, INotifyPropertyChanged
    {
    Private bool m_includeMarkers = true;
    public boolean IncludeMarkers
    {
    get {return m_includeMarkers ;}
    Set {m_includeMarkers = value; OnPropertyChanged ("IncludeMarkers"); }
    }

    Public Overridable event PropertyChangedEventHandler PropertyChanged;
    public virtual void OnPropertyChanged (string name)
    {
    Manager PropertyChangedEventHandler = PropertyChanged;
    If (Manager! = null)
    {
    Manager new (EC, PropertyChangedEventArgs (name));
    }
    }
    Private readonly PlotRendererCollection PlotRendererCollectionWithMarkers = new PlotRendererCollection();

    public GraphLinear()
    {
    InitializeComponent();

    DataContext = this;
    }

    public void AddData (list of data )
    {
    T [---] arrayData = new T [data. County, data [0]. Length];

    < data.count;="">
    {
    Create the plot object
    AddPlotToGraph (data [conspiracy]. Length, "");

    Convert the list to a table
    < data[plot].length;="">
    arrayData [field, point] = data [conspiracy] [point];
    }

    Assign data
    Graph.DataSource = arrayData;
    }

    ' Private Sub AddPlotToGraph (dataSize int, string label)
    {
    Brush brush = Utility.RandomBrush ();
    ChartCollection chartCollection = new ChartCollection(dataSize);
    Plot = new Plot (label);
    LinePlotRenderer linePlotRenderer = new LinePlotRenderer() {Stroke = brush, StrokeThickness = 2};
    LinePlotRenderer linePlotRenderer2 = new LinePlotRenderer() {Stroke = brush, StrokeThickness = 8};

    PlotRendererCollectionWithMarkers.Add (linePlotRenderer2); Store away alternating plot setting

    parcel of land. Renderer = linePlotRenderer;
    Graph.Plots.Add (plot);
    }

    ' private void CheckBoxIncludeMarkers_Click (object sender, RoutedEventArgs e)
    {
    If (IncludeMarkers)
    Graph.DefaultPlotRenderers.ReplaceAll (PlotRendererCollectionWithMarkers);
    on the other
    Graph.DefaultPlotRenderers.Clear ();
    }

         This is an excerpt from another class where I make a call to show this graph...

    GraphLinear graphLinear = new GraphLinear();
    graphLinear.AddData (listOfSmaData);
    graphLinear.Show ();

    If you need the motor field set, and then manually update render rendering on all parcels engines would be the way to go.

    If you leave the field undefined rendering engine, you could switch between two groups of default field rendering (i.e. to save both linePlotRenderer and linePlotRenderer2 in the collections and the Manager of the box update with a collection or another).

  • How to pass an enum testbed

    Is it possible to pass an enum in of TestStand? Otherwise I'll have to do a string and don't compare on my case, but it would be useful as I could?

    The compiler said

    Accessibility inconsistent error 1: type of parameter 'ChamberClass.Chamber.ChamberName' is less accessible than method ' ChamberClass.Chamber.Initialise (NationalInstruments.TestStand.Interop.API.SequenceContext, ChamberClass.Chamber.ChamberName, int, out bool, out int, String)

    The enum (highlighting) is declared in my class, and so I could understand why he loves her but just on the off chance that there is a solution...?

    Fixed! No need to answer:-once more, it wasn't a question of test bench: it's because my enum is private...

  • Passing values between tabs, using a structure of housing.

    At the risk of exposing my ignorance, I have a problem of substance; How to pass values in a controlled tab structure of the case.

    I have a simple user interface that uses a control tab control container a structure of all cases wrapped in a while loop. I use

    LabVIEW 2012.

    The basic intent is to run VI in tab 1, whose results would be available for the VI tab 2 ect...

    (See the attached example; an experience I wish that changes to the controls to page 1 int & string will appear

    the indicators corresponding to page 2).

    I can "pass" the values of a case outside the case itself (through a tunnel of output) structure, but can't seem to do

    available for all other cases by a tunnel entrance.

    I tried to tunnel of the case in a registry to lag on the while loop, but am upset by retrieving that data again in another case.

    I tried to use local variables, but obviously do not understand the paradigm brought LabVIEW for variables. I can create a local

    variable but can't seem to 'plug in' to an indicator on the second page.

    First question: is a reasonable method for execution of the loop control program structure business controlled within a certain time tab?

    I chose it because I have literally dozens of parameters to define, validate and want to manage Visual space

    for the operator. For example, I would that this sequence:

    1. Question and list of facilities available on my PC
    2. Select a device to use, make sure it works properly
    3. Set the parameters for this particular device (30)
    4. run the device, collect data and save the results

    Second question: it is clear that I don't know how to use variables, and the examples I read involve transmission of data to parallel structures

    and not in a case. Is a local variable to a reasonable method of transmission of data between the "tabs"? I will gladly make

    accept the reprimand to 'RTFM' until 'FM' required is identified.

    Thank you in advance for your kind attention to my wisely first year survey

    Shift registers are simple to get data from.  Where is your problem with their use?  However, have you considered just using the terminals directly in the case of the Page 2?

    You must learn to use the Structure of the event.  You shouldn't care what tab you are on.  It's all in the same VI.  Therefore use a Structure unique event for all your control value changes.

  • This cluster resembles a cluster of error, but it is not

    Created a new cluster containing a boolean success/failure, an integer as the 'leaders' and a short chain of calibration.  Recorded in a typedef would cluster, it fell on my block diagram and it shows up as the cluster of mustard color error!

    Anyway to do this does not resemble a cluster of error on the block diagram?

    Add another object in the typedef and making them invisible is just an ugly hack, but it turns the pink string object.

    Rearrange items.

    Right-click on the cluster in the type definition, select "Rearrange controls in Cluster" and click on the items in one different order, bool, int, string.

  • Insert Varray values in a cluster where the table is

    Hei,

    I use the openG libraries. I have a HAND in cluster that has 2 groups A, B that contains the different controllers (bool, strings, integers, enum) and a C array which has a cluster that contains also various controllers. What I want to do, is to read an INI file and save it in cluster A, B & C table. I managed to write the values for A, B clusters, but with table C, I have a few problems.

    How or which is the best way to access the values in the INI file and save it in table C that belongs to a MAIN cluster. The code below is how I do for the cluster A and B.

    Thanks for the help.

    Hello

    I apologize for the poor explanation. I need to work on that. Let's see if I can do better...

    I have some sections that I want to represent as clusters AND some sections of an array of clusters where the key values match grapes controls in the INI file. In addition, the VI has a core that has clusters with some elements (int, string, enum) and an array of cluster that also has some elements. I hope that is not confusing. To simplify, I want to write the values for 'children' of the main groups. As you may have noticed that I prepare this code as an object-oriented approach.

    Here is the solution I got on LAVA: https://lavag.org/topic/18951-insert-varray-values-into-a-cluster-where-the-array-is/

    Thank you for contributing

  • How to analyze the object in the soap response in Blackberry

    I am new to blackberry develipment.i developed using Momentics IDE. Now, I'm working on the integration of Soap Web service. Now my webservice function call works. I answer also. My webservice response, it's like

    http://shidhints.com/">booleanstringstringint    string    string
    

    While parese the answer, now I can analyze and get the token, NumberofReferral but I can't analyze the ListEmails object. How do I analyze this ListEmails, me, pleasehelp

    const QtSoapMessage& response = m_soap.getResponse();const QtSoapType& responseValue = response.returnValue();
    
    m_Token = responseValue["Token"].value().toString();
    m_NumberofReferral = responseValue["NumberofReferral"].value().toString();
    

    use QtSoapArray for that.

    I think this could work:
    QtSoapArray & email = (QtSoapArray &) responseValue ["ListEmails"];
    work with count() and iterate over the table to retrieve the values.

  • How to use ListFieldCallback in this class... ?

    Hi I have a write code to design a list box, but here I want to put an event or calling another class when you click check box. Please guide me where I need to write this code in this class.

    package mypackage;

    import java.util.Vector;
    Import net.rim.device.api.system.Bitmap;
    Import net.rim.device.api.system.Characters;
    Import net.rim.device.api.system.Display;
    Import net.rim.device.api.ui.Field;
    Import net.rim.device.api.ui.Graphics;
    Import net.rim.device.api.ui.Manager;
    Import net.rim.device.api.ui.MenuItem;
    Import net.rim.device.api.ui.UiApplication;
    Import net.rim.device.api.ui.component.LabelField;
    Import net.rim.device.api.ui.component.ListField;
    Import net.rim.device.api.ui.component.ListFieldCallback;
    Import net.rim.device.api.ui.component.Menu;
    Import net.rim.device.api.ui.component.SeparatorField;
    Import net.rim.device.api.ui.container.MainScreen;

    / public final class ListDemoScreen extends form {}

    private vector _listElements;

    ListField list;
    private ListField _checkList;
    _toggleItem private MenuItem;

    public ListDemoScreen() {}
    Super (Manager.NO_VERTICAL_SCROLL);
    Set the displayed title of the screen
    setTitle ("list Demo 1");
    Add (new LabelField ("list of Fruits", LabelField.FIELD_HCENTER));
    Add (new SeparatorField());

    _listElements = new Vector();
    Add (new SeparatorField());
    list = new ListField();
    ListCallback _callback = new ListCallback (this);

    list.setCallback (_callback);
    list.setSize (4);
    int index = list.getSelectedIndex ();

    Add (List);

    createField();

    }

    protected void createField() {}
    String itemOne = "Apple";
    String itemTwo = "Blackberry";
    String itemthree = "grape";
    String itemfour = "banana";
    / * ChecklistData itemOneCheckList = new ChecklistData ("Apple", false);
    ChecklistData itemTwoCheckList = new ChecklistData ("Blackberry", false);
    ChecklistData itemThreeCheckList = new ChecklistData ("Grapes", false);
    ChecklistData itemFourCheckList = new ChecklistData ('Banana', false);

    _listElements.addElement (itemOneCheckList);
    _listElements.addElement (itemTwoCheckList);
    _listElements.addElement (itemThreeCheckList);
    _listElements.addElement (itemFourCheckList);
    reloadList(); * /

    }

    private void reloadList() {}
    list.setSize (_listElements.size ());
    }

    {} public boolean invokeAction (int action)
    switch (action) {}
    case ACTION_INVOKE: / / Trackball click.
    int index = list.getSelectedIndex ();
    Data ChecklistData = _listElements.elementAt (index) (ChecklistData);
    data.toggleChecked ();
    _listElements.setElementAt (data, index);
    List.Invalidate (index);
    Returns true; We have consumed the event.
    }
    Return super.invokeAction (action);

    }

    Class ListCallback implements ListFieldCallback
    {
    ListDemoScreen listDemoScreen;

    public ListCallback (ListDemoScreen listDemoScreen)
    {
    this.listDemoScreen = listDemoScreen;

    }

    ' public void drawListRow (list ListField, Graphics g, int index, int)
    {int w)

    ChecklistData checkListData = _listElements.elementAt (index) (ChecklistData);
    String text = checkListData.getStringVal ();
    g.drawText (text, 60, y + 5, 0, w);
    Z.i. bitmap = null;
    {if (checkListData.IsChecked ())}
    BITM = Bitmap.getBitmapResource ("bullet_arrow1.png");
    //          } else {
    BITM = Bitmap.getBitmapResource ("bullet_arrow2.png");
    //          }

    w = bitm.getWidth ();
    int h = bitm.getHeight ();
    //
    int xPos = 2;
    int heightDifference = (list.getRowHeight (index) - h);
    int ypos = y + (heightDifference >-1? heightDifference: 0) / 2;
    //
    g.drawBitmap (PosX, Posy, w, h, z.i., 0, 0);

    PosX = w + 20;

    CurrentRow ChecklistData = (ChecklistData) this.get (list, index);

    StringBuffer rowString = new StringBuffer();

    If it is checked draws the string prefixed with a ticked,
    If it is not to precede a box unchecked.
    If (currentRow.isChecked ()) {}
    rowString.append (Characters.BALLOT_BOX_WITH_CHECK);
    } else {}
    rowString.append (Characters.BALLOT_BOX);
    }

    Add a few spaces and text on the line.
    rowString.append (Characters.SPACE);
    rowString.append (Characters.SPACE);
    rowString.append (currentRow.getStringVal ());

    Draw the text.
    g.drawText (rowString.toString (), y, 0, 0, -1);

    }

    public Object get (ListField list, int index) {}
    Return _listElements.elementAt (index);
    }

    public int indexOfList (String prefix, ListField list, int string) {}
    Return _listElements.indexOf (prefix, string);
    }

    public int getPreferredWidth (ListField list) {}
    Return Display.getWidth ();
    }

    }

    private class ChecklistData
    {
    private String _stringVal;
    Private boolean _checked;

    /*
    * ChecklistData() {_stringVal = ""; _checked = false;}
    */

    ChecklistData (String stringVal, boolean checked) {}
    _stringVal = stringVal;
    _checked = enabled;
    }

    Get / set methods.
    private String getStringVal() {}
    Return _stringVal;
    }

    Private boolean isChecked() {}
    Return _checked;
    }

    Toggle the verified status.
    private void toggleChecked() {}
    _checked =! _checked;
    }

    }

    /*
    * (non-Javadoc)
    *
    * @see
    * net.rim.device.api.ui.container.MainScreen #makeMenu (net.rim.device.api
    *. ui.component.Menu, int)
    */
    protected void makeMenu (menu Menu, for example int)
    {

    TODO self-generating method stub
    Focus on the ground = UiApplication.getUiApplication () .getActiveScreen (). getLeafFieldWithFocus();
    If (focus is _checkList)
    {
    The ListField _checkList instance has focus.
    Add the _toggleItem MenuItem.
    menu. Add (_toggleItem);
    }

    super.makeMenu (menu, for example);
    }

    }

    Thanks in advance

    You've already got an invokeAction who knows that something has been clicked.  If you just need to add the code in there.

    How to do this will depend on what kind of relationship you want to your other have with the ListField object.

    You could provide a method to directly call the outer class.  Or you can use the model of the observer.  Alternatively, you can implement the FieldChangeListener - simply to call it you can just call

    this.fieldChangeNotify ();

    and add a field ChangeListener to the ListField.

    HTH.

  • How to get the element selected listfield and goto next page?

    Assalaamualikum

    I try parsing the XML from a url and show in listfield.

    problem:

    How to get the selected item and passing the variable and than goto next page?

    my code:

    package parsepack;

    import java.io.IOException;
    import java.io.InputStream;
    import java.util.Vector;

    Import javax.microedition.io.Connector;
    Import javax.microedition.io.StreamConnection;

    Import net.rim.device.api.system.Bitmap;
    Import net.rim.device.api.system.Display;
    Import net.rim.device.api.ui.DrawStyle;
    Import net.rim.device.api.ui.Field;
    Import net.rim.device.api.ui.FieldChangeListener;
    Import net.rim.device.api.ui.Graphics;
    Import net.rim.device.api.ui.Manager;
    Import net.rim.device.api.ui.UiApplication;
    Import net.rim.device.api.ui.component.ListField;
    Import net.rim.device.api.ui.component.ListFieldCallback;
    Import net.rim.device.api.ui.container.MainScreen;
    Import net.rim.device.api.ui.container.VerticalFieldManager;
    Import net.rim.device.api.xml.parsers.DocumentBuilder;
    Import net.rim.device.api.xml.parsers.DocumentBuilderFactory;

    to import org.W3C.DOM.document;
    Import org.w3c.dom.Node;
    Import org.w3c.dom.NodeList;

    extends xmlparsing public class UiApplication implements ListFieldCallback, FieldChangeListener
    {

    Public Shared Sub main (String [] args)
    {
    xmlparsing app = new xmlparsing();
    app.enterEventDispatcher ();
    }

    public long mycolor;
    Connection _connectionthread;
    private static ListField _list;
    private static Vector listElements is new Vector();.
    public display display = new MainScreen();
    MainManager VerticalFieldManager;
    VerticalFieldManager subManager;

    public xmlparsing()
    {
    Super();
    pushScreen (screen);

    final Bitmap Imagearriereplan = Bitmap.getBitmapResource ("blackbackground.png");

    mainManager = new VerticalFieldManager(Manager.NO_VERTICAL_SCROLL |) Manager.NO_VERTICAL_SCROLLBAR)
    {

    public void paint (Graphics graphics)
    {
    graphics.drawBitmap (0, 0, Display.getWidth (), Display.getHeight (), Imagearriereplan, 0, 0);

    Super.Paint (Graphics);
    }

    };

    subManager = new VerticalFieldManager(Manager.VERTICAL_SCROLL |) Manager.VERTICAL_SCROLLBAR)
    {
    protected void sublayout (int maxWidth, maxHeight int)
    {
    int displayWidth = Display.getWidth ();
    int displayHeight = Display.getHeight ();

    Super.sublayout (displayWidth, displayHeight);
    setExtent (displayWidth, displayHeight);
    }
    };

    Screen.Add (mainManager);

    _list = new ListField()

    {

    public void paint (Graphics graphics)

    {
    graphics.setColor ((int) mycolor);
    Super.Paint (Graphics);

    }

    };
    myColor = 0x00FFFFFF;
    _list. Invalidate();
    _list.setEmptyString ("* only supplies not available *", DrawStyle.HCENTER "");
    _list.setRowHeight (50);
    _list.setCallback (this);
    mainManager.add (subManager);
    listElements.removeAllElements ();
    _connectionthread = New Connection();
    _connectionthread. Start();
    }

    protected boolean navigationClick (int status, int time)
    {
    Try
    {
    Here, go to another screen if you need.

    }
    catch (System.Exception e)
    {
    System.out.println ("Exception:-: navigationClick()" + try ());
    }
    Returns true;
    }

    private class login extends thread
    {
    Public connection()
    {
    Super();
    }

    public void run() {}
    Doc document;
    StreamConnection conn = null;
    InputStream is = null;
    try {}

    Conn = Connector.open (StreamConnection) ("http://ec2-54-248-241-248.ap-northeast-1.compute.amazonaws.com/koperasi-akr-trial/cgi-bin/gw-pinjama...

    DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance ();
    docBuilderFactory.setIgnoringElementContentWhitespace (true);
    docBuilderFactory.setCoalescing (true);
    DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder ();
    docBuilder.isValidating ();
    is = conn.openInputStream ();
    doc = docBuilder.parse (is);
    doc.getDocumentElement () .normalize ();
    List of NodeList = doc.getElementsByTagName ("ID");
    for (int i = 0; i)< list.getlength();="" i++)="">
    Node node = list.item (i) .getFirstChild ();
    listElements.addElement (textNode.getNodeValue ());
    }
    } catch (Exception e) {}
    System.out.println (try ());
    } {Finally
    If (is! = null) {}
    try {is.close ();
    } catch (IOException ignored) {}
    } If (conn! = null) {}
    Try {conn.close () ;}
    catch (IOException ignored) {}
    }} UiApplication.getUiApplication () .invokeLater (new Runnable() {}
    public void run() {}
    _list. SetSize (listElements.Size ());
    subManager.add (_list);
    Screen.Invalidate ();
    }
    });
    }

    }

    ' public void drawListRow (list ListField, Graphics g, int index, int y, int w)
    {
    Your string = (String) listElements.elementAt (index);
    int yPos = 0 + y;
    g.drawLine (0, yPos, w, yPos);
    g.drawText (, 5, 15 + y, 0, w);
    }

    public {get {Object (ListField list, int index)
    {
    Return listElements.elementAt (index);
    }
    public int indexOfList (String prefix, ListField list, int, string)
    {
    Return listElements.indexOf (prefix, string);
    }
    public int getPreferredWidth (ListField list)
    {
    Return Display.getWidth ();
    }
    public final void insert (String toInsert, int index) {}
    listElements.addElement (toInsert);
    }

    ' Public Sub fieldChanged (field field, int context) {}

    }
    }

    Thank you.

    I told you that replace the navigationclick() method where initialize you your listfield

    as I think that changing your code and then answer me

    _list = new ListField()
    {
    protected boolean navigationClick(int status, int time)
    {
      Dialog.inform("hi");
      return true;
    }
    
    public void paint(Graphics graphics)
    {
    graphics.setColor((int) mycolor);
    super.paint(graphics);
    }
    };
    

Maybe you are looking for