instruction
stringlengths
71
95.1k
I've got to make a form using Bootstrap and Angular, which validates the following requirements: Old password, new password and confirm password are mandatory fields. New password has to be equal confirm password. My HTML-code: <div class="container"> <form [formGroup]="form"> <div class="form-group"> ...
I am using the following format for my task management: https://github.com/todotxt/todo.txt Do some stuff +uni due:2022-12-31 Write some paper +uni due:2023-01-10 I am not using the syntax for priority. I know there is a command-line tool one can install to manage items but I just needed a sort function and decided to...
So I have this binary spaced partition leaf: #[derive(Clone)] pub struct Leaf { container: Rect, left: Option<Box<Leaf>>, right: Option<Box<Leaf>>, room: Option<Rect>, split_vertical: Option<bool>, } impl Leaf { fn new(container: Rect) -> Leaf { Leaf { container, ...
I've written a program that uses a binary tree to essentially 'learn' about animals given the name and questions about them. Learn is probably a little strong of a word, all it does is store the questions using bincode (pre-release 2.0.0-rc.2) and ask them later to figure out what the user is talking about. #![warn(cli...
I wrote a pool allocator (Arena) for a compiler I'm writing. My use case for this allocator is for storing the parse tree because it allows me to free all the memory at once, so I don't need to keep a reference to each node (which makes the code and logic a big mess). The implementation uses a singly linked list of blo...
Some time ago I tried to make a generic linked list in pure C (no external libraries, only the C standard library) using void*s here. Building on top of that and with the same restrictions, I'm now making a hash table. hashtable.h: #ifndef HASHTABLE_H #define HASHTABLE_H #include <stdbool.h> #include <stddef.h> #incl...
In my project, I'm trying to use the std::pmr allocator and monotonic_buffer_resource. I'm using vector in various classes, and I need to use the same resource in all of them. I created a separate free function that returns the resource pointer and used it while declaring the vectors. Here is the code #include <memory_...
Since charset conversions is so darn badly implemented and most standard options are deprecated I recently wrote a wrapper around iconv that converts from system narrow / multibyte character set to UCS-2 (wstring), UTF-8, UTF-16 and UTF-32. sconv.h #pragma once #include <string> #include <string_view> #ifdef SCONV_DL...
Link to newer version: A GUI Multimedia Player with acces to the Youtube Database (3) I am working on a GUI Youtube Player. When I had a first working version, I put it here on CodeReview, getting many helpful comments, and I made now a kind of version 1.0, with many improvements, in code structure, functionality and ...
I am reading the book OS three easy pieces, In the semaphore chapter I am going through barrier.c question. Below is the code that needs to be completed for the desired output: #include <assert.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <pthread.h> #include <semaphore.h> #include <sched.h> ...
The following code tries to convert an unstructured TOC with bounding box layout data given by the output of pdftotext -bbox-layout -f 11 -l 13 new_book.pdf toc.html in a html file into structured data on a DataFrame. I intend to use this data to build the internal TOC of a pdf document from scratch. I would like to he...
I'm new to web scraping and tried building a web scraper for Amazon customer reviews. The program works fine as is but I wanted to improve the design and get some feedback. The basic idea was to scrape customer review contents on Amazon product review pages using specific URL structures. 1. URL to search for product na...
I'm using the following two functions to calculate the determinant of A. Would this code be considered to have an asymptotic time complexity of O(n³)? The recursion is throwing me off, but I think that it would, since it would end up looking something like: n³ + n³ + ... based on however many cofactors of the original ...
I am familiar with Python but recently I have been trying to solidify my skills as a Python developer. I decided to do a project that would help me build some skills using the fundamentals of the language (limited modules, mostly just vanilla Python). I did this Slot Machine program, inspired by Tech with Tim, and I wa...
I'm relatively new to rust, so you don't need to go easy on the criticism. right now, this lexes 1MB of text (well, trims a 1MB-long word) in 30ms. is there any way I can make this faster? cursor.rs: use std::str::Chars; #[derive(Debug)] pub struct Cursor<'a> { peek: Option<char>, pub chars: Chars<'a>, pub...
I may introduce a Python code of prime factorization which is from my personal project that I'm working on. import timeit import gmpy2 import math A = gmpy2.mpz(11111111111) # Input a positive integer to factor. # Put it inside the parentheses as "A = gmpy2.mpz(....)" def factor(A): B = gmpy2.mpz(math.sqrt(2 * A ...
I'm writing a basic tutorial for a simple console menu for Python. I think it is secure, since the input() is controlled by a dispatch. Any suggestions would be appreciated. """ Nice Menu for Python """ import time # used only for testing purposes def m_help(): """ - - - - - - - - - Micro Menu Help - help line 1...
This is a tiny class that creates backup copies of a file so these can be diff'ed to spot the changes compared to last run; used when generating code and so far has proved to be very helpful. Basically, I reuse the async disposable logic because it doesn't really make sense to write it twice; the documentation simply d...
Is this fastest and most reliable way to copy multiple database files (SQLite) from one location to other and overwrite them if they already exists, safely ? Currently I'm using the below approach : string sourceDir = @"G:\test\from\"; string backupDir = @"G:\test\to\"; string[] databaseFiles =...
I am currently implementing a flat_map like container in C++, and had problems with the comparator used. Thus, I reduced it to the bare minimum which I will present here. (In particular, my code here implements a set instead of a map). template< typename T, typename Compare = std::less<T> > class flat_set : private Com...
Description This javascript code uses tmi.js to listen for chat messages in a Twitch chat and perform certain actions depending on their content. In the sample code provided, if the message starts with !add, !taskadd, !addtask or !taska it will call the addTask command handler which tries to add the task to a list of t...
I'm cleaning up my Flutter code and I'm not sure if I'm writing my Flutter code in the correct style. First, here's my code to import the file: import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:go_router/go_router.dart'; import 'pack...
I've written a module for running ETL pipelines. The goal was to standardize API use in pipelines while making the pipeline easy to create and maintain. I'm not a Python guru by any means, and I'm wondering how I could continue improving this. It's not complete even by my standards yet, as I still need to clean up some...
I'm trying sqlx for the first time these days, sorry if this is a dumb question. I'm writing a function that I want to take both PgPool and Transaction<Postgres>. I'm using the below (SIMPLIFIED) code: #[derive(Debug, Default, sqlx::FromRow)] pub struct PgPlayer { pub id: String, pub created_at: time::OffsetDat...
I was curious on how annotations are used during runtime, so after some googling I gave it a try, but kinda have the feeling that is not the proper way as I still have to call the annotation helper on the object. Maybe I'm confusing annotations with Typescript decorators where you can have all the code and logic inside...
I've read that fopen() is deprecated, and fopen_s() is recommended in its place. But there are many posts outlining the problems with fopen_s() in Linux. Several tutorials just avoid mentioning that issue, and show how to use both functions. With that in mind, how should I change this basic function to operate in a m...
I am developing an API and I have some questions about variables from another class. Here is an example (reduced code to be more assertive): File user.py from ..db_func import * from flaks import jsonify class User(): def __init__ (self, P_id_user = None, P_login = None, P_nome = None): self.id_user = P_id...
I am working on a blogging application in Laravel 8. The application assigns users roles and permissions. There is a many-to-many relationship between roles and permissions. I have created a custom middleware to give users access to routes based on their permissions: namespace App\Http\Middleware; use Closure; use Illu...
I currently have code that is working but I think it can be optimised. The code waits until a player joins and adds the player to a BlockingQueue if there is not already a Player waiting then it starts a game. The code also allows for multiple games to be played at the same time. The Players are two different threads t...
My friend is kind of new to coding and he decided to write a console tic-tac-toe game. He then showed me his code and I thought it would be cool to optimize it a bit and rewrite in my own way. I tried my best but I'm pretty new to C++ and I'm not super experienced in optimizing things so I'd like to know about ways to ...
I have implemented an integer square root function that is branch-free and runs in constant time, using the first variant found in this answer as a base. All possible values for the types byte, ushort, and uint have been exhaustively verified against the Math.Sqrt function. Validating ulong and UInt128 completely is no...
Having this React component: import RadioButton from './radio-button'; import { Label, Horizontal, Vertical } from './radio-button.styles'; import { RadioOption, OptionGroup } from './radio-button.types'; const RenderedOptions = ({ label, options, onChange }: OptionGroup) => { return ( <> {options.map(({ v...
I need to take a user's name and format it 'lastName, firstName middleName'. If firstName and middleName are not present then the comma should not be included with lastName. Below is what I came up with and I'm wondering if there are ways I can make this better. The code was adapted from another function written by a s...
Here is my code: typedef std::complex<double> Complex; typedef std::valarray<Complex> CArray; void FFT(CArray& x) { const size_t N = x.size(); if (N <= 1) return; CArray even = x[std::slice(0, N/2, 2)]; CArray odd = x[std::slice(1, N/2, 2)]; FFT(even); FFT(odd); for (size_t k = 0; k...
This program solves a version of the subset-sum problem: given a set of non-negative integers \$S=\{a_1,a_2,\cdots,a_n\}\$ (they may not be distinct) and a non-negative integer \$s\$, decide whether there exists a subset of \$S\$ (let's call it \$T\$) such that \$\sum\limits_{b\in T}b=s\$. Let the sum of all elements i...
I tried to implement a windows hook to grab foreground window event. This code is probably bad because I didnt understand much. Can you tell me if that is better than a simple while loop that checks the foreground window every 0.1s for a change? Is this code okay or just horrible? How can I stop this "listener" when I ...
I found myself many times in the past trying to generate fake DataFrames in pandas. I decided just for fun, to write a script that I can specify some inputs and generate that DataFrame for me. Here you can find the code: import random import pandas as pd from faker import Faker def generate_dummy_dataframe(int_cols, f...
For learning purposes, I wanted to implement a class that could hold JSON data with std::variant. Most of the implementations I found online were using incomplete types as template arguments for map, which is -at least according to my understanding- not C++17 compliant and implementation dependant (sometimes not compil...
I'm studying MPI and I'm trying to solve the exercise (number 3.5) taken from Pacheco's book Introduction to parallel programming. Essentially the exercise is: Write an MPI program that computes the matrix vector product Ax using a block-column distribution for A. Look at what the function MPI_Reduce_scatter does. Ass...
This fairly simplistic working example covers: Handling multiple sets of data without code repetition Fetching data and using useEffect to process the output when completed Changing from loading screen to data display/error message using conditional return statements No use of async/await Looking for some suggestions...
When working on my projects, I often need a 128-bit integer type. For this purpose, I use the __int128 compiler extension. Here is the implementation I am currently using: /** * Support for 128-bit integers. */ #ifndef WIDEINT_WIDEINT_H_ #define WIDEINT_WIDEINT_H_ /* all GNU compilers */ #if defined(__GNUC__) #pra...
I've just started learning Golang and was solving some problems which required me to read lines of text from a file. I decided to abstract away the reading part so that I can use Go's range keyword to iterate over lines of any "file". Here is my attempt: import ( "bufio" "fmt" "io" "io/fs" "os" ...
Like many posts before, I'm going through The C Programming Language, 2nd Edition, by Kernighan and Ritchie. I am very new to the c programming language. While I have a somewhat decent understanding of programming basics, I'm most looking forward to learning about memory management in c. Anyway, I'm looking for feedbac...
I’m trying to make a 3d renderer but I can only get at most 20fps on idle. I tried using @functools.lru_cache(maxsize=None) on project_and_rotate() and got it up to 40fps on idle. Is there any way I could make this any faster? I’m using a long math formula I found a few month ago but it seems to be to slow for the map ...
I'm trying to write a function in python that detects a pixel signature in an image. The pixel signature is a small image of a maximum of 16 pixels of different rectangular shapes, e.g. 1x3 pixels, 2x4 pixels, or 4x4 pixels. The image in which we want to detect the signature is between 800x600 and 1920x1080 in resoluti...
I'm trying to use ECS with Pygame and was wondering if I'm doing this right before I go any deeper than this. I've tried learning more about ECS but it's mostly in another language, which I could understand sometimes but it often confuses me. import pygame import sys class Entity: def __init__(self): self...
I have built a project OOP Tic Tac Toe. I am beginner-intermediate developer. Can you tell me what I can improve, what I did wrong and what to look up to? This is my first OOP project. I'm happy that I built in looking for any reviews I struggled a little bit with play_the_game() function because I got some times that...
The goal here is to pull an item from an array and when the array ends - to start over - and allow you to pull items infinitely as needed. We don't use PHP that much, so please let us know how we can write this succinctly and with best practices. :) class ColorGenerator { public function __construct($colors) { ...
I have been working out on C++ code lately just for fun and decided to make a simple logger in it. The code works fine, but it would be great if someone more knowledgeable could point out any mistakes/bad practices I would have carried along in my code. Also was curious on how I can go about writing testcases for the s...
Are there any major flaws to implement this test helper function? I know that the preferred way (refactoring) would simply make the function to be tested return its value and delegate printing to another part, but sometimes one has to test what is there. import ( "io" "os" ) // captureStdout calls a function f...
I'm working on the famous clump finding problem to learn Haskell. Part of the problem involve breaking nucleotide sequences, called kmers, into subsequences as follows: ACTGCA -> [ACT,CTG,GCA] This sliding window generates all possible kmers of length k, 3 in the above example. The problem is my very simple algorithm ...
I'm new to playwright, so I'm unsure if this is the correct or best way to go about testing. I basically want multiple tests on the same webpage. I've been able to successfully accomplish this using test.beforeAll: test.describe("sign in with an invalid email/password combination", () => { let page; test.beforeAll(...
My goal is to create a really seamless multi step form for onboarding with only PHP. It stores in sessions and cookies, and retrieves the session data from the cookie if it is stored. This is what I came up with but I feel it is pretty messy, and the more steps I have the messier it gets. I'm sure there are cleaner way...
I am looking for opinion on this bitset implementation. It only has 4 functions and they are set - set a bit/clear - clear a bit/check - test a bit /zero - zero out all bits. There is another one as well but that isn't meant to be used by the users of bitset. I have used macro to make the underlying type that bitset us...
I'm trying to create some system for profiling and I need to track different data types (double, float int). I have a container that can hold some base type, and then perform actions on the concrete type by switching on the enum or something similar. I need to have a base type so the data can be copied/passed around if...
Third update, now in OOP. Link to previous post: A GUI Youtube Player (2) Link: https://github.com/floris-vos/gui-youtube-player This is a multimedia player that gets its material from the database of www.youtube.com. It can play either video and audio, or audio only(the original concept of this program). Selecting su...
Ensuring that some logic is always being run before the user's overriding methods. I'm writing a library and I have some abstract classes that can be binary serialized (and users can subclass them and further implement their serialization logic) e.g. abstract class Base { protected int id; public virtual void S...
I'm currently making a discord bot playing music, I've been having a lot of problems these days with the song queue so I decided to make my own. I used to read music bot repos and it seems they use some kind of lists optimized specifically for append() and pop(). Could someone please enlighten me on this as I think it ...
(Before I even start: For reasons beyond my control, this code base is constrained to C++98 (so, no =delete, no auto etc., but that's also not the gist of this question). The code cannot use templates or the STL.) I inherited code that combines calls from two distinct modules which both have the ability to set and remo...
I have a word document that contains alphabetical bullet points along with the key: value that I am trying to input into a dictionary using docx. Example: This is my document a. First name: Jeff b. Last name: Smith c. Position: Manager d. Birthdate: 01/01/1990 e. Address: 123 Main Street, Smithville, Mai...
I wrote this shortcode parsing and it runs in \$O(N^2)\$. Is there a way to better optimize this? package shortcodes import ( "regexp" "strings" ) var ( shortcodesRegex = regexp.MustCompile(`\[\S+(?:\s+[^="]+(|="[^"\]\s]+"))+\]`) ) func Parse(content string) []map[string]str...
I am creating a video parser in C# WinForms. You select files, they get parsed then a custom control (ViewWideNarrow ) is created showing the video's name, duration and so forth, which is then added to FlowLayoutPanel1. The user then selects in what order to display said custom controls, titles alphabetically or by Bit...
I've been trying to make refactor really simple 2d sprite engine in OpenGL. As a start, I'm trying to use instanced rendering to render several copies of the same sprite in a square formation across my screen. The code works fine but it is quite slow; I am getting about 20 frames a second when rendering 25600 copies. R...
Let's suppose there is a method of an Inputter class that queries many questions. The Human inputter would have to answer all those questions, but an AI inputter will do so without the questions being displayed to the screen. Some goes for command classes that contains the Inputter* as data member. We don't want sepa...
I am currently working on a site product where I have to create a site-header that is always fixed on top of the viewport but when I scroll down it hides, and again when I scroll up, it becomes visible again. Actually, I made it happen somehow but I think the JQuery I used can be simpler and currently has some unnecess...
I am working on a lexer in rust. It has been through many different iterations, going from iterating over a Vec<char> to std::str::Chars to std::str::CharIndices, from pushing chars onto a String to taking a slice of a &str. i'm trying to speed up my implementations, so today i decided to ditch the Chars and instead ha...
I am working with: ruby 3.0.0p0 and Rails 7.0.4 and rspec-rails (6.0.1) I want to test my views. I created Product model with rails scaffolding. I tested all views but I am not sure about _form.html.erb testing. Because I have two status for this view. One of them is New page and other is Edit page. If I go to Edit pag...
I'm not proficient at Python. My question is twofold: whether this selection sort algorithm implementation for number lists could be considered clean code (in the sense of being modular and maintainable), and how should I go about making it more Pythonic if necessary. def selection_sort(the_list): for sorted_sublis...
Here, is my implementation of Iterative Closest Point algorithm in C++. The code is written using the Eigen library. I have tried to implement an efficient coding methodology best to my knowledge however, I believe there are still improvements that can be made in terms of vectorizing the code and getting rid of for loo...
I've seen a few implementations of N-Dimensional arrays in C++. This is the first time I've worked with them and wanted to get some opinions on my implementation. #include <iostream> #include <memory> #include <array> template <typename T_DATA, std::size_t N> class Nd_Array : public std::shared_ptr<Nd_Array<T_DATA, N ...
Question Write a program to prompt the user for hours and rate per hour using input to compute gross pay. Pay the hourly rate for the hours up to 40 and 1.5 times the hourly rate for all hours worked above 40 hours. Use 45 hours and a rate of 10.50 per hour to test the program (the pay should be 498.75). You should us...
So I've been looking into dependency injection for WPF while still using an MVVM pattern. And something that's been incredibly difficult to wrap my head around was, how to create a navigation service and map it to every ViewModel which needed it. So without using any nuget packages, this is what I came up with. In my A...
This is a modified exploit proof of concept targeting the BlogEngine.NET content management system (CVE-2019-6714) for the .NET framework. I modified it (from Cobb 2019) to execute payloads via mshta.exe as opposed to its original implementation: which was to initiate a generic reverse shell via C#'s network socket pro...
I am learning Python through Automate the Boring Stuff. And I was trying to do the practice project Sandwich Maker in Chapter 8, although I somehow already solved the problem but I encountered some issue in the coding process. Here is my code: import pyinputplus as pyip bread_type = { "Wheat":2.2,"White":1.2,"Sourdoug...
Preamble The first following code explains the context. QgsProject.instance().addMapLayer(comuni) #I call a vector in QGIS that is displayed as map that I am interested to build df7 lyr2 = QgsProject.instance().mapLayersByName('ac_002_1_v1_1_limiti_giurisdizionali_indicativi_comuni')[0] #from the vector ac_002_1_v1_1...
I'm trying to solve the following exercise: Compute in parallel with MPI the lp norm of a vector of a predefined size N allocated on the heap. Your implementation must work also when the number of processes p does not divide the number of of elements N. Here's my code. p is the number of ranks, while norm_p describes...
I'm working on a project where I need a strong AI for a combinatoric game, and decided to go with Monte Carlo Tree Search because the specific game will be original to the project - no good heuristics exist, so MCTS is more appropriate than something like minimax. Originally I wrote the AI in C# because that's what the...
I am trying to solve the 2009 Canadian Computing Competition Senior #4. The question gives you a map (graph) of different cities, and the cost of transporting something between each city. There are also a few select cities that sell pencils, at a specific cost. You are then given a destination city, and asked to find t...
I am working on a blogging application in Laravel 8. The application supports themes. In a nutshell, theme support works like this: In the views directory, I have the directory containing the views of every theme. In public\themes I keep the assets (CSS, Javascript) of every theme. In the SettingsController controlle...
Determine if all the phrases are found within the input string. If they're all found (using distance as a measure of leeway) return True. Else False. Example: input = 'can i go to the bathroom in the morning', phrases = ['can go', 'bathroom morning'] if distance is 1 then this won't result in a match because 'bathroo...
As pointed out in the answer by Victor Eijkhout to this question, the fact I am broadcasting the same vector to each process is against the MPI principles and, most importantly, will be a bottleneck for larger values of N. Here's how I changed my code. Now each process should own a local_size portion of the vector. I t...
I have two collections: A list of strings A hashtable let properties = [ "First"; "Second" ] let hash = System.Collections.Hashtable () hash.Add("First", "Blub") hash.Add("Third", "Blob") My goal is to find the key which is not in the properties list. My solution is so far: // Casting my hashtable to a...
I am using a template for a text inputs and feedback messages to simplify my html code. This passes in variable string called label and populates the placeholder value for this input, and also uses the same string for the invalid-feedback message, but for the latter I want the correct a or an depending on if the label ...
nov.el does not provide an easy function to search the whole of the ebook content. Every search performed on buffer only applies to the "document" or chapter of the book on display at that time. I wrote my own search function with reference to this answer below: (defun nov-search (pattern) "Search whole ebook in nov....
I have written a PowerShell-script, which reads specific data-pieces out of a given JSON-file. Then reassembles the read data. Finally prepends the data to a existing CSV-file by adding it to the top of the file. My script: $srcFile = ".\output copy.json" $targetFile = ".\demo1.csv" # Exit the script, if one of the fil...
Continuing to slowly progress through The C Programming Language by Brian Kernighan and Dennis Ritchie. The code I came up with below is for Exercise 1-18 - Write a program to remove trailing blanks and tabs from each line of input and to delete entirely blank lines. Feedback is much appreciated. In particular, I would...
Looking at the SDL library. Looking to load images from file into an SDL_Surface using the SDL2 Image API to do this I need to implement the SDL_RWops object class in terms of a C++ stream. The reason I want to use SDL_RWops and use a C++ stream is so that I can do a tiny amount of wrapping and use the standard C++ ope...
I have implemented a function to concatenate string literals at compile time. Basic requirements: Very simple API. Can be used as a one-liner. Must accept variadic string literals. Highly optimized instruction set, no runtime-overhead. Basically concat("A ", "quick ", "brown ", "fox"); should not differ (much) from wr...
I have a code block that imports CSV to list and map to a database. And there are few validations and I've to return error messages based on those validations. Right now all those logic is handled by multiple if else conditions. The code is working but I don't think it's the right approach. Is there any way I can repla...
The idea is to have an octree that stores a 32x32x32 region of 15 bit values more efficiently than a 32x32x32 array, because if all 8 leaf nodes of a given branch are the same, the branch does not need to be allocated and can just be stored as a single value instead of 8+. This recursively means that if all values are ...
So I tried to create a code which aims to diagonalise symmetric matrices via Givens algorithm. The program only works for symmetric matrices, for we know a symmetric matrix is always diagonalisable, and it takes values which will be set as columns. Due to the matrix being symmetrix, the user will type all the values fo...
My leetcode solution has been (finally!) accepted but I know it can be improved - in particular line 12 and 13. How can I make this code simpler and more efficient? How can I name elements that are duplicates instead of extracting it from a list? Q: LeetCode Two Sum Given an array of integers nums and an integer target...
Is there a more efficient way, without a loop for example, to find a the end value for n for a specific x? #include <stdio.h> int main(void) { const int x = 13; int n; for (int c = 0, p = 0; p < x; ++p) { n = c+(1<<p); if (p%3 == 0) c = n; } printf("%d\n", n); } The firs...
I have created a tab Accordion. at present it works fine. it should: open and close on click ( shuffling ) on click of a tab other tabs should be closed if open already. for this, I used 2 userEffect hook and a function to handle my click event. it is utilizing the provider from context as well. I am little bit confu...
Initial review requested here: The big thing I had missed was that read/write either work successfully (and all requested data is read/written) or it fails the flags are set appropriately. For write this is easy. It work and we can return num or it fails and we return -1. For read it is slightly more complex. A read th...
I wonder if there is a nuget that can do this already Anyway, here is my code Public Shared Function splitArrayIntoSmallerArrays(Of someObject)(arrayOfSomeObject As someObject(), chunkSize As Integer) As List(Of someObject()) Dim output = New List(Of someObject()) Dim newestArray = New List(Of someObject) ...
(See the next iteration: Delayed, concurrent event stack in Java - follow-up ) Motivation I was confronted with a task of having "message events" for a GUI program. The use case is as follows: we have two events; A and B. A is visible for, say, 10 seconds; and B is visible for 5 seconds. Also, suppose that B triggers ...
I'm using Styled Components for styling and there are many icons defined in the project so in the style file we have this code: my-component.styles.ts import { ReactComponent as CloseIcon } from 'svg/close.svg'; import { ReactComponent as OpenIcon } from 'svg/open.svg'; import { ReactComponent as DeleteIcon } from 'svg...
i have been working on a very big project for some time. Within this project, I wrote my own CUDA-kernels to do various operations. One of them is to perform a sparse affine transformation to a list of sparse inputs. Basically my input is a list of sparse vectors which are always either 1 or 0. I know for a fact that I...
I have been experimenting with methods to read large text files into a Scheme program as a single string in a performant manner. Development has been in R7RS Scheme, specifically Chibi-Scheme. After trying many approaches, some quite complex and involved, the best performing have been quite simple. Following are three ...