instruction stringlengths 71 95.1k |
|---|
I have two lists of dictionaries where both have the same "id" key but otherwise different data.
list1 = [{"id":1, "spam": 3, "eggs": 5}, {"id": 2, "spam": 5, "eggs": 7}]
list2 = [{"id":1, "knights": 5, "coconuts": 2}, {"id": 2, "knights": 3, "cocounts": 8}]
I know I can do a nested loop something like this (I know I ... |
What I try to achieve
I need to create a administration-panel for a website. Therefore, I need a possibility to protect the content of the panel via a password. The functionality doesn't have to be very advanced. I neither need a password-reset functionality nor the possibility to add more than one user. I also don't n... |
Finally after a few months of searching and learning AJAX with pagination PHP and History.pushState() I created AJAX PHP pagination.
Test page
1. Ajax(index.php)
$(window).on('load', function () { // makes sure that whole site is loaded
$('#status').fadeOut();
$('#preloader').delay(350).fadeOut('slow');
});
... |
I am writing a piece of code for some students and I came up with the following implementation of Floyd's algorithm for finding cycles in linked lists.
I was wondering if there are ways I can improve what I have so far such that the result is
more C++ idiomatic
does not contain dumb mistakes associated with the generi... |
quick question. I'm using Spring Boot and I created e.g. this class
public interface ProductService {
Page<Product> getPage(Pageable pageable);
}
@Service
public class ProductServiceImpl implements ProductService {
@Autowired
private ProductRepository productRepository;
@Override
public Page<Pr... |
Background
In the field of optimal control, it is part of everyday business to solve ordinary differential equations numerically. A differential equation system or dynamic system describes e.g. the physical behavior of an object over time. Every single equation can often be associated with a special state (position, ve... |
I need to find the odd occurring numbers as a list. For example the below list should give 1 and 2 as output.
Is there a way that I can do it in a better way?
ArrayList<Integer> numbers = new ArrayList<>(Arrays.asList(1,2,2,4,2,4));
List<Integer> OddOcuranceNumbers =
numbers.stream()
.collect(Collectors.groupingBy(Func... |
UPDATE: After getting "a kind of" affirmation from various platforms( my discussions on twitter, reddit, other stack overflow posts,etc) I have written an article on this style of view binding. Kindly check that out too, as that's the only place i am currently updating my latest version of the code (It's not behind t... |
I have the following implementation that takes in symmetric matrix W and returns matrix C
import torch
import numpy as np
import time
W = torch.tensor([[0, 1, 0, 0, 0, 0, 0, 0, 0],
[1, 0, 1, 0, 0, 1, 0, 0, 0],
[0, 1, 0, 3, 0, 0, 0, 0, 0],
[0, 0, 3, 0, 1, 0, 0, 0, 0],
... |
I had an idea recently of simplifying some of the code I already have in my Android app that uses Kotlin. I somewhat new to Kotlin, so any opinion would be very appreciated.
Before giving you what idea I had, I will give a base example of what code I have right now:
Lets say that in my app I have a functionality for us... |
I work with the GoogleMaps API, using React.js.
Inside the GoogleMap component:
I have a component called UserLocationTimer, which activates
setInterval within useEffect and samples the user's location every 2
seconds, centering the map accordingly. In addition, returns the
UserLocation component that displays the mar... |
My adjacency matrix looks like this, where non-zero weights denote edges.
[0, 2, 0, 0, 3]
[2, 0, 2, 4, 0]
[0, 2, 0, 3, 0]
[0, 4, 3, 0, 1]
[3, 0, 0, 1, 0]
Here's my attempt, would appreciate a code review.
private static class Edge implements Comparable<Edge> {
private int source;
private int destination;
p... |
I have this Java solution to LeetCode's 3Sum problem.
I would be really grateful if I could get feedback on correctness, scalability, efficiency, coding best practices, and OOP design.
I'm relatively new to Java.
class Solution
{
public List<List<Integer>> threeSum(int[] nums)
{
List l1 = new ArrayList<... |
As you might know, EF Core does not support executing multiple queries in parallel on the same context using something like Task.WhenAll.
So you have to write this code instead:
using var context1 = _factory.CreateDbContext();
using var context2 = _factory.CreateDbContext();
using var context3 = _factory.CreateDbContex... |
Can this code be shortened, optimized or remove any unnecessary parts. Just curious if this is the right way to achieve the given result in this CodePen example: CodePen Connect Four
Here is my code:
// Debug & fix this Script..
document.addEventListener('DOMContentLoaded',()=>{
const displayCurrentPlayer = do... |
I've recently started learning rust and doing cryptopals as exercise.
I coded a program that decrypts single xor cypher. The algorithm I came up with is very simple and probably not efficient, but I would like more emphasis on rust philosophy and syntax
extern crate hex;
use std::collections::HashMap;
fn main() {
... |
Data Structure coming back from the server
[
{
id: 1,
type: "Pickup",
items: [
{
id: 1,
description: "Item 1"
}
]
},
{
id: 2,
type: "Drop",
items: [
{
id: 0,
description: "Item 0"
}
]
},
{
id: 3,
type: "Drop",
... |
I'm coding a random strings generator. It's working, but I'm not sure if this is efficient.
/**
* @param n total number of strings to generate
* @param length length of generated strings
* @param charsetStr charset to be used when generate
*/
public static List<String> generateRandomStrings(int n, int ... |
I wrote this a few months ago as my first "serious" C program (I've used JS for a few years). It's a simple resource collecting and trading game (based off one I made in HTML/JS), that takes input in the form of some simple commands.
#include <stdio.h>
#include <inttypes.h>
#include <math.h>
#include <string.h>
#includ... |
First and foremost I want to say that I'm fully aware GOTO should normally be avoided in production code and it tends to be unreadable for others. For this specific case however, the code will not be read by anyone but me and the question is being asked mostly so I can understand what other options do I even have avail... |
I'm making a command line interface (CLI) role playing tool that tracks the state of the world, storing characters, monsters, etc as text files so their data can be edited directly if needed (free Vim UI yay). This means that every game loop, I need to reload the files.
Note: Direct editing implies no pickling. Also, I... |
I have been practising Python Practice questions and came across this question:
Write a Python program to add 'ing' at the end of a given string
(length should be at least 3).
If the given string already ends with 'ing' then add 'ly' instead.
If the string length of the given string is less than 3, leave it
unchanged.... |
I apologize beforehand if the question has been repeated so many times. This is a practice task from Automate the Boring Stuff with Python. In brief, the task entails writing a code that carries out an experiment of checking if there is a streak of 6 'heads' or 'tails' in 100 coin tosses, then replicates it 10,000 time... |
This is a simple program that solves a given Sudoku puzzle recursively. The input is provided as a file that contains the cells, 0 if empty, delimited by a , character.
#include <iostream>
#include <optional>
#include <string>
#include <string_view>
#include <vector>
#include <utility>
#include <exception>
#include <fs... |
I am using OWIN to self host a WebAPI service. There is Unity to serve as an IoC container. Within several OWIN middlewares (e.g. authorization layer) as well as in WebAPI I need to access a Unity container to resolve my dependencies. There should be a single child container per each request so that there is for exampl... |
To compare the speed of Julia to Python+numba, I implemented Game of Life in both languages.
For anyone who is not familiar with Game of Life: Start with a matrix of boolean entries, encoding whether a cell is alive or dead. Then, at every iteration, update the state of a cell based upon its value and the eight neighbo... |
I have this piece of code:
final ResultDO response = transformJsonToResponseDO(rawDataResponse, ResultDO.class);
return Optional.ofNullable(response)
.map(results -> createPOIs(Collections.singletonList(response), providerResponse))
.orElse(Collections.emptyList());
The important part is that:... |
I created this hangman game today as my first stand alone project. It is a quite basic and simplified approach. How could I improve the game to make it more interesting?
import random
words = ["abductions", "abridgment", "admixtures"
,"backfields", "blueprints", "chivalrous", "complexity", "cyberpunks", "de... |
Link here
I'll include a solution in Python and C++ and you can review one. I'm mostly interested in reviewing the C++ code which is a thing I recently started learning; those who don't know C++ can review Python code. Both solutions share similar logic, so the review will apply to either.
Problem statement
Given a s... |
Weekly Employee Report Generator PowerShell Script
Description
This script is used for generating a Markdown template file for weekly employee reports. In Settings.cfg file you can define the name and title of the employee, report title and report folder name, starting hour and working time, and the names of the days o... |
I recently was reading an article labeled "Modern C++ Singleton Template". The proposed solution used C++11 feature of Magic Statics (N2660). I wanted to adapt it for an own project in
"freestanding" (fno-hosted) environment.
My code looks as follows:
Singleton.hpp
namespace std
{
template <typename T>
class Si... |
I have an Excel file with 2 columns, names and numbers. I want to know for each name what is the probability for each number. I prefer to do it in Java so I would be able to combine it with the rest of my project.
Actually, I already did it, and it's works, but I think it's done in a primitive and inefficient way.
Can ... |
Link here
I'll include a solution in Python and C++ and you can review one. I'm mostly interested in reviewing the C++ code which is a thing I recently started learning; those who don't know C++ can review the Python code. Both solutions share similar logic, so the review will apply to any.
Problem statement
Determin... |
This function takes a list/array of booleans and converts them to an array that counts the number of either True/False values found next to each other.
I'd like to see this optimized for performance. It's not too slow, but I do use multiple loops with embedded if-else statements, I'm wondering if they're absolutely nec... |
Background
I am currently participating in a tic-tac-toe coding challenge. During their move, each participant is given the board state and their team, X or O. The blank board is:
[[' ',' ',' '],[' ',' ',' '],[' ',' ',' ']]
With 'X' and 'O' being added to the board, for example:
[[' ',' ',' '],[' ','X',' '],[' ','O'... |
This is a follow-up question for A recursive_count_if Function For Various Type Arbitrary Nested Iterable Implementation in C++ and A recursive_count_if Function with Specified value_type for Various Type Arbitrary Nested Iterable Implementation in C++. After digging into the thing that detecting the argument type of a... |
This is an object-oriented Chess game. So far, I have implemented the pawn and board functionalities and I would love to get a review early on before diving deep into the project.
piece.py
# piece.py
from abc import ABC, abstractmethod
class Piece(ABC):
def __init__(self, color):
if color.lower() != 'bla... |
Inspired by another Q I finally made a version that groups permutable regions into parentheses. Non-ambigous sequences are outside of parens.
Here the original problem:
Given the mapping a = 1, b = 2, ... z = 26, and an encoded message,
count the number of ways it can be decoded. For example, the message
'111' would g... |
I'm working on a project where I need to get all followers from a specific user and store this info in a database. I have done this and so far it suits my needs, but I'd like to make it more "professional" and would love to hear your suggestions.
The first code is twitter.py and the 2nd one is app.py
import requests
c... |
I have a table that has buttons per row that makes views/edit an item in a modal and they have a layout like so:
<td>
<button class="btn btn-sm btn-default" onclick="setModalMode('view', '8')" data-toggle="modal" data-target="#license-add" data-id="8">
<i class="far fa-eye"></i>
</button>
... |
So I'm learning typescript and I'm making a simple functional PubSub system. I want the user to be able to define topics and the data for those topics. So far I've got the below code, but I really want to improve it.
I'm not sure if I can get rid of the unknown in <T extends Record<string,unknown>>. I don't think that'... |
This is my code for an assignment. The task is to take a user input in form of a sequence of parenthesis' followed by an E to mark its end and determine whether it is a correct sequence (as an example (()())E is correct, )(()((E is incorrect) and if incorrect determine how many parentheses at the start you need to remo... |
I'm trying to optimize my solution to the following question:
given a regular expression with chars and special char '*', (star which is a joker we can replace with any string), and a string, write a program which determines if the regular expression can represent that string or not.
for example: "a'*b" can represent ... |
Hi I coded a simple app that allows user to generate border radius and then copy it to clipboard.
I already found out how big is the impact from your reviews guys. My code is slowly improving.
If someone could point out mistakes etc. in my code I would be grateful.
Repo on github
HTML:
<!DOCTYPE html>
<html lang="en"... |
We have two physical AWS S3s called in the code s3Legacy and s3Cache. They store the same data but with different S3 key structures.
The fists solution shared below uses objects, the second does not.
Is the solution using objects an excessive abstraction or there are benefits to it?
(There is no need to comment on the ... |
New to Python/Selenium and learning on the fly with my first basic selenium script.
Request user input - activate or deactivate.
Open's website, loops through shop URL as well as activate/deactivate checkboxes.
Would be grateful for some feedback on how to optimise the code.
# IMPORTS
import time
from selenium import w... |
I tried to code the fizzbuzz program following the functional programming rules in javascript. Please check my code and give feedback. thank you.
const isDivisible = (number, fizz) => number % fizz === 0;
const getSubstitutes = (
number,
substitutes,
{ currentIndex = 0, result = "" } = {}
) => {
if (currentInde... |
Some friends and I were playing a board game and decided that the random dice rolls just weren't fair! So we came up with a scheme for making the rolls slightly more evenly distributed, and I implemented it in python. The class represents 2 six sided dice and makes the probability of a given combination coming up (ther... |
I have a solution to this CodeWars challenge that's being rejected as "too slow".
Basically, write public static BigInteger Fusc(BigInteger n) given:
fusc(0) = 0
fusc(1) = 1
fusc(2 * n) = fusc(n)
fusc(2 * n + 1) = fusc(n) + fusc(n + 1)
-- CodeWars description (from part 1, which is formatted slightly nicer IMO)
I h... |
I want to improve on my original solution to this problem,
my solution is O(n^2) and I think it's possible to solve in less time
You have two arrays: A and B. A contains ints and B has pairs: (element from A, the number of elements that are larger than that element and to the right of it in A).
for example:
A = [4,3,5... |
I tried to implement bubble sort in Assembly 8086.
datasg SEGMENT BYTE 'data'
array DB 1, 3, 2, 5, 4
n DW 5
datasg ENDS
stacksg SEGMENT BYTE STACK 'stack'
DW 12 DUP(?)
stacksg ENDS
codesg SEGMENT PARA 'code'
ASSUME CS:codesg, DS:datasg, SS:stacksg
MAIN ... |
I have an assignment that I have completed, but I feel as though the way I went about solving the problems could be optimized a bit. As well, I don't know if I'm properly utilizing return statements. I'm relatively new to coding so I don't have the knowledge, but I would love to learn if anyone wants to go through and ... |
I am making a Ping Pong game using Html5 Canvas. I am concerned about the movement(_b) method. This method should move the computer paddle (up and down) vertically and follow the ball. Some sort of simple AI. Everything works like it should but there is a lot of repetition of if else blocks that might be handled differ... |
I am working on a small project that requires finding Von Neumann neighborhoods in a matrix. Basically, whenever there is a positive value in the array, I want to get the neighborhood for that value. I used an iterative approach because I don't think there's a way to do this in less than O(n) time as you have to check ... |
I've been programming in Go and I enjoy how easy it is to create descriptive errors and propagate them up the call stack. I wanted that sort of ease and consistency in C so I created a small error handling library to propagate errors and generate a sort of error code stack trace.
I've been using C for 6 months so I'm n... |
This project is in chapter 5 introduced me to a whole new world of dictionary data structure. To put it briefly, I want to know whether the choice I took between lists, tuples, and dictionaries could've been justifiable calls or not. I'm also not that confident about where putting many return statements correctly and m... |
I had a task where I had to build a stamp duty calculator, which calculates the tax or stamp duty first-time buyers(ftb) returning buyers (rtb), and second-home buyers (shb) had to pay when purchasing the home.
These were the tax bands, although I think some of the percentages may be slightly wrong.
First Time Buyers
0... |
This is a follow-up question for A recursive_count_if Function For Various Type Arbitrary Nested Iterable Implementation in C++, A recursive_count_if Function with Specified value_type for Various Type Arbitrary Nested Iterable Implementation in C++ and A recursive_count_if Function with Automatic Type Deducing from La... |
I have the following problem and I am new in Java:
I have an initial capital of 10 000. I invest this initial capital of 10 000 in the bank for a interest rate per month of 0.04/12. My net income is 3000 per month and my expenses per month is 2000. I invest also my monthysavings = net income - expenses = 3000 - 2000 = ... |
I made a very simple OS in Assembly. But my code is too long. I want to make my code shorter.
Here is my code:
BITS 16
start:
mov ax, 07C0h
add ax, 288
mov ss, ax
mov sp, 4096
mov ax, 07C0h
mov ds, ax
mov si, text_string
call print_string
jmp $
text_string db 'OS', 0
... |
Story
I'm trying to become more familiar with template metaprogramming and practice more of it. I need to use modular arithmetic to solve certain problems and so I decided to write a general purpose template for it.
Code
Include files
// Individual
#include <iostream>
#include <chrono>
#include <vector>
#include <excep... |
I have some vanilla JavaScript for a website menu which works perfectly (thanks mainly to Titus on Stack Overflow), opening and closing a sub-menu (toggling <ul class="hidden"> ) if the UL's sibling button is clicked or closing the sub-menu if another button on the same level as the sibling is clicked, adjusting other ... |
im trying to migrate my very large swift view controller to mvvm but it still feels very large, can you guys give me any advice
What this controller does is simple it shows a UIView on which i can draw the buttons that I display are here to manage the lines that i have drawn on the canvas.
For example to delete the las... |
Initial version of the code appeared as an answer to an SO question. I refactored the code a bit and it works pretty well, IMHO. I get a solid .csv file with all the data from Texas Department of Criminal Justice's Death Row page.
What I was especially interested in was getting all offenders' last statement, if there w... |
My C program has to parse a fixed-length message like this:
uint8_t message[8] = {80, 75, 73, 71, 1, 1, 1, 1};
another message could be:
uint8_t message[8] = {80, 75, 73, 71, 41, 42, 1, 1};
The message contains an ASCII string and 1 shows the end of string. So the actual length of the first message is 4 and the secon... |
Here is the code that can be used for calculation of mathematical function, like ax^2 + bx + c.
It is fast enough if you choose small length, otherwise if programmer don't know the small range, that code can be really slow. I've made it specially on C++ to be more fast.
#include <iostream>
#include <vector>
using name... |
I'm trying to solve a skyscraper puzzle for 6x6 boards using constraint programming and then backtracking. My solution works but is too slow, for certain cases, it takes up to 2 seconds and I was wondering how I could reduce this.
Here is the structure of my algorithm:
Create board of N size with each element having i... |
I often find that when I am writing, refactoring, or reviewing code that I want to do some simple testing. There are many existing test frameworks such as gtest and cppunit but my desire was to create something much simpler and with fewer features.
Specifically, I have two use cases in mind:
I have some test input va... |
I am trying to build a simple algorithm to achieve the best combination of values based on two params in an array of objects.
The whole code is available here
First I have an array holding objects. The items which will be analyzed and packed into volumes together. All of the values are in percentages.
const nonStackabl... |
I have a very basic python script that reads a CSV file. I'm importing the csv module setting some empty list variables and getting the data I want. The problem is that I know there is a much more efficient way to get the data I just don't know how to do it and I feel very redundant in creating a reader object multiple... |
I have 7000 CSV files that I want to do operation on. but the problem is that it takes to much time like it takes 13 seconds to process these files.
What I need to know is which operation take more time.
Opening and closing the files?
Reading data from these files?
I want to convert this program into multithreading o... |
I have two csv files, pricat.csv which contains objects I need to populate my DB with, and mapping.csv which specifies how the value in pricat.csv must be displayed in my DB, for ex: 'NW 17-18' in pricat.csv has to be 'Winter Collection 2017/2018' in my DB. Here the csvs, first row in both are the headers:
ean;supplier... |
I am learning typescript with React and come up with this small program that each button count how many time by clicking and record which button got click. Please help me to take a look if all the code are the best practice.
import * as React from "react";
import "./styles.css";
interface ButtonContainerProps {
opti... |
I did a small countdown clock challenge in JavaScript. Please review it, thanks.
const timeControls = document.querySelector('.timer__controls');
const timeLeft = document.querySelector('.display__time-left');
const endTime = document.querySelector('.display__end-time');
let interval;
function secondsToHourMinSec(se... |
I am trying to create class with connect to mysql database. And if there is max number of connections I want to wait and try it again. I figured out, how it can works, but I am not sure, if its the right way of doing it. So, my code looks like this:
<?php
class DbConnect {
private $attemps = 1;
private $errorCode... |
I must create a function that accepts a string of names all separated by a comma.
Example: "Jack,Matthew,John,Sam"
And return the string of names in the same order but spelled in reverse.
Expected output: "kcaJ,wehttaM,nhoJ,maS"
I completed the function with an inner for loop but I would like to know if maybe running a... |
I just wrote this decimal to Roman numeral converter, inspired by Kevlin Henney's talk "Get Kata".
I have been reading the Rust docs little by little and this is one of my first attempts at some code.
I'd like to get feedback on style, general rust idioms and how I could have implemented this algorithm in a more succin... |
I have created a Reddit bot that goes through an "x" amount of posts. For each post it pulls all the comments from that post into a list then a data frame and then it loops over a CSV look for words that match a ticker in CSV file and then finally it spits out a sorted data frame.
is there anything I could improve / mo... |
So I am building a website. It will be only used inside our small company and it's not made for public use.
What I want to achieve is the ability for user to maintain session after sign in for a prolonged period of time while also maintaining some sense of security and common sense.
My website building experience is 2-... |
this is my 2nd project on Python. I created a game of Noughts and Crosses(Tic-Tac-Toe) that you can play against the computer. What are your thoughts on my implementation of the game? Is there anything I've missed or could improve upon?
I did think about adding a figure window and making it more interactive by clicking... |
Implementation is based on the MVC design pattern, with callbacks to allow model and view to communicate with controller.
Concerns:
It's not ideal to have async code inside the model, i.e the model should be as close to a basic
hashtable implementation as possible. However since we need to set a chain of calls to the v... |
Here's the code I'm having trouble shortening. I am currently a beginner in Python 3.x.
from os import system
def fibonacci(terms):
count = 0
x = 0
y = 1
z = x + y
if terms <= 0:
print("Enter a positive integer.")
elif terms == 1:
print("Fibonacci sequence in " + str(terms) + " ... |
This is a follow-up question for the previous questions about recursive functions, including A Summation Function For Arbitrary Nested Vector Implementation In C++, A recursive_count_if Function For Various Type Arbitrary Nested Iterable Implementation in C++, A recursive_count_if Function with Specified value_type for... |
I solved the following question
You are asked to ensure that the first and last names of people begin
with a capital letter in their passports. For example, alison heck
should be capitalised correctly as Alison Heck.
Given a full name, your task is to capitalize the name appropriately.
Input Format
A single line of in... |
I want to create a struct-of-arrays (SOA) database for better cache use but also have a separate interface that gives encapsulation. I am close to the design I think but would like more experienced coding eyes to have a look to critique my design. Here is what I have so far:
struct OrbitalDataBase {
OrbitalDataBase(s... |
I am trying to solve a problem, where we are given an app name, service name, and version number of an api. We need to print the name of app, which is using the latest version for most of the service.
FOR EX -
Mail App, Authentication API, v6
Video Call App, Authentication API, v7
Mail App, Data Storage API, v10
Chat... |
Link here
I'll include a solution in Python and C++ and you can review one. I'm mostly interested in reviewing the C++ code which is a thing I recently started learning; those who don't know C++ can review the Python code. Both solutions share similar logic, so the review will apply to any.
Problem statement
Given an... |
Question:
Implement an autocomplete system. That is, given a query string s and a set of all possible query strings, return all strings in the set that have s as a prefix.
For example, given the query string de and the set of strings [dog, deer, deal], return [deer, deal].
Hint: Try preprocessing the dictionary into a ... |
I'd be grateful if you could review my code. Please be as critical towards it as possible and yet indulgent when it comes to asking my first question here.
This is a simple snake game using pygame. I have issues when it comes to classes and not sure if I did it right by putting everything into 1 class and rest as funct... |
Link here
I'll include a solution in Python and C++ and you can review one. I'm mostly interested in reviewing the C++ code which is a thing I recently started learning; those who don't know C++ can review the Python code. Both solutions share similar logic, so the review will apply to any.
Problem statement
Given an... |
NOTE
The script relies on ruamel-yaml and requests packages
available on pypi.
I wrote a script which goes over the pack file details as specified by the emojipacks project, and downloads (and saves) to the local drive. It downloads the files as threads, and saves to disk with the shutil's copyfileobj method.
Feel fr... |
I am new to Python and coding in general, and I would like feedback on this program that I wrote. It simulates a tennis game, based on a players "serv chance" (how likely it is that a player will win the ball). I primarily want feedback directed at how well my program executes the standard tennis rules, but general fee... |
This is my 2nd shot at dynamic memory allocation. This project is for practice purposes. So many things were considered whilst writing this minimal project.
I considered using placement new to dynamically allocate memory, this would be optimal for large objects. I finally resolved to restrict user of my class to c++ b... |
Project
I've created a puzzle site with automatically generated sudokus.
For more information on Sudokus, please see the wikipedia article.
The code
const GRID_SIZE = 9;
const REMOVE = 50;
let solution = createArray(9, 9);
let textIsVisible = false;
window.addEventListener('load', function() {
initialize();
});... |
I am a beginner in Python-3. I was solving a level 2 challenge in Google Foobar. Given an initial amount of items (LAMBs) I have to distribute it among individuals, who are ranked according to seniority, while adhering to the following rules:
The junior most individual gets 1 Lamb
An immediately senior individual can'... |
I would appreciate some feedback on this single price grid component project completed using HTML and CSS.
I am trying to recreate the content shown by this image: https://res.cloudinary.com/practicaldev/image/fetch/s--FzGw2rbZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com... |
I'm learning C# and after watching the course and get the basics I decided to write a small project. It's a guessing game where a player can:
guess (of course): that will subtract his/her energy rest: that will
recovery his/her energy but take out some time take a hint: get a
hint about the current puzzle but it takes... |
I have this code that:
Clears my worksheet from row 12 and onward in Workbook A
Opens a new file Workbook B
Copys the sheet to my Workbook A. and Close Workbook B
Renames sheet in Workbook A
Transfers data from New Sheet to another Tab.
This seems to take me 10 minutes+, it is roughly 35k Rows.
Is there a faster way ... |
I have been developing software drivers for the mcu peripherals in C++. My approach how to implement the drivers is following.
Each peripheral has its software driver modeled by C++ class with its interface
Peripheral.h
#include <cinttypes>
#include "DriversCfg.h"
class Peripheral {
public:
Peripheral(con... |
After an extended absence from coding, I decided I would make something to try and get back on my feet again. I ended up making a project that I have made several times before, a higher-lower guessing game. Now while the coding process went well and I came out with something that works quite well, I feel like I fell in... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.