Search Results

Search found 6674 results on 267 pages for 'pin numbers'.

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

  • Format numbers with css

    - by Luc M
    Is it possible to format numbers using css ? When I have 7000000.00, I would like it displayed as 7 000 000.00 I know I could write a backend (php, perl...) function or a javascript function that could return the formatted number but... The numbers that I want to format are into a cell. I would like to have something like <td class="myformat">7000000.00</td> or <td><span class="myformat">7000000.00<span></td>

    Read the article

  • Random number generation algorithm for human brains?

    - by Magnus Wolffelt
    Are you aware of, or have you devised, any practical, simple-to-learn "in-head" algorithms that let humans generate (somewhat "true") random numbers? By "in-head" I mean.. preferrably without any external tools or devices. Also, a high output (many random numbers per minute) is desirable. Asked this on SO but it didn't get much interest. Maybe this is better suited for programmers.. :) I'm genuinely curious about anything that people might have come up with on this problem.

    Read the article

  • Truly Random Numbers

    German researchers use a "flip-flop" to improve random number generator Random number generation - Algorithms - Pseudorandom Numbers - Math - Recreation

    Read the article

  • xor of sequence of numbers

    - by ArG0NaUt
    You are given with a sequence of natural numbers, you can add any natural number to any number in the sequence such that their xor becomes zero. Your goal is to minimize the sum of added numbers. e.g. Consider the following examples : sequence : 1, 3 answer : 2, adding 2 to 1 we get 3^3=0. sequence : 10, 4, 5, 1 answer: 6, adding 3 to 10 & 3 to 8 we get 13^4^8^1 = 0. sequence : 4, 4 answer : 0, since 4^4 = 0. I tried working on binary representations of sequence number but it got so complex. I want to know if there is any simple and efficient way to solve this problem.

    Read the article

  • Dividing numbers between rows in MySQL + PHP

    - by André Figueira
    Hi I am working on a kind of raffle system which divides 1 million random numbers into an x amount of tickets, e.g. 1 million random numbers to 10,000 tickets. Each ticket is a row in a database, we then have another table ticket numbers in which i need to give 100 numbers to each ticket they are related by the ticket id. So at the moment this is my code: //Amount of the 1 million tickets divided to the tickets $numbersPerTickets = $_POST['numbersPerTicket']; //The total cost of the property $propertyPrice = $_POST['propertyPrice']; //The total amount of tickets $totalTickets = NUMBER_CIELING / $numbersPerTickets; //The ticket price $ticketPrice = $propertyPrice / $totalTickets; //Generate array with random numbers up to 999,999 $randomTicketNumbers = createTicketNumbers(); //Creation loop counter $ticketCreationCount = 1; //Loop and create each ticket while($ticketCreationCount <= $totalTickets) { //Create a padded ticket number $ticketNumber = str_pad($ticketCreationCount, 6, 0, STR_PAD_LEFT); $query = ' INSERT INTO tickets( propertyID, ticketNumber, price ) VALUES( "'.$propertyID.'", "'.$ticketNumber.'", "'.$ticketPrice.'" ) '; $db->query($query); //Get the ID of the inserted ticket to use to insert the ticket numbers $ticketID = $db->insert_id; $loopBreak = $numbersPerTickets; $addedNumberCount = 1; foreach($randomTicketNumbers as $key => $value) { $query = ' INSERT INTO ticketNumbers( ticketID, number ) VALUES( "'.$ticketID.'", "'.$value.'" ) '; $db->query($query); unset($randomTicketNumbers[$key]); if($addedNumberCount == $loopBreak){ break; }else{ $addedNumberCount++; } } $ticketCreationCount++; } But this isn't working it adds the right amount of tickets, which in the case for testing is 10,000 but then adds far too many ticket numbers, it ends up exceeding the million numbers in the random tickets array, The random tickets array is just a simple 1 tier array with 1 million numbers sorted randomly.

    Read the article

  • How can I efficiently select several unique random numbers from 1 to 50, excluding x?

    - by Cocorico
    I have 2 numbers which are between 0 and 49. Let's call them x and y. Now I want to get a couple of other numbers which are not x or y, but are also between 0 and 49 (I am using Objective C but this is more of a general theory question I think?). Method I thought of is: int a; int b; int c; do { a = arc4random() % 49; } while ((a == x) || (a == y)); do { b = arc4random() % 49; } while ((b == x) || (b == y) || (b == a)); do { c = arc4random() % 49; } while ((c == x) || (c == y) || (c == a) || (c == b)); But it seem kind of bad to me, I don't know, I am just trying to learn to be a better programmer, what would be the most elegant way to do this for best practices?

    Read the article

  • iphone xcode annotation pin drop with slider value change also remove

    - by chirag
    i have to add annotation pin on location with UIslider Value change .... this is code where i add annotation (MKAnnotationView *) mapView:(MKMapView *)mapView1 viewForAnnotation:(id ) annotation{ MKAnnotationView* annotationView = nil; NSString* identifier = @"Pin"; MyAnnotationView* annView = (MyAnnotationView*)[mapView1 dequeueReusableAnnotationViewWithIdentifier:identifier]; // annotationView.leftCalloutAccessoryView = myImage; //myImage = [UIButton buttonWithType:UIButtonTypeCustom]; // [myImage setImage:[UIImage imageNamed:@"mark.png"]forState:UIControlStateNormal]; //Property_Photo UIButton *mybtn = [UIButton buttonWithType:UIButtonTypeCustom]; if([annotation isKindOfClass:[AddressAnnotation class]]){ AddressAnnotation x=(AddressAnnotation)annotation; mybtn.frame = CGRectMake(0, 0, 35, 35); mybtn.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter; mybtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter; [mybtn setImage:[UIImage imageNamed:@"btn.png"] forState:UIControlStateNormal]; [mybtn setTitle:[NSString stringWithFormat:@"%@",[x getID]] forState:UIControlStateDisabled]; [mybtn addTarget:self action:@selector(btnShowProperty:) forControlEvents:UIControlEventTouchUpInside]; ((IMOVEISAppDelegate*)[[UIApplication sharedApplication]delegate]).strPropertyPrice = [[myTblArray objectAtIndex:imgIndex]valueForKey:@"Property_Price"]; NSLog(@"property price: %@",((IMOVEISAppDelegate*)[[UIApplication sharedApplication]delegate]).strPropertyPrice); if(nil == annView) { ///if(annView!=nil && [annView retainCount]>0){ [annView release]; annView=nil; } annView = [[[MyAnnotationView alloc] initWithAnnotation:x reuseIdentifier:identifier] autorelease]; if(Objslider.value==10){ [myMapView removeAnnotations:myMapView.annotations]; } } NSURL *imgURL = [NSURL URLWithString:[[myTblArray objectAtIndex:imgIndex]valueForKey:@"Property_Photo"]]; UIImage *imgPhoto = [UIImage imageWithData:[NSData dataWithContentsOfURL:imgURL]]; UIImageView *pinImgView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0,35, 35)]; imgIndex++; [pinImgView setImage:imgPhoto]; annView.rightCalloutAccessoryView = mybtn; annView.leftCalloutAccessoryView = pinImgView; [annView setBackgroundColor:[UIColor clearColor]]; } [annView setEnabled:YES]; annView.canShowCallout = YES; annView.calloutOffset = CGPointMake(-5, 5); annotationView = annView; return annotationView; }

    Read the article

  • How would I find all sets of N single-digit, non-repeating numbers that add up to a given sum in PHP

    - by TerranRich
    Let's say I want to find all sets of 5 single-digit, non-repeating numbers that add up to 30... I'd end up with [9,8,7,5,1], [9,8,7,4,2], [9,8,6,4,3], [9,8,6,5,2], [9,7,6,5,3], and [8,7,6,5,4]. Each of those sets contains 5 non-repeating digits that add up to 30, the given sum. Any help would be greatly appreciated. Even just a starting point for me to use would be awesome. I came up with one method, which seems like a long way of going about it: get all unique 5-digit numbers (12345, 12346, 12347, etc.), add up the digits, and see if it equals the given sum (e.g. 30). If it does, add it to the list of possible matching sets. I'm doing this for a personal project, which will help me in solving Kakuro puzzles without actually solving the whole thing at once. Yeah, it may be cheating, but it's... it's not THAT bad... :P

    Read the article

  • Excel - Variable number of leading zeros in variable length numbers?

    - by daltec
    The format of our member numbers has changed several times over the years, such that 00008, 9538, 746, 0746, 00746, 100125, and various other permutations are valid, unique and need to be retained. Exporting from our database into the custom Excel template needed for a mass update strips the leading zeros, such that 00746 and 0746 are all truncated to 746. Inserting the apostrophe trick, or formatting as text, does not work in our case, since the data seems to be already altered by the time we open it in Excel. Formatting as zip won't work since we have valid numbers less than five digits in length that cannot have zeros added to them. And I am not having any luck with "custom" formatting as that seems to require either adding the same number of leading zeros to a number, or adding enough zeros to every number to make them all the same length. Any clues? I wish there was some way to set Excel to just take what it's given and leave it alone, but that does not seem to be the case! I would appreciate any suggestions or advice. Thank you all very much in advance!

    Read the article

  • Internal USB A Female to motherboard 4-pin that mounts internally

    - by rockinthesixstring
    I'm wondering if anyone knows of a product like this but that is physically mountable internally rather than on a cable? I'm planning on building a super low profile "gateway" pc that is dedicated to handling internet traffic in my home. I have a great 1U rackmountable chassis for an ITX motherboard, but I need the hard drive real estate for the additional NIC required to run a gateway (one onboard and one PCI). So the plan is to use a small 8GB USB Jump Drive for the OS inside the box (as to not have one hanging out the back. And although it's racked, I still don't want the jump drive flopping around internally, so I want it fixed somehow. I have an alternative idea where by I use a flush mount zap strap saddle and a zip tie to hold it in place, but that seems kind of like a hack.

    Read the article

  • Windows 7, "Pin to Taskbar" for all users.

    - by Archit Baweja
    In windows XP, you can add a shortcut to the start menu or desktop for all users by copying/moving the shortcut to C:\Documents and Settings\All Users[Desktop|Start Menu] I know same is the case in Windows 7 with a slightly different path (C:\Users\Public). However I'm still trying to find out how to add a 'shortcut' for all users. There is no C:\Users\Public\Taskbar. Any ideas? Or is it just not available as a feature?

    Read the article

  • windows 7 taskbar pin custom shortcuts to jumplist

    - by stijn
    For example I have TightVNC Viewer pinned to taskbar, it does not allow a jumplist (pinning multiple items or storing recent items). However I have a couple of shortcuts to vncviewer.exe that take arguments. Is there a way to get these in a jumplist for the vncviewer taskbar icon anyway? Found jumplist launcher already, but it's not exactly what I'm after + it's buggy (cannot add arguments to the exe)

    Read the article

  • Pin two shortcuts to same application with different settings to taskbar

    - by Dan Neely
    I'd like to have two shortcuts to Visual Studio on my taskbar: one with default settings and a second modified to always run as admin. I know I can manually start a copy with admin rights by right clicking on the shortcut and then right clicking on the name of the application and selecting Run as administrator...; but I'd like to automate the process when I need it (without impeding my ability to start VS without admin rights when I don't need them).

    Read the article

  • SQL SERVER – T-SQL Scripts to Find Maximum between Two Numbers

    - by pinaldave
    There are plenty of the things life one can make it simple. I really believe in the same. I was yesterday traveling for community related activity. On airport while returning I met a SQL Enthusiast. He asked me if there is any simple way to find maximum between two numbers in the SQL Server. I asked him back that what he really mean by Simple Way and requested him to demonstrate his code for finding maximum between two numbers. Here is his code: DECLARE @Value1 DECIMAL(5,2) = 9.22 DECLARE @Value2 DECIMAL(5,2) = 8.34 SELECT (0.5 * ((@Value1 + @Value2) + ABS(@Value1 - @Value2))) AS MaxColumn GO I thought his logic was accurate but the same script can be written another way. I quickly wrote following code for him and which worked just fine for him. Here is my code: DECLARE @Value1 DECIMAL(5,2) = 9.22 DECLARE @Value2 DECIMAL(5,2) = 8.34 SELECT CASE WHEN @Value1 > @Value2 THEN @Value1 ELSE @Value2 END AS MaxColumn GO He agreed that my code is much simpler but as per him there is some problem with my code which apparently he does not remember at this time. There are cases when his code will give accurate values and my code will not. I think his comment has value but both of us for the moment could not come up with any valid reason. Do you think any scenario where his code will work and my suggested code will not work? Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: Pinal Dave, PostADay, SQL, SQL Authority, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • program logic of printing the prime numbers

    - by Vignesh Vicky
    can any body help to understand this java program it just print prime n.o ,as you enter how many you want and it works good class PrimeNumbers { public static void main(String args[]) { int n, status = 1, num = 3; Scanner in = new Scanner(System.in); System.out.println("Enter the number of prime numbers you want"); n = in.nextInt(); if (n >= 1) { System.out.println("First "+n+" prime numbers are :-"); System.out.println(2); } for ( int count = 2 ; count <=n ; ) { for ( int j = 2 ; j <= Math.sqrt(num) ; j++ ) { if ( num%j == 0 ) { status = 0; break; } } if ( status != 0 ) { System.out.println(num); count++; } status = 1; num++; } } } i dont understand this for loop condition for ( int j = 2 ; j <= Math.sqrt(num) ; j++ ) why we are taking sqrt of num...which is 3....why we assumed it as 3?

    Read the article

  • Port numbers in Visual Studio projects and IIS

    - by aspdotnetuser
    I have a few questions about localhost and port numbers as this is an area where I do not have a lot of knowledge, and because I recently had to work with setting up Visual Studio projects and IIS and there are things I'm not clear on. I have the following questions on the things I find confusing. I thought it made more sense to include them all in one question instead of making separate questions. I have noticed a random port number is generated with projects I have worked on in the past, but I recently saw a project where the port number was fixed. What is the purpose of having a fixed/default localhost port number? i.e is it particularly useful on projects that have many programmers working on the project? If a solution contains multiple projects (for example, WCF services, Domain, MVC/Web pages), is it possible to setup a different localhost port for each of them? If so, what is the benefit of this? If a solution contains multiple projects and has different localhost urls/port numbers, must there be a corresponding website (and application pool) for each project in IIS? Or just for the project that contains the actual web pages?

    Read the article

  • How to Integrate Dropbox with Pages, Keynote, and Numbers on iPad

    - by The Geek
    The iWork apps are some of the best apps on the iPad, and each show just how powerful a touchscreen device can be with the most basic of computing functions. In fact, there’s not much to dislike about the iWork apps, except for one thing: importing and exporting files. You can open documents from email attachments, download them from websites, or import them from other apps like Dropbox. Once you’ve opened your file in Pages, Keynote, or Numbers on iPad, though, you can only send it via email, upload it to a WebDAV server or Apple’s iDisk service, or wait to sync it with iTunes on your computer. Most other iOS office apps don’t offer nearly as many features as the iWork apps, but they do offer deep integration with Dropbox which makes it easy to view and edit your documents no matter where you are. Dropbox is the most popular file sync and sharing solution, and makes it absolutely painless to share folders with anyone around the world and keep your computers in sync. That is, computers and applications that integrate with Dropbox. However, you don’t need to give up on using Dropbox with iWork apps on iPad. Today we’re going to look at how you can enable WebDAV compatibility on your Dropbox account to let Pages integrate nearly the whole way with Dropbox. It’s not a perfect solution, but it’s much better than the default setup. So let’s get started Latest Features How-To Geek ETC How to Integrate Dropbox with Pages, Keynote, and Numbers on iPad RGB? CMYK? Alpha? What Are Image Channels and What Do They Mean? How to Recover that Photo, Picture or File You Deleted Accidentally How To Colorize Black and White Vintage Photographs in Photoshop How To Get SSH Command-Line Access to Windows 7 Using Cygwin The How-To Geek Video Guide to Using Windows 7 Speech Recognition Stylebot Customizes Web Pages in Chrome, Now Has Downloadable Styles Blackberry, Dell, Apple, and Motorola Tablets Compared [Infographic] Encrypt Your Google Search Queries Vintage Posters Showcase the History of Tech Advertising Google Cloud Print Extension Lets You Print Doc/PDF/Txt Files from Web Sites Hack a $10 Flashlight into an Ultra-bright Premium One

    Read the article

  • Least common multiple for 3 or more numbers

    - by paan
    How do you calculate the least common multiple of multiple numbers? So far I've only been able to calculate it between two numbers. But have no idea how to expand it to calculate 3 or more numbers. So far this is how I did it LCM = num1 * num2 / gcd ( num1 , num2 ) With gcd is the function to calculate the greatest common divisor for the numbers. Using euclidean algorithm But I can't figure out how to calculate it for 3 or more numbers.

    Read the article

  • how to set mediatype for prreview pin vc++ directshow

    - by Sathis
    hai.. am writing simple appliaction for capture and rendering video in vc++ .and i set meadiatype for capture pin RGB24 AND 640*480 image size. Image is captured thats size.but i cant rendering preview.if i render that i get BLACk PREVIEW only.i checked also in GRAPH EDIT tool.but i cant get. am using wcsa400 card type cam and .net 2005 pl kindly help me.

    Read the article

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