Daily Archives

Articles indexed Monday May 17 2010

Page 13/112 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • Are there plans to make a non-programming general version of StackOverFlow like Yahoo Answer! [close

    - by RoboShop
    Firstly, I would like to say I think StackOverflow is a really great website, not just from a content perspective, but from a design perspective. The UI is designed in a way that makes it easy to use and the points are great incentives to be a productive part of the community. I was wondering, is there a part of the site, or maybe is there plans to make a new site, which is not programming driven. Like a general knowledge site but with StackOverflow as the engine. I use sites like Yahoo Answer! and they can be useful. But I think the main difference between Stack Overflow and Yahoo Answer is that Yahoo Answer encourages content indiscriminately, whereas Stack Overflow is disciplined enough that it only encourages content that are helpful or useful. I find it great that I can load up a question and the best answer pops up immediately, and the bad answers are voted down. Thanks

    Read the article

  • Runtime casting from String to other datatype

    - by Gengrlin
    Hi I have Map of String values. I want to cast this value at runtime. e.g. Map map = new HashMap(); map.put("key1","101"); map.put("key2","45.40"); Now runtime I know key1 is integer and key2 is double How can I cast this. I tried this: ("101").getClass().cast(Integer). Thanks.

    Read the article

  • Structured Storage

    - by user342735
    Hi All, I have a file that is in structured storage format. I was wondering if this format be accessed concurrently by threads. Meaning have multiple threads read the different streams process it at once. The objective is to load the file faster. When i refer to a file i refer one that represents CAD information. Thank you.

    Read the article

  • Makefile option/rule to handle missing/removed source files

    - by b3nj1
    http://stackoverflow.com/questions/239004/need-a-makefile-dependency-rule-that-can-handle-missing-files gives some pointers on how to handle removed source files for generating .o files. I'm using gcc/g++, so adding the -MP option when generating dependencies works great for me, until I get to the link stage with my .a file... What about updating archives/libraries when input sources go away? This works OK for me, but is there a cleaner way (ie, something as straightforward as the g++ -MP option)? #BUILD_DIR is my target directory (includes Debug/Release and target arch) #SRC_OUTS are my .o files LIBATLS_HAS = $(shell nm ${BUILD_DIR}/libatls.a | grep ${BUILD_DIR} | sed -e 's/.*(//' -e 's/).*://') LIBATLS_REMOVE = $(filter-out $(notdir ${SRC_OUTS}), ${LIBATLS_HAS}) ${BUILD_DIR}/libatls.a: ${BUILD_DIR}/libatls.a(${SRC_OUTS}) ifneq ($(strip ${LIBATLS_REMOVE}),) $(AR) -d $@ ${LIBATLS_REMOVE} endif

    Read the article

  • CodeIgniter -- unable to use an object

    - by Smandoli
    THE SUMMARY: When I call .../index.php/product, I receive: Fatal error: Call to a member function get_prod_single() on a non-object in /var/www/sparts/main/controllers/product.php on line 16 The offending Line 16 is: $data['pn_oem'] = $this->product_model->get_prod_single($product_id); Looks like I don't know how to make this a working object. Can you help me? THE CODE: In my /Models folder I have product_model.php: <?php class Product_model extends Model { function Product_model() { parent::Model(); } function get_prod_single($product_id) { //This will be a DB lookup ... return 'foo'; //stub to get going } } ?> In my /controllers folder I have product.php: <?php class Product extends Controller { function Product() { parent::Controller(); } function index() { $this->load->model('Product_model'); $product_id = 113; // will get this dynamically $data['product_id'] = $product_id; $data['pn_oem'] = $this->product_model->get_prod_single($product_id); $this->load->view('prod_single', $data); } } ?>

    Read the article

  • ASP.NET MVC in a subfolder (only) on godaddy

    - by Anthony Potts
    Okay, I have read many of the routing posts concerning putting asp.net mvc on godaddy. However, I have not come to a solution to my current problem. I am trying to publish an ASP.NET MVC application to a subfolder on godaddy. I have upgraded the account to use IIS 7 and I have included the MVC dlls in \bin\ deployment method. However, I suspect that my route is not correct. Currently, my routes are set up with the standard out of the box route: public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = "" } // Parameter defaults ); } I have a subdomain set up so that it looks like office.domain.com. The subdomain is pointing at a folder "/office/" which is right off the root folder. (There is not an MVC application installed in the root folder). All of my application has been placed in this 'office' folder. When I hover over the links however, the 'office' portion shows up in the link as well. e.g. Hovering over a link to the customer controller, index action yields "office.domain.com/office/Customer" as the target. This link then gets a 404 when I attempt to go to it. What should my route be to fix this? Is there something I have neglected in setting up the subdomain in godaddy? Is this something I just can't do in godaddy's domain management "tool". Do I need to set up a virtual directory for this instead of just a directory? Update: I changed the IIS settings in godaddy to use integrated pipeline mode, per this discussion and I am no longer getting 404 errors. The application worked just fine as suggested it would.

    Read the article

  • Page validation not working in javascript

    - by crisgomez
    Hi, I have a problem regarding checking the page validation in javascript. I have a user controls in my aspx page,for example control1, control2, and control3. For each control I created a validation group, then I tried to use the code below, the problem is, it will always return a false value eventhough the page validation has been satisfied.What went wong with the code below?By the way I used Ajax in my application. if (typeof (Page_Validators) != "undefined") { if (typeof (Page_ClientValidate) == 'function') { Page_ClientValidate(); } if (Page_IsValid) { // do something alert('Page is valid!'); } else { // it will always goes here eventhough it was validated successfully alert('Page is not valid!'); } }

    Read the article

  • number of elements in a static array of a predefined size

    - by cppb
    I have an array like this: int a[100]; I am filling only the first 4 elements in this array: a[0] = 1; a[1] = 2; a[2] = 3; a[3] = 4; When I do sizeof(a)/sizeof(a[0]) it returns 100. Is there a way I can get number of elements to which I have assinged a value and thus filtering out the remaining 96 unassigned elements? thanks

    Read the article

  • Balancing a Binary Tree (AVL)

    - by Gustavo Carreno
    Ok, this is another one in the theory realm for the CS guys around. In the 90's I did fairly well in implementing BST's. The only thing I could bever get my head around was the intricacy of the algorithm to balance a Binary Tree (AVL). Can you guys help me on this?

    Read the article

  • Looking for Light Time Management Software Suggestions (for Mac)

    - by tmo256
    I'm looking for a simple project management app that performs task scheduling, along the line of Merlin or MS Project, but no where near as robustly. I don't need to deal with other (human) resources, but I work on anything from 3 to 6 different projects at a time. What I'd like is to be able to input deadlines and tasks, and have a schedule suggested to complete them. I do technical work, but I don't think I need anything specifically for software development, especially considering I do plenty of other kinds of things, like graphic design and social media PR. I'd really like this to be dead simple, as simple as possible. Suggestions? OmniPlan, something web-based? Definitely cannot afford anything too extravagant, really looking for something under $200. Thanks for your input!

    Read the article

  • Ladder word-like game GUI problems

    - by sasquatch90
    Ok so I've written my own version of game which should look like this : http://img199.imageshack.us/img199/6859/lab9a.jpg but mine looks like that : http://img444.imageshack.us/img444/7671/98921674.jpg How can I fix this ? Is there a way to do the layout completely differently ? Here's the code : Main.java : import java.util.Scanner; import javax.swing.*; import java.awt.*; public class Main { public static void main(String[] args){ final JFrame f = new JFrame("Ladder Game"); Scanner sc = new Scanner(System.in); System.out.println("Creating game data..."); System.out.println("Height: "); while (!sc.hasNextInt()) { System.out.println("int, please!"); sc.next(); } final int height = sc.nextInt(); Grid[]game = new Grid[height]; for(int L = 0; L < height; L++){ Grid row = null; int i = L+1; String s; do { System.out.println("Length "+i+", please!"); s = sc.next(); } while (s.length() != i); Element[] line = new Element[s.length()]; Element single = null; String[] temp = null; String[] temp2 = new String[s.length()]; temp = s.split(""); for( int j = temp2.length; j>0; j--){ temp2[j-1] = temp[j]; } for (int k = 0 ; k < temp2.length ; k++) { if( k == 0 ){ single = new Element(temp2[k], 2); } else{ single = new Element(temp2[k], 1); } line[k] = single; } row = new Grid(line); game[L] = row; } //############################################ //THE GAME STARTS HERE //############################################ JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS)); panel.setBackground(Color.ORANGE); panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); for(int i = 0; i < game.length; i++){ panel.add(game[i].create()); } f.setContentPane(panel); f.pack(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setVisible(true); boolean end = false; boolean word = false; String tekst; while( !end ){ while( !word ){ tekst = JOptionPane.showInputDialog("Input word: "); for(int i = 0; i< game.length; i++){ if(game[i].equalLength(tekst)){ if(game[i].equalValue(tekst)){ word = true; for(int j = 0; j< game.length; j++){ game[i].repaint(); } } } } } word = false; for(int i = 0; i < game.length; i++){ if(game[i].solved()){ end = true; } else { end = false; } } } } } Grid.java import javax.swing.*; import java.awt.*; public class Grid extends JPanel{ private Element[]e; private Grid[]g; public Grid(){} public Grid( Element[]elements ){ e = new Element[elements.length]; for(int i=0; i< e.length; i++){ e[i] = elements[i]; } } public Grid(Grid[]grid){ g = new Grid[grid.length]; for(int i=0; i<g.length; i++){ g[i] = grid[i]; } Dimension d = new Dimension(600, 600); setMinimumSize(d); setPreferredSize(new Dimension(d)); setMaximumSize(d); } public JPanel create(){ JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS)); panel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); for(int j = 0; j < e.length; j++){ panel.add(e[j].paint()); } return panel; } @Override public void repaint(){ } public boolean equalLength(String s){ int len = s.length(); boolean equal = false; for(int j = 0; j < e.length; j++){ if(e.length == len){ equal = true; } } return equal; } public boolean equalValue(String s){ int len = s.length(); boolean equal = false; String[] temp = null; String[] temp2 = new String[len]; temp = s.split(""); for( int j = len; j>0; j--){ temp2[j-1] = temp[j]; } for(int j = 0; j < e.length; j++){ if( e[j].letter().equals(temp2[j]) ){ equal = true; } else { equal = false; } } if(equal){ for(int i = 0; i < e.length; i++){ e[i].changeState(3); } } return equal; } public boolean solved(){ boolean solved = false; for(int j = 0; j < e.length; j++){ if(e[j].getState() == 3){ solved = true; } else { solved = false; } } return solved; } @Override public String toString(){ return ""; } } Element.java import javax.swing.*; import java.awt.*; public class Element { final int INVISIBLE = 0; final int EMPTY = 1; final int FIRST_LETTER = 2; final int OTHER_LETTER = 3; private int state; private String letter; public Element(){ } //empty block public Element(int state){ this("", 0); } //filled block public Element(String s, int state){ this.state = state; this.letter = s; } public JButton paint(){ JButton button = null; if( state == EMPTY ){ button = new JButton(""); button.setBackground(Color.WHITE); } else if ( state == FIRST_LETTER ){ button = new JButton(letter); button.setBackground(Color.red); } else { button = new JButton(letter); button.setBackground(Color.yellow); } button.setSize(20,20); return button; } public void changeState(int s){ state = s; } public String letter(){ return letter; } public int getState(){ return state; } @Override public String toString(){ return "["+letter+"]"; } }

    Read the article

  • Xlib.h and Xutil.h not found in Eclipse, how can I fix this?

    - by eclipseNoob
    Hi, I'm a newbie to Eclipse IDE for C/C++ development. I just installed MingW and set it up as my system's environment variable. I am trying to make an application that uses the X library but eclipse cant seem to find it. Eclipse works with any other simple standard library functions but it cant find the X library. Please Help! Here's a sample code snippet that's failing: #include <stdio.h> #include <X11/Xlib.h> // Can't find this #include <X11/Xutil.h> // Or this... int main() { printf("Hello"); return 0; } Do I have to download the X library from somewhere? If so then from where and where do I paste it to? Please tell me what to do in order for me to start coding using the Xlib in Eclipse. If you find any useful links, please dont hesitate to post. Thanks.

    Read the article

  • "Undefined symbols" linker error with simple template class

    - by intregus
    Been away from C++ for a few years and am getting a linker error from the following code: Gene.h #ifndef GENE_H_INCLUDED #define GENE_H_INCLUDED template <typename T> class Gene { public: T getValue(); void setValue(T value); void setRange(T min, T max); private: T value; T minValue; T maxValue; }; #endif // GENE_H_INCLUDED Gene.cpp #include "Gene.h" template <typename T> T Gene<T>::getValue() { return this->value; } template <typename T> void Gene<T>::setValue(T value) { if(value >= this->minValue && value <= this->minValue) { this->value = value; } } template <typename T> void Gene<T>::setRange(T min, T max) { this->minValue = min; this->maxValue = max; } Using Code::Blocks and GCC if it matters to anyone. Also, clearly porting some GA stuff to C++ for fun and practice.

    Read the article

  • Crystal report loop

    - by CrystalLearn
    Hi All Master, I have a running total and would like to stop it when condition is match. Eg :- I have STOCK qty 100pcs ; qty are accumulate from Purchase Order Receiving transactions as below : No. Qty Accumulate 1. 20 20 2. 30 50 3. 10 60 4. 40 100 5. 20 120 The running total should stop at no.4, because it have reach the STOCK qty 100. Thanks in advance.

    Read the article

  • How to get JDK 1.5 on Mac OSX

    - by Eric
    I've got to write some code for a legacy application that is still running JDK 1.5. Unfortunately, it looks like OSX doesn't actually have a 1.5 JDK installed, it just links to 1.6: /System/Library/Frameworks/JavaVM.framework/Versions $ ls -l lrwxr-xr-x 1 root wheel 5 Apr 26 11:53 1.3 -> 1.3.1 drwxr-xr-x 3 root wheel 102 Feb 11 15:33 1.3.1 lrwxr-xr-x 1 root wheel 10 Apr 26 11:53 1.4 -> CurrentJDK lrwxr-xr-x 1 root wheel 10 Apr 26 11:53 1.4.2 -> CurrentJDK lrwxr-xr-x 1 root wheel 10 Apr 26 11:53 1.5 -> CurrentJDK lrwxr-xr-x 1 root wheel 10 Apr 26 11:53 1.5.0 -> CurrentJDK lrwxr-xr-x 1 root wheel 5 Apr 26 11:53 1.6 -> 1.6.0 drwxr-xr-x 7 root wheel 238 Apr 26 11:53 1.6.0 drwxr-xr-x 8 root wheel 272 Apr 26 11:53 A lrwxr-xr-x 1 root wheel 1 Apr 26 11:53 Current -> A lrwxr-xr-x 1 root wheel 3 Apr 26 11:53 CurrentJDK -> 1.6 It sounds like from http://developer.apple.com/java/faq/ that Java is part of the OS update...I'm on OSX-10.6.3. Anybody know of a way to get an actual 1.5 JDK installed on this OS version? Or do I need to try and find an old version of OSX before I can do this work?

    Read the article

  • Using Traveling Salesman Solver to Decide Hamiltonian Path

    - by Firas Assaad
    This is for a project where I'm asked to implement a heuristic for the traveling salesman optimization problem and also the Hamiltonian path or cycle decision problem. I don't need help with the implementation itself, but have a question on the direction I'm going in. I already have a TSP heuristic based on a genetic algorithm: it assumes a complete graph, starts with a set of random solutions as a population, and works to improve the population for a number of generations. Can I also use it to solve the Hamiltonian path or cycle problems? Instead of optimizing to get the shortest path, I just want to check if there is a path. Now any complete graph will have a Hamiltonian path in it, so the TSP heuristic would have to be extended to any graph. This could be done by setting the edges to some infinity value if there is no path between two cities, and returning the first path that is a valid Hamiltonian path. Is that the right way to approach it? Or should I use a different heuristic for Hamiltonian path? My main concern is whether it's a viable approach since I can be somewhat sure that TSP optimization works (because you start with solutions and improve them) but not if a Hamiltonian path decider would find any path in a fixed number of generations. I assume the best approach would be to test it myself, but I'm constrained by time and thought I'd ask before going down this route... (I could find a different heuristic for Hamiltonian path instead)

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >