Search Results

Search found 968 results on 39 pages for 'closest'.

Page 3/39 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How to redirect visitors to the server that is closest to them and where to place the servers?

    - by user2971623
    I am focusing on providing fast page refreshes for my visitors and I wonder where is the smartest spot to place my servers on? I understand that the best would be to place a server in every country or even city, but that is of course not doable with my economy. I am thinking of maybe setting up three servers, one in the middle of USA (Kansas?), one in Italy and one in Sweden. What do you think about that? I don't care about Africa since they haven't even got computers so I won't get traffic from there anyway. China, North Korea etc are probably just visiting chinese websites, they barely know english anway... The next problem is how do I redirect a visitor from Finland to the Swedish server? I don't want the visitor from Finland to be using the USA server or vice versa.

    Read the article

  • Blade Enclosure, Multiple Blade Servers, Whats the closest approximation to a DMZ?

    - by codeulike
    I appreciate that to get a proper DMZ, one should have a physical separation between the DMZ servers and the LAN servers, with a firewall server in between. But, in a network consisting of a single Blade Enclosure containing two or more Blade servers, whats the closest approximation to a DMZ that could be designed? More details: Virtual servers, mostly Windows, running in a VMWare environment on the Blade servers, and physical firewall box between the Blade enclosure and the internet.

    Read the article

  • How do I find the Next Closest Date to today from a list of dates in a Plist on iOS?

    - by user1173823
    Situation: In short, I have a football schedule. I would like to use a custom cell which provides more info for only the next game date in the schedule. Issue: How do I find only the next closest game in the schedule (for iOS)? I've watched the WWDC 2013 video for "Solutions to Common Date and Time Issues" however this primarily applies to the Mac. I've searched numerous posts here and some are close but not what I need to find ONLY the next date from my list of dates in the schedule. From other posts I see where I can compare two specific dates, but this is not what I want to do. I want to find the next closest date that is equal to or after today from a list of dates. This is where I am now. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { //Populate the table from the plist NSDictionary *season = _schedContentArray[indexPath.section]; NSArray *schedule = season[@"Schedule"]; NSDictionary *game = schedule[indexPath.row]; //find the closest game date after today's date ?? NSString *gameDateStr = game[@"GameDate"]; NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; dateFormatter.calendar=calendar; [dateFormatter setDateFormat:@"MM/dd/yy"]; NSDate *today = [NSDate date]; NSDate *gameDate = [dateFormatter dateFromString:gameDateStr]; //NSString *nextGame = NSLog(@"game date is %@",gameDate); The NSLog returns the game dates (except for the open date): 2013-11-11 16:10:05.979 Clemson Football[24060:70b] game date is 2013-08-31 04:00:00 +0000 2013-11-11 16:10:05.982 Clemson Football[24060:70b] game date is 2013-09-07 04:00:00 +0000 2013-11-11 16:10:05.985 Clemson Football[24060:70b] game date is (null) 2013-11-11 16:10:05.987 Clemson Football[24060:70b] game date is 2013-09-19 04:00:00 +0000 2013-11-11 16:10:05.988 Clemson Football[24060:70b] game date is 2013-09-28 04:00:00 +0000 2013-11-11 16:10:05.990 Clemson Football[24060:70b] game date is 2013-10-05 04:00:00 +0000 2013-11-11 16:10:05.992 Clemson Football[24060:70b] game date is 2013-10-12 04:00:00 +0000 2013-11-11 16:10:05.993 Clemson Football[24060:70b] game date is 2013-10-19 04:00:00 +0000 2013-11-11 16:10:05.995 Clemson Football[24060:70b] game date is 2013-10-26 04:00:00 +0000 2013-11-11 16:10:05.996 Clemson Football[24060:70b] game date is 2013-11-02 04:00:00 +0000 2013-11-11 16:10:05.998 Clemson Football[24060:70b] game date is 2013-11-09 05:00:00 +0000 2013-11-11 16:10:06.000 Clemson Football[24060:70b] game date is 2013-11-14 05:00:00 +0000 2013-11-11 16:10:06.001 Clemson Football[24060:70b] game date is 2013-11-23 05:00:00 +0000 2013-11-11 16:10:06.003 Clemson Football[24060:70b] game date is 2013-11-30 05:00:00 +0000 2013-11-11 16:10:06.005 Clemson Football[24060:70b] game date is 2013-12-07 05:00:00 +0000 Thanks in advance for any assistance you can provide. This seems like it should be simple but has been fairly frustrating. Let me know if you need additional info.

    Read the article

  • How can I define an irregular area of the screen and find the closest point to the mouse in that area?

    - by JonathonG
    I'm looking for a method to define an area of the screen that the mouse cannot leave. I have been directed by rob mayoff, the answerer of this question, that I can use a Quartz Event Tap to detect mouse events. This puts me part of the way to the solution to THIS question. I need to define an irregular area of the screen, not just a rectangle, that the mouse cannot leave. I have been researching this and the only idea I can come up with is using a bitmap to define the irregular area, as it will be very oddly shaped. However, I am open to solutions other than using a bitmap. Since this must be done on a Mac, I've determined that I will have to use objective C / Cocoa . I need to know how to define the area and, equally importantly, how to find the closest point in the area to the mouse (so that I can move the mouse to it if the mouse tries to move outside of the area). This is similar to what the restricted area will look like: [edit:] Okay, I've come up with part of the answer to this. If I can do a basic (light-weight) point collision detection on the image mask, I can use a simple algorithm to detect the closest point to the mouse on the black area of the image. I could do this by calculating distance between a pre-defined point (P) inside the black area of the image and the target mouse position (T), taking the midpoint (M), then checking if the midpoint is inside or outside of the shape (black or white, respectively). If M is inside the shape, then move the P to M, otherwise move T to the M, continuously recalculate this until the distance between T and P is 1 pixel or less, then move the mouse to the final calculated position. All of that being said, I still need some way to test the position of the mouse against that same position on the bitmap (assume the bitmap is the same resolution as the monitor), and check if that point is black or white. All of this needs to be done in the background, without this application actually having focus, or the bitmap being visible... is this possible?

    Read the article

  • Turning Floats into Their Closest (UTF-8 Character) Fraction.

    - by Mark Tomlin
    I want to take any real number, and return the closest number, with the closest fraction as available in the UTF-8 character set, appropriate. 0/4 = 0.00 = # < .125 1/4 = 0.25 = ¼ # > .125 & < .375 2/4 = 0.50 = ½ # > .375 & < .625 3/4 = 0.75 = ¾ # > .625 & < .875 4/4 = 1.00 = # > .875 I made this function to do that task: function displayFraction($realNumber) { if (!is_float($realNumber)) { return $realNumber; } list($number, $decimal) = explode('.', $realNumber); $decimal = '.' . $decimal; switch($decimal) { case $decimal < 0.125: return $number; case $decimal > 0.125 && $decimal < 0.375: return $number . '¼'; # 188 ¼ &#188; case $decimal > 0.375 && $decimal < 0.625: return $number . '½'; # 189 ½ &#189; case $decimal > 0.625 && $decimal < 0.875: return $number . '¾'; # 190 ¾ &#190; case $decimal < 0.875: return ++$number; } } What are the better / diffrent way to do this? echo displayFraction(3.1) . PHP_EOL; # Outputs: 3 echo displayFraction(3.141593) . PHP_EOL; # Outputs: 3¼ echo displayFraction(3.267432) . PHP_EOL; # Outputs: 3¼ echo displayFraction(3.38) . PHP_EOL; # Outputs: 3½ Expand my mind!

    Read the article

  • Given two lines on a plane, how to find integer points closest to their interseciton?

    - by Lukasz Lew
    I can't solve it: You are given 8 integers: A, B, C representing a line on a plane with equation A*x + B*y = C a, b, c representing another line x, y representing a point on a plane The two lines are not parallel therefore divide plane into 4 pieces. Point (x, y) lies inside of one these pieces. Problem: Write a fast algorithm that will find a point with integer coordinates in the same piece as (x,y) that is closest to the cross point of the two given lines. Note: This is not a homework, this is old Euler-type task that I have absolutely no idea how to approach.

    Read the article

  • How can I highlight the line of text that is closest to the mouse?

    - by Aaron Digulla
    I have a long text and I'd like to offer the user a reading help: The current line should be highlighted. To make it easier, I'll just use the Y coordinate of the mouse (this way, the mouse pointer isn't going to get in the way). I have a big DIV with the id content which fills the whole width and a small DIV with the class content for the text (see here for an example). I'm using jQuery 1.4. How can I highlight the line of text that is closest to the current mouse position?

    Read the article

  • Given two lines on a plane, how to find integer points closest to their intersection?

    - by Lukasz Lew
    I can't solve it: You are given 8 integers: A, B, C representing a line on a plane with equation A*x + B*y = C a, b, c representing another line x, y representing a point on a plane The two lines are not parallel therefore divide plane into 4 pieces. Point (x, y) lies inside of one these pieces. Problem: Write a fast algorithm that will find a point with integer coordinates in the same piece as (x,y) that is closest to the cross point of the two given lines. Note: This is not a homework, this is old Euler-type task that I have absolutely no idea how to approach. Update: You can assume that the 8 numbers on input are 32-bit signed integers. But you cannot assume that the solution will be 32 bit.

    Read the article

  • In Python, how do I search a flat file for the closest match to a particular numeric value?

    - by kaushik
    have file data of format 3.343445 1 3.54564 1 4.345535 1 2.453454 1 and so on upto 1000 lines and i have number given such as a=2.44443 for the given file i need to find the row number of the numbers in file which is most close to the given number "a" how can i do this i am presently doing by loading whole file into list and comparing each element and finding the closest one any other better faster method? my code:i need to ru this for different file each time around 20000 times so want a fast method p=os.path.join("c:/begpython/wavnk/",str(str(str(save_a[1]).replace('phone','text'))+'.pm')) x=open(p , 'r') for i in range(6): x.readline() j=0 o=[] for line in x: oj=str(str(line).rstrip('\n')).split(' ') o=o+[oj] j=j+1 temp=long(1232332) end_time=save_a[4] for i in range((j-1)): diff=float(o[i][0])-float(end_time) if diff<0: diff=diff*(-1) if temp>diff: temp=diff pm_row=i

    Read the article

  • 2D Game: Fast(est) way to find x closest entities for another entity - huge amount of entities, high

    - by Pygmy
    I'm working on a 2D game that has a huge amount of dynamic entities. For fun's sake, let's call them soldiers, and let's say there are 50000 of them (which I just randomly thought up, it might be much more or much less :)). All these soldiers are moving every frame according to rules - think boids / flocking / steering behaviour. For each soldier, to update it's movement I need the X soldiers that are closest to the one I'm processing. What would be the best spatial hierarchy to store them to facilitate calculations like this without too much overhead ? (All entities are updated/moved every frame, so it has to handle dynamic entities very well)

    Read the article

  • What's the closest equivalent of Little Snitch (Mac program) on Windows?

    - by Charles Scowcroft
    I'm using Windows 7 and would like to have a feature like Little Snitch on the Mac that alerts you whenever a program on your computer makes an outgoing connection. Description of Little Snitch from its website: Little Snitch informs you whenever a program attempts to establish an outgoing Internet connection. You can then choose to allow or deny this connection, or define a rule how to handle similar, future connection attempts. This reliably prevents private data from being sent out without your knowledge. Little Snitch runs inconspicuously in the background and it can also detect network related activity of viruses, trojans and other malware. Little Snitch provides flexible configuration options, allowing you to grant specific permissions to your trusted applications or to prevent others from establishing particular Internet connections at all. So you will only be warned in those cases that really need your attention. Is there a program like Little Snitch for Windows?

    Read the article

  • What filesystem comes closest to matching NTFS for support of ACLs, and highly-granular permissioning?

    - by warren
    It seems that most other filesystems handle the basic *nix permissions (ugo±rwx), with maybe an addition here or there. Or can be "made" to handle ACLs through the use of other tools on top of the system. On the wikipedia pages about filesystems (http://en.wikipedia.org/wiki/List%5Fof%5Ffile%5Fsystems & http://en.wikipedia.org/wiki/Comparison%5Fof%5Ffile%5Fsystems), it appears that while some do support extended meta-data, none support natively the level of permissioning that NTFS does. Am I wrong in this understanding?

    Read the article

  • How to get a number closest to the average in c++?

    - by Alex Zielinski
    What I'm trying to achieve is to take the average of the numbers stored in the array and find the number which is closest to it. My code compiles, but has an error just after starting. I think it's something to do with the memory handling (I don't feel confident with pointers, etc. yet) Could some nice guy take a look at my code and tell me what's wrong with it? (don't be hard on me, I'm a beginner) #include <iostream> #include <cmath> using namespace std; double* aver(double* arr, size_t size, double& average); int main() { double arr[] = {1,2,3,4,5,7}; size_t size = sizeof(arr)/sizeof(arr[0]); double average = 0; double* p = aver(arr,size,average); cout << *p << " " << average << endl; } double* aver(double* arr, size_t size, double& average){ int i,j,sum; double* m = 0; int tmp[7]; for(i=0;i<size;i++) sum += arr[i]; average = sum/size; for(j=0;j<size;j++){ tmp[j] = arr[j] - average; if(abs(tmp[j])>*m) *m = tmp[j]; } return m; }

    Read the article

  • How to find the closest descendants (hat matches a selector) with jQuery?

    - by powerboy
    We can use closest(selector) to find the first ancestor element that matches the selector. It travels up the DOM tree until it finds a match for the selector. But what if I want to travels down the DOM tree until it finds a match for the selector? Is there any jQuery function for doing this? Give an example. For the DOM tree below, <div id="main"> <div> <ul><!-- I want to match this ul --> <li> <ul><!-- but not this ul --> </ul> </li> </ul> <ul><!-- and match this ul --> </ul> </div> </div> how to do something like $('#main').closestDescendants('ul')?

    Read the article

  • How to find the closest descendants (that matches a selector) with jQuery?

    - by powerboy
    We can use closest(selector) to find the first ancestor element that matches the selector. It travels up the DOM tree until it finds a match for the selector. But what if I want to travels down the DOM tree until it finds a match for the selector? Is there any jQuery function for doing this? Or do I need to implement this using breadth-first search? Give an example. For the DOM tree below, <div id="main"> <div> <ul><!-- I want to match this ul --> <li> <ul><!-- but not this ul --> </ul> </li> </ul> <ul><!-- and match this ul --> </ul> </div> </div> how to do something like $('#main').closestDescendants('ul')?

    Read the article

  • Millions of 3D points: How to find the 10 of them closest to a given point?

    - by Kazoom
    A point in 3-d is defined by (x,y,z). Distance d between any two points (X,Y,Z) and (x,y,z) is d= Sqrt[(X-x)^2 + (Y-y)^2 + (Z-z)^2]. Now there are a million entries in a file, each entry is some point in space, in no specific order. Given any point (a,b,c) find the nearest 10 points to it. How would you store the million points and how would you retrieve those 10 points from that data structure.

    Read the article

  • How would i go about showing the closest paragraph element to a unique link with jQuery?

    - by Nike
    The title is a bit rusty, sorry about that. Now let me explain what i'm trying to do. I have a few listed items, like this: <li> <a id="toggle" class="0"><h4>ämne<small>2010-04-17 kl 12:54</small></h4></a> <p id="meddel" class="0">text</p> </li> <li class='odd'> <a id="toggle" class="1"><h4>test<small>2010-04-17 kl 15:01</small></h4></a> <p id="meddel" class="1">test meddelande :) [a]http://youtube.com[/a]</p> </li> The function i'm trying to achieve, is that when a user clicks a "toggle" link (the h4 text), i want the paragraph element below it to fade in. I thought of the idea of giving both the toggle link and the paragraph the same class, and then somehow make it get the paragraph with the same class as the toggle link clicked, and show it? But i'm not entirely sure how to do that either, and tbh, it doesn't sound like the greatest idea, but maybe that's the only way? I don't know... Is there some way to just simply get the nearest paragraph (below the link) with the id "meddel" and fade it in? That sounds a bit easier... I hope you can at least give me a few hints. Thanks in advance, -Nike

    Read the article

  • What is the closest thing MATLAB has to namespaces?

    - by rlbond
    We have a lot of MATLAB code in my lab. The problem is there's really no way to organize it. Since all the functions have to be in the same folder to be called (or you have to add a bunch of folders to MATLAB's path environment variable), it seems that we're doomed have loads of files in the same folder, all in the global namespace. Is there a better way to organize our files and functions? I really wish there were some sort of module system...

    Read the article

  • How to search for closest value in a lookup table?

    - by CSharperWithJava
    I have a simple one dimmensional array of integer values that represent a physical set of part values I have to work with. I then calculate and ideal value mathematically. How could I write an efficient search algorithm that will find the smallest abosulte difference from my ideal value in the array? The array is predetermined and constant, so it can be sorted however I need. Example Lookup array: 100, 152, 256, 282, 300 Searching for an ideal value of 125 would find 100 in the array, whereas 127 would find 152. The actual lookup array will be about 250 items long and never change.

    Read the article

  • For each element A[i] of array A, find the closest j such that A[j] > A[i]

    - by SamH
    Hi everyone. Given : An array A[1..n] of real numbers. Goal : An array D[1..n] such that D[i] = min{ distance(i,j) : A[j] > A[i] } or some default value (like 0) when there is no higher-valued element. I would really like to use Euclidean distance here. Example : A = [-1.35, 3.03, 0.73, -0.06, 0.71, -0.21, -0.12, 1.49, 1.41, 1.42] D = [1, 0, 1, 1, 2, 1, 1, 6, 1, 2] Is there any way to beat the obvious O(n^2) solution? The only progress I've made so far is that D[i] = 1 whenever A[i] is not a local maxima. I've been thinking a lot and have come up with NOTHING. I hope to eventually extend this to 2D (so A and D are matrices).

    Read the article

  • jQuery image gallery preview image popup

    - by JV10
    I've created an image gallery with the preview image popup on hover. http://jsfiddle.net/WSfka/ Hover over the thumbnail images and the larger image preview displays. I'm not happy with the way preview images can flash between moving around the thumbnail images. How can I simplify the script and improve the preview image popup? $(document).ready(function() { $('.imageGalleryAlbum li a img').mouseenter(function() { $(this).closest('li').find('.preview').delay(500).fadeIn(1); $(this).closest('li').siblings().find('.preview').fadeOut(1); return; }); $('.imageGalleryAlbum li .preview').hover(function() { $(this).closest('li').siblings().find('.preview').fadeOut(1); return; }); $('.imageGalleryAlbum li .preview').mouseleave(function() { $(this).closest('li').find('.preview').fadeOut(1); $(this).closest('li').siblings().find('.preview').fadeOut(1); return; }); $('.imageGalleryAlbum li .preview').click(function() { $(this).closest('li').find('.preview').fadeOut(1); $(this).closest('li').siblings().find('.preview').fadeOut(1); return; }); }); $(document).mouseup(function(e) { var container = $(".preview"); if (container.has(e.target).length === 0) { container.fadeOut(1); } });

    Read the article

  • Add a fadein fade out in jQuery, on multiple conditional statements

    - by Matthew Harwood
    Task: On click of li navigation filter show and hide content with a transitional fadein fade out. Problem I'm just guessing and checking on where to place this fadein//fadeout transition. Furthermore, I feel like my code is too inefficiency because I'm using 4 conditional statements. Would stack lead me in creating a solution to improve the overall logic of this script so I can just make a pretty transition :c? LIVE CODE jQuery Script $(document).ready(function () { //attach a single click listener on li elements $('li.navCenter').on('click', function () { // get the id of the clicked li var id = $(this).attr('id'); // match current id with string check then apply filter if (id == 'printInteract') { //reset all the boxes for muliple clicks $(".box").find('.video, .print, .web').closest('.box').show(); $(".box").find('.web, .video').closest('.box').hide(); $(".box").find('.print').show(); } if (id == 'webInteract') { $(".box").find('.video, .print, .web').closest('.box').show(); $(".box").find('.print, .video').closest('.box').hide(); $(".box").find('.web').show(); } if (id == 'videoInteract') { $(".box").find('.video, .print, .web').closest('.box').show(); $(".box").find('.print, .web').closest('.box').hide() $(".box").find('.video').show(); } if (id == 'allInteract') { $(".box").find('.video, .print, .web').closest('.box').show(); } }); HTML Selected <nav> <ul class="navSpaces"> <li id="allInteract" class="navCenter"> <a id="activeAll" class="navBg" href="#"><div class="relativeCenter"><img src="asset/img/logo30px.png" /><h3>all</h3></div></a> </li> <li id="printInteract" class="navCenter"> <a id="activePrint" class="navBg" href="#"><div class="relativeCenter"><img src="asset/img/print.gif" /><h3>print</h3></div></a> </li> <li id="videoInteract" class="navCenter"> <a id="activeVideo" class="navBg" href="#"><div class="relativeCenter"><img src="asset/img/video.gif" /><h3>video</h3></div></a> </li> <li id="webInteract" class="navCenter"> <a id="activeWeb" class="navBg" href="#"><div class="relativeCenter"><img src="asset/img/web.gif" /><h3>web</h3></div></a> </li> </ul> ps. Sorry for the newbie question

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >