Search Results

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

Page 46/232 | < Previous Page | 42 43 44 45 46 47 48 49 50 51 52 53  | Next Page >

  • How can a Delphi TPersistent object calculate its own deserialization time?

    - by mjustin
    For performance tests I need a way to measure the time needed for a form to load its definition from the DFM. All existing forms inherit a custom form class. To capture the current time, this base class needs overriden methods as "extension points": start of the deserialization process after the deserialization (can be implemented by overriding the Loaded procedure) the moment just before the execution of the OnFormCreate event So the log for TMyForm.Create(nil) could look like: - 00.000 instance created - 00.010 before deserialization - 01.823 after deserialization - 02.340 before OnFormCreate Which TObject (or TComponent) methods are best suited? Maybe there are other extension points in the form creation process, please feel free to make suggestions.

    Read the article

  • AspectJ join point with simple types

    - by Jon
    Hi! Are there defined join points in arithmetics that I can catch? Something like: int a = 4; int b = 2; int c = a + b; Can I make a pointcut that catches any one of those lines? And what context will I be able to get? I would like to add a before() to all int/float/double manipulation done in a particular method on a class, is that possible. I see in the AspectJ docs that there are defined join points for object initialization and method calls. Is declaring an int an object initialization and does the + operator count as a method call? Thanks!

    Read the article

  • iOS: How to access the `UIKeyboard`?

    - by MattDiPasquale
    I want to get a pointer reference to UIKeyboard *keyboard to the keyboard on screen so that I can add a transparent subview to it, covering it completely, to achieve the effect of disabling the UIKeyboard without hiding it. In doing this, can I assume that there's only one UIKeyboard on the screen at a time? I.e., is it a singleton? Where's the method [UIKeyboard sharedInstance]. Brownie points if you implement that method via a category. Or, even more brownie points if you convince me why it's a bad idea to assume only one keyboard and give me a better solution.

    Read the article

  • Shortest distance between two line segments

    - by Frank
    I need a function to find the shortest distance between two line segments. A line segment is defined by two endpoints. So for example one of my line segments (AB) would be defined by the two points A (x1,y1) and B (x2,y2) and the other (CD) would be defined by the two points C (x1,y1) and D (x2,y2). Feel free to write the solution in any language you want and I can translate it into javascript. Please keep in mind my geometry skills are pretty rusty. I have already seen http://stochastix.wordpress.com/2008/12/28/distance-between-two-lines/ and I am not sure how to translate this into a function. Thank you so much for help.

    Read the article

  • 3D line plane intersection, with simple plane

    - by clamp
    hello, i have two points in 3D space which have X-coordinates with different signum. so one of them lies definitely on one side of the X-plane and one on the other. now i want to find the intersection of this plane and the line made up by the two points in the most simple and optimized way. i know how to do general line plane intersection, but since in this case the plane is just the x-plane, i think there should be some shortcuts i can take. thanks!

    Read the article

  • Table alias -- Unkown column in field list

    - by Jason
    Hi all, I have a sql query which is executing a LEFT JOIN on 2 tables in which some of the columns are ambiguous. I can prefix the joined tables but when I try to prefix one of the columns from the table in the FROM clause, it tells me Unknown column. I even tried giving that table an alias like so ...From points AS p and using "p" to prefix the tables but that didn't work either. Can someone tell me what I'm doing wrong. Here is my query: SELECT point_title, point_url, address, city, state, zip_code, phone, `points`.`lat`, `points`.`longi`, featured, kmlno, image_url, category.title, category_id, point_id, lat, longi, reviews.star_points, reviews.review_id, count(reviews.point_id) as totals FROM (SELECT *, ( 3959 * acos( cos( radians('37.7717185') ) * cos( radians( lat ) ) * cos( radians( longi ) - radians('-122.4438929') ) + sin( radians('37.7717185') ) * sin( radians( lat ) ) ) ) AS distance FROM points HAVING distance < '25') as distResults LEFT JOIN category USING ( category_id ) LEFT JOIN reviews USING ( point_id ) WHERE (point_title LIKE '%Playgrounds%' OR category.title LIKE '%Playgrounds%') GROUP BY point_id ORDER BY totals DESC, distance LIMIT 0 , 10

    Read the article

  • Pre-packaged Rails applications

    - by Craig
    Seems like most Rails applications have similar 'base' functionality. As such, it seems that there would be value in having pre-build Rails applications at various functionality points such as: basic User model with authentication using Authlogic #1 + openid integration #2 + authorization using declarative_authorization #3 + Administration module #4 + a Profile model Themes (useful stylesheets and such) Friendship model Geocoding ... In addition to the basic MVC stuff, these applications would include: testing harnesses seed data git support One could choose start from any of these functionality points. Other than the sample application that are available with the various gems/plugins, are there projects such as these? If not, I would certainly be willing to contribute what I have.

    Read the article

  • How to install the program depending on libstdc++ library

    - by Alex Farber
    My program is written in C++, using GCC on Ubuntu 9.10 64 bit. If depends on /usr/lib64/libstdc++.so.6 which actually points to /usr/lib64/libstdc++.so.6.0.13. Now I copy this program to virgin Ubuntu 7.04 system and try to run it. It doesn't run, as expected. Then I add to the program directory the following files: libstdc++.so.6.0.13 libstdc++.so.6 (links to libstdc++.so.6.0.13) and execute command: LD_LIBRARY_PATH=. ./myprogram Now everything is OK. The question: how can I write installation script for such program? myprogram file itself should be placed to /usr/local/bin. What can I do with dependencies? For example, on destination computer, /usr/lib64/libstdc++.so.6 link points to /usr/lib64/libstdc++.so.6.0.8. What can I do with this? Note: the program is closed-source, I cannot provide source code and makefile.

    Read the article

  • How to calculate a point with an given center, angle and radius?

    - by mystify
    In this SO question, someone asked for calculating an angle from three points. I need to do the opposite thing. I want to draw a clock, and I have tiny tick images. An art dude made 60 of them, each with an individual and accurate shadow. So there are 60 distinct images at 10x10 points in size, already correctly rotated in the center of that square. So every 6 degrees one tick image has to be placed. I would just need to calculate the x/y coordinate based on a center point, an radius and an angle. So I have: an center point an radius an angle Is there an easy way to calculate the x/y coordinate with this? Maybe cocoa-touch already has a useful function or method for this?

    Read the article

  • circles and triangles problem

    - by Faken
    Hello everyone, I have an interesting problem here I've been trying to solve for the last little while: I have 3 circles on a 2D xy plane, each with the same known radius. I know the coordinates of each of the three centers (they are arbitrary and can be anywhere). What is the largest triangle that can be drawn such that each vertice of the triangle sits on a separate circle, what are the coordinates of those verticies? I've been looking at this problem for hours and asked a bunch of people but so far only one person has been able to suggest a plausible solution (though i have no way of proving it). The solution that we have come up with involves first creating a triangle about the three circle centers. Next we look at each circle individually and calculate the equation of a line that passes through the circle's center and is perpendicular to the opposite edge. We then calculate two intersection points of the circle. This is then done for the next two circles with a result of 6 points. We iterate over the 8 possible 3 point triangles that these 6 points create (the restriction is that each point of the big triangle must be on a separate circle) and find the maximum size. The results look reasonable (at least when drawn out on paper) and it passes the special case of when the centers of the circles all fall on a straight line (gives a known largest triangle). Unfortunate i have no way of proving this is correct or not. I'm wondering if anyone has encountered a problem similar to this and if so, how did you solve it? Note: I understand that this is mostly a math question and not programming, however it is going to be implemented in code and it must be optimized to run very fast and efficient. In fact, I already have the above solution in code and tested to be working, if you would like to take a look, please let me know, i chose not to post it because its all in vector form and pretty much impossible to figure out exactly what is going on (because it's been condensed to be more efficient). Lastly, yes this is for school work, though it is NOT a homework question/assignment/project. It's part of my graduate thesis (abet a very very small part, but still technically is part of it). Thanks for your help.

    Read the article

  • Boost::asio bug in MSVC10 - Failing BOOST_WORKAROUND in ~buffer_debug_check() in buffer.hpp

    - by shaz
    A straight compilation of example http://www.boost.org/doc/libs/1_43_0/doc/html/boost_asio/tutorial/tutdaytime3/src.html results in a runtime null pointer exception. Stack trace points to the buffer_debug_check destructor which contains this comment: // MSVC's string iterator checking may crash in a std::string::iterator // object's destructor when the iterator points to an already-destroyed // std::string object, unless the iterator is cleared first. The test #if BOOST_WORKAROUND(BOOST_MSVC, = 1400) succeeds in MSVC10 and (but) results in a null pointer exception in c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xutility line 123 _Iterator_base12& operator=(const _Iterator_base12& _Right) { // assign an iterator if (_Myproxy != _Right._Myproxy) _Adopt(_Right._Myproxy->_Mycont); return (*this); } _Right._Myproxy is NULL

    Read the article

  • Google Maps : How to open an InfoWindow by hovering a link?

    - by JB
    Hi there, i have a very simple question about Google Maps API. In this case, i have on my page a map on the left, with about 40 points, and the list of these 40 points on the right. So you know, when you click on a point of the map, the "info window" is displayed so you can see some informations about it. I can't find how can i do to simply open the "info window" on the map, by making a "hover" on the corresponding link. (and by the way, close all the others info windows) Did someone have an idea about this? Thanks a lot, have a nice day! :)

    Read the article

  • string s; &s+1; Legal? UB?

    - by John Dibling
    Consider the following code: #include <cstdlib> #include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; int main() { string myAry[] = { "Mary", "had", "a", "Little", "Lamb" }; const size_t numStrs = sizeof(myStr)/sizeof(myAry[0]); vector<string> myVec(&myAry[0], &myAry[numStrs]); copy( myVec.begin(), myVec.end(), ostream_iterator<string>(cout, " ")); return 0; } Of interest here is &myAry[numStrs]: numStrs is equal to 5, so &myAry[numStrs] points to something that doesn't exist; the sixth element in the array. There is another example of this in the above code: myVec.end(), which points to one-past-the-end of the vector myVec. It's perfecly legal to take the address of this element that doesn't exist. We know the size of string, so we know where the address of the 6th element of a C-style array of strings must point to. So long as we only evaluate this pointer and never dereference it, we're fine. We can even compare it to other pointers for equality. The STL does this all the time in algorithms that act on a range of iterators. The end() iterator points past the end, and the loops keep looping while a counter != end(). So now consider this: #include <cstdlib> #include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; int main() { string myStr = "Mary"; string* myPtr = &myStr; vector<string> myVec2(myPtr, &myPtr[1]); copy( myVec2.begin(), myVec2.end(), ostream_iterator<string>(cout, " ")); return 0; } Is this code legal and well-defined? It is legal and well-defined to take the address of an array element past the end, as in &myAry[numStrs], so should it be legal and well-defined to pretend that myPtr is also an array?

    Read the article

  • Matlab - Propagate unit vectors on to the edge of shape boundaries

    - by Graham
    Hi I have a set of unit vectors which I want to propagate on to the edge of shape boundary defined by a binary image. The shape boundary is defined by a 1px wide white edge. I also have the coordinates of these points stored in a 2 row by n column matrix. The shape forms a concave boundary with no holes within itself made of around 2500 points. What would be the best method to do this? Are there some sort of ray tracing algorithms that could be used? Or would it be a case of taking the unit vector and multiplying it by a scalar and testing after multiplication if the end point of the vector is outside the shape boundary. When the end point of the unit vector is outside the shape, just find the point of intersection? Thank you very much in advance for any help!

    Read the article

  • Effective way of String splitting

    - by openidsujoy
    I have a completed string like this N:Pay in Cash++RGI:40++R:200++T:Purchase++IP:N++IS:N++PD:PC++UCP:598.80++UPP:0.00++TCP:598.80++TPP:0.00++QE:1++QS:1++CPC:USD++PPC:Points++D:Y++E:Y++IFE:Y++AD:Y++IR:++MV:++CP:~ ~N:ERedemption++RGI:42++R:200++T:Purchase++IP:N++IS:N++PD:PC++UCP:598.80++UPP:0.00++TCP:598.80++TPP:0.00++QE:1++QS:1++CPC:USD++PPC:Points++D:Y++E:Y++IFE:Y++AD:Y++IR:++MV:++CP: this string is like this It's list of PO's(Payment Options) which are separated by ~~ this list may contains one or more PO contains only Key-Value Pairs which separated by : spaces are denoted by ++ I need to extract the values for Key "RGI" and "N". I can do it via for loop , I want a efficient way to do this. any help on this.

    Read the article

  • GNUPlot: plot different ranges with different styles

    - by Mr. Shickadance
    Hello all, I know this should be pretty simple, but I haven't been able to find a similar example. I need to plot different ranges of a datafile differently, but on the same graph. For instance, say my datafile represents a function with x and y values. I want to plot the first N values using a style like lines, and then the next M values using a different style, like points. I was thinking I would need a plot command similar to this: plot [1:5] "my.data" using 1:2 with lines, [6:12] using 1:2 with points, [13:19] using 1:2 with lines Essentially I want to distinguish different areas of the functions. Any ideas? I am sorry if it sounds like I'm rambling but I am quite stumped. Thanks in advance!

    Read the article

  • Excel + Web Data

    - by user348152
    I've spent hours scouring the net for anything to do with VBA calling data from the web in excel and nothing provides a tutorial on how to do so, only complicated examples un-related to what I want to do. I want to pull data from either a .html or .xml site, doesn't matter, via Excel and find specific points in that data. I can find specific points but don't know how to get the data or scroll through multiple lines. I've done this exact sort of thing in mIRC (sort of C code). http://eve-central.com/home/quicklook.html?typeid=438 http://api.eve-central.com/api/quicklook?typeid=438 Those are two examples, using roughly the same data I'd like to retrieve. It'd be FAR more specific with at most 100 or so different values. I'd like to be TAUGHT how to do it, not given the code to do it, or if you must explain each part with comments in-depth please. Thanks Nick

    Read the article

  • DirectX text at (x,y,z)

    - by bobobobo
    In OpenGL, you can actually draw text with an XYZ position, and it will appear at that location, but in a fixed size. If anyone's played MechWarrior 2, they used it there for nav points. The text had a 3d position, but it always appeared a fixed size. The nav point was actually a bit of text at that exact point in space. Other than that the ability to place 3d text was pretty much useless.. you'd always want text to be 2d, righT? I'm finally in a position where I want this feature. I have these points in space that I need to assign text information to, i.e. I need to draw text at a fixed size but with a 3d position. Can this be done from DirectX?

    Read the article

  • Differentiate A Section/Portion of 3D object From Other Parts

    - by Ramshad
    I am trying to write a WPF windows application that dynamically creates a 3 D object for an existing 3D Image. The senerio is as follows. Mark the points randomly on the existing 3D Image. Create a 3D object based on the points already marked. Check the below Sample Screenshots. Screenshot 1 and Screenshot 2 I am successfully able to load the 3D file to the WPF form. And was able to perform the rotation using TrackballDecorator 3D Tools library. I have just read this related post. however i didn't get it exactly :) So,can you suggest some efficient methods to achieve it.

    Read the article

  • how to go the middle of the singularly linked list in one iteration?

    - by u3050
    Recently I have been asked one question that in a singularly linked list how do we go to the middle of the list in one iteration. A --> B --> C --> D (even nodes) for this it should return address which points to B A --> B --> C (odd nodes) for this also it should return address which points to B There is one solution of taking two pointers one moves one time and other moves two times but it does not seem working here LinkedList p1,p2; while(p2.next != null) { p1 = p1.next; p2 = p2.next.next; } System.out.print("middle of the node" + p1.data); //This does not give accurate result in odd and even Please help if anyone has did this before.

    Read the article

  • Effective way of String spliting C#

    - by openidsujoy
    I have a completed string like this N:Pay in Cash++RGI:40++R:200++T:Purchase++IP:N++IS:N++PD:PC++UCP:598.80++UPP:0.00++TCP:598.80++TPP:0.00++QE:1++QS:1++CPC:USD++PPC:Points++D:Y++E:Y++IFE:Y++AD:Y++IR:++MV:++CP:~ ~N:ERedemption++RGI:42++R:200++T:Purchase++IP:N++IS:N++PD:PC++UCP:598.80++UPP:0.00++TCP:598.80++TPP:0.00++QE:1++QS:1++CPC:USD++PPC:Points++D:Y++E:Y++IFE:Y++AD:Y++IR:++MV:++CP: this string is like this It's list of PO's(Payment Options) which are separated by ~~ this list may contains one or more PO contains only Key-Value Pairs which separated by : spaces are denoted by ++ I need to extract the values for Key "RGI" and "N". I can do it via for loop , I want a efficient way to do this. any help on this.

    Read the article

  • How to check if a pointer is null in C++ Visual 2010

    - by mariomario
    I am having problems here if I want to check if eerste points to nothing i get Blockquote Unhandled exception at 0x003921c6 in Bank.exe: 0xC0000005: Access violation reading location 0xccccccd0. and i am kinda wondering why he justs skips the if statement or doens't stop when the object eerste points to nothing Bank::Bank() { LijstElement *eerste = NULL; LijstElement *laatste = NULL; } Rekening * Bank::getRekening(int rekNr) { if(NULL != eerste) { LijstElement *nummer = eerste; while(nummer->volgende!= NULL) { Rekening *een = nummer->getRekening(); if(een->getRekNr()==rekNr) { return een; } else { nummer = nummer->volgende; } } } return NULL; }

    Read the article

  • [MATH]Project an axis to a plane

    - by Robert
    how do i project the X axis to a plane if the plane is defined by three points? see pic here: http://129.25.16.135:2080/v6.5/books/usb/graphics/iconventions-local-surfaces.png The default local 1-direction is the projection of the global x-axis onto the surface. If the global x-axis is within 0.1° of being normal to the surface, the local 1-direction is the projection of the global z-axis onto the surface. let's suppose that these points are: t1 = [-0.362879991531372, 0.357021987438202, -0.373737007379532] t2 = [-0.383525013923645, 0.371621012687683, -0.383549988269806] t3 = [-0.383534014225006, 0.34629300236702, -0.38544899225235] is the vector [0.78280971952246, -0.0307519963686645, 0.411184845614438] correct answer in this case? i've calculated the angle between the surf and x (1,0,0) is ~28°. and can you give the entire procedure for the calculation, because i'm just puzzled.

    Read the article

< Previous Page | 42 43 44 45 46 47 48 49 50 51 52 53  | Next Page >