Displaying 20 results from an estimated 2000 matches similar to: "share an hash .."
2006 Jul 27
2
accessing a variable inside a plugin
Hello,
I would like to load an Hash in my init.rb plugin file ... than I would
like to use this hash in my module ...
in my init.rb:
@anHash = load From file...
in mymodule:
module Amodule
def myFunction
#@anHash ....
end
end
How can I access to my hash in my plugin module function ?
thanks for this dummy question ;-)
Arnaud
2004 Feb 27
1
Samba3 with W2K Native Mode
Hi.
I use Samba 3.0.2-29 on Server S7.
In our network is a W2K Server named S4 running in Native Mode, Domain Name
hel.lan.
I tried to join the S4-Domain hel.lan.
s7:~ # kinit Administrator@HEL.LAN
Administrator@HEL.LAN's Password:
s7:~ # net ads join
[2004/02/27 08:20:54, 0] libads/ldap.c:ads_add_machine_acct(1006)
Host account for s7 already exists - modifying old account
Using short
2006 May 05
1
Sorting a hash
Quick Prototype.js hash question.
Given:
MyHash = {"Alpha" : {name:"Foo",val:3},
"Delta" : {name:"Bar",val:2},
"Beta" : {name:"Baz",val:4} }
I want to display this set ordered by key - Alpha,Beta,Delta and by
val - 2,3,4
Prototype.js helps with the hash:
$H(MyHash).keys().sort() will give me Alpha, Beta, Delta
but I''ve not
2011 Feb 27
10
How to store the same key multi times in a Hash ?
given an Arra tags[]
I need to produce a resulting Hash as following ..
{ "$in" => [tags[0]], "$in" =>[tags[1], ...}
in which the key should be always the same and the value being an
Array
I tried this :
myHash = {}
tags.each do |tag|
h = {"$in" => [tag]}
myHash.merge!(h)
end
but the merge! is only
2010 May 30
4
Data Frame as Hash Table
I'm interested in using a data frame as if it were a hash table. For
instance if I had the following,
> (d <- data.frame(key=seq(0.5, 3, 0.5), value=rnorm(6)))
key value
1 0.5 -1.118665122
2 1.0 0.465122921
3 1.5 -0.529239211
4 2.0 -0.147324638
5 2.5 -1.531503795
6 3.0 -0.002720434
Then I'd like to be able to quickly retrieve the "value" of "key" 1.5
2006 Apr 09
1
http request, hash table
Hello,
My problem is that I cannot figure out how to format data in the http
post request
using external C++ application, so then I could write in my controller:
@myHash = params[:person]
print ''Name: '', @myHash[:name]
or
@name = params[:person][:name]
Thanks in advance!
--
Jakub P. Nowak
2006 Jul 10
11
prototype hash method
var v1 = {
a: ''value for a'',
b:''value for b''
}
var v2 = {
c: ''value for c'',
d: function(){some code...}
};
var v3 = v2.merge(v1);
I''m getting an error doing this...
what is wrong?
2006 Jan 24
2
collect array values
This may be more of a Ruby question, but I wasn''t sure.
Is there a way to run a find on a model and then save two fields as
key => value in an array for each row. Then use this array on the
template for checking if various checkbox or select values are
checked? I''m trying to avoid running one query to check the value for
each box in the form.
- Kyle
2023 Mar 18
2
Custom SASL authentication
An HTML attachment was scrubbed...
URL: <https://dovecot.org/pipermail/dovecot/attachments/20230318/8ce3c29a/attachment-0001.htm>
2006 Apr 19
2
how to pass a hash as a parameter in link_to_remote
When using link_to_remote, I''d like to pass along some auxiliary data in
the request. It''s a hash of dynamic data that can change with each
request.
But I get an error when rails trying to "stringify" the hash.
For the regular link_to, it works because it turns the hash into a
regular GET-like query string.
I''m expecting to be able to get my hash as
2013 Apr 02
2
How to remove all characters after comma in R
I have the following list of strings:
x <- c("foo, foo2, foo3", "bar", "qux, qux1")
what I want to do is to obtain
foo, bar qux
Namely for each element in the vector obtain only string
before the first comma.
What's the way to do it?
- G.V.
[[alternative HTML version deleted]]
2008 Sep 09
3
Splitting Data Frame into Two Based on Source Array
Dear all,
Suppose I have this data frame:
> data_main
V1 V2
foo 13.1
bar 12.0
qux 10.4
cho 20.33
pox 8.21
And I want to split the data into two parts
first part are the one contain in the source array:
> src
[1] "bar" "pox"
and the other one the complement.
In the end we hope to get this two dataframes:
> data_child1
V1 V2
bar 13.1
pox
2004 Mar 19
0
RES: Samba3 with W2K Native Mode
Have you locked at samba-3.0.2a/source/nsswitch directory ? Normally the pam
modules and nss libs are there, you need manually copy that to /lib/security
(Debian system. maybe different in your distribution)
Also remember to run ldconfig after copy the files to the lib directory.
Make sure that you /etc/pam.d/login is, some like that:
passwd: winbind files
shadow: files
group:
2006 Aug 16
7
Forward of moderated message
OK I know whats happening. Your while loop completes and calls kill
on the worker before your task_progress controller method ever gets
called> So the worker is deleted and when you try to access it from
rails you get an error because there is no longer a worker at that
job key. The kill method is meant to be used within a worker that you
fire and forget. If you want to get the
2009 Jan 08
2
Faster Printing Alternatives to 'cat'
Dear all,
I found that printing with 'cat' is very slow.
For example in my machine this snippet
__BEGIN__
# I need to resolve to use this type of loop.
# because using write(), I need to create a matrix which
# consumes so much memory. Note that "foo, bar, qux" object
# is already very large (>2Gb)
for ( s in 1:length(x) ) {
2010 Aug 13
2
Rails 3 / ActiveModel for Credit Card information?
When submitting billing information in the past I''ve always used
attr_accessor for credit card details as they should not be saved in
the database. In addition I always end up storing the card
expiration date so that the date form helper works correctly.
With Active Model it seems logical to create a CreditCard class to
hold this data instead.
**1st issue.**
It seems there still
2012 Sep 25
3
Proposal for a new ActiveModel::Errors structure
There are few issues with the current ActiveModel::Errors class.
Firstly, when an error is added to ActiveModel::Errors class via #add
method
(https://github.com/rails/rails/blob/master/activemodel/lib/active_model/errors.rb#L294)
its translation is added. It should not be translated when being added, but
only when being read.
The second issue is a bit bigger. We''d like to create
2013 May 22
2
Creating nested hash from nested active record results
Hello,
I''m trying to find a very abstract and "one size fits all" for
converting nested active record results to nested hashes. It''s easy,
to do one level deep as such:
[code]
results_to_hash = Hash[ found_categories.map{ |c| [c.id, c.title]}]
[/code]
But, when I try to add another collection to the mix, it completely
borks and the results_to_hash only returns an
2012 Jan 18
7
[LLVMdev] [RFC] Module Flags Metadata
Hello,
This is a proposal for implementing "module flags". Please take a look at this and give any feedback you may have.
Thanks!
-bw
Module Flags Metadata
Information about the module as a whole is difficult to convey to LLVM's
subsystems. The LLVM IR isn't sufficient to transmit this information. One
should instead use the llvm.module.flags named
2010 Nov 03
1
Recoding -- test whether number begins with a certain number
Dear R community,
I have a question concerning recoding of a variable. I have a data set
in which there is a variable devoted to the ISCO code describing the
occupation of this certain individual
(http://www.ilo.org/public/english/bureau/stat/isco/isco88/major.htm).
Every type of occupation begins with a number and every number added to
this number describes th occupation more detailed.
Now my