Need help with custom event from Main class to an unrelated class.

Hey guys,
I'm new to Flash and not great with OOP.  I've made it pretty far with google and lurking, but I've been pulling my hair out on this problem for a day and everything I try throws an error or simply doesn't hit the listener.
I'm trying to get my Main class to send a custom event to an unrelated class called BigIcon.  The rest of the code works fine, it's just the addEventListener and dispatchEvent that isn't working.
I've put in the relevant code in below.  Let me know if anything else is needed to troubleshoot.  Thank you!
Main.as
package
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    public class Main extends MovieClip
        var iconLayer_mc:MovieClip = new MovieClip();
        public function Main()
            Spin_btn.addEventListener(MouseEvent.CLICK,fl_MouseClickHandler);
            addChildAt(iconLayer_mc,0);
            placeIcons();
        function placeIcons():void
            var i:int;
            var j:int;
            for (i = 0; i < 4; i++)
                for (j = 0; j < 5; j++)
                    //iconString_array has the names of illustrator objects that have been converted to MovieClips and are in the library.
                    var placedIcon_mc:BigIcon = new BigIcon(iconString_array[i][j],i,j);
                    iconLayer_mc.addChild(placedIcon_mc);
        function fl_MouseClickHandler(event:MouseEvent):void
            dispatchEvent(new Event("twitchupEvent",true));
BigIcon.as
package
    import flash.display.MovieClip;
    import flash.events.Event;
    import flash.utils.getDefinitionByName;
    public class BigIcon extends MovieClip
        private var iconImage_str:String;
        private var iconRow_int:int;
        private var iconColumn_int:int;
        public function BigIcon(iconImage_arg:String, iconRow_arg:int, iconColumn_arg:int)
            iconImage_str = iconImage_arg;
            iconRow_int = iconRow_arg;
            iconColumn_int = iconColumn_arg;
            this.addEventListener(Event.ADDED_TO_STAGE, Setup);
        function Setup(e:Event)
            this.y = iconRow_int;
            this.x = iconColumn_int;
            var ClassReference:Class = getDefinitionByName(iconImage_str) as Class;
            var thisIcon_mc:MovieClip = new ClassReference;
            this.addChild(thisIcon_mc);
            addEventListener("twitchupEvent", twitchUp);
        function twitchUp(e:Event)
            this.y +=  10;

Ned Murphy wrote:
You should be getting an error for the Main.as class due to missing a line to import the Event class...
import flash.events.Event;
My apologies, I should attempt to compile my example code before I ask for help...
Alright, this compiles, gives me no errors, shows my 'book' and 'flowers' icons perfectly when ran, and prints 'addEventListener' to the output window as expected.  I get no errors when I press the button, 'dispatchEvent' is output (good), but the 'twitchUp' function is never called and 'EventTriggered' is never output. 
How do I get the 'twitchUp' event to trigger?
Main.as
package
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    import flash.events.*;
    public class Main extends MovieClip
        var iconLayer_mc:MovieClip = new MovieClip();
        var iconString_array:Array = new Array(2);
        public function Main()
            Spin_btn.addEventListener(MouseEvent.CLICK,fl_MouseClickHandler);
            addChildAt(iconLayer_mc,0);
            buildStringArray();
            placeIcons();
        function buildStringArray():void
            var i:int;
            var j:int;
            for (i = 0; i < 2; i++)
                iconString_array[i] = new Array(3);
                for (j = 0; j < 3; j++)
                    if (Math.random() > .5)
                        //'flowers' is the name of an illustrator object that has been converted to a MovieClip and is in the library
                        iconString_array[i][j] = "flowers";
                    else
                        //'book' is the name of an illustrator object that has been converted to a MovieClip and is in the library
                        iconString_array[i][j] = "book";
        function placeIcons():void
            var i:int;
            var j:int;
            for (i = 0; i < 2; i++)
                for (j = 0; j < 3; j++)
                    //iconString_array has the names of illustrator objects that have been converted to MovieClips and are in the library.
                    var placedIcon_mc:BigIcon = new BigIcon(iconString_array[i][j],i*50,j*50);
                    iconLayer_mc.addChild(placedIcon_mc);
        function fl_MouseClickHandler(event:MouseEvent):void
            dispatchEvent(new Event("twitchupEvent",true));
            trace("dispatchEvent");
BigIcon.as
package
    import flash.display.MovieClip;
    import flash.events.*;
    import flash.utils.getDefinitionByName;
    public class BigIcon extends MovieClip
        private var iconImage_str:String;
        private var iconRow_int:int;
        private var iconColumn_int:int;
        public function BigIcon(iconImage_arg:String, iconRow_arg:int, iconColumn_arg:int)
            iconImage_str = iconImage_arg;
            iconRow_int = iconRow_arg;
            iconColumn_int = iconColumn_arg;
            this.addEventListener(Event.ADDED_TO_STAGE, Setup);
        function Setup(e:Event)
            this.y = iconRow_int;
            this.x = iconColumn_int;
            var ClassReference:Class = getDefinitionByName(iconImage_str) as Class;
            var thisIcon_mc:MovieClip = new ClassReference;
            this.addChild(thisIcon_mc);
            addEventListener("twitchupEvent", twitchUp);
            trace("addEventListener");
        function twitchUp(e:Event)
            this.y +=  10;
            trace("EventTriggered");
Output:
[SWF] Untitled-1.swf - 40457 bytes after decompression
addEventListener
addEventListener
addEventListener
addEventListener
addEventListener
addEventListener
dispatchEvent
[UnloadSWF] Untitled-1.swf
Test Movie terminated.

Similar Messages

  • Need Help: Generate Customer Data from Prod Database

    Hi All,
    My company have an Oracle Financial System, with and old version Oracle Application 11.0.3 and Oracle Database 8.0.5. The database name PROD. This system has been use for more than 7 years and in between there were many stuff resigned without handover and therefore many records and supporting steps cannot be trace back. However the system is still keep running and updated daily.
    Recently we have a user request to generate out a list of customer company name, and their related products purchase from the database, this is because they does not have any methods to print out the list from application. Unfortunately, we do not know which tables or index is actualy storing the name of the customer and products. We have the list of below users accounts that able to log in to the database.
    PA/PA
    APPLSYS/APPS
    APPS/APPS
    ALR/ALR
    AX/AX
    AK/AK
    GL/GLRG/RG
    FA/FAHR/HR
    SSP/SSP
    HXT/HXT
    OTA/OTA
    RLA/RLA
    VEH/VEH
    QA/QA
    ICX/ICX
    AZ/AZ
    AP/AP
    AR/AR
    OE/OE
    OSM/OSM
    NSM/NSM2020
    CN/CN
    MFG/MFG
    INV/INV
    PO/PO
    BOM/BOM
    ENG/ENG
    MRP/MRP
    CRP/CRP
    WIP/WIP
    CZ/CZ
    PJM/PJM
    FLM/FLM
    MSC/MSC
    CS/CS
    CE/CE
    EC/EC
    JG/JG
    APPS/APPS
    All the reference documents is no longer exist. I am able to use SQL Plus to generate the list of tables with the command : select table_name from user_tables. Each user accounts will return different kind of table names. But still I cant locate which table that actually storing the name of the customers and products.
    Is that anybody got hands on this case before? Urgent

    We have this table: And need to unload this table data in flat file format.
    Need help with unload SQL file with these two columns:
    AMT_PAID_ORIG, AMT_PAID_ADJ
    SQL> desc flconv.claim_adj_less
    Name Null? Type
    SAK_CLAIM_ADJ_LESS NUMBER(10)
    SAK_CLAIM_ADJ NUMBER(10)
    ADJ_CLAIM_ICN NUMBER(13)
    ORIGINAL_CLAIM_ICN NUMBER(13)
    DATE_PAID_ORIG NUMBER(8)
    DATE_PAID_ADJ NUMBER(8)
    AMT_PAID_ORIG NUMBER(10,2)
    AMT_PAID_ADJ NUMBER(10,2)
    SAK_PROV_LOC NUMBER(9)
    SAK_FUND_CODE NUMBER(9)
    CHECK_SAK NUMBER(9)
    SAK_PUB_HLTH NUMBER(9)

  • I need help with a download from Adobe

    I need help with Adode photoshop elements that I bought from Adobe. The download take forever. I can't get signed in very easy. It take forever

    Hi Kathy1963-1964,
    Welcome to Adobe Forum,
    You have photoshop elements 12, you can try downloading without the akamei downloader .
    http://prodesigntools.com/photoshop-elements-12-direct-download-links-premiere.html
    Please read the " very important instruction" prior to downoload.
    I would request you to disable the firewall & the antivirus prior to download.
    Let us know if it worked.
    Regards,
    Rajshree

  • Need help with getting variable from static

    Hello,
    What I am building is an application that prompts for username/password before it shows the main screen. Once they have successfully logged in, I need to assign the username that they used, in order to use it for a button event if the make any updates.
    Here is the code that I have tried to use.
    public String username;
    ///This set's the public variable username
    public void setUserName(String UserName){
    username = UserName;
    /////////////////Here is where they login, and assign the name to setUsername
    public static void main(String args[]) throws SQLException {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    JFrame frame = new JFrame();
    JTextField userName = new JTextField();
    JTextField passWord = new JTextField();
    Object[] options = {"OK","CANCEL"};
    Object[] msg = {"UserName:", userName, "Password:", passWord};
    final JOptionPane op = new JOptionPane(msg, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION){};
    JDialog dialog = op.createDialog(frame, "Please Login");
    dialog.show();
    int result = JOptionPane.OK_OPTION;
    try {
    result = ((Integer)op.getValue()).intValue();
    }catch(Exception uninitializedValue){}
    if(result == JOptionPane.OK_OPTION) {
    String userID = userName.getText();
    String passID = passWord.getText();
    Main myMain = new Main();
    myMain.setUserName(userID);
    if(!userID.equals("") && !passID.equals("")) {
    new Main().setVisible(true);
    }else {
    // user cancelled
    ////here is the button event that also will need the username
    private void selButtonActionPerformed(java.awt.event.ActionEvent evt) {
    Connection conn = null;
    Statement stmt3 = null;
    Statement stmt4 = null;
    ResultSet rset3 = null;
    ResultSet rset4 = null;
    String usernum = null;
    String xemu = null;
    String loc = null;
    String ustat = null;
    String manager = null;
    String dept = null;
    String Add = "Add";
    String Update = "Update";
    String groupID = "9999";
    Vector columnNames = new Vector();
    Vector data = new Vector();
    String Manager_info[] = {"managerindex", "managers", "managername"};
    String Account_info[] = {"acctypeindex", "acctype", "acctypedesc"};
    String Group_info[] = {"groupnum", "groups", "groupcode"};
    String System_info[] = {"systemindex", "systems", "systemname"};
    String Dept_info[] = {"departindex", "departments", "departname"};
    String Xemu_info[] = {"xemuindex", "xemulator", "xemudesc"};
    String Location_info[] = {"locindex", "location", "locdesc"};
    String Ustatus_info[] = {"ustatusindex", "userstatus", "ustatusdesc"};
    Date myDate = new Date();
    SimpleDateFormat formatter = new SimpleDateFormat("dd-MMM-yy");
    String today = formatter.format(myDate);
    System.out.println(username);
    I am trying to set the public username variable to what the person enters, however since I am creating a seperate instance of it, I don't believe it will work. Any help would be very much appreciated.
    Thanks.
    Josh

    I am developing in Netbeans. If I try to remove the static keyword from main(), netbeans canno't find a main to run. I have created the User class.
    Here is the main again to show what I have done.
    public static void main(String args[]) throws SQLException {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    User user = new User();
    JFrame frame = new JFrame();
    JTextField userName = new JTextField();
    JTextField passWord = new JTextField();
    Object[] options = {"OK","CANCEL"};
    Object[] msg = {"UserName:", userName, "Password:", passWord};
    final JOptionPane op = new JOptionPane(msg, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION){};
    JDialog dialog = op.createDialog(frame, "Please Login");
    dialog.show();
    int result = JOptionPane.OK_OPTION;
    try {
    result = ((Integer)op.getValue()).intValue();
    }catch(Exception uninitializedValue){}
    if(result == JOptionPane.OK_OPTION) {
    String userID = userName.getText();
    String passID = passWord.getText();
    user.setName(userID);
    user.setPassword(passID);
    if(!userID.equals("") && !passID.equals("")) {
    //Auth.setUserName(userID);
    //Auth.setPassword(passID);
    new Main().setVisible(true);
    }else {
    // user cancelled
    This set's the variables
    Here is the beginning of the evt that I am using to try and get the data.
    private void selButtonActionPerformed(java.awt.event.ActionEvent evt) {                                         
    Connection conn = null;
    Statement stmt3 = null;
    Statement stmt4 = null;
    ResultSet rset3 = null;
    ResultSet rset4 = null;
    String usernum = null;
    String xemu = null;
    String loc = null;
    String ustat = null;
    String manager = null;
    String dept = null;
    String Add = "Add";
    String Update = "Update";
    String groupID = "9999";
    Vector columnNames = new Vector();
    Vector data = new Vector();
    User user = new User();
    String User = user.getName();
    System.out.println(User);
    String Manager_info[] = {"managerindex", "managers", "managername"};
    String Account_info[] = {"acctypeindex", "acctype", "acctypedesc"};
    String Group_info[] = {"groupnum", "groups", "groupcode"};
    String System_info[] = {"systemindex", "systems", "systemname"};
    String Dept_info[] = {"departindex", "departments", "departname"};
    String Xemu_info[] = {"xemuindex", "xemulator", "xemudesc"};
    String Location_info[] = {"locindex", "location", "locdesc"};
    String Ustatus_info[] = {"ustatusindex", "userstatus", "ustatusdesc"};
    Date myDate = new Date();
    SimpleDateFormat formatter = new SimpleDateFormat("dd-MMM-yy");
    String today = formatter.format(myDate);
    String [] str = {
    "EmpID", "Account", "System", "Type", "Status", "UserID", "Group"
    This gives me a null on the println, how can I get the data that was entered in main()?
    Thanks,
    Josh

  • Need help with customizing standard reports in Fusion Applications

    Hi,
       I have requirement to customize 'Asset Transfer Report' in Oracle Fusion.
       This report is a BI Publisher report and Data Model lies in folder '/Share Folders/Financials/Fixed Assets/Tracking/Data Model' and report lies in folder '/Share Folders/Financials/Fixed Assets/Tracking'.
        Steps which i have completed
       I am trying to customize this report, i followed the below steps
    Step 1:- 
       Copied Data Model into '/Shared Folder/Custom/Financials/Fixed Assets/Tracking/Data Model' and report into '/Shared Folder/Custom/Financials/Fixed Assets/Tracking/'
    Step 2:-
       Opened task 'Manage Custom Enterprise Scheduler Jobs for Ledger and Related Applications' and created a job with the following details.
    Job Definition
    Field Name
    Value
    Display Name
    XX Asset Transfers Report
    Name
    XX_ASSET_TRANSFERS_REPORT
    Path
    /FA/
    Application
    Financials Common Module
    Description
    XX Asset Transfers Report
    Job Application Name
    FinancialsEss
    Enable Submission from Enterprise Manager
    Job Type
    BIPJobType
    Class Name
    oracle.xdo.service.client.scheduler.BIPJobExecutable
    Default Output Format
    Report ID
    /Custom/Financials/Fixed Assets/Tracking/Asset Transfers Report.xdo
    Priority
    Allow Multiple Pending Submissions
    False
    Enable Submission From Scheduled Processes
    Yes
    User Properties
    Field Name
    Value
    PDF
    .*\.pdf$
    jobDefinitionName
    FAS430
    XML
    .*\.xml$
    jobPackageName
    /oracle/apps/ess/financials/assets/tracking/transfers
    EXT_PortletContainerWebModule
    Ledger
    Since the standard report has the below parameter i have created same set of parameters for the Job which i have created, but i do not know how to assign the list of values to these parameters
    Parameter Prompt
    Data Type
    Page Element
    Default Value
    Required
    Book
    String
    Text box
    Yes
    Currency
    String
    Text box
    Yes
    Period
    String
    Text box
    Yes
    Batch
    String
    Text box
    No
    Step 4:-
       Now when i navigate to schedule process, when i click Schedule New Process Button in the list of values i can see the job which i created. When i submit the job is completing with error.
       When i open the xml file, file is blank and no data is available in the file.
       When i open the log file i see the below error
    dummy file is deleted
    ================ BIPJobExecutable Execution Started ============
    OutputFile : /u01/APPLTOP/instance/ess/rfd/67068/out/67068.xml
    Request ID: 67068 ClassLoader is weblogic.utils.classloaders.GenericClassLoader@1c85c3a finder: weblogic.utils.classloaders.CodeGenClassFinder@1c85cb3 annotation: FinancialsEssApp#V2.0@
    RequestId:67068
    ReportID : /Custom/Financials/Fixed Assets/Tracking/FLY FA Transfers Report.xdo
    Process : BIPDocGen
    The bipJobID : 6252
    bipJobID is updated to ESSRuntimeService
    BIP_STATUS_URL is added to ESSRuntimeService
    ================ BIPJobExecutable is running in async mode. ============
    ================ Please check the ess status for more detail info. ============
        Am i doing anything wrong while creating the job?
    Note :- I created another test data model and report with 'Select SYSDATE from dual' and am able to see the report completing successfully.
    Please kindly help, i am failing to meet my deadlines.
    Regards,
    Prasad R

    Hello Jani Rautiainen,
        Thanks a lot for replying my question.
        This is the first time i am working with the BI Publisher reports and fusion applications.
        My requirement is to add few columns to the standard report with out loosing the functionality.
        I was not aware that there is two ways of doing this, i was always copying data model and report to a new folder and trying to create a new job for the report.
        As mentioned in the document 7.2.1.4 Using the Customize Feature    , i clicked on the more button on my report but i do not see the customize option. Do i need to have any specific role for this to appear in the menu? Please kindly let me know.
        Also i see below limitations while customizing report
    Limitations
    Following are limitations of the Customize report option:
    The Customize option is only available through direct access to the BI Publisher server using the /xmlpserver URL (for example:http://hostname.com:7001/xmlpserver). The Customize option is not available through the /analytics URL used to access Oracle Business Intelligence Enterprise Edition.
    The Customize option is available only for reports. The Customize option is not available for data models, style templates, or sub templates.To customize data models, style templates or sub templates and insulate them from potential changes from patching: Make a copy of the data model, style template, or sub-template and either rename it or place it in a custom folder. Ensure that you update any reports to point to the customized data model, style template, or sub template.
        My requirement is to add few additional columns which needs Data Model to be modified, Can i copy the data model to the custom folder and do my modifications and point this data model in the report(as mentioned in the point 2 in the limitations)? In that case, will the original report submission works?
    Regards,
    Prasad R

  • Need help with my HttpConnection From Midlet To Servlet...

    NEED HELP ASAP PLEASE....
    This class is supposed to download a file from the servlet...
    the filename is given by the midlet... and the servlet will return the file in bytes...
    everything is ok in emulator...
    but in nokia n70... error occurs...
    Http Version Mismatch shows up... when the pout.flush(); is called.. but when removed... java.io.IOException: -36 occurs...
    also i have posted the same problem in nokia forums..
    please check also...
    http://discussion.forum.nokia.com/forum/showthread.php?t=105567
    now here are my codes...
    midlet side... without pout.flush();
    public class DownloadFile {
        private GmailMidlet midlet;
        private HttpConnection hc;
        private byte[] fileData;
        private boolean downloaded;
        private int lineNumber;
    //    private String url = "http://121.97.220.162:8084/ProxyServer/DownloadFileServlet";
        private String url = "http://121.97.221.183:8084/ProxyServer/DownloadFileServlet";
    //    private String url = "http://121.97.221.183:8084/ProxyServer/Attachments/mark.ramos222/GmailId111d822a8bd6f6bb/01032007066.jpg";
        /** Creates a new instance of DownloadFile */
        public DownloadFile(GmailMidlet midlet, String fileName) throws OutOfMemoryError, IOException {
            System.gc();
            setHc(null);
            OutputStream out = null;
            DataInputStream is= null;
            try{
                setHc((HttpConnection)Connector.open(getUrl(), Connector.READ_WRITE));
            } catch(ConnectionNotFoundException ex){
                setHc(null);
            } catch(IOException ioex){
                ioex.printStackTrace();
                midlet.alertScreen = new AlertScreen("Error C1", ioex.toString(),
                        null, AlertType.ERROR);
                midlet.alertScreen.setTimeout(Alert.FOREVER);
                midlet.display.setCurrent(midlet.alertScreen);
            try {
                if(getHc() != null){
                    getHc().setRequestMethod(HttpConnection.POST);
                    getHc().setRequestProperty("Accept","*/*");
                    getHc().setRequestProperty("Http-version","HTTP/1.1");
                    lineNumber = 1;
                    getHc().setRequestProperty("CONTENT-TYPE",
                            "text/plain");
                    lineNumber = 2;
                    getHc().setRequestProperty("User-Agent",
                            "Profile/MIDP-2.0 Configuration/CLDC-1.1");
                    lineNumber =3;
                    out = getHc().openOutputStream();
                    lineNumber = 4;
                    PrintStream pout = new PrintStream(out);
                    lineNumber = 5;
                    pout.println(fileName);
                    lineNumber = 6;
    //                pout.flush();
                    System.out.println("File Name: "+fileName);
                    lineNumber = 7;
                    is = getHc().openDataInputStream();
                    long len = getHc().getLength();
                    lineNumber = 8;
                    byte temp[] = new byte[(int)len];
                    lineNumber = 9;
                    System.out.println("len "+len);
                    is.readFully(temp,0,(int)len);
                    lineNumber = 10;
                    setFileData(temp);
                    lineNumber = 11;
                    is.close();
                    lineNumber = 12;
                    if(getFileData() != null)
                        setDownloaded(true);
                    else
                        setDownloaded(false);
                    System.out.println("Length : "+temp.length);
                    midlet.setAttachFile(getFileData());
                    lineNumber = 13;
                    pout.close();
                    lineNumber = 14;
                    out.close();
                    lineNumber = 15;
                    getHc().close();
            } catch(Exception ex){
                setDownloaded(false);
                ex.printStackTrace();
                midlet.alertScreen = new AlertScreen("Error C2+ line"+lineNumber,
                        ex.toString()+
                        " | ",
                        null, AlertType.ERROR);
                midlet.alertScreen.setTimeout(Alert.FOREVER);
                midlet.display.setCurrent(midlet.alertScreen);
        public HttpConnection getHc() {
            return hc;
        public void setHc(HttpConnection hc) {
            this.hc = hc;
        public String getUrl() {
            return url;
        public void setUrl(String url) {
            this.url = url;
        public byte[] getFileData() {
            return fileData;
        public void setFileData(byte[] fileData) {
            this.fileData = fileData;
        public boolean isDownloaded() {
            return downloaded;
        public void setDownloaded(boolean downloaded) {
            this.downloaded = downloaded;
    }this is the midlet side with pout.flush();
    showing Http Version Mismatch
    public class DownloadFile {
        private GmailMidlet midlet;
        private HttpConnection hc;
        private byte[] fileData;
        private boolean downloaded;
        private int lineNumber;
    //    private String url = "http://121.97.220.162:8084/ProxyServer/DownloadFileServlet";
        private String url = "http://121.97.221.183:8084/ProxyServer/DownloadFileServlet";
    //    private String url = "http://121.97.221.183:8084/ProxyServer/Attachments/mark.ramos222/GmailId111d822a8bd6f6bb/01032007066.jpg";
        /** Creates a new instance of DownloadFile */
        public DownloadFile(GmailMidlet midlet, String fileName) throws OutOfMemoryError, IOException {
            System.gc();
            setHc(null);
            OutputStream out = null;
            DataInputStream is= null;
            try{
                setHc((HttpConnection)Connector.open(getUrl(), Connector.READ_WRITE));
            } catch(ConnectionNotFoundException ex){
                setHc(null);
            } catch(IOException ioex){
                ioex.printStackTrace();
                midlet.alertScreen = new AlertScreen("Error C1", ioex.toString(),
                        null, AlertType.ERROR);
                midlet.alertScreen.setTimeout(Alert.FOREVER);
                midlet.display.setCurrent(midlet.alertScreen);
            try {
                if(getHc() != null){
                    getHc().setRequestMethod(HttpConnection.POST);
                    getHc().setRequestProperty("Accept","*/*");
                    getHc().setRequestProperty("Http-version","HTTP/1.1");
                    lineNumber = 1;
                    getHc().setRequestProperty("CONTENT-TYPE",
                            "text/plain");
                    lineNumber = 2;
                    getHc().setRequestProperty("User-Agent",
                            "Profile/MIDP-2.0 Configuration/CLDC-1.1");
                    lineNumber =3;
                    out = getHc().openOutputStream();
                    lineNumber = 4;
                    PrintStream pout = new PrintStream(out);
                    lineNumber = 5;
                    pout.println(fileName);
                    lineNumber = 6;
                    pout.flush();
                    System.out.println("File Name: "+fileName);
                    lineNumber = 7;
                    is = getHc().openDataInputStream();
                    long len = getHc().getLength();
                    lineNumber = 8;
                    byte temp[] = new byte[(int)len];
                    lineNumber = 9;
                    System.out.println("len "+len);
                    is.readFully(temp,0,(int)len);
                    lineNumber = 10;
                    setFileData(temp);
                    lineNumber = 11;
                    is.close();
                    lineNumber = 12;
                    if(getFileData() != null)
                        setDownloaded(true);
                    else
                        setDownloaded(false);
                    System.out.println("Length : "+temp.length);
                    midlet.setAttachFile(getFileData());
                    lineNumber = 13;
                    pout.close();
                    lineNumber = 14;
                    out.close();
                    lineNumber = 15;
                    getHc().close();
            } catch(Exception ex){
                setDownloaded(false);
                ex.printStackTrace();
                midlet.alertScreen = new AlertScreen("Error C2+ line"+lineNumber,
                        ex.toString()+
                        " | ",
                        null, AlertType.ERROR);
                midlet.alertScreen.setTimeout(Alert.FOREVER);
                midlet.display.setCurrent(midlet.alertScreen);
        public HttpConnection getHc() {
            return hc;
        public void setHc(HttpConnection hc) {
            this.hc = hc;
        public String getUrl() {
            return url;
        public void setUrl(String url) {
            this.url = url;
        public byte[] getFileData() {
            return fileData;
        public void setFileData(byte[] fileData) {
            this.fileData = fileData;
        public boolean isDownloaded() {
            return downloaded;
        public void setDownloaded(boolean downloaded) {
            this.downloaded = downloaded;
    }here is the servlet side...
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            if(request.getMethod().equals("POST")){
                BufferedReader dataIN = request.getReader();
                String fileName = dataIN.readLine();
                File file = new File(fileName);
                String contentType = getServletContext().getMimeType(fileName);
                response.setContentType(contentType);
                System.out.println("Content Type: "+contentType);
                System.out.println("File Name: "+fileName);
                int size = (int)file.length()/1024;
                if(file.length() > Integer.MAX_VALUE){
                    System.out.println("Very Large File!!!");
                response.setContentLength(size*1024);
                FileInputStream fis = new FileInputStream(fileName);
                byte data[] = new byte[size*1024];
                fis.read(data);
                System.out.println("data lenght: "+data.length);
                ServletOutputStream sos = response.getOutputStream();
                sos.write(data);
    //            out.flush();
            }else{
                response.setContentType("text/plain");
                PrintWriter out = response.getWriter();
                BufferedReader dataIN = request.getReader();
                String msg_uid = dataIN.readLine();
                System.out.println("Msg_uid"+msg_uid);
                JDBConnection dbconn = new JDBConnection();
                String fileName = dbconn.getAttachment(msg_uid);
                String[] fileNames = fileName.split(";");
                int numFiles = fileNames.length;
                out.println(numFiles);
                for(int i = 0; i<numFiles; i++){
                    out.println(fileNames);
    out.flush();
    out.close();
    Message was edited by:
    Mark.Ramos222

    1) Have you looked up the symbian error -36 on new-lc?
    2) Have you tried the example in the response on forum nokia?
    3) Is the address "121.97.220.162:8084" accessible from the internet, on the device, on the specified port?

  • Beginner - need help with custom profiles

    I've got 30-day demo versions of both Aperture and Lightroom trying to work out which is best for printing using custom profiles I've had done for a selection of textured art papers for use on my Epson R2400. I've read the printing documentation for both products.
    In Aperture, I select print from the menu and open the print dialogue window. Then I open the printer settings window choosing the correct media and switching off Epson 'Color Adjustment' and saving the settings. Then I'm selecting my color profile from Aperture's 'ColorSync Profile' option in the print window and making sure 'Black Point Compensation' is selected. Then I'm pressing print.
    In Lightroom 2, I select print from the menu and scroll down to the 'Color Management' tab in the print module. Here I'm choosing my custom profile from the drop down list and setting rendering intent as 'Perceptual'. On clicking the print button the default print window opens and I'm switching off Epson 'Color Adjustment' and selecting my preferred paper type. Then I'm pressing print.
    Now I will admit that I'm new to printing with profiles and a complete newbie to Aperture and Lightroom. However, my prints from Lightroom are absolutely perfect, but colours are differing in Aperture prints. In particular, prints are slightly lighter and washed-out. I'm wondering if I might be missing a step somewhere in Aperture? It seems strange that both applications follow roughly the same print procedure yet I'm getting different results using the same profiles and images. I'd much rather use Aperture so I'm trying to seek an explanation for the change in colors.
    Any suggestions would be appreciated.

    A lot of people including me have had problems in this area. There may have been some problems but in my case I was so absorbed in trying different solutions it is hard to say what worked when.
    This works for me using an HP 9180:
    1. In the View drop down select Printing Profile and choose your paper. This step is not critical but can be helpful.
    2. select Print Image and we will work through the menu in sequence.
    3. Select your printer
    4. Click on Print settings
    Click on the Cover Page arrows and you will be given a number of other choices. Select Paper Type/Quality. Select your paper and possibly adjust the other values but generally I leave these alone unless i specifically want Borderless printing.
    Click save
    5. back on the print menu select paper size. I usually select best fit next.
    6. Select Colorsync Profile and again select your paper.
    7. Keep Black Point clicked on.
    8. I find that I need to set my Gamma between 1.10 and 1.20.
    9. I usually click on the Loupe and check to see if Sharpening is needed.
    10. Adjust scaling and width to your needs.
    11. I then Print as I have not found that Previewing helps me to improve my Workflow.
    It may all seem straightforward but this now works for me.
    When this all started there were many saying how important it was to calibrate the screen, many tried this but is still did not help solve the problem. From what i understand all the Canon printers are capable of giving excellent results with Aperture. i hope that you join the community of satosfied users. Good luck.

  • I need help with viewing files from the external hard drive on Mac

    I own a 2010 mac pro 13' and using OS X 10.9.2(current version). The issue that I am in need of help is with my external hard drive.
    I am a photographer so It's safe and convinent to store pictures in my external hard drive.
    I have 1TB external hard drive and I've been using for about a year and never dropped it or didn't do any thing to harm the hardware.
    Today as always I connected the ext-hard drive to my mac and click on the icon.
    All of my pictures and files are gone accept one folder that has program.
    So I pulled up the external hard drive's info it says the date is still there, but somehow i can not view them in the finder.
    I really need help how to fix this issue!

    you have a notebook, there is a different forum.
    redundancy for files AND backups, and even cloud services
    so a reboot with shift key and verify? Recovery mode
    but two or more drives.
    a backup, a new data drive, a drive for recovery using Data Rescue III
    A drive can fail and usually not if, only when
    and is it bus powered or not

  • Help with removing event from calendar

    Hello everyone I'm adding a simple feature in my xcode ios app that has a UISwitch. When the UISwitch is on an event is created (this part works fine). But when I turn the UISwitch off I cannot find a way to remove the event. If I use code in the second if statement to remove the event, the event identifier is undeclared because it is in a separate if statement. Can someone please tell me what code I need to remove the event.
    Code:
    - (IBAction)switchon:(id)sender {
        if (switchoutlet.on) {
            EKEventStore *store = [[EKEventStore alloc] init];
            [store requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error) {
                if (!granted) { return; }
                EKEvent *event = [EKEvent eventWithEventStore:store];
                event.title = @"Event A";
                event.startDate = [NSDate dateWithTimeIntervalSince1970:1406948400]; //today
                event.endDate = [event.startDate dateByAddingTimeInterval:60*60];  //set 1 hour meeting
                EKAlarm *alarm = [EKAlarm alarmWithRelativeOffset:-60*10];
                event.alarms = [NSArray arrayWithObject:alarm];
                [event setCalendar:[store defaultCalendarForNewEvents]];
                NSError *err = nil;
                [store saveEvent:event span:EKSpanThisEvent commit:YES error:&err];
                NSString *savedEventId = event.eventIdentifier;  //this is so you can access this event later
        if (!switchoutlet.on) {
            //remove event

    Ben Pleysier wrote:
    Be patient!
    For about 7 years!!!!!!!!!!!
    Once something is on the Internet, it remains so.  That is why people (mainly children) are always advised not to post anything that they may come to regret in a few years time when you are looking for jobs and your potential employer does a background search on you.

  • I need help with a migration from Exchange 2010 to 2007

    Hi All,
    I need help migrating mailboxes from a separate forest / domain using exchange 2010 to our Exchange 2007 SP3 servers..  I am following this procedure:
    1. On source server, create a mailbox user, test01.
    2. On target server, run the following command to move the AD account:
    Prepare-MoveRequest.Ps1 -Identity [email protected] -RemoteForestDomainController FQDN.source.com -RemoteForestCredential $Remote -LocalForestDomainController FQDN.target.com -LocalForestCredential $Local -UseLocalObject -Verbose"
    3. Run the ADMT to migrate the password and SID history.
    4. Run the following command to move the mailbox:
    New-MoveRequest -Identity '[email protected]' -RemoteLegacy -RemoteTargetDatabase DB03 -RemoteGlobalCatalog 'GC01.humongousinsurance.com' -RemoteCredential $Cred -TargetDeliveryDomain 'mail.contoso.com'
    (Changed all the details obviously)
    It gets to 95% and shows this error
    01/12/2014 12:47:24 [EX2K10] Fatal error UpdateMovedMailboxPermanentException has occurred.
    Error details: An error occurred while updating a user object after the move operation. --> Active Directory operation failed on DC.DC.COM . This error is not retriable. Additional information: The parameter is incorrect.
    Active directory response: 00000057: LdapErr: DSID-0C090A85, comment: Error in attribute conversion operation, data 0, vece --> The requested attribute does not exist.
       at Microsoft.Exchange.MailboxReplicationService.LocalMailbox.Microsoft.Exchange.MailboxReplicationService.IMailbox.UpdateMovedMailbox(UpdateMovedMailboxOperation op, ADUser remoteRecipientData, String domainController, ReportEntry[]& entries,
    Guid newDatabaseGuid, Guid newArchiveDatabaseGuid, String archiveDomain, ArchiveStatusFlags archiveStatus)
       at Microsoft.Exchange.MailboxReplicationService.MailboxWrapper.<>c__DisplayClass3c.<Microsoft.Exchange.MailboxReplicationService.IMailbox.UpdateMovedMailbox>b__3b()
       at Microsoft.Exchange.MailboxReplicationService.ExecutionContext.Execute(GenericCallDelegate operation)
       at Microsoft.Exchange.MailboxReplicationService.MailboxWrapper.Microsoft.Exchange.MailboxReplicationService.IMailbox.UpdateMovedMailbox(UpdateMovedMailboxOperation op, ADUser remoteRecipientData, String domainController, ReportEntry[]& entries,
    Guid newDatabaseGuid, Guid newArchiveDatabaseGuid, String archiveDomain, ArchiveStatusFlags archiveStatus)
       at Microsoft.Exchange.MailboxReplicationService.RemoteMoveJob.UpdateMovedMailbox()
       at Microsoft.Exchange.MailboxReplicationService.MoveBaseJob.UpdateAD(Object[] wiParams)
       at Microsoft.Exchange.MailboxReplicationService.CommonUtils.CatchKnownExceptions(GenericCallDelegate del, FailureDelegate failureDelegate)
    Error context: --------
    Operation: IMailbox.UpdateMovedMailbox
    OperationSide: Target
    Primary (b5373e49-6a06-41f4-990e-27807c7a57f3)
    01/12/2014 12:47:24 [EX2K10] Relinquishing job.
    Any ideas what i can do about this? 

    Hi,
    From your description, I recommend you follow the steps below for troubleshooting:
    Open the problematic user in AD and check the Email Address. Verify if you can open or edit the x400 address. If no, remove the x400 address and recreate it. If yes, ensure that the name is spelt correctly. After that, continue to move the mailbox and check
    the result.
    Hope this can be helpful to you.
    Best regards,
    Amy Wang
    TechNet Community Support

  • Need help with saving item from combobox to textfile

    Hi all. right now my codes can only save one stock information in the textfile but when I tried to save another stock in the textfile , it overrides the pervious one.
    So I was wondering which part of my codes should be changed??
    DO the following
    Create a fypgui class and put this bunch of codes inside
    import java.awt.GridLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.KeyEvent;
    import java.awt.event.KeyListener;
    import java.io.BufferedInputStream;
    import java.io.BufferedReader;
    import java.io.DataInputStream;
    import java.io.File;
    import java.io.FileReader;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.io.InputStream;
    import java.net.URL;
    import java.util.ArrayList;
    import java.util.Scanner;
    import javax.swing.JButton;
    import javax.swing.JComboBox;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JTabbedPane;
    import javax.swing.JTable;
    public class fypgui {
         private ArrayList<Stock> stockList = new ArrayList<Stock>();
         private String[] stockArray;
         private JComboBox choice1;
         private JTabbedPane tabbedPane = new JTabbedPane();
         private JPanel displayPanel = new JPanel(new GridLayout(5, 1));
         private JButton saveBtn = new JButton("Save");
         private JPanel choicePanel = new JPanel();
         String yahootext;
         String     symbol;
         int index;
         public fypgui() {
              try {
                   //read from text file for stockname
                   File myFile = new File("D:/fyp/savedtext2.txt");
                   FileReader reader = new FileReader(myFile);
                   BufferedReader bufferedReader = new BufferedReader(reader);
                   String line = bufferedReader.readLine();
                   while (line != null) {
                        Stock stock = new Stock();
                        // use delimiter to get name and symbol
                        Scanner scan = new Scanner(line);
                        scan.useDelimiter(",");
                        String name = "";
                        String symbol = "";
                        while (scan.hasNext()) {
                             name += scan.next();
                             symbol += scan.next();
                        stock.setStockName(name);
                        stock.setSymbol(symbol);
                        stockList.add(stock);
                        line = bufferedReader.readLine();
                   //size of the array(stockarray) will be the same as the arraylist(stocklist)
                   stockArray = new String[stockList.size()];
                   for (int i = 0; i < stockList.size(); i++) {
                        stockArray[i] = stockList.get(i).getStockName();
                   //create new combobox
                   choice1 = new JComboBox(stockArray);
                   //For typing stock symbol manually
                   choice1.setEditable(true);
                   //set the combobox as blank
                   choice1.setSelectedIndex(-1);
              } catch (IOException ex) {
                   ex.printStackTrace();
              JFrame frame1 = new JFrame("Stock Ticker");
              frame1.setBounds(200, 200, 300, 300);
              JPanel panel1 = new JPanel();
              panel1.add(choice1);
              choice1.setBounds(20, 35, 260, 20);
              JPanel panel2 = new JPanel();
              JPanel panel5 = new JPanel();
              panel5.add(saveBtn);
              displayPanel.add(panel1);
              displayPanel.add(panel5);
              tabbedPane.addTab("Choice", displayPanel);
              tabbedPane.addTab("Display", choicePanel);
              JLabel label2 = new JLabel("Still in Progress!");
              choicePanel.add(label2);
              frame1.add(tabbedPane);
              frame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame1.setVisible(true);
              saveBtn.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        // initalize index as the postion of the stock in the combo box
                        index = choice1.getSelectedIndex();
                        /*if the postion of the combobox is not blank,
                             it will get the StockName and symbol according to the
                             position and download the stock*/
                        if(index != -1){
                             symbol = stockList.get(index).getSymbol();
                             save(symbol);
         @SuppressWarnings("deprecation")
         public void save(String symbol){
              try {
                   String part1 = "http://download.finance.yahoo.com/d/quotes.csv?s=";
                   String part2 = symbol;
                   String part3 = "&f=sl1d1t1c1ohgv&e=.csv";
                   String urlToDownload = part1+part2+part3;
                   URL url = new URL(urlToDownload);
                   //read contents of a website
                   InputStream fromthewebsite = url.openStream(); // throws an IOException
                   //input the data from the website and read the data from the website
                   DataInputStream yahoodata = new DataInputStream(new BufferedInputStream(fromthewebsite));
                   // while there is some contents from the website to read then it will print out the data.
                   while ((yahootext = yahoodata.readLine()) != null) {
                        File newsavefile = new File("D:/fyp/savedtext.txt");
                        try {
                             FileWriter writetosavefile = new FileWriter(newsavefile);
                             writetosavefile.write(yahootext);
                             System.out.println(yahootext);
                             writetosavefile.close();
                        } catch (IOException e) {
                             e.printStackTrace();
              } catch (IOException e) {
                   e.printStackTrace();
         public static void main(String[] args) {
              // TODO code application logic here
              new fypgui();
    Create a Stock class a put this bunch of codes inside
    public class Stock {
         String stockName ="";
         String symbol="";
         double lastDone=0.0;
         double change =0.0;
         int volume=0;
         public String getStockName() {
              return stockName;
         public void setStockName(String stockName) {
              this.stockName = stockName;
         public String getSymbol() {
              return symbol;
         public void setSymbol(String symbol) {
              this.symbol = symbol;
         public double getLastDone() {
              return lastDone;
         public void setLastDone(double lastDone) {
              this.lastDone = lastDone;
         public double getChange() {
              return change;
         public void setChange(double change) {
              this.change = change;
         public int getVolume() {
              return volume;
         public void setVolume(int volume) {
              this.volume = volume;
    Create a folder called fyp in D drive and create two txt file in it.
    -savedtext.txt
    -savedtext2.txt
    in the saved savedtext2.txt add
    A ,AXP
    B ,B58.SI
    C ,CLQ10.NYM
    this is my whole application. if you guys can tell me what can I do to make sure that the stock info doesn't overrides . I will more than thankful.
    Edited by: javarookie123 on Jul 9, 2010 9:49 PM

    javarookie123 wrote:
    Hi all. right now my codes can only save one stock information in the textfile but when I tried to save another stock in the textfile , it overrides.. 'over writes'
    ..the pervious one.
    So I was wondering which part of my codes should be changed??Did not look at the code closely, but I am guessing the problem lies in the instantiation of the FileWriter. Try [this constructor|http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/java/io/FileWriter.html#FileWriter(java.io.File,%20boolean)] (<- link). The documentation is a wonderful thing. ;-)
    And generally on the subject of getting help:
    - There is no need for two question marks. One '?' means a question, while 2 or more typically means a dweeb.
    - Do your best to [write well|http://catb.org/esr/faqs/smart-questions.html#writewell] (<- link). Each sentence should start with an upper case letter. Not just the first one.
    Also, when posting code, code snippets, XML/HTML or input/output, please use the code tags. The code tags protect the indentation and formatting of the sample. To use the code tags, select the sample and click the CODE button.

  • Need help with Kerb. jdbc from Linux to MS SQL 2008

    Hello Forum, I am getting an erro when I try to use Kerb. trusted security to connect to sql server.
    4.0 documentation reflects it's absolutely possible.
    Not only that, I have ms odbc installed on the same box and it provides Kerbers (not ntlm) connection to sql server. But java with jdbc reject doing it.
    Here is the message:
    com.microsoft.sqlserver.jdbc.SQLServerException: Integrated authentication failed. ClientConnectionId:5836ac6c-6d2e-42e4-8c6d-8b89bc0be5c9
            at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1667)
            at com.microsoft.sqlserver.jdbc.KerbAuthentication.intAuthInit(KerbAuthentication.java:140)
            at com.microsoft.sqlserver.jdbc.KerbAuthentication.GenerateClientContext(KerbAuthentication.java:268)
            at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:2691)
            at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:2234)
            at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$000(SQLServerConnection.java:41)
            at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:2220)
            at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696)
            at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715)
            at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1326)
            at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:991)
            at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:827)
            at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1012)
            at java.sql.DriverManager.getConnection(DriverManager.java:419)
            at java.sql.DriverManager.getConnection(DriverManager.java:367)
            at connectURL.main(connectURL.java:53)
    Caused by: javax.security.auth.login.LoginException: unable to find LoginModule class: com.sun.security.auth.module.Krb5LoginModule
            at javax.security.auth.login.LoginContext.invoke(LoginContext.java:834)
            at javax.security.auth.login.LoginContext.access$000(LoginContext.java:209)
            at javax.security.auth.login.LoginContext$4.run(LoginContext.java:709)
            at java.security.AccessController.doPrivileged(AccessController.java:327)
            at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:706)
            at javax.security.auth.login.LoginContext.login(LoginContext.java:603)
            at com.microsoft.sqlserver.jdbc.KerbAuthentication.intAuthInit(KerbAuthentication.java:133)
    1] Client side:
    Which OS platform are you running on? (Linux)
    Which JVM are you running on? (IBM J9 VM (build 2.6, JRE 1.6.0 Linux amd64-64
    What is the connection URL in you app? (jdbc:sqlserver://abcde24243.somebank.COM:15001;databaseName=master;integratedSecurity=true;authenticationScheme=JavaKerberos)
    If client fails to connect, what is the client error messages? (see above)
    Is the client remote or local to the SQL server machine? [Remote | Local]
    Is your client computer in the same domain as the Server computer? (Same domain | Different domains | WorkGroup)
    [2] Server side:
    What is the MS SQL version? [ SQL Sever 2008]
    Does the server start successfully? [YES ] If not what is the error messages in the SQL server ERRORLOG?
    If SQL Server is a named instance, is the SQL browser enabled? [NO]
    What is the account that the SQL Server is running under?[Domain Account]
    Do you make firewall exception for your SQL server TCP port if you want connect remotely through TCP provider? [YES ]
    Do you make firewall exception for SQL Browser UDP port 1434? In SQL2000, you still need to make firewall exception for UDP port 1434 in order to support named instance.[YES | NO | not applicable ]
    I currently can login from client using ms odbc sqlcmd (linux) version with trusted Kerberos connection.
    which tells me there is no problem with firewall.
    Tips:
    If you are executing a complex statement query or stored procedure, please use execute() instead of executeQuery().
    If you are using JDBC transactions, do not mix them with T-SQL transactions.
    Last but not least:
    gene

    Saeed,
    Not being versed in JAVA, I'm not sure what you're telling me. Can you tell me if this looks good? BTW, I did find out that JDBC is installed on the server as part of Coldfusion and this is what I was told:
    macromedia.jdbc.oracle.OracleDriver is 3.50
    macromedia.jdbc.db2.DB2Driver is 3.50
    macromedia.jdbc.informix.InformixDriver is 3.50
    macromedia.jdbc.sequelink.SequeLinkDriver is 5.4
    macromedia.jdbc.sqlserver.SQLServerDriver is 3.50
    macromedia.jdbc.sybase.SybaseDriver is 3.50
    Below is what I think will work, but I know it won't because of the semi colons. Can you help me fix it?
    I've the things that I think need changing are in bold.
    Thanks!
    ======
    private void dbInit()
    dbUrl = "jdbc:odbc:DRIVER={SQL Server};Database="DATADEV";Server=VS032.INTERNAL.COM:3533;", "web_user";
    try
    Class.forName("macromedia.jdbc.sqlserver.SQLServerDriver ");
    catch(Exception eDriver)
    failedDialog("Driver failed!", eDriver.getMessage());
    private void dbOpen()
    if(paramServerIP.indexOf("datadev") >= 0)
    dbPswd = "password";
    else
    dbPswd = "password";
    try
    dbCon = DriverManager.getConnection(dbUrl, paramDbUserStr,
    dbPswd);
    dbStmt = dbCon.createStatement();
    dbStmt.setEscapeProcessing(true);
    catch(Exception eDbOpen)
    failedDialog("Failed to open db connection!",
    eDbOpen.getMessage());
    private void dbClose()
    try
    dbStmt.close();
    dbCon.close();
    catch(Exception eDbClose)
    failedDialog("Failed to close db connection!",
    eDbClose.getMessage());
    }

  • I need help with a lab from programming.

    I need the following tasks implemented in the code I wrote below. I would really appreciate if someone could achieve this because it would help me understand the coding process for the next code I have to write. Below are the four classes of code I have so far.
    save an array of social security numbers to a file
    read this file and display the social security numbers saved
    The JFileChooser class must be used to let the user select files for the storage and retrieval of the data.
    Make sure the code handles user input and I/O exceptions properly. This includes a requirement that the main() routine does not throw any checked exceptions.
    As a part of the code testing routine, design and invoke a method that compares the data saved to a file with the data retrieved from the same file. The method should return a boolean value indicating whether the data stored and retrieved are the same or not.
    * SSNArray.java
    * Created on February 28, 2008, 9:45 AM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package exceptionhandling;
    import java.util.InputMismatchException; // program uses class InputMismatchException
    import org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName;
    * @author mer81348
    public class SSNArray
        public static int SOCIAL_SECURITY_NUMBERS = 10;
        private String[] socialArray = new String[SOCIAL_SECURITY_NUMBERS];
        private int socialCount = 0;
        /** Creates a new instance of SSNArray */
        public SSNArray ()
        public SSNArray ( String[] ssnArray, int socialNumber )
            socialArray = ssnArray;
            socialCount = socialNumber;
        public int getSocialCount ()
            return socialCount;
        public String[] getSocialArray ()
            return socialArray;
        public void addSocial ( String index )
            socialArray[socialCount] = index;
            socialCount++;
        public String toString ()
            StringBuilder socialString = new StringBuilder ();
            for ( int stringValue = 0; stringValue < socialCount; stringValue++ )
                socialString.append ( String.format ("%6d%32s\n", stringValue, socialArray[stringValue] ) );
            return socialString.toString ();
        public void validateSSN ( String socialInput ) throws InputMismatchException, DuplicateName
            if (socialInput.matches ("\\d{9}"))
                return;
            else
                throw new InputMismatchException ("ERROR! Incorrect data format");       
    * SSNArrayTest.java
    * Created on February 28, 2008, 9:46 AM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package exceptionhandling;
    import java.util.InputMismatchException; // program uses class InputMismatchException
    import java.util.Scanner; // program uses class Scanner
    import org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName;
    * @author mer81348
    public class SSNArrayTest
        /** Creates a new instance of SSNArrayTest */
        public SSNArrayTest ()
         * @param args the command line arguments
        public static void main (String[] args)
            // create Scanner to obtain input from command window
            Scanner input = new Scanner ( System.in );
            System.out.printf ( "\nWELCOME TO SOCIAL SECURITY NUMBER CONFIRMER\n" );
            SSNArray arrayStorage = new SSNArray ();
            for( int socialNumber = 0; socialNumber < SSNArray.SOCIAL_SECURITY_NUMBERS; )
                String socialString = ( "\nPlease enter a Social Security Number" );
                System.out.println (socialString);
                String socialInput = input.next ();
                try
                    arrayStorage.validateSSN (socialInput);
                    arrayStorage.addSocial (socialInput);
                    socialNumber++;
                catch (InputMismatchException e)
                    System.out.println ( "\nPlease reenter Social Security Number\n" + e.getMessage() );
                catch (DuplicateName e)
            System.out.printf ("\nHere are all your Social Security Numbers stored in our database:\n");
            System.out.printf ( "\n%8s%32s\n", "Database Index", "Social Security Numbers" );
            System.out.println (arrayStorage);
    * SSNArrayExpanded.java
    * Created on February 28, 2008, 9:52 AM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package exceptionhandling;
    import java.util.InputMismatchException;
    import org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName;
    * @author mer81348
    public class SSNArrayExpanded extends SSNArray
        /** Creates a new instance of SSNArrayExpanded */
        public SSNArrayExpanded ()
        public SSNArrayExpanded ( String[] ssnArray, int socialNumber )
            super ( ssnArray, socialNumber );
        public void validateSSN ( String socialInput ) throws InputMismatchException, DuplicateName
            super.validateSSN (socialInput);
                int storedSocial = getSocialCount ();
                for (int socialMatch = 0; socialMatch < storedSocial; socialMatch++ )
                    if (socialInput.equals (getSocialArray () [socialMatch]))
                        throw new DuplicateName ();
            return;
    * SSNArrayTestExpanded.java
    * Created on February 28, 2008, 9:53 AM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package exceptionhandling;
    import java.util.InputMismatchException; // program uses class InputMismatchException
    import java.util.Scanner; // program uses class Scanner
    import org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName;
    * @author mer81348
    public class SSNArrayTestExpanded
        /** Creates a new instance of SSNArrayTest */
        public SSNArrayTestExpanded ()
         * @param args the command line arguments
        public static void main (String[] args)
            // create Scanner to obtain input from command window
            Scanner input = new Scanner ( System.in );
            System.out.printf ( "\nWELCOME TO SOCIAL SECURITY NUMBER CONFIRMER\n" );
            SSNArrayExpanded arrayStorage = new SSNArrayExpanded(); 
            for( int socialNumber = 0; socialNumber < SSNArray.SOCIAL_SECURITY_NUMBERS; )
                String socialString = ( "\nPlease enter a Social Security Number" );
                System.out.println (socialString);
                String socialInput = input.next ();
                try
                    arrayStorage.validateSSN (socialInput);
                    arrayStorage.addSocial (socialInput);
                    socialNumber++;
                catch (InputMismatchException e)
                catch (DuplicateName e)
                    System.out.println ( "\nSocial Security Number is already claimed!\n" + "ERROR: " + e.getMessage() ); 
            System.out.printf ("\nHere are all your Social Security Numbers stored in our database:\n");
            System.out.printf ( "\n%8s%32s\n", "Database Index", "Social Security Numbers" );
            System.out.println (arrayStorage);
    }

    cotton.m wrote:
    >
    That writes creates the file but it doesn't store the social security numbers.True.Thanks for confirming that...
    How do I get it to save?
    Also, in the last post I had the write method commented out, the correct code is:
         System.out.printf ("\nHere are all your Social Security Numbers stored in our database:\n");
            System.out.printf ( "\n%8s%32s\n", "Database Index", "Social Security Numbers" );
            System.out.println ( arrayStorage );
            try
                File file = new File ("Social Security Numbers.java");
                // Create file if it does not exist
                boolean success = file.createNewFile ();
                if (success)
                      PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("Social Security Numbers.txt")));               
    //                BufferedWriter out = new BufferedWriter (new FileWriter ("Social Security Numbers.txt")); 
                    out.write( "what goes here ?" );
                    out.close ();
                    // File did not exist and was created
                else
                    // File already exists
            catch (IOException e)
            System.exit (0);
    }It still doesn't write.

  • Need help with generating keys from xml

    Hello,
    I am just learning about JCE and am haveing some problems with implementing a basic program.
    I have the following information:
    <RSAKeyValue>
    <Modulus>Base64EncodedString</Modulus>
    <Exponent>Base64EncodedString</Exponent>
    <P>Base64EncodedString</P>
    <Q>Base64EncodedString</Q>
    <DP>Base64EncodedString</DP>
    <DQ>Base64EncodedString</DQ>
    <InverseQ>Base64EncodedString</InverseQ>
    <D>Base64EncodedString</D>
    </RSAKeyValue>
    From which I need to construct a public and private key. I am using RSA algorithm for the encrypting and decrypting. I am using the org.bouncycastle.jce.provider.BouncyCastleProvider provider. Any help would be greatly appreciated.
    My questions are:
    1) Is it possible to create the public and private key from this data?
    2) How can I construct a public and private key from this data.
    Thank you in advance.
    Sunit.

    Thanks for your help...I am still having problems.
    I am now creating the public and private keys. I am generating the public exp, modulus, private exp, and the encrypted text from another source.
    so my questions are:
    1) How do I verfiy that the private and public keys that I generate are valid?
    2) How do I get the decrypted text back in a readable form?
    3) the decrypted text should read "ADAM"
    Here is a test I wrote:
    _________________STARTCODE_____________________
    import java.security.*;
    import java.security.spec.*;
    import javax.crypto.*;
    import javax.crypto.spec.*;
    import java.math.BigInteger;
    import org.bouncycastle.jce.provider.BouncyCastleProvider;
    public class CryptTester
         protected Cipher encryptCipher = null;
         protected Cipher decryptCipher = null;
         private KeyFactory keyFactory = null;
         protected PublicKey publicKey = null;
         protected PrivateKey privateKey = null;
         private RSAPublicKeySpec publicKeySpec = null;
         private RSAPrivateKeySpec privateKeySpec = null;
         public CryptTester()
              /* Create Cipher for asymmetric encryption (
              * e.g., RSA),
              try
                   encryptCipher = Cipher.getInstance("RSA", "BC");
                   System.out.println("Successfully got encrypt Cipher" );
                   decryptCipher = Cipher.getInstance("RSA", "BC");
                   System.out.println("Successfully got decrypt Cipher" );
                   keyFactory = KeyFactory.getInstance("RSA" , "BC");
                   System.out.println("Successfully got keyFactory" );
              }catch ( NoSuchAlgorithmException nsae)
                   System.out.println("Exception1: " + nsae.toString() );
              catch ( NoSuchPaddingException nspe)
                   System.out.println("Exception2: " + nspe.toString() );
              catch ( java.security.NoSuchProviderException nspe)
                   System.out.println("Exceptiont6: " + nspe.toString() );
              /* Get the private and public keys specs
              BigInteger publicMod = new BigInteger ("86e0ff4b9e95bc6dcbfd6673b33971d4f728218496adcad92021923a9be815ddb7ecf17c06f437634c62fa999a293da90d964172a21d8ce74bd33938994fbd93377f7d83ce93d523782639c75221a3c91b53927a081b2b089a61770c6d112d78d5da8a6abc452d39a276787892080d6cf17dd09537c1ec5551d89567345068ef", 16);
              BigInteger publicExp = new BigInteger ("5");
              BigInteger privateExp = new BigInteger ("50ed65fa2bf3710ead980a456b88dde62de4e0e9", 16);
              publicKeySpec = new java.security.spec.RSAPublicKeySpec( publicMod, publicExp );
              privateKeySpec = new java.security.spec.RSAPrivateKeySpec( publicMod, privateExp);
              try
                   privateKey = keyFactory.generatePrivate(privateKeySpec);
                   publicKey = keyFactory.generatePublic(publicKeySpec);
              }catch ( InvalidKeySpecException ivse)
                   System.out.println("Exception3: " + ivse.toString() );
              try
              * initialize it for encryption with
              * recipient's public key
                   encryptCipher.init(Cipher.ENCRYPT_MODE, publicKey );
                   decryptCipher.init(Cipher.DECRYPT_MODE, privateKey );
         }catch ( InvalidKeyException ivse)
                   System.out.println("Exception4: " + ivse.toString() );
         public String getPublicKey()
              //return new String(publicKey.getEncoded());
              return publicKey.toString();
         public String getPrivateKey()
         //          return new String(privateKey.getEncoded());
              return privateKey.toString();
         public String encryptIt(String toencrypt)
              * Encrypt the message
              try
                   byte [] result = null;
                   try
                        result = encryptCipher.doFinal(toencrypt.getBytes());
                   catch ( IllegalStateException ise )
                        System.out.println("Exception5: " + ise.toString() );
                   return new String(result);
              }catch (Exception e)
                   e.printStackTrace();
              return "did not work";
         public String decryptIt(String todecrypt)
                        * decrypt the message
              try
                   byte [] result = null;
                   try
                        result = decryptCipher.doFinal(todecrypt.getBytes());
                   catch ( IllegalStateException ise )
                        System.out.println("Exception6: " + ise.toString() );
                   return new String(result);
              }catch (Exception e )
                   e.printStackTrace() ;
              return "did not work";
         public static void main(String[] args)
              try
              Security.addProvider(new BouncyCastleProvider());
              CryptTester tester = new CryptTester();
              String encrypted = "307203c3f5827266f5e11af2958271c4";
              System.out.println("Decoding string " + encrypted + "returns : " + tester.decryptIt(encoded) );
              } catch (Exception e)
                   e.printStackTrace();
    _________________ENDPROGRAM_____________________

  • Need help with custom column in BI Publisher

    Hi Guru's
    I have started working with BI Publisher Recently and need with below issue
    Can you please let me know how can i create a custom column like % based on two existing measures in the report
    I tried creating it in obiee report and used that SQL to create BI Publisher Report , but the result column in obiee is not working as expected in BI Publisher,
    can some one please help me with this
    Thanks a lot in advance.

    This column can be calculated in BIP RTF template. But if it is a column inside a FOR-loop
    then it may need to be calculated slightly different.
    Like I said, get the xml data and rtf then send it to me : [email protected]
    and will get it fixed for you.
    thanks
    Jorge

Maybe you are looking for

  • JSP tags; html formatting problem

    Hi, I've implemented a jsp custom action which supports several enclosed tags in like this: <%@ taglib ..... prefix="myprefix" %> <myprefix:myTag ... > <myprefix:myNestedTag ... /> <myprefix:myNestedTag ... /> </myprefix:myTag> I have three classes t

  • Is there any way to set "Scale stroke"

    does the document have a property that can be set to true or false for scale stroke? I didn't see it in the documentation, maybe there is another way?

  • What app can I use to upload pdf documents that cane read in ibooks?

    Previously, with MobileMe, I have uploaded pdf files to iDisk and then opened them in iBooks on my iPad2.  Worked great.  Moving to iCloud, I can no longer upload to iDisk and must use (?) Pages, which will not open a pdf or allow me to move it to iB

  • IPad has frozen screen, can't turn off?

    iPad has frozen screen, can't turn off? had multi-tasking gesture feature on and was trying to zoon out of a picture. Help!!  Thanks  : 0

  • IMac OSX error and restart

    Hi i jus bought an imac and have this error, like every 30 mins, what shoul i do? Anonymous UUID:       4C4E80EF-D728-6651-6459-93A7C729F249 Tue Nov 19 17:02:15 2013 panic(cpu 0 caller 0xffffff801b2dc19e): Kernel trap at 0xffffff7f9c9a4787, type 14=p