Displaying 20 results from an estimated 427 matches for "z0".
2011 Aug 03
0
[PATCH] update valid_hostname regex checks
...diff --git a/scripts/ovirtfunctions.py b/scripts/ovirtfunctions.py
index ae454e5..2d6fac4 100644
--- a/scripts/ovirtfunctions.py
+++ b/scripts/ovirtfunctions.py
@@ -781,11 +781,15 @@ def is_valid_ipv6(ip_address):
return False
def is_valid_hostname(hostname):
- regex = "^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$"
- if re.match(regex, hostname):
+ regex_1 = "^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])\.)+([a-zA-Z0-9]{2,5})"
+ regex_2 = "^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*...
2003 Jul 14
2
Subsetting a matrix
...e following illustrates what seems to me to be an inconsistency
in the behaviour of matrix subsetting:
> Z<-matrix(c(1.1,2.1,3.1,1.2,2.2,3.2,1.3,2.3,3.3),nrow=3)
> Z
[,1] [,2] [,3]
[1,] 1.1 1.2 1.3
[2,] 2.1 2.2 2.3
[3,] 3.1 3.2 3.3
> dim(Z)
[1] 3 3
> Z0<-Z[c(T,F,F),c(F,T,T)]
> Z0
[1] 1.2 1.3
> dim(Z0)
NULL
whereas, of course, with
> Z1<-Z[c(T,T,F),c(F,T,T)]
> Z1
[,1] [,2]
[1,] 1.2 1.3
[2,] 2.2 2.3
> dim(Z1)
[1] 2 2
i.e. a fully-paid-up matrix.
What I would have expected is that Z0 should come...
2006 Jan 20
4
validates_format_of > Invalid regular expression with simple pattern
Hello,
I try this :
validates_format_of :name , :with => /^[A-z0-9_.- ]*$/ , :message =>
"bad characters"
for accept any name with chars "A" to "z" , "0" to "9" , with "_" "."
"-" and " "
The pattern is really simple but I have this error :
SyntaxError in Login#r...
2006 Jun 05
2
When adding a record in console, a parameter comes in as null even when I set it
...:password
attr_accessible :username, :password, :email, :name
validates_uniqueness_of :username, :scope => :account_id
validates_presence_of :username, :password, :name, :email, :account_id
validates_format_of :email, :with => /
^[-^!$#%&''*+\/=?`{|}~.\w]+
@[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])*
(\.[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])*)+$/x,
:message => "must be a valid email address",
:on => :create
def before_create
self.hashed_password = User.hash_password(self.password)
end
def after_create
@password = nil
end...
2005 Oct 10
1
using innov in arima.sim
Hello,
I have used the arima.sim function to generate a lot of time series, but to day I got som results that I didn't quite understand. Generating two time series z0 and z1 as
eps <- rnorm(n, sd=0.03)
z0 <- arima.sim(list(ar=c(0.9)), n=n, innov=eps)
and
z1 <- arima.sim(list(ar=c(0.9)), n=n, sd=0.03),
I would expect z0 and z1 to be qualitatively similar. However, with n=10 the two series could look like this:
z0 = -4.1258 -3.7326 -3.3269 -2.9813 -...
2008 Feb 11
1
ctags support for puppet
This is a quick and dirty .ctags file that makes basic navigation
possible with vim and ctags, great if you have multiple files:
--langdef=puppet
--langmap=puppet:.pp
--regex-puppet=/^class[ \t]*([a-zA-Z0-9_\-]+)[ \t]*/\1/d,definition/
--regex-puppet=/^site[ \t]*([a-zA-Z0-9_\-]+)[ \t]*/\1/d,definition/
--regex-puppet=/^node[ \t]*([a-zA-Z0-9_\-]+)[ \t]*/\1/d,definition/
--regex-puppet=/^define[ \t]*([a-zA-Z0-9_\-]+)[ \t]*/\1/d,definition/
Paul
2006 Dec 02
1
Trouble passing arrays to C code
Hello,
I'm having more trouble with interfacing with C code. I have a
function in C that will return the result of its computation as 3
arrays. The signature of the function is as follows:
void lorenz_run(double x0, double y0, double z0, double h, int steps,
double *res_x, double *res_y, double *res_z)
The function works, as I've tested it from within C itself and the
results it gives are accurate. In order to integrate it with R, I've
written the following C wrapper function:
void lorenz_run_R_wrapper(double *x...
2008 Oct 15
4
Small regular expression question
...ch valid URLs.
My problem is that it almost works, except it accepts URLs with / in the
middle of them, suchs as:
http://www.ruby/rails.com
It looks (to me) like my regular expression should not match strings
like that, but it does. Here is the regular expression:
.match(/^((http|https):\/\/)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.(\w+).*$/ix)
How can I make it not accept URLs with / in the middle of them?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Ta...
2006 Jun 13
0
HTTP validation regexp, possible solution
...l of my tests anyway. :-)
For a reminder, here''s a sample message from that thread. My code is
below it.
On Jan 26, 2006, at 5:28 AM, Nathaniel S. H. Brown wrote:
> It only allows for URL''s without the HTTP AUTH syntax you mentioned.
>
> /^(http|https|ftp|smb):\/\/(a-z0-9]+:[a-z0-9]+@)?[a-z0-9]+([\-\.]{1}
> [a-z0-9]
> +)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$/ix
>
> Without testing, the above should work in such a case.
>
> -Nb
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Nathaniel S. H. Brown...
2000 Apr 28
3
L(x,y,t)?
I have been using the following method to create L(x,t)
x<-seq(1,66)
time<-seq(1,19)
v0<-.01
f0<-function(x,time) .45*cos(2*pi*3*x/66+v0*time)
L0<-outer(x,time,f0)
If I do image(L0) I get an x,t plot of a drifting cosine wave grating.
The grating is actually a pattern of fuzzy bars; I have been ignoring the
y dimension (because the grating is vertical: y has no effect on the
2006 Jan 22
0
problem setting up lighttpd and rails app.
...ot; + var.wholesale +
"/public/dispatch.fcgi",
"bin-environment" => ( "RAILS_ENV" => "development" )
)
)
)
url.rewrite = ("^/$" => "/dispatch.fcgi?controller=home&action=index2",
"^/([\-_a-zA-Z0-9]+)/([\-_a-zA-Z0-9]+)/([\-_a-zA-Z0-9%]+)\??([\-_a-zA-Z0-9=&%]*)$"
=>
"/dispatch.fcgi?controller=$1&action=$2&id=$3&$4",
"^/([\-_a-zA-Z0-9]+)/([\-_a-zA-Z0-9]+)/?\??([\-_a-zA-Z0-9=&%]*)$" =>
"/dispatch.fcgi?controller=$1&action...
2006 Apr 01
3
Syncpeople Plugin Scope Never Active
...he controller:
{ name = ''meta.rails.controller'';
comment = ''Uses lookahead to match classes with the Controller
suffix; includes ''''source.ruby'''' to avoid infinite recursion'';
begin = ''(^\s*)(?=class\s+(([.a-zA-Z0-9_:]+Controller\b(\s*<\s*[.a-zA-Z0-9_:]+)?)|(<<\s*[.a-zA-Z0-9_:]+)))(?!.+\bend\b)'';
end = ''^\1(?=end)\b'';
patterns = (
{ include = ''source.ruby''; },
{ include = ''$self''; } );
}
--
Jeremy Huffman
http://www.jer...
2006 Jan 25
24
RailsCron 0.2 plugin
I received feedback from some of you, saying that it would be cool if
RailsCron was even easier to manage. So I implemented a graceful
start/restart inside of the plugin''s init.rb. If you don''t like it,
comment it out and send me the feedback.
Also, I finished an update to RailsCron that allows you to attach
asynchronous processing methods to your ActiveRecord models. i.e.:
2006 Sep 04
1
how to fit gauss beam?
Hello,
I am having a hard time fitting a gauss beam using R. In
gnutplot I did something like
$ w(z) = w0 * sqrt(1+(z/z0)**2)
$ fit w(z) 'before_eom.txt' using 1:2 via w0, z0
to obtain w0 and z0. Now I want to do the same in R. I tried
a linear model like this (r = radius, z = distance):
beam <- function(z) {
sum(sqrt(1 + z**2))
}
lm(r ~ I(beam(z)), data = before_eom)
Which gives nonsensical answers...
2013 Nov 19
1
Quick question on sieve
I have a procmail recipe that does the majority of my heavy lifting for my mailing lists. It's pretty straightforward, but as I understand it, this isn't something sieve can do:
# [ ] contains a space and a tab
:0
* 9876543210^0 ^(List-Id:.*<|X-Mailing-List:[ ]*)\/[-A-z0-9_+]+
* 9876543210^0 ^(List-Post:[ ]*(<mailto:)?|List-Owner:[ ]*(<mailto:)?owner-)\/[-A-Z0-9_+]+
* 9876543210^0 ^(Sender:[ ]*owner-|X-BeenThere:[ ]*|Delivered-To:[ ]*mailing list )\/[-A-Za-z0-9_+]+
* 9876543210^0 ^Sender:.* List"? <(mailto:)?\/[-A-Z0-9_+]+
{ LISTNAME=$MATCH }
Ba...
2020 Feb 04
0
Always Be Conferencing v16e - pure AEL-based dial plan solution
...of first call path. Ring 1 minute.
same = n,AELSub(pngnpbx-abc-path,3,300,${path3}) ; Set the third call path - used only on failover of second call path. Ring 5 minutes.
same = n,NoOp(About to change flow based on caller ID number.)
same = n,Set(cleancid=${FILTER(a-zA-Z0-9,${CALLERID(num)})})
same = n,Set(gotdp=${DIALPLAN_EXISTS(${CONTEXT},${EXTEN},x${cleancid})})
same = n,GotoIf($[${gotdp}]?x${cleancid})
; C-Level
; These two phones are in the same 10m square open area.
same = n(x1107),NoOp()
same = n(x1111),NoOp()
same = n,AELSub(pngnpbx-abc-gps,39.739,-104...
2007 Aug 07
2
Making Validations Optional
Hello,
I am working with URL validations. I want this validation to be
optional if the data exists in the form submission. I have tried
several things.
validates_format_of :website,
:if => params[:organization][:website],
:with => /((http|https):\/\/)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]
{2,5}(([0-9]{1,5})?\/.*)?/,
:message => "Please enter a valid url"
Of course the challenge is in the :if statement
I won''t bother you guys with all of my experiments, but I have tried
using :website, :website.length > 0, params[:organiz...
2004 Dec 13
4
Dispatcher? how to use long urls with slashes to call a controller
Hello rails,
I have a controller called file with a method get that returns me a
file from the db.
want to do the following:
When calling http://localhost:8080/file/get/11/hansi.txt i want that
rails does the same as if i would call
http://localhost:8080/file/get/11
This i not the case. I get a 404.
This is useful as this makes the filename in the browser downloading
the
2020 Feb 26
1
Matching regexps
Hi,
I'm having some trouble with matching. The regexp in my dovecot.sieve
file should match on email addresses, but does not.
# The code:
if header :matches "From" "<[a-z0-9-]*@[a-z0-9-.]*>" { set "sender" "${1}"; }
if not execute "grepfrom" ["${sender}"] {
if envelope :matches "from" "*" { set "sender" "${1}"; }
This failes to match Tamara Denning <tdenning at cs.utah.edu...
2009 Jun 08
1
Regex question to find a string that contains 5-9 alpha-numeric characters, at least one of which is a number
Hi,
This is not exactly an R question but I am trying to use gsub to replace
a string that contains 5-9 alpha-numeric characters, at least one of
which is a number. Is there a good way to write it in a one line regex?
Thanks,
Richard