vector Questions

6

Solved

I'm doing some physics simulations which of course involve vectors. This has become very difficult for me because to the best of my knowledge javascript doesn't support anything like this... #with...
Approach asked 21/8, 2011 at 1:54

3

Solved

I have data that looks like this: vector = c("hello I like to code hello","Coding is fun", "fun fun fun") I want to remove duplicate words (space delimited) i.e. the output should look like vec...
Bituminous asked 19/1, 2015 at 20:55

9

Solved

What are the benefit of using reserve when dealing with vectors. When should I use it? I couldn't find a clear cut answer on this but I assume it is faster when you reserve in advance before using ...
Georg asked 29/6, 2011 at 18:46

3

I've been searching the web for tutorials or methods on how to to implement my own point to point navigation system for an SVG-based indoor floor plan map. I have searched the web but the only opti...
Economically asked 18/3, 2015 at 18:44

12

Suppose I have a vector that is nested in a dataframe with one or two levels. Is there a quick and dirty way to access the last value, without using the length() function? Something ala PERL's $# s...
Labiovelar asked 16/9, 2008 at 21:40

6

Solved

I have a templated class that has a data member of type std::vector<T>, where T is also a parameter of my templated class. In my template class I have quite some logic that does this: T &am...
Dendriform asked 17/1, 2013 at 17:37

13

Solved

Is it possible to iterate a vector from the end to the beginning? for (vector<my_class>::iterator i = my_vector.end(); i != my_vector.begin(); /* ?! */ ) { } Or is that only possible with s...
Coyote asked 31/8, 2010 at 16:8

4

Solved

In order to understand the memory consumption of std::vector<int> I wrote: std::cout << sizeof(std::vector<int>) << std::endl; This yields 32. I tried to understand where...
Printable asked 27/11, 2017 at 9:31

2

Solved

I need to get the top N items from a Vec which is quite large in production. Currently I do it like this inefficient way: let mut v = vec![6, 4, 3, 7, 2, 1, 5]; v.sort_unstable(); v = v[0..3].to_v...
Lithographer asked 3/12, 2018 at 14:24

2

Solved

I am trying to get the features from my vector layer. The vector layer is composed from a GeoJSON document loaded via Geoserver. I tried vector.features but in vain. Could anyone help with this?
Gratiana asked 30/3, 2015 at 16:58

2

I am trying to implement dense vector based search in solr (currently using version 8.5.2). My requirement is to store a dense vector representation for each document in solr in a field called vec...
Hypogeum asked 19/10, 2021 at 7:2

5

Solved

I am using the HuggingFace Transformers package to access pretrained models. As my use case needs functionality for both English and Arabic, I am using the bert-base-multilingual-cased pretrained m...
Needlecraft asked 2/3, 2020 at 16:20

3

Solved

How can I initialize new Vector using the vec! macro and automatically fill it up with values from an existing array? Here's the code example: let a = [10, 20, 30, 40]; // a plain array let v = vec...
Platy asked 11/1, 2022 at 16:7

2

I have: a vector of type <class 'sympy.vector.vector.VectorMul'>; and a matrix of type <class 'sympy.matrices.dense.MutableDenseMatrix'> I would like to multiply the matrix by the v...
Cockleshell asked 20/2, 2019 at 3:0

12

Solved

How do I create an empty mutable two dimensional array in Rust? This is what I have tried so far: let mut state[[u8 * 4] * 4]; This produces the error error: expected one of `:`, `;`, `=`, or ...
Nikolai asked 3/11, 2012 at 18:31

6

Solved

I have the following vector called input: input <- c(1,2,1,NA,3,2,NA,1,5,6,NA,2,2) [1] 1 2 1 NA 3 2 NA 1 5 6 NA 2 2 I would like to split this vector into multiple vectors by each NA. So the d...
Faline asked 4/12, 2022 at 9:50

4

I have the vector: v <- c("godzilla", "jurassic", "googly") I want the first 3 letters of every element in this vector. I would like to end up with: # "god" "jur" "goo" I have already tri...
Topaz asked 18/6, 2014 at 17:49

2

Solved

What would be the idiomatic way of converting arrays or vectors of one type to another in Rust? The desired effect is let x = ~[0 as int, 1 as int, 2 as int]; let y = vec::map(x, |&e| { e as u...
Lopez asked 26/5, 2013 at 0:36

8

I was wondering if there was a way to get the forward vector of a spatial node in godot 3d. In unity this would simply be transform.forward. Godot gives me a rotational vector but im not sure how...
Foggia asked 25/1, 2018 at 8:10

9

Solved

I'm trying to learn R and I can't figure out how to append to a list. If this were Python I would . . . #Python vector = [] values = ['a','b','c','d','e','f','g'] for i in range(0,len(values)): ...
Gin asked 6/3, 2014 at 20:58

6

Solved

I would like to merge 2 vectors this way : a = c(1,2,3) b = c(11,12,13) merged vector : c(1,11,2,12,3,13) How could I do it ?
Twofold asked 21/9, 2014 at 17:25

2

Solved

I'm using a Lua API. I'm trying to transform 3D space coordinates to 2D space coordinates. I've asked google but I can't find anything apart from snippets using OpenGL function. I don't need source...
Frascati asked 26/5, 2011 at 13:41

6

Solved

Is it even possible to concatenate vectors in Rust? If so, is there an elegant way to do so? I have something like this: let mut a = vec![1, 2, 3]; let b = vec![4, 5, 6]; for val in &b { a.p...
Southernmost asked 24/11, 2016 at 18:34

4

Solved

I'm creating game in using html5 and THREE.js, and I have a camera that rotates with the euler order of 'YXZ'. This is so the camera rotation up, down, left and right like a head. As in first pers...
Revanche asked 11/2, 2013 at 14:19

3

Solved

The image below shows a rotated box that should be moved horizontally on the X and Z axes. Y should stay unaffected to simplify the scenario. The box could also be the SCNNode of the camera, so I g...
Mightily asked 5/4, 2017 at 17:25

© 2022 - 2024 — McMap. All rights reserved.