Please Help me!!! HTML code

Hi everybody,
I need to extract a value of an Html tag from an Html page, I mean:
<select name="Test" multiple>
<option value="1">AA</option>
<option value="2">BB</option>
<option value="3">CC</option>
</select>
My question is:
How can I read the values "1" - "2" - "3" from the html page if in the
page there are many "select" html tag?
Thanks a lot in advance!!!

<select name="Test" multiple> <select name="Test" id="multiple">
<option value="1">AA</option>
<option value="2">BB</option>
<option value="3">CC</option>
</select>But how do you want to read (JavaScript, Perl, etc)?

Similar Messages

  • PLEASE Help with HTML code for email background image...

    Hi there!
    i have a background image that I want to pop into an html email widget for the email's background...  here is the web link I created in Photoshop: file:///C:/Users/Rachel/Desktop/iMuse%20Clients/LeadMachine360/Email%20Signatures/tileabl e-metal-textures-2.html
    If anyone could please help me out that would be AWESOME!  I've attached pics of the background & I'm using Infusionsoft email builder which allows for HTML widgets.  I have a code that I use for my landing pages & webforms which works, tried that but no dice!
    Any help would be much appreciated - I'm an html newbie!
    Here is the code that I use for landing pages & works great, tried it for the email & it was a fail:
    <style>
      #mainContent .background, {
          background: url('file:///C:/Users/Rachel/Desktop/iMuse%20Clients/LeadMachine360/Email%20Signatures/ti leable-metal-textures-2.html') no-repeat center center fixed;
        background-size: cover;
    </style>
    <script src="file:///C:/Users/Rachel/Desktop/iMuse%20Clients/LeadMachine360/Email%20Signatures/ti leable-metal-textures-2.html">
    </script>
    <script>
      jQuery(document).ready(
          function(){
          jQuery(' table.bodyContainer').removeAttr('bgcolor');
    </script>
    thanks in advance!
    Muse

    Not sure what you expect. Your URL is absolute and pointing to a local file resource. It's not a proper relative HTML link. Beyond that it's toatlly unclear how you actually plan to load your image and where they are hosted, so nobody can tell you anything. Either way, there is an obviously painful lack of understanding of even the most basic web techniques, so the best advise anyone would give you is to spend some time with a web search and actualyl learn some of that stuff...
    Mylenium

  • Please help 'Translate' These codes from AS2 to AS3 for me

    Hi, i need help 'translating' these codes from Action Script 2 to Action Script 3. Please Do it for me:
    toc    loadText = new LoadVars();
        loadText.load("Curie.txt");
        loadText.onLoad = function(success) {
            if (success) {
                // trace(success);
                Curie.html = true;
                Curie.htmlText = this.Curie;
    Please translate it for me, i need it ASAP thanks
    Kenneth

    Thank you for helping me
    Kenneth
    Date: Thu, 15 Oct 2009 05:49:14 -0600
    From: [email protected]
    To: [email protected]
    Subject: Please help 'Translate' These codes from AS2 to AS3 for me
    Take a look at that:
    http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/migration.html
    There is a LoadVars section on that.
    There is also a tutorial here:
    http://www.republicofcode.com/tutorials/flash/as3externaltext/
    Cheers,
    CaioToOn!
    >

  • Please help in this code..

    Hi,
    I am developing one small program. Which has one inner class in parent class. I am using object [] array of that inner class. like thisPreferredRoomsItem maxPercentagePrefRooms[] = new PreferredRoomsItem[solutionOfTimeTable.MAX_ACTIVITIES];  
            for (int j = 0; j < solutionOfTimeTable.nInternalActivities; j++) {           
                maxPercentagePrefRooms[j].percentage=-1.0;
                maxPercentagePrefRooms[j].prefferedRooms.clear(); // test it.                                  
                double maxPercentage = -1;
                double minNRooms = INF;        
                for(PreferredRoomsItem it:activitiesPreferredRoomsList){ // check this code. this is incorrect/.
                if(maxPercentage<it.percentage || (maxPercentage==it.percentage && minNRooms>it.prefferedRooms.size())){           
                    maxPercentage = it.percentage;              
                    minNRooms = it.prefferedRooms.size();
                    maxPercentagePrefRooms[j] = it;
                } In inner class PreferredRoomsItem it has two member variables. And then I am using iteration with for loop. When I am using this line-->maxPercentagePrefRooms[j]. it gives me nullpointerexception. Please help.
    It is urgent.
    Thanks in advance.

    You still need to instantiate the Object in each array index.
    for (int j = 0; j < solutionOfTimeTable.nInternalActivities; j++) {           
                 maxPercentagePrefRooms[j] = new PreferredRoomsItem();
                //...

  • Please help with this code....

    I create a button with ActionListner and a writeCd method. Now I want everytime i push the button, it will read the writeCd method. I dont' know how to make it work. Please help me out as soon as possible. Thanks a lot. Below are the codes of the button and writeCd method.
    class findCD implements ActionListener
    public void actionPerformed(ActionEvent event)
    //what do I need to put here to make the button work
    //with method writeCD() below
    public void writeCd() throws Exception
    String outputFileName;
    PrintWriter outputFile;
    outputFileName = "D:\\cdoutput.txt";
    outputFile = new PrintWriter(new FileWriter(outputFileName,true));
    int loopTest;
    do
    String numStr = JOptionPane.showInputDialog("Please enter Index number");
    int number = Integer.parseInt(numStr);
    cC.setIndexNumber(number);
    numStr = JOptionPane.showInputDialog("Please enter cd name");
    number = Integer.parseInt(numStr);
    cC.setCdName(number);
    String message = cC.toString() +
    "\nYour input is: ";
    JOptionPane.showMessageDialog(null, message);
    outputFile.println(numStr + "");
    loopTest = JOptionPane.showConfirmDialog(null,"Do another?","",0,1);
    while (loopTest == 0);
    outputFile.close();

    class findCD implements ActionListener
           public void actionPerformed(ActionEvent event)
                try
                     writeCd();
                } catch(Exception e){
                                        e.printStackTrace();
      public void writeCd() throws Exception
          String outputFileName;
          PrintWriter outputFile;
          outputFileName = "D:\\cdoutput.txt";
    outputFile = new PrintWriter(new
    (new FileWriter(outputFileName,true));
             int loopTest;
             do
    String numStr =
    umStr = JOptionPane.showInputDialog("Please enter
    Index number");
             int number = Integer.parseInt(numStr);
             cC.setIndexNumber(number);
    numStr = JOptionPane.showInputDialog("Please
    "Please enter cd name");
             number = Integer.parseInt(numStr);
             cC.setCdName(number);
             String message = cC.toString() +
                              "\nYour input is: ";
             JOptionPane.showMessageDialog(null, message);
            outputFile.println(numStr + "");
    loopTest =
    pTest = JOptionPane.showConfirmDialog(null,"Do
    another?","",0,1);
             while (loopTest == 0);
           outputFile.close();
        }That should work. This also assumes that the method writeCd is in the class findCD.

  • Please help me on code inspector

    We want to run the code inspector on standard SAP reports (say, RABAB0504). But when we run the code inspector, it gives the message "This is a SAP object that cannot be checked". Why can't we run the Code Inspector on this?
    If we copy the code of Code Inspector into a Z program and remove the checks for this standard programs, would it run successfully or would there be any complications in that?
    Please help me.

    Well, it doesn't make much sense it run it on an SAP object. What would you do if it found something? But, if you must try, why not try copying it yourself and see if it works?
    Oh yes - and welcome to SCN!
    Rob
    Edited by: Rob Burbank on May 11, 2009 2:37 PM

  • Help with html code - inserting video into Muse

    I am seeking help writing the code to insert a video into Muse. I uploaded video into my Business Catalyst hosting. I need it to autoplay, loop and not show any controls or frames.
    When I host video on Vimeo or YouTube, I see markings on the video that is why I am trying to just host in the same place that the files are stored for my website. If there is a way to host on youtube with out any markings showing up on the video I would be open to that too.
    I don't want to see any play button or time bar.
    Thanks in advance!!

    Hello,
    Just as an FYI - we also have an HTML5 video tool over at MuseThemes.com that achieves this, but works on mobile devices as well. The link above looks like it uses Flash, which isn't common anymore since the release of HTML5 based video.
    Simply drag the widget out onto your canvas, and link up your videos / set options like loop, controls visible, etc. It's quite a flexible widget, and there's a complete training video included so you don't get stuck
    Check out the widget here
    Just wanted to provide another alternative that could be helpful. Cheers!
    Steve Harris
    MuseThemes.com

  • Help with HTML code Please

    Hello,
    I am having some trouble with my HTML format. I am trying to
    have it so when I click on my thunbnail another picture shows up as
    a popup. you can see what I am trying to do at this link
    http://209.66.101.242/EZ-Templates/calendars.php
    Here is what my code looks like. If you are able to tell me
    what I have wrong I would appreciate it. Thanks in advance
    <DIV align=center><a
    onclick="return enlarge('
    http://www.brcphotography.com/holidaycards/pics/annual/CL02.jpg',event,'center',300,375)"
    href="pics/quarterly/CL08-3.jpg"><img
    src="pics/quarterly/CL08-3 thumb.gif" name="thumbnail"
    border="0" id="thumbnail"
    /></A></DIV></TD></TR>
    <TR>
    <TD>
    <DIV class=product_name
    align=center>CL08-3</DIV>

    Works fine for me in boty IE7 and FF. Did you fix it after
    posting?
    emichael brandt
    cdc3323 wrote:
    > Hello,
    >
    > I am having some trouble with my HTML format. I am
    trying to have it so when
    > I click on my thunbnail another picture shows up as a
    popup. you can see what
    > I am trying to do at this link
    http://209.66.101.242/EZ-Templates/calendars.php
    >
    > Here is what my code looks like. If you are able to tell
    me what I have wrong
    > I would appreciate it. Thanks in advance
    >
    > <DIV align=center><a
    > onclick="return
    > enlarge('
    http://www.brcphotography.com/holidaycards/pics/annual/CL02.jpg',event,
    > 'center',300,375)"
    > href="pics/quarterly/CL08-3.jpg"><img
    > src="pics/quarterly/CL08-3 thumb.gif"
    > name="thumbnail"
    > border="0" id="thumbnail"
    > /></A></DIV></TD></TR>
    > <TR>
    > <TD>
    > <DIV class=product_name
    > align=center>CL08-3</DIV>
    >
    >

  • Help with html code. not running properly once on server

    The video works fine in captivate and works once i publish it, but when I try to upload it onto the server it does not. This is my first time using captivate 4, and when I matched the codes from my old movies they were quite different. So I just messed with the code I had and made it lok like the old vodes and it runs fine on the server.
    I was wondering if anyone had any ideas on what is going on with the code that it does not work on the server?
    Thank you!!!!!
    -danielle

    Hello Sue. It's very easy actually.
    If you have the lastest update of Muse CC from Nov 2013, there is a FREE Muse Library by musegrid.com that you can download from the Adobe Muse Exchange page that does this specifically using Google Analytics.  Here is the direct link should you like to check it out: 
    http://muse.adobe.com/exchange-library/add-google-analytics
    Start by "Right Clicking" on the "Master Page Icon" in the "Plan View" and choose "Page Properties" from the list of menu options available. 
    This will open up the "Page Properties Dialog Box" for the entire site. Once that dialog box is open, paste your code into the "Metadata" tab section (I believe that tab is displayed at default - at least on the Mac it is - I'm pretty sure it's the same on the Windows platform).
    All anaytics embed code goes in the <head> tag of an html page (note: it actually says "HTML for <head>" at the top of the embed window area - making it helpful to know you're in the right area). This is also where you would add any <meta> tags too like facebook's OpenGraph code etc.
    If using more than one master, included it to all masters.  If just using it on a specific page - say like a landing page, just go to that particular page in your site's "Plan View" and paste it there instead.
    Incase i get too "wordy" i've attached screen shots of what these should look like. 
    Good luck Sue!
    And congratulations on a nice new computer too - its got "juice".

  • Problem in layout, please help in correcting code

    Hello Friends,
    I am facing a very strange problem. I have 1 DespktopPane, say DT in which I have created two InternalFrames, say IF1 and IF2. Also there are two JPanels, say P1 and P2. P1 contains various controls and IF1s ContentPane is set to P1 and P2 contains nothing. There two MenuItems, say M1 and M2. On M1s click I displayed IF1 and on M2s click I displayed IF2. Before adding IF2 everything is working fine, i.e. all the controls are able to display on IF1 but after adding IF2 allthe controls are transferred from IF1 to IF2 and now IF1 displays as a blank screen and IF2 contains allthe controls which are added in JPanel p2 whereas IF2s ContenPane is set to P2 and no control is added in P2.
    For your reference, here is the code:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class MDILayout extends JFrame implements ActionListener
        private static JFrame frame = null;
        private static JDesktopPane desktop = null;
        private static JInternalFrame intframe = null;
        private static JInternalFrame rangeframe = null;
        private static JPanel panel = null;
        private static Image img = null;
        private static JMenuBar menubar = null;
        private static JMenu mfile = null;
        private static JMenuItem bexit = null;
        private static JMenuItem borders = null;
        private static JMenuItem boption = null;
        JButton bcancel,bquery,bexecute,bupdate,bnext,bprev;
        JLabel lheader,lheader1,lheader2,lheader3,lline,lline1,
        lodate,lquality,ltype,lparty,lindent,lsize,lmul,lgsm,lquantity,ldest,lorderno;
        JTextField todate,tquality,ttype,tparty,tindent,tlength,twidth,tgsm,tquantity,tdest,torderno;
        JComboBox cbotype;
        Font bigfont,bigfont1;
        static String ltext="",ltext1="",ltext2="",ltext3="";
        Panel p; Graphics g;
        MDILayout()
            frame = new JFrame("Deckle Suite (Board)");
            desktop = new JDesktopPane();
            intframe = new JInternalFrame("Orders",true,true,true,true);          
            rangeframe = new JInternalFrame("Machine - Deckle Range",true,true,true,true);           
            frame.setSize(1024,738);
            frame.setResizable(false);
            intframe.setSize(1000,680);
            rangeframe.setSize(500,350);
            JPanel p1=(JPanel)getContentPane();
            p1.setLayout(null);
            JPanel p2=(JPanel)getContentPane();
            p2.setLayout(null);
            intframe.setContentPane(p1);
            rangeframe.setContentPane(p2);
            frame.setContentPane(desktop);
            desktop.add(intframe);
            desktop.add(rangeframe);
            intframe.setMaximizable(true);
            intframe.setResizable(false);
            rangeframe.setMaximizable(true);
            rangeframe.setResizable(false);
            intframe.setContentPane(p1);
            intframe.setDefaultCloseOperation(HIDE_ON_CLOSE);
            rangeframe.setContentPane(p2);
            rangeframe.setDefaultCloseOperation(HIDE_ON_CLOSE);
            menubar = new JMenuBar();
            mfile = new JMenu("File");
            bexit = new JMenuItem("Exit");
            borders = new JMenuItem("Orders");
            boption=new JMenuItem("Options");
            menubar.add(mfile);
            mfile.add(borders);
            mfile.add(boption);
            mfile.add(bexit);
            frame.setJMenuBar(menubar);
            ltext="==========";
            for(int i=0;i<6;i++)
                    ltext1=ltext+ltext1;
                    ltext=ltext1;
            ltext2="----------";
            for(int j=0;j<6;j++)
                    ltext3=ltext2+ltext3;
                    ltext2=ltext3;
            bigfont=new Font("Monotype Corsiva",Font.BOLD,35);
            bigfont1=new Font("Times New Roman",Font.PLAIN,20);
            lheader=new JLabel("Deckle Suite (Board)");
            lheader1=new JLabel("Khanna  Paper  Mill (Pvt.) Ltd.");
            lheader2=new JLabel("Fatehgarh Road");
            lheader3=new JLabel("Amritsar");
            lline=new JLabel(ltext1);
            lline1=new JLabel(ltext3);
            lodate=new JLabel("Order Date");
            lquality=new JLabel("Quality");
            ltype=new JLabel("Sheet/Reel");
            lparty=new JLabel("Party");
            lindent=new JLabel("Indent No.");
            lsize=new JLabel("Size");
            lmul=new JLabel("x");
            lgsm=new JLabel("GSM");
            lquantity=new JLabel("Quantity");
            ldest=new JLabel("Destination");
            lorderno=new JLabel("Line No.");
            todate=new JTextField(50);
            tquality=new JTextField(50);
            ttype=new JTextField(20);
            cbotype=new JComboBox();
            tparty=new JTextField(200);
            tindent=new JTextField(50);
            tlength=new JTextField(35);
            twidth=new JTextField(35);
            tgsm=new JTextField(20);
            tquantity=new JTextField(35);
            tdest=new JTextField(200);
            torderno=new JTextField(200);
            lheader.setBounds(350,50,500,50);
            lheader1.setBounds(370,100,500,30);
            lheader2.setBounds(430,130,200,30);
            lheader3.setBounds(460,160,200,30);
            lline.setBounds(0,200,3000,30);
            lline1.setBounds(0,350,3000,30);
            lorderno.setBounds(40,240,100,20);
            lodate.setBounds(40,270,100,20);
            lquality.setBounds(320,270,100,20);
            ltype.setBounds(40,400,70,20);
            lparty.setBounds(40,300,70,20);
            lindent.setBounds(40,430,100,20);
            lsize.setBounds(450,430,50,20);
            lmul.setBounds(560,430,50,20);
            lgsm.setBounds(40,460,50,20);
            lquantity.setBounds(320,460,50,20);
            ldest.setBounds(40,490,100,20);
            torderno.setBounds(120,240,100,20);
            todate.setBounds(120,270,100,20);
            tquality.setBounds(380,270,200,20);
            cbotype.setBounds(120,400,90,20);
            tparty.setBounds(120,300,700,20);
            tindent.setBounds(120,430,200,20);
            tlength.setBounds(490,430,60,20);
            twidth.setBounds(580,430,60,20);
            tgsm.setBounds(120,460,80,20);
            tquantity.setBounds(380,460,80,20);
            tdest.setBounds(120,490,500,20);
            cbotype.addItem("SHEET");
            cbotype.addItem("REEL");
            p1.add(lheader);
            p1.add(lheader1);
            p1.add(lheader2);
            p1.add(lheader3);
            p1.add(lline);
            p1.add(lline1);
            p1.add(lodate);
            p1.add(todate);
            p1.add(lquality);
            p1.add(tquality);
            p1.add(lparty);
            p1.add(tparty);
            p1.add(ltype);
            p1.add(cbotype);
            p1.add(lindent);
            p1.add(tindent);
            p1.add(lsize);
            p1.add(tlength);
            p1.add(lmul);
            p1.add(twidth);
            p1.add(lgsm);
            p1.add(tgsm);
            p1.add(lquantity);
            p1.add(tquantity);
            p1.add(ldest);
            p1.add(tdest);
            p1.add(lorderno);
            p1.add(torderno);
            lheader.setFont(bigfont);
            lheader1.setFont(bigfont1);
            lheader2.setFont(bigfont1);
            lheader3.setFont(bigfont1);
            lheader.setForeground(Color.blue);
            lheader1.setForeground(Color.gray);
            lheader2.setForeground(Color.gray);
            lheader3.setForeground(Color.gray);
            bcancel=new JButton("Refresh");
            bquery=new JButton("Query");
            bexecute=new JButton("Execute");
            bupdate=new JButton("Update");
            bnext=new JButton("Next");
            bprev=new JButton("Previous");
            bcancel.addActionListener(this);
            bquery.addActionListener(this);
            bexecute.addActionListener(this);
            bupdate.addActionListener(this);
            bnext.addActionListener(this);
            bprev.addActionListener(this);
            borders.addActionListener(this);
            boption.addActionListener(this);;
            bexit.addActionListener(this);
            bcancel.setBounds(250,550,200,25);
            p1.add(bcancel);
            bquery.setBounds(450,550,200,25);
            p1.add(bquery);
            bexecute.setBounds(650,550,200,25);
            p1.add(bexecute);
            bupdate.setBounds(250,575,200,25);
            p1.add(bupdate);
            bprev.setBounds(450,575,200,25);
            p1.add(bprev);
            bnext.setBounds(650,575,200,25);
            p1.add(bnext);
            torderno.setEnabled(false);
            todate.setEnabled(false);
            bcancel.setEnabled(true);
            bexecute.setEnabled(false);
            bquery.setEnabled(false);
            bprev.setEnabled(false);
            bnext.setEnabled(false);
            bupdate.setEnabled(false);
            frame.show();
            frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
        public static void main(String args[])
            MDILayout layout=new MDILayout();
        public void actionPerformed(ActionEvent ae)
            if (ae.getSource()==borders)
              intframe.show();
              intframe.repaint();
            if (ae.getSource()==boption)
              rangeframe.show();
              rangeframe.repaint();
    }Please provide me the solution so that P1 appears in IF1 and P2 appears in P2.
    Thanks in advance,
    Ankur

    all the controls are able to display on IF1 but after adding IF2 allthe controls are transferred from IF1 to IF2 and now IF1 displays as a blank screen
    You can't have components at more than one place in the hierarchy. If you add a component to something it is removed from its existing parent if there is one.
    I'm not sure how much that helps you - I took one look at your code and ran away screaming.

  • Please Help In Restriction Code !!!

    Hie Guys..!
    Before Sum Days I Was Usin My Sim Wid A data Card To Use Net On Pc,but Wen I Inserted Sim In Mobile it Started To Show "contact Service" ..!
    I Switched It Off N On Again But Now Its Askin For " RESTRICTION CODE" even I Tried Wid Other Operators But Its Same...
    Though I'm Able To Turn It On Widout Sim Card But Within 5 Minutes It Turns Off Automaticaly.
    Please Guys Help Me...
    My Info Is...
    Mobile- Nokia 6300
    country- India
    Network- Tata Docomo
    thnkz In Advance.
    "~: b0rN To Ch3r1sH Uh :~" ....;o)

    Nah i din't ..! But I Contacted to My Network Operator n even i tried dat default code too,but It Was Useless...
    "~: b0rN To Ch3r1sH Uh :~" ....;o)

  • Please help with timout code. I'm under deadline.

    I have a timeline that stops on a frame full of flv playback
    components. I need the frame to listen for mouse clicks and after
    no mouse clicks for 2-3 minutes I need it to gotoAndPlay frame 1.
    As long as the viewer keeps clicking on the video controls it need
    to keep reseting the timer.
    I have looked all over trying to find something on this and
    got some help from the as forum but it's not woking like I need it
    to. I'm hoping to have this ready for a tradeshow in a couple of
    days.
    Any help would be greatly appreciated.
    ff

    I've added this code on the video page frame and it works but
    I need to disable it after the goto frame 1 or else it just meets
    the criteria for the goto again as soon as it loops around and gets
    back to the video page frame and just goes back to frame 1 without
    showing the video page frame without the 120 sec check for mouse
    movement.
    How do I disable this code on frame one and then let it work
    again when the timeline gets to the video page frame again.
    t=120; // 120 seconds inactivity triggers return to frame 1
    clearInterval(inactiveI); // <-- new statement
    inactiveI=setInterval(inactiveF,1000*t);
    function inactiveF(){
    _root.gotoAndPlay(1);
    _root.onMouseMove=function(){
    clearInterval(inactiveI);
    inactiveI=setInterval(inactiveF,1000*t);

  • Please help with C code to synchronize counter output to analog input

    Hi All,
    I am using NI DAQ USB-6353 with text-based C code to control it. I would like to send a continuous pulse train from the DAQ to pulse a power supply, which then activates an electron beam producing current to be read by the analog input port of the same DAQ. I would like to keep only the analog samples during the pulse peak and samples of a couple pulse widths right after. I am successfully to generate a pulse train using the sampled clock from a counter output channel, but fail to use the same clock to synchronize the pulse train with the analog input. DAQmxReadAnalogF64 is not called by the static function EveryNCallback set for the analog input task. Am I doing something wrong with the following codes? It would be great if it turns out only I am using the wrong sampled clock name of the counter ("dev1/PFI8") for the analog input. Or is something more fundamental that a counter cannot be sync. with an analog input?
    Would someone be able to send me a link to an example in C or C++ or visual basic showing how to synchronize a buffered sample clocked digital pulse train from a counter output channel to an analog input? To simplify the post, the below codes do not include the static functions EveryNCallback and DoneCallBack, but I can send them if needed.
    Many thanks in advance for your help,
    Thuc Bui
    //setting operation parameters
    double initDelay = 0.0, freq = 10;
    double dutyCycle = 0.0001;           //thus pulse width is 10 microsec
    unsigned highTicks = 4;   //per period
    unsigned numSamplesPerPeriod = highTicks / dutyCycle;   //40000 samples/period
    unsigned lowTicks = numSamplesPerPeriod - highTicks;      //per period
    unsigned sampleRate = 2*numSamplesPerPeriod*freq;       //800000 samples/s
    //create counter
    TaskHandle counterTask;
    int errCode = DAQmxCreateTask("", & counterTask);
    errCode = DAQmxCreateCOPulseChanFreq(counterTask, "dev1/ctr0", "",
                                     DAQmx_Val_Hz, DAQmx_Val_Low,
                                     initDelay, freq, dutyCycle);
    errCode = DAQmxCfgSampClkTiming(counterTask, "dev1/PFI8", sampleRate, DAQmx_Val_Rising,
                               DAQmx_Val_ContSamp, numSamplesPerPeriod);
    //create analog input
    TaskHandle aiTask;
    double minVolt = 0.0, maxVolt = 1.0;
    errCode = DAQmxCreateAIVoltageChan(aiTask, "dev1/ai0", "", DAQmx_Val_Diff,
                                     minVolt, maxVolt, DAQmx_Val_Volts, "");
    unsigned bufferSize = 10* numSamplesPerPeriod;
    errCode = DAQmxSetBufInputBufSize(aiTask, bufferSize);
    errCode = DAQmxCfgSampClkTiming(aiTask, "dev1/PFI8", sampleRate, DAQmx_Val_Rising, DAQmx_Val_ContSamp, numSamplesPerPeriod);
    errCode = DAQmxRegisterEveryNSamplesEvent(aiTask, DAQmx_Val_Acquired_Into_Buffer,
                                            numSamplesPerPeriod, 0, EveryNCallback, 0);
    errCode = DAQmxRegisterDoneEvent(aiTask, 0, DoneCallBack, 0)
    //start aiTask first
    errCode = DAQmxStartTask(aiTask);
    //then counterTask
    errCode = DAQmxStartTask(counterTask);

    Hi Xavier,
    Thank you very much for getting back to me. I really appreciate it. I followed your advice with the option 2 and simplified my code by using one of the NI C example templates to generate the below codes (also attached). I was able to see the pulses generated with an oscilloscope, and on the same oscilloscope I could see the ouput pulses of the electron beam probe. Unfortunately, the below code via DAQmxReadAnalogF64 reports of no data read from the probe and finally times out. Below is the error message given by this function. I did check the connection of the analog input wires to make sure they were connected to pin 1 (A0+) and 2 (A0-) because I was using the terminal configuration DAQmx_Val_Diff. Do you see any obvious errors I have made in my codes?
    Thanks a lot for your help,
    Thuc Bui
    Task started, waiting for trigger...
    Acquired 0 analog samples DAQmx Error: Some or all of the samples requested have not yet been acquired.
    To wait for the samples to become available use a longer read timeout or read later in your program. To make the samples available sooner, increase the sample rate. If your task uses a start trigger,  make sure that your start trigger is configured correctly. It is also possible that you configured the task for external timing, and no clock was supplied. If this is the case, supply an external clock.
    Property: DAQmx_Read_RelativeTo
    Corresponding Value: DAQmx_Val_CurrReadPos
    Property: DAQmx_Read_Offset
    Corresponding Value: 0
    Task Name: _unnamedTask<1>
    Status Code: -200284
    End of program, press Enter key to quit
    ********************** C Code **************************************************
    #include <stdio.h>
    #include "NIDAQmx.h"
    #include <math.h>
    #define DAQmxErrChk(functionCall) { if( DAQmxFailed(error=(functionCall)) ) { goto Error; } }
    int main(void) {  
    int32 error = 0;  
    char errBuff[2048]={'\0'};
    TaskHandle  taskHandleDig=0;  
    TaskHandle taskHandleAna=0;    
    double  timeout=10;  
    double minVol = -1.0, maxVol = 1.0;
    double initDelay = 0.0;  
    double freq = 10.0;  
    double pulseWidth = 1.0e-5; //10us  
    double dutyCycle = pulseWidth * freq;
    unsigned hiTicks = 4;  
    double sampleRate = hiTicks/pulseWidth; //samples/s  
    unsigned lowTicks = ceil(sampleRate/freq) - hiTicks;  
    unsigned nSpPeriod = hiTicks + lowTicks;
    unsigned numPulses = 1;  
    unsigned nSpCh = numPulses*nSpPeriod;    
    double sampleRate2 = ceil(2.0*sampleRate);  
    unsigned sampleMode = DAQmx_Val_FiniteSamps;
     /*********************************************/  /*/ DAQmx Configure Code  /*********************************************/  
    DAQmxErrChk(DAQmxCreateTask("", &taskHandleDig));  DAQmxErrChk(DAQmxCreateTask("", &taskHandleAna));    
    DAQmxErrChk(DAQmxCreateAIVoltageChan(taskHandleAna, "Dev2/ai0", "", DAQmx_Val_Diff, minVol, maxVol, DAQmx_Val_Volts, ""));  
    DAQmxErrChk(DAQmxCfgSampClkTiming(taskHandleAna, "/Dev2/Ctr0InternalOutput", sampleRate2, DAQmx_Val_Rising, sampleMode, nSpCh));
    DAQmxErrChk(DAQmxCreateCOPulseChanFreq(taskHandleDig, "Dev2/ctr0", "", DAQmx_Val_Hz, DAQmx_Val_Low, initDelay, freq, dutyCycle));  
    DAQmxErrChk(DAQmxCfgSampClkTiming(taskHandleDig, "/Dev2/PFI12", sampleRate2, DAQmx_Val_Rising, sampleMode, nSpCh));    
    unsigned bufferSize = nSpCh;  
    DAQmxErrChk(DAQmxSetBufInputBufSize(taskHandleAna, bufferSize));  
    DAQmxErrChk(DAQmxSetBufOutputBufSize(taskHandleDig, bufferSize));
    /*********************************************/  /*/ DAQmx Write Code  /*********************************************/  
    DAQmxErrChk(DAQmxWriteCtrTicksScalar(taskHandleDig, 0, timeout, hiTicks, lowTicks, NULL));
    /*********************************************/  /*/ DAQmx Start Code  /*********************************************/  
    DAQmxErrChk(DAQmxStartTask(taskHandleAna));  DAQmxErrChk(DAQmxStartTask(taskHandleDig));
    printf("Task started, waiting for trigger...\n");
    /*********************************************/  /*/ DAQmx Read Code  /*********************************************/  
    double* dataAna = new double[nSpCh];  
    int32 numReadAna = 0;  
    int errCode = DAQmxReadAnalogF64(taskHandleAna, -1, timeout, DAQmx_Val_GroupByChannel, dataAna, nSpCh, &numReadAna, NULL);  
    printf("Acquired %d analog samples\n",numReadAna);  
    if (numReadAna) {   
        unsigned nPts = (numReadAna < hiTicks)? numReadAna : hiTicks;  
        for (unsigned n = 0; n < nPts; ++n) {    
             printf("%6.3f ", dataAna[n]);   
        printf("\n");  
    delete [] dataAna;
    DAQmxErrChk(errCode);
    Error:  
    if( DAQmxFailed(error) )   DAQmxGetExtendedErrorInfo(errBuff,2048);  
    if( taskHandleDig!=0 && taskHandleAna!=0 ) {   
    /*********************************************/   /*/ DAQmx Stop Code   /*********************************************/   
        DAQmxStopTask(taskHandleDig);   
        DAQmxClearTask(taskHandleDig);   
        DAQmxStopTask(taskHandleAna);   
        DAQmxClearTask(taskHandleAna);  
    if( DAQmxFailed(error) )   printf("DAQmx Error: %s\n",errBuff);  
    printf("End of program, press Enter key to quit\n");  
    getchar();  
    return 0;
    Attachments:
    Correlated DIO AI_Sample_Clock Dig Start.c ‏6 KB

  • Please help - index.html file crashes Dreamweaver and others

    Hello -
    I went to open my tried and true index file today and it crashed Dreamweaver every time. I then tried to open it in TextEdit and Word, and it crashed both of those!  I then downloaded the index file from my website, which displays fine in browsers, and that file ALSO crashes Dreamweaver!
    I am lost on this one.  I have re-created the index file and uploaded a working one.  HOWEVER, I'd like to find out what happened as this is quite disconcerting to say the least.  Should I attempt to post the code here?  I can view it in Safari, but that's about it.  I tried deleting the deleting the personal cache file, but that did not help.
    I am on CS4 for Mac, running Snow Leopard OS.
    Thanks in advance for any input on where to look!
    Kelli

    Kelli, Chris -
    When DW "crashes", what specifically happens?
    I had a similar issue yesterday with DW going "unresponsive" on me - it just froze when trying to open up certain pages.
    Here's a link to the thread.  Hope it helps.
    ~codeDawg

  • Please help have error code 1013 and can not restore iphone 3gs

    i have tried every thing i can find to restore 3gs and no luck
    tried 4 different computers and 3 cables and all the usb ports on the computers
    i have even tried the gs.apple.com fix and no go.. am at a loss on what to do next any help
    would be great thank you all

    Every time I restore I get a different code last 2 times I have gotten code 1002
    And 1013 a few times.
    Error 1002 usually means a hardware problem. If you've tried several known working cables, the problem is likely in thte phone itself.
    +"Error 23, 28, 29, 40, 1002, 1011, 1012, 1014, 1611: These errors may indicate a hardware issue with your device. Follow the steps in this article and also attempt to restore while connected with a known-good 30-pin Dock Connector cable, computer, and network to isolate this issue to the device. If the MAC address is missing or the IMEI is the default value (00 499901 064000 0), this can also confirm a hardware issue."+

  • Please help with merging code

    With the help of this forum I have a program that decrypts a password that was previously encrypted. I'm trying to encorporate this decrypt code into a program of mine and having a problem with an undeclared Exception. Can someone help?
    Here's the short decrypt program that works:
    import java.io.*;
    import java.security.*;
    import javax.crypto.*;
    import sun.misc.*;
    public class DecryptPassword
         public static void main(String args[]) throws Exception
              if(args.length<1)
                   System.out.println("Usage : DecryptPassword text");
                   return;
              Security.addProvider(new com.sun.crypto.provider.SunJCE());
              Key key;
              try
                   ObjectInputStream in=new ObjectInputStream(new FileInputStream("des.key"));
                   key=(Key)in.readObject();
                   in.close();
              }      catch(FileNotFoundException fnfe)
                        KeyGenerator generator= KeyGenerator.getInstance("DES");
                        generator.init(new SecureRandom() );
                        key=generator.generateKey();
                        ObjectOutputStream out=new ObjectOutputStream(new FileOutputStream("des.key"));
                        out.writeObject(key);
                        out.close();
              Cipher cipher=Cipher.getInstance("DES/ECB/PKCS5Padding");
                   cipher.init(Cipher.DECRYPT_MODE,key);
                   BASE64Decoder decoder = new BASE64Decoder();
                   byte[] raw = decoder.decodeBuffer(args[0]);
                   byte[] stringBytes = cipher.doFinal(raw);
                   String result = new String(stringBytes,"UTF8");
                   System.out.println(result);
    }Now here's the code snippet. I call this function from another part of the program with DecryptPassword();
         public void DecryptPassword()
              Security.addProvider(new com.sun.crypto.provider.SunJCE());
              Key key;
              try
                   ObjectInputStream in=new ObjectInputStream(new FileInputStream("des.key"));
                   key=(Key)in.readObject();
                   in.close();
              }      catch(FileNotFoundException fnfe)
                        KeyGenerator generator= KeyGenerator.getInstance("DES");
                        generator.init(new SecureRandom() );
                        key=generator.generateKey();
                        ObjectOutputStream out=new ObjectOutputStream(new FileOutputStream("des.key"));
                        out.writeObject(key);
                        out.close();
              Cipher cipher=Cipher.getInstance("DES/ECB/PKCS5Padding");
              cipher.init(Cipher.DECRYPT_MODE,key);
              BASE64Decoder decoder = new BASE64Decoder();
              byte[] raw = decoder.decodeBuffer(EncryptedRemedyPassword);
              byte[] stringBytes = cipher.doFinal(raw);
              String result = new String(stringBytes,"UTF8");
              EncryptedRemedyPassword = result;
              //System.out.println(result);
         }Problem is, what do I do with the "throws Exception" that is a part of the Main program in the first set of code? I assume that's the problem.
    Thanks.
    James

    Please don't write the name of your method with an uppercase.
    There is two ways to solve your problem :
    1) you declare that your method throws an Exception like this :
    public void decryptPassword() throws Exceptionbut, for each call of this method you will have to put it in a try{} catch(Exception e) {} clause.
    2) you put all the code of your method in a try clause like this :
    public void decryptPassword() {
        try {
             // all the code
        catch(Exception e) {
            System.out.println(e);
    }I hope this helps,
    Denis

Maybe you are looking for