similar to: date.to_s trimming

Displaying 20 results from an estimated 3000 matches similar to: "date.to_s trimming"

2017 Jul 21
3
[PATCH] common/mlstdutils: Add chomp function to remove \n from end of strings.
This is like the Perl chomp function, it removes a single \n from the end of a string if present, else leaves the string alone. I believe I found the only (two) places where such a function is used, but there may be a few more lurking. --- common/mlstdutils/std_utils.ml | 7 +++++++ common/mlstdutils/std_utils.mli | 2 ++ common/mlstdutils/std_utils_tests.ml | 10 ++++++++++
2006 Nov 09
1
POSIXlt converted to POSIXct in as.data.frame()
In trying to use as.Date(), I've come across the conversion of POSIXlt to POSIXct when a POSIXlt variable is included in a data frame: my_POSIX <- strptime(c("11-09-2006", "11-10-2006", "11-11-2006", "11-12-2006", "11-13-2006"), "%m-%d-%Y") str(my_POSIX) my_Date <- as.Date(my_POSIX) str(my_Date) data <- format(my_Date)
2008 Feb 19
3
will_paginate question
Hi- Is it possible to use search parameters with will_paginate? For example, something like this: @var = Model.paginate :per_page => 20, :page => params[:page], :order => ''my_date DESC'', :conditions =>["my_date >= ? AND my_date <=?",@start,@end] I am getting some errors with this, but will this generally work?
2003 Aug 25
2
SetVar on sample.call
Hi all!! Does anyone have a short example or even better - a working AGI script that uses "GET VARIABLE' from a /var/spool/asterisk/outgoing call that uses "SetVar"? Here's what I've tried with no luck so far: sample.call ================= Channel: SIP/1000 MaxRetries: 2 RetryTime: 60 WaitTime: 30 Application: Agi Data: playTasks.agi Callerid: Nightly Processor
2010 Dec 30
2
remove newlines / perl /concise example
Thanks for the previous tips and suggestions. Here's a more concise example: Input file: <aaaa> <bbbb> <cccc> <dddd> I want everything on one line, i.e., remove all newlines. Like so: <aaaa><bbbb><cccc><dddd> Simple perl code: #!/usr/bin/env perl # Remove newlines from a file in two ways: # (1) Just "chomp" them; # (2) Replace
2010 Dec 30
4
perl code to remove newlines
Given an HTML file which looks like this: --------- begin snippet --------- <HTML ><HEAD ><TITLE >We've Lied to You&#8230;</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="Maximum RPM" HREF="index.html"><LINK REL="UP"
2008 Nov 20
1
Stopping bdrb from another process gets the process killed
Hi, I''ve been having some issues integrating bdrb on a cruisecontrolrb server It''s related to the way we stop the bdrb server. The thing is, right now when we stop the process we are killing the parent of the group of the process. This is ok if you''re running script/backgroundrb stop directly from the console, but if I''m running this from another process,
2010 Mar 23
2
Samba / Lucid / Windows 7 problem
Hi list I'm running a Samba PDC on Ubuntu Lucid (3.4.7) and am unable to join Windows 7 machines to the domain. I have applied the registry changes described at http://wiki.samba.org/index.php/Windows7 Windows XP machines can join with no problems. Samba log: stty: standard input: Inappropriate ioctl for device Use of uninitialized value $pass in chomp at /usr/sbin/smbldap-useradd line
2008 May 25
2
storing data from a txt file in ruby?
Hello Im trying to write a a ruby program that takes a list of books title ,author so on and i can read in the file with no problem but im trying to store the list into either a array or hash so i ca say run different methods view, delete ect.. anyhelp would be great this is what i have so far IO.foreach("book_list.txt") do |line| catalog=line.chomp.split(",")
2007 Jun 06
2
lookup in CSV recipe
I await Luke''s node settings implementation with interest. At the moment however, I have this sort of ugliness: $site = $hostname ? { fred => "opsera", barney => "bedrock", default => "unknown site", ... } So I''ve knocked up this little function to use CSV files instead. Now I can just do: $site =
2006 Dec 15
5
Testing event driven Socket classes
Ok, here is the class, I want to Unit Test, its part of a large app and is based on EventMachine library. I want to mock the class TickServer ( i.e not stub it) . Since in actual scenario, you can''t do this on this class: @server = TickServer.new # will toss an exception at your face you must initialize the server like this: EventMachine.run {
2006 Jun 08
5
AM/PM select
I have a customer that has a request that the select_datetime fields have AM/PM selectors instead of 24 hour time. The rails time and datetime selects seem to only support 24 hour time. I can''t seem to find any information on this. i was wondering if there is already a solution out there, or will i have to roll my own? Sean Wolfe master nerd of i heart squares, inc. 3711 N.
2004 Feb 25
1
probleb with 'passwd chat' and 'passwd program'
Hi ! I have a problem using an external script to change password : in smb.conf, i have : => passwd chat = "Changing password for*\nNew password*" %n\n "\nRetype new password*" %n\n => passwd chat debug = Yes => log level = 100 => unix password sync = Yes => passwd program = /usr/local/sbin/smbldap-passwd %u The script is called normally, and logs show that the
2012 Mar 16
3
custom fact issue
Would anyone please assist me on this one? This fact seems to work, but it doesn''t return when called directly via facter --puppet noop, but the resulting facts end up in the reports. I''m at wits end with this. Thanks! <snip> utc_hour = Facter::Util::Resolution.exec(%q</bin/date -u +"%H">).chomp Facter.add(:noop) do setcode do
2006 May 29
3
File.size() on Uploaded Images Fail
I am checking the file size of an uploaded file and storing it in a filesize column. It will work just fine when the user uploads any files other than images (jpg,png,gif). Word, Excel, Powerpoint, .zip and more all work fine. This is my model asset.rb that handles the file upload. def newfile=(newfile_field) self.filename = base_part_of(newfile_field.original_filename) self.filetype
2006 Jun 18
4
uninitialized constant Datetime
I am building an application and I have generated the scaffold for a product. In the list method I include something like my_date = Datetime.now and the result I get from the webrick is an error uninitialized constant Datetime Do I have to add a line with a require? I am new at ruby on rails thanks in advance -- Posted via http://www.ruby-forum.com/.
2006 Mar 03
2
Background() App From AGI
I have the following python AGI script. I know it's been abstracted, but it's still pretty easy to see what's happening. self.agi.channelAnswer() self.agi.wait(1) self.agi.execCmd("background","enter-conf-call-number","") self.agi.execCmd("Read","confNum|||","") confNum =
2010 Oct 07
6
Deleting observations - can't see the data after that
Hello all, I am loading a data frame, fitting a model, getting diagnostic plots and they are flagging a couple of observations as problematic. Fair enough, and I want re-fit without them. After I delete an offending row (identified by one of the diagnostic plots), something like data = data[-3,]; then R will no longer print the contents of the data frame; it tells me it is a data frame
2011 Aug 25
5
custom fact regex problem
Hi guys I have a custom fact envt, it was working fine but now I have to make some changes in it; puppet client''s hostname is of the type 1234qa-abc-de.local where 1234 can be any thing of any length.My custom fact should contain qa, ie I want to check in the first part(before the first -) of the hostname if there exists a pattern/word qa and if it exists then my custom fact for envt
2002 Apr 22
3
no output from perl script
Here is the first Perl script I've tried to write to run rsync. It seems to work, but I don't see the progress like I should. I apologize if it's sloppy, I should add that it's not only the first perl script I've written for rsync, it's the first perl script I've written at all. ___________________________ #!/usr/bin/perl -w print " This command will DELETE