instruction
stringlengths
71
95.1k
This is a pretty huge question, however, I would appreciate it if you could just review the design and not my implementations of it. The Implementation and test sections could be ignored, they are only there to aid the description of the design, in case I didn't describe it very well. This makes this question have a s...
For my game engine I am implementing ImGui for debugging purposes. In order to manage ImGui I have made a singleton to make sure only one ImGui context gets created. I am not entirely sure if this is a good implementation of a Singleton so I am looking for some feedback, also is using a Singleton here the right way or ...
I'm trying to split an incoming stream of strings into cumulative tokens per line item using a function below, def cumulativeTokenise(string: String): Array[String] = { val array = string.split(" +") var result: Array[String] = Array() array.map { i => ( result = result :+ ( ...
Extending this answer solution, I've wrote the following bash script to get the html of my StackExchange accounts page and parse it to a YAML file. The objective was list for each community I participate its url and my user id. get-stackexchange-info.sh #!/bash/bin NETWORK_PROFILE_URL=$1 # https://stackexchange.com/us...
I'm new to JavaScript and I decided to make a script that allows other developers to show SVG elements in the web browser. (It is just for learning purposes), and it is still under development. I coded it in ES5 first and then I'm willing to upgrade it to ES6+ so I can learn and understand the differences. I really app...
I want to read csv file in to array of structs with NULL ending. test.txt: 11,345,1,k 12,34.23,3,v 13,13.4,5,x 14,15.7,6,c My code: #include <stdio.h> #include <stdlib.h> struct csv_line { int value1; float value3; int value2; char char1; }; struct csv_line *line_pointer = NULL; int main(void) { FIL...
I have a method that I use nested foreach and the same variable call multiple times. I read a lot of optimizing code but I'm pretty sure I can do this with less code and best practices: public async Task<IEnumerable<IssueViewModel>> Get(IssueSelectModel model) { async Task<IEnumerable<IssueViewM...
I was asked to solve the following exercise: Given an input vector<string>, I have to find the anagrams and return a vector<string> with only the strings that are not an anagram from other strings in the vector. Example: Input vector: "code","doce","framy","frame","sad","cat","frema" Output: "code","framy","sad","cat"...
I wrote a simple card game in JavaScript and I wonder if anyone could give me some advice and make some improvements on my code. Here is the demo that I build: https://codesandbox.io/s/cardgame-his95?file=/src/index.js So it is a 2 person card game. Every card has a number and also has a pattern. The game goes like ...
I'm writing a program in Unity and am using a TextMeshProUGUI object (named history) to hold a list of messages to act as a terminal/console. The problem I am having is that I am printing up to hundreds of lines a second, which can be detrimental to performance when I'm doing many string splits and then updating the te...
I am trying to learn the Cartesian Coordinate System, starting with a basic tic tac toe grid for simplicity, then perhaps moving to chess. I was able to make the following code to start out: board = [] def new_board(): for row in range(4): board.append([]) for column in range(4): board[...
I have 2 functions to get the n-th fibonacci number. The 1st one uses recursive calls to calculate the power(M, n), while the 2nd function uses iterative approach for power(M, n). Theoretically (at least what I think), they should have the same speed O(log n), but why when I run both, the 2nd one is much slower than th...
I am total beginner in C and after reading K&R's chapter 5, I felt I was ready to at least make a simple game using C. I know linked-lists, so since I was making an implementation of Snake, why not? main.h #include <SDL2/SDL.h> #ifndef MAIN #define MAIN #define SCREEN_WIDTH 640 #define SCREEN_HEIGHT 480 SDL_Renderer...
(define or-l (lambda x (if (null? x) #f (if (car x) #t (apply or-l (cdr x)))))) (map (lambda (x) (apply or-l x)) '((#t #t) (#f #t) (#t #f) (#f #f))) '(#t #t #t #f) It will be used in a function that evaluates Boolean expressions.
I implemented mergesort in C as an exercise. I have two main questions: Is the code future-proof? 2.1 Will I have problems modifying it to sort float and double? 2.2 What could be problematic for creating a multithreaded version? I haven't learned multithreading in C yet, but I plan on a multithreaded version later on...
I've coded up a Vector class for use in my simulation support code, which I offer up for review. I decided to extend std::array. Now, I know that std::array is an aggregate type, but with C++-17 we can now extend an aggregate base type and still use 'curly brace' initialization. Extending std::array means that each Ve...
I do this as sort of hobby and want to no if I can improve. This is a simplified version of my code that normal works with bootstrap classes and id's. At the bottom there is the input of the classes. I have already a working version connected with SQL Database. but want to take it a step further with object oriented ph...
I have been learning linked lists for the past three days. I feel I have implemented a complete linked list. Are there any more things a linked list should do? Please can you review any or all of my code. I would be most interested in feed back to the more tricky section of the linked list. class Node: def __init__...
I've been meaning to revisit this old code for a long time, and this week finally ended up doing it. The resulting code is on GitHub, and for full context and disclosure I wrote a blog article about this exercise in OOP design. The idea is to abstract away the pain of making secure ADODB queries. This immediate pane co...
I had to solve three problems on graph theory that I solved by implementing a utility function and 3 functions, one for each of the problems. The problem set defines the input for all my functions as a E+1 x 2 matrix (they call this an edge list) where the first row V E contains the number of vertices V in the graph an...
Some background Feel free to skip this if you're not interested. There is a very popular bioinformatics program called tabix that permits interval-based searches for genetic variants in VCF files. To list all variants from position 100000 to 150000 on chromosome 1, one would invoke tabix db.vcf chr1:100000-150000. I cr...
I've got a task to create a readline() function that would have the exact same behavior as read(): ssize_t read(int fd, void *buf, size_t count); (man read) So it should return -1 on error and number of bytes read on success. Also, if the function receives a string with multiple \n chars, it should return only the fir...
I faced a series of problems when unit testing a tool of mine that generates files. They were caused by me putting the files in the same temporary folder and the tests running in parrallel. Here is an exemple of the unit tests (for @shanif) public class OutputWriterTests { [Fact] public async Task WriteToDirect...
This is my first Web Scraping project in which I am retrieving the current stock information from here. This program works as expected, but I would certainly think someone with more experience with the language and web scraping could improve it. #Imports from bs4 import BeautifulSoup from colorama import Fore as F from...
I have a function in JavaScript that converts a string value to title case using APA style: function titleCase(str, options) { const stopwords = 'a an and at but by for in nor of on or so the to up yet' const defaults = stopwords.split(' ') const opts = options || {} if (!str) return '' const stop = opts.s...
Is it possible to implement this function without goto, while keeping the code correct and readable? using iter = std::string::const_iterator; // Skip multiline comment in a source string. // Initial iterator is at the first character after the "/*" iter skipMultilineComment( iter i, iter fileEnd ) { while( true )...
This is an implementation of Huffman Coding that works on ASCII values. I simplified main to show an example of user input to the program. I only removed handling of non-printable ASCII characters, as that is not something I need reviewed. Initially, I tried to use std::priority_queue<std::unique_ptr<node>>, but you ca...
I am learning the basics about managing an SQLite database by using Python and, mainly for practice purposes, I have then defined an interface class in order to let operations on database as clear as possible. That said, I would like to ask you for some feedback about the following code: import sqlite3, os class DbInt...
I'm experimenting with ways to reuse code throughout a Rails web app. I'm interested in feedback concerning one such approach! Context A user's request may be scoped to a physical location so that the view shows location-relevant information. In most cases, the location is stored in a cookie. It's possible for location...
I made a program that calculates how much the value of money has decreased due to inflation over a given set of years. This takes a principal amount, a start and end date, and with the help of the inflation rate, it calculates how much the value of money is at the current year. (compound) The data from the CSV file is ...
I am writing a simple count down timer in React: index.js import React from "react"; import ReactDOM from "react-dom"; import "./index.css"; import bootstrap from "bootstrap/dist/css/bootstrap.css"; import App from "./App"; ReactDOM.render( <React.StrictMode> <App /> </React.StrictMode>, document.getElementB...
I've recently wrote snake game. I Wanted to keep it in pure terminal, without libraries like pygame, tkinter or curses. It works just fine, but i know that the code might be improved. I'm rather junior programmer, and it's my first attempt at 'gamedev', because currently i'm learning Django. I would be grateful if you ...
import sys import time import multiprocessing def change_char_at(s: str, ch: str, i: int, j: int=None): '''strings are immutable so i made this handy-little function to 'mutate' strings similar to => s[i] = ch # if j is not specified s[i:j] = ch # if j is specified *note*: negative indices do...
I am reading Stroustrup now and I was very impressed with how flexible the STL library is thanks to iterators and generic programming. Along the way, I am also reading Cormen's book and decided to try to implement an algorithm for searching for the maximum subarray in the style of STL. I wrote in C++11. I would be very...
https://leetcode.com/problems/find-pivot-index/ Question: Given an array of integers nums, write a method that returns the "pivot" index of this array. We define the pivot index as the index where the sum of the numbers to the left of the index is equal to the sum of the numbers to the right of the index. If no such i...
I am new to this part of backend development using JS and the truth being a new programming language (for me) it is worrying that it suddenly does not meet the structuring and / or security standards. CLEAN ARCHITECTURE API / CONTROLLERS / SERVICES / LIBS ROUTE //Required application const express = require('express'...
While reading an online book (Michael A. Nielsen, Neural Networks and Deep Learning, Determination Press, 2015) regarding neural networks, I decided I wanted to try and build a neural network which does not require a predefined network size, i.e. the layer depth and size are defined by input arguments. My goal was to m...
I have implemented a queue by using a stack data structure. How could I improve it? package _amazonAskedQuestions.dataStructures; import java.util.Iterator; import java.util.Stack; public class Queue_Stack<T> implements Iterable<T>{ Stack<T> stack = new Stack<>(); public void enqueue(T item){ Stack...
To get a feel of Monty Hall problem, I've implemented Monty Hall simulator in Python, using only two strategies: never switch the door or always switch the door. Please review it with an eye towards any problem with the code you can think of, things like better design, flaws in code, etc. #!/usr/bin/env python3 import...
This is a simple app that starts the webcam either in color or in grayscale mode depending on what the user wants: The grayscale camera is implemented via the GrayVideo class and the color camera through ColorVideo. I wanted to have a common show_current_frame for both the ColorVideo and GrayVideo objects. That show_c...
When you write a code in python code people always ask to make it more pythonic. I am not sure if there is a term for scala or not. However, I am pretty sure my following code use one or two scala feature. Objective Read a property file, which has location to XML file Read source, destination and some other properti...
So after years of teaching myself, I think I'm ready to stand on the shoulders of giants and ask you a good question! I have a tree of nodes. What I want is a function that returns an array of the entire tree sorted by depth. In my original attempt I wasn't aware at the time that I was performing a depth first search. ...
This question was asked through the Facebook interview and the suggested solution is solving via binary search. I have put the binary search solution but it still looks too complicated. Question: Given an int array wood representing the length of n pieces of wood and an int k. It is required to cut these pieces of woo...
I am just working on Flatland Space Stations problem, and it is not seeming to be a tough question, but my algorithm lags in some aspects, since it solves majority of the test cases but fails for some. Which is causing me not to move forward. The cause of the failure is timeout only, no wrong output. My Algo: To loop...
Wanted to get familiarize myself with CSV Files handling and datetime library so I wrote this small project where: when the user enters a string into the console the program saves the time at which the string was entered and marks it as the start time. when the user reenters the same string the activity is cons...
I'm trying to build a CLI that runs until the user decides to exit. The functionality of the CLI is to be able to explore a json-file by typing commands into the terminal while the program is running. Right now commands are checked against if/else statements, but I would like to add so that commands are checked in the ...
Ok, so I want to find out if my approach towards a custom interpreter is pragmatic and if not how to implement it in a better way. this is purely for fun and practice and to find out more about how to implement a good interpreter. when I get a good grip on what to do I want to implement this into a Unity game. Any tips...
Could you please help me optimize the macro, Its taking more than 50 minutes but still no success. The For loop is looping untill 1.0 million + rows. Screen is flickering. I have tried Application.ScreenUpdating = True but it still flickers and for loop is taking very long time. I am downloading reports from sharepoint...
My code works for user output alignment to the right side by maximum length of 4 different user input. I have 2 question. Is there a simplier way for append method in my code ? Is there a simplier way for right alignment by maximum legth of 4 different user input. Thank You for Your Time... """ Main purpose of this c...
There is a simple movement CAKeyframeAnimation, what needs is that I can cancel and restart the animation freely. The key point of the following code, is that I use CATransaction.flush() I update to the render tree manually. If not, Flush is typically called automatically at the end of the current runloop. Then the a...
I've been experimenting with TCP clients in C++ and I really wanted to get some feedback on my code since I know it is bad. I would really appreciate some feedback on the class structure I have and the ways I can improve it. I also would love some feedback on any other simple bugs I have (or things in general I can fix...
I'm importing data from file to many tables in database. It may look like this: First Name, Last Name, Meeting John, Doe, 2020-04-24 08:00:00 Some fields like "First Name" and "Last Name" are being saved in one table and other fields like "Meeting" are being saved in different tables. There are a lot of more fields an...
I am a professional Angular developer and start to learn React. This is my repo to be reviewed. This is a small login/register form created with React. I want to check if this small project actually is written with React-style. If you don't feel comfortable to open and look into repository, I place the most issued file...
I have done the leap year check on https://exercism.io already in a lot of languages. Today I came back to the exercise in Java and was playing around with some maybe more funny ways to do the check. The following more functional one kept me thinking of: import java.util.stream.IntStream; class Leap { boolean isL...
So I have a Know Your Customer provider interface like this to estimate risks associated with a customer: public interface IRiskProvider { string Name { get; } Task<Risk[]> FindRisksAsync(Customer customer); } And I would like to be able to create an instance of it from a delegate as well as intercept all the ...
I have an app in which I want to create multiple configurable parallel workers. The configuration is done via an "options" parameter because I want to have an interface that requires Run(options) method. Each worker (called thread in the snippet) has its own configuration type (ThreadAOptions for ThreadA and ThreadBOpt...
In relation to the question I asked here, I myself came up with an answer. I would like constructive criticism and tips to improve it to make it efficient like the other answers that have been posted. #include <algorithm> #include <iostream> #include <set> #include <vector> int main() { std::vector<int> job_list; ...
I'm writing some code in Python that takes a set of [x,y] coordinates (in a list of tuples) and also an x-value. I need to find the two closest x coordinates to my x-value. To find the closest x, I created a list of all the x-coordinates, used that list to create a lambda function that found the closest x to my x-val...
I am beginner a 1st year cs student. I am taking CS50 and I completed the first week problem of implementing Luhn Check algorithm. Though my solution works I feel it's very sloppy and not efficient. Can someone please suggest how can I improve my solution? (It's a first-week problem so you are not intended to use arr...
I implemented an immutable hash map in C, as described in this paper. First, my design goals: plug-and-playable: compile with gcc -O3 -std=c11 champ.c, #include "champ.h", ready to use #define Key and value types to suit your needs: see Using it as a "champ<string,int>" below Provide reference counting as the default ...
I have a lambda function that ingests a CSV, reads it as a list of dicts, modifies them (updating the Keys, adding a few values) and submits them to a firehose. Initially I had the following code: import json import boto3 import sys import csv import io import logging s3 = boto3.client('s3', 'us-east-1') firehoseClien...
I have made a clone of windows task manger using QT and c++. When I started out this project I had much less knowledge of c++ then I do know so the style of some parts of the code are not always consistent with others. the full source code can be found here https://github.com/qwertybomb/Task-Manager-Clone. However My m...
I have a .net core razor app that has a special use case where I need to have a global counter that will be incremented by every request, and yet it should remain thread-safe. Also at web application load, this counter will be read from a database using entity framework. I don't think that static variables are threadsa...
I'm writing a code that, starting from an XML file: stores the index of child elements of a tag and the child elements as key, values in a dictionary (function get_xml_by_tag_names); deletes keys whose values contain a certain string (the specific text size) and puts these keys and the corresponding values into a seco...
I recently discover by reading some blog topics on web that 90% of code lines I produced in my career was procedural and not OOP oriented (big slap in the head). So now, I try to lobotomy my brain in order to produce only OOP codes. The problem is that I have a lot of questions about OOP practice. Here is one : I got ...
I'm looking for an array join that will return an array with an element inserted between consecutive elements of an input array. string[] input = { "red", "white", "blue" }; string[] result = InterstitialJoin("or", input); // { "red", "or", "white", "or", "blue" } If I use string.Join, then the output is a string, but...
I have a Lambda function that processes incoming messages and sends emails based on an enum type property in the message. I have N number of "handlers", one per type, and this number grows from time to time. I could register them in a simple object or Map, but I'd prefer to register them all automatically in a store th...
I am writing code for the challenge given here . Below the text: Each time Sunny and Johnny take a trip to the Ice Cream Parlor, they pool their money to buy ice cream. On any given day, the parlor offers a line of flavors. Each flavor has a cost associated with it. Given the value of and the of each flavor for tr...
I'm working on a function that takes in a NumPy array containing only mutually distinct positive square numbers. I want the function to pick an element at random, find if there is a lower positive square number than the number selected: (1) if there is, return the array with the lower positive square number in place of...
The Question: Steve has a string of lowercase characters in range ascii[‘a’..’z’]. He wants to reduce the string to its shortest length by doing a series of operations. In each operation he selects a pair of adjacent lowercase letters that match, and he deletes them. For instance, the string aab could be shortened to b...
class Node: def __init__(self, data): self.data = data self.next = None class LinkedList: def __init__(self): self.head = None def insert(self, data): self.head = self.insertHelper(self.head, data) def insertHelper(self, head, data): if(head == None): return Node(data)...
Sometimes I have the need to call an async function from a non-async function and get the result back synchronously. Therefore I wrote the following helper function to be able to do this in one line. public static T RunSync<T>(Func<Task<T>> taskConstructor) { var signal = new ManualResetEventSlim(); T result; ...
This is an echo program with no runtime or standard library. It's meant to be compiled with -nostdlib on an amd64 Linux system. static signed long mywrite(int fd, const void *buf, unsigned long count) { signed long retval; __asm__ __volatile__( "syscall" : "=a" (retval) : "a" (1), "D" (f...
I made a simple signup form using this HTML. Am I separating my code properly here or is there some code that I could remove/change? The form looks good visually, but when I styled it with CSS I noticed a lot of stuff I had to repeat. <body> <form action="#" class="form"> <div class="img-overlay"></div> ...
I implemented the following method to send IMAP commands to server and return the response to caller. Here, I'm not trying to parse the commands. Would like some advice on how I can improve the method (e.g. avoiding unnecessary copying) because I feel like I keep moving data between buffers and strings too much. The ot...
I'm using the following lump of code to manage a 9.4gb dataset. I had to divide the dataset into multiple github repositories to be able to do this. I've explained what each block of code does. git_repo_tags = ['AB', 'C', 'DEF', 'G', 'HILMNO', 'PR', 'STW', 'X'] counter = 1 # Cloning the github repositories print('Beg...
I have been trying to deal with this problem set, and I have figured out how to solve it as well. But there is one problem that is Timeout error for some hidden cases, but no wrong answers PROBLEM STATEMENT In this challenge, a string and a list of intervals are given. The string consists of English letters only and it...
This code below is supposed to calculate the root of a function using bisection method. I am a newbie to Python, so I do not know how to raise errors. Also, I would like to have a general review on this algorithm design, where I could have optimised, utilised some tricks or any sort of improvements. I feel like I am r...
I wanted to create an image compressor using Machine Learning and started work on an "AutoEncoder". This is a type of Neural Network which takes in the image and creates a compressed vector form. It has two parts: encoder and decoder. encoder converts the images to vector form. decoder tries to re-create the image only...
I am trying to develop an ECS registry. How would you improve this ? First disadvantage comes to my mind is using lambdas might be expensive, however I was not able to replicate functionality using F&& template arguments. engine->addEntity(1, Position{1, 1}, Mesh{"thing.gltf"}, PhysicsBody{...
Hi I need advice and review, here I have class AutomaticWorker which should constantly running and check if there is any file to process and after processing write data in database. OnDoWork method is inside while loop and started every 5 min to check if there is some job to do. public override void OnDoWork() { Ex...
I'd like feedback please as to improvements which could be made to make this more 'pythonic' in its approach/structure. Any constructive feedback welcome. The below is a game which takes a single random word from a list of 3000 and has the player guess letters (whilst being limited to a certain number of attempts). #...
I have written C++ code using trie and min-heap to find the k most frequent words. I want to review my code. #include<bits/stdc++.h> using namespace std ; //structure of the node of trie struct TrieNode { bool IsEnd ; // If this node is end node int HeapIndex ; // To store the ...
I want to make a command-line text editor in python. Is this good code? from termcolor import * import os while True: files = os.listdir() bufname = input("File name: ") title = cprint("Ganesha Editor v1.0", "green") controls = cprint("Type $exit to exit text editor. It autosaves.", "blue") def wr...
I have a class with numerous methods, and so I would like to split these up into groups. This would make it easier for the user to find the method they are after. Here is a minimal example of this functionality. class Greeter(): def __init__(self, name): self.name = name self.spanish = Spanish(self...
Given an array a, find the greatest number in a that is a product of two elements in a. If there are no two elements in a that can be multiplied to produce another element contained in a, return -1. I am trying to get this to run as fast as possible. I assume there is some math algorithm or formula to do this that I...
I am beginner in programming and I did the task "manually" by logically creating the sum of costs for each route. But I wanted to ask if it is possible to automatic (dynamic) counting of costs for a given route? original_route = [0, 4, 2, 1, 3, 0] route_2 = [0, 3, 5, 2, 4, 6, 0] route_3 = [0, 7, 6, 4, 1, 5, 0] distan...
I am trying to solve the following Hackerrank Problem. I have written the code for the problem. However, it runs for some of the test cases while for others it doesn't. It shows the message : "Your code did not execute within the time limits" I know that bubble sort is not required for the problem. However, I have see...
I have some code which is working, but I would be interested if anyone could review it and tell me if there is a more efficient way of achieving my goal. I receive input from a data source as an array such as ["Y","Y",,"Y","Y",,"Y"]. The values relate to investment fund names and I am outputting a string such as "Balan...
I need to generate a huge array from a few words, and not random, I must get the same array always for the same words. I wrote this code which will generate 3050 from 51 letters, but I'm sure there is a better way to do it. The idea is to convert the letters to ASCII numbers and put them into an array, then manipulate ...
I am trying to abstract data from a complex and create a EventDto. And I was able to do it using foreach but the syntax is dreadful. Is there a better way of writing this code? public class EventDtO { public string Id { get; set; } public string Title { get; set; } public string CategoryTitle { get; set;...
In python the itertools module is a good tool to generate combinations of elements. In this case I want to generate all combinations (without repetition) having a subsets of specified length but also with a product limit. For example, given a list of integer numbers I want all subsets of length 4 which product is bello...
My agent-based simulation spends about 60% of its runtime in one function, as the profiler shows. That function looks as follows. # That is, for those locations, the family knows actual # available resources and size and culture vectors of all agents located there # at the moment. @cython.inline @cython.ccall @cython....
This is a basic map that was built: To render it, you would put this in the .html.slim files .acme-map-container-4 data=map_identifier(resource: @warehouse.id) What actually happens is, the map_identifer() (a rails helper) inserts some data attributes, and the javascript code uses that to initialize the google map. A...
I followed the Algorithms book implementation of quick sort. pub fn quick_sort<T: PartialOrd>(a: &mut [T]) { shuffle(a); let low = 0; let high = a.len() - 1; inner_quick_sort(a, low, high); } pub fn inner_quick_sort<T: PartialOrd>(a: &mut [T], low: usize, high: usize) { if high <= low { return; } le...
I've been refactoring my OCaml solution for Project Euler problem 54, which is about comparing poker hands. While I'm mostly satisfied with my second iteration of the refactor, I stumbled upon two solutions in Haskell. I was surprised by the brevity, and although I'm not familiar with Haskell, I found out that the both...
This is the question: The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be: 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ... Let us list the factors of the first seven triangle numbers: 1: 1 3: 1,3 6: 1,...
I've recently discovered patterns and decided to implement Presenter pattern inside a pedagogical project. I spent few days playing around with different implementations, reading some Gem's source code. However, I'm not sure I'm handling delegation and decoration appropriately. Could anyone give me feedback on my imple...
I am going though Cracking the coding interview and trying to improve my coding interview skills. The question is "Given a directed graph, design an algorithm to find out whether there is a route between two nodes. I think the run time is N^2 but I could be wrong. Is there a better way to do BFS? package TreesAndGra...
I've written this function to read matrices from the ROS parameter server. void read_matrix_from_param(ros::NodeHandle nodehandle, std::string param, cv::Mat &cv_matrix) { // 1D vector for temporarily holding matrix elements std::vector<double> _data; // matrix dimensions int _rows, _cols; ...