Displaying 20 results from an estimated 50 matches for "hashmap".
Did you mean:
hash_map
2009 May 25
2
Looping through java hashmap from ruby through rjb
Greetings.
I am trying to list all keys in a java.util.HashMap field.
The Java code to do this looks like:
#
Collection c = hMap.values();
#
#
//obtain an Iterator for Collection
#
Iterator itr = c.iterator();
#
#
//iterate through HashMap values iterator
#
while(itr.hasNext())
System.out.println(itr.next());
So, I took a stab at the ruby version:
# I...
2007 Dec 06
1
error during template parsing (??)
...e clients.
during "puppetd --server=puppetmaster.example.com --verbose" I get the
following error which says nothing to me:
err: Could not retrieve configuration: Uncaught exception compile error
(erb):241: syntax error, unexpected tIDENTIFIER, expecting $end
HashMap map =
(HashMap)session.getAttribute("map");
^ in method
puppetmaster.getconfig
warning: Could not get config; using cached copy
has anyone had this error?
I use puppet in version 0.20.1-1 on debian sarge.
Yours,
Phillip
-----BE...
2005 Jul 08
8
Integrating script.aculo.us into existing javascript codebase
Hi,
I''m new to this mailing list, so first off, a big THANK YOU for the
script.aculo.us and prototype.js libraries.
I''m trying to integrate script.aculo.us into an existing pretty large
Javascript codebase (see http://openrecord.org). I''m running into a
problem with prototype.js and the existing codebase''s use of for/in
loops over an Array.
2019 Aug 05
0
[PATCH 1/2] Rust bindings: Add Event structs, Clarify Handle lifetime
...el_case_types)]
#[repr(C)]
@@ -34,31 +37,37 @@ extern "C" {
const GUESTFS_CREATE_NO_ENVIRONMENT: i64 = 1;
const GUESTFS_CREATE_NO_CLOSE_ON_EXIT: i64 = 2;
-pub struct Handle {
+pub struct Handle<'a> {
pub(crate) g: *mut guestfs_h,
+ pub(crate) callbacks: collections::HashMap<
+ event::EventHandle,
+ Box<Box<dyn Fn(guestfs::Event, event::EventHandle, &[u8], &[u64]) + 'a>>,
+ >,
}
-impl Handle {
- pub fn create() -> Result<Handle, error::Error> {
+impl<'a> Handle<'a> {
+ pub fn create()...
2019 Jun 27
0
Re: [PATCH 08/11] Rust bindings: Fix memory management and format the file
...());
+ w.push(ffi::CString::new(y)?);
+ }
+ Ok(w)
+}
+
+fn free_string_list(l: *const *const c_char) {
+ for buf in NullTerminatedIter::new(l) {
+ unsafe { free(buf as * const c_void) };
}
- w.push(ptr::null());
- w
+ unsafe { free(l as *const c_void) };
}
-fn hashmap (l: *const *const c_char) -> collections::HashMap<String, String> {
+fn hashmap(l: *const *const c_char) -> Result<collections::HashMap<String, String>, Error> {
let mut map = collections::HashMap::new();
let mut iter = NullTerminatedIter::new(l);
while let So...
2005 Jun 02
2
Dynamic Dictionary Data Type?
Hello!
I have an algorithm which performs lengthy operations and I would like to
cache results. Other languages usually offer a dictionary data type
which I can use as an efficient way to dynamically cache already
calculated results - what's the best way to do this in R?
Best wishes,
Sven C. Koehler
2019 Jun 27
0
[PATCH 7/9] Rust bindings: Complete actions
...et(1) };
+ Some(r)
+ }
+ }
+}
+
fn arg_string_list (v: &Vec<String>) -> Vec<*const i8> {
let length = v.len();
let mut w = Vec::new();
@@ -144,10 +170,48 @@ fn arg_string_list (v: &Vec<String>) -> Vec<*const i8> {
w
}
+fn hashmap (l: *const *const c_char) -> collections::HashMap<String, String> {
+ let mut map = collections::HashMap::new();
+ let mut iter = NullTerminatedIter::new(l);
+ while let Some(key) = iter.next() {
+ if let Some(val) = iter.next() {
+ let key = unsafe { ffi::CStr::...
2017 Jul 20
2
Which assumptions do llvm.memcpy/memmove/memset.* make when the count is 0?
...than the given alignment?
The actual operation will of course not do anything, but I am worried
about some analysis seeing a pointer being used as an argument to one of
these intrinsics, and then assuming the pointer is valid and aligned
without proving that the count is > 0.
E.g., Rust's HashMap indirectly calls memset(0x0, 0, 0, ..., false).
Vec calls memcpy(..., 0x1, 0, 4, false). Is that a problem?
Kind regards,
Ralf
PS: I'm not on the list, so please keep me in Cc.
2019 Jun 27
4
Re: [PATCH 9/9] Rust bindings: Complete bindings
Patch 9 is a kind of dumping ground of all kinds of stuff. It may be
better to spend some time with git rebase -i trying to work this into
more coherent patches.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines. Boot with a
live
2019 Jun 27
16
[PATCH 1/9] Rust bindings: Add Rust bindings
From: Hiroyuki_Katsura <hiroyuki.katsura.0513@gmail.com>
---
Makefile.am | 4 ++++
configure.ac | 3 +++
generator/Makefile.am | 3 +++
generator/bindtests.ml | 3 +++
generator/bindtests.mli | 1 +
generator/main.ml | 5 +++++
generator/rust.ml | 34 ++++++++++++++++++++++++++++++++++
generator/rust.mli | 19 +++++++++++++++++++
2019 Jun 27
0
[PATCH 9/9] Rust bindings: Complete bindings
...));
+ w.push(ffi::CString::new(y)?);
+ }
+ Ok(w)
+}
+
+fn free_string_list(l: *const *const c_char) {
+ for buf in NullTerminatedIter::new(l) {
+ unsafe { free(buf as * const c_void) };
}
- w.push(ptr::null());
- w
+ unsafe { free(l as *const c_void) };
}
-fn hashmap (l: *const *const c_char) -> collections::HashMap<String, String> {
+fn hashmap(l: *const *const c_char) -> Result<collections::HashMap<String, String>, Error> {
let mut map = collections::HashMap::new();
let mut iter = NullTerminatedIter::new(l);
while let So...
2016 Aug 15
2
KMeans - Evaluation Results
...lusters end up
being more compact.
I'm continuing to optimize this solution in time before I can go ahead with
PSO.
With respect to optimization, I'm currently using unordered_map where ever
I'm requiring to map values. It certainly works faster than the std::map
but there are various hashmap implementations that can work faster. Google
dense hash map is one of those and they work way faster than unordered_map
(to my knowledge). I thought of using them to speed value look ups, but
would it affect the portability of the code? Or will it be possible for me
to use it?
I would like to know...
2019 Jul 02
16
[PATCH] Add Rust bindings
I fixed the patch I submitted before based on comments, and there are some
commits which are merged or divided. So, I will re-send all the patches.
Regards,
Hiroyuki Katsura
2009 Oct 13
0
[LLVMdev] hash extras
So, after digging around in the old llvm/ADT/hash_map, I think I
discovered the problem. Now, if you want to include
llvm/ADT/HashExtras.h, you have to include the hash_map h file from your
system (ext/hash_map in my case) and define HASH_NAMESPACE, before you
include llvm/ADT/HashExtras. It might be good to include some
documentation about that for those using HashExtras.
Regards,
Ryan
2018 Jun 15
0
CRAN Check warnings with GCC 8.1
...SPManalysis
> PropClust RArcInfo RandomFields RandomFieldsUtils RcppMsgPack
> RcppParallel RcppRedis RecordLinkage Rmalschains RnavGraph Rvcg
> RxODE SiMRiv antiword bigrquery bsamGP catnet coxme dbarts
> dggridR divest dpglasso earth epanet2toolkit fs gap geojsonsf
> gglasso graphql hashmap haven hier.part imager iptools jiebaR
> kernlab lpridge lvec mlvocab mongolite nandb ore phreeqc polyclip
> qtbase rbamtools rebmix rexpokit rgdal rioja rlas rpf rphast
> rtfbs s2 scio sdnet sdwd sequoia tmlenet tth udpipe validatejsonr
> velox wrassp
>
> GCC 8.1 (the current rele...
2007 Jan 13
1
[LLVMdev] Value* as used by the non-JITted interpreter
...with the lli code and extended it
considerably. I have retained something that looks vaguely like the
original ExecutionContext stack, though I now have one stack per thread,
and the whole data structure is implemented with custom collection
classes that support versioning and rollback. I use a hashmap (analogous
to std::map semantically) to map Value* pointers onto GenericValue
objects, as per the original code. This seems to work fine nearly all of
the time, but occasionally I'm seeing the memory pointed to by the
Value* objects go away, and lookups fail (probably due to the same
mecha...
2009 Oct 13
2
[LLVMdev] hash extras
I am trying to upgrade my code to use the latest version of llvm from
svn. Whenever I include "llvm/ADT/HashExtras.h", I get error messages
like the following. Does anyone know what is going on? Thanks for any
help.
llvm[1]: Compiling Aux.cpp for Debug build (PIC)
In file included from
/home/lefever/work/memrep/src/compiler/include/Aux.h:4,
from Aux.cpp:1:
2009 Mar 12
0
[LLVMdev] a different hash for APInts
...and the bucket selection is done by h%64 or
h%(1<<n) so only the low bits are taken into acount. on your exemple
since all the low bits are zero, you have a lot of collision.
Instead of changing the hash, changing the number of bucket would be a
better/simpler solution. From what I know of hashmap, having a number of
bucket equal to a power of two is uterly stupid, ie: it mean that you
only use the lower part of the hash. So why compute a hash on 32bits
then... The only reason to do this is for faster modulo, but here it is
not the case has the bucket number is a variable. Usually, prime...
2019 Aug 05
3
Re: [PATCH] Rust bindings: Implement Event features
I fixed based on comments.
I'll send these two patches to this mailing list.
- Fix Handle -> Handle<'a>
- Add events
Regards,
Hiroyuki
2019年8月1日(木) 0:01 Pino Toscano <ptoscano@redhat.com>:
> Hi Hiroyuki,
>
> On Tuesday, 30 July 2019 07:51:37 CEST Hiroyuki Katsura wrote:
> > This patch includes:
> >
> > - Event callback handlers
> > -
2019 Jun 27
0
[PATCH 6/9] Rust bindings: Add generator of function signatures
...ec<String>"
+ | RStruct (_, sn) ->
+ let sn = camel_name_of_struct sn in
+ pr "%s" sn
+ | RStructList (_, sn) ->
+ let sn = camel_name_of_struct sn in
+ pr "Vec<%s>" sn
+ | RHashtable _ -> pr "collections::HashMap<String, String>"
+ | RBufferOut _ -> pr "Vec<u8>");
+ pr ", Error> {\n";
+
+ let _pr = pr in
+ let pr fs = indent 2; pr fs in
+ List.iter (
+ function
+ | Bool n ->
+ pr "let c_%s = if %s { 1 } else {...