Search Results

Search found 5784 results on 232 pages for 'points'.

Page 140/232 | < Previous Page | 136 137 138 139 140 141 142 143 144 145 146 147  | Next Page >

  • try-catch in JavaScript : how to get stack trace or line number of the original error

    - by Greg Bala
    When using TRY-CATCH in JavaScript, how to get the line number of the line that caused the error? On many browsers, the below code will work great and I will get the stack trace that points to the actual line that throw the exception. However, some browsers do not have "e.stack". Iphone's safari is one example. Is there someway to get the line number that will work for all browsers? try { // lots of code here var i = v.WillGenerateError; // how to get this line number in catch?? // lots of code here } catch (e) { alert (e.stack) // this will not work on iPhone, for example } Many thanks!

    Read the article

  • Create Outlines around line.

    - by Eric Muller
    Hi SO community! I am drawing graphs into a WinForms Picturebox. Now I am searching for a possibility to 'duplicate' a line (an array of points), so that the two resulting lines are positioned a fixed distance away from the original one. Like in this picture, I have the red line and want to get the black ones: I thought about just moving the line a few pixels up/right/up-right, but that leads to strange overlapping lines. Is there any other approach that does what I want? Any ideas would be greatly appreciated. Thanks!

    Read the article

  • Creating a fixed background for a website

    - by ShiVik
    Hello all I am trying to implement a fixed background for a website like one over here. Searching around for it told me that I can use background: fixed or background-attachment properties for this. My problem is the image which will be used as background. I am thinking about following issues: What should be image size? how will it repeat when browser window size is very large? for big 27" monitors out there? Can somebody guide me on these points? Regards Vikram

    Read the article

  • navigation framework in silverlight 3 skipping constructor when usercontrol is of a derived type

    - by tarren
    Hi: I am using the NavigationFramework in Silverlight 3, and am running into issues where the constructor of the UserControl in the xaml I am loading is not being called, and I believe this is because the UserControl in the xaml I am calling is actually derived from another user control. I have stepped through the debugger with specific break points and the constructor is being ignored completey. I have MyWindowBlue which is of type uctrlBaseMyWindow. The constructor for uctrlBaseMyWindow is being called when the xaml is 'navigated to' but the constructor for MyWindowBlue is being ignored. This is not the case if I add the user control via markup directly. Anyone else have this issue? The code I am using to navigate to the MyWindowBlue is this.MyContentFrame.Navigate(new Uri("/Controls/uctrlMyWindowBlue.xaml", UriKind.Relative)); Has anyone run into this or could offer any help? Thanks

    Read the article

  • Style of if: to nest or not to nest

    - by Marco
    A colleague of mine and me had a discussion about the following best-practice issue. Most functions/methods start with some parameter checking. I advocate the following style, which avoids nesting. if (parameter one is ugly) return ERROR; if (parameter two is nonsense || it is raining) return ERROR; // do the useful stuff return result; He, who comes from a more functional/logic programming background, prefers the following, because it reduces the number of exit points from the function. if (parameter one is ok) { if (parameter two is ok && the sun is shining) { // do the useful stuff return result } } return ERROR; Which one would you prefer and why?

    Read the article

  • Writing a custom iterator -- what to do if you're at the end of the array?

    - by Goose Bumper
    I'm writing a custom iterator for a Matrix class, and I want to implement the increment method, which gets called when the iterator is incremented: void MatrixIterator::increment() { // go to the next element } Suppose the iterator has been incremented too many times and now points to past the end of the matrix (i.e. past the one-past-the-end point). What is the best practice for this situation? Should I catch this with an assert, or should I just say it's the user's responsibility to keep track of where the iterator is pointing and it's none of my business?

    Read the article

  • How can I explain to a programmer that CSS positioning has many benefits over table based layouts?

    - by Pat
    I have a friend who wishes to work as a freelance web developer, but insists that tables are the way forwards for layouts. Several points he maintains in favour of tables: 1 This is what was taught at the beginning of 10 years of programming & computer science degrees. 2 Large companies use tables to achieve 'technical' things. 3 It saves time I have coded him some examples of CSS exactly matching table based layouts, and provided many links to articles explaining SEO and accessibility benefits. From the perspective of a client, I have been explaining to him that I wouldn't hire someone using outdated methods as their main strategy for layout. As he is my friend and I wish him every success, I believe it is important for him to gain the best start when pitching for work. The question again: How can I explain to a programmer that CSS positioning has many benefits over table based layouts?

    Read the article

  • Correct way to write /* and */

    - by billpg
    Hi everyone. I'd like to know, please, the correct way to write the symbols that the C family of languages use to begin and end comments. Before you all respond "a slash followed by an asterisk", I mean what's the correct way to write them on paper. (IE, How many points should the asterisk have? What angle should the slash be? etc) Everything I need so I can sit down and draw correct comment start and end symbols. Please note, I'm looking for the correct standard way. If there is no industry standard, please respond with "there is no standard" and I will accept that answer.

    Read the article

  • Creating 'select' listboxes using FormHelper in CakePHP

    - by joec
    I have two models Category and Point. The associations are defined as: Category hasMany Point Point belongsTo Category I would like, when adding Points to my database, to be able to select the category it belongs to from a <select> box, along with the rest of the form data. Where would i need to set the category list and how could i do it? And how would i produce the select box? I assume it could be done with $form->input('categorieslist',array('type'=>'select')); //categorieslist needs //setting somewhere. But i am fairly new to Cake and not done much with associations before. Thanks.

    Read the article

  • C++ Memory Allocation & Linked List Implementation

    - by pws5068
    I'm writing software to simulate the "first-fit" memory allocation schema. Basically, I allocate a large X megabyte chunk of memory and subdivide it into blocks when chunks are requested according to the schema. I'm using a linked list called "node" as a header for each block of memory (so that we can find the next block without tediously looping through every address value. head_ptr = (char*) malloc(total_size + sizeof(node)); if(head_ptr == NULL) return -1; // Malloc Error .. :-( node* head_node = new node; // Build block header head_node->next = NULL; head_node->previous = NULL; // Header points to next block (which doesn't exist yet) memset(head_ptr,head_node, sizeof(node)); ` But this last line returns: error: invalid conversion from 'node*' to 'int' I understand why this is invalid.. but how can I place my node into the pointer location of my newly allocated memory?

    Read the article

  • Storing search result for paging and sorting

    - by Mattias
    I've been implementing MS Search Server 2010 and so far its really good. Im doing the search queries via their web service, but due to the inconsistent results, im thinking about caching the result instead. The site is a small intranet (500 employees), so it shouldnt be any problems, but im curious what approach you would take if it was a bigger site. I've googled abit, but havent really come over anything specific. So, a few questions: What other approaches are there? And why are they better? How much does it cost to store a dataview of 400-500 rows? What sizes are feasible? Other points you should take into consideration. Any input is welcome :)

    Read the article

  • Trigger local program execution from browser

    - by DroidIn.net
    First and foremost: I know it's not right or even good thing to do but my current customer will not cave in. So here's what he is asking for (this is for in-house-behind-a-firewall-etc project). In the web report I need to supply a link which points to the executable script that lives on the universally mapped location (network file server). When user clicks on it it is expected to run on the local client starting local executable which should be pre-installed on the client's box. It should be agnostic to OS (Windows or Linux) and the browser used. Customer doesn't mind to click on angry pop-up alerts but he wants to do it once per client browser (or at minimum - session). QUESTION: Will trusted Java applet be able to do it? Or is the any other (better, simpler) ways of achieving the same? ActiveX control is out of question

    Read the article

  • A simple algorithm for polygon intersection

    - by Elazar Leibovich
    I'm looking for a very simple algorithm for computing the polygon intersection/clipping. That is, given polygons P, Q, I wish to find polygon T which is contained in P and in Q, and I wish T to be maximal among all possible polygons. I don't mind the run time (I have a few very small polygons), I can also afford getting an approximation of the polygons' intersection (that is, a polygon with less points, but which is still contained in the polygons' intersection). But it is really important for me that the algorithm will be simple (cheaper testing) and preferably short (less code). edit: please note, I wish to obtain a polygon which represent the intersection. I don't need only a boolean answer to the question of whether the two polygons intersect.

    Read the article

  • simple EJB jar deployed in jboss with its own log4j configuration

    - by user309281
    Hi All I have a simple EJB jar with a stateless session bean, deployed in JBOSS AS 4.2.2, unde r/server/default/deploy. The bean is registered under JNDI tree as viewed from jboss jmx console and I am able to access it through a remote java client outside JBOSS. Inside EJB jar, I have added some logging to be written to a separate log file, using apache log4j jar and log4j.xml. But I am not able to view any of the logs. Also I do not wish to use jboss-log4j.xml, since there will be many other EJBs to be deployed and wish to have separate log4j for each EJB application. Here is my one of the EJB-jar contents: EJB_DS.jar: log4j.xml classes apache log4j jar is added to /server/default/lib path. Kindly highlight if i have missed any points for enabling log4j configuration With Regards, Krishna

    Read the article

  • What are the main differences between: Seaside vs Aida vs Iliad

    - by elviejo
    What are the differences between the three Smalltalk web application frameworks? Some starting points: What is the sweet spot for each framework? in Which case would you use one or the other? What are their weaknesses? Which one has the cleanest URLs? How do they handle Ajax? Do they have some preference in their use of persistence? I'm just trying to decide which framework is appropriate for each kind of application.

    Read the article

  • Extracting a Rails application into a plugin or engine

    - by Globalkeith
    I have a Rails 2.3 application which I would like to extract into a plugin, or engine. The application has user authentication, and basic cms capabilities supported by ancestry plugin. I want to extract the logic for the application into a plugin/engine so that I can use this code for future projects, with a different "skin" or "theme" if required. I'm not entirely sure I actually understand the difference between plugin and engine concepts, so that would be a good first point. What is the best approach, are there any good starting points, links, explanations, examples that I should follow. Also, with the release of R3 to consider, is there anything that I should be aware of for that, with regards to plugins etc. I am going to start off by watching Ryan's http://railscasts.com/episodes/149-rails-engines but obviously thats over a year old now, so one of the challenges I'm faced with is finding the most up to date and relevant information on this subject. All tips and help gratefully received.

    Read the article

  • How do I map a texture onto a Octahedron?

    - by Justin808
    I'm about to go mad. I cant for the life of me figure out texture coords. I have a Octahedron defined by the 8 triangles below. I want to map a texture of the earth on it. See the texture here: http://img37.imageshack.us/f/earthmap1k.jpg/ I would like the north pole at the top point and the south pole at the oposite point with the equator wrapped around the center points. Can someone show me the UVs for each point to map the texture please? 0, 0, 1 1, -1, 0 1, 1, 0 -1, 1, 0 0, 0, 1 1, 1, 0 0, 0, 1 -1, 1, 0 -1, -1, 0 1, -1, 0 0, 0, 1 -1, -1, 0 1, -1, 0 0, 0, -1 1, 1, 0 0, 0, -1 -1, 1, 0 1, 1, 0 0, 0, -1 -1, -1, 0 -1, 1, 0 0, 0, -1 1, -1, 0 -1, -1, 0

    Read the article

  • Can I make valgrind ignore glibc libraries?

    - by Jack
    Is it possible to tell valgrind to ignore some set of libraries? Specifically glibc libraries.. Actual Problem: I have some code that runs fine in normal execution. No leaks etc. When I try to run it through valgrind, I get core dumps and program restarts/stops. Core usually points to glibc functions (usually fseek, mutex etc). I understand that there might be some issue with incompatible glibc / valgrind version. I tried various valgrind releases and glibc versions but no luck. Any suggestions?

    Read the article

  • using .htaccess to redirect from friendly url to actual file

    - by Kohalza
    I have the following RewriteRule in my .htaccess to redirect from a friendly url to my main application file: RewriteRule ^\/(.*).html$ home/www/page.php?p=$1 [L] This should send any url that points to a html page to page.php with the url as a parameter that will be parsed by the app. This works for urls that look like http://www.example.com/hello.html The problem is that I get a 404 error when the url contains a directory path, for example: http://www.example.com/category/hello.html The error reads: "File does not exist: /home/www/category" Seems it is first looking for the 'category' path instead of processing the .htaccess Any ideas how to solve this?

    Read the article

  • Core Data - Relationship to dissimilar entities

    - by carotene
    Suppose I have the following data model: Entity Person Attribute name String Attribute personType String Attribute dailyRecords Entity CarpenterDailyRecord Attribute numberOfNailsHammered Int Attribute picNameOfFinishedCabinet String Entity WindowWasherDailyRecord Attribute nameOfBuildingWashed String Attribute numberOfWindowsWashed Int I would like to establish a to-many relationship between the Person.dailyRecords and 1 of the daily record entities (which changes depending on the person type). Of course, i could create a CarpenterPerson and WindowWasher entity which each points to it's unique daily record structure, but i have to group people together in my app somehow. so if i do a Group Entity: Entity Group Attribute people array i'm still stuck. how do i point to multiple & different Person entities? There must be an obvious answer, it's just i'm so new to all of this. thanks!

    Read the article

  • What choices to make for an application backend

    - by Saif Bechan
    I am creating an web application and I at the point that i am starting to make backend choices. Now there are a lot of ways to go with this, so I am looking for some good points and back practices. Some of the question i have involve: Should i make a seperate table in the db for admin users Should i extend make some classes to load the admin data and the normal data, or make seperate classes for the admin section Where can i get some information on making different types of users Just some best practices for a backend My application is written in PHP with an MySQL database.

    Read the article

  • Restricting Directory access from web application context

    - by Yogi
    i have a web application which stores users file in directory which is under webroot directory.. Suppose web application is under 'fileupload' and all files are getting stored in 'xyz' folder under 'fileupload' so now if user points to url say like www.xyzpqr.com/fileupload/xyz/abc.doc, he gets that file. How do i restirct this from happening.. i have thought of putting xyz folder in WeB-inf folder but as my application is very big i have to made changes at too many places.. so is there any way so that without moving the folder to web-inf (restricted folders) i can achieve wat i want..

    Read the article

  • How do you create a formula that has diminishing returns?

    - by egervari
    I guess this is a math question and not a programming question, but what is a good way to create a formula that has diminishing returns? Here are some example points on how I want the curve to look like. f(1) = 1 f(1.5)= .98 f(2) = .95 f(2.5) = .9 f(3) = .8 f(4) = .7 f(5) = .6 f(10) = .5 f(20) = .25 Notice that as the input gets higher, the percentage decreases rapidly. Is there any way to model a function that has a very smooth and accurate curve that says this? Another way to say it is by using a real example. You know in Diablo II they have Magic Find? There are diminishing returns for magic find. If you get 100%, the real magic find is still 100%. But the more get, your actual magic find goes down. So much that say if you had 1200, your real magic find is probably 450%. So they have a function like: actualMagicFind(magicFind) = // some way to reduced magic find

    Read the article

  • What is the Simplest Possible Payment Gateway to Implement? (using Django)

    - by b14ck
    I'm developing a web application that will require users to either make one time deposits of money into their account, or allow users to sign up for recurring billing each month for a certain amount of money. I've been looking at various payment gateways, but most (if not all) of them seem complex and difficult to get working. I also see no real active Django projects which offer simple views for making payments. Ideally, I'd like to use something like Amazon FPS, so that I can see online transaction logs, refund money, etc., but I'm open to other things. I just want the EASIEST possible payment gateway to integrate with my site. I'm not looking for anything fancy, whatever does the job, and requires < 10 hours to get working from start to finish would be perfect. I'll give answer points to whoever can point out a good one. Thanks!

    Read the article

  • Consing lists with user-defined type in Haskell

    - by user1319603
    I have this type I defined myself: data Item = Book String String String Int -- Title, Author, Year, Qty | Movie String String String Int -- Title, Director, Year, Qty | CD String String String Int deriving Show -- Title, Artist, Year, Qty I've created an empty list all_Items = [] With the following function I am trying to insert a new book of type Item (Book) into the all_Items addBook all_Items = do putStrLn "Enter the title of the book" tit <- getLine putStrLn "Enter the author of the book" aut <- getLine putStrLn "Enter the year this book was published" yr <- getLine putStrLn "Enter quantity of copies for this item in the inventory" qty <- getLine Book tit aut yr (read qty::Int):all_Items return(all_Items) I however am receiving this error: Couldn't match expected type `IO a0' with actual type `[a1]' The error points to the line where I am using the consing operator to add the new book to the list. I can gather that it is a type error but I can't figure out what it is that I am doing wrong and how to fix it. Thanks in Advance!

    Read the article

< Previous Page | 136 137 138 139 140 141 142 143 144 145 146 147  | Next Page >