I'd like to generate an array of Random numbers with defined Min, Max, Mean and Stdev with given number of elements and error level. Is there such a library in C, C++, PHP or Python to do so? Please kindly advise. Thanks!
I'm trying to secure my rails 3 app against brute force login guessing. I'm using authlogic. What's the best way to force a user (or bot) to fill out a captcha after a specific number of failed login attempts? Does authlogic have a built in mechanism for recording how many consecutive failed attempts came from the same ip? I'd appreciate any help.
Does anyone no of a command or script that will output each author that has committed to the project followed by the number of lines they have contributed.
e.g. something similar to the following:
Author Insertions Deletions
Bob Dole 1240 409
Sarah J 481 140
Jim Helper 388 23
Cheers, Ben
In gawk I know two ways to test if a string contains a number. Which is best?
Method one: using regular expressions:
function method1(x) {
return x ~ /^[+-]?([0-9]+[.]?[0-9]*|[.][0-9]+)([eE][+-]?[0-9]+)?$/
}
Method two: the coercion trick (simpler):
function method2(x) {
return (x != "") && (x+0 == x)
}
Is there any reason to favor the more complex method1 over the simpler method2?
The documentation states: "Precision can range from 1 to 38. Scale can range from -84 to 127".
How can the scale be larger than the precision? For example I can't create a column with the datatype NUMBER(10, 100). Shouldn't the Scale range from -38 to 38?
For instance, Model Resume contains variable number of Model Project 's,
What should be my models and relationships between them to achieve this ?
Thanks in advance.
I'm sure this must be possible:
I want to have the revision number (from Subversion) put into a property that is accessible from Ant when my build runs in Luntbuild. There must be an OGNL expression that I can add to the Build Properties box on the configuration page for my Ant builder.
Does anyone know what it is?
I am trying to create an access 2007 database that allows staff that already have ID numbers to make a transaction and also other guest users who do not have ID number make a transaction. What is the best way todo this in access? A transaction involves taking an item out of inventory. Therefore if one a user (staff or external) has an item out of inventory then no other users can get a hold of that item. Thanks, Any Ideas would be most appreciated!
Hello guys,
For a school project, we'll have to implement a ranking system. However, we figured that a dumb rank average would suck: something that one user ranked 5 stars would have a better average that something 188 users ranked 4 stars, and that's just stupid.
So I'm wondering if any of you have an example algorithm of "smart" ranking. It only needs to take in account the rankings given and the number of rankings.
Thanks!
I have a django model with a DateTimeField.
class Point(models.Model):
somedata = models.CharField(max_length=256)
time = models.DateTimeField()
I want to get a count of the number of these objects for each day. I can do this with the following SQL query, but don't know how to do it through django.
SELECT DATE(`time`), Count(*)
FROM `app_point`
GROUP BY DATE(`time`)
Being able to restrict the results to a date range would also be good.
Let's say I have this query:
select * from table1 r where r.x = 5
Does the speed of this query depend on the number of rows that are present in table1?
Input : {5, 13, 6, 5, 13, 7, 8, 6, 5}
Output : {5, 5, 5, 13, 13, 6, 6, 7, 8}
The question is to arrange the numbers in the array in decreasing order of their frequency, preserving the order of their occurrence.
If there is a tie, like in this example between 13 and 6, then the number occurring first in the input array would come first in the output array.
I'm considering using Berkeley DB to cache some data on an application cluster. What's a reasonable upper limit on the number of nodes I can plan on Berkeley DB handling? Writing to the database will be from a single node.
I need to get the number of days contained within a couple of dates on mysql.
For example: Check in date 12-04-2010 Check out date 15-04-2010 and the day difference would be 3
I hope that was clear
Thanks
I am writing a small C application that use some threads for processing data. I want to be able to know the number of processors on a certain machine, without using system() & in combination to a small script.
The only way i can think of is to parse /proc/cpuinfo. Any other useful suggestions ?
I have a multiline textbox which can contain only 500 characters. Now i want to show the user the number of characters left as they are typing into the textbox as is the case when we use twitter.
Kindly help
I'm playing around with ASP.NET MVC and I just loaded up an empty project and ran it and the URL in my browser is http://localhost:52432/. Where is the 52432 port number specified?
Thanks in advance for your help, I'm going to start researching this question right now.
I am using AutoCompleteTextView and want to limit the number of dropdown items visible at a time on screen. Currently it fills up the screen but can i limit it to say 2 items with a scroll bar for displaying more.
As you can read in the tittle i need a regular expression for getting any letter, symbol, number from 1 to 100 maxlength (any text posible). Can someone provide that for me and maybe a good link to understand how it works.
Thank you.
Input : {5, 13, 6, 5, 13, 7, 8, 6, 5}
Output : {5, 5, 5, 13, 13, 6, 6, 7, 8}
Question is to arrange the numbers in the array in decreasing order of their frequency preserving the order of their occurrence.
If their is a tie, for example, here 13 and 6 then the number occurring first in input array would come first in output array.