[#408616] How to get the User_logged in windows with Sinatra — Mario Ruiz <lists@...>
I need to know the user that is accessing the intranet i created with
[#408620] including FileUtils::Verbose crashes Marshal.dump — Bryan Lockwood <lockwood.bryan@...>
This is a bug I ran into today. I'm not sure who's responsible for =
[#408622] Error with JSON#parse — Love U Ruby <lists@...>
require 'json'
The same with `YAML#load`
[#408624] Why the use of a pound (#) sign with Enumerable — Ruby Student <ruby.student@...>
Team,
[#408634] How do I make lots of classes aware of each other? — "Andrew S." <lists@...>
I'm apparently missing something fundamental in my knowledge of classes
You can use send which as you would expect sends messages to an object. You
Thanks.
[#408654] Backtick probleme — xcoder Blue_fox <lists@...>
Hey guys i got a probleme with this code :
[#408662] How can I add minutes,seconds and hours to a DateTime object? — Love U Ruby <lists@...>
require 'date'
[#408668] Implementing sort/sort! — Kyle Hunter <lists@...>
Hello,
On Wed, Jul 3, 2013 at 4:39 AM, Kyle Hunter <lists@ruby-forum.com> wrote:
[#408680] Difference between Kernel#__callee__ and Kernel#__method__ — Love U Ruby <lists@...>
Is there any Difference between Kernel#__callee__
[#408684] rake drake or ? — Marc Weber <marco-oweber@...>
Is there yet another alternative to drake vs rake?
[#408701] Loading csv giving error — Nithi anand <lists@...>
hi guys I am trying to compare some data so I create one file name
[#408712] Ruby web service with REST support — "Shubhada S." <lists@...>
Hi All,
I would suggest you install the Sinatra gem, and read the
On Fri, Jul 5, 2013 at 12:03 PM, Matthew Kerwin <matthew@kerwin.net.au>wrote:
Robert Klemme wrote in post #1114499:
On Mon, Jul 8, 2013 at 7:42 AM, Shubhada S. <lists@ruby-forum.com> wrote:
I am still confused when to use phusion passenger and when to use rails?
[#408713] Ruby link grabber — xcoder Blue_fox <lists@...>
Hey guys i wanted to write a ruby code to grab all links from html code
[#408724] How do I rescue a program exception in an at_exit block? — Josh Cheek <josh.cheek@...>
I was thinking about how bad I am at reading error messages, and realized
On Fri, Jul 5, 2013 at 4:08 PM, Josh Cheek <josh.cheek@gmail.com> wrote:
[#408734] what is Vector#map2 ? — Love U Ruby <lists@...>
Hi,
[#408745] How can I make ruby read a string of characters per three characters? — Sam Thorpe <lists@...>
I want to input a string of characters, and have it be read by every
[#408757] Parslet: subtrees merged without warning? — Axel Friedrich <lists@...>
Hi,
> Or, in which cases results are lost/merged silently?
Hallo Kaspar,
> Could I easily add some extension code to get a message in this case,
> Probably
> I think, I haven't understood the "philosophy" of Parslet yet. There are
[#408778] Price lookup from sketchup to csv — Nithi anand <lists@...>
I need to perform a lookup on a CSV file.
[#408787] execute_script - selenium-webdriver — Love U Ruby <lists@...>
HTML:
[#408788] A very half-baked idea: setting local variables — Hal Fulton <rubyhacker@...>
I'm sure this nonexistent feature is not in great demand, but there have
[#408795] Well-Grounded Rubyist -- Person class implementation in chapter 4 question — Arslan Farooq <lists@...>
Hi,
[#408801] Help me to understand a Ruby file — Salvo Foru <lists@...>
Hello everyone, I'm a new to the site and I'm just starting to learn
[#408808] how to compile .so on windows — Dimmak SDI <lists@...>
Plese help me!
[#408812] create variables depending on counter — stefan heinrich <lists@...>
Hi community,
Hi Robert and Marcus,
Ok i got it. Thank you so much.
[#408819] search a string with ruby then read what comes after the string in the same line — dJD col <lists@...>
I am trying to look for a a given string in a text and once i find the
[#408842] Why can't I just subtract in a loop without restating the variable? — Wayne Brisette <wbrisett@...>
I have some code that uses a counter. In certain circumstances, I have to s=
[#408854] execute commands within SMTP email code: send content in variables and not actual variables — dJD col <lists@...>
I am trying to send an email using the code below. I am able to send the
I was able to print the values of the variables t and s
[#408894] phusion passenger + uninitialised constant+ NameError — "Shubhada S." <lists@...>
Hi,
[#408906] how to upgrade to the latest version of ruby ? — Love U Ruby <lists@...>
I am using RVM with Ubuntu13.04. Installed version of Ruby is :
[#408911] Module Confusion — "Michael W." <lists@...>
The below code works. Question though. How does add_to_stack acess the
[#408925] closing a socket while another thread is in an IO.select() call on it — Graham Menhennitt <graham@...>
Hello Rubyists,
[#408927] Ticket for eurucamp 2013 — Jens Hausherr <jabbrwcky@...>
Hi Rubyists,
[#408937] Get part of matrix — "Diego N." <lists@...>
Hi!
[#408944] Kernel.caller Performance Across Different Ruby Versions — Peter Giacomo Lombardo <lists@...>
I wrote a quick Ruby script to benchmark Kernel.caller using ruby-prof.
[#408955] Iteration anomalu — "Andrew D." <lists@...>
Surely this is a FAQ but I can't figure out how I would search for an
[#408963] Allowing a character through Addressable::URI unescaped — Joel Pearson <lists@...>
I have some code which used to work a few months ago but appears to have
[#408970] Install RVM on Solaris — "Chamila W." <lists@...>
I tried installing RVM on Solaris using command
[#408976] TryRuby Popup Problems — "Jayant S." <lists@...>
Hello there, my name is Jay. I wanted to introduce myself because I
[#408990] Hash#update - need tweaks — Love U Ruby <lists@...>
I am in a situation,where I have to the below kind of operations.
[#408994] Ruby Debugger — Alphonse 23 <lists@...>
Could anybody recommend me a good Ruby Debugger. Preferably one that
[#408995] ActiveSupport undercore behaviour — Serguei Cambour <lists@...>
I tried to use ActiveSupport 'underscore' method to convert some
tamouse m. wrote in post #1116149:
I am on the phone, but my guess is that the quotes and backslashes are
I changed as follows and it works for the first nest level for the
On Sun, Jul 21, 2013 at 7:03 AM, Serguei Cambour <lists@ruby-forum.com>wrote:
[#409008] Unsubscribe? — James Murphy <jamurphy84@...>
Hi all,
[#409031] tap { break } idiom deserves its own Kernel method? — Andy Lowry <lists@...>
I use this idiom from time to time:
On Mon, Jul 22, 2013 at 7:37 PM, Andy Lowry <lists@ruby-forum.com> wrote:
On Mon, Jul 22, 2013 at 10:37 AM, Andy Lowry <lists@ruby-forum.com> wrote:
I just used the pattern again, and this time it's a much simpler example
[#409046] Question on while loop to script — "Talal B." <lists@...>
Hi guys,
[#409047] using qsub from Ruby script produces "command not found" — Thomas Luedeke <lists@...>
I am running a script that runs multiple cases on an engineering code.
[#409052] How can we create instance method and class methods at runtime in ruby? — Love U Ruby <lists@...>
How can we create instance method and class methods at runtime in ruby?
Sorry for creating the confusions:-
[#409064] how to create structure like bellow — Expert Alart <lists@...>
Hi...
[#409072] Link To Masses Of External Data In Openoffice? — "Austin J." <lists@...>
This is what I want to do.
tamouse m. wrote in post #1116598:
tamouse m. wrote in post #1116750:
tamouse m. wrote in post #1116838:
On Sat, Jul 27, 2013 at 5:55 AM, Austin J. <lists@ruby-forum.com> wrote:
"Jes=C3=BAs Gabriel y Gal=C3=A1n" <jgabrielygalan@gmail.com> wrote in pos=
Am 27.07.2013 21:04, schrieb Austin J.:
unknown wrote in post #1116906:
Am 27.07.2013 22:12, schrieb Austin J.:
unknown wrote in post #1116910:
[#409073] class <=> module — Bráulio Bhavamitra <lists@...>
Hello all,
Am 24.07.2013 01:04, schrieb Br叩ulio Bhavamitra:
On Wed, Jul 24, 2013 at 1:10 AM, <sto.mar@web.de> wrote:
Am 24.07.2013 14:35, schrieb Josh Cheek:
[#409104] Ruby newbie question on Methods (NoMethoderror) — "Crispian A." <lists@...>
I have recently started learning ruby and so I am writing a small little
Am 25.07.2013 12:22, schrieb Crispian A.:
unknown wrote in post #1116651:
[#409119] replace words using gsub — noterrain mee <lists@...>
New to ruby! Body is a string, i am using the code directly below. I am
The k is an iterator. Let's use another example here to demonstrate:
[#409134] Learning how to create and save .rbs — Joseph Bershas <lists@...>
So I am trying to create and run an .rb, a basic stepping stone.
[#409139] How to install Ruby 2.0.0 locally - stuck — Thomas Luedeke <lists@...>
I previously installed Ruby 1.8.7 locally on my HP-UX Unix system,
[#409152] Calculate input - numbers — Marc Heiler <lists@...>
Hi
[#409161] Difference between Kernel#caller and Kernel#caller_locations — Love U Ruby <lists@...>
Hi,
[#409169] Love U Ruby — Dave Aronson <rubytalk2dave@...>
On Sat, Jul 27, 2013 at 5:13 PM, Ryan Davis <ryand-ruby@zenspider.com>
On Sun, Jul 28, 2013 at 2:26 AM, Dave Aronson <rubytalk2dave@davearonson.com
[#409170] Working through Ch.10 for learning to program 2.0 (Chris Pine) — JD JD <lists@...>
So, I have been working through this book, and have been doing ok up
I tried this and came up with a one-liner that seems to do it. It sorts the
Am 29.07.2013 16:43, schrieb Harry Kakueki:
On Tue, Jul 30, 2013 at 2:34 AM, <sto.mar@web.de> wrote:
[#409207] Losing values upon converting object to Array — Rochit Sen <lists@...>
Hi All,
[#409221] How to check an input IS an integer ? — Captain Ishido <ishido7@...>
Hi everyone !
[#409225] Question about arrays/hash — Jenn Fo <lists@...>
Hi All:
[#409234] Parsing Data from Row using Regexp — Joel Dezenzio <lists@...>
Hi All,
[#409266] Is there a good port of Ruby for Solaris 10? — Rick Carrick <lists@...>
Does anyone know of a place to DL Ruby for Solaris 10?
[#409267] Method tracker - Need assistance — Kenny Meyer <kenny@...>
I would like to write an includable method tracker, which logs about added
Re: How can I add minutes,seconds and hours to a DateTime object?
On 2013-07-02, at 3:41 PM, Love U Ruby <lists@ruby-forum.com> wrote:
> finally I came up with as below :
>=20
> require 'date'
>=20
> text_t =3D '2:12:03 PM ET'
> dt =3D DateTime.parse(text_t, '%I:%M %p %Z')
> # =3D> #<DateTime: 2013-07-03T14:12:03+00:00=20
> ((2456477j,51123s,0n),+0s,2299161j)>
> dt.to_s
> # =3D> "2013-07-03T14:12:03+00:00" # !> invalid offset is ignored
> dh =3D Date._strptime(dt.to_s,'%Y-%m-%dT%H:%M:%S%z')
> # =3D> {:year=3D>2013,
> # :mon=3D>7,
> # :mday=3D>3,
> # :hour=3D>14,
> # :min=3D>12,
> # :sec=3D>3,
> # :zone=3D>"+00:00",
> # :offset=3D>0}
>=20
> dh[:hour] +=3D 30 # =3D> 44
> dh
> # =3D> {:year=3D>2013,
> # :mon=3D>7,
> # :mday=3D>3,
> # :hour=3D>44,
> # :min=3D>12,
> # :sec=3D>3,
> # :zone=3D>"+00:00",
> # :offset=3D>0}
>=20
> dh.values[0..-2].join(" ")
> # =3D> "2013 7 3 44 12 3 +00:00"
> DateTime.ordinal(*dh.values[0..-3])
> # =3D> #<DateTime: 2013-01-07T03:44:12+00:00=20
> ((2456300j,13452s,0n),+0s,2299161j)>
>=20
> Please suggest me if any wrong calculation has been made by me? Please
>=20
> Thanks
>=20
> --=20
> Posted via http://www.ruby-forum.com/.
It does seem odd that 30 hours after 2013-07-03T14:12:03+00:00 is =
2013-01-07T03:44:12+00:00, and you do seem to be doing a lot of work to =
add 30 hours - looking a the code there is a lot of "noise".
If I look at the documentation for DateTime then I see I can use + to =
add a fractional number of days, =
http://www.ruby-doc.org/stdlib-2.0/libdoc/date/rdoc/Date.html#method-i-2B =
, so:
ratdog:tmp mike$ pry
[1] pry(main)> require 'date'
=3D> false
[2] pry(main)> dt =3D DateTime.parse('2:12:03 PM ET', '%I:%M %p %Z')
=3D> #<DateTime: 2013-07-02T14:12:03+00:00 =
((2456476j,51123s,0n),+0s,2299161j)>
[3] pry(main)> dt + (30.0 / 24) # days
=3D> #<DateTime: 2013-07-03T20:12:03+00:00 =
((2456477j,72723s,0n),+0s,2299161j)>
Hope this helps,
Mike
--=20
Mike Stok <mike@stok.ca>
http://www.stok.ca/~mike/
The "`Stok' disclaimers" apply.