how to find difference between two strings Hi, I have two strings, like @a = "hello" @b = "h123llo" so in that how can i print diffrence? i want difference like user know which diffrence on which character. Please let me know if any one know. Thanks in advance Priyank -- Posted via http://www.ruby-forum.com/. ... 31 Jul 2010 03:13
show all files from a folder How can I display the content of a folder after some time of its creation, in order to see the newly added files? Any script with File.readlines? any help? James Gray wrote: On Mar 1, 2006, at 1:43 PM, misiek wrote: I can not find nothing about files in google, how to create File.open("m... 30 Jul 2010 09:40
Swap contents in two files Shiwei Zhang wrote: Got to see this topic just now. I do agree with Tom's opinion. Shiwei http://pastie.org/1066992 -- Posted via http://www.ruby-forum.com/. ... 30 Jul 2010 09:40
Compiling Ruby through JRuby? Hi! I'm currently building a program which will be mostly standalone, and use little libraries, if at all. If I want to use the project as a library within a Java program, would it be possible to compile it through JRuby? -- Thank you for your brain. -MrZombie ... 4 Aug 2010 01:42
leak tracking x64 Have easily reproducable memory leaks, need to find them. I'm running Ruby 1.8.6 on an windows7 x64 machine. I checked out memprof, bleak_house et al. I can't find anything compatible with my architecture / ruby version and prefer not to patch VM. would it be worthwhile trying to walk the GC or is there some... 4 Aug 2010 01:42
.any?{} Behavior David A. Black wrote: As I see it, all? and any? make sense in terms of each other. If array.all? is true for a condition, that means that array.any? is false for the opposite of the condition: array.all? {|e| cond(e) } == !(array.any? {|e| !cond(e) }) I think that always holds. If [].all? w... 3 Aug 2010 18:02
binary encode 7 ([7].pack("C")) as "\007" instead of "\a" I have a problem that's on the borders of ruby and erlang, but I'm beginning to think the solution won't be from the erlang side of things. (and forgive me for my haziness with the terminology here...) The basic problem is that ruby encodes the integer 7 as "\a", while erlang only decodes it as "\007". Ruby *will... 30 Jul 2010 16:20
.all?{} and [].any?{} Behavior The docs pretty clear... If the block is not given, Ruby adds an implicit block of{|obj| obj} (that is all? <Enumerable.html#M003131> will return true only if none of the collection members are false or nil.) Its an assumption is always true unless the block tells it something different.. Assuimng Happy unle... 1 Aug 2010 08:19
[].all?{} and [].any?{} Behavior I find the following behavior interesting (so interesting that I modified it), and I would like to hear others' thoughts on the subject: [3].all? {|element| element == 3 } # => true [3].all? {|element| element != 3 } # => false (sanity checks) [].all? {|element| element == 3 } # => true [].all? {|element| ... 29 Jul 2010 18:29
Problem with a lambda not executing immediately Hi, I'm using the paperclip plugin for one of my rails app, but my problem is pure Ruby. I'm not good enough with Ruby and lambdas so I need your advice. Here is the code I am trying to make work: class Asset < ActiveRecord::Base has_attached_file :data, :styles => { :theora => [:format => :ogv, :p... 1 Aug 2010 06:12 |