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.
I'm using inflector Pluralize and Singularize functions.
I want to know if there is a ready library that know to decide if a word needs to be Pluralize or Singularize based on a number.
Like:
0 articles
1 article
2 articles
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.
Hi,
I need to define an appender for log4net in a way that I get one log file for each day, but the total number of files are limited to, let's say, 30. That is I want to keep only the logs not older then 30 days, delete the older ones.
I've tried doing it with RollingFileAppender, but it seems that specifying a limit of files to keep is not supported. Do you know of an alternative solution that I could use?
Hello
I would like to create, in a function, a boucle to create a data.frame with a variable number of columns.
WIth something like :
a = c("a","b")
b = c(list(1,2,3), list(4,5,6))
data.frame(a,b)
I would like to get a data-frame like :
a 1 2 3
b 4 5 6
Instead of I obtain :
a 1 2 3 4 5 6
b 1 2 3 4 5 6
Thank you !
PS : I also try with rbind, but it's doesn't work...
I am working on a project that stores multiple versions in the same svn repo but in different directories. For ease of reference for the coders working on the project I'd like to be able to add a commented tag similarly to
# $Revision: 144 $
However, instead of the file revision it should contain a simple version number like so:
# $Version: 1.63 $
# $Version: 1.64 $
# $Version: 2.0 $
Is there a way to get subversion to do this automatically for a specific directory and all sub-directories as well as for any new files added to those?
Given an element with unknown margin-left, how to increase its margin-left at a number say 100px?
For example, assuming the original margin-left is 100px, the expected result is 100px + 100px thus 200px finally.
I would like to ask if there is a way to include the total number of rows, as an additional column, in the returned result sets from a TSQL query using also the Row_Number (SQL 2005) command.
For example, getting the results set from a query against Book table in a form similar to this:
RowNum BookId BookTitle TotalRows
--------------------------------------------
1 1056 Title1 5
2 1467 Title2 5
3 121 Title3 5
4 1789 Title4 5
5 789 Title5 5
Take the following code in C/C++, for example:
int foo[] = {0, 0, 0, 0};
No magic numbers, right?
Now, the Python "equivalent" of that would be:
foo = [0, 0, 0, 0]
Still no magic numbers.
However, in Python, that same thing can be written like this:
foo = [0] * 4
And now we DO have a magic number. Or do we?
I'm guessing this and other similar things are present on these and other languages.
I have a scores table that has two fields:
user_id
score
I'm fetching specific rows that match a list of user_id's. How can I determine a rank for each row relative to the total number of rows, based on score? The rows in the result set are not necessarily sequential (the scores will vary widely from one row to the next). I'm not sure if this matters, but user_id is a unique field.
How to count the number of right children in a binary tree?
This means that I only want the children marked as right.
Ex. (Left | Right)
F(Root)
G | H
T U | I J
The right children would be U,H,and J.
What would be the algorithm to find these.
df <- data.frame(var1=c('a', 'b', 'c'), var2=c('d', 'e', 'f'), freq=1:3)
What is the simplest way to expand the first two columns of the data.frame above, so that
each row appears the number of times specified in the column 'freq'?
In other words, go from this:
>df
var1 var2 freq
1 a d 1
2 b e 2
3 c f 3
To this:
>df.expanded
var1 var2
1 a d
2 b e
3 b e
4 c f
5 c f
6 c f
What's the fastest way to count the number of keys/properties of an object? It it possible to do this without iterating over the object? i.e. without doing
var count = 0;
for (k in myobj) if (myobj.hasOwnProperty(k)) count++;
Firefox provides a magic __count__ property, but this isn't available in other implementations.
let's say I have this query:
select * from table1 r where r.x = 5
do the speed of this query depends on the number of rows that are present in table1 ?
Hi,
I have a SSRS report with full of number fields. I would like to have that to be displayed as in one decimal. i tried to use F1. it gives me only one decimal points in html rendering, but in excel exported version it shows 2 decimal points.
How can i have just one decimal point both ecxel and html rendering.
Please comment.
Thanks in advance
San
I have a site that is mainly showing a paged list of content (articles, data element's, etc.), and I'm wondering about returning HTTP 404 when user navigates outside of the available list range.
Some sites just display "No results/Page number out of range" and some return additionally return HTTP 404 status.
What's your take on that, and why?
UPDATE
It's not and api response. This question is in regard to user viewed pages that among other things show a list/table in the main area.
if ([tempArray containsObject: [sectionInfo indexTitle]])
{
return nil;
}else
{
[tempArray addObject: [sectionInfo indexTitle]];
return [sectionInfo indexTitle];
}
return [sectionInfo indexTitle];
The code above groups the cells in alphabetical order but displays a blank header instead of the appropriate title. Could this possibly be because I did not specify the number of headers? This would naturally be a single header for every letter in the alphabet.
I'm looking to convert single digit numbers to two-digit numbers like so:
9 ==> 09
5 ==> 05
12 == 12
4 ==> 04
I figure I could put a bunch of if-else statements (if number is under 10, then do a gsub) but figure that's horrible coding. I know Rails has number_with_precision but I see that it only applies to decimal numbers. Any ideas on how to convert single-digits to two-digits?