Search Results

Search found 21663 results on 867 pages for 'result sets'.

Page 8/867 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • c# opennetCF background worker - e.result gives a ObjectDisposedException

    - by ikky
    Hi! I'm new working with background worker in C#. Here is a class, and under it, you will find the instansiation of it, and under there i will define my problem for you: I have the class Drawing: class Drawing { BackgroundWorker bgWorker; ProgressBar progressBar; Panel panelHolder; public Drawing(ref ProgressBar pgbar, ref Panel panelBig) // Progressbar and panelBig as reference { this.panelHolder = panelBig; this.progressBar = pgbar; bgWorker = new BackgroundWorker(); bgWorker.WorkerReportsProgress = true; bgWorker.WorkerSupportsCancellation = true; bgWorker.DoWork += new OpenNETCF.ComponentModel.DoWorkEventHandler(this.bgWorker_DoWork); bgWorker.RunWorkerCompleted += new OpenNETCF.ComponentModel.RunWorkerCompletedEventHandler(this.bgWorker_RunWorkerCompleted); bgWorker.ProgressChanged += new OpenNETCF.ComponentModel.ProgressChangedEventHandler(this.bgWorker_ProgressChanged); } public void createDrawing() { bgWorker.RunWorkerAsync(); } private void bgWorker_DoWork(object sender, DoWorkEventArgs e) { Panel panelContainer = new Panel(); // Adding panels to the panelContainer for(i=0; i<100; i++) { Panel panelSubpanel = new Panel(); // Setting size, color, name etc.... panelContainer.Controls.Add(panelSubpanel); // Adding the subpanel to the panelContainer //Report the progress bgWorker.ReportProgress(0, i); // Reporting number of panels loaded } e.Result = imagePanel; // Send the result(a panel with lots of subpanels) as an argument } private void bgWorker_ProgressChanged(object sender, ProgressChangedEventArgs e) { this.progressBar.Value = (int)e.UserState; this.progressBar.Update(); } private void bgWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (e.Error == null) { this.panelHolder = (Panel)e.Result; } else { MessageBox.Show("An error occured, please try again"); } } } Instansiating an object of this class: public partial class Draw: Form { public Draw() { ProgressBar progressBarLoading = new ProgressBar(); // Set lots of properties on progressBarLoading Panel panelBigPanelContainer = new Panel(); Drawing drawer = new Drawing(ref progressBarLoading, ref panelBigPanelContainer); drawer.createDrawing(); // this makes the object start a new thread, loading all the panels into a panel container, while also sending the progress to this progressbar. } } Here is my problem: In the private void bgWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) i don't get the e.Result as it should be. When i debug and look at the e.Result, the panel's properties have this exception message: '((System.Windows.Forms.Control)(e.Result)).ClientSize' threw an exception of type 'System.ObjectDisposedException' So the object gets disposed, but "why" is my question, and how can i fix this? I hope someone will answer me, this is making me crazy. Another question i have: Is it allowed to use "ref" with arguments? is it bad programming? Thanks in advance. I have also written how i understand the Background worker below here: This is what i think is the "rules" for background workers: bgWorker.RunWorkerAsync(); => starts a new thread. bgWorker_DoWork cannot reach the main thread without delegates - private void bgWorker_DoWork(object sender, DoWorkEventArgs e) { // The work happens here, this is a thread that is not reachable by the main thread e.Result => This is an argument which can be reached by bgWorker_RunWorkerCompleted() bgWorker.ReportProgress(progressVar); => Reports the progress to the bgWorker_ProgressChanged() } - private void bgWorker_ProgressChanged(object sender, ProgressChangedEventArgs e) { // I get the progress here, and can do stuff to the main thread from here (e.g update a control) this.ProgressBar.Value = e.ProgressPercentage; } - private void bgWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { // This is where the thread is completed. // Here i can get e.Result from the bgWorker thread // From here i can reach controls in my main thread, and use e.Result in my main thread if (e.Error == null) { this.panelTileHolder = (Panel)e.Result; } else { MessageBox.Show("There was an error"); } }

    Read the article

  • how to get the result query one by one in jsp and mysql

    - by user261002
    I am trying to implement as Online Mock exam in JSP, but I have a problem to get the questions one by one, it get connceted for the first time, and show me the first question and answers, but when I click on "next" again, it still show me the first question, I think by clicking on "next" it start querying again. please help me. this is my bean : database.SQLSelectStatement sqlselect; database.SQLSelectStatement sqlselect2; static ResultSet questions; static ResultSetMetaData rsm; static ResultSet answers; public void setConnection() throws SQLException { if (database.DatabaseManager.getInstance().connectionOK()) { sqlselect = new database.SQLSelectStatement("question", "question", "0"); sqlselect2 = new database.SQLSelectStatement("answers", "question_id", "0"); questions = sqlselect.executeWithNoCondition(); } } public int i=0; public String getQuestions() throws SQLException { String result = ""; rsm = questions.getMetaData(); for (int i = 0; i < rsm.getColumnCount(); i++) { result += "<th>" + rsm.getColumnName(i + 1) + "</th>"; } if (!questions.isLast()) { questions.next(); System.out.println(i+1); result += "<tr>"; result += "<td>" + questions.getInt(1) + "</td>"; result += "<td>" + questions.getString(2) + "</td>"; result += "</tr>"; result += "<tr>"; sqlselect2.setValue(String.valueOf(questions.getInt(1))); answers = sqlselect2.Execute(); while (answers.next()) { result += "<tr> <td colspan='2'><input type='radio' name='answer' value='" + answers.getString(2) + "'> " + answers.getString(2) + "</td></tr>"; } result += "</tr>"; answers.close(); } return result; } this is the HTML: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <h1>JSP Page</h1> <jsp:useBean id="exam" class="exam.ExamQuestions"></jsp:useBean> <% exam.setConnection(); %> <form method="post"> <table > <%=exam.getQuestions()%> </table> <input type="submit" name="action" value="next"/> </form> <% String action = request.getParameter("action"); if ("next".equals(action)) { out.println(request.getParameter("answer")); } %> </body> </html>

    Read the article

  • Running Best Practice Analyzer on Windows 2012 yields error "Result file has not yet been generated"

    - by mhildreth
    Whenever I run the Best Practice Analyzer on a Windows 2012 server with IIS installed, I receive the error: "There has been a Best Practice Analyzer error for Model Id 'Microsoft/Windows/WebServer'. The Result file has not yet been generated. Please perform the scan first and try again." I'm doing this from the "Local Server" section of the Server Manager. I'm logged in as with a domain credential that has administrative rights on the server. I don't know how to generate the result file or where it would be located. I have 4 servers, all with IIS and this is happening on all of them. The servers are practically brand new so there isn't anything really exceptional about their setup. Any suggestions on how to generate the result file? Thanks in advance.

    Read the article

  • SVM Classification - minimum number of input sets for each class

    - by Amol Joshi
    Im trying to build an app to detect images which are advertisements from the webpages. Once I detect those Ill not be allowing those to be displayed on the client side. From the help that I got here in stackoverflow, I thought SVM is the best approach to my aim. So, I have coded SVM and an SMO myself. The dataset which I have got from UCI data repository has 3280 instances ( Link to Dataset- http://archive.ics.uci.edu/ml/datasets/Internet+Advertisements )where around 400 of them are from class representing Advertisement images and rest of them representing non-advertisement images. Right now Im taking the first 2800 input sets and training the SVM. But after looking at the accuracy rate I realised that most of those 2800 input sets are from non-advertisement image class. So Im getting very good accuracy for that class. So what can I do here? About how many input set shall I give to SVM to train and how many of them for each class? Thanks. Cheers. ( Basically made a new question because the context was different from my previous question. http://stackoverflow.com/questions/1991113/optimization-of-neural-network-input-data )

    Read the article

  • Getting results in a result set from dynamic SQL in Oracle

    - by msorens
    This question is similar to a couple others I have found on StackOverflow, but the differences are signficant enough to me to warrant a new question, so here it is: I want to obtain a result set from dynamic SQL in Oracle and then display it as a result set in a SqlDeveloper-like tool, just as if I had executed the dynamic SQL statement directly. This is straightforward in SQL Server, so to be concrete, here is an example from SQL Server that returns a result set in SQL Server Management Studio or Query Explorer: EXEC sp_executesql N'select * from countries' Or more properly: DECLARE @stmt nvarchar(100) SET @stmt = N'select * from countries' EXEC sp_executesql @stmt The question "How to return a resultset / cursor from a Oracle PL/SQL anonymous block that executes Dynamic SQL?" addresses the first half of the problem--executing dynamic SQL into a cursor. The question "How to make Oracle procedure return result sets" provides a similar answer. Web search has revealed many variations of the same theme, all addressing just the first half of my question. I found this post explaining how to do it in SqlDeveloper, but that uses a bit of functionality of SqlDeveloper. I am actually using a custom query tool so I need the solution to be self-contained in the SQL code. This custom query tool similarly does not have the capability to show output of print (dbms_output.put_line) statements; it only displays result sets. Here is yet one more possible avenue using 'execute immediate...bulk collect', but this example again renders the results with a loop of dbms_output.put_line statements. This link attempts to address the topic but the question never quite got answered there either. Assuming this is possible, I will add one more condition: I would like to do this without having to define a function or procedure (due to limited DB permissions). That is, I would like to execute a self-contained PL/SQL block containing dynamic SQL and return a result set in SqlDeveloper or a similar tool. So to summarize: I want to execute an arbitrary SQL statement (hence dynamic SQL). The platform is Oracle. The solution must be a PL/SQL block with no procedures or functions. The output must be generated as a canonical result set; no print statements. The output must render as a result set in SqlDeveloper without using any SqlDeveloper special functionality. Any suggestions?

    Read the article

  • How to exclude result from 2 different table and show the result?

    - by Lucy Amalia Lusiana
    I have 2 tables: T1 (Total User) T2 (User_id_that_have_done_something_for_today) the mysql_query result from T1 are (Total User) ----- ID ----- | 1 | | 2 | | 3 | | 4 | | 5 | | 6 | | 7 | | 8 | the mysql_query from T2 are (logged) ----- user_id_log ----- | 1 | | 3 | | 4 | | 7 | How to compare T1 and T2 And only show the user that not approved? The end result that i wanted is (result) ----- ID ----- | 2 | | 5 | | 6 | | 8 | I spent 2 days to make this work but i cannot do it I have try LEFT JOIN and NOT IT but the result is not what i wanted Please help me, thank you

    Read the article

  • An efficient code to determine if a set is a subset of another set

    - by Edward
    I am looking for an efficient way to determine if a set is a subset of another set in Matlab or Mathematica. Example: Set A = [1 2 3 4] Set B = [4 3] Set C = [3 4 1] Set D = [4 3 2 1] The output should be: Set A Sets B and C belong to set A because A contains all of their elements, therefore, they can be deleted (the order of elements in a set doesn't matter). Set D has the same elements as set A and since set A precedes set D, I would like to simply keep set A and delete set D. So there are two essential rules: 1. Delete a set if it is a subset of another set 2. Delete a set if its elements are the same as those of a preceding set My Matlab code is not very efficient at doing this - it mostly consists of nested loops. Suggestions are very welcome! Additional explanation: the issue is that with a large number of sets there will be a very large number of pairwise comparisons.

    Read the article

  • An efficient code to determine if a set is a subset of another set

    - by Edward
    I am looking for an efficient way to determine if a set is a subset of another set in Matlab or Mathematica. Example: Set A = [1 2 3 4] Set B = [4 3] Set C = [3 4 1] Set D = [4 3 2 1] The output should be: Set A Sets B and C belong to set A because A contains all of their elements, therefore, they can be deleted (the order of elements in a set doesn't matter). Set D has the same elements as set A and since set A precedes set D, I would like to simply keep set A and delete set D. So there are two essential rules: 1. Delete a set if it is a subset of another set 2. Delete a set if its elements are the same as those of a preceding set My Matlab code is not very efficient at doing this - it mostly consists of nested loops. Suggestions are very welcome! Additional explanation: the issue is that with a large number of sets there will be a very large number of pairwise comparisons.

    Read the article

  • Hiding result sets from multiple selects in a stored procedure

    - by Josh Young
    I have a stored procedure that retrieves SQL queries as text and executes the statements using sp_executesql. Each of the dynamic queries is a count query in that it only returns the number of records found (select COUNT(id) from...). I am looping through a set of SQL queries stored as text and building a table variable out of the results. At the end, I am selecting all the results from the table variable as the result set that I want returned from the stored procedure. However, when I execute the stored procedure, I am naturally getting multiple result sets (one for each of the dynamic queries and one for the final select.) Is there any way I can suppress the results of a select statement executed through sp_executesql? I have found answers that reference storing the results in a temp table, but I don't have control of the query text that I am running so I can't change it to select into anything. Please help. Thank you for your time.

    Read the article

  • Intersection between sets containing different types of variables

    - by Gacek
    Let's assume we have two collections: List<double> values List<SomePoint> points where SomePoint is a type containing three coordinates of the point: SomePoint { double X; double Y; double Z; } Now, I would like to perform the intersection between these two collections to find out for which points in points the z coordinate is eqal to one of the elements of values I created something like that: HashSet<double> hash = new HashSet<double>(points.Select(p=>p.Z)); hash.IntersectWith(values); var result = new List<SomePoints>(); foreach(var h in hash) result.Add(points.Find(p => p.Z == h)); But it won't return these points for which there is the same Z value, but different X and Y. Is there any better way to do it?

    Read the article

  • Problem with the way the Ajax Control Toolkit TabContainer sets the default submit button

    - by Colin
    We have an Ajax Control Toolkit TabContainer containing some textboxes for doing a search. When you keypress inside one of the textboxes, the TabContainer sets the default button to be the button immediately following the tab control. This is fine because that's the search button. The problem occurs after the button is clicked and results returned. Now there is no default button, and keypress does nothing. Any suggestions?

    Read the article

  • Training sets for AdaBoost algorithm

    - by palau1
    How do you find the negative and positive training data sets of Haar features for the AdaBoost algorithm? So say you have a certain type of blob that you want to locate in an image and there are several of them in your entire array - how do you go about training it? I'd appreciate a nontechnical explanation as much as possible. I'm new to this. Thanks.

    Read the article

  • ASP.NET sets of technologies/components

    - by Maxim Gueivandov
    Just a question of pure curiosity. It happens that development teams tend to stick to the same technological set(s) for some time, for various reasons (obviously, the lack of time, money, necessity and/or willingless to adopt new technologies). So, what are your usual sets of technologies/components to build an ASP.NET application (e.g., WebForms / MVC, Automapper, NInject, NHibernate / LinqToSql, JQuery / ASP.NET Ajax, ...) or architectural frameworks (Arch#, Catharsis, ...) and in which context do you use them (site size, speed/availability requirements, etc.)?

    Read the article

  • Character Sets explained for Dummies!

    - by Imran
    I don't think i fully understand character sets so i was wondering if anyone would be kind enough to explain it in layman's terms with examples ( for Dummies).I know there is utf8, latin1, ascii ect The more answers the better really. Thank you in advance;-)

    Read the article

  • Align 2 sets of 2D point clouds

    - by user108088
    From what I gather, there are two major methods to perform alignment on point clouds, Iterative Closest Point (ICP) and Particle Filtering. What are the advantages of each method? And can someone point me some good tutorials. For what I am currently doing, I think ICP would be easier, I can't seem to find any simple reference implementations online for 2d point sets. Has anyone seen (psuedo)code for ICP with details on the transformation step? Thanks in advance.

    Read the article

  • Having multiple 'sets' of open files in Netbeans

    - by edorian
    I'd like to be able to have multiple "sets" of open files in netbeans but i didn't find a way or plugin to do it. Say i have 5 file related to "bug xyz" but i want to start working on feature "abc". Instead of having 10 files open i'd like to be able to say "create new set of files" and work on those and switch back and forth. Is there some way it netbeans to achieve this ?

    Read the article

  • Problem with the way the Ajax Control Toolkit tab control sets the default submit button

    - by Colin
    We have a tab control containing some textboxes for doing a search. When you keypress inside one of the textboxes, the tab control sets the default button to be the button immediately following the tab control. This is fine because that's the search button. The problem occurs after the button is clicked and results returned. Now there is no default button, and keypress does nothing. Any suggestions?

    Read the article

  • Fast data structure for small sets

    - by thr
    I'm in need for a data structure that can handle small sets (10-20 strings, at most 50, of varying length) very fast. False positives is ok, but false negatives are not. The last requirement makes bloom filters seem like a good fit, but I'm not sure about their speed, any other recommendations?

    Read the article

  • Minimum range of 3 sets

    - by user343882
    We have three sets S1, S2, S3. I need to find x,y,z such that x E S1 y E S2 z E S3 let min denote the minimum value out of x,y,z let max denote the maximum value out of x,y,z The range denoted by max-min should be the MINIMUM possible value

    Read the article

  • Looping an executable to get the result from Python script

    - by fx
    In my python script, I need to call within a for loop an executable, and waiting for that executable to write the result on the "output.xml". How do I manage to use wait() & how do I know when one of my executable is finished generating the result to get the result? How do I close that process and open a new one to call again the executable and wait for the new result? import subprocess args = ("bin/bar") popen = subprocess.Popen(args) I need to wait for the output from "bin/bar" to generate the "output.xml" and from there, read it's content. for index, result in enumerate(results): myModule.callSubProcess(index) #this is where the problem is. fileOutput = open("output.xml") parseAndStoreInSQLiteFileOutput(index, file)

    Read the article

  • Convert executed SQL result to a list of Model object

    - by huynq9
    I'm wondering that is it possible to convert the executed query result to a list of models. I'm using Ruby with ActiveRecord and need to execute custom SQL query to join two or many tables. The code looks like below: connection = ActiveRecord::Base.connection sql = "select T1.f1, T2.f2 from T1 left join T2 on T1.id = T2.id" @result = connection.execute(sql) In Ruby code, I defined a models to manage the executed SQL result: class Model property :f1, :f2 end Is there any way to convert @result to list of Model object? so I can deal with each item in the list as following @result.each do |item| puts item.f1 puts item.f2 end

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >