Search Results

Search found 1725 results on 69 pages for 'equation solving'.

Page 42/69 | < Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >

  • How to deal with constructor argument names?

    - by Bane
    Say I have a class that has some properties, like x, y, width and height. In its constructor, I couldn't do this: class A { public: A(int, int, int, int); int x; int y; int width; int height; }; //Wrong and makes little sense name-wise: A::A(int x, int y, int width, int height) { x = x; y = y; width = width; height = height; } First of all, this doesn't really make sense. Second, x, y, width and height become some weird values (-1405737648) when compiled using g++. It does work, however, if I append "a" to the argument names. What is the optimal way of solving these naming conflicts?

    Read the article

  • How can I enforce Eclipse to use Sun Java?

    - by Dan
    Hi Before installing Eclipse I had Open JDK on default. Now I changed it to Sun Java. I did as Eclipse Helios was running really slow, unfortunately it is still... Do you have any ideas how to enforce it to use Java Sun? I could reinstal it however I have already Android SDK installed so I would have to do all the process again, after all thats not the correct way of solving problem I think. I'm using Ubuntu 10.10. java -version java version "1.6.0_22" Java(TM) SE Runtime Environment (build1.6.0_22-b04) Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03, mixed mode) Would be grateful for any help. Best, Daniel

    Read the article

  • jQuery image fade not working for unknown reason...?

    - by Henrik Petterson
    Just when I thought I was done for the night, another issue is keeping me awake. It appears that somehow I have broken the fade I was using on my thumbnails. If you go here: http://ftframes.com/milad2/ When you hover your mouse of the thumbnails, it should fade up. To give you an idea, this is a working version of the script: http://nothingcantouchme.com/stackoverflow.php#download_page As you can see, the hover works fine with the fade. And please mind the mess on this one, I just added it to demonstrate. Is there anyone that can kindly assist me in solving this issue? I would lie if I told you that I wasn't completely lost.

    Read the article

  • Very Different Execution Times of SQL Query in C# and SQL Server Management Studio

    - by Paul
    I have a simple SQL query that when run from C# takes over 30 seconds then times-out every time, whereas when run on SQL Server Management Studio successfully completes instantly. In the latter case, a query execution plan reveals nothing troubling, and the execution time is spread nicely through a few simple operations. I've run 'EXEC sp_who2' while the query is running from C#, and it is listed as taking 29,000 milliseconds of CPU time, and is not blocked by anything. I have no idea how to begin solving this. Does anyone have some insight? The query is: SELECT c.lngId, ... FROM tblCase c INNER JOIN tblCaseStatus s ON s.lngId = c.lngId INNER JOIN tblCaseStatusType t ON t.lngId = s.lngId INNER JOIN [Another Database]..tblCompany cm ON cm.lngId = cs.lngCompanyId WHERE t.lngId = 25 AND c.IsDeleted = 0 AND s.lngStatus = 1

    Read the article

  • Ajax get throws a syntax error when ip is given instead of localhost

    - by Aruna
    Hi , i am working on cakephp. I have developed an application where i have used localhost in all ajax post and get.. like var ht = $.ajax({ type: "GET", url: "http://localhost/FormBuilder/index.php/forms/getInvitees/<?php echo $emailid;?>", async: false }).responseText; var myObject = eval('(' + ht + ')'); this thing works only when i put localhost . But when i change that to my Ip like http://111.11.11.11/FormBuilder/index.php/forms/getInvitees/", then i am getting a syntax error () in the line var myObject = eval('(' + ht + ')'); WHy it happens ?? Please give valuable suggestions in solving this.. Thank you

    Read the article

  • PHP - white screen of death!

    - by Industrial
    Hi everyone, After debugging a codeigniter app that were installed into a new development environment, I have started to freak out when seeing white screens with nothing more available. I have been able to solve each and every one of the errors that have caused this, but it have taken seriously way too long time. PHP error_reporting(E_ALL) & display_errors", 1 is set as well. I even installed Xdebug in hope of getting more output, but no. My logging settings are also working, but nothing is written to the log. Is there a way to get something informative printed out instead of a complete white screen? It would certainly shorten my time spent on solving the eventual errors that causes this? Thanks a lot! Reference: http://stackoverflow.com/questions/2149321/why-does-code-igniter-give-me-a-white-page

    Read the article

  • Catch unhandled exception of invisible thread

    - by user346804
    In my C++ application i use an activeX component that runs its own thread (or several I don't know). Sometimes this components throws exceptions. I would like to catch these exceptions and do recovery instead of my entire application crashing. But since I don't have access to its source code or thread I am unsure how it would be done. The only solution I can think of is to run it in its own process. Using something like CreateProcess and then CreateRemoteThread, unsure how it could be implemented. Any suggestion on how to go about solving this?

    Read the article

  • 0/1 Knapsack with irrational weights

    - by user356106
    Consider the 0/1 knapsack problem. The standard Dynamic Programming algorithm applies only when the capacity as well as the weights to fill the knapsack with are integers/ rational numbers. What do you do when the capacity/weights are irrational? The issue is that we can't memoize like we do for integer weights because we may need potentially infinite decimal places for irrational weights - leading to an infinitely large number of columns for the Dynamic Programming Table . Is there any standard method for solving this? Any comments on the complexity of this problem? Any heuristics? What about associated recurrences like (for example): f(x)=1, for x< sqrt(2) f(x)=f(x-sqrt(2))+sqrt(3)

    Read the article

  • Excel - Counting unique values that meet multiple criteria

    - by wotaskd
    I'm trying to use a function to count the number of unique cells in a spreadsheet that, at the same time, meet multiple criteria. Given the following example: A B C QUANT STORE# PRODUCT 1 75012 banana 5 orange 6 56089 orange 3 89247 orange 7 45321 orange 2 apple 4 45321 apple In the example above, I need to know how many unique stores with a valid STORE# have received oranges OR apples. In the case above, the result should be 3 (stores 56089, 89247 and 45321). This is how I started to try solving the problem: =SUM(IF(FREQUENCY(B2:B9,B2:B9)>0,1)) The above formula will yield the number of unique stores with a valid store#, but not just the ones that have received oranges or bananas. How can I add that extra criteria?

    Read the article

  • Best approach to a customer portal in ASP.NET MVC

    - by DoodleWalker
    Hi All, The problem: client needs a website to serve 10+ customers, each customer has 5-10 people they wish to grant access using login & user name, once "logged in" the user can download files specific to their company. The files will be uploaded to a directory under the customer name, and displayed as a list. Currently using membership for all of the users, it's just the "by customer" segmentation I'm wondering about. the question being under ASP.NET MVC what is the cleanest or simplest approach to solving the customer segmentation, trying to avoid customer membership provider so was going to use the roles to assign customer group. Thoughts appreciated.

    Read the article

  • Django Redundancy

    - by Sunsu
    I've read many things about scaling Django and the new multiple-DB support makes it so much easier. However, I have not been able to find much information on good ways to create a fully redundant system (not just one that scales). I realize there are many things that go into this problem, but the real thing I'm having trouble solving well is Database redundancy. Is it possible to set up a "write slave" using django's new multiple-DB support? If I had IP failover support it seems like having a write slave would help solve the problem. Simple MySQL replication doesn't seem like it will work due to slave lag right? What's the typical method of creating a redundant database system? Any input or guidance you guys have would be greatly appreciated. I realize I could be asking the wrong questions!

    Read the article

  • Algorithm to find added/removed elements in an array

    - by jj
    Hi all, I am looking for the most efficent way of solving the following Problem: given an array Before = { 8, 7, 2, 1} and an array After ={1, 3, 8, 8} find the added and the removed elements the solution is: added = 3, 8 removed = 7, 2, 1 My idea so far is: for i = 0 .. B.Lenghtt-1 { for j= 0 .. A.Lenght-1 { if A[j] == B[i] A[j] = 0; B[i] = 0; break; } } // B elemnts different from 0 are the Removed elements // A elemnts different from 0 are the Added elemnts Does anyone know a better solution perhaps more efficent and that doesn't overwrite the original arrays

    Read the article

  • What will be the setup process for website development?

    - by Vijay Shanker
    Hi, I want to create a simple site for my personal usage. And this only in python based technologies. So I want to get a expert oponian on this topic. What should i used as platform? I did a search for available options and found Django, grok, web2py and many more of these. Which one a novice use should use? If I choose to use only the basic python scripts then what option i have to work on? http://wiki.python.org/moin/WebBrowserProgramming. This link on python site confused me more, instead of solving my curiosity about the topic. Please give some pointer to accurate and easy to understand reading materials. I have got a idea of developing java based web applications using either spring-webmvc and struts. Can I relate Java process to python process for web development?

    Read the article

  • Problem with number/type of arguments passed to an overloaded c++ constructor wrapped with swig.

    - by MiKo
    I am trying to wrap a c++ class (let's call it "Spam") written by someone else with swig to expose it to Python. After solving several problems, I am able to import the module in python, but when I try to create an object of such class I obtain the following error: foo = Spam.Spam('abc',3) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "Spam.py", line 96, in __init__ this = _Spam.new_Spam(*args) NotImplementedError: Wrong number of arguments for overloaded function 'new_Spam'. Possible C/C++ prototypes are: Spam(unsigned char *,unsigned long,bool,unsigned int,SSTree::io_action,char const *) Spam(unsigned char *,unsigned long,bool,unsigned int,SSTree::io_action) Spam(unsigned char *,unsigned long,bool,unsigned int) Spam(unsigned char *,unsigned long,bool) Spam(unsigned char *,unsigned long) Googling around, I realized that the error is probably caused by the type of the arguments and not by the number (which is quite confusing), but I still cannot identify. I suspect the problem lies in passing a string as the first argument, but have no idea on how to fix it (keep in mind that I know almost no c/c++).

    Read the article

  • is_admin? function in rails? - undefined method Error

    - by Newbie
    Hello! At the moment, I am creating some kind of admin panel/backend for my site. I want to do the following: Only admins (a user has a user_role(integer) -- 1 = admin, 2 = moderator, 3 = user) can see and access a link for the admin panel. So I created an admin_controller. In my admin controller I created a new function called is_admin?: class AdminController < ApplicationController def admin_panel end def is_admin? current_user.user_role == 1 end end my route looks like. map.admin_panel '/admin-panel', :controller => 'admin', :action => 'admin_panel' and in my _sidebar.html.erb (partial in applicaton.html.erb) I created the link: <%= link_to "Admin Panel", :admin_panel unless is_admin? %> Now I get an error called: undefined method `is_admin?' Where is the problem? Please help me solving this problem!

    Read the article

  • How to search for a string including spaces in Objective C?

    - by AlexCu
    I have a real basic command-line program, in Objective-C, that searches for user inputed information. Unfourtunately, the code will only read the first word in series of words that the user enters. For example, if the user enters in "Apples are great", only "Apples" is kept (and hence searched later on), excluding the "are great" part of the sentence. Here's what I have so far: char enteredQuery [128]; // array 'name' to hold the scanf string NSString *searchQuery; // ending NSString to hold and compare the user inputed data NSLog(@"Enter search query:"); scanf("%s", enteredQuery); //will read the next line searchQuery = [NSString stringWithCString: enteredQuery encoding: NSASCIIStringEncoding]; //converts scanf data into a NSString type I know it's got to do with me using scanf or the character-encoder conversion, but I can't seem to figure it out. Any help in solving the problem is very appreciated! Thanks.

    Read the article

  • Java: How to I change the color of a specific line or row of string in a Text area?

    - by Kevin
    Hi all, the one way I could change the color is by setForground(). However when there are multiple lines of code it makes everything green or black. Is there another method or any way of solving this problem? Thanks! int key = evt.getKeyCode(); if (key == KeyEvent.VK_ENTER) { String tb1EnterdValue = tb1.getText().toString(); if((tb1EnterdValue.equals("yes")) ) { TextArea1.setForeground(Color.green); else { TextArea1.setForeground(Color.lightGray); } this.TextArea1.append(">"+tb1EnterdValue+newline); this.tb1.setText("");

    Read the article

  • How might one detect the first run of a program?

    - by Julian H. Lam
    In my web application, users can download a .tar.gz archive containing the app files. However, because the MySQL database won't have been configured then, the user needs to run the install script located in ./install. I "catch" the user upon first run of the app by checking to see if the ./install directory exists. If so, the index.php page redirects the user to the install script. However, I was wondering if there were a more elegant way to "catch" a user upon first-run of a program. Someone on IRC suggested the web-server create a file .installed upon completion, but because the web server might not have write privileges to the web root directory, I can't rely on that. How would you go about solving this problem, or is my solution workable?

    Read the article

  • Should I use a modified singleton design pattern that only allows one reference to its instance?

    - by Graham
    Hi, I have a class that would normally just generate factory objects, however this class should only used once throughout the program in once specifix place. What is the best design pattern to use in this instance? I throught that having a modified singleton design which only allows one reference to instance throughout the program would be the correct way to go. So only the first call to getInstance() returns the factory library. Is this a good or bad idea? Have I missed out another fundermental design pattern for solving this problem? Thanks for your help.

    Read the article

  • ArrayBlockingQueue exceeds given capacity

    - by Wojciech Reszelewski
    I've written program solving bounded producer & consumer problem. While constructing ArrayBlockingQueue I defined capacity 100. I'm using methods take and put inside threads. And I've noticed that sometimes I see put 102 times with any take's between them. Why does it happen? Producer run method: public void run() { Object e = new Object(); while(true) { try { queue.put(e); } catch (InterruptedException w) { System.out.println("Oj, nie wyszlo, nie bij"); } System.out.println("Element added"); } } Consumer run method: public void run() { while(true) { try { queue.take(); } catch (InterruptedException e) { e.printStackTrace(); } System.out.println("Element removed"); } } Part of uniq -c on file with output: 102 Element removed 102 Element added 102 Element removed 102 Element added 102 Element removed 102 Element added 102 Element removed 102 Element added 102 Element removed 102 Element added 102 Element removed 102 Element added 2 Element removed 2 Element added 102 Element removed 102 Element added

    Read the article

  • AppFabric serialization problem.

    - by jandark
    I am trying cache a class instance with AppFabric but it return class instance with empty members. The reason is DataContract Attribute. My class is marked with [Serializable] and [DataContract(Name = "TestClass", Namespace = "CustomNameSpace.TestClass")] attributes. Problem solving if I mark all properties with DataMember or remove DataContract attribute. But I do not want to remove DataContract attributte because of other serialization needs (such as json or something else) Or I do not want to add DataMember attribute to other classes. (a lot of) Do you have any idea to solve that problem ? Thanks.

    Read the article

  • Best practice for handling memory leaks in large Java projects?

    - by knorv
    In almost all larger Java projects I've been involved with I've noticed that the quality of service of the application degrades with the uptime of the container. This is most probably due to memory leaks in the code. The correct way to solve this problem is obviously to trace back to the root cause of the problem and fix the leaks in the code. The quick and dirty way of solving the problem is simply restarting Tomcat (or whichever servlet container you're using). These are my three questions: Assume that you choose to solve the problem by tracing the root cause of the problem (the memory leaks), how would you collect data to zoom in on the problem? Assume that you choose the quick and dirty way of speeding things up by simply restarting the container, how would you collect data to choose the optimal restart cycle? Have you been able to deploy and run projects over an extended period of time without ever restarting the servlet container to regain snappiness? Or is an occasional servlet restart something that one has to simply accept?

    Read the article

  • How do I all the registered users on a day report

    - by Nadal
    I have a table called users where I have two columns: name and created_at. created_at column column is of type datetime and it stores the datetime when this user was created. I need to know the number of users created for a given date range. Let's say I ask give me user report between 1-nov-2010 and 30-nov-2010 . I need something like this 1-nov-2010: 2 2-nov-2010: 5 The problem I am running into is that created_at data has value upto second. How do I check if a created_at date falls within a given date. Any help in solving this problem is appreciated. I am using mysql5.

    Read the article

  • How do I best write my own background-working and communicatible (sending progress updates and getti

    - by Ivan
    I have to develop a class which can run it's own hard-coded task in a background thread and communicate with container class sending him progress updates and taking messages from it. I believe I am going to extend BackgroundWorker class but it looks a bit weird to extend and I haven't managed to find a good example wit Google. Can you share a link to a good example of solving such a task? Please don't offer placing a BackgroundWorker visually on a form and reading the standard tutorial, it's not for my case. Maybe I'd better not extend but encapsulate a BackgroundWorker, but I hardly understand how to use it outide WinForms designer either :-(

    Read the article

  • Tree + Recursion..

    - by RBA
    Hi.. I came across an article on Binary Trees Search . It uses intensive Recursive Algorithms.. I am just so confused with these stuff.. Please guide my path so as I understand these problems at ease, or any good website to read about recursion first and then solving these problems.. Please share your experience on it.. Its very urgent, and I want to learn these concepts as soon as possible.. Thankss... Regards.

    Read the article

< Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >