Can anyone solve this query requirement

Would like to know if anyone solved this situation in the query before. If yes, or If you have any ideas, could you please share it with me.
Below is the scenario.
Cube data: We have a number of 'FACILIIES'. 'Surveys' are conducted for each facility once in every six to 18 months. No fixed time intervals though. And surveys are numbered sequencially, always in the increasing order with respect to time. each survey has a 'survey date'. and a keyfigure 'Count'.                                                  
DATA IN THE CUBE AS OF 4/30/2005               
FACILITY...SURVEYID...SURVEYDATE...COUNTKEYFIGURE     
525...         121...  1/6/2004...         6     
624...         132...  2/20/2004...    7     
525...         138...  10/1/2004...    5     
624...         140...  9/15/2004...    4     
525...         157...  3/10/2005...    8     
624...         245...  4/15/2005...    6     
If the query is run for the above data, is shouls be displayed like this.               
REPORT AS OF 04/30/2005                    
FACILITY...LATESTSURVEY...LATESTCOUNT...PREVIOUSSURVEY PRECOUNT
525... 157... 8... 138... 5
624... 245... 6... 140... 4
Once the data is updated further, this is the data in the Cube as of 10/30/2005
DATA IN THE CUBE AS OF 10/30/2005          
FACILITY...SURVEYID...SURVEYDATE...COUNTKEYFIGURE     
525...          121...     1/6/2004...     6     
624...          132...     2/20/2004...     7     
525...          138...     10/1/2004...     5     
624...          140...     9/15/2004...     4     
525...          157...     3/10/2005...     8     
624...          245...     4/15/2005...     6     
525...       290...     8/20/2005...     9     
624...          312...     10/15/2005...     4     
REPORT AS OF 04/30/2005                         
FACILITY LATESTSUREY LATESTCOUNT PREVIOUSSURVEY PRECOUNT
525...          290...     9...          157...     8     
624...          312...     4...          245...     6     
Dynamically, the latest survey and previous survey has to be determined. Any ideas on how to solve... We alrady thought of making changes to the Survey Master data. Any thing that can be done in the query itself?
thanks
Gova
(I could not improve the display format, so I used '...' to separate the fields. may be SDN should look into improving the display format)

Hi Gova..
We too had a similar requirement..to get the previous records..
We had to end up having to populate the Previous record in a seperate field on the same line..
I think you are on the right path to modify the master data and have the previous survey and previous count populated on every line..
Good Luck
Ashish..

Similar Messages

  • Hi all, I upgraded my MBP to Lion , but on the screen where i need to type my password, click  on my photo and it does not appear the place for me to type my password and it stay stuck there. Can anyone solve this problem for me?

    Hi all, I upgraded my MBP to Lion , but on the screen where i need to type my password, click  on my photo and it does not appear the place for me to type my password and it stay stuck there. Can anyone solve this problem for me?

    Reboot the machine holding Command and r keys down, you'll boot into Lion Recovery Partition
    In there will be Disk Utility, use that to select your Lion OS X Partition and Repair Permissions.
    After that is done reboot the machine and see if you can log in.
    If not repeat the above steps to get into Lion Recovery, get online and reinstall Lion again, it will overwrite the installed version and hopefully after that it wil work.
    Reboot and try again.
    If not follow my steps to create a Snow Leopard Data Recovery drive, then option boot from it and grab a copy of your files off the machine.
    Then reinstall all your programs onto the external drive like setting up a new machine, then use Disk Utility to erase the entire internal boot drive (select the drive media on the far left, not the partiton slightly indented) format Option: GUID , 1 partition OS X Extended and then use Carbon Copy Cloner to clone the external to the newly formatted internal drive. Once that is finished reboot and disconnect the external drive.
    Once you go that, boot into Snow Leopard and update to 10.6.8, use the AppStore and option click on Purchases and download Lion again and install.
    Lots of work, but there is no Lion disks.
    https://discussions.apple.com/message/16276201#16276201

  • Can anyone explain this query.?

    Can anyone explain this query.?
    select nvl(s.p_id,q.p_id),nvl(s.p_type,q.p_type),nvl(s.p_line,q.p_line),
    nvl(s.sales2004,0),nvl(s.sales2005,0),nvl(q.quota2004,0),nvl(q.quota2005,0)
    from sales s
    full outer join quota q on(s.p_id = q.p_id and s.p_type=q.p_type and s.p_line=q.p_line)

    from sales s full outer join quota qTable quota is outer joined to table sales , if there are no matching records in table quota then also the query retuns the sales record with null values for the corresponding quota record columns
    NVL() has been used to handle such cases

  • Can anyone solve this error? 0xc 19a0013

    can anyone solve this error? 0xc 19a0013 my black ink cartridge will not print and its full. i've cleaned the heads and still no black.  please help.

    Hello family1023, and welcome to the HP Forums, I hope you enjoy your experience!
    I see you are experiencing print system issues.  I would love to try and help you, but I do need a little information first. I am linking a few HP Support documents below that will show you how to find your product number. Also, please include which operating system you are using. Also, if you're using Windows, please include whether your operating system is 32-bit or 64-bit. With this information and the product number we can provide you with accurate information.
    How Do I Find My Model Number or Product Number?
    Mac OS X: How Do I Find Which Mac OS X Version Is on My Computer?
    Which Windows operating system am I running?
    Is the Windows Version on My Computer 32-bit or 64-bit?
    Please let me know what you find, and thanks for posting on the HP Forums!
    Please click “Accept as Solution " if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the right to say “Thanks" for helping!
    Jamieson
    I work on behalf of HP
    "Remember, I'm pulling for you, we're all in this together!" - Red Green.

  • Can anyone solve this puzzle using SQL?

    Can anyone solve this puzzle using SQL?
    http://www.greylabyrinth.com/puzzle/puzzle182

    DylanB123 wrote:
    Took me almost 4 min just to get all the permutations/combinations using only dual. May try out the full thing when traffic does down on the DB.Well this looks like it gives the correct answer...
    SQL> select * from disks;
          DISK COLOUR
             1 WGYBRK
             2 WBYGKR
             3 WBGRKY
             4 WRGYKB
             5 WKGBYR
             6 WBKYGR
             7 WGKBYR
    7 rows selected.
    Elapsed: 00:00:00.04
    SQL> select   disk_perms,
      2           offset_1,
      3           offset_2,
      4           offset_3,
      5           offset_4,
      6           offset_5,
      7           offset_6,
      8           offset_7
      9    from   (select   permutations disk_perms
    10               from   (    select   replace (sys_connect_by_path (n, ','), ',')
    11                                       permutations
    12                             from   (    select   to_char (level) n
    13                                           from   dual
    14                                     connect by   level <= 7) yourtable
    15                       connect by   nocycle n != prior n)
    16              where   length (permutations) = 7) disk_permutations
    17           cross join
    18           (select   tab1.c offset_1,
    19                      tab2.c offset_2,
    20                      tab3.c offset_3,
    21                      tab4.c offset_4,
    22                      tab5.c offset_5,
    23                      tab6.c offset_6,
    24                      tab7.c offset_7
    25             from   (select   level - 1 as c from   dual connect by   level <= 6) tab1,
    26                    (select   level - 1 as c from   dual connect by   level <= 6) tab2,
    27                    (select   level - 1 as c from   dual connect by   level <= 6) tab3,
    28                    (select   level - 1 as c from   dual connect by   level <= 6) tab4,
    29                    (select   level - 1 as c from   dual connect by   level <= 6) tab5,
    30                    (select   level - 1 as c from   dual connect by   level <= 6) tab6,
    31                    (select   level - 1 as c from   dual  connect by   level <= 6) tab7) offset_combinations
    32           join disks d1 on d1.disk = substr(disk_perms,1,1)
    33           join disks d2 on d2.disk = substr(disk_perms,2,1)
    34           join disks d3 on d3.disk = substr(disk_perms,3,1)
    35           join disks d4 on d4.disk = substr(disk_perms,4,1)
    36           join disks d5 on d5.disk = substr(disk_perms,5,1)
    37           join disks d6 on d6.disk = substr(disk_perms,6,1)
    38           join disks d7 on d7.disk = substr(disk_perms,7,1)
    39    where substr( substr(d6.colour,offset_6+1)||substr(d6.colour,decode(offset_6,0,7,1),offset_1), 3,1) = substr( substr(d7.colour,offset_7+1)||substr(d7.colour,decode(offset_7,0,7,1),offset_7), 5,1)
    40    and   substr( substr(d5.colour,offset_5+1)||substr(d5.colour,decode(offset_5,0,7,1),offset_5), 2,1) = substr( substr(d7.colour,offset_7+1)||substr(d7.colour,decode(offset_7,0,7,1),offset_7), 5,1)
    41    and   substr( substr(d5.colour,offset_5+1)||substr(d5.colour,decode(offset_5,0,7,1),offset_5), 1,1) = substr( substr(d6.colour,offset_6+1)||substr(d6.colour,decode(offset_5,0,7,1),offset_5), 4,1)
    42    and   substr( substr(d4.colour,offset_4+1)||substr(d4.colour,decode(offset_4,0,7,1),offset_4), 1,1) = substr( substr(d7.colour,offset_7+1)||substr(d7.colour,decode(offset_7,0,7,1),offset_7), 4,1)
    43    and   substr( substr(d4.colour,offset_4+1)||substr(d4.colour,decode(offset_4,0,7,1),offset_4), 6,1) = substr( substr(d5.colour,offset_5+1)||substr(d5.colour,decode(offset_5,0,7,1),offset_5), 3,1)
    44    and   substr( substr(d3.colour,offset_3+1)||substr(d3.colour,decode(offset_3,0,7,1),offset_3), 6,1) = substr( substr(d7.colour,offset_7+1)||substr(d7.colour,decode(offset_7,0,7,1),offset_7), 3,1)
    45    and   substr( substr(d3.colour,offset_3+1)||substr(d3.colour,decode(offset_3,0,7,1),offset_3), 5,1) = substr( substr(d4.colour,offset_4+1)||substr(d4.colour,decode(offset_4,0,7,1),offset_4), 2,1)
    46    and   substr( substr(d2.colour,offset_2+1)||substr(d2.colour,decode(offset_2,0,7,1),offset_2), 5,1) = substr( substr(d7.colour,offset_7+1)||substr(d7.colour,decode(offset_7,0,7,1),offset_7), 2,1)
    47    and   substr( substr(d2.colour,offset_2+1)||substr(d2.colour,decode(offset_2,0,7,1),offset_2), 4,1) = substr( substr(d3.colour,offset_3+1)||substr(d3.colour,decode(offset_3,0,7,1),offset_3), 1,1)
    48    and   substr( substr(d1.colour,offset_1+1)||substr(d1.colour,decode(offset_1,0,7,1),offset_1), 3,1) = substr( substr(d2.colour,offset_2+1)||substr(d2.colour,decode(offset_2,0,7,1),offset_2), 6,1)
    49    and   substr( substr(d1.colour,offset_1+1)||substr(d1.colour,decode(offset_1,0,7,1),offset_1), 4,1) = substr( substr(d7.colour,offset_7+1)||substr(d7.colour,decode(offset_7,0,7,1),offset_7), 1,1)
    50    and   substr( substr(d1.colour,offset_1+1)||substr(d1.colour,decode(offset_1,0,7,1),offset_1), 5,1) = substr( substr(d6.colour,offset_6+1)||substr(d6.colour,decode(offset_6,0,7,1),offset_6), 2,1)
    51  /
    DISK_PERMS
      OFFSET_1   OFFSET_2   OFFSET_3   OFFSET_4   OFFSET_5   OFFSET_6   OFFSET_7
    5172643
             5          0          3          2          5          4          2
    Elapsed: 00:00:03.90
    SQL>If you take the positions as in
       1
    6   2
       7
    5   3
       4and the rotations (offsets) as anticlockwise based on my colour strings being in a clockwise order from the top.

  • Hi i got a mac mini but when i connect it to my smartax mt882 modem via ethernet it says device not connected can anyone solve this issue it work fine with the usb connection but the ethernet is giving me problems plz help

    hi i got a mac mini but when i connect it to my smartax mt882 modem via ethernet it says device not connected can anyone solve this issue it work fine with the usb connection but the ethernet is giving me problems plz help

    Hello, give this a try...
    Make a New Location, Using network locations in Mac OS X ...
    http://support.apple.com/kb/HT2712
    10.5, 10.6, 10.7 & 10.8…
    System Preferences>Network, top of window>Locations>Edit Locations, little plus icon, give it a name.
    10.5.x/10.6.x/10.7.x/10.8.x instructions...
    System Preferences>Network, click on the little gear at the bottom next to the + & - icons, (unlock lock first if locked), choose Set Service Order.
    The interface that connects to the Internet should be dragged to the top of the list.
    For 10.5/10.6/10.7/10.8, System Preferences>Network, unlock the lock if need be, highlight the Interface you use to connect to Internet, click on the advanced button, click on the DNS tab, click on the little plus icon, then add these numbers...
    208.67.222.222
    208.67.220.220
    (There may be better or faster DNS numbers in your area, but these should be a good test).
    Click OK.

  • I have set a passcode for my iphone and later I forgot it, and I tried it so many times but it was not correct now the iphone is disable it doesn't work in tune, can anyone solve this problem??

    I have set a passcode for my iphone and later I forgot it, and I tried it so many times but it was not correct now the iphone is disable it doesn't work in tune, can anyone solve this problem??

    You can solve this problem. Just follow these instructions:
    http://support.apple.com/kb/ht1212

  • Can anyone solve this cmos puzzle?

    Attached are two CMOS circuits created in Multisim 10.1 (10.1.197)
    The first circuit was created after the second.
    I'd created two identical oscillators with both CMOS gates and a CMOS IC, but neither of them responded with anywhere near the correct frequency.  (The oscillator of my design wasn't working right -- the C had an impossible square waveform, which prompted further investigation into the circuit.)  I wanted to investigate this to determine what I needed to do to get the frequency roughly correct.  So I decided to go simple-stupid: start with a simple RC circuit, and slowly, step by step, transform it into a CMOS oscillator, just to see where the frequency went to lunch.  The circuits below resulted from this quest for the answer.
    I'm very puzzled.  These CMOS gates don't appear to work at all.  I never could get a legal CMOS output (<50mV). 
    As I see it, my RC oscillator has no chance of working if the gates don't work.   This is bad enough that I'm going to have to break out EWB 5.12 now, just to see if all those years ago CMOS didn't work and I'd never noticed.
    If anyone out there can solve this puzzler, modify these circuits so that I can get legal CMOS operation, I'd like to know how it's done.
    Attachments:
    cmos_puzzler.ms10 ‏90 KB
    simpleRC_becomeOSC_puzzle.ms10 ‏255 KB

    The first piece of the puzzle is that you don't have VSS tied to GND so they are disconnected.
    Second, you don't have the proper timebase set on the scope for your analysis, part of your answer lies here:
    http://www.datasheet4u.com/html/4/0/0/4001B_FairchildSemiconductor.pdf.html
    looking specifically at Tplh (time propogation low to high) with VDD at 5V.
    As I read it, the NOR should have a low based on your dual high condition, BUT, during startup, there is no stablization of during the current inrush to allow the inputs to stablize. During this process, the input ramps the output in a linear fashion, once the inputs reach proper operating level, then gate switchs after the 120ns setup prop delay time(datasheet), at which time, then goes low and remains low for the duration, as it should.
    I'm not sure how your trying to measure a frequency out of that since it becomes steady state with DC power supplies.
    This comes from the simpleRC scope.....I hope this is what you were looking for???
    Chris
    Signature: Looking for a footprint, component, model? Might be here > http://ni.kittmaster.com
    Attachments:
    SS005.png ‏13 KB

  • Please can anyone solve this problem...it's taking over my life!!

    Hi, I hope someone can hep me with this as it's driving me crazy!!...I have a magnify glass effect for my main movie and everything is working great, except I need the magnify glass to stay within certain boundaries on the stage...basically when someone moves there mouse away from the flash movie in the centre of the page in a browser, it cuts off the glass and it looks funny (see www.zoeglazebrook.co.uk)...
    Kglad has very kindly donated many hours to trying to solve this but it still isn't working unfortunately.
    This is the code on the main timeline, and I just need to add in 125, 127, 1095, 775 coordinates in there to make it not go past these points on the stage:
    var moveGlass:Number;
    magnifyingGlass.onPress = function() {
        moveGlass = setInterval(startGlass,1);
    function startGlass() {
        magnifyingGlass._x = _root._xmouse;
        magnifyingGlass._y = _root._ymouse;
    magnifyingGlass.onEnterFrame = function(){
         this.largeobject._x = (this._parent.original._x-this._x)*2;
         this.largeobject._y = (this._parent.original._y-this._y)*2;

    I'm not sure I understand your question.
    I think you are asking about how once you start clicking it doesn't go off? You can add something like this:
    magnifyingGlass.onRelease=magnifyingGlass.onReleaseOutside=function(){
    delete this.onEnterFrame;
    If I'm following you correctly. Or not.
    I'm actually more annoyed by also having the pointer still show. So you might add a Mouse.hide() when they press and a Mouse.unhide() when they release. BTW, you need the onReleaseOutside because if you are limiting where the magnifying glass can be dragged then the pointer might not be above the glass when they release. Most people forget the onReleaseOutside and it causes a lot of problems.
    Also I'm confused about your confusion of "...whether it's better to have a start drag on there instead."
    startDrag() does just that. It takes the item that is referenced and makes it follow the pointer. And it also gives you an easy way to limit the bounds of that dragging to a rectangle. However you can only drag one thing at a time using startDrag and there is no way to do other things as you drag.
    In this case you need to also reposition the large view at the same time based upon the position of the pointer. Therefore you need some other kind of loop that says, "every little bit of time make the glass match the mouse coordinates and also align the large image." You could probably make some kind of combined solution that starts the magnifying glass moving with startDrag and uses an onEnterFrame to position the large view, but why make it more complex than it needs to be?

  • Can anyone solve this Phase Locked Loop puzzle?

    I created a Phase Locked Loop circuit using
    Multisim10.0.   It uses the Multisim clock oscillator, and the circuit
    appears to work great.
    However,
    I just discovered that if I use the same parts that I used to create
    the Phase Locked Loop circuit in an oscillator circuit added to the
    same schematic, the Phase Locked Loop circuit doesn't work any more,
    while the new oscillator circuit pumps out a frequency that is way
    off.  4+MHz is no where near 1kHz, the design frequency.
    What
    happened?   The evidence says my newly-added oscillator brings in
    something that kills a previously working circuit that uses the same
    old parts.   Every part used was taken from the previously working
    circuit, aside from the variable resistor values.  How did the Multisim
    rules change from 10.0 to 10.1?  What am I missing here?
    Did the Phase Locked Loop circuit really work to begin with?  Which circuit is the broken one?
    As
    I see things, in order to solve this puzzle, I need to come up with a
    factor that involves both circuits.  Some factor is going to kill both
    simultaneously.
    Note what I'm saying here.  (At least when I ran
    them this was the case.)  Delete just the oscillator circuit, and run
    the circuit that remains.  It works.  Undo the deletion.  The
    oscillator reappears where it was, and the previously working circuit
    stops working.  There's something in that oscillator circuit that
    kills.  It's like switching on and off a light bulb.
    Message Edited by Euler's Identity on 08-02-2008 12:10 AM
    Attachments:
    phase_locked_loop1.ms10 ‏649 KB
    phase_locked_loop_puzzle1.ms10 ‏174 KB

    Ah hey why not?
    After all, I still can't predict what the next filenames I uplaod are going to look like, not yet at least.
    However, at this point, it is safe to say it won't be what I uploaded.
    [drum roll]
    Attachments:
    phase_locked_loop1.ms10 ‏649 KB
    phase_locked_loop_puzzle1.ms10 ‏174 KB

  • Can anyone solve this one?

    Hi,
    I've got a problem with compiling the code below.
    I've downloaded a java and a class file. The class file is working (it's a slide-menu).
    Because I wanted to update a record in a DB, I changed the java file. The part I changed is the part under ActionPerformed. The actionPerformed code is working independently.
    But when I implement it in the java file, he stops compiling.
    I tried to compile the original code, but it stopped also at the same line. In the new code it's line 318.
    The line is:
    this.add(mainMenu);
    and the error is:
    method add(java.awt.Menu) not found in class FisMenu.
    The strangest thing is that he gives an error in the code which is used in the WORKING class file.
    I have had a hint to use Japplet instead of Applet, that�s why I post this problem here.
    can anyone help me out?
    thanks in advance.
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import java.net.*;
    import java.util.*;
    import netscape.javascript.*;
    import sqlj.runtime.*;
    import sqlj.runtime.ref.*;
    import java.sql.*;
    import java.lang.*;
    public class FisMenuApplet extends Applet implements MouseListener, ActionListener {
    String title, img, bgcolor, text, font, size, style, menufont, menustyle, menusize, data;
    String actions[], targets[];
    java.awt.Menu menus[];
    MenuItem menuItems[];
    int fontsize, menufontsize;
    CardLayout cardlayout;
    java.awt.Menu mainMenu;
    Image bgImage = null;
    boolean parseError = false, imgError = false;
    URL imgUrl;
    Label label;
    Font labelFont, menuFont;
    //Construct the applet
    public FisMenuApplet() {
    //Initialize the applet
    public void main() {
    cardlayout = new CardLayout();
    title = getParameter("title");
    if (title == null) title = "Menu";
    // the colors for bgcolor and text are used only for the applet label
    // Java 1.1 menus themselves don't support colors, although some Unix implementations
    // allow a menu's background color to be inherited from the object it's attached to.
    bgcolor = getParameter("bgcolor");
    if (bgcolor == null) bgcolor = "white";
    else bgcolor = bgcolor.toLowerCase();
    text = getParameter("text");
    if (text == null) text = "blue";
    else text = text.toLowerCase();
    // font, size and style are used for the applet's text label (if any)
    font = getParameter("font");
    if (font == null) font = "SansSerif";
    size = getParameter("size");
    if (size == null) fontsize = 11;
    else
    try {
    fontsize = Integer.parseInt(size);
    } catch(NumberFormatException f) {
    fontsize = 11;
    style = getParameter("style");
    if (style == null) style = "plain";
    labelFont = new Font(font, translateStyle(style), fontsize);
    // menufont, menusize and menustyle default to font, size and style if undefined,
    // but they can be also defined explicitely in case we want the popup menu to look different
    // from the applet's text label (if any)
    menufont = getParameter("menufont");
    if (menufont == null) menufont = font;
    menusize = getParameter("menusize");
    if (menusize == null) menufontsize = fontsize;
    else
    try {
    menufontsize = Integer.parseInt(menusize);
    } catch(NumberFormatException f) {
    menufontsize = 11;
    menustyle = getParameter("menustyle");
    if (menustyle == null) menustyle = style;
    menuFont = new Font(menufont, translateStyle(menustyle), menufontsize);
    data = getParameter("data");
    parseData(data);
    this.addMouseListener(this);
    this.setBackground(translateColor(bgcolor));
    this.setForeground(translateColor(text));
    this.setFont(labelFont);
    this.setLayout(cardlayout);
    img = getParameter("img");
    if (img != null) {
    try { // absolute URL
    imgUrl = new URL(img);
    bgImage = this.getImage(imgUrl);
    } catch(MalformedURLException a) {
    try { // relative URL
    imgUrl = new URL(this.getDocumentBase(), img);
    bgImage = this.getImage(imgUrl);
    } catch(MalformedURLException r) {
    imgError = true;
    bgImage = this.getImage(this.getDocumentBase(), img);
    } else {
    label = new Label(title);
    label.setAlignment(1);
    label.addMouseListener(this);
    this.add(title, label);
    //Start the applet
    public void start() {
    //Stop the applet
    public void stop() {
    //Destroy the applet
    public void destroy() {
    //Get parameter info
    public String[][] getParameterInfo() {
    String pinfo[][] =
    {"title", "String", "Menu title"},
    {"img", "URL", "Background image"},
    {"bgcolor", "Color or Hex RGB value", "Menu background color"},
    {"text", "Color or Hex RGB value", "Menu foreground color"},
    {"font", "Font name", "Menu font name"},
    {"size", "Integer", "Menu font size"},
    {"style", "Sum of BOLD,PLAIN,ITALIC", "Menu font style"},
    {"menufont", "Font name", "Menu font name"},
    {"menusize", "Integer", "Menu font size"},
    {"menustyle", "Sum of BOLD,PLAIN,ITALIC", "Menu font style"},
    {"data", "Menu item names, actions and targets", "Menu data"},
    return pinfo;
    public void paint(Graphics g) {
    if (bgImage != null)
    g.drawImage(bgImage,0,0,this);
    if (imgError)
    this.showStatus("FisMenuApplet: invalid URL for img parameter " + img);
    if (parseError)
    this.showStatus("FisMenuApplet Error: unbalanced braces in data parameter tag.");
    public void mousePressed(MouseEvent e) {
    public void mouseReleased(MouseEvent e) {
    public void mouseClicked(MouseEvent e) {
    popup();
    public void mouseEntered(MouseEvent e) {
    popup();
    public void mouseExited(MouseEvent e) {
    public void actionPerformed(ActionEvent e)
    // Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    try
    Connection con = DriverManager.getConnection("jdbc:odbc:tom", "", "");
    System.out.println("jdbc:odbc connectie...");
    Statement stmt = con.createStatement();
    //Update database record
    stmt.executeUpdate(
    "update fis_tuser_preferences set word_path = 'ffisau01' ");
    System.out.println("ffisau01");
    //Close conection and commit transaction
    con.close();
    System.out.println("connection closed");
    catch (Exception f)
    System.err.println("problems connecting to URL");
    public void popup() {
    // if (!parseError)
    // mainMenu.show(this,this.getSize().width/2,this.getSize().height/2);
    private Color translateColor(String c) {
    if(c.equalsIgnoreCase("white"))
    return(Color.white);
    else if(c.equalsIgnoreCase("lightgray"))
    return(Color.lightGray);
    else if(c.equalsIgnoreCase("gray"))
    return(Color.gray);
    else if(c.equalsIgnoreCase("darkgray"))
    return(Color.darkGray);
    else if(c.equalsIgnoreCase("black"))
    return(Color.black);
    else if(c.equalsIgnoreCase("red"))
    return(Color.red);
    else if(c.equalsIgnoreCase("pink"))
    return(Color.pink);
    else if(c.equalsIgnoreCase("orange"))
    return(Color.orange);
    else if(c.equalsIgnoreCase("yellow"))
    return(Color.yellow);
    else if(c.equalsIgnoreCase("green"))
    return(Color.green);
    else if(c.equalsIgnoreCase("magenta"))
    return(Color.magenta);
    else if(c.equalsIgnoreCase("cyan"))
    return(Color.cyan);
    else if(c.equalsIgnoreCase("blue"))
    return(Color.blue);
    // allow for Hex RGB values (and an optional leading #, as in HTML syntax)
    else if (c.length() == 6 || (c.length() == 7 && c.charAt(0) == '#')) {
    if (c.length() == 7)
    c = c.substring(1);
    return(new Color(hexToInt(c.substring(0,2)),
    hexToInt(c.substring(2,4)),hexToInt(c.substring(4,6))));
    else
    return(Color.white);
    private int hexToInt(String c) {
    try {
    return(Integer.parseInt(c, 16));
    } catch(NumberFormatException h) {
    return 0;
    private int translateStyle(String s) {
    int style = 0;
    String token = null;
    StringTokenizer st = new StringTokenizer(s,",+ \t\n\r");
    do {
    try {
    token = st.nextToken();
    } catch(NoSuchElementException n) {}
    if (token.equalsIgnoreCase("PLAIN"))
    style += Font.PLAIN;
    else if (token.equalsIgnoreCase("BOLD"))
    style += Font.BOLD;
    else if (token.equalsIgnoreCase("ITALIC"))
    style += Font.ITALIC;
    } while (st.hasMoreTokens());
    return style;
    private void parseData(String s) {
    // menuItem counters start at -1 so that at first increment, they get set to
    // the first array subscript value of 0
    // menu counters start at 0 so that at first increment, they get set to
    // the array subscript value of 1, the first value (0) being reserved for the main menu
    int levelCtr = -1, menuCtr = 0, menuItemCtr = -1;
    int levelCount = 0, menuCount = 0, menuItemCount = -1;
    int parentMenuPtr[];
    String itemToken = null, datatoken = null;
    String title = "", action = "", target = "_self";
    boolean newMenu = false;
    if (s == null || s.indexOf("{") == -1) {
    parseError = true;
    return;
    StringTokenizer braces = new StringTokenizer(s,"{}",true);
    StringTokenizer braceCtr = new StringTokenizer(s,"{}",true);
    StringTokenizer asterisks;
    // Get the number of menus and menuItems for which to allocate array space
    do {
    try {
    itemToken = braceCtr.nextToken();
    } catch(NoSuchElementException i) {}
    if (itemToken.charAt(0) == '{') {
    if (newMenu)
    menuCount++;
    newMenu = true;
    levelCtr++;
    if (levelCount < levelCtr) levelCount = levelCtr;
    } else if (itemToken.charAt(0) == '}') {
    if (newMenu)
    menuItemCount++;
    newMenu = false;
    levelCtr--;
    } while (braceCtr.hasMoreTokens());
    if (levelCtr != -1) {
    parseError = true;
    return;
    // allocate one more element than the counter values , since the first subscript value is 0
    actions = new String[menuItemCount+1];
    targets = new String[menuItemCount+1];
    menuItems = new MenuItem[menuItemCount+1];
    menus = new java.awt.Menu[menuCount+1];
    parentMenuPtr = new int[levelCount+1];
    mainMenu = new java.awt.Menu(title);
    menus[0] = (java.awt.Menu)(mainMenu);
    this.add(mainMenu);
    itemToken = null;
    newMenu = false;
    // Parse the data Param and build the menu and menu items
    do {
    try {
    itemToken = braces.nextToken();
    } catch(NoSuchElementException i) {}
    if (itemToken.charAt(0) == '{') {
    if (newMenu) {
    menuCtr++;
    menus[menuCtr] = new java.awt.Menu(title);
    menus[menuCtr].setFont(menuFont);
    menus[parentMenuPtr[levelCtr]].add(menus[menuCtr]);
    parentMenuPtr[levelCtr+1] = menuCtr;
    newMenu = true;
    levelCtr++;
    } else if (itemToken.charAt(0) == '}') {
    if (newMenu) {
    menuItemCtr++;
    actions[menuItemCtr] = action;
    targets[menuItemCtr] = target;
    menuItems[menuItemCtr] = new MenuItem(title);
    menuItems[menuItemCtr].setFont(menuFont);
    menuItems[menuItemCtr].addActionListener(this);
    menuItems[menuItemCtr].setActionCommand(new Integer(menuItemCtr).toString());
    menus[parentMenuPtr[levelCtr]].add(menuItems[menuItemCtr]);
    newMenu = false;
    levelCtr--;
    } else if (!itemToken.trim().equals("")) {
    asterisks = new StringTokenizer(itemToken,"*");
    try {
    title = asterisks.nextToken();
    // a menu separator is a -, but allow for hr as well, as in HTML syntax
    if (title.equals("-") || title.equalsIgnoreCase("HR"))
    title = "-";
    } catch(NoSuchElementException i) {
    title = "-";
    try {
    action = asterisks.nextToken();
    } catch(NoSuchElementException i) {
    action = "";
    try {
    target = asterisks.nextToken();
    } catch(NoSuchElementException i) {
    target = "_self";
    } while (braces.hasMoreTokens());

    Congratulations!
    I understand completely that you don't like to look at my code and I don't aspect you to help me.
    But I'll sure appriciate any help from you or anyone else, today and in the future :)
    about the working class file, I downloaded it once and it's working, but when I compile the java file it crashes (even in de original downloaded code).
    I just need a way for my code to accept the add method (even if there are major changes needed).

  • Can anyone solve this error??

    I have following files
    1)
    CaptureApplet.html
    <APPLET CODE=CaptureApplet WIDTH=320 HEIGHT=300>
    </APPLET>
    import java.applet.*;
    import java.awt.*;
    import java.net.*;
    import java.util.*;
    import javax.media.*;
    import javax.media.protocol.FileTypeDescriptor;
    import javax.media.protocol.DataSource;
    import javax.media.control.StreamWriterControl;
    import javax.media.format.*;
    import java.io.IOException;
    public class CaptureApplet extends Applet implements ControllerListener
         CaptureDeviceInfo di = null;
         Processor player = null;
         StateHelper sh = null;
         DataSink filewriter = null;
         public void init()
              Vector deviceList = CaptureDeviceManager.getDeviceList(new AudioFormat(AudioFormat.LINEAR,8000.0,8,1,Format.NOT_SPECIFIED,AudioFormat.SIGNED,8,Format.NOT_SPECIFIED,Format.byteArray));
              if (deviceList.size() > 0)
                   di = (CaptureDeviceInfo)deviceList.firstElement();
              else
                   // Exit if we can't find a device that does linear,
                   // 44100Hz, 16 bit,
                   // stereo audio.
                   System.exit(-1);
              try
                   player = Manager.createProcessor(di.getLocator());
                   sh = new StateHelper(player);
              catch (IOException e)
                   System.exit(-1);
              catch (NoProcessorException e)
                   System.exit(-1);
              // Configure the processor
              if (!sh.configure(10000))
                   System.exit(-1);
              // Set the output content type and realize the processor
              player.setContentDescriptor(new FileTypeDescriptor(FileTypeDescriptor.WAVE));
              if (!sh.realize(10000))
                   System.exit(-1);
              // get the output of the processor
              DataSource source = player.getDataOutput();
              // create a File protocol MediaLocator with the location of the
              // file to which the data is to be written
              MediaLocator dest = new MediaLocator("file://foo.wav");
              // create a datasink to do the file writing & open the sink to
              // make sure we can write to it.
              try
                   filewriter = Manager.createDataSink(source, dest);
                   filewriter.open();
              catch (NoDataSinkException e)
                   System.exit(-1);
              catch (IOException e)
                   System.exit(-1);
              catch (SecurityException e)
                   System.exit(-1);
              // if the Processor implements StreamWriterControl, we can
              // call setStreamSizeLimit
              // to set a limit on the size of the file that is written.
              StreamWriterControl swc = (StreamWriterControl)player.getControl("javax.media.control.StreamWriterControl");
              //set limit to 5MB
              if (swc != null)
                   swc.setStreamSizeLimit(5000000);
              // now start the filewriter and processor
         public void start()
              try
                   filewriter.start();
              catch (IOException e)
                   System.exit(-1);
              // Capture for 5 seconds
              sh.playToEndOfMedia(5000);
              sh.close();
              // Wait for an EndOfStream from the DataSink and close it...
              filewriter.close();
         public synchronized void controllerUpdate(ControllerEvent event)
    }2) StateHelper.java
    import javax.media.*;
    public class StateHelper implements javax.media.ControllerListener {
         Player player = null;
         boolean configured = false;
         boolean realized = false;
         boolean prefetched = false;
         boolean eom = false;
         boolean failed = false;
         boolean closed = false;
         public StateHelper(Player p) {
          player = p;
          p.addControllerListener(this);
         public boolean configure(int timeOutMillis) {
          long startTime = System.currentTimeMillis();
          synchronized (this) {
              if (player instanceof Processor)
                ((Processor)player).configure();
              else
                return false;
              while (!configured && !failed) {
                try {
                    wait(timeOutMillis);
                } catch (InterruptedException ie) {
                if (System.currentTimeMillis() - startTime > timeOutMillis)
                    break;
          return configured;
         public boolean realize(int timeOutMillis) {
          long startTime = System.currentTimeMillis();
          synchronized (this) {
              player.realize();
              while (!realized && !failed) {
                try {
                    wait(timeOutMillis);
                } catch (InterruptedException ie) {
                if (System.currentTimeMillis() - startTime > timeOutMillis)
                    break;
          return realized;
         public boolean prefetch(int timeOutMillis) {
          long startTime = System.currentTimeMillis();
          synchronized (this) {
              player.prefetch();
              while (!prefetched && !failed) {
                try {
                    wait(timeOutMillis);
                } catch (InterruptedException ie) {
                if (System.currentTimeMillis() - startTime > timeOutMillis)
                    break;
          return prefetched && !failed;
         public boolean playToEndOfMedia(int timeOutMillis) {
          long startTime = System.currentTimeMillis();
          eom = false;
          synchronized (this) {
              player.start();
              while (!eom && !failed) {
                try {
                    wait(timeOutMillis);
                } catch (InterruptedException ie) {
                if (System.currentTimeMillis() - startTime > timeOutMillis)
                    break;
          return eom && !failed;
         public void close() {
          synchronized (this) {
              player.close();
              while (!closed) {
                try {
                    wait(100);
                } catch (InterruptedException ie) {
          player.removeControllerListener(this);
         public synchronized void controllerUpdate(ControllerEvent ce) {
          if (ce instanceof RealizeCompleteEvent) {
              realized = true;
          } else if (ce instanceof ConfigureCompleteEvent) {
              configured = true;
          } else if (ce instanceof PrefetchCompleteEvent) {
              prefetched = true;
          } else if (ce instanceof EndOfMediaEvent) {
              eom = true;
          } else if (ce instanceof ControllerErrorEvent) {
              failed = true;
          } else if (ce instanceof ControllerClosedEvent) {
              closed = true;
          } else {
              return;
          notifyAll();
    }When I am running the Applet it crashes.
    Can anyone tell me what the problem is.
    Using JCreater and even commandline both gave same error as below
    java.security.AccessControlException: access denied (java.lang.RuntimePermission exitVM.-1)
        at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
        at java.security.AccessController.checkPermission(AccessController.java:546)
        at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
        at java.lang.SecurityManager.checkExit(SecurityManager.java:744)
        at java.lang.Runtime.exit(Runtime.java:88)
        at java.lang.System.exit(System.java:906)
        at CaptureApplet.init(CaptureApplet.java:34)
        at sun.applet.AppletPanel.run(AppletPanel.java:417)
        at java.lang.Thread.run(Thread.java:619)

    >
    Applets do not have permission to terminate the JVM. I don't write applets, so I don't know what the proper approach is to "end" an applet, ...>You might
    a) Add a new component to a CardLayout that displays the problem.
    b) Pop a JDialog or JOptionPane with same, and/or
    c) showDocument(errorpage.html)
    Edit 1:
    Note that an applet will need to be signed and trusted by the end user, before it has any chance of 'capturing' anything. Even as a fully trusted applet, it will still not be able to System.exit(int).
    Edited by: AndrewThompson64 on Apr 22, 2009 7:38 PM

  • Can anyone solve this out

    Hello All;
    I need the support of you brillant people in solving this
    problem.I have to play a flash file in a qt widget.But presently it
    is not possible. Can any body tell me that how can I play any flash
    file in Qt widget.I have to control all its activity such as volume
    control,resizing event ,etc in a widget.
    If it is not possible than I would request the Adobe flash
    player developers that please provide me a support to solve it, a
    handsome price will be paid according to there service.
    But the conditions are :-
    1. It should play in qt widget.
    2.It has all the controls so that I can pass commands to
    monitore it.
    3.It is able to play all type of flash files.
    4.The operating system must be Linux (fedora 6).
    5.Time duration is with in a week.
    waiting for reply of you brillant people.
    Your New friend,
    Aki Tomar
    Text

    Well, there IS a SWF track inside of QuickTime. I don't know
    anything about QuickTime widgets, but I suspect they still support
    hte Flash track. Trick is, they only support up to a Flash Player 5
    formatted SWF. That functionality hasn't been updated by Apple. (
    http://www.apple.com/au/quicktime/technologies/interactivity/)
    I have no idea if the Linux version has a Flash track ability
    or not. Nor can I advise you how to actually -get- your SWF into
    the MOV. You'll have to google that..
    Can't deliver it the other way around? MOV inside of Flash?
    That's what I'd look at.

  • Can anyone solve this PLL puzzle?

    I created a Phase Locked Loop circuit using Multisim10.0.   It uses the Multisim clock oscillator, and the circuit appears to work great.
    However, I just discovered that if I use the same parts that I used to create the Phase Locked Loop circuit in an oscillator circuit added to the same schematic, the Phase Locked Loop circuit doesn't work any more, while the new oscillator circuit pumps out a frequency that is way off.  4+MHz is no where near 1kHz, the design frequency.
    What happened?   The evidence says my newly-added oscillator brings in something that kills a previously working circuit that uses the same old parts.   Every part used was taken from the previously working circuit, aside from the variable resistor values.  How did the Multisim rules change from 10.0 to 10.1?  What am I missing here?
    Did the Phase Locked Loop circuit really work to begin with?  Which circuit is the broken one?
    As I see things, in order to solve this puzzle, I need to come up with a factor that involves both circuits.  Some factor is going to kill both simultaneously.
    Note what I'm saying here.  (At least when I ran them this was the case.)  Delete just the oscillator circuit, and run the circuit that remains.  It works.  Undo the deletion.  The oscillator reappears where it was, and the previously working circuit stops working.  There's something in that oscillator circuit that kills.  It's like switching on and off a light bulb.
    When I tried to upload both circuits, the extension isn't acceptable now.  Therefore, change the extensions to ms10.   (What the frig is going on??  I just uploaded here yesterday and didn't change the extension.  Am I in the Twilight Zone or something?) 
    Attachments:
    phase_locked_loop.txt ‏1 KB
    phase_locked_loop_puzzle.txt ‏1 KB

    Just curious
    Attachments:
    phase_locked_loop.txt ‏1 KB
    phase_locked_loop_puzzle.txt ‏1 KB

  • HT201210 I am trying to update Ios7 for iPhone 4 but there is an unknown error occurred like (-23). My Laptop OS is Windows 8. Now how can i solved this query.

    Dear Sir/Madam
    I am trying to update Ios7 for iPhone 4 but there is an unknown error occurred like (-23). My Laptop OS is Windows 08.ios 7 update which can updated and remaining  30minutes are left out. Than after error which can be show as i have mentioned above.
    How can i resolved this error? So please help me.
    Thanks & Regards,
    Vatsal Desai

    Error 20, 21, 23, 26, 28, 29, 34, 36, 37, 40
    These errors typically occur when security software interferes with the restore and update process. Use the steps to troubleshoot security software issues to resolve this issue. In rare cases, these errors may be a hardware issue. If the errors persist on another computer, the device may need service.
    Also, check your hosts file to verify that it's not blocking iTunes from communicating with the update server. See the steps under the heading "Blocked by configuration (Mac OS X / Windows) > Rebuild network information > Mac OS X > The hosts file may also be blocking the iTunes Store." If you have software used to perform unauthorized modifications to the iOS device, uninstall this software prior to editing the hosts file to prevent that software from automatically modifying the hosts file again on restart.
    all of this from
    iTunes: Specific update-and-restore error messages and advanced troubleshooting

Maybe you are looking for