A NullPointerException in a problematic point of code?

Hello!
In one of my NetBeans 6.5.1 projects
there is an ordinary MIDlet
which should be able to change the Canvas used by the MIDlet
in method startApp.
The MIDlet class is as follows:
public class OSMIDlet extends MIDlet implements CommandListener
* Called when MIDlet is started.
* Checks whether the MIDlet have been already started and initialize/starts or resumes the MIDlet.
public void startApp() {
if (midletPaused) {
resumeMIDlet ();
} else {
initialize ();
startMIDlet ();
WelcomeJK pictureSequence = new WelcomeJK (this);
Display.getDisplay (this).setCurrent (pictureSequence);
midletPaused = false;
} /* end class 'OSMIDlet' */
Now when using the debugger of NetBeans 6.5.1 IDE
it turns out that the line
Display.getDisplay (this).setCurrent (pictureSequence);
causes a NullPointerException to be thrown.
It seems that trying to catch that exception does not help
in finding out where the problem is since
it really seems that the Display object
given by Display.getDisplay (this) is null
while there should be existing a reference to a valid object.
Method Display.setCurrent (Displayable?) should not
throw a NullPointerException if variable pictureSequence is null.
Could you please help me to resolve this problem? Thank you.
Kind regards,
Lauri J. Martikainen

Use code tags to post codes -- [code]CODE[/code] will display asCODEOr click the CODE button and paste your code between the {code} tags that appear.
db

Similar Messages

  • Find break-points source code (update rules, transfer rules)

    Hi all,
    Is there any effective and efficient way to find (active) break-points in source code, more specfic update rules, transfer rules or other objects where custom code is implemented? Or in other words look for strings in source code or programs.
    I looked and searched everywhere but could not find any answer.
    RSRSCAN1 (does not work)
    RPR_ABAP_SOURCE_SCAN (does not exist)
    We are on SAP BW 3.5 with SAP Basis 640.
    Thanks all.

    Hi,
    Try this
    1)  if you're checking any program from SE38 ..goto Utilities -> find in the source code-> give breakpoint and search.
    2) else. load data , Goto details tab in the monitor and right click on any of the data packages.
    Simulate update -> choose transfer rules or update rules for debuging.-> It will take you debuging screen. -> Create a watch point with key word "break-point" and execute (F8).
    It will go and stop where there is  "break-point"

  • Need Help with Cue Points/Custome Code

    So I've figured out that videos with a playback component need cue points in order to set up all the interactivity I want to use. The only way to make animated graphics, interactive graphs and text is to apparently create custom code, which I no zip about.
    Should I hire someone to do that for me? I was thinking elance, but does anyone have any suggestions on how to make an interactive video other ways (or cheaper)ways.
    p.s
    how much do you think I should charge for that:)?

    My advice... start with a very simple "proof of concept" project before you attempt the entire package.
    It will be much easier to scale up if you first have a very good understanding of what's going on.
    So one simple video with just one cuepoint and only one button and additional display. You'll also have to work out the interaction of pausing the video when a cuepoint is reached or button pushed to display the graph, giving the viewer time to read the graph... then when the viewer closes the graph, the video should "resume".
    Start very simple and build on that only after you understand the fundamentals.
    Second, you mention "video reports"... plural. So that most likely means that you will need a video player with a "playlist".
    This may mean that you'll need to learn to use a little .xml to bring in the playlist data. You may also find xml an excellant way to bring other data into you project.
    At the link listed above there is an excellant tutorial on "Integrating Flash and XML"
    "Flash and XML"
    "XML Video Playlist"
    "ActionScript 3 XML Basics"
    "ActionScript 3 Advanced XML"
    Personally I would not even begin a project like this without considering how I could use xml to feed data into the project.
    Here's an example of a video player I created that has a playlist, thumbnails, categories, transcipts, "Now Playing" etc. All that data comes into the main .swf via various xml files. Super good way in input data into Flash.
    http://www.drheimer.com/video/
    Yours is a rather ambitious project and will take awhile to gain the skill and assemble the pieces. So when you come to a new part... first create a real simple "proof of concept" model so you can learn how that section works. Don't expect to be able to assemble the entire project all at once.
    Best wishes,
    Adninjastrator

  • Preorder points for COD AW

    Hi I preordered COD AW on 10/31. The preorder should have awarded 10 dollars up to 20 days later. It's now past 20 days and I never received the 250 points. Can someone please look into this?

    Hey nybigapple,
    Based on what you mentioned, it sounds like you're already aware of the reason why your pre-order bonus certificate hasn't posted yet: your pre-order deposit wasn't correctly applied to the final sale. I've taken steps to ensure you receive that bonus though, so please keep an eye on your points balance on BestBuy.com for updates. Also, remember that points are not earned for any portion of a purchase paid for by gift card, store credit, or reward certificates.
    Thanks for reserving and purchasing your copy of Call of Duty: Advanced Warfare with us! I hope you're enjoying the game so far.
    Aaron|Social Media Specialist | Best Buy® Corporate
     Private Message

  • Changing the file name dynamicallly in file Adapter - NullPointerException

    Hi, I want to change the file name directly from Java Mapping in the file adapter for this i have written this code:
    [code]
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http:""/""/"+"sap.com/xi/XI/System/File","FileName");
    String newFileName = CCC'_'NNN'_'NOMCIA'_'DATE;
    conf.put(key, newFileName);
    return newFileName;[/code]
    Where CCC, NNN, NOMCIA and DATE are input of the user-defined function.
    but it gives a null pointer exception:
    [code]16:44:53 Start of test
    Runtime exception during processing target field mapping /ns0:MT_HSBCAltasTrabajadores_TEST/row/separador7. The message is: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._MM_JDBC_2_HSBCAltasTrabajadores_TEST_ method FileName$[123, James, Gates, Spectory, com.sap.aii.mappingtool.tf3.rt.Context@247d247d]
    com.sap.aii.mappingtool.tf3.MessageMappingException: Runtime exception during processing target field mapping /ns0:MT_HSBCAltasTrabajadores_TEST/row/separador7. The message is: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._MM_JDBC_2_HSBCAltasTrabajadores_TEST_ method FileName$[123, James, Gates, Spectory, com.sap.aii.mappingtool.tf3.rt.Context@247d247d]
    at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:347)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:398)
    at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:141)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:102)
    at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInternal(ServerMapService.java:431)
    at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:169)
    at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52)
    at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.execute(MapServiceRemoteObjectImpl0.java:301)
    at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:146)
    at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
    at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
    at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
    at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
    at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    at java.security.AccessController.doPrivileged(AccessController.java:215)
    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Root Cause:
    com.sap.aii.utilxi.misc.api.BaseRuntimeException: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._MM_JDBC_2_HSBCAltasTrabajadores_TEST_ method FileName$[123, James, Gates, Spectory, com.sap.aii.mappingtool.tf3.rt.Context@247d247d]
    at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.getValue(FunctionWrapper.java:56)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:291)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:398)
    at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:141)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:102)
    at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInternal(ServerMapService.java:431)
    at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:169)
    at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52)
    at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.execute(MapServiceRemoteObjectImpl0.java:301)
    at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:146)
    at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
    at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
    at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
    at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
    at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    at java.security.AccessController.doPrivileged(AccessController.java:215)
    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Root Cause:
    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
    at java.lang.reflect.Method.invoke(Method.java:391)
    at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.getValue(FunctionWrapper.java:47)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:291)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:398)
    at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:141)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:102)
    at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInternal(ServerMapService.java:431)
    at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:169)
    at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52)
    at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.execute(MapServiceRemoteObjectImpl0.java:301)
    at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:146)
    at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
    at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
    at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
    at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
    at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    at java.security.AccessController.doPrivileged(AccessController.java:215)
    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: java.lang.NullPointerException
    at com.sap.xi.tf._MM_JDBC_2_HSBCAltasTrabajadores_TEST_.FileName$(_MM_JDBC_2_HSBCAltasTrabajadores_TEST_.java:564)
    ... 26 more
    RuntimeException in Message-Mapping transformation: Runtime exception during processing target field mapping /ns0:MT_HSBCAltasTrabajadores_TEST/row/separador7. The message is: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._MM_JDBC_2_HSBCAltasTrabajadores_TEST_ method FileName$[123, James, Gates, Spectory, com.sap.aii.mappingtool.tf3.rt.Context@247d247d]
    16:44:53 End of test[/code]
    Regards,
    Luis Diego

    Hey Luis,
    the container object only exists in message mapping runtime.
    Thus you're getting a null pointer exception there.
    For java mappings, remember that you have a .setParameter() method (which is necessary from definition of StreamTransformation interface),
    which sets the private variable param with the transformation parameters. In your .execute() method, just use it like this:
    DynamicConfiguration conf = param.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    Regards,
    Henrique.

  • Max Beans in Cache causes NULL Pointer Exception

    Hi All,
    a rather weird event (from our perspective) occurs when we do the
    following:
    We have an entity bean set to max beans in cache 100 (default value of
    our deployment tool ), the database table related to that bean holds
    lets say 300 entries.
    Doing a find all and in the same session bean instanciated transaction a
    processing loop over the enumeration of beans we get an NULL Pointer
    exception when accesing the 101 Bean. Neverthless the Weblogic server
    increases the cache size automatically but obviously not fast enough and
    not on time.
    has anyone experienced the same problem and has a fix for it, appart
    from increasing the cache size in the deployment descriptor ?
    any help welcome
    Michael

    Hi Michael.
    Can you post the stack trace of the NullPointerException? Was it in
    your code or ours? Also, what version of WebLogic are you using?
    -- Rob
    Rob Woollen
    Software Engineer
    BEA WebLogic
    [email protected]
    Michael Rupprecht wrote:
    Hi All,
    a rather weird event (from our perspective) occurs when we do the
    following:
    We have an entity bean set to max beans in cache 100 (default value of
    our deployment tool ), the database table related to that bean holds
    lets say 300 entries.
    Doing a find all and in the same session bean instanciated transaction a
    processing loop over the enumeration of beans we get an NULL Pointer
    exception when accesing the 101 Bean. Neverthless the Weblogic server
    increases the cache size automatically but obviously not fast enough and
    not on time.
    has anyone experienced the same problem and has a fix for it, appart
    from increasing the cache size in the deployment descriptor ?
    any help welcome
    Michael

  • Ticker JavaBean giving java.lang.NullPointerException

    I am running Ticker form which calls Ticker JavaBean via Form Bean Area. Sometimes clock starts up, other times it doesn't start when form is loaded. When the clock doesn't start there is always an associated error in the JInitiator Java Console. See below. Any ideas as to why this error and inconsistency ?
    oracle.forms.demos.TickerApplet: start()
    oracle.forms.demos.TickerApplet: run()
    java.lang.NullPointerException
    OUTERSIZE:java.awt.Point[x=232,y=30]
    oracle.forms.demos.TickerApplet:setSize(java.awt.Dimension[width=232,height=30])
         at oracle.forms.demos.TickerApplet.run(Compiled Code)
    oracle.forms.demos.TickerAppletcalcOffsets() 10:36:11 AM x=69, y=25
    att java.lang.Thread.run(Thread.java:466)

    I am running Ticker form which calls Ticker JavaBean via Form Bean Area. Sometimes clock starts up, other times it doesn't start when form is loaded. When the clock doesn't start there is always an associated error in the JInitiator Java Console. See below. Any ideas as to why this error and inconsistency ?
    oracle.forms.demos.TickerApplet: start()
    oracle.forms.demos.TickerApplet: run()
    java.lang.NullPointerException
    OUTERSIZE:java.awt.Point[x=232,y=30]
    oracle.forms.demos.TickerApplet:setSize(java.awt.Dimension[width=232,height=30])
         at oracle.forms.demos.TickerApplet.run(Compiled Code)
    oracle.forms.demos.TickerAppletcalcOffsets() 10:36:11 AM x=69, y=25
    att java.lang.Thread.run(Thread.java:466)

  • Some java code returns a null resultset from 10.2.0.1 DB, but works w/ 9.2

    I am a Java noob guys, but we have java code the calls an Oracle Function. This code is unchanged from what successfully runs against an Oracle 9.2 database returning, in this case, one row from the database. A ref cursor is used. When the same Java code calls the same ref cursor function from a 10.2.0.1 database, a null resultset occurs. The function correctly returns a single row when executed by the same database user via sql-plus. So it must be a java thing. Does the jdbc driver need to be upgraded to correctly run against a 10.2 database? And is this null resultset type of anomaly a potential result of having a wrong version of ojdbc14.jar? Nothing else has changed except pointing the code to the same package and tables in a 10.2 database.
    Thanks in advance for your comments.
    Phil McDermott

    I realize now that this is the wrong forum to post in, but I was linked here from a google search on the issue.
    I downloaded the 10.2.0.1 ojdbc14.jar from oracle, but the problem persists.
    yeesh! now what?

  • Error message pointing to an unavailable AS line #

    Hi,
    The error message I'm getting suggests the culprit might be on line #235.  I have no such line number anywhere.  But I have to admit, I have two Actions layers on my main timeline.  Could it be that the line numbers are combined off the two actionscript layers?
    TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::BitmapData@173f8f11 to flash.display.Bitmap.
        at Function/WebsiteNew_fla:MainTimeline/RollingTractor/WebsiteNew_fla:tractorBodyLoadComplet e/WebsiteNew_fla:backWheelLoadComplete/WebsiteNew_fla:frontWheelLoadComplete()[WebsiteNew_ fla.MainTimeline::frame1:235]

    yes.  layers don't exist in your swf.
    so, to find the problematic line number add the total lines in each layer starting from the top layer (unless you specified a different load order).  the first layer that exceeds the problem line number contains the problematic line of code.  subtract the total lines in the layers above the problem containing layer from the line number in the error message and you'll have the problematic line number in the problem containing layer.

  • Using a VI explicity and as a subpanel in the same code?

    I realize this message is somewhat long, so skip to the bold portion if you are faint of heart.
    I am attempting to use a Subpanel (for the first time) to simplify
    maintenance and compiling of my application.  A subpanel should
    allow me to only have to build one executable that behaves in different
    ways, rather than building separate executables which is what I have
    done in the past.  This is time consuming and
    prone to error, so I was really hoping subpanels would be the easy
    answer.  I have read nearly all posts pertaining to subpanels, but
    I still can't get my head completely around the concept.
    I have a VI that I want to display/run normally when the application is
    configured in non-emulation mode (via config file), but I want to
    display the same VI as a subpanel of another "wrapper" VI if the
    application is configured in emulation mode.  The "wrapper" VI
    simply contains boolean buttons that simulate physical buttons on a
    real device.  The VI will not be used in both ways at the same
    time, just whichever mode it is configured for.
    My attempt at this has been to create a case structure in which the
    FALSE case calls the SubVI directly (placed statically on the block
    diagram), and the TRUE case calls a different VI (the wrapper) that has
    a subpanel containing the SubVI.  It doesn't seem to be a problem
    getting the SubVI to display in the subpanel, but the RunVI invoke
    method on SubVI fails with "Error 1000: The VI is not in a state
    compatible with this operation."  I suspect this is due to the
    fact that the VI is loaded in memory already (from the static
    placement) somehow.  But as long as the VI isn't running before I
    invoke the RunVI method (which it won't be), why won't it work?
    What is the best way to accomplish what I need?  I know there are
    a few things I can try (such as making it re-entrant or making all
    calls to SubVI dynamic), but they all seem to have their own downfalls.
    Thank you in advance,
    Phish ><>

    I agree that reentrancy isn't the best answer.  And in my case, it
    isn't an answer at all since keypresses aren't dealt with.
    In my WrapperVI, I was passing the SubVI name as a string to the Open
    VI Reference.  Since, at the time, I had the SubVI statically
    placed in the MainVI, it was loaded into memory already.
    So I guess you are right:  I will not be able to do it that way
    and I'll need to open the reference with a path at both points in code
    (where I call the SubVI directly, and where I call it in the
    WrapperVI).  That is where the "unclean" code is going to come
    in.  I'll have to use two comepletely different, non-correlating
    paths depending on whether I'm running the code in the development
    system or in the run-time engine.  I do have a VI that I use to
    properly determine the path to the top-level VI whether it be in an
    LLB/EXE or not, but that won't keep me from having to use some
    hard-coded paths.  I hate hard-coded paths.
    I'll try it out and experiment some.  Thank you for your help so far.

  • In need of Fixed-point algorithm

    hi peeps,
    Im in need ( a very urgent need ) of a fix-point algorithm , with explanations if possible. Can anybody point me to the right direction?
    thanks....

    See if this helps you,
    To find a solution to p=g(p)given an initial approximation p0.
    Input: Initial approximation p0; tolerance TOL; maximum number of
         iterations N0.
    Output: Approximate solution p or message of failure.
    Step 1: Set i=1;
    Step 2: While i<=N0 do Steps 3-6.
    Step 3: Set p=g(p0). (Compute p.)
    Step 4: If |p-p0| < TOL then
    OUTPUT (p); (Procedure completed successfully.)
    STOP.
    Step 5: Set i=i+1.
    Step 6: Set p0=p. (Update p0.)
    Step 7: OUTPUT('Method failed after N0 iterations, N0=', N0);
    (procedure completed unsuccessfully.)
    STOP.
    Fixed-Point Iteration Code in C Language
    * Fixed-Point Iteration Code in C Language
    * To find a solution to p = g(p) given an
    * initial approximation p0
    * INPUT: initial approximation; tolerance TOL;
    * maximum number of iterations NO.
    * OUTPUT: approximate solution p or
    * a message that the method fails.
    #include<stdio.h>
    #include<math.h>
    #define true 1
    #define false 0
    main()
    double TOL,P0,P;
    int I,NO,FLAG,OK;
    FILE *OUP[1];
    void INPUT(int *, double *, double *, int *);
    void OUTPUT(FILE **, int *);
    double absval(double);
    double G(double );
    INPUT(&OK, &P0, &TOL, &NO);
    if (OK)
    OUTPUT(OUP, &FLAG);
    /* STEP 1 */
    I = 1; OK = true;
    /* STEP 2 */
    while((I<=NO) && OK)
    /* STEP 3 */
    /* compute P(I) */
    P = G(P0);
    if (FLAG == 2)
    fprintf(*OUP, "%3d %15.8e\n", I, P);
    /* STEP 4 */
    if (absval(P-P0) < TOL)
    /* procedure completed successfully */
    fprintf(*OUP, "\nApproximate solution P = %12.8f\n", P);
    fprintf(*OUP, "Number of iterations = %3d", I);
    fprintf(*OUP, " Tolerance = %14.8e\n",TOL);
    OK = false;
    else
    /* STEP 5 */
    I++;
    /* STEP 6 */
    /* update P0 */
    P0 = P;
    if (OK)
    /* STEP 7 */
    /* procedure completed unsuccessfully */
    fprintf(*OUP, "\nIteration number %3d", NO);
    fprintf(*OUP, " gave approximation %12.8f\n", P);
    fprintf(*OUP, "not within tolerance %14.8e\n",TOL);
    fclose(*OUP);
    /* Change function G for a new problem */
    double G(double X)
    double g;
    g = sqrt(10.0 / (4.0 + X));
    return g;
    void INPUT(int OK, double P0, double TOL, int NO)
    char AA;
    printf("This is the Fixed-Point Method.\n");
    printf("Has the function G been created in the program immediately preceding\n");
    printf("the INPUT function?\n");
    printf("Enter Y or N\n");
    scanf("%c",&AA);
    if ((AA == 'Y') || (AA == 'y'))
    *OK = false;
    printf("Input initial approximation\n");
    scanf("%lf",P0);
    while(!(*OK))
    printf("Input tolerance\n");
    scanf("%lf", TOL);
    if (*TOL <= 0.0)
    printf("Tolerance must be positive\n");
    else
    *OK = true;
    *OK = false;
    while (!(*OK))
    printf("Input maximum number of iterations - no decimal point\n");
    scanf("%d", NO);
    if (*NO <= 0)
    printf("Must be positive integer\n");
    else
    *OK = true;
    else
    printf("The program will end so that the function G can be created\n");
    *OK = false;
    void OUTPUT(FILE **OUP, int *FLAG)
    char NAME[30];
    printf("Select output destination\n");
    printf("1. Screen\n");
    printf("2. Text file\n");
    printf("Enter 1 or 2\n");
    scanf("%d", FLAG);
    if (*FLAG == 2)
    printf("Input the file name in the form - drive:name.ext\n");
    printf("For example: A:OUTPUT.DTA\n");
    scanf("%s", NAME);
    *OUP = fopen(NAME, "w");
    else
    *OUP = stdout;
    printf("Select amount of output\n");
    printf("1. Answer only\n");
    printf("2. All intermeditate approximations\n");
    printf("Enter 1 or 2\n");
    scanf("%d", FLAG);
    fprintf(*OUP, "FIXED-POINT METHOD\n");
    if (*FLAG == 2)
    fprintf(*OUP, " I P\n");
    /* Absolute Value Function */
    double absval(double val)
    if (val >= 0)
    return val;
    else
    return -val;

  • Code 'Generation' with DRY (don't repeat yourself)??

    Hello I am new to the forum so please be kind,
    I have recently gotten an internship with one of the offices with my University and am working a project (for a while now). I spend most of the day just getting all the classes assembled to be used (often a two day process) and what I would like to do is pass in a few parameters then have it generate the majority of the standard code that takes so much time to type out.
    What I am referring to is Consructors/ Setters/ Getters and toString.
    Parameters:
    Class name
    int first 5
    double secondMost of this stuff is pretty standard, but I figured there was a template or something I could build to do much of this for me. Unfoturnaly the University teaches C++, so learning Java on my own is somewhat difficult at times.
    Oh. I had found a wikipedia page about a design method called DRY, basically it pointed out that I could do just what I am wanting to do, but unfortunately I cannot seem to find an example or any detailed information about this method.
    This is what I have rolling around in my head at the moment:
    The use a bunch of strings and printf("%s, args) ...to build this entire page, then go in and enter the things that I couldn't generate.
    I could see this working, but I had felt this would go against code resuability because when the class/things I would generate would change, I would have to do some serious changes to this to get it working again. (Maybe that is the point).
    I would greatly appreciate some guidance on this, or pointed to more information.
    Thanks

    dajohnson1s wrote:
    Hello I am new to the forum so please be kind,
    I have recently gotten an internship with one of the offices with my University and am working a project (for a while now). I spend most of the day just getting all the classes assembled to be used (often a two day process) and what I would like to do is pass in a few parameters then have it generate the majority of the standard code that takes so much time to type out.
    What I am referring to is Consructors/ Setters/ Getters and toString.
    Parameters:
    Class name
    int first 5
    double second
    Most of this stuff is pretty standard, but I figured there was a template or something I could build to do much of this for me. Unfoturnaly the University teaches C++, so learning Java on my own is somewhat difficult at times.
    First step is recognizing a pattern.
    Second step, experience wise, is learning to recognize the difference between something that should be generated and something that shouldn't.
    Third step is implementation.
    Code generation should only be used if it can be insured that it eases the task now and in addition does not complicate the task in the future. That must include the possibility that the generation part will be abandoned so the generated code itself must be in such a state that it can be maintained.
    Once you have a pattern then you must choose a way to represent the pattern as a 'source'. Sources can one or more of the following: text, xml, sql scripts, sql databases, existing source files, existing code bases, design document, pdf files. Anything that you can extract a definition from will work.
    An example text file relevant to your task might look like this.
          Class: XxxMyclas
          Attribute: Count int
          Attribute: Name String.From that you create a standard compiler type idiom
    1. Parse (read file and collect data)
    2. Syntax (validate collected data, which might also be part of 1)
    3. Generate (use data to generate new source)
    Each phase can embodied certain complications (can not must). Some examples.
    1. Parse - provide an xml to define data types.
    2. Generate - provide a template file used to generate the code, define where the output goes, insure existing files not overwritten, etc.
    Your description sounds like a one shot - in that you will not be generating every everytime but rather will generate it once and then modify it.
    Oh. I had found a wikipedia page about a design method called DRY, basically it pointed out that I could do just what I am wanting to do, but unfortunately I cannot seem to find an example or any detailed information about this method.
    The only general books I have found on the subject is one directed at Perl (Perl Munging) which is sort of related and one for .Net (or maybe java) but which is directed at a proprietary commercial product.
    This is what I have rolling around in my head at the moment:
    The use a bunch of strings and printf("%s, args) ...to build this entire page, then go in and enter the things that I couldn't generate.
    I could see this working, but I had felt this would go against code resuability because when the class/things I would generate would change, I would have to do some serious changes to this to get it working again. (Maybe that is the point).
    Code generation has its best usage if you can recognize a pattern and then implement it such that manual modifications are not needed. This however is tempered by the requirement that I first mentioned that the generated code must be maintainable by itself.

  • Can FC put action script in a 'code behind'.

    Once of the practices I do in FB3 is to move all my action script into 'code behind' files instead of having all the code in the mxml files.  Does FC have the option to do that (as part of the gen process) and if not, does anyone else who 'codes' instead of 'designs' feel that is a benefit?  I know I'd prefer it to be in a 'separate' as3 file.  Also, if I DO move the code into code behinds (I've not tried it yet), does FC have any issues reading the code behind?  I'll be trying that on a 'simple' project to be sure but figured I'd ask just in case anyone else wants to know...

    The two references cited helped answer questions about Adobe's overall philosophy and approach that came up as I worked a simple example down the design/development stack of tools from Illustrator (AI) to Catalyst (FC) to Flash Builder 4 (FB).
    Other questions that arose were:
    Each application (AI, FC, FB) contains tools for design with some degree of overlap.
    Will FC eventually include from AI (or Photoshop, InDesign, etc.) and the FB design view all functionality needed for interactive storyboarding and skin generation?
    Is it the intent for FC to become the designer's tool and FB the developer's tool, at least for application design?
    The diagram in the Gumbo skinning spec shows that base components and their subclasses are typically implemented in AS and skins in MXML and recommends this as the preferred design pattern. Yet when I converted one of my groups (essentially a form) to a customized component, and exported the project into FB, I noticed that FC had generated a single mxml file (CustomComponent1 ...) and not a pair of files (an X.as file for the base component and an X.mxml file for the skins).
    For several reasons, wouldn't you want to generate separate files as depicted in the Gumbo diagram as a starting point for code customization?
    How does one develop custom components in FB (or using AI+FC+FB) and package them as a library so that they can be dropped into FC and used in the way that the current set of 5 components (button, hscrollbar, vscrollbar, text input and data list) are used?
    How will I integrate my hand-coded dynamic components for data visualization alongside more generic and static app components on an RIA page?
    How would I use AI+FC to design liquid layouts where children at each level often utilize constraints (i.e. top, bottom, left, right) between parent and child?
    For agile methodologies, how will refactoring the interaction or software design work in this new world where interaction designers are trying to maintain full control over appearance and interactive behavior?
    Finally, I would like to know what tools and steps Ely used to develop the component shown in the video. It would be instructive to turn that into a tutorial that we could walk through, step by step, in slow motion
    While I understand the arguments for separation of design and development as a workflow methodology, those of us with development and HCI/visualization backgrounds building research prototypes would like to see integration of the design and development tools (from the perspective of the workflow, not the architecture and code).
    As Jordan said, the direction you are heading is inspiring. Keep up the good work.

  • How to sort a list of strings, without methods and stuff just simple code?

    Hi
    How to sort a list of strings, without methods and stuff just simple code?
    Thanks in adavance!!

    Without methods? How are you going to all the sort code? What is the point of code?
    Collections.sort(List) will sort strings or anything that implements the Comparable interface, or you can use the sort method that takes a Comparator implemenation.
    If you want "just code", you could either get the Collections class souce and follow it to the code. But otherwise, there isn't one set of code. There are various sorting algorithms with advantages and disadvantages. Maybe you'd be better off searching for sorting algorithms and if you understand them, it should be simple to write Java implementations of them.

  • BSOD after closing Itunes (newest version, also older versions) error: Reference by pointer 0x000000018

    Every time I close Itunes I get a BSOD in windows vista ultimate 64bit error I get in BSOD : Reference by pointer error code 0x000000018.
    Looked for dumpfile but no dumpfile created.
    Allready uninstalled Itunes and all apple software following some tips I found on the internet in correct order, reinstalled same problem occurs.
    I believe it must have to do something with apple mobile device software, but when I remove that software Itunes can't find the mobile devices
    anymore.

    Guys,
    I'm in the same boat, close iTunes 11.0.4.4 and BSOD. When it is open everything is fine!
    Running Vista
    I'm good with computers....but not at the level that know what the message means.
    Can you offer any help? Is this the same problem you are having?
    Cheers
    Steve
    Problem signature:
      Problem Event Name:                     BlueScreen
      OS Version:                                     6.0.6002.2.2.0.768.3
      Locale ID:                                        1033
    Additional information about the problem:
      BCCode:                                          18
      BCP1:                                               88903D38
      BCP2:                                               8C59FD90
      BCP3:                                               00000001
      BCP4:                                               00000001
      OS Version:                                     6_0_6002
      Service Pack:                                    2_0
      Product:                                          768_1
    Files that help describe the problem:
      C:\Windows\Minidump\Mini072313-01.dmp
      C:\Users\Steve Rusk\AppData\Local\Temp\WER-75406-0.sysdata.xml
      C:\Users\Steve Rusk\AppData\Local\Temp\WER42A1.tmp.version.txt
    Read our privacy statement:
      http://go.microsoft.com/fwlink/?linkid=50163&clcid=0x0409

Maybe you are looking for

  • Convert text in PDF to pure black

    Hi all, I have spent hours researching this with little to show for it, so I thought it's time to ask for help. I am dealing with a situation where I need a batch solution to change the color of all the (vector) text in a PDF document to pure black.

  • Easy Cost Planning (SAP) in Tender Process

    Hi All, I am using SAP ECC 6.0 EHP 4. I wanted to know if Easy Cost Planning in SAP PS can be used to cost a project initially while Tendering process.Or is there any other tcodes in SAP for tender process? I created Costing Models for most of the po

  • Access-list port range question

    Hi, I would like to clarify the exact operation of the below command: /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-

  • Fileupload uploads empty 0 kb files

    I have fileupload code same with on this link http://jakarta.apache.org/commons/fileupload/using.html after i ran the code i have 0 kb jpg files with correct names but they are empty... what can the problem be...thank you...

  • Passing parameters in FQDN URL of WDA component

    hai my dear WDAers, how can we pass the parameters from URL and how can we access that paremeter into another view. regards, rk