search for: map2

Displaying 20 results from an estimated 37 matches for "map2".

Did you mean: map
2019 Mar 20
2
New extents structure proposal
I think the extents map is just too complicated and is unnecessarily so. How about instead we define the plugin interface to be: int can_extents (void *handle); // as before int extents (void *handle, uint32_t count, uint64_t offset, uint32_t flags, struct nbdkit_extents_list *list); and have the extents_list be a simple list. The first extent you add must start at offset.
2019 Mar 19
0
[PATCH nbdkit 5/9] offset: Implement mapping of extents.
..., offs, length, type); +} + +static int +offset_extents (struct nbdkit_next_ops *next_ops, void *nxdata, + void *handle, uint32_t count, uint64_t offs, uint32_t flags, + struct nbdkit_extents_map *extents_map, + int *err) +{ + struct nbdkit_extents_map *map2; + + map2 = nbdkit_extents_new (); + if (map2 == NULL) + return -1; + if (next_ops->extents (nxdata, count, offs + offset, + flags, map2, err) == -1) { + nbdkit_extents_free (map2); + return -1; + } + + /* Transform offsets in map2, return result in extents_...
2019 Mar 20
0
Re: New extents structure proposal
...bility of random-access extent probing rather than linear is over-engineered). I like the idea. I'm trying to figure out if filters would still need a foreach visitor. But my initial guess is no. Consider - the earlier proposal required the offset filter to do: + struct nbdkit_extents_map *map2; + + map2 = nbdkit_extents_new (); + if (map2 == NULL) + return -1; + if (next_ops->extents (nxdata, count, offs + offset, + flags, map2, err) == -1) { + nbdkit_extents_free (map2); + return -1; + } + + /* Transform offsets in map2, return result in extents_...
2006 Oct 06
13
Need some help with latest win32-mmap
...data. Below is a simple example that seems like it ought to work but doesn''t. Any ideas? # map1.rb require ''win32/mmap'' include Win32 mmap = MMap.new(:name => ''alpha'', :size => 20) p mmap.address mmap.test = "hello" mmap.close # map2.rb # mmap = MMap.open(''alpha'') # Boom! mmap = MMap.new(:name => ''alpha'', :size => 20) # Ok so far... p mmap.test # Boom! mmap.close I tried using MMap.open and MMap.new. Neither seems to work as expected. What am I doing wrong? Thanks, Dan PS - The...
2019 Mar 20
2
Re: New extents structure proposal
...ather than linear is over-engineered). > > I like the idea. > > I'm trying to figure out if filters would still need a foreach visitor. > But my initial guess is no. Consider - the earlier proposal required > the offset filter to do: > > + struct nbdkit_extents_map *map2; > + > + map2 = nbdkit_extents_new (); > + if (map2 == NULL) > + return -1; > + if (next_ops->extents (nxdata, count, offs + offset, > + flags, map2, err) == -1) { > + nbdkit_extents_free (map2); > + return -1; > + } > + > +...
2011 May 18
1
Overlaying maps
I'm having difficulty overlaying maps when writing to a file graphics device. My command sequence has the structure plot(map1) par(new = T) plot(map2) On the screen device, it works fine. When I attempt something like png(file = "map.png") plot(map1) par(new = T) plot(map2) dev.off() only the last map appears, the previous ones having been cleared. Can someone clarify? Thanks, Michael Laviolette PhD MPH New Hampshire Department of...
2012 Jan 27
1
Overimposing one map in ssplot onto another
Hello! I have 2 maps - both created in ssplot and both identical in terms of outline. Is there any way to superimpose Map1 (which has black borders between Canadian provinces) onto Map2 (which is also a map of Canada)? Thanks a lot for your hints! Dimitri ### A. Reading in Canada data at the province and then at the county level: library(raster) getData('ISO3') # Canada's code is "CAN" can1<-getData('GADM', country="CAN", level=1) can2&...
2012 May 31
1
Repost: Expressions returned by GlobalEnv functions and package functions
...tion(.index,k,r){ .(CO) },1:length(map.values),map.keys,map.values) .(AF) },list(CO=co,BE=before,AF=after))) class(j) <- c(class(j),"rhmr-map") j } but the following two are different, map <- ewrap({ len <- length(r$addon) rhcollect(len,1) }) and map2 <- rhwrap({ len <- length(r$addon) rhcollect(len,1) }) (because serialize(map,NULL) != serialize(map2,NULL)) I guess this is because both functions(ewrap and rhwrap) return an environment in which they are defined and in the case of rhwrap this is the Rhipe package namespace/envir...
2009 Apr 06
1
political maps world maps in R, wrld_simpl
....all for (i in 1:length(country2)){ col.map[grep(country2[i],country.all)] = runif(1) # assign a random score to country i } # it certainly exists a cleaner coding for this but it's not my first thought now c2 = col.map!=0 # set countries with score != 0 is not listed in country2 col.map2=col.map col.map2[!c2]=rgb(.95,.96,.97) # be grey the countries not listed in country2 object col.map2[c2]= rgb(patramp(col.map[c2])/255) # ramp the remaining plot(wrld_simpl,col=col.map2,axes=T) # nice plot ### end of program ######################################################### Now what i...
2019 Mar 12
2
Re: [PATCH nbdkit] server: Implement extents/can_extents calls for plugins and filters.
...o transform the extents map received > +back from the layer below. Usually this must be done by allocating a > +new map which is passed to the layer below. Without error handling it > +would look like this: > + > + myfilter_extents (...) > + { > + struct nbdkit_extents_map *map2 = nbdkit_extents_new (); > + next_ops->extents (nxdata, count, offset, flags, map2, err); > + /* transform map2 and return results in extents_map */ > + nbdkit_extents_foreach (map2, transform_offset, extents_map); > + nbdkit_extents_free (map2); > + } And the fact that w...
2019 Mar 12
0
Re: [PATCH nbdkit] server: Implement extents/can_extents calls for plugins and filters.
...d > > +back from the layer below. Usually this must be done by allocating a > > +new map which is passed to the layer below. Without error handling it > > +would look like this: > > + > > + myfilter_extents (...) > > + { > > + struct nbdkit_extents_map *map2 = nbdkit_extents_new (); > > + next_ops->extents (nxdata, count, offset, flags, map2, err); > > + /* transform map2 and return results in extents_map */ > > + nbdkit_extents_foreach (map2, transform_offset, extents_map); > > + nbdkit_extents_free (map2); > >...
2019 Mar 12
2
[PATCH nbdkit] server: Implement extents/can_extents calls for plugins and filters.
Second version based on nbdkit_extent* calls, as discussed here: https://www.redhat.com/archives/libguestfs/2019-March/msg00033.html Note in particular there is some subtlety about how filters would work in this implementation. See docs/nbdkit-filter.pod for the details. Rich.
2009 May 11
1
Building US maps in R
Hi, I'm trying to build some maps of the US by county that will have the following characteristics: Feature/Map Map 1 Map2 Both Broken out by county Yes Yes Yes Heatmaps of US Census Data for income by county Yes No Yes Heatmaps of US Census Data for race by county (recoded as white and &non-white, with each county color coded based on the majority) No Yes No Polygon markers showing the coordinates of a...
2012 May 31
0
Expressions returned by a Package function
...tion(.index,k,r){ .(CO) },1:length(map.values),map.keys,map.values) .(AF) },list(CO=co,BE=before,AF=after))) class(j) <- c(class(j),"rhmr-map") j } but the following two are different, map <- ewrap({ len <- length(r$addon) rhcollect(len,1) }) and map2 <- rhwrap({ len <- length(r$addon) rhcollect(len,1) }) (because serialize(map,NULL) != serialize(map2,NULL)) I guess this is because both functions(ewrap and rhwrap) return an environment in which they are defined and in the case of rhwrap this is the Rhipe package namespace/envir...
2019 Mar 19
15
[PATCH nbdkit 0/9] [mainly for discussion and early review] Implement extents.
I want to post this but mainly for discussion and early review. It's not safe for these patches to all go upstream yet (because not all filters have been checked/adjusted), but if any patches were to go upstream then probably 1 & 2 only are safe. File, VDDK, memory and data plugins all work, although I have only done minimal testing on them. The current tests, such as they are, all
2020 Oct 04
0
how to get a numeric vector?
...results = c() for (index in 1:length(a)) { results <- c(results, a[index]:b[index]) } The above generalizes to any size vectors of the same length. There are probably lots of ways to do this using functional programming (after loading the tidyverse or just purrr) but here is one: unlist( map2(a, b, `:`) ) Or more explicitly in an extended length-4 vector example: Library(purr) alpha <- c(1, 4, 10, 20) beta <- c(5, 8, 19, 27) unlist(map2(.x=alpha, .y=beta, .f=`:`)) Result: [1] 1 2 3 4 5 4 5 6 7 8 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24...
2006 Oct 13
2
win32-mmap - trying to marshal self
...work. For the getter in method_missing I simply did: marshal = Marshal.dump(self) For the getter in method_missing I did: obj = memcpy(buf, @address, @size) val = object.send(obj.to_sym) instance_variable_set("@#{method}", Marshal.load(val)) But when I run the map1.rb and map2.rb scripts again, I get errors (and beeping!) with odd characters no less: C:/Documents and Settings/djberge/workspace/win32-mmap/lib/win32/mmap.rb:334:in `send'': undefined method o:?Win32::MMap? @inheriti'' for nil:NilClass (NoMethodError) from C:/Documents and Settings/d...
2017 Aug 04
1
Restructuring Star Wars data from rwars package
I'm having trouble restructuring data from the rwars package into a dataframe. Can someone help me? Here's what I have... library("rwars") library("tidyverse") # These data are json, so they load into R as a list people <- get_all_people(parse_result = T) people <- get_all_people(getElement(people, "next"), parse_result = T) # Look at Anakin
2019 Mar 12
0
[PATCH nbdkit] server: Implement extents/can_extents calls for plugins and filters.
...+It is also possible for filters to transform the extents map received +back from the layer below. Usually this must be done by allocating a +new map which is passed to the layer below. Without error handling it +would look like this: + + myfilter_extents (...) + { + struct nbdkit_extents_map *map2 = nbdkit_extents_new (); + next_ops->extents (nxdata, count, offset, flags, map2, err); + /* transform map2 and return results in extents_map */ + nbdkit_extents_foreach (map2, transform_offset, extents_map); + nbdkit_extents_free (map2); + } + +If there is an error, C<.extents> sh...
2020 Oct 04
3
how to get a numeric vector?
Hi, a <- c(1, 4) b <- c(5, 8) a:b [1] 1 2 3 4 5 Warning messages: 1: In a:b : numerical expression has 2 elements: only the first used 2: In a:b : numerical expression has 2 elements: only the first used how to get: c(1:5, 4:8) Thanks.