Possible in a decode

So I am trying to use a decode statement with my query to do the following:
If col_A is eqaul to the values 12, 13, and 117 output then output 'TEST' for column_B, else output 'Prod' when col_A is equal to 5 and 'Reg' when col_A is equal to 6 as data_state
So my main question is can i do something like this...
DECODE(col_A, (12, 13, 117),'TEST', DECODE(col_B, 5, 'Prod', 6, 'Reg')) as data_state,So...
if col_A is equal to 12, 13, or 117 i want data_state to output 'TEST'
DATA_STATE
TEST
or if col_B is equal to 5, i want data_state to say
DATA_STATE
Prod
or if col_B is equal to 6, i want data_state to say
DATA_STATE
RegI am mainlly having an issue with the aspect of outputing TEST for values 12, 13, and 117. I realize (12, 13, 117) is clearly invalid in my code above. I am just trying to give an idea of how i am coding, basically the (12, 13, 117) is the concept of, if col_A in 12, 13, or 117...not sure if this can be done in a decode.
Using Oracle: 10g

Hi,
You can use case instead. Something like
(case when col_A in  (12, 13, 117) then 'TEST'
       when col_B = 5 then 'Prod'
       when col_B= 6 then 'Reg'
       end ) as data_state -Arun

Similar Messages

  • [SOLVED]:Is it possible to use functions like decode in 'setWhereClause()'?

    Hello,
    My requirement is that I have 2 poplists - Country and States.
    When I select a country,the corresponding states of that country should get populated in the states poplist.
    The approach I took is that :
    I selected firePartialAction as ActionType in Country poplist. Then I called a function to VOImpl of StatesVO and set the where clause there.
    Now I was thinking about using decode as there is no direct connection between the CountryVO and StatesVO.
    Is it possible to use functions like decode in 'setWhereClause()'?
    For Example:
    setWhereClause("DECODE(LOOKUP_TYPE,'XXC_IND_STATES','IND','XXC_US_STATES','US') = :1");
    setWhereClauseParam(0,Country);
    executeQuery();
    When I tried running the page,no error was given but when the country poplist was changed - there is no change in states poplist.
    If its not possible to use decode in setWhereClause(), could you please guide me as to how I can write a query to retrieve a value from a table and store it in a variable 'A'- so that I can pass that variable 'A' in setWhereClauseParam function .
    Message was edited by:
    Anju Susan

    That kewl, but for u knowledge u can add anything in ur where clause of query through ur code in Voimpl class. It is even possible to do change entire query, see Voimpl class methods in javadoc.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Decode in an insert statement

    Is it possible to use decode base on a pl/sql variable in field declaration of an insert statement?
    For example:
    INSERT INTO emp_schedule
    (employee_id,
    schedule_date,
    destination,
    start_time,
    absent,
    late,
    entry_date_time,
    decode(v_bucket_id,
    1,
    bucket1_class,
    2,
    bucket2_class,
    3,
    bucket3_class,
    4,
    bucket4_class,
    5,
    bucket5_class,
    6,
    bucket6_class,
    7,
    bucket7_class,
    8,
    bucket8_class,
    9,
    bucket9_class,
    10,
    bucket10_class,
    11,
    bucket11_class,
    12,
    bucket12_class,
    13,
    bucket13_class,
    14,
    bucket14_class,
    15,
    bucket15_class,
    16,
    bucket16_class,
    17,
    bucket17_class,
    18,
    bucket18_class,
    19,
    bucket19_class,
    20,
    bucke20_class,
    bucket1_class),
    bucket1_class_reghrs,
    bucket1_sched_hrs,
    actual_hours,
    actual_start_time,
    shift,
    on_the_clock,
    end_of_shift_complete)
    VALUES
    (v_employee_id,
    v_payroll_date1,
    v_destination,
    v_start_punch,
    'N',
    'N',
    SYSDATE,
    v_class_number,
    v_actual_hrs,
    0,
    v_actual_hrs,
    v_start_punch,
    v_shift,
    v_on_clock,
    'N');

    You have the DECODE in the wrong place
    INSERT INTO emp_schedule
         employee_id,
         schedule_date,
         destination,
         start_time,
         absent,
         late,
         entry_date_time,
         bucket1_class,
         bucket2_class,
         bucket3_class,
         bucket4_class,
         bucket5_class,
         bucket6_class,
         bucket7_class,
         bucket8_class,
         bucket9_class,
         bucket10_class,
         bucket11_class,
         bucket12_class,
         bucket13_class,
         bucket14_class,
         bucket15_class,
         bucket16_class,
         bucket17_class,
         bucket18_class,
         bucket19_class,
         bucket20_class,
         bucket21_class,
         bucket1_class_reghrs,
         bucket1_sched_hrs,
         actual_hours,
         actual_start_time,
         shift,
         on_the_clock,
         end_of_shift_complete
    VALUES
         v_employee_id,
         v_payroll_date1,
         v_destination,
         v_start_punch,
         'N',
         'N',
         SYSDATE,
         DECODE(v_bucket_id, 1,  v_class_number),
         DECODE(v_bucket_id, 2,  v_class_number),
         DECODE(v_bucket_id, 3,  v_class_number),
         DECODE(v_bucket_id, 4,  v_class_number),
         DECODE(v_bucket_id, 5,  v_class_number),
         DECODE(v_bucket_id, 6,  v_class_number),
         DECODE(v_bucket_id, 7,  v_class_number),
         DECODE(v_bucket_id, 8,  v_class_number),
         DECODE(v_bucket_id, 9,  v_class_number),
         DECODE(v_bucket_id, 10, v_class_number),
         DECODE(v_bucket_id, 11, v_class_number),
         DECODE(v_bucket_id, 12, v_class_number),
         DECODE(v_bucket_id, 13, v_class_number),
         DECODE(v_bucket_id, 14, v_class_number),
         DECODE(v_bucket_id, 15, v_class_number),
         DECODE(v_bucket_id, 16, v_class_number),
         DECODE(v_bucket_id, 17, v_class_number),
         DECODE(v_bucket_id, 18, v_class_number),
         DECODE(v_bucket_id, 19, v_class_number),
         DECODE(v_bucket_id, 20, v_class_number),
         DECODE(v_bucket_id, 21, v_class_number),
         v_actual_hrs,
         0,
         v_actual_hrs,
         v_start_punch,
         v_shift,
         v_on_clock,
         'N'
    );

  • Decode null with function call

    Hi
    Is it possible to use decode in select for the below scenario, if so what is the correct syntax
    IF function one returns null I want to call display the value from function 2 in decode statement.
    Regards
    anna

    Hi, Anna,
    I would use COALESCE for that:
    COALESCE (a1, a2, a3, ...)returns the first of its arguments (there can be as few as 2, and probably at least 100) that is not NULL.
    If you need help, post some sample data (CREATE TABLE and INSERT statements), function code, and the results that you want from that data.

  • If-then-else in a select statement

    hi, is it possible to make a if-then-else in a select query, something like:
    select name, age, if(sex=f,1,2) as my_columnn from table1;
    thx.

    Hallo,
    yes it is possible:
    1. with decode
    select name, decode(sex, 'f',1,2) as your_column from table1;
    2. with case
    select name, case when sex='f' THEN 1 ELSE 2 END) as your_column from table1;
    Regards
    Dmytro

  • UDF of type "Lookup" - doesn't accept "space/Empty" value in lookup defn

    Hello there,
    I have created a Combo Box UDF field - but I don't want to put any value in it. If I give only "space" in Encode and Decode - it gives error of providing some value to it. I want to give a default blank value over there along with other values so that the user is free to declare an empty value if he/she doesn't wants to provide one otherwise the user has to mandatorily provide some value to this like "NULL/zzz/NOTHING" as a string.
    Is there anyway we can achieve this - giving blank value in a lookup/combo field ?
    TIA,
    - oidm.

    I don't think you can enter nulll/space in decode.
    For Lookup Field Code as well as Decode can't be null.
    If you want to give blank so it is not possible APMK, in decode you can give ---. You can treat it as Blank.
    Code Key > NULL
    Decode > ---

  • [AIR 3.0] New JSON functionality doesn't work in FlashPro: Error #1065: Variable JSON is not defined

    After upgrading the AIR SDK to 3.0 in Flash Professional CS5.5 I've found some problems.
    First, the JSON class in the as3corelib.swc library now throws a couple of compile errors:
    1061: Call to a possibly undefined method decode through a reference with static type Class.
    1172: Definition com.adobe.serialization.json:JSON could not be found.
    At first I was completely puzzled, since I had the proper "import com.adobe.serialization.json.JSON;" reference,
    and I had the "as3corelib.swc" referenced in my ActionScript Properties, so how could that not be found?
    Then, I found out that's because it conflicts with the new internal JSON class included with AIR 3.0
    (maybe it should have been called something else, to avoid conflicts with Adobe's own as3corelib library).
    The new native JSON class doesn't have the decode() method. Now it's called parse()
    Ok, so I've tried using the new JSON class, but after changing decode() with parse() and removing
    the "import com.adobe.serialization.json.JSON;" reference, Flash tells me that "Variable JSON is not defined".
    Really? The JSON class is showing in the Flash Builder code completion popup,
    complete with its all-new parse() and stringify() methods! So why does it say it's not defined?
    Also, my SWF file gets compiled with no errors at all, so that verifies that the new 3.0 libraries are in place.
    I only get the "JSON is not defined" error at runtime in ADL, not at compile time. Why?
    In order to upgrade to the AIR 3.0 SDK, I've followed this guide:
    http://kb2.adobe.com/cps/908/cpsid_90810.html
    I know that's about upgrading to AIR 2.7, but I suppose the steps to upgrade to AIR 3.0 would be very similar,
    only with the AIR3.0 SDK package, instead of 2.7.
    I also took care to type version="13" in all the XMLs, instead of version="12" as stated in that guide, which is meant for 2.7.
    Also, I followed this advice about adding -swf-version=13 in the Project Properties window in Flash Builder:
    http://blogs.adobe.com/cantrell/archives/2011/08/how-to-use-the-air-3-beta-sdk.html
    But that doesn't seem to make a difference, since, even though I use Flash Builder for code editing (which is usually used for Flex),
    my project is a Flash Professional project, not a Flex one, and when testing the project, Flash Builder runs Flash Professional
    to compile and then runs adl.exe (it's the same as if you click the option "Control / Test movie / in AIR Debug Launcher (Mobile)" inside Flash Pro).
    In the "ActionScript Settings" window in Flash Professional, I also have the proper airglobal.swc referenced (from the AIR 3.0 SDK),
    and the same airglobal.swc is referenced in Flash Builder as well (in "Referenced Libraries"), to get proper code completion.
    I've tried all sorts of things to try to get it to work, but no luck. Still get the "JSON is not defined" error at runtime.
    I'm starting to get desperate about this. I'm going to have to revert back to AIR 2.7.1, to stop wasting time on this issue.
    BTW, I'm also having another unrelated problem (though maybe it happens because of the same reason as the other problem).
    Now Flash Builder underlines the getTime() method in my code, as if it no longer were a method of a Date class instance.
    I have a line where I ask for the timestamp like this:
    ts = new Date().getTime();
    That has worked perfectly fine up until now with AIR 3.0.
    Now, when hovering the mouse cursor over the orange "(?)" icon that appears at the left, Flash Builder tells me
    "Access of undefined property getTime". Why?
    The AS3 documentation doesn't say anything about getTime() getting deprecated of anything of the sort:
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Date.html
    In fact, in the code completion popup that Flash Builder shows, now there isn't any mention
    of get or set methods, as you can see here:
    I suppose I can use the .time property instead of .getTime() but I don't know why I'm not getting all the methods I had available before.
    Any ideas why all this is happenning? Specially the dreaded "JSON is not defined" error.

    Well, after much tinkering, I think I've finally found a way to finally make it work!.
    I've created some modified XML files with the profiles needed for AIR 3.0 and after a lot of tries, it finally works!
    I've uploaded them here: http://www.mediafire.com/?d5e761frl5px4
    These are the steps needed to get AIR 3.0 running properly:
    Put all three files into the folder "c:\Program Files (x86)\Adobe\Adobe Flash CS5.5\Common\Configuration\Players"
    Then, make sure you've unzipped the AIR 3.0 SDK into the folder "c:\Program Files (x86)\Adobe\Adobe Flash CS5.5\AIR3.0" Do not overwrite the contents of the "AIR2.6" folder, as suggested by the "Overlay AIR SDK" article (linked in the above post). It gave me problems. It's best to use a different separate folder. My XML files point to that new "AIR3.0" folder.
    Inside the folder "c:\Program Files (x86)\Adobe\Adobe Flash CS5.5\Common\Configuration\ActionScript 3.0" create a new folder named "AIR3.0". Inside that folder, copy the file "airglobal.swc" located at "c:\Program Files (x86)\Adobe\Adobe Flash CS5.5\AIR3.0\frameworks\libs\air".
    Finally, you will have to keep the file "descriptor-sample.xml" in the "c:\Program Files (x86)\Adobe\Adobe Flash CS5.5\AIR2.6\samples" folder, but change the xmlns attribute to "http://ns.adobe.com/air/application/3.0"
    Yes, you have to change that inside the AIR2.6 folder even if the SDK has been put into AIR3.0. That's because of how the publish settings work in Adobe Flash. It's hardcoded into a DLL, so that can't be changed. Not very intuitive.
    I think AIR SDK installations should be a lot more straightforward than this! I know Adobe AIR is meant for developers, not for final users, but still, all these not very well documented upgrade procedures are a pain in the ***. I've wasted A LOT of hours in this (more than half a day), with what should have been a straightforward upgrade!
    Adobe should make a SDK installer so we do not have to be tinkering with all these error-prone procedures each time a new update is released!
    Well, I hope those XML files are useful to somebody and avoids further frustration.
    Regards,
    OMA2k
    PD: BTW, I still have the .getTime() issue described in my above post, but it's not very important,
    since I can still use the .time property. Still, it puzzles me why this is happening.

  • X-Fi Xtrememusic and all X-Fi products

    I have been corresponding with CL techs via email and telephone re: the connection of my xbox360 to my X-Fi XtremeMusic soundcard via optical cable to produce 5. DD from my analogue speakers (Creative T7700). After doing ALOT of research, many ppl (CL lab techs, other sound card companies, forum members) have stated that this is NOT possible as the decoder of DD lies within the software and NOT the hardware of the X-fi soundcard. Thus, the X-Fi XtremeMusic CAN NOT DECODE 5. DD from an xbox360 and you would need an external decoder like DDTS-00. HOWEVER, I came across several CL techs by email and this is what they told me:
    Email :
    I understand from your email that you like to know if there is specific driver for X-Fi Xtreme Music sound card. I am sorry for any inconvenience this is causing you. Please let me assist you. For your information there is a built-in decoder on the X-Fi Xtreme Music sound card. Therefore the signal from a game console such as an Xbox can be decoded & output to analog speakers. There is no need for an I/O Dri've. You may use a digital Toslink cable to 3.5 mm plug.
    Email 2:
    With regard to your email, please be informed that the X-FI Extreme Music sound card is able to decode the 5. DD signal via optical connection to analog speakers. Instead of purchasing the I/O Console, you can get a Tosslink to Minijack adaptor for the connection from the Xbox to Xfi Extreme Music sound card. Please be informed that the decoding will only work on Win XP and not on a Windows Vista PC. In case if you need any clarification, please do not hesitate to contact us.
    Email 3:
    Prior to getting to the email form on our website, you were asked to try some basic troubleshooting for the issue that you identified. The steps that you were walked through resolve some issues with your product. Some of the information that I provide in this message may be repetiti've but it is still valuable information for troubleshooting your device. Yes it can since the X-Fi XtremeMusic has a built-in decoder.
    Email 4:
    With regard to your email, i believe that you are enquiring on a sound card which is suitable for Xbox connection so that it can output 5. sound via the analog speakers connected to the sound card. To do that, you would need to purchase a XFi Extreme Music sound card and an Xfi I/O Console.
    So this concludes my message. I do not know who is right. I deliberately wrote the names of the authors of the emails above so that other Creative techs can clarify with them. The emails have stated that I can connect use the digital connection from my 360 to the flexijack of the x-fi XtremeMusic and get 5. DD sound but others have stated that I cant since the decoder is in the software. Can someone from CL tech explain to me this discrepancy? Thanks, I appreciate it alot.
    Message Edited by turok_t on 0-0-2009 0:58 AMMessage Edited by turok_t on 0-0-2009 02:00 AMMessage Edited by turok_t on 0-0-2009 02:05 AMAdmin Notes: Thanks for letting us know, please understand that I have to remove the name of the Customer Support Advisors for their privacy.
    Message Edited by KokChoy-CL on <span class='local-date'> 0-2-2009<span class='local-time'> 02:02 [email protected]

    turok_t wrote:
    ...the sound card itself can not decode the signal so its useless.
    I wouldn't say that. The card doesn't need to. It's nicer if it appears to do so than if application programs have to be relied on.
    Yes, I have heard that previous?sound cards (not just Creative) had built in decoders to the hardware. This was for 2 reasons. ) Privacy and copyright reasons from Dolby Digital themselves. 2) Codecs change very quickly which means that the hardware will be obsolete once a new codec is released. Thus, it is more efficient to embedd the codecs in software itself. This is based on one of the correspondences with a CL tech staff member.
    There may have been soundcards that included hardware decoding, but I've only heard of one, which was an early USB-interfaced one by CL which was almost stand-alone in character. I have a vague memory of some card with a DSP chip being programmed for it, but I also have this sense this was vaporware or a baseless claim.
    Almost all soundcards punt and say they support decoding but really just include a copy of PowerDVD or similar that actually does it (which CL has started doing recently, unfortunately), but CL has pretty much been unique in including a driver-based decoder which makes the card look like it does do decoding. As far as I can tell, the Xtrememusic is one of those. ? In most cases these support digital-in decoding from an external digital input, but you usually needed the I/O dri've to have the digital input it supported that for. As I said, the formal manual shows explictly how to make an optical connection from a DVD player to the I/O Dri've or I/O console expressly so the card's decoding can be used to hear DD/DTS on the computer's analog speakers.
    As far as your comment about hardware becoming obsolete, why haven't I heard about this being a problem for DD/DTS receivers. That's hardware,
    isn't it's
    Yes, you will need to specify the source if multiple sources are connected to the sound card.
    Only if more than one is supported and it is not the default. It is entirely possible that if there is more than one external digital input, only one of them is actually supported as a decoding input.
    Well, I think its kinda dumb to put a flexijack that is nonfunctional for digital I/O unless you buy the I/O console or dri've separately. Many consumers, including me, thought that external devices can be directly connected to the flexijack since it is Digital I/O. IMO, this is a bit misleading.
    There is only so much real estate on the card's slot cover, and you can't help that some people are apt to jump to unwarranted conclusions. In fact, you can connect external devices to the flexijack directly, in the output direction such as connecting the card to a receiver's coaxial digital input, but you need the Digital I/O Module to do that optically, or to do either form of digital input. You can do so without the I/O console or dri've in addition. The question is not that the flexijack cannot be used for digital input, it's whether the card's decoding feature supports decoding from it, or only from the digital inputs on the dri've/console. It might, but to say it does or doesn't would be an unwarranted conclusion, since I don't have confirmation either way. I also don't know the effect of Vista, if you're using it, but I know that once again drivers had to be rewritten for it, and when that happens, esoteric features may get broken or not work for awhile. (Microsoft seems to be quite incapable of architecting a stable driver environment.)? Plus, drivers rewritten for Vista might force CL to renegotiate the Dolby licensing, which even might be the reason CL has stopped supplying driver-based decoding in some cases.
    To me, it doesnt really matter how many external digital inputs are connected or whether you can switch between digital inputs?from multiple input sources. The fact remains that the Xtrememusic currently can not decode 5. DD li've regardless if you have an adaptor (optical>3/5mm), I/O module, I/O console. In other words,?you can find many ways to connect external devices to the sound card, but the sound card cant INTERPRET and DECODE those digital inputs.
    It can.
    -Dave
    [email protected]

  • OSB: Calling MTOM business service from non-MTOM proxy

    Hi,
    it is very easy to call non-MTOM business service from MTOM enabled proxy service, but I don't know how to do it in an opposite way. I have web service proxy (http) with binary data in Base64 in a soap body element and I'd like to call a business service (web service over http again) using MTOM format to send binary data in binary format (and not in Base64 as it is in proxy). Is it possible to somehow decode binary data from Base64 in a proxy service and send them from this proxy to a business service using MTOM?

    I understand the flow you propose, but I don't know how to pass decoded data from Java callout back to message flow. As far as I know I can only return primitives, String and XmlObject, because anything else can't be processed in message flow.Yes you are correct.But you can also return DataSource in java callout. Please http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/pojo.html
    Now the working solution/POC --Tested on my local linux box
    package manoj.javacallout.binary;
    import java.io.BufferedReader;
    import java.io.ByteArrayOutputStream;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.OutputStream;
    import javax.activation.DataSource;
    import javax.mail.util.ByteArrayDataSource;
    import com.sun.org.apache.xml.internal.security.utils.Base64;
    * TODO: I have use sun internal API for decoding for simplicity. You should modify this code with any base64 decoding library
    * Ideally should be using using http://commons.apache.org/downloads/download_codec.cgi
    * @author mneelapu
    public class Util {
         public static DataSource decodeBase64(DataSource ds) throws Exception {
         InputStream in=ds.getInputStream();
         BufferedReader bin = new BufferedReader(new InputStreamReader(in));
         byte[] decodedB64=Base64.decode(bin);
         ByteArrayDataSource decodedDS= new ByteArrayDataSource(decodedB64,"binary/octet-stream");
         return(decodedDS);
    Java Callout to decodeBase64
    Parameters
    javax.activation.DataSource=[ $body/* ]
    Result
    javax.activation.DataSource=response
    Now replace the $body with the decoded base64 response from java callout
    Replace [ node contents ] of [  undefined XPath  ]
    in [ body ] with [ $response ]
    Use $BEA_HOME/modules/javax.mail_1.4.jar for compiling.
    Let me know if this solves your problem.
    Thanks
    Manoj
    Edited by: mneelapu on Apr 20, 2009 3:23 PM

  • Change color of column background when entire column meets a condition

    I'm trying to create a report that visually indicates staffing coverage during certain hours. The report has the hours of the day as column headers, and for each person-row, a column can contain a 0 if that person is not scheduled for that hour, a 1 if one person is scheduled for that hour, or 2 if 2 people are scheduled for that hour, etc.<p>
    What I need is to show gaps in coverage, so I need to color red those columns where there are 0's for all rows in that particular column.<p>
    thanks!

    Couldn't you do this in the report SQL itself<BR><BR>The problem I see with this is that based on what she's asking (i.e. all rows in that column must be zero), you will not know if a column should be marked in red until after all of the rows have been retrieved and displayed. To do what you suggest, you'd have to run the report once to find columns that sum to zero, i.e.:<BR><BR>
    SELECT SUM(col1), sum(col2)...<BR>
    INTO v_sum_col1, v_sum_col2...<BR><BR>
    Then for any column with a sum of zero -- add in the code you suggest into the second SELECT to return the data, possibly with a DECODE twist:
    DECODE(v_sum_col1, 0, '&lt;span style="background-color:pink"&gt;0&lt;/span&gt;', col1)

  • Base64 problem

    Is it possible to encode/decode a key in Bytes using Base64 functions. Can u please suggest me the syntax for it.

    Is it possible to encode/decode a key in Bytes using
    Base64 functions. Can u please suggest me the syntax
    for it.Yes. It is not a matter of 'syntax'; you will need a Base64 library. There are several free ones available. For example, 'codec' available from - http://jakarta.apache.org/commons/index.html . Google will help find others.

  • CS6 Error with JSON

    Updated one of my projects to CS6 and now get error...
    Line 188 1061: Call to a possibly undefined method decode through a reference with static type Class.
    CODE:
    import com.adobe.serialization.json.JSON;
    if ("" != scormSuspendString) scormSuspend = JSON.decode(scormSuspendString);
    This also occurs with the JSON.encode.
    Becuase of differences in CS6 and CS5.5, could this be another problem?
    THANKS

    kglad,
    I totally missed your first line of code refering to parse/stringify. I've sense revised my coding to use these two functions. Works just as well without including the long class naming in front of JSON.
    NOTE: Coding is in reference to SCORM
    REVISED CODE:
    OBJECT
    public var scormSuspend:Object = {completeArray: new Array(), lessonFrame: new Array(), completed: false, resume: false};
    public var scormSuspendString:String = "";
    DECODING JSON
    scormSuspendString = scorm.get("cmi.suspend_data") as String;
    if ("" != scormSuspendString) scormSuspend = JSON.parse(scormSuspendString);
    ENCODING JSON
    scormSuspendString = JSON.stringify(scormSuspend);
    THANKS AGAIN

  • Blink custom cursor

    Hi to all.
    I'm having problems changing the look of the cursor of my app. Sometimes, when the user let the mouse pointer on certain areas of the principal panel, the cursor look must change for a custom look that I have created. The problem is that when I change the aspect of the system cursor, for my custom cursor, it start to blink sometimes, and it stays blinking when I move it on areas where the cursor have to have this custom look. I'm using a code like this.
    All this is into a class that extends from JPane.
    public void paintComponent(Graphics g) {
            Toolkit toolkit = Toolkit.getDefaultToolkit();
            Image image = toolkit.getImage("CrearTransiciones.gif");
            Point hotSpot = new Point(15, 15);
            Cursor cursor = toolkit.createCustomCursor(image, hotSpot, "CrearTransiciones");
            if (cursorIsOver().equals(ZoneOver.Zone1)) {
                setCursor(cursor);
            } else {
               if (cursorIsOver().equals(ZoneOver.Zone2)) {
                   setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
               } else {
                  if (cursorIsOver().equals(ZoneOver.Zone3)) {
                      setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
    }I have also proved to set the hotSpot into the (0, 0) point, but I'm still having the same problem.
    Someone knows what I have to do to avoid the annoying blinking?
    Thanks for read.

    I think the problem may be the fact that you are changing the cursor in paintComponent() regardless of what the cursor currently is; I would change the code to check if the cursor is already the cursor you want it to be; if so then skip the setCursor().
    You are fetching the image every time a paintComponent() call is made. That is not very efficient. I would fetch the image once (in the constructor perhaps?), store the cursor in a member variable and just use it whenever you need it. The rule is that a paint() or paintComponent() call should take as little time as possible, loading and decoding an image from disk is not exactly a fast action.
    Also, you are aware that you can do "else if" in stead of nesting the if statements like that?

  • OS 9 doesn't recognize .bin file

    Hello All:
    I downloaded iTunes for my friend as described in this article:
    Hi -
    You can download iTunes 2.0.4 from this Apple KBase article -
    http://docs.info.apple.com/article.html?artnum=120073
    but my friend's Mac won't recognize the .bin file. How do I get it to recognize this file type, or is this really another problem?
    Thanks!
    Bob

    Hello Don,
    The only sensible solution in this case, as you have already pointed out, would be to obtain an appropriate Mac OS 9 install CD; both for StuffIt Expander and in order to have a bootable disc at hand.
    If an install CD is not yet available, and Bob would like to try other ways to get StuffIt Expander in the meantime, here are some additional comments:
    There is a Stuffit archive format, .sea, which can be decompressed without using Stuffit Expander. ".sea" stands for "Self-Extracting Archive" - the archive itself contains sufficient program code that it will run and decompress itself when double-clicked. I suspect that the reason that format is not used for downloads is that it acts like a program (if you do a Get Info on one it will be reported as being an application program) - and so probably has vulnerable codes.
    Yes, that is the way I see it, too. Since a PC, normally, cannot handle the resource fork of the file, the "clickability" of the .sea would get lost without a protective outer "shell" of MacBinary (.bin) or BinHex (.hqx) encoding. You would not be able to launch the built-in unpacking program of an unprotected .sea file, but it should be OK to regain the data portion by dragging the file onto a StuffIt Expander program icon (or by opening it from within StuffIt Expander). Not very useful for downloading StuffIt Expander itself, that is, if one does not have StuffIt Expander.
    For older Macs, with a built in floppy drive, I usually recommend getting a ready-to-use version of StuffIt Expander for Macintosh via a PC . This is how it works: Begin by downloading the MACDISK.EXE file here onto the PC. Prepare an empty 1.44 MB PC-formatted diskette through the FORMAT A: command in DOS or the "full" formatting option under Windows. Launch the MACDISK.EXE program on the PC. Follow the instructions on screen. The result will be a Mac-formatted floppy, complete with a StuffIt Expander 4.0.1 installer. Once installed, in a suitable environment, the 4.0.1 version can be used to decode many files. If a newer StuffIt Expander version (e.g. 5.5) is needed to handle certain decompressions, a download from ftp://ftp.allume.com/pub/archive/mac/StuffIt_Expander should now not be too difficult.
    With a more modern Mac, without a built-in floppy drive, the situation gets more complicated. Even with access to an external USB floppy drive, one can not assume that the 4.0.1 installer will run on the new machine (and if it does, the 4.0.1 program may not).
    There are PC utilities for Mac disks (an old freeware application called HFVExplorer could once be found via a Google search) which can internally process MacBinary and/or BinHex files while placing the decoded result on a plain Mac-formatted 1.44 MB floppy. This means that one can download a .bin or .hqx StuffIt Expander program file as it is (for instance, directly from the aforementioned ftp site) onto a PC (without attempting to decode or decompress in a PC file system surrounding), and then decode it while in transit to the Mac floppy. With a USB floppy drive at the Mac end, this will improve the chances to get a properly working version of StuffIt Expander.
    Some web browsers and certain email programs may be capable of directly decoding at least BinHex files. This would per se make it possible to download .hqx files from the above site, or having .hqx files sent by a friend. However, without a functioning Internet connection that would not be of any use in this very case.
    Another possibility might include decoding encoded files sent by a terminal emulation application over the telephone lines, provided that a program of a corresponding type is installed at the receiving end.
    Regards,
    Jan

  • Importing DVD to FCP questions

    I did a search on importing DVD content into FCP. I have read a lot of the articles but I still have questions.
    I have about 8 DVD's that I have to pull clips from. There are about 18 clips. I know it is possible to just decode those clips. I am going to be editing this in FCP so here are my questions.
    Which software is easier as far as setting in and out marks for the decoding of the DVD (mpegstreamclip or Handbrake)? I know I have to Encode the DVD to MPEG-4. Is this the default in mpegstreamclip or Handbreak? I also read that you have to demux the file before you import it into FCP. Is this an option in mpegstreamclip or handbreak?
    One last thing, I know that a DVD is MPEG2 and I have to convert it to MPEG 4 but is it better to transfer the DVD to DVCAM and then capture the tape or use the software to rip the files. As far as quality, I would assume it is the same thing but I would like to hear it from the Gurus.
    Any advice would be much appreciated.
    thanks
    Dual G5 2.0   Mac OS X (10.4.5)  

    Given the fact that both are free or very inexpensive downloads, give them both a try.
    MPEG Streamclip extracts are variety of QT formats. And you do not have to encode the DVD to Mpeg4, instead mpeg2.
    Not certain why you are calling something a fault of the program.
    You might want to explain, and remember these programs do not work with encrypted DVDs.
    best wishes
    David
    Remember to mark an response helpful or solved.
    It protects the integrity of the board.

Maybe you are looking for

  • Connecting my Macbook Pro!

    Hello everyone! So, I am going to be purchasing a new television once I graduate this may for my apartment...an HDTV .. they are getting cheaper by the minute! Anyway, I have movies on iTunes and such that I want to be able to watch easily and other

  • EJBCompiler Exception when trying to deploy application in a cluster

    Hi,           I have setup a cluster environment with 2 Managed Servers. While I tried to deploy the application using the Admin console, I got the following exception on both managed servers. I have tried suggestions from different websites:        

  • Most efficient way to strip nulls from a Double[] array?

    I'm trying to optimize performance of some code that needs to accept a Double[] array (or a List<Double>) and fetch the median of the non-null values. I'm using org.apache.commons.math.stat.descriptive.rank.Median to fetch the median after converting

  • Node Application - effectivness?

    Just how effective is it when a another Mac is used as a Node. I am currently using a G4 PowerBook 1.25GHz (2G RAM) which is struggling with my extensive use of software instruments and plug-ins. I am considering purchasing the latest edition of the

  • CS4 displaying images/text really low res

    Not sure what happened but my vector images are coming out really low res... i have an 09 macbook pro, just upgraded to osx mountain lion, running CS4 [URL=http://s324.photobucket.com/user/niudude/media/ScreenShot2013-09-12at62000PM_zpsa8fee4c0.p ng.