instruction stringlengths 71 95.1k |
|---|
I wrote the following scripts to extract data from BigQuery and InfluxDB using the bigquery cli and the influx cli. The code works as expected. I included all files for completeness, but I'm primarily interested in feedback on the bash scripts config_query.sh, extract.sh and run.sh. You can also comment on the python f... |
I've been learning C++ on my own and working solo on trying to implement some of the concepts I've been reading.
I'm wondering if this is the correct group to get someone to point me to other info regarding the code I've wrote or if I'm getting the concepts right.
I've tried to build Tic Tac Toe using a class system. I... |
This is my first serious shell script, so it is probably horrible.
Problem statement
I decided to improve my profiling skills as so far they were mostly about hand-rolling counters and timers. After trying out better profiling tools and techniques I noticed that previously I was just rolling my face over keyboard until... |
I am attempting to implement my neural net for a fully connected network configuration. I don't know much about neural networks and ai, so the implementation is not great and may contain errors however it has been tested and seems to give the desired results.
Full code:
import numpy as np
import pandas as pd
X = np.ar... |
I've been writing with C for a couple days, so this is a relatively advanced function compared to the simple things I've been doing previously. It's written for the Lua API, but it's still C.
#include "lua.h"
#include "lauxlib.h"
#include <stdlib.h>
#include <string.h>
static int l_rtrim(lua_State *L) {
luaL_checkt... |
I MIGHT REWRITE THIS QUESTION IN A CLEARER WAY WITH SOME SAMPLES TOO AND POST IT AS ANOTHER SOON, AS NOW MY EXPLAINATION HERE IS QUITE HARD TO UNDERSTAND & MIGHT BE PHRASED WRONG.
I do have background knowledge in programming, but this is my first time using VBA so any advice is appreciated.
This code is the final pa... |
My code takes a list of dictionaries as an input. Each of these dictionaries contains a person identified by name and a region code region, as well as financial account information associated with that region code for that person. The output structure is supposed to be a dictionary with one element for each person. Thi... |
I wrote this little snippet which moves files from several subfolders to their parent folder. Since the snippet uses different nested for loops I was wondering if it could be refactored to a cleaner and more maintainable solution? I tried extracting the different for loops to separate functions, but they rely on the sa... |
I've written this code to simulate the Ising Model. The idea is a system represented as a matrix with each element having value 1 or -1. The input is an initial matrix of 1 and -1; it is then being subjected to this algorithm:
Pick a random element of the matrix
calculate the energy change of the system if that elemen... |
I have written an article on a new way of non comparison sorting and I want it to get peer reviewed. The sorting algorithm uses Trie data structure to store digits of numbers as nodes and iterating over each node 10 times (k) in a depth first traversal returns the sorted list. Time complexity O(n log m), log to the bas... |
Below is the core of an entity component system I am working on to learn more c++, the full project can be seen here: https://github.com/williamholm/IBECS. Any feedback is appreciated.
The goal of this ECS is to end up with component data being sorted in such a way that for expressions which require multiple component ... |
Based on a question I asked on SO, I have come up with the following solution. As I am very new to Python Qt, I would like a review rather than just add it as an answer in SO.
The code runs a script in another thread. That script needs to open a file dialog to get another file from the user. To do that, I pass a signal... |
Long piece of code, I hope it is readable.
The code is basically if statements looking at 4 arrays: ArrPnLDataD1, PricingDatesArr, ArrForwardCurves and ArrHistoricalPrices.
I thought that having gone with arrays, the code would run quite fast but due to the size of the arrays and the number of loops it is running for t... |
Here is an implementation of the 'which' command which can tell where programs are located.
/* SPDX-FileCopyrightText: 2021-2022 John Scott <jscott@posteo.net>
* SPDX-License-Identifier: GPL-3.0-or-later */
/* We do not support the obsolete extension where an
* omitted directory name is interpreted as the current
*... |
For a final project I used a weighted union-find and decided to implement it in Python. I wrote it to be as general as possible so it's very portable. I do plan on looking into path compression to make it better, but that's in the future. Otherwise, I have plans to make it more generic so that it's even more portable. ... |
I'm working to implement a custom string format. These are the float values to convert into a string:
1,02458
0,4145805
0,06231292
0,04362812
1,16458
1,172608
0,06011338
0,05324263
0,0653288
0,0285034
0,0992517
0,0861678
This is the output I'm getting:
1.02458f
.4145805f
6.231292E-02f
4.362812E-02f
1.16458f
1.172608f
... |
Introduction
I have written a first iteration of a 3d rendering-program utilizing openGL and c++ and i am looking to get some of my code reviewed.
As i am self-taught and have never received any input on my coding i am looking forward to all sorts of feedback regarding style, abstraction, architecture, algorithm design... |
I am trying to learn to improve my coding on a daily basis and this is one of the first times I am posting on here, so bear with me.
I have two models, a Payment and an Expense model. A payment hasMany expenses. In a table I am showing all payments, including the sum of all expenses for each payment. Now I would like t... |
Comparison Sorting
Quicksort usually has a running time of n x log(n), but is there an algorithm that can sort even faster? In general, this is not possible. Most sorting algorithms are comparison sorts, i.e. they sort a list just by comparing the elements to one another. A comparison sort algorithm cannot beat n x log... |
I want to see if there is a cleaner way to do this logic. I have a working sample:
Same fiddle.net
public static Boolean passwordchecker(string userName)
{
string[] group = new string[] { "a", "b" };
if (group[0] == userName || group[1] == userName)
{
return true;
}
... |
Can this solution be made more efficient?
game_scoring.py
"""
Game Scoring
Imagine a game where the player can score 1, 2, or 3 points depending on the move they make. Write a function or functions,
that for a given final score computes every combination of points that a player could score to achieve the specified sc... |
We had a string with byte array (hexadecimal) sequence, like: "0x65,0x31,0xb6,0x9e,0xaf,0xd2,0x39,0xc9,0xad,0x07,0x78,0x99,0x73,0x52,0x91,0xf5,0x93,0x1a,0x49,0xc6" and we need to recovery this sequence to byte array again.
We are using the following approach:
string byteSequence = "0x65,0x31,0xb6,0x9e,0xaf,0xd2,0x39,0x... |
I'm learning web development with JavaScript, HTML, and CSS and have just created my first application, a Pig Game. The app works well, however, I think my CSS is a bit over complicated and that the media query I wrote for responsiveness could be greatly improved.
Game rules:
Player 1 starts first. Each player take tur... |
The code below gets data from an Excel spreadsheet and returns some values; this can take up to 15 minutes because the Excel has more than 15 columns and an average of 20,000 rows.
def media_dia(data):
lst_matric = []
contaf = 0
totinf = 0
for x in range(1, mxrw1):
date_time_str = ws_sheet1.cell... |
The problem is this. Forecast model data indicates at 0700Z the 1000 milibar temps will be -4C°. The forecaster knows that is incorrect, so they choose to make a correction. This correction should have a diminishing affect across the axes. The forecaster can set the threshold of correction via 2 sliders. time and h... |
The boring but exciting challenge:
Using a HashMap and HashSet, create a text interface to allow a user to add employee names to a department in a company. For example, “Add Sally to Engineering” or “Add Amir to Sales”.
Then let the user retrieve a list of all people in a department or all people in the company by dep... |
I am trying to read multiple files in parallel in such a way so that each go routine that is reading a file write its data to that channel, then have a single go-routine that listens to that channel and adds the data to the map. Here is my play.
This handles error and if there are any errors reading the file then it ca... |
I decided to try to write half a pyramid of stars using programming because I wanted to see if I could do it, and I did it. However after comparing it to other people's solutions I started doubting that my way was the correct one, even though it does the same thing.
So I combined all three examples so that I could get ... |
The purpose of the code is to apply adapter pattern to put an extra feature for searching through json object.
I hate deep nested json object because it makes my code look messy when access through each node. I made an adapter class that can search through this deep json. So basically instead of having this messy code
... |
I have wrote a smart string container implementation for use in my application, but as I'am not such professional C programmer I have doubts about is I'am did it right and is there ways how to improve it and make it better?
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <wchar.... |
This is a DNS query resolver written in Python 3 using socket, I wrote it entirely by myself, it supports 8 primary DNS query types: A, NS, CNAME, SOA, PTR, MX, TXT, AAAA, and it is working correctly. Albeit the code is a little bit ugly.
Sample output:
In [22]: print(json.dumps(dns_query('deviantart.com', '8.8.8.8', '... |
Write a program that asks the user to enter an integer and prints
two integers, root and pwr, such that 0 < pwr < 6 and root**pwr is equal to the integer entered by the user.
If no such pair of integers exists, it should print a message to that effect.
This is a question from MIT 6.0001 OpenCourseWare. I'm an absolut... |
I have a text file which is tab delimited:
1 324 2344
1 8372 1234
2 62 12
2 872 12111
2 1211 28736
3 87636 198272
The first "column" contains the id value and the rest containing data. I would like a csv file to be created for each id value so in this example, there would be 3 csv fi... |
Often I have async functions that I want to be able to time out, this timeout is independent of the greater scope of the application. However the function should also take into consideration the greater scope and thus needs to receive the CancellationToken that will indicate when the application scope or some other hig... |
For reasons that are too dreary to detail, I need to reproduce several pseudo
random number generators in different languages. It mostly involves translating
ancient C and FORTRAN code. No problems with C, Java, Zig, Julia, etc. But for
Lisp-derived languages, I would like to do something more idiomatic.
For example, h... |
This comes from an answer I provided to a question on stackoverflow here:
https://stackoverflow.com/a/71482194/3258131
To make c# record parameter validation concise and maintain all the benefits of the positional record definition I created the following solution.
The first part is using a "dummy" private validation f... |
For a section of a much larger program that generates plots, I am creating a list of styles that I can pull from to create a consistent format from plot-to-plot. It works as follows
I have a list of colors shade = ['k','m'] and a list of styles style = ['--', ':','-','.'] that I am concatenating to get the desired list... |
I am completely new to data structures and algorithms.
I tried this problem on hackerank. I got the desired output but my code wasn't efficient enough to execute in the given time limit.
How can I optimise my code? Is it proper way to solve this problem?
Question:
A left rotation operation on an array of size shifts e... |
I just started with embeddeded C++ since I only coded in C for the last year and I wanted to do/learn something while I'm in university.
First of the there is the Register manipulation class. I won't include the .cpp file since stuff done there is trivial.
register.hpp:
class Reg {
public:
Reg(uint32_t *reg, uint32... |
I have a simple program where I am deserializing my bytes byteSlice into a ClientProduct array struct. And then I iterate over that ClientProduct array and construct definitions.CustomerProduct struct for each ClientProduct.
Below is my struct details:
type ProductInfo struct {
Name map[Locale]map[int]string
}
typ... |
with basic knowledge of multiset and vectors in c++ I solved the following problem.
How can I improve my code and also handle any input errors?
Problem statement:
There is a collection of input strings and a collection of query strings. For each query string, print how many times it occurs in the list of input strings... |
I have some DTOs returned by my API that have sensitive data fields like CreatedBy, CreatedDate, LastModifiedBy and LastModifiedDate. These fields should only be in the response if the user is authenticated and/or has allowed roles in their claims. My current running solution is to use my DTO mappers that have a depend... |
I wrote reverse proxy using boost::asio. The idea is to send client's data to two external servers and send back response from one of them. Here is my code:
#include <iostream>
using namespace std;
// BOOST ASIO declarations
#include <boost/asio.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/thread.hpp>
#include... |
My goal is to create a function that safely renames files by adding numeric increments if the file is found at the destination, without using a third party library.
Having a source file foo.bar and an existing destination foo.bar the function would rename using foo (1).bar, foo (2).bar, foo (3).bar, etc.
I have to fs.l... |
I've got an array of data from an API called content that needs to have its shape transformed as shown in the console output. Essentially, the objects within each formula array need to be pulled out and put into a formulas array but they need to carry along the role and id attributes of their parent object.
While the ... |
I am working on parsing an orders.csv file with products and prices by different vendors which is kind of a time-series data.
The output of that process looks something like below, with order total by product and vendor -
source_dict = {
'amazon': {'macbookpro': {'total': 1200}, 'ps5': {'total': 600}},
'walmart... |
I've been using the excellent pg-promise library for a few years now, but my primary irk with it is that the stack traces are sometimes unhelpful. For example, the following test will fail (currently on nodejs v16.x):
const pgdb = pgp(config) // see pg-promise link for details, but just know that various db call meth... |
We were tasked to do this assignment where there is the base class employee and two derived class part-time and full-time employees. Here is what I came up with:
import java.util.Scanner;
class RunEmployee {
public static void main(String[] args){
String inputForP;
Scanner s = new Scanner(System.in... |
I am trying to read bunch of S3 parquet files in parallel from a S3 bucket. After reading all these files, I am populating my products and productCatalog concurrent map. This happens during server startup and then I have getters method GetProductMap and GetProductCatalogMap to return these maps which be used by main ap... |
Now I have two algorithms solving a problem: given a general (multi-way) tree, and any array of node names, find the the node that is the deepest common ancestor.
LCAComputer.java:
package com.github.coderodde.generallca;
/**
* This interface specifies the API for methods computing multiple node LCAs.
*
* @author ... |
First attempt to write functional programming, been following OO paradigm all through my programming journey
Please review the code and let me know if any comments and violations of functional programming?
King Shan wants to visit the suburb of A and has 2 possible orbits and 3 possible vehicles to choose from.
Your co... |
Task
I tried to code a treemap function in matplotlib, and one of the challenges is auto-fitting text into boxes of different sizes in the treemap, similar to R's package ggfittext.
My Code
My implementation is as follows:
import matplotlib.patches as mpatches
def text_with_autofit(ax, txt, xy, width, height, *,
... |
I am currently working on building a small search engine (if it can be called that) that allows users to search for relevant articles from a short list of other older websites that do not have search features.
This particular part of the software takes a query from an API via a Redis Stream which is then used to sort a... |
I think the best Random Number on the Planet is PI. I wrote a code that generates a list of pseudo-random numbers in Python. Then it treats this list as positions of digits in Pi and then outputs digits at those positions. I am expecting someone to tell me that this method is NOT RANDOM ENOUGH.
import random
# Read al... |
I have a list of Students and I want group this list by the property NAME, to sort each group ASC by the property GRADE, to remove the first entry from each Group and after thatto return the proccesed list.
Here is what I've done.
package com.example.demo;
import java.security.KeyStore.Entry;
import java.util.ArrayLi... |
I have a Django project that has an HTML page with a table on it.
The table can have thousands of rows in it.
The problem is that, as a customer requirement, each row has 2 <select>'s with options for the user to choose from:
<table>
<thead>
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3<... |
I have a bit of trouble with two-dimensional arrays in C. I want to pass such an array to a function accepting a pointer to pointers. I figured no way of really passing the array itself. Furthermore, I am not very sure if my solution is perfect practice because it is very circuitous and long. Especially because this sh... |
I don't have a formal description for this problem, but here are the parameters:
Given a string S check that each opening bracket has a matching closing bracket.
Any nesting violations are invalid.
Assume multiple nested sets of similar brackets are invalid.
Because the nesting level matters and we can't just arbitra... |
This is a curiosity as a follow up from Purely Random Numbers Generator
import quantumrandom as qr
with open("piDigits.txt", 'r') as f:
pidecimals = f.read()
f.close()
maxrange = int(input("Enter Maxmimum of Range "))
count = 0
for i in range (0,maxrange):
myx = qr.randint()
print(f"Quantum Number {myx}"... |
What is your opinion on this simple school project exercising OOP in C++?
class Person {
public:
Person() = default;
explicit Person(std::string const& name);
Person(const std::string& name, int age);
void setAge(int age);
void setName(std::string const& name);
int getAge() const;
const std:... |
I am looking to write a JavaScript class BasicType with five fixed instances INT, FLOAT, STRING, BOOL, ANYTHING. It should be impossible to create any additional instances.
The instances themselves should have a single enumerable, non-configurable, non-writable property called name. Printing these instances with consol... |
I've 2 tables emp and expenditure.
Emp:
ID, NAME
Expenditure:
ID, EMP_ID, AMOUNT
Each emp has a limit of 100 that he/she can spend. We want to check which emp has expenditure > 100.
Output attributes needed: Emp name, exp id, amount
My query:
SELECT E.NAME,
EXP.ID,
EXP.AMOUNT
FROM EMP E
INNER JOIN expenditu... |
I've implemented a chess engine using the python chess move generation library (which I assumed to be reasonably fast), and have implemented various optimisation techniques for search and move ordering, such as alpha-beta pruning (with negamax) and MVV LVA tables. However, it still takes more than 50 seconds (at depth ... |
I am studying Algorithms by Princeton University. The first week assignment is to simulate percolation by using Java.
https://coursera.cs.princeton.edu/algs4/assignments/percolation/specification.php
Since I am learning C++, I'm using C++ to do the assignment. Unfortunately, there is no grader for C++. Therefore, I cam... |
Here's my doubly-linked list implementation. I'd like to hear what the community has to say, and what feedback I can get to further improve it.
#pragma once
#include <cstdlib>
#include <ostream>
#include <iostream>
#include <cassert>
#define CHECK assert(Invariant());
template <class T>
class List
{
class Node; ... |
It's very basic. I'm learning C# and I want a method to print an array in a readable format. My array could be integers, doubles, or strings. I have implemented method overloading.
From the fact that my method behaves the same way regardless of the input type is, I end up copying and pasting the same code and change th... |
I received feedback that my code was convoluted and written with very bad practices.
Our tutor said explicitly that I should never write the code like that.
I'm just trying to wrap my head around the general concepts of object oriented programming.
I would be very thankful for pointing out what I did wrong, so I can be... |
A follow-up to this question, this post improves on test case issues.
To restate problem parameters, a given string S is considered closed if it:
Has a matching opening and closing bracket or no brackets at all
Respects bracket nesting levels
Has no more than at least one of each bracket type in it
Note that the stri... |
Below is the wording from the problem in Automate the Boring Stuff book. The bold text leads me to believe that I should be checking for a streak and not multiple streaks within each experiment of 100 flips. With that assumption in mind, I would appreciate any feedback on my solution and comments to the problem posted ... |
I wrote a Python script for Web scraping of a Website. Please review my code and suggest me any changes or make me aware of my blunders/mistakes?.
I wrote the almost same script for other websites also so please can you suggest me a way to combine all other scripts into one script so that I can get one single [merged] ... |
Introduction
I have been reading about Consistent Hashing and in an attempt to better understand the concept, I wanted to implement a simple hash ring.
I did not implement the concept of virtual nodes / replication across multiple node. The focus of this exercise was to build a simple implementation of an in-memory has... |
I try to solve the following problem using Python:
Given a 1-dimensional numeric array arr, find all indices where the value of arr changes. Return for each pair (a, b) (where a != b) an iterator of the indices i where arr[i] == a and arr[i+1] == b.
Example:
If the input array was [1,1,1,1,1,1,5,5,5,5,5,5,5,5,5,5,5,1,1... |
I wrote this code to get familiar with structs in C. It allows the creation and exporting of a 24 bit TGA image and changing the color of individual pixels.
My concern is the setPixel function, and how I could improve its performance.
First the conversion from x,y to an array index, how can I minimize/eliminate the nee... |
From the left to the right column calculating the mean azimuth, and using that mean value to calculate the subsequent columns mean value
data (azimuth radians)
DATA = [[-2.3843975194179015, -2.7958149137126727, -2.6810230389823926], [0.0, -0.33324870390860456, 1.9163397142483196], [-2.775696989543418, -2.62753281912120... |
All my code is below. It uses an API to search for a show and then outputs the providers (like breaking bad is available on Netflix).
The main aim of this application was to practice using APIs and object oriented programming as I have been struggling and not very confident in my skill of using Object Oriented Principl... |
I would like to check if a string appears in a list of strings. For that, I have chosen the List<string> type, as follows:
public List<string> list_statuses;
// list_statuses gets filled with 173 entries
// Regular execution of:
string text_list = ...; // Mostly, this is an empty string
int list_statuses_count = list... |
Create a function called GETLYRICS, which will receive as parameters a word of at most 15 letters and a number. It must return the letter of the position indicated in the number.
My exercise is fine but is there any other way to do it?
Here is a link to how the program works : https://www.db-fiddle.com/f/3PnzHErrf2fZFG... |
I made a Json save system for my Unity game. I wanted to make something as generic as possible to keep the code DRY. I couldn't find much information online on how to make something generic.
Could you guys let me know what do you think of it?
So first, I have this utils class to save and load json data.
public class Js... |
I have an application where I need to highlight some information that is printed to the console, so I wrote some static library methods which do that. I tested for bugs. Is my code clean and satisfying, or are there aspects to criticise?
It has to work for multiple lines - given as a string that contains newlines and f... |
I am looking to build a message encryption/decription method that would allow messages to be encrypted in a timely fashion on board an Arduino Portenta H7, using as much of the onboard hardware acceleration as possible, and decrypted using python.
This will be used to encrypt and sign an MQTT payload.
The Server public... |
My objective is to enter/type in values into Excel cells if the column names and indices match between Excel and dataframe.
So, my code does the below
Gets the ID values from the dataframe
for each ID, see whether it is present in excel file
If they are present, get the column name list for those corresponding IDs (... |
0) Problem / Current Solution
I'd like to create two strings that are really similar like this (demo):
private const string Base =
@"AAA
CCC";
private const string BasePlusExtra =
@"AAA
BBB
CCC";
This solution is perfectly fine as is, but doesn't feel very DRY.
Also, in reality, the AAA and CCC sections are very lo... |
The code below plots a background image (sky) and then a Gundam sprite using Matplotlib. It also creates 4 buttons with obvious purposes.
The Gundam class stores 2 plotted image objects by the name .img_object and .img_riflemode_object. By default the code plots the .img_object (set to visible = True), and the .img_rif... |
I've tried to solve a challenge posted on a LinkedIn forum using Haskell - a language I'm still learning the basics of - and, while the code works correctly, I would like to get some feedback on the coding style, and learn what could be improved.
The task is to add all Armstrong numbers within a range.
An Armstrong (or... |
I had to write a cycle that loops a log file and assigns a given status according to some logic.
I didn't post the whole code but this is the script that bugs me the most... why?
Well, first:
I thought I was writing OO... but I guess, I didn't
Each import from Status is an Enum, it might be wrong, and I auto-assign e... |
I have written web scraping code with selenium with python3 for a dynamic site (it was my first project that is why I started with selenium). In my code I extracted the values and created DataFrame.
My question is, while extracting the values I created lists like this
and when the for loop ends. So I wanted to ask you ... |
I have created a function which randomly sets styles using CSS selectors. Right now it returns a random item from an array. The program also works with shorthand properties (such as font).
Could my code be improved and run more efficiently?
const setRandomStyles = (obj) => {
console.time("Executed in ");
Object.e... |
As part of my first python project, I needed to know what the dominant hue of an image was.
I started with finding the modal hue of the image, but the results seemed really odd in images with pale/dark backgrounds. This lead me to applying a threshold to both the saturation and value channels of a HSV image, so as to i... |
I have many observables so I use combineLatest in RxJS. After get all results I need to check one of value by using if condition. If the condition meets then call another HTTP service so I use another observable. Finally I render the data into UI.
const a$ = this.http.get('url_a'); // observable
const b$ = this.http.ge... |
I have a settings section to my UI which keeps track of a myriad of user settings. The settings are requested from an API when the app loads, and then used in the section to populate what the user's current settings are. I am using redux for this. For example:
const Settings () => {
const dispatch = useDispatch();... |
I have some data that represents the area, speed(meters per second), and azimuth(rads) of a polygon. The objective is to determine the mean for each set of parameters. With that mean value, apply a threshold to remove data points that fell outside of the mean deviation threshold. Then recalculate the means for the p... |
So this is my first Python project and hoped for a bit of feedback.
I'm trying to make a little program, where I can insert n equations and run a numerical solve. I ended up using tkinter for the GUI as it seemed very approachable, and sympy for the math part.
I'm unsure if the overall structure of the program, is good... |
So I was tasked with making this and I was able to fing a way to make it work as intended. I was wondering if there is a simpler way to get this same result?
function generatePyramid() {
var totalNumberofRows = 10;
var output = '';
for (var i = 1; i < totalNumberofRows; i++) {
for (var j = 1; j <=... |
I have this CLion project on GitHub. It constructs a directed, weighted graph consisting of 100 thousand nodes and 500 thousand directed arcs, picks two random nodes, and computes the shortest paths between the two using both versions of the Dijkstra's algorithm.
Code
algorithm.c:
#include "algorithm.h"
#include "dary_... |
There is a file created with the project paths in a dictionary.
Example:
export const URL = {
DASHBOARD: '/dashboard',
SETTINGS: '/settings',
PROFILE: '/profile',
PRODUCTS: '/products/'
};
And in the file where the routes are used, the urls are imported. A coworker and I are debating about two ways to write the c... |
I've got this function which reads an entry until the next starting Token determined through a function, as the nature of the token is flexible.
Usage:
// pattern is java.util.regex.Pattern object determined in function of the file which is read
Function<String, Boolean> startToken = s -> pattern.matcher(s).matches();
... |
Make a procedure called paintletter, it receives two parameters,
a letter and a number. it will have to paint on the screen lines with the specified letters starting with a letter and ending with as many letters as the parameter says (USE BUCLES).
My exercise works but can it be improved in any way?
USE almacen;
DELI... |
I am a hobbyist and do not work in the industry, but I do have an interest in programming an cryptography. I decided to have a go at writing a 128bit implementation of AES in C++. This is my first ever C++ program and I learn as I went. So I'm sure there are a lot of bad habits or things that are simply wrong.
But it d... |
I have code that I have been using for 2 years and it was working perfectly until recently. It started to give a timeout warning a couple of weeks ago and now it's not really running anymore. The code pulls every picture from 13 different folders on google drive and then adds them to a sheet, it was giving the timeout ... |
This is my first time writing a custom thread pool in C++. I would love some feedback on how my code looks and if I am missing best practices or have glaring/subtle issues. Thanks!
ThreadPool.hpp:
#pragma once
#include <atomic>
#include <vector>
#include <iostream>
#include <thread>
#include <future>
#include <mut... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.