instruction stringlengths 71 95.1k |
|---|
I created my first implementation of an arbitrary feed forward neural network with a simple back-propagation training implementation.
class NeuralNet(object):
learning_rate = .1
# Error function
@staticmethod
def J(guess, target):
return 0.5 * np.linalg.norm(guess - target, 2) ** 2
def __i... |
Is it a good practice to initialize the BufferedReader and DataOutputStream in infinite loop?
ServerSocket welcomeSocket = new ServerSocket(8080);
Socket connectionSocket = welcomeSocket.accept();
while (true) {
BufferedReader inFromClient = new BufferedReader(new InputStreamReader(... |
I have a simple job class in Laravel, that will do the following:
Get all the images in a folder /original
Perform some image manipulation on each image
Save each image in a new folder /preprocessed
All of these steps are added to a queue.
However, I have taken an alternative approach and it is using python to do the... |
I wrote a piece of code that included multiple AJAX requests and multiple SetTimeout animations.
I want the code to perform better, especially the SetTimeout sections.
which part of the code should be improved?
window.timer = [];
window.timerNum = 1;
function amLoading(timer) {
var node = document.createEleme... |
I did wrote this parallel merge sort with no external dependencies. I tried to make use of modern C++ as much as possible.
Can you please tell me how it is?
#include <vector>
#include <list>
#include <thread>
#include <memory>
#include <mutex>
#include <condition_variable>
#include <algorithm>
#include <utility>
#inclu... |
Python beginner here. Created this program as a project to help learn python. Just ran this in a centos7vm so far to test. What it does is - zip up files containing certain extensions (excluding those defined in the var ext_list), logs the zip up process as it continues through, and when finished, send an email confirm... |
Debugged my page load (was taking 4s...) and I was running 94 queries. 30 of them were the same. I've refactored a little by caching results, but how can I further refactor this class?
The project is only half finished, and its already getting... messy.
<?php
class User extends Authenticatable
{
use Notifiable;
... |
I'm writing a log table which contains the summary of the claims. The log table logs the data whenever there is an upload.
I have written the following SQL query. Though it serves the purpose, I'm trying to learn whether there is any way to simplify the UPDATEs.
CREATE TABLE #1
(
id INT... |
Function
This class extends the key class, called EQ, and does basic calculation based on minutely data. It then calculates weight coefficients (e.g., [0, 1]) for sectors of equity exchange markets using data from market movers (e.g., AAPL, GOOG, AMZN, NVDA, FB).
It works, I'm not so sure about its OOP.
Would you be ... |
My Code measures the longest path, not allowing cycles. For the example input below, the longest chain would be 4
Please can you review my code?
import numpy as np
inputgrid = np.array([['.','.','.','.','.'],
['C','-','C','-','C'],
['.','.','|','.','.'],
... |
I have the following code to find the minimum sbyte value in an array. It is using System.Runtime.Intrinsics to perform a SIMD min on chunks of the array, and then loops over the resulting vector to find the true minimum.
public static sbyte Min( sbyte[] array )
{
if( array.Length <= 0 )
return 0;
var length =... |
I am trying to puzzle out api based user registration for a service I am building, but I have a strong feeling that my code is not optimal.
It feels like passing "state" in the way I did prevents the server from being multithreaded, as I have no clue how actix could share data that isn't Send or Sync across multiple th... |
I'm learning Go and I wrote this for a programming challenge. It is working (building and running) but I feel the code is not what Go code should be.
I used an OOP design. Is it correctly implemented in GO ?
In my main, I will call the method pod.playTurn(target, speed)
package main
import (
"fmt"
"math"
... |
I'd like to use basic auth with the WordPress API, but restrict the capability to a single IP address. I've updated the existing code from here: https://github.com/WP-API/Basic-Auth accordingly.
It seems to work fine but I would be interested in any comments about security or improvements that could be made.
class Bas... |
I've been trying to get better at Haskell for a while, and have recently been working on a lot of small projects with it. This constructs a binary decision tree.
The command to run it is:
stack exec decision-tree-exe <threshold> <training file> <testing file>
where threshold is in the range (0,1].
I think I've gotten ... |
I have been teaching myself Python (as well as Tkinter) and today one of the sites I was reading, asked us to write a program to covert one value from Fahrenheit to Celsius, once - an easy three line program. As you can read in the comments for the program below, I wanted to expand on this.
This program is one of the m... |
I've written a small package that counts the files and the size by file type in a directory tree. It produces the result as a markdown file.
Here is a sample:
| directory | type | count | size |
| --- | --- | ---: | ---: |
| 0_0_root | ALL | 26 | 29.914 MiB |
| 0_0_root | .mp3 | 4 | 3.901 MiB |
| 0_0_root | .jpg | 5 | ... |
I have two dataframes:
One contains of company and its corresponding texts. The texts are in lists
**supplier_company_name Main_Text**
JDA SOFTWARE ['Supply chains','The answer is simple -RunJDA!']
PTC ['Hello', 'Solution']
The second dataframe is texts extracted from the company's webs... |
I've got a large macro which calculates diverse things for my job. I work in a contact center.
Firstly it writes people and forecast data. With this calculates if there are more/less people than it should (depending on the forecast). After this calculation Uses it to calculate the break time for everyone CalculadoraAux... |
We are developing an automatic text Captcha solver in python 3. The solver has a module that is responsible for extracting letters out of captcha images that contain 4 letters each. We would like to get a review of this module and understand if there are any ways to write it more elegantly.
Here is an example of a capt... |
I have completed my initial version of BlackJack with Javascript and some JQuery. Any thoughts of this version? I can't seem still to implement timer successfully as I have commented out. After implement the timer (delay of 2 seconds for each card dealt, the hit and stand button breaks).
I updated my code to fixes some... |
I recently discovered to joys of rust programming and I have written a tic-tac-toe game. I was hoping for some feedback on how it is made. (The reason split and input are separate functions is because this is part of a larger collection of games)
fn input(prompt: &str) -> String {
let mut out = String::new();
... |
I finally finished the code for a snake game I was working on. I would like it if you were to give me some advice as to things that can be improved.
#ifndef UNICODE
#define UNICODE
#endif
#include <iostream>
#include <Windows.h>
#include <conio.h>
#include <ctime>
#include <random>
#include <queue>
#include "Snake_seg... |
Given a binary tree, determine if it is a valid binary search tree
(BST).
Assume a BST is defined as follows:
The left subtree of a node contains only nodes with keys less than the
node's key. The right subtree of a node contains only nodes with keys
greater than the node's key. Both the left and right subtrees ... |
Suppose I have some expensive function expensive_computation which takes a long time to compute but it always returns the same value.
I want to avoid paying the cost of computing this function because it may never be called.
Here is my solution to this, is there a more obvious or clean way to do it? Or maybe even some ... |
I've found the following code invaluable in helping me 'handle' None values including "whitespace" characters that should be treated as None based on the situation. I have been using this code for quite some time now:
class _MyUtils:
def __init__(self):
pass
def _mynull(self, myval, myalt, mystrip=T... |
This code calculates pi via collisions; it asks for a user input of N which determines the mass of the second block. It is fully working, it just takes forever to run when N >= 2. I want to be able have at least N=5 and have a reasonable runtime. The issue is in the velocity and x1, x2 calculation I believe. There are ... |
So, I'm in the midst of writing a programming language interpreter in Python, and one of the problems I'm concerned about is that since I've been using a lot of recursions to implement the interpreter, I'll get a stack overflow if the size of the code is too large. For example, I have a piece of code that evaluates an ... |
What I need to do is create a new object, modify it using a recursive function, then merge it with another object, and do this all in such a way that the values of the new object take precedence over the values in the object I'm merging it with.
Currently, my code works, but I'd like to have more readable code, particu... |
this is the first time I've requested a code review. I'm writing a piece of software in C++ that will use HTTP for communication. I wanted to do it myself to learn and then have someone review it and tell me where I could make some improvements. I'm having some problems with class member object initialization.
I've br... |
Working on the 2 element subset sum problem (finding two numbers in a list that sum to a given value), I came up with a relatively short solution code-wise.
The code could fit on a single line but I'm not super familiar with python so is this is a naive way to solve/implement it?
How efficient is creating a set and in... |
I am writing a clock in / out and payroll app for Android. I am no professional, but I was hoping I could get some feedback on whether my code is spaghetti or not. This is just one of many classes & activities, but I feel like this is one of the ones that is a little complex and I want to make sure I am not learning to... |
This is my first program ever made in C. Before that I programmed just a little bit in C++ (didn't touch OOP so I did only structural programming). This is my second "project" ever made, the first "project" was even bigger joke. I am new to programming.
The project is nowhere near to be finished. However, it somehow wo... |
Background
In many languages we have built-in data types for representing decimal floating point numbers. In .NET that's decimal, and in Java we have BigDecimal.
Now these are fundamentally different types. The .NET decimal is a fixed size value type, so its representable range and precision are limited (±1.0 × 10-28 t... |
This is a bash library intended to be used in a CI/CD pipeline to make finding the next release number for a Debian package semi-automatic. I figured out how to use a JSON file as a metadata store since the CI/CD pipeline I'm working with doesn't provide any metadata storage across jobs.
I'm basically happy with how t... |
I've written a pair of functions that can be added to a module or script that will allow the developer to specify a list of options and let the user select with the up/down arrow and return any selected with Enter, or abort with Esc.
I haven't used them much yet, and I'm wondering if there are any features that they'... |
This is a script I wrote to:
Combine multiple text files into one CSV
Append the source file's name to each line of data
This script currently takes about 3 seconds per 10,000 lines read - this is so long in comparison to a working batch/Perl script I have that I'm wondering what I'm doing wrong.
Comments about wheth... |
I am doing a project in plant pest detection using CNN. There are four classes each having about 1400 images. While training the model using Convolution Neural Network, there is a smooth curve for training while for validation there lots of ups and downs in high range. After that,I start using alexnet architecture of C... |
My relevant work experience is with Java (mostly web development with Dropwizard/Spring) so I can not avoid using the same practices as I do in a Java project. The project is there but I am going to copy it here:
Project
A very simple project with Gin framework with an endpoint to return a list of users based on their ... |
This is a simple CLI Blackjack game in python3. I saw that there were others already posted here and tried to implement some of their solutions and logic where I understood it. My game is a little different in that I have a "probability mode". This shows probabilities of bust or blackjack if the user takes another hit.... |
I made a small script to get a list of all download links from an FTP based File Hosting URL. I have tested it on a couple of URLs and it works reasonably well.
Can you please point out mistakes and bad practices, suggest ways to improve, and if possible further generalize the code?
Also, please suggest ways I could u... |
I implemented the Sieve of Erasthotenes recursively using filter and I was wondering how efficient this implementation is and wether a non-recursive implementation or something without filter would be better. If someone wants to get into micro-optimization etc. - that would be fun too I suppose :)
This is my code:
def ... |
Here my attempt was to write a graph algorithm the way a competitive programmer would write under time pressure. The problem to solve was to find a shortest path in a directed, unweighted graph using breadth-first search algorithm (BFS, for short).
Basically, I would like to hear comments on my style. Is it effective, ... |
After my last attempt, I started to learn Rust again. This time I wrote a simple HTTP router. I would appreciate it if you could help me to fix my mistakes.
Here is the link of the repository
main.rs
fn main() {
let mut router = Router::new();
router.get("/home", home);
Server::new(router).run("127.0.0.1:8... |
This is my first shot at writing a makefile for a document generation system. Please identify any more ways to refine it. Some pointers on how it works:
The INPUT files initially are templates to be edited and are copied to the "src" directory upon first execution only.
The code at the beginning tests for an environme... |
I felt that having a plain red favicon for every youtube tab is a little boring. So, I wrote a TamperMonkey Script with the new ES6 promises that replaces the favicon with the channel's logo. Link to the script here.
The script works by first extracting the channel logo's URL from the window.ytInitialData object. Then,... |
I want to write a function that merges two sorted lists in Python 3.
For example:
>> merge_lists([2, 5, 9], [1, 6, 8, 10])
[1, 2, 5, 6, 8, 9, 10]
My implementation is as follows:
def merge_lists(L1, L2):
Outlist = []
while (L1 and L2):
if (L1[0] <= L2[0]):
item = L1.pop(0)
Outl... |
I am trying to write simple graph lib in C++, BFS, DFS etc..
I want to create class GraphI which will represent any graph and will include necessary methods so my library could work.
Could I add/remove/improve something from my code?
#pragma once
#include <algorithm>
#include "colors.h"
struct Vertex;
template < typ... |
This is a Computer science glossary that I made with Tkinter. The user inputs the word that they want and then the code searches the text file for it and then ouputs it to the user.
#My Computer Scienece Glossary project
from tkinter import *
#key down function
def click():
global definition
entered_text=text... |
I am working on a Chess AI using chess.js, and currently, it can run 3 layers in under 10 seconds, but 4 or more takes minutes. How can I optimize my current code to be able to run 4 or 5 layers, or do I have to implement a different algorithm.
Here is my code:
function startMinimax(depth, game, isMaximisingPlayer) {
... |
Yesterday I had help via Stack Overflow on a program I written some code for, and needed to know if it needed to be improved.
After reviewing the responses, I restructured the code into the following...
using System;
namespace Language
{
public static class Grammar
{
/// <summary>
/// Returns a... |
https://leetcode.com/problems/maximum-depth-of-n-ary-tree/
Given a n-ary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
For example, given a 3-ary tree:
We should return its max depth, which is 3.
Note:
The depth of the t... |
I'm working on a personal game project to hone my CSS, HTML, and vanilla JS skills. I would appreciate any feedback on my small dice game project.
ceelo-js Codepen
The main logic of the game is run by this function:
getScore: function(results) {
let message = '';
if (results.toString() === WIN) {
message = `${WIN} Yo... |
https://leetcode.com/problems/n-ary-tree-level-order-traversal/
Given an n-ary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).
For example, given a 3-ary tree:
We should return its level order traversal:
[
[1],
[3,2,4],
[5,6]
]
Note:
The depth of th... |
I just started using c# and I made this snake game in a console application . It is a bit jittery when i run it in visual studio. How could I improve it to be cleaner and less jittery.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
namespace _2017project1
{
class Program... |
Ok, so I have been looking for resources on how to make a registration form work with input validation. I want the error message show up under the table of the registration form and not on top of the website. Here is what I have working so far, but I am still learning and I would like to improve:
<?php
$host = 'localh... |
Background
A forcefield is a collection of functions and parameters that is used to calculate the potential energy of a complex system. I have text files which contain data about the parameters for a forcefield. The text file is split into many sections, with each section following the same format:
A section header wh... |
In the picture below, I want to open a modal when a user clicks anywhere within in the yellow block, including if they click on the white ‘+’ sign. The problem is, the click event happens on a different target depending on whether the user clicks on the yellow portion, or on the white ‘+’ sign.
In my JavaScript code, I... |
To get a better handle and understanding of how bitfields, unions, and the byte alignment of structures work, I'm simulating a template Register structure.
The requirements of my Register are as follows:
Default size or width of a register is 8 bits or 1 byte
Larger size registers must be a multiple of 8
Registers are... |
Much of the academic exposition of Dijkstra's Algorithm (such as Wikipedia, or this class page from Darmouth) relies on your priority queue having the ability decrease the key of an entry: the priority queue fills up once at the beginning of the algorithm, and then exclusively shrinks, with one entry being popped at ea... |
This is my version of the Huffman Codes.
/*
Author: Stevan Milic
Date: 05.05.2018.
Course: Data Structures II
Professor: Dr. Claude Chaudet
Description: Huffman Codes
*/
#include <iostream>
#include <cstdlib>
using namespace std;
#define MAX_TREE_HEIGHT 1000
// A Huffman tree node
struct MinHeap... |
I recreated the game Hangman and I'm decently happy with it, but like always it would be preferable if anyone knew how to improve my code:
main.cpp
#ifndef UNICODE
#define UNICODE
#endif
#include <iostream>
#include <conio.h>
#include <Windows.h>
#include <ctime>
#include "gameInfo.h"
// Function declares
std::wstri... |
I'm very new to coding and decided to try a mini-project in python to create a 'guess the number game'. I was just hoping for some feedback on my code-writing to prevent bad habits before they develop. This program runs smoothly but I would like to know if there are improvements I could make.
In particular:
How can I ... |
I have made an exercise where I need to calculate the average per row of a .txt file. (see below)
Toa Narumi gradeA 10 8 7 4 6,5
Jean-François Le Clerk gradeB 5 4 7
Joe GradeC 10 10
I only want the numbers behind the name and grade.
This is my code:
using System;
using System.Collections.Generic;
using System.Linq;
us... |
I'm trying to learn python and I'm modeling a simple dice game that a friend and I invented.
On any one turn of the game, you must roll a specific combination to stay in the game.
The particular rule I'm trying to model is this:
Given a previous roll (where the dice are contiguous) make another contiguous roll either a... |
I have improved my BFS in Java according to vnp's suggestions. Again, we wish to find shortest paths in directed unweighted graphs using BFS, competitive style (no Maps, Set's or Lists):
import java.util.Arrays;
class BFS {
static int[] bfs(int[][] graph, int sourceNode, int targetNode) {
int[] queue = ne... |
I decided to do an algorithms course (Roughgarden's on Coursera), and am setting out to implement each algorithm as it's introduced, in Lisp. We start with mergesort which is introduced as the canonical example of the divide and conquer paradigm.
The point of the paradigm being a problem is divided (into two), and solv... |
I am converting an old Objective-C class into Swift. My actual question is at the very end after all of the code.
Here is a cut-down version of the Objective-C class:
DateInfo.h:
#import <Foundation/Foundation.h>
@interface RMYearInfo : NSObject
// There are also some instance properties but those aren't relevant to ... |
For the first readers-writers problem, in which readers can access a given resource simultaneously, is the following Python3 solution correct?
Problem parameters:
One set of data is shared among a number of threads
Only one writer may write at a time, and no other thread can read the resource
If at least one reader is... |
Thank you to everyone for the feedback provided to the initial version of this program posted here.
Please find below the newest version, revised based on the comments provided, for review and comment on how I can further improve my coding.
I have removed the portion of the program that checked if the provided value wa... |
This is a follow up of my original question in which I'd still like to have some answers, opinions etc. but after looking through some of the standard library's features I have come across std::bitset and was looking at its behavior.
I managed to write a simple class template to provide the behavior I was after. This ... |
I decided to take up learning c++ recently, so I coded a Huffman compression algorithm. I'm particularly interested in critique of my c++ techniques (pointers, references, best practices, etc), but I am open to any comments you have.
Thanks for you time!
#include <map>
#include <iostream>
#include <vector>
#include <de... |
The task
is taken from leetcode
There is a robot starting at position (0, 0), the origin, on a 2D
plane. Given a sequence of its moves, judge if this robot ends up at
(0, 0) after it completes its moves.
The move sequence is represented by a string, and the character
moves[i] represents its ith move. Valid moves... |
I am trying to implement the Execute Around pattern described in Kent Beck's Smalltalk Best Practice Patterns. An example in Java could be found here.
Basically, I am repeatedly opening and closing a pdf document while performing various operations, something like,
public void Parse()
{
// Open the document
Pd... |
I had a code challenge for a class I'm taking that built a NN algorithm. I got it to work but I used really basic methods for solving it. There are two 1D NP Arrays that have values 0-2 in them, both equal length. They represent two different trains and test data The output is a confusion matrix that shows which rec... |
This is my simple unique_ptr implementation. Anything that could be improved upon or should be added?
#include <algorithm>
template<typename T>
class unique_ptr
{
private:
T * ptr_resource = nullptr;
public:
// Safely constructs resource. Operator new is called by the user. Once constructed the unique_ptr will... |
I created a twitter bot, that can parse a subreddit and post content from there to Twitter. I am running this bot using a cron-job, which starts the app using npm start after a 1-hour interval. Here is the code:
const Twit = require("twit");
const request = require("request").defaults({ encoding: null, });
const config... |
I have made an equivalent of Python's "eval" command in Arduino (which in itself is quite a feat) but the part that decodes the output of it is not small enough to fit in another 30 functions since this will be running on an Arduino Micro.
Any suggestions on compacting it? (btw I don't care about the actual function, r... |
I wanted to use <select multiple> but was annoyed by the poor design on desktops which is why I created a version with dropdown:
convertSelect("001", "Options");
function convertSelect(el_id, name) {
let el = document.getElementById(el_id),
opts = Array.from(el.options);
let input_el = document.crea... |
In Main.cs, which is attached to a GameObject that has a MeshRenderer and MeshFilter:
using UnityEngine;
[RequireComponent(typeof(MeshFilter))]
public class Main : MonoBehaviour
{
public int divisions = 0;
public float radius = 1f;
private void Awake () {
MeshFilter meshFilter = GetComponent<MeshF... |
I have one model class as listed here:
class Post < ActiveRecord::Base
has_many :comments
def tags
comments.map(&:tag).uniq.sort
end
end
and below is the best rspec as per my understanding:
context 'tags' do
let(:post) { Post.find_by_code('TX') }
it 'returns sorted alphabetically list of available tags... |
Powershell has the Split-Path cmdlet which allows you to extract the Parent and Leaf of a file. In PS version 6, you can extract the extension, with the -Extension switch. Why this wasn't a feature of PS version 4 and greater I don't know, so I decided to write my own version in Python.
PathUtilities:
# PathUtilities.p... |
Here is my program to find the largest number(s) in a list of elements, possibly non-unique (in Python):
item_no = [5, 6, 7, 8, 8]
max_no = 0
for i in item_no:
if i > max_no:
max_no = i
high = [i]
elif i == max_no:
high.append(i)
Example input: [5, 6, 7, 8, 8]
Example output: [8, 8]
Ho... |
Summary: Given a string find the number of anagramic pairs of substrings of it. e.g 'abba' pairs are [a,a],[b,b],[ab,ba],[abb,bba] so we have 4 pairs.
I'm wondering if anyone can help me improve my code so that it runs faster. My code passes all test cases when running locally, but times out on hackerrank. Any ideas ?
... |
I have this Java implementation of a Rubik's cube's state. My primary concern is DRYness of my code:
RubiksCubeNode.java
package net.coderodde.libid;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
/**
*
* @author Rodion "rodde" Efremov
* @version 1.6 (May 4, 2019)
*/
public final class R... |
I write decently sloppy code and piecemeal together various things I find online to help me accomplish what needs to be done. This loop goes through 4 different worksheets to paste a formula in 3 columns. Based on some previous feedback from the site, I removed all of my .Select references and hopefully did things more... |
I have finished a simple Tic Tac Toe game, and I'd like if anyone was to give advice to how I could improve my code.
main.cpp
#ifndef UNICODE
#define UNICODE
#endif
#include "gameInfo.h"
int main() {
// Gets the screen buffer size (for somewhat of compatability)
CONSOLE_SCREEN_BUFFER_INFO csbi;
GetConsol... |
I am studying design patterns, I was wondering if my approach makes sense.
I am trying to implement the strategy pattern. I think I have captured the essence which is
Define a family of algorithms,
encapsulate each one,
and make them interchangeable,
as shown in the example code below.
Have I captured the inten... |
I am relatively new to programming and have been recommended to work through the many tasks in order, in order to better my skills. For some reason, problem 42 had me stumped for a while:
The nth term of the sequence of triangle numbers is given by, tn = ½n(n+1); so the first ten triangle numbers are:
1, 3, 6, 10, 15,... |
I am self thought c# kiddy and wonder if little projects like one here, are worth showing to potential employers when looking for junior developer position.
This code has some issues that i do not know how to tackle, and error handling is poor. What do you think ?
https://github.com/moment93/SimpleServerClientApplicati... |
I am writing my own 3D engine. I initially made the code quick and dirty but after a while the code became pretty messy and it have a lot of repeating code so I am currently cleaning up some of the code that I have written previously, one thing I didn't do originally was creating a base class for my 3D objects and I di... |
I have a class that I'm using to find the shortest word ladder between two words. Each "Step" in that ladder is returned as a String element in a LinkedList. If it can't find one, it returns an empty LinkedList. The class is only intended to work with capital letters.
A step can only be formed from a word in the HashSe... |
For my code, up to the 5th row, the formatting of my triangle is fine. But once I hit the 6th row, the formatting turns funny because I start having double digits. Is there any way to fix this?
Also is my code optimized? Any way I can make it better?
Thanks!
function pascals(num) {
var result = [[1],[1,1]];
if (nu... |
I have a fairly complex query which insert multiple rows into a table from multiple tables. Its works fine but I really don't want to use cursor as some blog says cursor took long time for execution (of course it depends). I hope I could find alternative way for minimize my execution time or cursor complexity. Here is ... |
For lack of better things to do I went on coderbyte and did one of the simple challenges since I have not written code for a little while.
The problem was stated as following:
Have the function LongestWord(sen) take the sen parameter being passed and return the largest word in the string. If there are two or more words... |
I have created a binary to decimal calculator that needs to follow this spec:
Arrays may not be used contain the binary digits entered by the user
Determining the decimal equivalent of a particular binary digit in the sequence must be calculated using a single mathematical function, for example the natural logarithm. ... |
I have created a program that lets you play the fifteen puzzle game. You have to get the blocks into ascending order by moving them into the one open space. I would like some feedback on the code and how I made it. This works best in full screen mode.
"use strict";
class Block {
constructor(x, y, w, h, value) {
... |
I've just published a small library implementing the RSA Blind Signature process.
Here's the GitHub repo!
I needed something portable, and easy enough to use that I could ask other people to incorporate it into their work. Nothing like that seemed to be available, so I put it together using the Crypto++ library, some ... |
I have written an answer to this question on Stack Overflow. To make it easier for you, I have copy-pasted the main question below.
Write a program that generates 100 random integers that are either 0
or 1.
Then find the:
longest run of zeros, the largest number of zeros in a row. For instance, the longest run of z... |
I have my movie folders formatted:
~: no sub included
{}: already watched
nothing: sub included, ready to watch
the program asks for the movie directory; extracts the name and searches IMDb for the name; renames the given directory to the first IMDb search result.
finally saves what you'd see when the first result is... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.