instruction
stringlengths
71
95.1k
The script below uses an ArcPy package which helps to create buffer of the impact around a location where a blast occurs(user entered), intersects with building footprint which is the point of interest to figure out if the blast impact will be there on the point of interest. This I am intending to use for blast analysi...
I have written a Java Program to place a bunch of rectangles into the smallest possible rectangluar area(no overlapping and rotating). Here is a short summary: I calculate minArea and maxArea: minArea: minArea is sum up all given rectangle areas. maxArea: put all given rectangles side by side, maxArea is rectangle are...
I have a method that takes a JSON string as input and "fixes" it. By that, I mean, that the JSON string comes in with all values quoted. My method un-quotes the values that shouldn't be quoted (i.e. true, false, numbers, {}, etc). The method was originally doing it by doing 4 string replaces (for the true / false, etc)...
Given a chessboard of N size (square matrix), the position of Knight and position of a target, find out minimum steps (both count and exact steps) from start to target for a Knight. If it is not possible to reach to the given position, return -1 as step count. Here is my implementation in Scala (assuming N = 4 or 4X4 c...
I am working through a PHP book, and date comparison was mentioned as one of the uses of usort(), so I wrote a date comparison function to use in line with usort(). Writing the function wasn't as easy as I expected (there was a pesky bug which took me a while to identify), so I thought I would submit my comparison code...
For a computation engineering model, I want to do a grid search for all feasible parameter combinations. Each parameter has a certain possibility range, e.g. (0 … 100) and the parameter combination must fulfil the condition a+b+c=100. An example: ranges = { 'a': (95, 99), 'b': (1, 4), 'c': (1, 2)} increm...
I'm new to programming and in back-end. Right now I'm trying to learn flask, so I wrote a very simple website that currently encrypts and decrypts the message using RSA and DES. I feel like my app.py file is just bad and should do it much better. I mean, there're a lot of repeating code like this: @app.route('/rsa_...
I currently have an Android Activity that allows the users to select the startDate, endDate, startTime and endTime. Once they click the "submit" button, I will combine the startDate and startTime together, and then convert it to milliseconds. The milliseconds will then be used to set an alarm using the AlarmManager. So...
I just created a simple game. Now I'm thinking what could be done better here. I want to get some tips how to make the code better/easier or what to add to it. Code: import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class Test extends JFrame implem...
I'm doing a lot of Python development lately for various (small-)data analysis pipelines at work. I've been wrestling with how to robustly and ~automatically version the code at a fine-grained level, so as to provide strong guarantees of reproducibility of a result generated from any particular version of the code, at ...
When I show others how to use this module I have them make a PROJECT instance and then add other objects. >>> from Abstracted import PROJECT >>> project = PROJECT('bob', Y_factor=2, use_MQTT=True) MQTT status: started Yay, your new Project named "bob" has been created They may do this from a terminal which does not ...
I've created an RPN evaluator in Haskell, as an exercise because I'm new to this language. It runs well: $ ./rpn 2 3 4 5 + - + -4 And the source code: {-# LANGUAGE BangPatterns #-} import Data.String import System.IO data Token = TNum Int | TOp Operator data Operator = Add | Sub | Mul | Div main :: IO () main = do ...
I wrote a MergeSort implementation of doubly linked list, based on the MergeSort implementation of array on the textbook Algorithms 4th, which is definitely \$O(n \log n)\$. I think my linked list implementation is \$O(n \log n)\$, but it runs so much slower than the array version so I am getting very confused and dou...
I just want feedback about the code. Better implementation, more commentary etc. app Delegate.swift import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: ...
This is a little project I did over Christmas, I wanted to understand a bit more about how RFC 1951 (https://www.ietf.org/rfc/rfc1951.txt) compression worked, mostly out of curiosity really. RFC 1951 is used to compress PNG images, zip files and portions of PDF files ( and probably other things as well ). I have tried ...
I have a script running as an hourly cron job. It finds all screenshots on the Desktop and moves them to directories sorted by year/month/day. On MacOS, screenshots are automatically saved to the desktop with the following filename structure: "/Users/<USER>/Desktop/Screen Shot 2019-01-02 at 11.56.42 AM.png" require 'fi...
I tried to make a generic, header-only vector thingy I can use in other projects in the future. I omitted documentation comments because it's already quite long. #ifndef __VECTOR__ #define __VECTOR__ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdbool.h> static int VECTOR_DEFAULT_SIZE = 1; t...
I have a PR implementing denoising discrete Lanczos derivatives, following this paper. The following code works well, but the design is a train wreck, and I was hoping to get some advice to improve it. But here's what it does: Give it some noisy data, and it will compute a reasonable derivative from it, so long as the ...
I was looking to get some reviews of my code, so I can improve my writing. Functionally it works the exact way I want it to based on my patch notes .md file. I'm open to all suggestions for improving the code, especially in making it more performant. state = { open: false, notes: null } componentDidMount() { ...
While I was working on a personal project, I found I needed to exclude certain characters in a regex range. So I thought, why not implement a custom range exclusion check for greater efficiency, it'll only take 5 lines or so. 60+ lines later, I produced this: regex_supplement.py: """Supplementary regex modifying method...
Simple truncating method for characters, words, and sentences for a personal utility library I've been working on. Improvements & criticism welcomed! Especially around default param usage, as I've not utilized it much to date. const truncate = (( value = '', int = 0, elipsis = '\u2026', /* ... */ prune = (val...
I am trying to do an auxilliary function to print pairs of value-uncertainty in a formal way, given their name, value and uncertainty. The "technical" agreement is that "uncertainty rules", meaning that the significant digits of a pair to be printed are given by the decimal size of the uncertainty value. For example: r...
I have been working on my first ever C# project and I'd love some feedback of the any and all aspects variety. I am building a game called Fleet Command. In the MainWindow I use a ContentControl to use various UserControls based on user interaction. The screen navigation is pretty simple so for the most part I am leavi...
I have a text file with letters (tab delimited), and a numpy array (obj) with a few letters (single row). The text file has rows with different numbers of columns. Some rows in the text file may have multiple copies of same letters (I will like to consider only a single copy of a letter in each row). Also, each letter ...
I have a function that will calculate the sum of a list of integer, however if any of the number is negative, it will should an error instead (not throwing exception). The following is a working Haskell code (Glasgow Haskell Compiler, Version 7.10.3): addAll :: [Int] -> Either String Int ...
I learnt lots about ruby from my last post Game of Life in Ruby, so I have my next try in Ruby, it is Gomoku. It is still an console game and I use three classes Game Grid Cell, the structure is similar with the @Johan Wentholt 's example code. But of course game rule is different. Game class Game class to run the gam...
PHP's shuffle() function destroys the array keys, so I decided to write a shuffle function that doesn't do that and instead rearranges key-value associations. As I would be using the function in place of shuffle() most of the time, I'd like it to be as fast and memory efficient (if a time-space tradeoff is needed, I th...
I wanted to make a matrix template class to see if I can learn how to use templates, work on figuring out the indexing in loops, and making an interface so the user can know if an operation will work. Eventually I would like to add more cache optimization, calculating the inverse, and other ways to get data into the ma...
GeeksForGeeks challenge: Given a singly linked list, write a function to swap nodes pairwise. For example : if the linked list is 1->2->3->4->5->6->7 then the function should change it to 2->1->4->3->6->5->7, and if the linked list is 1->2->3->4->5->6 then the function should change it to 2->1->4->3->6->5 #inc...
I wrote a macro which works, but given the large amount of data, it takes a lot of time. I wonder if there is a way to speed it up. Here is a summary of what it does: In "Summary (All)" tab I have global sheet with all the data. I have several tabs corresponding to the each months. I want to have the data distributed ...
If one menu-item is clicked then the description with the same data-filter attribute should be shown. I added a class to the description elements to associate each one with the affiliated menu item. What do you think? $(".button").click(function() { $(".button").removeClass("active-filter"); $(this).addClass("act...
To become more familiar with templates I attempted a doubly linked list implementation in C++. Is this a valid use for a template? template <class T> struct LinkedListNode { LinkedListNode<T>* m_previous; T m_data; LinkedListNode<T>* m_next; }; template <class T> class LinkedList { public: LinkedList()...
My problem is this causes more lag as time goes on. I use this commonly to chat with my friends, and I need it the site to update in real-time whenever a message gets edited/deleted/added. Any solutions? function update(){ var i = 0; var leadsRef = firebase.database().ref(room); leadsRef.on('value', functio...
I'm very new to Haskell's ReadP library, and the entire concept of parser combinators, so I was wondering whether there are better ways to do some things in this program: import Text.ParserCombinators.ReadP import Control.Applicative import Data.List data Operator = Add | Subtract instance Show Operator where sho...
I wrote a function that can be used to generate a probability distribution for an array of elements (probGen()), and another that can be used to select an element from an array with a specified probability (probSelect()). I want to optimise my code. probGen.php <? require_once("randX.php"); #"randX()" generates a ...
This is my first console application in C# and I think it's unnecessarily wrong and I made some bad practices, but at least it works smoothly. How could I improve this code so that next time I write a console application it won't be as garbled as this? using System; using System.Collections.Generic; using System.Diagno...
I have to read a lot of code and search through many code bases. I frequently find myself using something like grep -r --include=.C "test string" . to find files containing a certain string or regular expression. However, to simplify this and expedite the process, I want to create a function that allows me to specify w...
I'm writing a small C++14 library for myself that allows me to decorate a type with dimensionality information, so that I can leverage the template/type system to avoid mistakes such as adding velocity to distance (or similar). This is my first time working with C++ templates to any meaningful extent. I know that this ...
I tried to implement a Python-esque list in C. Having not really used C in anger, I'd like some pointers on style and error handling in particular. Header #ifndef __TYPE_LIST_H__ #define __TYPE_LIST_H__ /* Generic list implementation for holding a set of pointers to a type (has to be consistently handled by the e...
Given an array of words representing a sentence and a word to search for, the method must determine whether the word appears in the sentence. Specifications Case insensitive. The arguments are never null. The sentence is in the English language. /** * A case-insensitive search on a sentence to find whether a given w...
Introduction I'm using Advent of Code 2018 to learn Python better, interested in the new type support for Python 3.7, I decided to go with that. Here is my solution to Advent of Code Day 4, both part 1 and 2. I'm returning the answers for both part 1 and 2 as a tuple. Problem Description The problem essentially boils d...
I have a csv-file that consists of all match outcome probabilities for soccer matches. Each math can be result in a win, draw or loss. I also included the actual outcome. In order to test how accurate my predictions are I want to use the Ranked Probability Score (RPS). Basically, the RPS compares the cumulative probabi...
(See the previous and initial iteration.) My main attempt here was to get rid of monolithic code and split the implementation into smaller methods when applicable and do more extensive commenting. Here we go: package net.coderodde.util; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections;...
I've written a function that should get rid of empty p, span, etc tags and those with just ' ' and am looking for ways to improve it. My original solution was very 'wet', but I've managed to come up with a drier solution. The Original HTML: <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"...
I have a large table in which I store region/state/province codes (two letters) from different countries. I use these region codes further downstream for multiple process. One of the steps I do is a cleanup of regions to ensure it is a valid region/state/province code. I have a lookup table consisting of a country vs ...
As far as I understood this problem, it is a subset of vertices of Graph G, such that every edge has at least one endpoint in the subset. This problem is considered to be NP Complete. However I think a polynomial time greedy solution exists for this problem. I have tested this greedy solution on 12 common instances and...
I made a Tic Tac Toe game using classes to show a better approach than the Tic Tac Toe game in Tic Tac Toe in C++11 which works not with classes. I already posted the code there as an improvement over the code posted in that question. Now I wonder what I can still improve on my solution? Feel free to comment on anythin...
Just on a chapter 3 of Rust Book so not much good in Rust. so tried to implement a simple temprature calculator as suggest in this chapter. so i would like you guys to point anything you feel use std::io; fn main() { println!("Enter Temperature as 56f or 98c"); let mut usr_inpt = String::new(); io::stdin...
Over the past few months, I've been actively using python and I have made a few scripts to scrape #hashtag data from Instagram. It all started with some basic script I had made early 2017 and I have been adding and modifying it ever since. Over the last few months, I made progress in my own skill of Python, successfull...
I decided to make a calculator as a project. Implementing basic addition, subtraction, division, and multiplication was fairly easy. I wanted to add more functionality so I decided to implement a list of results the user view. However, I had a difficult time keeping track of the results numerically. I wrote a maze of i...
This is a program to purchase tickets for a ferry. There are two classes - business and economy. I am wondering what is a better way to write this piece of code. Honestly I want someone to review my whole code file and give me feedback on things I can improve. I just want to improve my coding ability and become a bette...
This program converts a decimal number to a binary number. This is one of my first C programs and I am wondering if I have used the elements of this language properly. Suggestions for improvement are welcome. #include <stdio.h> #include <string.h> void print_out_reversed(char string[]) { int index = strlen(string)...
This is my first attempt at a jQuery plugin and really doing anything with jQuery which isn't simple DOM manipulation or initialising another plugin! I'm really keen to learn where I have gone wrong and improve on the code. The code for the plugin is: (function($) { $.fn.unsplash = function(options, cbOnImageSelec...
My solution to Leetcode MaxStack in python in Python. I have two solution one is using linked-list and another one is using list. Design a max stack that supports push, pop, top, peekMax and popMax. push(x) -- Push element x onto stack. pop() -- Remove the element on top of the stack and return it. top() -- Get the el...
I solved this problem: Given a sorted array nums, remove the duplicates in-place such that each element appears only once and return the new length. Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory. How can I improve its execution time? Is th...
Problem Spreadsheet cells are referenced by column and row identifiers. Columns are labeled with alphabetical characters, starting with "A", "B", "C", ...; rows are numbered from 1 in ascending order. Write a function that takes in a string identifying a range of cells in a spreadsheet and returns an ordered list of ...
I started writing some of the standard algorithms for tuples, here are the first few non-modifying ones #include <functional> #include <iostream> #include <optional> #include <tuple> #include <type_traits> template <typename Predicate, typename Tuple> constexpr bool all_of(Predicate&& pred, Tuple&& t) noexcept { ret...
I am writing the code for my EPQ project and am aiming to produce a graphic showing the collapse of a particle cloud with around 10^5/6 particles. My current code will spawn a specified number of particles in a uniform distribution across a specified area. It will then calculate the acceleration of the particles using...
This started as a simple exercise in sorting an array. I wanted to make it a bit more complex which is why I made it a 2D array. I then noticed that each pass that checked and swapped values, it was checking all ten values. This seemed unnecessary because with each pass the highest value gets moved all the way to its f...
The task (also found at https://www.youtube.com/watch?v=10WnvBk9sZc): Write a function that takes two strings, s1 and s2, and returns the longest common subsequence of s1 and s2. "ABAZDC", "BACBAD" → "ABAD" "AGGTAB", "GXTXAYB" → "GTAB" The longest common subsequence is defined such as all of them appear in the same ...
package main import ( "fmt" ) type LinkedList struct { first, last *node } type node struct { item int next *node } func (l *LinkedList) add (val int) { n := node { item: val, next: nil, } if l.first == nil { l.last = &n l.first = &n } else { ...
I just finished coding a Tic Tac Toe game for my first Python project. Everything seems to be running correctly, but I wanted to get some advice on things I can improve. The main loop is pretty messy and I'm sure there is a way I can clean that up. Also I have many repetitive if statements that I think can be looped so...
Min Heap Implementation As an exercise, I wanted to implement a min heap using JavaScript. I'm not terribly familiar with JavaScript best practices, so I wanted to get feedback on my approach. Notes I decided to implement the min heap using an array. I filled the first element with a null value to make some of the...
I want to sync the table every few minutes to a remote database. I want it to be as efficient as possible. I wrote this stored procedure that will only return rows that are added or removed after the last query. Basically, this stored procedure will return something like this: 190107080001 | REMOVED | NULL | NULL | ...
What is does I'm reading The Go Programming Language. Below is my code for the last exercise in the first chapter, which is to create a webserver, generate an image, and serve the image via the server, allowing modifications of the image via query string parameters, eg: localhost:8000/?cycles=25&bgcolor=0,255,255. My C...
As a beginner in Rust i am trying to practice Rust with some little programs so here is my implementation of Decimal to Binary. use std::io; pub fn run() { let number = input("Enter an input"); println!("{}", to_binary(number)); } fn input(msg: &str) -> i32 { println!("{}", msg); let mut number = Stri...
I'm new to PHP OOP programming and I'm trying to make a user class with login, register, logout and some other methods. I'm concentrating in the login method that will be used with Ajax. Session class class Session { // these are global variables defined in the config file private $lifetime = LIFETIME; priv...
I wanted to write a transpose function for N*N mat without it getting literals or #define values and I want it to compile with gcc -ansi -pedantic -Wall -Werror #include<stdio.h> /*printf */ /*function to transpose a N*N 2D mat */ void TransposeOf2DArray(int* mat, size_t n) { int i = 0; int j = 0; if(NULL ==...
I wrote this class a few months ago and noticed from a few examples that it's better to break down these classes and separate them. I am not so sure what is the proper way to break if to parts. It currently includes a creation of a System_user obj based on user id (fetching user data), login validation, logout, stori...
I started with Python and Tkinter and am trying to make my first steps by creating a simple UI with a header, sidebar (currently just a label) and a few labels and entries. Before I go on I want to ask you all if the way I do this is correct and a common one. Also if you see potential to make this better, please let m...
I've written an infix to postfix converter in Haskell using the Shunting-yard algorithm. Example of how it works: $ ./in2post 2 + 2 2 2 + $ ./in2post 1 + 2 * 3 1 2 3 * + $ ./in2post (5 - 4) * 3+1005/(12-6*(12 -8) ) 5 4 - 3 * 1005 12 6 12 8 - * - / + $ ./in2post (2 + 45 2 45 + ERROR And the source code: Main.h...
The following is my binary search implementation in Java: package com.solo.workouts.collections.Tree; import com.solo.workouts.Implementors.Util; import java.util.Comparator; import java.util.NoSuchElementException; import java.util.Objects; /* @author soloworld @since 1.o */ public class BinarySearchTree<T>...
I want to make fizzbuzz method return the resolved value and then pass it to println!. Been having quite a problem with &str vs String. Wanted to use &str as return value as it's immutable so I tought it fit nicely though I couldn't get it right. Here is my String impl: fn main() { let ss = "FizzBuzz"; for i in...
I have solved a task which takes input in a unique markup language. In this language each element consists of a starting and closing tag. Only starting tags can have attributes. Each attribute has a corresponding name and value. For example: <tag-name attribute1-name = "Value" attribute2-name = "Value2" ... > A closin...
Decided to make a small C# console based rhythm game finger trainer with lots of user definable options. I'm very much a beginning programmer, so thought I might learn a lot from it. Especially when you guys could give me some advice. using System; using System.Collections; using System.Collections.Generic; using Syste...
Below is a piece of code that uses a promise for sending a request to a server, and to wait for an answer. Under normal conditions the server will always respond immediately, But of course you don't want your code to be stuck forever if a response is missed (e.g. a network issue). So for that reason, it needs a timeou...
Problem I want to read in the data to dictionary person = { 'name': 'John Doe', 'email': 'johndoe@email.com', 'age': 50, 'connected': False } The data comes from different formats: Format A. dict_a = { 'name': { 'first_name': 'John', 'last_name': 'Doe' }, 'workEmail': 'johnd...
I've been learning JS for a few months now and I've just finished creating a small image slider for a website. The sliders functionality is as follows: Continuously cycle through images and loop back to the start Allow the user to click through to a certain section When clicked, the cycle timer must reset and the loop...
I've been working on a bot that records the result of matches on SaltyBet.com. It uses that data to calculate the probability of winning for fighters of a given match. A fighters probability is based on the Elo rating system. I'm posting this here to share the code. Repo: https://github.com/zakarh/salt-bot import json ...
I have created a little framework for my work to manage loading and unloading plugins by using a modular tree structure that is based on Promises. I would like to be able to create the tree structure, but execute the async functions in order from the root node down, or more precisely execute the affects of the async fu...
I wrote a commit message validator + CLI in NodeJS. Notes: My greatest concern is that the patten I use to represent the results of a validation is inadequate. Options: Use adhoc enums Create a ValidationResult class (?) Extend Error and return an array of those. In this case, how would the --verbose option, which sh...
I wrote a script that gives a "generalized" function of an arbitrary dice. Is this any good? How can it improve so to make it cleaner? import random def roll(die): number = random.randint(0,len(die)-1) b = die[number] return b Die1 = [1,2,3,4] Die2 = [1,2,3,4,5,6] #num lists def inptchacc(): ending_co...
I was bored the other day and got to wondering how I would implement a circular FIFO buffer in Rust. My goal was to create an implementation I could use on a bare metal microcontroller. This means no dynamic allocation and a fixed size known at compile time, so I used a primitive fixed size array instead of a vector as...
I have the following Qt class: mainwindow.h class MainWindow : public QWidget { Q_OBJECT QPushButton* m_button; public: explicit MainWindow(); }; mainwindow.cpp MainWindow::MainWindow() { auto main_layout = new QHBoxLayout; m_button = new QPushButton("Press me"); main_layout->addWidget(m_button); s...
I've made a simple function, this time in jQuery rather than JS, that just removes empty <p></p>, span and strong tags. I'm curious to see what everyone thinks about my solution as I'm relatively new to jQuery, and whether it could be improved. My original solution is as follows: $('p').filter(function() { return ($(t...
Today I just completed a personal POST function that emulates jQuery's using $.ajax, but also implementing a possible redirect. I just finished up and it looks like it is functional, but since this is something I want to keep long term and integrate in many projects, I want to make sure it is as functional as possible....
This is a simple and robust LRUCache implementation using doubly linked list and unordered map. It supports .get(), .put(), and .has() operations in constant time. I want to know if my code conforms to the best practices. Any suggestions or feedback are appreciated! #pragma once #include <list> #include <unordered_ma...
I wrote this class a few months ago and noticed from a few examples that it's better to break down these classes and separate them. I am not so sure what is the proper way to break it into parts. It currently includes a creation of a System_user obj based on user id (fetching user data), login validation, logout, stor...
I implemented this paper, more specifically the bipartite graph case in numpy. The whole code is available on github. The file munkres.py comes from scipy. Some variables seem poorly named but they respect the definitions of the paper. I pasted the main file below. If you want to read it with line numbers and syntax co...
I am trying to learn Python 3.6 with the help of a book. Until now I have learned the basics of functions, conditions and printing etc. No loops yet - so they need to come from recursion. To test the current stuff I wrote this basic TicTacToe - and would like to know what could be better. def print_game(*args): fo...
It is to find the maximum element in an array which is first increasing and then decreasing. I've tried to write my idea by using divide and conquer approach. Is there any improvable or missing point? My code is following, def search(arr, low, high): if low == high: return arr[low] mid = low + (high - ...
I have 2 Classes, the first one is only used as Container, and the second Class Splits a GpsString, Converts it to suitable data types and returns the Container Class. The String to analyze looks about like this: ("$GPGGA,120003.533,7926.184,N,02222.419,W,1,12,1.0,88.5,M,0.0,M,,*71") Now i want to know if this is good...
Hey guys this is my second attempt at a Tic Tac Toe game using the advice given in my first post: My first Python project: Tic Tac Toe Again, just looking for advice on things I can improve. There is no classes because I have not really learned a great deal about OOP yet. I wanted to make sure I could use functions pro...
Alright, so first, the reason I'm posting this is because I've seen so many tutorials that conflict with each other, and I would like to get this all straightened out. (Ignore the lack of shaders/mvp matrices/etc.) Here is my simple example code: You can view it on pastebin here to make it easier to read. #pragma once ...
I'm still a freshman and this one of my first projects I made using Java and Swing. The program is a simple League of Legends multi-threaded ping checker that pings the server 10 times to get an average ping and determine the max and minimum ranges. How can I make my code cleaner instead of writing so many if statem...
I have an implementation for my first binary search tree in C++. I was wondering if there was some cleaner way to avoid using the double pointer in the way I have my code setup? Such as on one line I have: (*node)->left = insert(&((*node)->left),value); Which seems a bit "messy", but it almost seems necessary for the ...
I am an experienced developer but pretty new to React. I wanted to go on my own and build a simple little weather app that updates the image, tempature, and description of each day when you click on the + or - buttons. I got it to work but I think it is pretty messy and was hoping for some advice. Firstly, is it bad pr...
I've the following d3 chart which is both grouped and each grouped contains a stacked bar. But somehow, I feel this is not a proper way to implement and little complicated. If there was only stacked bar chart, I would have used d3.stack(). Is there anyway I can still use the d3.stack() with current setup. Can someone l...
I just study Python, and have finished my first personal challenge game Tetris. It has multi-game, bindable keys, customizable game field. It would be great to have review/feedback on it. https://github.com/vberd/different/blob/master/tetris.py import pygame from random import choice, randint class Field: def __...
Lets say I have Cars with Features, and I have been given a List of features to look for in the Cars available with me. Though I could have done that using for-loop, what are the suggestions for below? Is this production-worthy? import java.util.Arrays; import java.util.List; import org.apache.commons.collections4.Co...