threads and HTML5 sqlite

I had changed my code for functions sqlite gear to the new features of sqlite html5 to porpose to works in a 6.0 torch.

I have:

try
{
    openDB();
    db.transaction(function(tx){
        tx.executeSql("SELECT * FROM Config LIMIT 1",[],
            function(tx2, rs) {
                for (var i=0; i < rs.rows.length; i++) {
                    alert('1:' + rs.rows.item(i)['alias']);
                    settings.alias = rs.rows.item(i)['alias']; // rs.fieldByName("alias");
                }
            }
        );
    });

    alert('2:' + settings.alias);
}
catch(ex)
{
    alert("config error: " + ex);
}

and javascript first show alert('2:'...)  before alert('1:'...);

that's happened?

Thank you

I have the same problem, so I wrote the following code:

var sprawdz = 0;

var timer=function (){ 

    if (sprawdz == "1"){     alert("Information saved.")       window.location.href = "index.html";  }

}; 

var timerId=setInterval('timer();',500); 

        function zapisz() {

              var data = document.getElementById("pczk1nam").value;             var data2 = document.getElementById("pczk1num").value;                var data3 = document.getElementById("pczk2nam").value;                var data4 = document.getElementById("pczk2num").value;                var data5 = document.getElementById("pczk3nam").value;                var data6 = document.getElementById("pczk3num").value;                var data7 = document.getElementById("pczk4nam").value;                var data8 = document.getElementById("pczk4num").value;                var data9 = document.getElementById("pczk5nam").value;                var data1 = document.getElementById("pczk5num").value;

          if (!db) {                alert("In order to save your data you need memory card in your phone.");              return;           } else {

              db.transaction(function(bx){                  bx.executeSql("UPDATE userdata1 SET value1 = ? WHERE key = ? ", [data, 1]);                   bx.executeSql("UPDATE userdata1 SET value2 = ? WHERE key = ? ", [data2, 1]);

                  bx.executeSql("UPDATE userdata1 SET value1 = ? WHERE key = ? ", [data3, 2]);                  bx.executeSql("UPDATE userdata1 SET value2 = ? WHERE key = ? ", [data4, 2]);

                  bx.executeSql("UPDATE userdata1 SET value1 = ? WHERE key = ? ", [data5, 3]);                  bx.executeSql("UPDATE userdata1 SET value2 = ? WHERE key = ? ", [data6, 3]);

                  bx.executeSql("UPDATE userdata1 SET value1 = ? WHERE key = ? ", [data7, 4]);                  bx.executeSql("UPDATE userdata1 SET value2 = ? WHERE key = ? ", [data8, 4]);

                  bx.executeSql("UPDATE userdata1 SET value1 = ? WHERE key = ? ", [data9, 5]);                  bx.executeSql("UPDATE userdata1 SET value2 = ? WHERE key = ? ", [data1, 5]);

                  sprawdz = 1;              });

          }

        }

As long the sprzet is not 1 check the timer. If the sprzet is 1, that your code is executed

Tags: BlackBerry Developers

Similar Questions

  • Key3db and signons.sqlite are breaking Firefox.

    Earlier today, starting Firefox (and only FF - IE worked / works very well) is no longer load google or youtube or some other sites, but instead to give this screen "could not load", he would keep trying to load and would just never got anywhere. The window would not be too close in any way, except for the Task Manager. After uninstalling, reinstalling, reset and all the usual mess, I started to look at the profile and seem to have reduced the problem until signons3.txt and signons.sqlite or maybe just key3.

    Deleting key3 corrects both loading and closing of issues, but the problem of loading is returned immediately if I save passwords and that you restart FF. So now, I don't know what to do to get it working again.

    You will lose all saved password if you deleted the signons3.txt file because this file stores the encryption key for the file signons.sqlite.
    I can hardly imagine that a problem with this file would cause such a question.
    It would be preferable to (re) move the file signons.sqlite as well to avoid problems with the password manager if you cannot restore the file signons3.txt.

    Ever had problems with the recording and display of passwords?

    • Tools > Options > Security: passwords: "saved passwords" > "show passwords".

    Have you tried safe mode to see if an extension is the cause?

  • Threading and reuse of the node to call using reference of buffers (of the required adhesive tape)

    I tried to get the following information in the public domain for years and now that I have the answers, I'll share with those who might be interested.

    Caveat!

    Wrap your head in tape before reading just for the sake of security.

    My two questions were;

    (1) may LV re - use tampons of VI calling when you use VI serve call by reference?

    (2) is used when the use of call by reference UI thread?

    1 when you call a VI using the call through the reference node, the data in the pane of the copied or is node connector - this online as it would be with a Subvi properly implemented?

    Short answer: it's somewhere between the two.

    Long answer:

    The compiler does not know what will be called VI, but there a hint:

    the reference connected to the node of the call by reference. He uses to get the 'Prototype' for the call. Therefore, for optimal performance, use a prototype that has the same 'characteristics placeness' as it is called VI. That said, users don't know what are the "characteristics of the placeness.

    Before getting into the details, I will say that the overhead of these copies should not matter much unless it's a large data structure (a table with lots of items.) or a cluster/class with many fields or containing large networks etc..

    Example 1:

    If the prototype does not change the data, then the compiler assumes that the crux of the call by reference will not alter the data. However, at runtime, a check is made to see if the real called VI will modify the data. If Yes, then a copy is made and past so that the original data can be modified.

    Example 2:

    If the prototype contains an entry that is wired through an exit so that both input and output terminals can use the same buffer memory, but running an audit determines that the real called entry and exit VI do not share a buffer, then a copy will be made from output of the actual call to the original screws (combined input and output) buffer.

    I should also mention that, even with this behavior "are trying to get along with the prototype", it is not always possible to obtain good performance as a Subvi ordinary call. For example, if you have a situation where the prototype does not change the data and passes it through to an exit and then the compiler must assume that the data is changed (because, as in example 2, there are screws that may change even if the called real VI is not).

    And there are a few caveats:

    (1) this behavior "using a prototype" was new for 2009. Before that, we used a method more naïve data of passage that took all the entries will be changed and no outputs don't share a buffer with an entry.

    (2) this behavior can be changed in future versions, if we find additional optimizations.

    (3) this behavior is the same that we use for the dynamic distribution live (when you use the classes in LV)

    (4) If you want to create a VI can be used as a prototype, you can use the features of the Structure in Place to control the "characteristics of the placeness', namely the element nodes in and out of the border, the function"Mark as modifier"border nodes (note the pencil icon on the item), and the node always one copy.

    (5) the prototype is only the first reference ever connected to the node of the call by reference. So if you make a new prototype VI, you can just make a reference out of it plug into the crux of the call by reference. I suggest to remove the node from the call by reference and file a new.

    (6) for remote calls, we still "making copies" by transmitting data over a network.

    I hope that this helps, if you want information/clarification, so feel free to ask.

    2 - is the call made by the reference to run in the user interface thread node? If the call is made by a remote machine via ethernet, thread that host (the computer that makes the call by reference) runs on and thread that executes the target (the machine that contains the file VI) on?

    In the case of premises, the appeal made by the reference node does not require the user interface thread and may work in some thread the VI wants to run in.

    When you call a remote VI, the appeal made by the reference node uses the UI thread (detailed below) on both the client and the server.

    The client uses the UI thread to send the request to the server and there still when the response comes back. The user interface thread is not blocked during the time between the two.

    The server receives the TCP message in the UI thread, and then starts the call to the UI thread. The server also uses the user interface thread to send the response to the client. The user interface thread is not blocked on the server during execution of the VI.

    I hope that people find it when they need it!

    Ben


  • thread and TSVs locks

    Dear experts threads,

    are there side effects if I use the macro "GetPointerTo" and "ReleasePointerTo" inside a thread lock, which is in the code located between CmtGetLock and CmtReleaseLock?

    Phrased differently, what type of sequence is best if I need to edit a TSV in a piece of code that should be accessible only from a single thread at a time:

    1)

    CmtGetLock

    ...

    CmtReleaseLock

    GetPointerTo

    ...

    ReleasePointerTo

    CmtGetLock

    ...

    CmtReleaseLock

    OR

    2)

    CmtGetLock

    ...

    GetPointerTo

    ...

    ReleasePointerTo

    ...

    CmtReleaseLock

    Thank you!

    Wolfgang

    Hi, Wolfgang.

    GetPointerTo... will block until the thread that holds the pointer releases, then the CmtGetLock() and CmtReleaseLock() calls are not necessary, unless they protect some other variables, in which case sequence 2) is the way to go.

    Remember that if you use multiple thread safe variables or multiple locks thread, and you need to use more than one at any time, each thread must obtain and release pointers / locking in the same order. This avoids the possibility of blocking. In addition, each thread must release the resource as soon as possible.

    Example (using thread locking):

    If (!.) CmtGetLock (lock1))

    {

    If (!.) CmtGetLock (lock2)) / / Get QL2 only when you hold lock1

    {

    ...

    CmtReleaseLock (lock2);  Always communicated QL2 before lock1

    }

    CmtReleaseLock (lock1);

    }

    Kind regards

    Colin.

  • Thread and class with no thread

    Hi everyone , hope you can help me with this...

    I have two classes, extends a Thread and the other extends screen. My problem is that the screen needs all the information that the thread has had, but I do not know how to make the screen show upward when the thread is finished, or wait until this thread stops to see its information.

    Thanks in advance

    At the end of your thread, you can push the screen with:

    synchronized (UiApplication.getEventLock) {}

    UiApplication.getUiApplication () .pushScreen (yourMainScreen);

    }

  • problem with thread and try {} - catch () {}

    Hello

    My problem is that in the second thread of my request, there is a method (at the beginning) that connects with the server. If the connection is impossible-i try to reconnect two times. the problem is that the connection must by in a try-catch block. and when I can't connect for the first time, the program will the something something trying to reconnect. and the problem is that once my progam enters this something, the thread is dead!

    Do you have any suggestions, what can I do with it?

    concerning

    I reorganized my request. whenever I see that the thread is killed (with an exception of capture) I wait 2 seconds and start the thread. and it works like a "reconnect".

    Thank you for your time and suggestions!

    Kind regards

  • Update of the screen, threading and synchronization

    I have a game I developed that uses multiple threads to process. The game does not focus on the user by itself and seems to be accelerating when there are more items on the screen and slows down when there is less. I have four threads in use. Three of them are used to update the main (UI) thread and run continuously; two update a class watch stop custom, and the third simply disabled the screen to force a refresh. All three of the threads use locks objects synchronized; That's why I think it slows down when nothing is on the screen, because they constantly block. I do not have variables that are constantly updated by the thread and read survival gear each iteration; which I was I use locks. I use the IDE 4.7 and the simulator of the storm. Profiling code over a minute 3 period shows that almost 60% of the execution time is during one of the locked rows (block I'm of course). I was wondering what I should use locks because only the UI thread updates one of the three? If so, is there a better way. Code can be provided if necessary.

    BUDOKAI-is that they have a book of text on the famine of lock?

    http://Java.Sun.com/docs/books/tutorial/essential/concurrency/starvelive.html

    [ed, I would also like to make out this seems to be a tight loop so that it also uses time spinning CPU]

    during the liberation that briefly up to 2 locks]

    While (true) {}
    synchronized (runLock) {}
    If {(race)
    synchronized (pauseLock) {}

  • threads and processes

    What is the difference between threads and processes?

    Hi Shams,

    Process of

    A process, in simple terms, is a running program. One or more threads run in the context of the process.

    Each process provides the resources needed to run a program. A process has a virtual address space, executable code, open the handles to system objects, a security context, a process environment variables, unique identifier, a class of priority, minimum and maximum working set size and at least a thread of execution. Each process is started with a single thread, often called the main thread, but can create additional threads in any of his sons.

    Thread

    A thread is the basic unit to which the operating system allocates time processor. A thread can execute any part of the process code, including parts being run by another thread.

    A thread is the entity within a process that can be scheduled for execution. All threads in a process of shared system resources and the virtual address space. In addition, each thread manages handlers exceptions, a scheduling priority, threads local storage, a single thread identifier and a set of structures, that the system uses to save the thread context until it is scheduled.

    If you have additional questions, feel free to post. We are here to help you.

  • Game Flash possible publication WebGL and HTML5?

    When (if ever) will it be possible to publish a Flash game with lots of assets and ActionScript to WebGL and HTML5? It is even technically feasible? I tried to do with CC last Flash and it seems it is closer, but not there yet. Predictions?

    I have converted to html5, several times, but you must convert the ActionScript easeljs (manually).

  • messages between the main thread and the FX application thread

    I run a thread of the Application of FX for a main thread using Application.launch [described here: {: identifier of the thread = 2530636}]

    I try to have the application thread return information on the main thread, but Application.launch returns void. Is there an easy way to communicate between the main thread and the thread of the Application?

    So far, I googled and found:
    -MOM (Message Oriented Middleware)
    -Sockets

    Thoughts/ideas/examples are appreciated--especially examples ;)--now I try to use Sockets to show/hide the application and data transmission.

    What is the preferred method? Are there others that I did not find (gasp) via Google?

    Dave.

    Published by: cr0ck3t on April 30, 2013 21:04

    Published by: cr0ck3t on April 30, 2013 21:05

    Is there an easy way to get a reference to these objects to both the main thread and the thread of Application FX - called via Application.launch () since the main thread? Or what I need to use Sockets or MOM?

    Not much to do with the concurrent programming is what I would call easy. It looks easy - but it's not.
    You can do kind of what you're describing using Java concurrency constructs without using sockets or a package of Message Oriented Middleware (MOM).
    With the Java concurrency stuff you really implement your own form or MOM light.
    If you have quite an application is complex with many messages of comes and goes, then a sort of package for MOM such as the camel and ActiveMQ (http://camel.apache.org) is useful.
    ---------
    You can find a sample of the various interactions of thread with JavaFX here:
    https://gist.github.com/jewelsea/5500981 "Simulation of dwarf dragons using multiple threads to eat."
    Related code is just demo-ware to try different competitive access facilities and not necessarily a recommended strategy.
    If your curiosity, you can take a look and try to work out what it is, what it does and how it does.
    The main reason followed is that of a blocking queue:
    http://docs.Oracle.com/javase/6/docs/API/Java/util/concurrent/BlockingQueue.html
    ---------
    Note that once you call launch of the main thread, no subsequent statement in the main method will be different until the JavaFX application terminates. If you can't start from the main thread and communicate with the main thread JavaFX application. Instead, you need to spawn another thread (or a set of threads) for communication with the JavaFX application.
    ---------
    But really, in most cases, the best solution with the simultaneity is not care at all (or at least as little as possible). Write everything in JavaFX, use the animation of JavaFX framework to time related things and the simultaneity of JavaFX utilities for when you really need multiple interaction of wire.
    http://docs.Oracle.com/JavaFX/2/threads/jfxpub-threads.htm
    ----------
    For additional assistance, you may be better off describing exactly (i.e. really specific) what you're trying to make in a new question, perhaps with a solution of the sample in a http://sscce.org NBS

  • Hyper-threading and vCPUs

    A few years ago I was working with VMware Server 1.0 on Windows 2003. I had 2 servers with VMware Server, one of them has a CPU Intel Hyper-thread, and the other has the same Intel processor but with HT disabled.

    I had a VM running a 16-bit application, which took all the cycles available CPU. When this run on non-HT Server virtual computer, the Windows host reports 100% CPU usage. When the virtual machine running on the active HT server, host the CPU utilization was 50%, and the Task Manager showed the virtual machine, taking all the cycles of a demi-processeur and the other half processor almost in slow motion.

    Assuming that the processors are equal, I think I know that the virtual machine has got more CPU power running on non-HT server to run on HT-enabled server (because HT divided by 2 CPU and just one half CPU is assigned to the virtual machine).

    My question is: what happens with HT on ESX?

    When I assign a vCPU virtual machine, it will use just half a nucleus in a Hyper-Threaded Server, but a full kernel on a server of HT-people with reduced mobility? (assuming that no other virtual machines compete for resources).

    Thank you and best regards.

    With the following reflections on 2 and 3.

    (2) but do not forget hypervisor (vmkernel) provides these vcpus to the LCPU he will ensure that the vCPU is scheduled to LCPU who has cycles CPU available - if you are in the situation where all LCPUs are heavily loaded, then you need to increase the resource capacity by adding additional hosts to the cluster (if you ave a)

    (3) the virtual machine has no direct access to the LCPU but she is planned there by the vmkernel - if the virtual machine is idle, it can theoretically be used no. (or at least very few CPU cycles)

    hope this helps-

  • How killi thread and stop java.util.Timer?

    Hello

    I have table list, this list contains my objects (areas of Thread) and these threads use the Timer (java.util.Timer).

    In some time, I need to find the object in the list of tables, destroy this specific thread and immediately to stop the timer.

    I don't know what is the best way how a) destroy the thread and b) stop the timer.

    Could you tell me what technique to use?

    Thank you.

    I don't think you're catching what everyone tells you:

    Unless I missed something in your code, you do the following:

    1 create a thread that starts a timer (the thread itself dies immediately after the launch of the timer)
    2 put the dead (or soon to die) wire reference in a list of tables.

    To solve your problem, as has already been said: stop timers, they exist independently of your son now dead. Remove the reference ArrayList where you keep a list of the dead son. They will be eligible for garbage collection when you have no refrence to them any longer. Java garbare collector will not immediately work to show you got something, it is that way by their design, but ultimately it will collect your dead and not referenced objects and drop them.

  • Captivate SWF - 6 AND HTML5?

    Captivate SWF - 6 AND HTML5?  I would like to than my users to be able to open my tutorials of training from their desktops / laptops or their iPads, according to what they prefer.  When I publish to the Format Option to output SWF, they open it on their desktops / laptops not their iPads.  If I publish to the Option of output Format of HTML5, they can open on their iPads, but not their desktops / laptops.  Is it possible to create a tutorial so that it can be opened on both a destop/laptop AND iPad?

    Thank you, Anjaneai.  I am hosting LMS on Taleo (Oracle).  I'll check the boxes the SWF and HTML5.  I confirm that my report captures the results, whether accomplished through SWF or HTML5.  Thanks again.

  • CS3 will not show CSS3 and HTML5 in WYSIWYG 'design mode '?

    So, I just a CSS3 and HTML5 mobile site template. When I open it to work on it in Dreamweaver CS3, CSS is not displayed in the "design" view, but again, when you view a preview in the browser, everything is perfect. In the WYSIWYG design view, I see the content, but the style is missing. Preview in the browser, it's all there.

    Is this just a limitation in the service of visualization of design WYSIWYG CS3 and I'm out of luck? Is there one "fix" - other than a costly upgrade - for it in CS3?

    But you're definitely saying that CS3 can't make CSS3 and HTML5 in its design view editor WYSIWYG?

    Yes I say certainly that you will not be able to view whatever it is in design mode.  Have you downloaded the free adobe Web site extension?  The extension is very useful for coding in code view.

    http://forums.Adobe.com/message/4172755#4172755>

    Good luck.

  • View threads AND grouped by date/conversation

    Hello

    I try to have messages see the thunderbird grouped by date (with a thread on today, yesterday, last week, etc.) and within these threads, see email conversations. A conversation that began three weeks ago, but has received a new email today is expected to manifest itself in the thread today, but from the first email of the conversation.
    I did not understand if it is possible, as grouped by (Date) and Threads are mutually exclusive. Any ideas?

    Thank you

    As you say, it is there only one group so at the time. So I guess that your out of luck.

    You could fill a better bug report and see if one of the developers interested. https://Bugzilla.Mozilla.org/

Maybe you are looking for

  • Portege R600 - option GPS in Wireless manager

    Hello I noticed that there is a GPS option in the Wireless Manager this race and specify the location, how can this GPS can be used by other programs? Is it necessary to run the Manager to use/activate wireless GPS? Why this option is hide? (it is no

  • Error installing BOINC 1325.boinc_data is not a valid short file name.

    * - Original title - BOINC install error REF: BOINC (Berkeley Open Infrastructure for Network Computing) which is SETI@home install error When you try to install BOINC on my Windows 7 system, I received the error "error 1325.boinc_data is not a valid

  • Effectiveness of password computer when the computer is open

    The computer access password act as a block, restrict or prevent access to the computer by unwelcome intruders, when the computer is open? D I'm Kaye

  • incompatible drive after drive letters reformat Windows 7

    I use Windows 7 64-bit. I have 2 hard drives each partitioned inot 2 discs.HDD0 was and is drive C and M.HDD1 was D and S, but was dynamic- changed base, reformatted and repartitioned.(may be mentioned that before that, D drive was actually 2 separat

  • Question related to resetting Windows

    Hello I have a silly question... I reset my computer to factory settings, however I'm not sure if it will also remove all on my drive hard shild... it will be, or will it only reset my hard drive with windows on it? I followed the instructions here: