Displaying 17 results from an estimated 17 matches for "myhashes".
Did you mean:
hashes
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
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
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 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>
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
2016 Dec 01
0
clang error: static_assert failed "Cache the hash code or make functors involved in hash code and bucket index computation default constructible"
Hi,
Consider below test case:
1 #include <unordered_map>
2
3 using key=const int;
4 struct Myhash {
5 Myhash() = default;
6 std::hash<int> hash_int_t;
7 inline size_t operator()(const key& x) const throw() {
8 return hash_int_t(x);
9 }
10 };
11
2006 Jun 18
4
share an hash ..
Hello,
How to share an Hash between all objects (model, controller ect ...)
=> I did a static Hash in my model where a static method fill it
basically, this is the code
class Person < ActiveModel
@@anHash.new
def Person.anHelperMethod(aKey)
if anHash.size==0
... load the hash, some SQL to fill the Hash
end
return anHash[aKey]
end
=> The problem,: it always
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 Feb 16
0
RE: Applying list-item format depending on action (Diego Scataglini)
Seth,
It really depends how often you do that check.
If it happens only once or twice in your whole application, that''s just
fine.
If it happens more than that and in multiple controllers/views then maybe
you want to create a helper for it.
Something like this: (didn''t test it, but should be working)
module ApplicationHelper
def current_id_select(controller, action)
(
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
2023 Mar 17
1
Custom SASL authentication
Hello,
I'm looking for a good way to apply a custom hash to passwords.? My hope
is to add passwords to a (MySQL) database: INSERT INTO users
(user='joblo', pass=MYHASH('plain-password')..
For SASL authentication, my thought first was to apply the same hash to
the issued password and compare it with the hashed password in the
database.? I soon discovered the sql driver
2010 Jul 12
13
ANNOUNCE: Puppet 2.6.0 - Release Candidate 2 available!
Welcome back again to the Puppet release cycle with the long-awaited
eleventy times better RC2 release.
The 2.6.0 release is a major feature release and includes a huge variety
of new features, fixes, updates and enhancements. These include the
complete cut-over from XMLRPC to the REST API, numerous language
enhancements, a complete rewrite of the events and reporting system, an
internal Ruby
2005 Oct 14
7
validates_confirmation_of not working
Hello, I''m having a weird problem in my user model. For the
change_password method I have the following:
def change_password(oldpass, newpass, confirmation)
oldpass = self.class.myhash(oldpass)
reload
passhash = self.password
self.password = newpass
self.password_confirmation = confirmation
if valid? and oldpass == passhash
save!
else
# valid?
2006 Jul 27
16
Net::LDAP 0.0.3 released, adds TLS encryption
We''re pleased to announce version 0.0.3 of Net::LDAP, the first
pure-Ruby LDAP library. Net::LDAP intends to be a feature-complete
LDAP client which can access as much as possible of the functionality
of the most-used LDAP server implementations. This library does
not wrap any existing native-code LDAP libraries, creates no
Ruby extensions, and has no dependencies external to Ruby.
2005 Dec 16
10
Associative arrays
I just started playing with rails this week and am working on porting our
existing website to rails
in our navigation we have a list that has the days of the week that link to
the articles for those days.
this seems to be working when I had it in the template it would give me the
array I was looking for so I decided to move it to the helper so that I
could use it on all my templates.
2007 Oct 26
14
''Considered Harmful'' Considered Harmful
Because here in Puppet-land we''re all about self-reference and
recursion, and because I actually have to give a talk at RubyConf
next weekend about abusing self-reference, and because parent nodes
aren''t considered harmful in my own world, I give you:
http://www.codinghorror.com/blog/archives/000982.html
I think it manages to somehow be both on- and off-topic at the same