Search Results

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

Page 90/232 | < Previous Page | 86 87 88 89 90 91 92 93 94 95 96 97  | Next Page >

  • Drawing single pixel in Quartz

    - by wwrob
    I have an array of CGPoints, and I'd like to fill the whole screen with colours, the colour of each pixel depending on the total distance to each of the points in the array. The natural way to do this is to, for each pixel, compute the total distance, and turn that into a colour. Questions follow: 1) How can I colour a single pixel in Quartz? I've been thinking of making 1 by 1 rectangles. 2) Are there better, more efficient ways to achieve this effect?

    Read the article

  • Sparse linear program solver

    - by Jacob
    This great SO answer points to a good sparse solver, but I've got constraints on x (for Ax = b) such that each element in x is >=0 an <=N. The first thing which comes to mind is an LP solver for large sparse matrices. Any ideas/recommendations?

    Read the article

  • Reverse engineering a bezier curve

    - by Martin
    Given a few sample points on a bézier curve, is it possible to work out the set of possible parameters of the curve? In my specific application there is a limited set of endpoints the curve may have, so I want to generate the set of possible curves, enumerate all of them and pick out all the ones which may end on a valid end point.

    Read the article

  • How to handle different screen resolution /screen size when developing a site ?

    - by Misha Moroshko
    I would like to develop a site using jQuery that will work with all major browsers. I thought to start with a basic layout (a header, a couple of tabs with content, and footer). I wonder how should I create this layout to support different screen resolution, screen size, or window size. Should I work in pixels / points / percents when defining width and height of the components ? Are there any jQuery plugins that can help me with this task ? Thanks !

    Read the article

  • Using google maps API, how can we set the current location as the default set location using map.set

    - by vs1984
    I am writing Javascript code using Google maps API. map = new google.maps.Map2(document.getElementById("map_canvas")); map.setCenter(new google.maps.LatLng(37.4419, -122.1419), 13); The above code sets the default location of the map canvas to Palo Alto. How can we write the script in such a way that the setCenter function automatically points to the current location of the client?

    Read the article

  • How to calculate a measure of a total error in this clustering

    - by Vafello
    I have the following points and clustering of data S1. Can anyone tell me how to calculate the total error associated with this clustering? I know it's not a strictly programming question, but I need it for my algorithm. I think the answer should be 4/3 but I have no idea how to calculate this. Can anyone help me? x1= (2.0,1.0) x2= (2.0,2.0) x3= (1.0,2.0) S1={ x1, x2, x3 }

    Read the article

  • Looking for interesting formula

    - by Thinker
    I'm creating a game where players can make an alloy. To make it less predictable and more interesting, I thought that the durability and hardness of an alloy should not be calculated by a simple formula, because it will be extremely easy to find extrema, where alloy have best statistics. So the questions is, is there any formula for a function where extrema can be found only by investigating all points? Input values will be in percents: 0.0%-100.0%. I think it should look like this: half sound wave

    Read the article

  • dynamically decorating objects in c#

    - by Oren Mazor
    is it possible to easily and dynamically decorate an object? for example, lets say I have a List<PointF>. this list is actually a plot of the sine function. I'd like to go through these points and add a flag to each PointF of whether it's a peak or not. but I don't want to create a new extended SpecialPointF or whatever, that has a boolean property. judge me all you want for being lazy, but laziness is how awesome ideas are born (also bad ideas)

    Read the article

  • C++ memcpy problem :(

    - by Simon
    Hey all :) I have a problem my src pointer of memcpy is pointing wrong. unsigned char* lpBuffer is a buffer that contains my bytes, i checked with olly. The code: IMAGE_DOS_HEADER iDOSh; memcpy(&iDOSh,lpBuffer,sizeof(iDOSh)); The problem is that lpBuffer points wrong, output from debugger is dest = 002859E8 RIGHT src = 000001D8 FALSE src is pointing invalid :( i have no idea why Thanks for reading

    Read the article

  • What is the component a popup menu click originated from

    - by Ralph Rickenbach
    Having a popup menu attached to several components on a form (buttons, but also things like TCharts), I would like to know which component was right clicked to start the popup menu in the first place. The Sender parameter of the click method just points to the TMenuItem, its parent to the popup menu (or the parenting menu item). How do I get the originating component?

    Read the article

  • Restarting an activity in a single tab in a TabActivity?

    - by user291701
    Hi, I have a TabActivity. Each tab points to a sub activity. Works great. Is there any clever way to refresh one of the activity tabs? I just want to 'restart' the activity in tab #3 for example. Not sure of a good way to do this other than building in refresh support to the activity itself, or clearing ALL the tabs and recreating all of them. Thanks

    Read the article

  • PHP Parse Error unexpected '{'

    - by Laxmidi
    Hi, I'm getting a "Parse error: syntax error, unexpected '{' in line 2". And I don't see the problem. <?php class pointLocation {     var $pointOnVertex = true; // Check if the point sits exactly on one of the vertices     function pointLocation() {     }                   function pointInPolygon($point, $polygon, $pointOnVertex = true) {         $this->pointOnVertex = $pointOnVertex;                  // Transform string coordinates into arrays with x and y values         $point = $this->pointStringToCoordinates($point);         $vertices = array();          foreach ($polygon as $vertex) {             $vertices[] = $this->pointStringToCoordinates($vertex);          }                  // Check if the point sits exactly on a vertex         if ($this->pointOnVertex == true and $this->pointOnVertex($point, $vertices) == true) {             return "vertex";         }                  // Check if the point is inside the polygon or on the boundary         $intersections = 0;          $vertices_count = count($vertices);              for ($i=1; $i < $vertices_count; $i++) {             $vertex1 = $vertices[$i-1];              $vertex2 = $vertices[$i];             if ($vertex1['y'] == $vertex2['y'] and $vertex1['y'] == $point['y'] and $point['x'] > min($vertex1['x'], $vertex2['x']) and $point['x'] < max($vertex1['x'], $vertex2['x'])) { // Check if point is on an horizontal polygon boundary                 return "boundary";             }             if ($point['y'] > min($vertex1['y'], $vertex2['y']) and $point['y'] <= max($vertex1['y'], $vertex2['y']) and $point['x'] <= max($vertex1['x'], $vertex2['x']) and $vertex1['y'] != $vertex2['y']) {                  $xinters = ($point['y'] - $vertex1['y']) * ($vertex2['x'] - $vertex1['x']) / ($vertex2['y'] - $vertex1['y']) + $vertex1['x'];                  if ($xinters == $point['x']) { // Check if point is on the polygon boundary (other than horizontal)                     return "boundary";                 }                 if ($vertex1['x'] == $vertex2['x'] || $point['x'] <= $xinters) {                     $intersections++;                  }             }          }          // If the number of edges we passed through is even, then it's in the polygon.          if ($intersections % 2 != 0) {             return "inside";         } else {             return "outside";         }     }               function pointOnVertex($point, $vertices) {         foreach($vertices as $vertex) {             if ($point == $vertex) {                 return true;             }         }          }                   function pointStringToCoordinates($pointString) {         $coordinates = explode(" ", $pointString);         return array("x" => $coordinates[0], "y" => $coordinates[1]);     }           } $pointLocation = new pointLocation(); $points = array("30 19", "0 0", "10 0", "30 20", "11 0", "0 11", "0 10", "30 22", "20 20"); $polygon = array("10 0", "20 0", "30 10", "30 20", "20 30", "10 30", "0 20", "0 10", "10 0"); foreach($points as $key => $point) { echo "$key ($point) is " . $pointLocation->pointInPolygon($point, $polygon) . "<br>"; } ?> Does anyone see the problem? Thanks, -Laxmidi

    Read the article

  • Finding all areas that intersect with a point and vice-versa - PostGIS

    - by ForeignerBR
    I'm developing a project using PostGIS to hold spatial data where I have records that hold geometry point data and records that hold geometry area data. To solve my problem I'm looking for two queries that can take geographic shapes rather than geometric shapes as parameters. For query A I need it to return all points that intersect with a given area. For query B I need it to return all areas that intersect with a given point.

    Read the article

  • Visual Studio: Debuggin non localhost domain, locally

    - by Skawful
    I have an entry in my hosts file that points somesite.com to 127.0.0.1 (localhost) so that I can test certain aspects of my web app (i goto http://somesite.com in a browser to test). Can someone suggest a way to debug a setup like this (in visual studio) that does not include using http://localhost? I understand that this can most likely be done using remote debugger, if that is the best way can someone explain how thats setup (or a link to a good article).

    Read the article

  • wpf Image resources and visual studio 2010 resource editor

    - by Berryl
    Hello My motivation for this question is really just to specify an image to be used in a user control via a dependency property for ImageSource. I'm hitting some pain points involving the management, access, and unit testing for this. Is the resource editor a good tool to use to maintain images for the application? What is the best way to translate the Bitmap from the editor to an ImageSource? How can I grab the resource Filename from the editor? Cheers, Berryl

    Read the article

  • How to diff just the source files?

    - by Kimvais
    I have two almost similar source code trees, but do not have access to the source code repository so I am stuck with release packages that contain also test reports, documentation, binaries etc. the diff command only support --exclude, but I would like to do something like diff -wbur --include='*.c,*.h' tree1 tree2 I know that this question is somewhat related, but does not really address my issue. Bonus points for ignoring change blocks that are completely in C comments :)

    Read the article

< Previous Page | 86 87 88 89 90 91 92 93 94 95 96 97  | Next Page >