similar to: A more elegant way of obtaining the major OS release number

Displaying 20 results from an estimated 400 matches similar to: "A more elegant way of obtaining the major OS release number"

2012 May 18
2
Facter 1.6.9 complains about "No LSB modules are available."
Hi, it seems that Facter 1.6.9 complains that "No LSB modules are available." on every run. This is on Ubuntu 10.04 and 12.04, probably others as well. This message (on stderr) usually comes from calling "lsb_release -v" when no additional LSB modules are installed. Facter apparently calls "lsb_release -v -s" in facter/lsbrelease.rb. This is neither fatal nor
2007 Aug 29
4
Newbie stuck on facter not finding hostname
Hi all, I''m trying to get puppet working for the first time, and I''ve run into something that''s got me stumped. This is all on Solaris 10/x64. The initial startup of puppetmasterd wasn''t working, and it appeared to be related to the SSL certs not getting generated properly. I managed to trace that down to the fact that facter isn''t finding the
2007 Dec 14
3
Nested conditions
Hello, I have a file which varies depending on which OS/version it''s running. I tried to make a nested source parameter like this, but it didn''t work: source => $operatingsystem ? { Debian => "puppet://myserver.com/files/os/debian/etc/ssh/sshd_config", Gentoo => "puppet://myserver.com/files/os/gentoo/etc/ssh/sshd_config", RedHat =>
2012 May 11
0
Announce: Facter 1.6.9rc1 Available
Facter 1.6.9rc1 is a maintenance release candidate with bug fixes and improvements. It includes contributions from the following people: Jeff Weiss, Joachim de Groot, Ken Barber, Matthaus Litteken, Moses Mendoza, and Stefan Schulte. This release is available for download at: http://downloads.puppetlabs.com/facter/facter-1.6.9rc1.tar.gz See the Verifying Puppet Download section at:
2005 Dec 28
1
making has_and_belongs_to_many save more elegant
When a user creates a post I also want to save all the tags associated with it. I do that in the post_controller like this presently: def save @post = Post.new(@params[:post]) @tags = Tag.new(@params[:tags]) @post.user_id = session[:id] if @post.save @tags.title.split('','').each do |tag| present_tag = Tag.find_by_title(tag.strip) present_tag =
2011 Jul 06
1
elegant way of removing NA's and selecting specific values from a data.frame
I have a data.frame "e" and would like to extract the 23rd column, remove any NA's and then remove any values >= 30. I can do it in steps such as this but have failed to figure out how to do it in a single line .... any suggestions? first <- e[,23] second <- first[!is.na(first)] third <- second[second<=30] thanks a bunch J -- Dr. Jim Maas University of East
2006 Feb 05
0
elegant way of re-encoding?
kloschi wrote: >> I've not used it, but Icecast now has the ability to execute a command >> upon stream start, as well as upon stream stop. You could use this >> fascility to launch a streamTranscoder instance. > > I didn't find any docs on that, how to execute a command upon stream > start/end? As I say, I've not used it, but I think there are some
2006 Feb 06
1
elegant way of re-encoding?
Hi, Now that I've been able to look at streamtranscoder 3.0, I see there's absolutely no documentation whatsoever. I've not compiled it, but I note that previously when you ran it first time, it would create a sample config file for you to edit. Maybe it still does this. Oddsock's flash demo may shed more light on this, but I can't use it so don't know. Geoff. --
2008 Aug 18
1
seq: specify *minimum* end value, more elegant solution
Hello, Using seq, I would like to specify a minumum end value, rather than a maximum end value. For example, rather than > seq(from=0, to=10, by=4) [1] 0 4 8 I would like to obtain [1] 0 4 8 12 I can do that with > by.value = 4 > seq(from=0,by=by.value,to=ceiling(10 / by.value)*by.value) [1] 0 4 8 12 That seems like a somewhat clunky solution, though, and requires an additional
2009 Jul 24
1
Most elegant way to use formals() in building functions
Dear Group: I want to create a function having a ... argument and to have the default arguments evaluated, as thus: g <- function(a, b, ...) a+b formals(g) <- alist(a=,b=2+3,...=) g function (a, b = 2 + 3, ...) a + b But I want the default argument for b to be evaluated as 5. How can this be done? Note: My real need is for a more complex expression to be evaluated for the default
2009 Nov 30
2
Ggplot2: Elegant Graphics for Data Analysis (Use R) (2009 Paperback)
Is this book worth its dollar? If so, why?, if not, why not? Cheers. -- View this message in context: http://n4.nabble.com/Ggplot2-Elegant-Graphics-for-Data-Analysis-Use-R-2009-Paperback-tp931702p931702.html Sent from the R help mailing list archive at Nabble.com.
2008 Mar 22
2
More elegant multiplication or division of a data frame with a vector
Hello, I am importing some raw voltage multichannel measurements into an R data frame. I need to scale each column with the respective sensitivity for that channel. I figured how to do it, but I am curious if there isn't a more elegant way. Now I start with something like this: rawdata <- data.frame(rbind(c(1,2,3), c(4,5,6))) sens <- c(2,4,6) and I do this: data <-
2010 Jul 29
2
Replace last element in a vector - elegant solution?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi I have to replace the last element of a vector with 0, but the length of x is not known at coding time. So I do the following: x <- 1:10 x x[length(x)] <- 0 x it is working nicely, but I am wondering: is there a more elegant solution( like tail(x, 1) <- 0 , which does not work)? Thanks, Rainer - -- Rainer M. Krug, PhD (Conservation
2011 Sep 08
2
The elegant way to test if a number is a whole number
Hi, x <- 0.2*5 is.integer(x) gives me FALSE because R stores it as a float number, right? Is there an elegant way to work around that problem? Right now I'm using x <- 0.2*5 round(x) == x which returns TRUE. But more strictly I should use all.equal(), right? I somehow just don't like the--pardon--ugliness of those pieces of code. Maybe there is a beautiful
2014 May 29
0
How to make the tests pass in an elegant way? Ruby on Rails
I am writing a rails app with my colleague who wrote a lot of the tests. He had to take a leave of absence due to a death in his family, and I am needing helps with changing the model so that the tests will pass in our spec file. Here is the model: class Worker < ActiveRecord::Base attr_accessible :first_name, :last_name has_many :writings end Here is the spec:
2012 Mar 16
2
Elegant Code
Hi, Can anyone help to write a more elegant version of my code? I am sure this can be put into a loop but I am having trouble creating the objects b1,b2,b3,...,etc. b1 <- rigamma(50,1,1) theta1 <- rgamma(50,0.5,(1/b1)) sim1 <- rpois(50,theta1) b2 <- rigamma(50,1,1) theta2 <- rgamma(50,0.5,(1/b2)) sim2 <- rpois(50,theta2) b3 <- rigamma(50,1,1) theta3 <-
2008 Mar 02
3
elegant way to minus on each row of a matrix
How to do this in an elegant way formatrix/data frame/zoo? mat= 1 2 3 4 5 6 7 8 9 vector= 1 2 3 result= 0 1 2 2 3 4 4 5 6 ie 1-1 2-1 3-1 4-2 5-2 6-2 7-3 8-3 9-3 Thanks in advance. _________________________________________________________________ 08 [[alternative HTML version deleted]]
2011 Jul 27
2
Elegant way to subtract matrix from array
there are really two related problems here I have a 2D matrix A <- matrix(1:100,nrow=20,ncol =5) S <- matrix(1:10,nrow=2,ncol =5) #I want to subtract S from A. so that S would be subtracted from the first 2 rows of #A, then the next two rows and so on. #I have a the same problem with a 3D array # where I want to subtract Q for every layer (1-10) in Z # I thought I solved this one
2006 Jan 26
2
elegant way of re-encoding?
hi, I have a single stream going to my icecast server, encoded in hi-quality ogg. goal is to serve hi- and low quality ogg and mp3 streams, re-encoded from the single hi-quality ogg stream. encoding all from e.g. oddcast simultaniously is not an option. it would be easier if source-streams would be static and always named the same .. unfortunately they are not. if so, I could define simple
2008 May 22
2
1501-511 Compilation failed for file ch2inv.f - R on AIX 5.2.
Hi, While executing the make after successful configuration (./configure --with-readline=no --without-iconv), the following error occurs: mbf2n11s (Regatta) /saswork/R/R-2.7.0$ make Target "R" is up to date. Target "R" is up to date. Target "R" is up to date. Target "R" is up to date. Target "Makedeps" is up to date. Target "libbz2.a"