Displaying 20 results from an estimated 500 matches similar to: "Create a hyphen-separated set of letters derived from a string - How to?"
2010 Mar 22
7
How to reference a select_tag within a form
Hi All,
Inside my app\views\expenses\new.html.erb file, I had the code:
<% form_for(@expense) do |f| %>
[snip]
<p>
<%= f.label :vendor %><br />
<%= f.text_field :vendor %>
<br />
<div id="vendor_droplist>
<%= select_tag "test",
options_for_select(@current_vendors.collect { |v|
v.nickname }),
{:multiple
2008 Nov 21
15
Switching the version of Rails that an app uses
Hi All,
I’ve got a few versions or Rails installed and I''d like to run an App
I’m developing with various versions of Rails. I heard of two ways to
switch the version of Rails that an app uses:
1. Use GitHub as described by http://kylecordes.com/2008/04/30/git-windows-go/
. But that requires using Bash in a Command Window and more steps
than I want to go through.
2. Alter
2010 Mar 20
4
Displaying an image in a Rails form_for
Hi,
I''ve got a public\images\DownArrow.jpg
and app\views\expenses\new.html.erb that want to present this image in
the following context:
<p>
<%= f.label :vendor %><br />
<%= f.text_field :vendor %>
<%= f.image "DownArrow.jpg" %>
<br>
<%= select_tag "test",
options_for_select(@current_vendors.collect {
2010 Jul 16
31
Added associations but don't see generated methods
Hi,
I''ve got a Rails app working that includes two two classes, etc.:
Expense & Vendor. I eventually learned that the mental concept I had
of their relationship should be express in Rails as:
class Expense < ActiveRecord::Base; belongs_to :vendor; end
class Vendor < ActiveRecord::Base; has_many :expenses; end
2009 Apr 23
2
Replace the first word of a string
Does anybody have a good starting point for how to read the first word
of a string and then, based on several defined pairs, swap it?
I''ve been considering using something like
@split = @message.split(''-'')
if @split[0] == "word"
...
elsif @split[0] == "otherword"
...
end
Even if this is the best way to do it, I''m not sure how to replace
2001 May 03
2
error when installing win97 word/excell
i installed red hat 7.0, got teh codeweavers version of wine up and
runnin, and i fire up the setup program for ms word 97, and it runs into
this error:
setup is unable to open the data file
X:\~MSSETUP.t\~msstfof.t\Word97.stf';run
setup again from were you ariginally ran it
im stumped, what should i be doing here differently...thanks
...............................
Daniel W. Schar
2004 Aug 02
4
reducing memmoves
Attached is a patch that makes window strides constant when files are
walked with a constant block size. In these cases, it completely
avoids all memmoves.
In my simple local test of rsyncing 57MB of 10 local files, memmoved
bytes went from 18MB to zero.
I haven't tested this for a big variety of file cases. I think that this
will always reduce the memmoves involved with walking a large
2020 May 19
5
[PATCHv2] SSE2/SSSE3 optimized version of get_checksum1() for x86-64
I've read up some more on the subject, and it seems the proper way to
do this with GCC is g++ and target attributes. I've refactored the
patch that way, and it indeed uses SSSE3 automatically on supporting
CPUs, regardless of the build host, so this should be ideal both for
home builders and distros.
Getting the code to build right in c++ mode (checksum_sse2.cpp only)
was a bit of an
2003 Oct 05
2
Possible security hole
Maybe security related mails should be sent elsewhere? I didn't notice
any so here it goes:
sender.c:receive_sums()
s->count = read_int(f);
..
s->sums = (struct sum_buf *)malloc(sizeof(s->sums[0])*s->count);
if (!s->sums) out_of_memory("receive_sums");
for (i=0; i < (int) s->count;i++) {
s->sums[i].sum1 = read_int(f);
2002 Mar 15
1
Weak CheckSum Question
Hi all,
I am writing a xdelta-like application as a personal experiment and am busy
implementing the rsync protocol, so far so good. I am using C++ templates and
creating the algorithms so that operate on any stream, array, etc. through
iterators.
All seems well except that I am getting a lot of false hits with the weak
checksum. When generating checksums of blocksize 1024 on the RedHat 7.1
2004 Aug 25
1
FAQs, gentoo ebuild
Hi
I''ve just done a bit of re-jig of bits of the Wiki. I''ve added a FAQ
page, suggestions welcome. I''m happy to write them up (assuming I
know/can find the answers).
Also, I''ve just been editing the Installation page. From the downloads
page, it looks like only an old version of WxRuby (0.2.0) is available
to Gentoo''s pkg mgr, but is it in fact
2020 May 18
3
[PATCH] SSE2/SSSE3 optimized version of get_checksum1() for x86-64
What do you base this on?
Per https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html :
"For the x86-32 compiler, you must use -march=cpu-type, -msse or
-msse2 switches to enable SSE extensions and make this option
effective. For the x86-64 compiler, these extensions are enabled by
default."
That reads to me like we're fine for SSE2. As stated in my comments,
SSSE3 support must be
2003 Sep 14
2
rsync error: error in rsync protocol data stream (code 12) at io.c(463)
Hi,
I'm having a problem rsyncing one file (since I signed it). It seems that
the content of a file is able to cause problems in the protocol.
building file list ...
28820 files to consider
apt/packages/avifile/
apt/packages/avifile/avifile-0.7.34-1.dag.rh90.i386.rpm
rsync: error writing 4 unbuffered bytes - exiting: Broken pipe
rsync error: error in rsync protocol data stream (code
2010 Apr 14
35
Conditionally adding a link to a form -- how?
I''ve got two entities created by scaffolding: Expense & Vendor
In Expense#new there''s a form with a Vendors-drop-down and a NewVendor-
button.
The latter button brings up Vendor#new.
The Create button in Vendor#new brings up Vendor#show with Edit & Back
links.
I want to append a third link conditionally to Vendor#show: if the
Expense#new form led to the Vendor#show
2020 May 18
6
[PATCH] SSE2/SSSE3 optimized version of get_checksum1() for x86-64
This drop-in patch increases the performance of the get_checksum1()
function on x86-64.
On the target slow CPU performance of the function increased by nearly
50% in the x86-64 default SSE2 mode, and by nearly 100% if the
compiler was told to enable SSSE3 support. The increase was over 200%
on the fastest CPU tested in SSSE3 mode.
Transfer time improvement with large files existing on both ends
2008 Aug 22
2
How to find/open Spec::Expectations and Spec::Matchers
Hi,
Then RSpec 1.4 recommends, in the webpage http://rspec.info/documentation/expectations.html,
referencing the subject items.
I''m running ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] over
WinXP-Pro/SP2.
I believe I installed RSpec with a Ruby gem. At least, I think that''s
confirmed because I have a lot of stuff in the directory K:\_Utilities
2010 Apr 03
2
Specifying a decimal field precision/scale with scaffold requires 2 steps?
Hi,
It appears to me that the command:
ruby script/generate scaffold whatever money_field:decimal(10,2)
will not generate a valid migration.
Therefore it appears to me only two ways to achieve the desired result
is:
1.1 Omit the the precision/scale on the scaffold command
1.2 Edit the migration file by following the "do |t| ... end" with
the command:
change_column :whatever
2022 Apr 15
4
Rsync 3.2.4 released
I have released rsync 3.2.4. Another typical release with both bug fixes
and some enhancements. It also contains a security fix for the bundled zlib
1.2.8, which may or may not be used in your particular build configuration.
To see a summary of all the recent changes, visit this link:
https://rsync.samba.org/ftp/rsync/NEWS#3.2.4
You can download the source tar file and its signature from
2022 Apr 15
4
Rsync 3.2.4 released
I have released rsync 3.2.4. Another typical release with both bug fixes
and some enhancements. It also contains a security fix for the bundled zlib
1.2.8, which may or may not be used in your particular build configuration.
To see a summary of all the recent changes, visit this link:
https://rsync.samba.org/ftp/rsync/NEWS#3.2.4
You can download the source tar file and its signature from
2002 Aug 05
5
[patch] read-devices
Greetings,
I'd like to propose a new option to rsync, which causes it to read
device files as if they were regular files. This includes pipes,
character devices and block devices (I'm not sure about sockets). The
main motivation is cases where you need to synchronize a large amount of
data that is not available as regular files, as in the following scenarios:
* Keep a copy of a block