Categories
Development

if value is in array using includes not working

I have 2 arrays: ids = [a,b,c,d,e,f….]; savedRepods = [e,f]; function getPoints(){ for (var i = 0; i < savedRepods.length; i++) { if(ids.includes(savedRepods[i]) ) { console.log(savedRepods[i]); } } } I know the value is in the array but this won’t show me the value console.log(savedRepods[i]); Full code: /** get saved values from the server */ […]

Categories
Development

MySQL: How to use main query variable inside sub query WHERE condition

Here is my Table “assets” +—-+—————————-+——-+———–+ | id | model | grade | warehouse | +—-+—————————-+——-+———–+ | 1 | Optiplex 9030 AIO i5 | 2 | 2 | | 2 | Optiplex 9030 AIO i3 Touch | 2 | 2 | | 3 | Optiplex 9030 AIO i7 | 2 | 1 | | 4 […]

Categories
Development

PHP insert array associative – i want to insert a value to existing array in assosciative array

i got question How to insert value to a existing array, and my expetation of result is like : Array ( [id] => 11 [title] => Lorem ipsum [view] => 3445 ) But what i have did is : <?php $newVideo = [ ‘id’=>’11’, ‘title’=>’Lorem ipsum’ ]; $view = ‘3445’; $newVideo[] = [‘view’=>$view]; print_r($newVideo); and […]

Categories
Development

Parsing Erlang data to Python dictionary

I have an erlang script from which I would like to get some data and store it in python dictionary. It is easy to parse the script to get string like this: {userdata, [{tags, [#dt{number=111}, #mp{id=’X23.W’}]}, {log, ‘LG22’}, {instruction, “String that can contain characters like -, _ or numbers”}]} desired result: userdata = {“tags”: {“dt”: […]

Categories
Development

How to project 2d laser scanner data in world co-ordinate system

I have small tank drive robot which has a rplidar a1 mounted on it. The robot has a raspberry pi on board. I am working on making a small arena with cardboard obstacles. I can find the pose(x,y,heading) of the robot using aruco markers and a celling mounted downward looking webcam. My x axis is […]

Categories
Development

Emgu CV ArucoInvoke.InterpolateCornersCharuco gives error “Emgu.CV.Util.CvException: ‘OpenCV: 0 <= i && i < (int)vv.size()'"

I’m trying to detect charuco markers with Emgu CV and I’ve copied and rewritten the example from the OpenCV website. My code looks as follows: Mat cameraMatrix = new Mat(new Size(3, 3), Emgu.CV.CvEnum.DepthType.Cv32F, 1); Emgu.CV.Matrix<float> matrix = new Emgu.CV.Matrix<float>(3, 3); matrix.Data[0, 0] = 925.6412f; matrix.Data[0, 2] = 640.055f; matrix.Data[1, 1] = 925.4835f; matrix.Data[1, 2] = […]

Categories
Development

Using arrays with pg-promiise

I’m using pg-promise and am not understanding how to run this query. The first query works, but I would like to use pg-promise’s safe character escaping, and then I try the second query it doesn’t work. Works: db.any(`SELECT title FROM books WHERE id = ANY (‘{${ids}}’) ORDER BY id`) Doesn’t work db.any(`SELECT title FROM books […]

Categories
Algorithms Development

Grouped Cross Join with R data.table

I am looking for grouped cross join functionality I would like to implement with data.table for performance and memory allocation reasons. I basically want to calculate all potential combinations within a group and iterate over all groups. (FYI:The task I want to solve is to compute all possible edges between a given set of grouped […]