Thank you for your suggestion but I don't really think they are going to give out that. If so, they are going to ask me for product details or question to verify I have bought from them which I don't have because when I use their products, I buy them from retailers who are not accredited dealers. Buddy, if you know this just help me out if you don't know too let me know.
I'm looking to buid a program that works like a dating site and that matches you with the best options available for you. They usually show the results starting from the closest and then expanding the research larger and larger.
I'm doing my project in the US and Canada for my 1st test.
I'm woundering how can I set this up to be the smartest way possible.
Is it IP location, Latitude and Longitude, city....???
Do I need a complete database with all the distances between all the citites in the US and Canada?
Or maybe instead of a database with the cities, regroup the cities by urban Areas to make the matrix smaller?
I've been trying to work with a programmer and he says that to do what they do we would need a big computing power that for a little project can't be possible.
I'M confused and decided to come here for some help and see what you find coder have to say about all this.
I've been trying to work with a programmer and he says that to do what they do we would need a big computing power that for a little project can't be possible
Not based on your description.
- Determine a location. Ask them or attempt a service look up for IP (ask is probably better.)
- Then use a zip code location match to find a geo location for the zip code.
- Then 'draw' a box around the zip code - maybe based on user input miles from location.
- Then do a database geo look up to find others based on whether they are in the box or not.
More complex stuff than that happens on my personal development box every day.
For that matter you could just based it on zip code.
You'll need the lat and long of every zip code in the US\Canada\whatever. Where you get that data? I don't know, will it be free? Perhaps not. But that's beside the point.
If a user does a 10 mile search and their zip code is 1234 you find the lat\long of that zip, work out how much extra lat\long you add for 10 miles in all directions (you'll find the maths to convert lat\long to miles on-line if you search) and you search for users where the lat\long falls within this 10 mile "square" (eg if the user is at lat long 0,0 you search for users where the lat is between -10 and +10, and the long is between -10 and +10). That will give you all results in a 10 mile "square" around the user, but you *really* need a circle, not a square. You can leave the results as they are knowing some will be a little long, or you can do another set of processing on the initial results that fell within the "box" to eliminate the ones that are outside the 10 mile circle. You find this out using Pythagoras' theorem (again on-line if you need to search). Loop through every result and for each result calculate the "crow flies" distance between the two users using Pythagoras, and if that distance is > 10 remove it from the result set. If you want to show the exact distance between the user and the found user you'll need Pythagoras' theorem anyway. Doing this search as a two-step process will allow you to quickly eliminate most results using a standard, fast SQL query, and you then fine-tune the results in your code on that reduced result set.
The t array holds constants for each month, so the day can be calculated based on some recurring pattern of days within months. A look at the calendar should show you what this pattern is. The calculation using year, month and day yields some value, which is then divided by 7, giving the day of the week in the range [0-6].
Hi, I would be very glad if someone can help me with algorithm to solve following task.
We have a convoy of cars that are lined up in a row and must cross the bridge. Cars can´t overtake each other.
The bridge has limited capacity, which may not be exceeded.
Find the algorithm, which divides cars into groups so that the entire convoy cross the bridge in the shortest time.
Another group is allowed to enter only when the entire previous group cross the bridge.
Weight and speed of each car is known. The speed of group is determined by the slowest of car in the group.
We don't have ready made algorithms for each problem. You could try and come up with your own; keep adding cars to the current group until you reach a threshold - be it number of cars or total weight, if either one is reached, send the group.
Then find the slowest car in that group; that's the speed of that group.
For the fastest way of the group, you'd try to move as much slow vehicles together as possible.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
I am working on a bignum library and have been checking out some of the functions. I would like to know it the times I am seeing are good, bad, or indifferent.
To test big numbers, I used the RSA challenge file.
The times are in seconds and hundredths.
The initialize time is setting high priority and allocating all of virtual memory.
The read and split time is the time to read the file (one time) and tokenize it.
The edit time is for deleting unneeded lines in the file.
To get any difference in time between the different RSA instances, I had to loop 100,000 times to get different time values for the different instances (as you can see, the read/split time and the edit time are the default .01 second), thus those times are listed as 100K*xxx, i.e. "RSA-2048 100K*DTB conversion time: 2.06" means 20.6 microseconds for any single loop.
A single RSA instance includes the following data which is verified during the conversion (the first RSA instance is used as this example):
The edit deletes the blank lines and the Status line. The initialize, read, and edit are only done one time.
The conversion time for each RSA instance includes validating that only decimal digits are present in the data, and that there the correct number of digits, and that the digit sum matches. I load the number as a radix 10 value and convert it to binary, and verify that the result has the correct number of bits. I save this binary value over the decimal digits so I can load it later without conversion. I also load this binary value to insure correct operation with radix 1. Each RSA instance is processed 100,000 times and then the time is calculated.
The SQRT times include loading the binary value and taking the SQRT and getting its remainder, and then squaring the SQRT and adding the remainder and comparing the result with the RSA instance value. Each RSA instance is processed 100,000 times and then the time is calculated.
With all of the above operations as described, are the times at all reasonable, i.e. 20.6 microseconds for DTB conversion and validation of a 2048 bit binary number and 63.6 microseconds to load and take the SQRT and validate (SQRT**2 + remainder == semi prime) for the 2048 bit binary value?
Time to initialize: 0.06
Time to read and split RSA.TXT: 0.01
Time to edit RSA.TXT: 0.01
RSA-576 100K*DTB conversion time: 0.49
RSA-640 100K*DTB conversion time: 0.56
RSA-704 100K*DTB conversion time: 0.59
RSA-768 100K*DTB conversion time: 0.79
RSA-896 100K*DTB conversion time: 0.98
RSA-1024 100K*DTB conversion time: 1.13
RSA-1536 100K*DTB conversion time: 1.54
RSA-2048 100K*DTB conversion time: 2.06
Time to DTB convert 100K*RSA.TXT: 8.34
RSA-576 SQRT Time - 100k*RSA.TXT: 1.46
RSA-640 SQRT Time - 100k*RSA.TXT: 2.51
RSA-704 SQRT Time - 100k*RSA.TXT: 2.71
RSA-768 SQRT Time - 100k*RSA.TXT: 2.12
RSA-896 SQRT Time - 100k*RSA.TXT: 2.40
RSA-1024 SQRT Time - 100k*RSA.TXT: 2.80
RSA-1536 SQRT Time - 100k*RSA.TXT: 5.69
RSA-2048 SQRT Time - 100k*RSA.TXT: 6.36
No, I prefer to roll my own, only my functions process only positive integers. I do not use C++ or .NET, I am a MASM(5,6,7,8,9) programmer. OBTW, I read the class documentation but could not find a SQRT function, did I miss it somewhere?
If you are interested, I can email you the RSA.txt file (if you do not already have it) and you could implement and test the SQRT function and report the timings from the big integer class. My timings were taken on an HP Pavilion dv7-6c23cl - 6GB memory, quad AMD, 2.5GHz, 32 bit assembly, console application.
What I was looking for was anyone's WAG about how long the square roots of 576 bit to 2048 bit integers should take.
I have several more questions to ask about bignumb processing, but since you were were the only one to respond to my original question I thought I'd just ask you directly via email, however your email seams to be blocked so I will ask here directly.
When you select the low limit for a potential P value of 40% of the decimal digit count, what would that be? Lets take a simple example - 40% of a 15 digit number would be 6 digits. My assumption is that it would be 100,000, 6 digits and the lowest number in 6 digits. If I wanted to insure that this was an odd number, would that change to 99,999 or to 999,999? 99,999 is not a 6 digit number, but 999,999 is certainly greater than the minimum 6 digit number of 100,000. Which should be used as the limit to match what RSA would generate for encryption?
To calculate this in binary, consider that 10^14 is 100,000,000,000,000 (15 digits) = 0x3,8D7E,A4C6,8000 (50 bits). 40% of 50 bits is 20 bits. The lowest 20 bit number is 0x8,0000 (the lowest number in 20 bits). If I wanted to insure that this was an odd number, would that change to 0x7,FFFF or 0xF,FFFF? 0x7,FFFF is just a 19 bit number, but 0xF,FFFF is certainly is certainly greater than the minimum 20 bit number of 0x8,0000.
The upper limit of 45% is easier to figure out. Just create the maximum number for that digit count (or bit count) and increment the count and create the
number as a base to a power, then decrement the result by 1 (it will always be odd, either 99999... or FFFFF...).
Thank you for the reply. I guess I'll just select the smallest low number to guarantee that I get most of the created keys. I already plan to check that low limit and if I find that that low limit value is above the solution value, I will just use it as a high limit and use the value 1 as thee low limit.
I am looking for help at the following problem:
at my final project for Bsc i get data and need to decide if a threshold had been crossed (tha data IS NOT BOOLEAN.. i get data about the velocity of an object)
the deffinition : if i get that for 1sec at least the given data is above threshold - It has been crossed.
it ofcourse complicated beacuse i need to filter "noise".
i thought to use "ALPHA FILTER" or "X/Y decision" or "Avarege" and other.. but i am sure that someone did a these on that and there is a proven algorythm to handle it.