Search Results

Search found 11 results on 1 pages for 'kingnestor'.

Page 1/1 | 1 

  • Does anyone know of a library in Java that can parse ESRI Shapefiles?

    - by KingNestor
    I'm interested in writing a visualization program for the road data in the 2009 Tiger/Line Shapefiles. I'd like to draw the line data to display all the roads for my county. The ESRI Shapefile or simply a shapefile is a popular geospatial vector data format for geographic information systems software. It is developed and regulated by ESRI as a (mostly) open specification for data interoperability among ESRI and other software products.1 A "shapefile" commonly refers to a collection of files with ".shp", ".shx", ".dbf", and other extensions on a common prefix name (e.g., "lakes.*"). The actual shapefile relates specifically to files with the ".shp" extension, however this file alone is incomplete for distribution, as the other supporting files are required. Does anyone know of existing libraries for parsing and reading in the line data for Shapefiles?

    Read the article

  • How does Dijkstra's Algorithm and A-Star compare?

    - by KingNestor
    I was looking at what the guys in the Mario AI Competition have been doing and some of them have built some pretty neat Mario bots utilizing the A* (A-Star) Pathing Algorithm. (Video of Mario A* Bot In Action) My question is, how does A-Star compare with Dijkstra? Looking over them, they seem similar. Why would someone use one over the other? Especially in the context of pathing in games?

    Read the article

  • Best branching strategy when doing continuous integration?

    - by KingNestor
    What is the best branching strategy to use when you want to do continuous integration? Release Branching - Unstable Trunk: or Feature Branching - Stable Trunk: Does it make sense to use both of these strategies together? As in, you branch for each release but you also branch for large features? Does one of these strategies mesh better with continuous integration? Would using continuous integration even make sense when using an unstable trunk?

    Read the article

  • How can I build a Truth Table Generator?

    - by KingNestor
    I'm looking to write a Truth Table Generator as a personal project. There are several web-based online ones here and here. (Example screenshot of an existing Truth Table Generator) I have the following questions: How should I go about parsing expressions like: ((P = Q) & (Q = R)) = (P = R) Should I use a parser generator like ANTLr or YACC, or use straight regular expressions? Once I have the expression parsed, how should I go about generating the truth table? Each section of the expression needs to be divided up into its smallest components and re-built from the left side of the table to the right. How would I evaluate something like that? Can anyone provide me with tips concerning the parsing of these arbitrary expressions and eventually evaluating the parsed expression?

    Read the article

  • How do I get jQuery's Uploadify plugin to work with ASP.NET MVC?

    - by KingNestor
    I'm in the process of trying to get the jQuery plugin, Uploadify, to work with ASP.NET MVC. I've got the plugin showing up fine: With the following javascript snippet: <script type="text/javascript"> $(document).ready(function() { $('#fileUpload').fileUpload({ 'uploader': '/Content/Flash/uploader.swf', 'script': '/Placement/Upload', 'folder': '/uploads', 'multi': 'true', 'buttonText': 'Browse', 'displayData': 'speed', 'simUploadLimit': 2, 'cancelImg': '/Content/Images/cancel.png' }); }); </script> Which seems like all is well in good. If you notice, the "script" attribute is set to my /Placement/Upload, which is my Placement Controller and my Upload Action. The main problem is, I'm having difficulty getting this action to fire to receive the file. I've set a breakpoint on that action and when I select a file to upload, it isn't getting executed. I've tried changing the method signature based off this article: public string Upload(HttpPostedFileBase FileData) { /* * * Do something with the FileData * */ return "Upload OK!"; } But this still doesn't fire. Can anyone help me write and get the Upload controller action's signature correctly so it will actually fire? I can then handle dealing with the file data myself. I just need some help getting the method action to fire.

    Read the article

  • What is the equivalent to Master Views from ASP.NET in PHP?

    - by KingNestor
    I'm used to working in ASP.NET / ASP.NET MVC and now for class I have to make a PHP website. What is the equivalent to Master Views from ASP.NET in the PHP world? Ideally I would like to be able to define a page layout with something like: Master.php <html> <head> <title>My WebSite</title> <?php headcontent?> </head> <body> <?php bodycontent?> </body> </html> and then have my other PHP pages inherit from Master, so I can insert into those predefined places. Is this possible in PHP? Right now I have the top half of my page defined as "Header.html" and the bottom half is "footer.html" and I include_once both of them on each page I create. However, this isn't ideal for when I want to be able to insert into multiple places on my master page such as being able to insert content into the head. Can someone skilled in PHP point me in the right direction?

    Read the article

  • Trouble with pointers and references in C++

    - by KingNestor
    I have a PolygonList and a Polygon type, which are std::lists of Points or lists of lists of points. class Point { public: int x, y; Point(int x1, int y1) { x = x1; y = y1; } }; typedef std::list<Point> Polygon; typedef std::list<Polygon> PolygonList; // List of all our polygons PolygonList polygonList; However, I'm confused on reference variables and pointers. For example, I would like to be able to reference the first Polygon in my polygonList, and push a new Point to it. So I attempted to set the front of the polygonList to a Polygon called currentPolygon like so: Polygon currentPolygon = polygonList.front(); currentPolygon.push_front(somePoint); and now, I can add points to currentPolygon, but these changes end up not being reflected in that same polygon in the polygonList. Is currentPolygon simply a copy of the Polygon in the front of polygonList? When I later iterate over polygonList all the points I've added to currentPolygon aren't shown. It works if I do this: polygonList.front().push_front(somePoint); Why aren't these the same and how can I create a reference to the physical front polygon rather than a copy of it?

    Read the article

  • How can I modify my Shunting-Yard Algorithm so it accepts unary operators?

    - by KingNestor
    I've been working on implementing the Shunting-Yard Algorithm in JavaScript for class. Here is my work so far: var userInput = prompt("Enter in a mathematical expression:"); var postFix = InfixToPostfix(userInput); var result = EvaluateExpression(postFix); document.write("Infix: " + userInput + "<br/>"); document.write("Postfix (RPN): " + postFix + "<br/>"); document.write("Result: " + result + "<br/>"); function EvaluateExpression(expression) { var tokens = expression.split(/([0-9]+|[*+-\/()])/); var evalStack = []; while (tokens.length != 0) { var currentToken = tokens.shift(); if (isNumber(currentToken)) { evalStack.push(currentToken); } else if (isOperator(currentToken)) { var operand1 = evalStack.pop(); var operand2 = evalStack.pop(); var result = PerformOperation(parseInt(operand1), parseInt(operand2), currentToken); evalStack.push(result); } } return evalStack.pop(); } function PerformOperation(operand1, operand2, operator) { switch(operator) { case '+': return operand1 + operand2; case '-': return operand1 - operand2; case '*': return operand1 * operand2; case '/': return operand1 / operand2; default: return; } } function InfixToPostfix(expression) { var tokens = expression.split(/([0-9]+|[*+-\/()])/); var outputQueue = []; var operatorStack = []; while (tokens.length != 0) { var currentToken = tokens.shift(); if (isNumber(currentToken)) { outputQueue.push(currentToken); } else if (isOperator(currentToken)) { while ((getAssociativity(currentToken) == 'left' && getPrecedence(currentToken) <= getPrecedence(operatorStack[operatorStack.length-1])) || (getAssociativity(currentToken) == 'right' && getPrecedence(currentToken) < getPrecedence(operatorStack[operatorStack.length-1]))) { outputQueue.push(operatorStack.pop()) } operatorStack.push(currentToken); } else if (currentToken == '(') { operatorStack.push(currentToken); } else if (currentToken == ')') { while (operatorStack[operatorStack.length-1] != '(') { if (operatorStack.length == 0) throw("Parenthesis balancing error! Shame on you!"); outputQueue.push(operatorStack.pop()); } operatorStack.pop(); } } while (operatorStack.length != 0) { if (!operatorStack[operatorStack.length-1].match(/([()])/)) outputQueue.push(operatorStack.pop()); else throw("Parenthesis balancing error! Shame on you!"); } return outputQueue.join(" "); } function isOperator(token) { if (!token.match(/([*+-\/])/)) return false; else return true; } function isNumber(token) { if (!token.match(/([0-9]+)/)) return false; else return true; } function getPrecedence(token) { switch (token) { case '^': return 9; case '*': case '/': case '%': return 8; case '+': case '-': return 6; default: return -1; } } function getAssociativity(token) { switch(token) { case '+': case '-': case '*': case '/': return 'left'; case '^': return 'right'; } } It works fine so far. If I give it: ((5+3) * 8) It will output: Infix: ((5+3) * 8) Postfix (RPN): 5 3 + 8 * Result: 64 However, I'm struggling with implementing the unary operators so I could do something like: ((-5+3) * 8) What would be the best way to implement unary operators (negation, etc)? Also, does anyone have any suggestions for handling floating point numbers as well? One last thing, if anyone sees me doing anything weird in JavaScript let me know. This is my first JavaScript program and I'm not used to it yet.

    Read the article

1