Using threads (SwingWorker) to update JTree component

Hi,
Im having a problem trying to update a JTree component (adding child nodes to an existing node) using threads. Im using the SwingWorker3 class (http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html) for threading.
When the user selects a node for expansion, the logic for fetching the children of the selected node is executed under the construct() method of SwingWorker.
Once this data is obtained, the job of adding the children to the selected node is done in the finished() method which runs on the event-dispatch thread as per documentation of SwingWorker3.
The problem Im facing is that even though the data for the children is obtained and the finished() method executes and adds the children to the selected node, they are not visible in the UI.
If anybody knows how this can be resolved, please let me know. Any help/pointers would be greatly appreciated.
Rgds
Sridhar

I added the tree.updateUI() method call in the finished() method. This renders the children (Yipee!).
But now I have a new problem. If I collapse and again expand a node, I get a NPE. (I see all the child nodes but a exception is still thrown) The exception happens after my treeWillExpand() and treeExpanded() method implementations. So no probs in my code.
If you know of a solution, pleeease let me know.
TIA
Sridhar
Exception occurred during event dispatching:
java.lang.NullPointerException
at javax.swing.plaf.basic.BasicTreeUI.updateSize(Unknown Source)
at javax.swing.plaf.basic.BasicTreeUI.toggleExpandState(Unknown Source)
at javax.swing.plaf.basic.BasicTreeUI.handleExpandControlClick(Unknown Source)
at javax.swing.plaf.basic.BasicTreeUI.checkForClickInExpandControl(Unknown Source)
at javax.swing.plaf.basic.BasicTreeUI$MouseHandler.mousePressed(Unknown Source)
at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Similar Messages

  • Difference Between Using MVC And SwingUtilities For GUI Component Update

    Hi Guys,
    What are the difference of using the MVC (Model View Controler) pattern to update GUI and using the SwingUtilities of doing the same job?
    Are there any big differences or shortcomings of any?
    Thanks.

    kap wrote:
    Hi Guys,
    What are the difference of using the MVC (Model View Controler) pattern to update GUI and using the SwingUtilities of doing the same job?
    Are there any big differences or shortcomings of any?
    Thanks.Your question is akin to asking, "What's the difference between using a car to get somewhere versus stepping on the gas pedal to do the same job?"
    The use of SwingUtilities to update the "view" only pertains to updating components in a thread-safe manner, it has nothing to do with MVC. MVC would govern when the view gets updated (i.e. after the model changes), while SwingUtilties would be used to specify how the view gets updated.

  • Can we use both INSERT and UPDATE at the same time in JDBC Receiver

    Hi All,
    I would like to know is it possible to use both INSERT and UPDATE at the same time in one interface because I have a requirement in which I have to perform both the task.
    user send the file which contains both new and old record and I need to save those in MS SQL database.
    If the record exist then use UPDATE otherwise use INSERT.
    I looked on sdn but didn't find any blog which perform both the things at the same time.
    Interface Requirement
    FILE -
    > PI -
    > JDBC(INSERT & UPDATE)
    I am thinking to use JDBC Lookup but not sure if it good to use for bulk record.
    Can somebody please suggest me something or send me the link of any blog or anything to solve this problem.
    Thanks,

    Hi ,
              If I have understood properly the scenario properly,you are not performing insert and update together. As you posted
    "If the record exist then use UPDATE otherwise use INSERT."
    Thus you are performing either an insert or an update which depends on outcome of a search if the records already exist in database or not. Obviously to search the tables you need " select * from ...  where ...." query. If your query returns some results you proceed with update since this means there are some old records already in database. If your query returns no rows  you proceed with "insert into tablename....." since there are no old records present in database.
      Now perhaps the best method to do the searching, taking a decision to insert or update, and finally insert or update operation is to be done by a stored procedure in MS SQL database.  A stored procedure is a subroutine available to applications accessing a relational database system. Here the application is PI server.   If you need further help on how to write and call stored procedure in MS SQL you can look into these links
    http://www.daniweb.com/web-development/databases/ms-sql/threads/146829
    http://www.sqlteam.com/article/stored-procedures-parameters-inserts-and-updates
    [ This part you can ignore, Since its not sure that you will face this situation
        Still you might face some problems while your scenario runs. Lets consider this scenario, after the stored procedure searches the database it found no rows. Thus you proceed with an insert operation. If your database table is being accessed by multiple applications (or users) other than yours then it is very well possible that after the search operation completed with a null result, an insert/update operation has been performed by some other application with the same primary key. Now when you are trying to insert another row with same primary key you get an error message like "duplicate entry not possible for same primary key value". Thus you need to be careful in this respect. MS SQL has a feature called "exclusive locks ". Look into these links for more details on the subject
    http://msdn.microsoft.com/en-us/library/aa213039(v=sql.80).aspx
    http://www.mssqlcity.com/Articles/Adm/SQL70Locks.htm
    http://www.faqs.org/docs/ppbook/r27479.htm
    http://msdn.microsoft.com/en-US/library/ms187373.aspx
    http://msdn.microsoft.com/en-US/library/ms173763.aspx
    http://msdn.microsoft.com/en-us/library/e7z8d5hf(v=vs.80).aspx
    http://mssqlserver.wordpress.com/2006/11/08/locks-in-sql/
    http://www.mollerus.net/tom/blog/2008/03/using_mssqls_nolock_for_faster_queries.html
        There must be other methods to avoid this problem. But the point is you need to be sure that all access to database for insert/update operations are isolated.
    regards
    Anupam

  • Using CRUD procedures to update data and ref cursors to return data

    Hi:
    I am currently evaluating Apex 3.x to replace an existing app that uses lots of procedures to update and return data.
    1. Is it possible to return data from a function that returns a cursor (or from a procedure that has an input/output ref cursor parameter for that matter) ? Example: Let's say I have the following function in a package:
    function get_data return sys_refcursor
    is
    l_cursor sys_refcursor;
    begin
    open l_cursor for select sysdate as field from sys.dual;
    return l_cursor;
    end;
    Can I add a page with a table that is populated based on this function? Based on my research it is not possible, but I want an APEX expert to confirm it
    2. The old application uses CRUD procedures to update date, that is for each table there are 3 procedures, insert update and delete. Question: is it possible to channel all the update, inserts and deletes through these procedures? Furthermore, in lots of cases I use sequences to populate the primary keys, and the new value is returned as output parameter. Can I retrieve the output value and use it maybe in the next page I am branching to?
    In the samples that I've seen the same form is used for insert and update. How do I distinguish between the two modes?
    3. Can you please point me to some samples that show how to do 1 & 2. The standard samples that I've seen use the automatic row processing.
    4. Could you please recommend some good books about Apex or HTML db? I found the documentation unintuitive. It is hard to picture quickly how things tie together by reading this documention. I wish the documentation was more task oriented and presented 'how to...' implement generic patterns used in web apps.
    Thank you in advance

    Hi guys
    Check out the last 2 posts in this thread for ideas on how to implement 1.
    Report on user data from LDAP
    Varad

  • Why do we have to use SwingUtilities.invokeLater() to update UI status?

    I just don't understand very well why we have to use SwingUtilities.invokeLater() to update UI status. Why not just new a thread in actionPerformed() method and do time consuming tasks in this thread and update UI status in it? Some tutorials say it is not safe to update UI status not in Event Dispatch Thread, I don't understand, why is it not safe? Can anyone provide a scenario for this? I just write an example, a button and a progressbar, click button, progressbar keeps updating value. I just create a new thread to do this, don't find any issue. Thanks.

    [Swing single threaded rule|http://www.lmgtfy.com/?q=swing+single+threaded+rule]
    db

  • Using threads to change button status

    Hi all
    im reworking my conway life adt and trying to build it into an ap (as i have it working as an applet)
    as applets have a repaint command then implementing the generations was pretty easy.
    However in an application i will have to use threads wont i?
    so what i have done is built an ap that builds the life grid using swing buttons (this isnt a swing question by the way its a thread question :p)
    so how would i go about threading my application so it doesnt freeze up?
    here is the code from my swing ap
    import javax.swing.*;
    import java.awt.*;
    public class LifeAp
    private Life gLife;
    private JButton[][] buttons;
    private JFrame frame;
         public LifeAp(int y, int x)
         gLife=new Life(y,x);
         buttons=new JButton[y][x];
         for (int yc=0;yc<y;yc++)
              for (int xc=0;xc<x;xc++)
                   JButton btn=new JButton();
                   btn.setBackground(new Color(204, 204, 204));
                   btn.setText("");
                   buttons[yc][xc]=btn;
         initLife();
         public void buildForm()
         frame = new JFrame("Life");
         frame.getContentPane().setLayout
               (new GridLayout(buttons[0].length,buttons.length));
         for (int y=0;y<buttons.length;y++)
              for (int x=0;x<buttons[0].length;x++)
                   frame.getContentPane().add(buttons[y][x]);
         frame.pack();
         public void setButtons()
         for (int y=0;y<buttons.length;y++)
              for (int x=0;x<buttons[0].length;x++)
                   if (gLife.getStatus(y,x)==0)
                        buttons[y][x].setBackground(new Color(204, 204, 204));
                   else
                        buttons[y][x].setBackground(new Color(255, 255, 0));
         public void initLife()
         buildForm();
         gLife.generateMap();
         setButtons();
         public void show()
         frame.setVisible(true);
         private void exitForm(java.awt.event.WindowEvent evt)
         System.exit(0);
         public static void main(String[] args)
         new LifeAp(16,16).show();
    }the form builds just fine.
    now in the Life adt i have a method called generation()
    so when i call gLife.generation(); the next life phase is calculated
    so i need in a thread to basically say
    gLife.generation();
    setButtons();which will update life then colour the buttons accordingly.
    however i think that maybe im going to hit problems because of static and non static methods etc.
    have i approached this the wrong way? or is this something quite easy to implement into a thread?

    ok so now i have
         public void start()
         animator = new Thread(this);
         animator.start();
         public void run()
         long tm = System.currentTimeMillis();
         while (Thread.currentThread() == animator)
              gLife.generation();
              setButtons();
              validate();
              show();
              try
                   tm += delay;
                   Thread.sleep(Math.max(0, tm - System.currentTimeMillis()));
              catch (InterruptedException e)
                   break;
              frame++;
         }and my current main is
         public static void main(String[] args)
         LifeAp l=new LifeAp(64,64);
         l.show();
         l.start();
         }what should i have in my main code to start my thread?
    if i have
    public static void main(String[] args)
         LifeAp l=new LifeAp(64,64);
         l.show();
         }then the process doesnt run, it just displays the first generation then stops.
    so what do i need to include?

  • Retrieving records using Thread

    I am a newbie in Java Servlet programming. I want to retrieve some records from my db2 database every 5 minutes and then display the result for viewing.
    I have no idea where should I put my html tags. Assuming that my program only have 2 methods which are the doPost method and runningThread method, should I put the tags within the doPost method or inside the running thread?
    Example or tutorial are good in term of understanding for a beginner.
    Thanks in advanced for any help.

    You don't need to use threads to do it. If it is just updated response that you need, you can achieve it by setting headers appropriately for autorefresh.
    In your doPost method , call
    response.setIntHeader("Refresh", 300) the browser re-requests the page after 300 seconds
    Then you can pull the new data and display.
    HTH

  • Updating custom component properties

    Hi all,
    I have a custom textManager component which i use in flash 8.
    This component has several parameters which are "inspectable" which
    enables me to set the value of the parameters per instance inside
    the flash parameters panel. I have now added a new value to one of
    these parameters but have noticed that this new value isnt
    available for the exisiting instances, only new instances dragged
    into the stage have this new value in the drop down. How do i
    update all the existing instances of this component so that i can
    see this new value on their parameters list? Does this require a
    JSFL solution, if so could someone give me some tip on where to
    start as i have no knowledge of JSFL. Thanks in advance
    /Eric

    Hi all,
    I have a custom textManager component which i use in flash 8.
    This component has several parameters which are "inspectable" which
    enables me to set the value of the parameters per instance inside
    the flash parameters panel. I have now added a new value to one of
    these parameters but have noticed that this new value isnt
    available for the exisiting instances, only new instances dragged
    into the stage have this new value in the drop down. How do i
    update all the existing instances of this component so that i can
    see this new value on their parameters list? Does this require a
    JSFL solution, if so could someone give me some tip on where to
    start as i have no knowledge of JSFL. Thanks in advance
    /Eric

  • Problem to update JTree

    Hello world :)
    I use JDK 1.6 update 2. My problem description:
    I have a database with product categories. Each category can have unlimited subcategories. For displaying it's structure in a JTree I've extended DefaultTreeModel, override some necessary methods and everything works fine.
    But when a user add or delete a new category or a subcategory it is deleted in a database. I can not find the way to update only this parent node, because this table model needs this node to be an implementation of a TreeNode. The only solution that works and is not a good one is to set each time a new TableModel. But even in this case a JTree collapses all expanded nodes and this is a bad thing that exasperates a user. Then I've tried to remember a TreePath of parent node and after setting a new model to call expandPath for it. But this gives nothing, all stays collapsed. I've tried to create a "shell" for my ProductCategory entity, named it TreeProductCategory, it extends a DefaultMutableTreeNode and composites my ProductCategory delegating all necessary methods. But in this case I got exceptions that this node doesn't have children when delete it. I confused and bog down.
    //Here I run over all selected tree paths
    for(TreePath path : paths){
    //get ProductCategory from node
    ProductCategory category = (ProductCategory)path.getLastPathComponent();
    //data is deleting from a database.
    //But how to update a parent tree node and notify it that
    //child node was deleted?
    ProductCategoryManager.getInstance().deleteByCrieteria_ProductCategory(category);
    //now I just set a new model. And get collapsed nodes.
    jTreeCategory.setModel(new TreeProuductCategoryModel());
    Message was edited by:
    Sergey.Chunayev

    Have you tried
    treeModel.removeNodeFromParent( node );Where node is a implementation of TreeNode?
    ICEThanks for solution. Here is my implementation of tree model.
    public class TreeProductCategoryModel extends DefaultTreeModel {
        private TreeProductCategoryRoot root;
        /** Creates a new instance of TreeProductCategoryModel */
        public TreeProductCategoryModel(TreeNode node){
            super(node);
        public TreeProductCategoryModel(){
            this(new TreeProductCategoryRoot());
        public TreeProductCategoryModel(TreeProductCategoryRoot root){
            super((TreeNode)root);
            if(root == null){
                this.root = new TreeProductCategoryRoot();
            }else{
                this.root = root;
        public Object getRoot() {
            return root;
        public Object getChild(Object parent, int index) {
            if(parent instanceof TreeProductCategoryRoot){
                TreeProductCategoryRoot r = (TreeProductCategoryRoot)parent;
                return r.getAt(index);
            if(parent instanceof ProductCategory){
                ProductCategory c = (ProductCategory)parent;
                return ProductCategoryManager.getInstance().getChildren(c).toArray()[index];
            return null;
        public int getChildCount(Object parent) {
            if(parent instanceof TreeProductCategoryRoot){
                TreeProductCategoryRoot r = (TreeProductCategoryRoot)parent;
                return r.getChildCount();
            ProductCategory c = (ProductCategory)parent;
            return (int)ProductCategoryManager.getInstance().getCountChildren(c);
        public boolean isLeaf(Object node) {
            return (getChildCount(node) == 0);
    }My nodes don't implement TreeNode, because they are persistence elements marked @Entity and I don't want to mix their implementation with a view. Is there any other ways to work with a tree without using TreeNode implemantation. I thought that it was enough to write my own class of table model, or I was wrong? I have only a little experience with Swing, may be my code has mistakes? P.S. TreeProductCategoryRoot implements TreeModel. This is done only to have a top most element root with label "Product Categories" and it is not a ProductCategory.
    Message was edited by:
    Sergey.Chunayev

  • Using only 1 view from a component ( usage )

    hi experts..
    I have a component C1 with 7 views...
    I have another componet C2 in ehich i want to use only 1 view of the component C1 rather than the entire component...
    How can i do that...
    jagruti

    Hi again.
    can u make it more simpler sascha..
    In the component controlelr of C1 create en event
    (mark as interface).
    Steps below r not clear.....
    Then in the actíon handler method of C1 fire this
    event.
    The action handler method assigned to the back button in the view you want to use in C2. Here you can use the wizzard to fire the event in the component controller. There should be a fire_... method in the component controller now.
    In the controller of view in C2 which contains the
    ViewUiContainerElement create an event handler method
    for the event of C1. In this handler you fire an
    outbound of the view which navigates to another view
    in C2.
    this is described in the above mention thread. In C2 you created a viuew with the ViewUiContainerElement which embedds the view with the back button of C1.
    Go to the attrib utes tab of this view and add the usage of C1 here.
    Then go to the methods tab of this view and create a method handleBackEvent and choose event handler. In the event columen make a F4 and select the event of the component usage C1. Hit enter.
    Create an outbound plug in this view which should be use to navigate to the view in C2 you want. Then go to the event handler method just created and fire the outbound plug.
    Do not forget to connect the outbound to the inbound of the view you want to navigate to.
    sorry for bugging u..
    No prob.
    jagruti..
    Cheers,
    Sascha
    Message was edited by:
            Sascha Dingeldey

  • How can I  get System dates  with time scheduler using threads

    how can I get System dates with time scheduler using threads.is there any idea to update Date in my application along with system Date automatic updation...

    What the heck are you talking about and whatr has it to do with threads?
    Current time: System.currentTimeMillis. Date instances are not supposed to be updated.

  • Using threads in a neural network

    Hello,
    I've written a neural network and I'm wondering how I could use threads in it's execution to 1) increase (more precisely achieve!) learning speed and 2) print out the current error value for the network so that I can see how it is working without using the de-bugger. Basically, i've read the Concurrency tutorial but I'm having trouble getting my head around how I can apply it to my network (must be one of those days!)
    I'll give a brief explanation of how i've implemented the NN to see if anybody can shed any light on how I should proceed (i.e. whether it can be threaded, what parts to thread etc.)
    The network consists of classes:
    Neuron - stores input values to be put into the network and performs the activation functions (just a mathematical operation)
    WeightMatrix - contains random weights in a 2-D array with methods for accessing and changing those weights based on output error
    Layer - simply an array that stores a collection of neurons
    InputPattern - stores the values in an array and target value of a pattern (e.g. for logical AND i would store in pattern[0] = 1; pattern [1] = 1; target = 1;)
    PatternSet - set of InputPatterns stored so that they can be input into the network for learning
    NeuralNetwork - the main class that I want to thread. This class contains multiple layers and multiple WeightMatrices (that connects the neurons in each layer). The learn algorithm then uses the methods of the previous classes to generate neuron inputs and ouputs and error values given a specific input. It uses a loop that iterates through as follows:
        public float learn(PatternSet p)
            InputPattern currentPattern = null;
            double netError=0f;
            float previousError=0f;
            float outputValue = 0f;
            float sum=0f;
            float wcv=0f;
            float output1=0f;
            float output2=0f;
            float currentError=0f;
            float multiply=0f;
            float outputError = 0f;
            float weight = 0f;
            int count;
            int setPosition=0;
            int setSize = p.getSetSize();
            Neuron outputNeuron = layers[getNumberOfLayers()-1].getNeuron(0);
            //execute learning loop and repeat until an acceptable error value is obtained
            do
                 //set input layer neuron values to pattern values
                currentPattern = p.getPattern(setPosition);
                for (int i=0; i<currentPattern.getPatternSize(); i++)
                    layers[0].getNeuron(i).setNeuronInput(currentPattern.getValue(i));
                currentError = layers[getNumberOfLayers()-1].getNeuron(0).getOutputError();
                for (int a=0; a<layers[getNumberOfLayers()-1].getNumberOfNeurons(); a++)
                    //set target value of output neuron
                    layers[getNumberOfLayers()-1].getNeuron(a).setTarget(currentPattern.getTarget());
                //iterates between weight layers - i.e. there will be a weight matrix between each layer of the NN
                for (int i=0; i<getNumberOfLayers()-1; i++)
                    for (int j=0; j<layers[i+1].getNumberOfNeurons(); j++)
                        sum =0f;
                        count=0;
                        for (int k=0; k<layers.getNumberOfNeurons(); k++)
    weight = weights[i].getWeight(k,j);
    outputValue = layers[i].getNeuron(count).getOutput();
    multiply = layers[i].getNeuron(count).getOutput() * (weights[i].getWeight(k,j));
    //add values
    sum = sum + multiply;
    count++;
    //check that all weighted neuron outputs have been completed
    if (count == layers[i].getNumberOfNeurons())
    //pass results to neuron
    layers[i+1].getNeuron(j).setNeuronInput(sum);
    //activate neuron
    layers[i+1].getNeuron(j).neuronActivation();
    //calculate output error of neuron for given input
    layers[i+1].getNeuron(j).calculateOutputError();
    //check that output layer has been reached and all neurons have been summed together
    if (i == getNumberOfLayers()-2 && count == layers[i].getNumberOfNeurons())
    outputError = layers[i+1].getNeuron(j).getOutputError();
    netError = layers[i+1].getNeuron(j).getNetError();
    for (int a=getNumberOfLayers()-1; a>0; a--)
    for (int b=0; b<layers[a-1].getNumberOfNeurons(); b++)
    for (int c=0; c<layers[a].getNumberOfNeurons(); c++)
    output1 = layers[a-1].getNeuron(b).getOutput();
    output2 = layers[a].getNeuron(c).getOutput();
    wcv = learningRate * (outputError) * output1 * output2 * (1-output2);
    weights[a-1].changeWeight(wcv, b, c);
    learningCycle++;
    if (setPosition < setSize-1)
    setPosition++;
    else
    setPosition=0;
    while (netError > acceptableError && learningCycle < 1000000000);
    return currentError;
    }At the moment the net doesn't seem to learn to an acceptable degree of accuracy, so I was looking to use threads to monitor it's error value change while I left it running just to ensure that it is working as intended (which it seems to be based on NetBeans debugger output). For the moment, all I'm aiming for is an output of the netError value of the NN at a particular time - would this be possible given my current implementation?
    Thanks for the help,
    Nick                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    For huge NN and a really multi-core CPU (reporting to OS as a multiple CPU's) one may benefit from having:
    - an example pump
    - a separate threads for calculation of forward and backwards propagation with in/out queues.
    Example pump pumps one forward example to each forward processing thread. It waits for them to complete. Then it reads their output and finds errors to backpropagate. It pumps errors to back-propagation threads. They finds weights correction but does not update weight matrix only are pushing them to the output temporary arrays. The example pump takes those corrections, combines them an updates weights.
    Redo from start.
    The rule of thumb for high-performance is - avoid locks. If must access data which are changing, make a copy of them in bulk operation, prepare bulk result and read-write in bulk operations.
    In this example a whole bunch of weight matrixes and states of neurons are such a kind of data. Each thread should use separate copy and the teaching pump should combine them together. This makes one to split data in two blocks - non-changing, common for all threads (the geometry of NN and weights) and changing, separate for each thread (weight correction, in/out of neurons).
    Avoid "new", "clone" and etc. for the preference of System.arraycopy on existing data.
    Regards,
    Tomasz Sztejka.

  • I changed my AppleID a long time ago to an email that I no longer use and I have updates for apps that I can't update because my old email is filled in to where i sign in and it wont let me change it to my new one???

    I changed my AppleID a long time ago to an email that I no longer use and I have updates for apps that I can't update because my old email is filled in to where i sign in and it wont let me change it to my new one???

    The problem with those two apps is that they are supposed to be in your Apple ID and you didn't set up the Mac properly/completely when you got it.
    You might try deleteing them and using OS X Recovery to install them again.
    OS X Recovery -
    http://support.apple.com/kb/HT4718
    After that, before you open any iLife apps go to your Mac App Store account, to the Purchased pane and Accept them into your account.

  • Can I use axis.jar in my custom component

    Can I use axis.jar in my custom component.
    Is there any license need to user this jar ??
    Thanks

    In our UCM setup axis has been implemented in a custom component to consume webservices. As Axis falls under the Apache license you can freely import it in your custom java classes.

  • HT204053 I cannot use the password to update apps on my second IPhone.  It only works on one of the phones. They both have the same Apple ID and password.

    I cannot use the password to update apps on my second IPhone.  It only works on one of the phones. They both have the same Apple ID and password.

    If it really does not work, change your password here https://appleid.apple.com (Manage account) and try to add the account again. I hope it helps.

Maybe you are looking for

  • Workaround for dropping signal in MBPro and A Extreme Basestation

    I've been struggling with an erratic signal in my MBPro 2Ghz 2 Mb, week 15, when used with wireless networks. I tried most of the workarounds posted elsewhere and nothing seem to work. In my case, I would acquire a wireless connection, and then I wou

  • Ipod nano 6th generation wont connect to computer or itunes, but still charges

    I have an Ipod nano 6 that will not connect to my computer. It still charges however. I tried a new cord. I uninstalled and reinstalled itunes. I reset my computer and the ipod. I looked to see if it was a problem with my usb drivers and the ipod did

  • Report of Sales

    Respected Sir/Madam,                I have a small Issue one of my enduser is working on Sale Quotation.He has done overall 25 Quotatoins per day.By the end of the day he wants to see only those Quotatins that has done by him of that particular date.

  • Display Multiple Lines - Edit Window

    When a user presses CNTL-e to pop up the editor window for a varchar item, is there a way for the user to show his text string on multiple lines? If you hit carriage return, the window closes. If you hit the down arrow the cursor moves to the search

  • GRC SPM 5.3: Auth. object GRCFF_0001 in the role /VIRSA/Z_VFAT_FIREFIGHTER

    Hi experts, According to latest version of "SAP GRC Access Control 5.3 Security Guide" available on SAP service marketplace: https://websmp105.sap-ag.de/~sapdownload/011000358700000406492008E/AC53_Sec_Guide_en.pdf I should assign the default role "/V