instruction stringlengths 71 95.1k |
|---|
This is a follow up to my last question:
Multiperson chat server using the select() API
Changes:
After much fine critique, I made the following changes to the code:
Removed redundant casts and initializations.
Moved the contents of selectserver.h to selectserver.c.
Rewrote the read_line() function (Added checks for bu... |
I'm trying to find out whether a particular file is UTF-8 encoded readable text, by which I mean printable symbols, whitespaces, \n, \r\n and \t (think: source code). As speed is of importance, this has to be determined from just the first few dozen or so bytes of the file.
I've tried my luck using an io.RuneReader, im... |
The app is based upon an exercise from a Udemy-course. The purpose is to become familiar with LazyColumns. I've enhanced the exercise with a Details-view and a navigation between LazyColumn and Details.
Here are the essential code-snippets:
// MainActivity with the definition of the navigation
class MainActivity : Co... |
I am developing a custom reusable web component using Svelte (a "tabs" component), I would like to know is my code is idiomatic Svelte and also any suggestion for improvement is welcome.
Illustration:
I believe that component can be useful. It can be used as a menu widget which is very easy to use or as a pseudo routi... |
This code has been revised. See (Rev. 2) Command-line Tower of Hanoi game
Compiled with g++ 9.4.0. makefile included. Any criticism welcome.
main.cpp
/*
Author: Jared Thomas
Date: Tuesday, August 4, 2020
*/
#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstring>
#include... |
This simple implementation hides text secrets (S) in images by manipulating the least significant bits (lsb) on Pixels.
How it works
When encrypting I take a three pixel "chunk" for each byte. Each bit of the byte is hidden in the RGB (lsb) values of the pixels. The last blue value in the last pixel of each chunk is an... |
I am trying to group uncorrelated variables into subsets. So, using the correlation matrix, I check each variable to see the correlation. If correlation is more then a threshold I will create a new list, else I will add it to the current list. At the end, in each subset the variables are not correlated. I have written ... |
I am very new to rust and have been reading up and playing around to get a better understanding. I was trying to replicate a small task that I have done via bash scripting before, as a way to continue learning. The task involves getting the sub-directories of some base directory, where all sub-directories will be num... |
I have implementted a simple JavaScript function to find the list of abundant numbers and print them on the screen.
an abundant number is a number for which the sum of its proper divisors is greater than the number
The function printAbundantNumbers(), takes an argument, which is a range that tells the function how ma... |
The majority of merge sort implementations searched online are provided with unnecessary variables and code lines. Here is an attempt to reduce that. However, does passing back the subArray as return types around cause any extra overhead on space complexity due to the temporary auxiliary space requirements for the ret... |
Let's say that we have a list of strings and we want to find the steps (pair representing swaps to be made) to sort it. Here is my current implementation:
#include <algorithm>
#include <unordered_map>
#include <vector>
auto is_lexicographically_ordered = [](const std::string &s1, const std::string &s2) {
return st... |
I have written the following code. I hope to improve how it completes the given task, since I think that my code - even if "properly working" - is quite "brute" and it could greatly use some improvement.
The exercise is about Agility (dogs) and it wants me to calculate, for a total of 9 pairs (dog+human), the total pen... |
I have created a program in python that calculates forces between bodies (i.e earth, moon and a hypothetical moon) and make them move according to the changes in velocity and forces. This is the code for the program:
from math import sin,cos,sqrt,atan2,pi
import pygame
pygame.init()
class Planet:
dt = 1/100
G ... |
As an exercise I've implemented malloc and free in Python as a first fit free list as described here. This tracks which blocks are free in a doubly linked list that is sorted by the address of the first byte of the block. It also keeps track of the size of each allocated block in a dictionary. The time complexity is \$... |
I've coded a program that calculates the number of partitions of n into at least two distinct parts, and is relatively quick too (about N^1.5 complexity). For input 30 000 it takes roughly 4 seconds. The memory usage rises due to its recursive nature (1Gb for 30 000). I need to calculate input that is max 300 000, but ... |
I have a known hierarchy of the organization units, by descending order:
$hierarchy = [
"a" => "organization",
"b" => "company",
"c" => "group",
"d" => "unit",
"e" => "sub_unit",
"f" => "team"
];
I am then given an input key-value array which can consist of any of the units, but not necessarily... |
I am trying to make an AvaloniaUI user control. I want to be able to set a property at design time from inside my XAML files and see the result in the designer in Rider, such as the "Hello World!" text below.
The approach I have taken is to add a property to the control that gets and sets the Text property of a TextB... |
I want to add classes to elements based on a source array or object.
For example, it can be:
classesArr = ["class1", "class2", "class3"];
or
classesObj = {class1: "class1", class2: "class2", class3: "class3"};
the way I currently do it is:
// for arrays
element = document.getElementById("myelement");
classesArr.forE... |
I've been using this extension in almost all of my projects. What's your opinion? Do you think there is something else to add or to be improved? The idea is to ignore all default ASP.NET messages that are there by default and if optionally to override stuff via configuration. I actually override Microsoft.AspNetCore.Ho... |
The goal of the code is to enable me to express a 2D array in an unsorted coordinate-sparse representation in my code (i.e. a list of individual x, y, value entries in any order), but have this converted at compile-time to a more-readily-accessed row-sparse representation of that array (i.e. an array of pointers to row... |
I am writing a utility class to store RGB images and do a few utility functions as a way to learn C++.
#include <fstream>
#include <iostream>
#include <numeric>
#include <cmath>
using namespace std;
#define RGB_H 203 // CHANGE THIS DEPENDING ON THE IMAGE NOTE 1512 before 810
#define RGB_W 360 // CHANGE THIS DEPENDING... |
I have a lexer (program that turns source code into tokens) written in Go that I am re-writing in Rust.
The lexer should take in a sequence of tokens, generally different special characters, integers, or string sequences (identifiers) and output tokens representing those 'types'.
I'd like to write more idiomatic Rust, ... |
I have food table having number of foods, each food can have specific properties in multiple languages (en, es) like name, description etc. But it is not sure if all of the properties are always present for preferred language of that user, so if they are not present for preferred language we can pick the properties fro... |
My code seems to work fine, but I'm interested in how I can make it faster. I really just want to reduce any wasteful computation (for instance eta_m = eta / (double)m reduces coef[j] -= eta * gradient_coef[j] / (double)m to coef[j] -= eta_m * gradient_coef[j]). I realize a good BLAS implementation would probably be us... |
So I have the following relationship in my Model:
Events Model:
class Events extends Model
{
use CrudTrait;
use HasFactory;
use Sluggable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'title',
'url',
'start',
... |
Background
This code is apart of a library I'm developing for my company. It takes in anywhere from 3 to 5 arguments. All of the code functions properly. To be more specific, a user has data on a spreadsheet that they want copied somewhere else. The first function takes the data the user wants copied and puts it somewh... |
I have very basic principle. I have multiple types of entities with some shared functionality. Some of this functionality is highly customizable and you want to be able to swap it out even for a single type.
For example, I have an "Entity" type and subtypes "SmartAgent" and "Agent".
Their instances may or may not have ... |
I am working on a boto3 library and getting some metrics from aws cloud service cloud watch and that works perfectly fine, however, I am placing this question just in anticipation to get a review and guidelines form the python experts to make this code more explicit and distinct for readers so I can also get the opport... |
I wrote a neural network in python using pytorch, which determines the gender of a word in Russian. As a training set: a file containing a word and a number from 0 to 2 (0-masculine,1- feminine and 2-neuter). I'd like to improve and simplify this code as I'm not too familiar with pytorch technology yet, I'd appreciate ... |
I'm a newbie when it comes to programming. I'm working on a console app that subscribes to ChuckNorris JSON API and displays the results.
I believe I took into account all possible scenarios. Do you guys think I missed anything? Or something can be done better?
using System;
using System.Collections.Generic;
using Syst... |
I have been working hard trying to learn Haskell, or at least understand it enough to make simple programs. This is my first program. I have been working on it for about a month now. I had already gone through 4 different Haskell courses. None of which explain even basic usage. My goal was SDL2 a game, one I have alrea... |
I have written the following simple scoped timer struct in order to help me measure the execution time of arbitrary scopes.
Here is the code (live):
#include <chrono>
#include <thread>
#include <cstdio>
#include <fmt/core.h>
#include <fmt/chrono.h>
template < class Time = std::chrono::microseconds,
class ... |
I have this small subclass of JavaFX's javafx.scene.control.Dialog that requires the enum specifying the data type of the input data:
package com.github.coderodde.jfx.ui;
import java.util.Objects;
import java.util.Optional;
import javafx.event.EventHandler;
import javafx.scene.control.ButtonBar.ButtonData;
import ja... |
I would like to create a grammar for the Conventional Commits spec and I would love to hear any feedback for what I wrote.
The spec has some ambiguities, I think, hence my usage of "island grammars" to avoid writing predicates and such, which would limit the parser to a certain language target.
An example of a conventi... |
This library is a fork of eteran/c-vector. It is macro based, so that it is generic, without void pointers and additional functions. This of course means that it has the downsides of macros in C. The repository for the project is hosted here. It is still in its early stages, in the future I will upload the unit tests f... |
// January
// This program inputs the # of days in January 1-31
// Brandon Summerlin
// 2/03/2023
#include <iostream>
using std::cout; using std::cin; using std::endl;
int main() {
//inputs the numbers
cout << "input the number from 01 to 31: ";
int number;
cin >> number;
const int... |
The following is my solution to the Letter Blocks problem from Codejam 2022: https://codingcompetitions.withgoogle.com/codejam/round/0000000000877b42/0000000000afe6a1.
Problem
It is a rainy day, so you are indoors building towers of letter blocks. A letter block is a wooden cube that has a letter printed on one of its... |
Quick sort is a sorting algorithm in which we select any random element as pivot from the array and we do the partition of the array around that pivot. Basically we place all the elements smaller than pivot on its left side and the elements greater than it on its right side.
So following is the code written by me that ... |
I am using Powershell 7.
We have the following PowerShell script that will parse some very large file.
I no longer want to use 'Get-Content' as this is to slow.
The script below works, but it takes a very long time to process even a 10 MB file.
I have about 200 files 10MB file with over 10000 lines.
Sample Log:
#Fields... |
Given a std::vector<std::vector<double>> (e.g., representing some points in a space with D dimensions), I want to compute a new std::vector<std::vector<double>> where each double is the negative of the original, as in the following MWE:
#define FMT_HEADER_ONLY
#include <fmt/ranges.h>
#include <vector>
#define D 3
std... |
This is a follow-up from Command-line Tower of Hanoi game -- many thanks to those whose reviwed it.
By request, the project is also available on GitHub. Forks and bug reports are welcomed.
Compiled with g++ 9.4.0. makefile included.
Issues addressed
The disks are further differentiated between even and odd by
styling,... |
I have several components/pages in my personal project that contain complex logic and even nested ternary operators. Since I'm the only person working on this project, I don't have a hard time figuring out where to make changes if I need to.
But I'm trying to improve my code in a way that others could work on it too. I... |
This is an x86-64 Linux program to print a non-negative decimal integer. I would appreciate any simple optimizations for size and readability. I am aware that division by a constant is usually done by multiplication by the magic constant reciprocal, but I used div here for simplicity.
; nasm -f elf64 print_dec.asm && l... |
review my code if possible. I am making network packet capture using pyshark and python. if possible give me some feedback about the code and help to make it better.
!/usr/bin/python
import argparse
import pyshark
import time
import re as regex
parser = argparse.ArgumentParser()
parser.add_argument('-i', '--interfac... |
https://github.com/floris-vos/vimeo_search_python
I made a small function that takes search terms as arguments and returns a dictionary with items, each holding an URL, title, duration, channel, and date published for a search result (the title is the key; a format that I have found extremely useful).
The function uses... |
In Python you can use print(locals()) to print a dictionary of all the local variables, but this has 3 shortcomings:
Double underscore variables will be included that is not what we usually want.
The output is in black and white, that can make it harder to read.
Only the variable names and their values are printed, ... |
I recently finished cleaning up my code in a compiler/interpreter for a strongly-typed domain-specific language, which makes use of three sorts of types:
Compile-time enumerated types: Have one of a set of values, defined at compile time (ex. type 'direction' has values 'up', 'down', 'left', 'right')
Run-time enumerate... |
Here is the original question. I have extensively revised and redesigned my custom scoped timer for my needs using the feedback I got from two helpful members of this community. However I was told to ask a new question in case I want my new solution to be reviewed.
Here is the revised version (live on Godbolt):
#includ... |
I created this script because the Spotify desktop app doesn't have a built in sleep timer, and I needed one. I made it as easy to use as possible, and it can close other programs because it asks for the package name at the beginning of the script.
import time
import sys
import subprocess
pkgname = input("Please set th... |
I'm learning Rust by solving ProjectEuler problems.
To this end, I am trying to port a solution to problem 88 (link) in Python that heavily relies on generators to Rust (which doesn't have generators).
A natural number, N, that can be written as the sum and product of a given set of at least two natural numbers, {a1, ... |
I recently started learning programming and in particular Java. I wrote this small hangman game which takes the input for the secret word from the user.
It all works as intended; I would like to know ways to optimize or improve this code (taking into account that the input must be taken from the user and not from a fil... |
I am using Bootstrap v5.3 to create a card layout, and I want it to be SEO-friendly (see this link for my SEO-friendly criteria).
Below is my card component I wish to optimize and, if possible, to drop some classes from <div> elements for cleaner markup.
I am considering to put all styling inside a style file, which is... |
I am looking for a way to ship dependencies (dynamic libraries) with an executable build under Mac OS with Crystal-lang, is there a way to improve on:
It seems to works, but it is a bit of a hack.
# The name of the executable
app=$1
# Create a directory to hold the app and dependencies
mkdir -p "MyApp.app/Contents/M... |
Below is a Vue app I wrote to draw a Sierpinski Triangle given n iterations, which can be incremented/decremented via a HTML input control. I was wondering if there were any ways this code could be optimized.
const app = new Vue({
el: "#app",
data: {
canvas: null,
context: null,
v1: 0,
v2: 0,
... |
So I am currently writing a function in laravel that handles URL parameter filters.
How the code works: So we have the following two URL parameters:
timeframe and category
an URL would look like this:
/events?timeframe=3&category=6
but it can also look like this
/events?timeframe=0&category=0
the range for the timefr... |
Using a hash map and vectors, create a text interface to allow a user to add employee names to a department in a company.
For example, “Add Sally to Engineering” or “Add Amir to Sales.”
Then let the user retrieve a list of all people in a department or all people in the company by department,
sorted alphabetically.
I... |
I have a VBA that takes all the rows with the same ID in Column 1 and concatenates the data in Column 3 to a single cell with line breaks. The code then deletes the old rows. The code works, but takes 10+ seconds to run. I have about 3-4k rows of data but I was hoping this could run much faster.
Sub merge()
Dim lngRow ... |
Hello everyone
Last week I've started creating a little project for fun - TapType Game, I know there is a lot of things to make better, but what about my solution, can you give me some general tips, how to make it better? Thanks in advance, and have a nice night.
import tkinter as tk
from tkinter import ttk
from typing... |
I was working on a code base where I have a function definition like this:
int TaskM::GetDefaultValues(unsigned long ccId, unsigned long at, unsigned long& sId, string& dName, void * db = NULL);
The task of above function is to assign sId some value based on the logic inside the function.
I need to call this function ... |
I'm trying to make a imperial/metric length unit converter in Python. Here is my full code:
Metric = MM, CM, DM ,M, DAM, HM, KM = ('mm', 'cm','dm','m', 'dam' ,'hm', 'km')
Imperial = IN, FT, YD, MI, NM, barleycorn = ('in', 'ft', 'yd', 'mi', 'nm', 'barleycorn')
Vaildunit = Metric + Imperial
# defining
def valid(unit):
... |
After long googling I try to use the proposal indirect_value to implement a simple pimpl.
The reason for doing so is to hide "libarchive - archive.h" to the end user, also to be api compatible between releases.
What do you think about this code, it's of course only the impl boilerplate of the full code.
vfs_archive.h:
... |
Trying my hand at Leet 236.
Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.
According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes p and q as the lowest node in T that has both p and q as descendants (where we allow a node to... |
Trying my hand at Leet 236
Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.
According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes p and q as the lowest node in T that has both p and q as descendants (where we allow a node to ... |
I’m currently studying computer science at university and I’d been tasked with writing a MIPS assembly program that performs a permutation on an array. I’m asking here because my code actually worked and I got no feedback beyond that (on the style, comments & form).
Unfortunately the result is likely rather unperforman... |
This is my first Python program. It is not very user friendly, but it works. I used some code snippets and tricks I found in various places. And generous people at Stack Overflow helped me with recursion.
This program generates all free polyominoes of given level N for two given tiles: root and tile. Here how it looks ... |
I'm looking to improve the logic used in this ETL pipeline manager. The concept creates a structure:
Pipeline(Pipe(Task, [Task, ...]), [Pipe(...), ...])
...where a Pipeline contains one or more Pipes and a Pipe contains one or more Tasks.
Another important concept is the Operators, namely the Handle, Wrangler, and Load... |
This post is the continuation of A simple, funny, easy linked stack of lists in Java.
What's new:
Now I have varargs for pushing/linking multiple values per call.
Provided the unit tests.
com.github.coderodde.util.Multistack.java:
package com.github.coderodde.util;
import java.util.ArrayList;
import java.util.Concur... |
I am trying to merge multiple map with Java stream API.
The reqiurements like ...
this method can receive multiple map, does not care hot many of it
support 2 merge method: intersection, union
if key duplicates, it overwrites with later value
Here is basic code I wrote,
public class MapMergeHelper {
public static... |
I am new to Rcpp and am looking to make the following code as fast as possible. Any tips would be greatly appreciated.
It is running a lot slower than I would like.
I have tried vectorising as much as possible but i'm not sure how to vectorise further
In R I can vectorise this easily so i'm pretty sure it should be pos... |
I have a "flat file" with structure as below:
machineCode,Key,Ip_Name_No,Share_Percent,Account_Name,Account_No
"ygh048GT",4767,534293748,"100.00","cderfgdsc Publishing International Ltd","160102040"
"xcd064HW",6380,65424090,"100.00","dascdfrgh snm skion","00090382478"
"00006... |
I have the code such as this for opposite conditions.
For Each iCell In Range("A2:A6").Cells
If iCell.EntireRow.Range("H1").Value = "" Then
BOM = InputBox("The current BoM Code is...", "BoM Calculator v1.1", (iCell.Value))
scrUpdt = Application.ScreenUpdating
Application.ScreenUpdating = Fal... |
I have tried to implement my singly linked list to be optimal in the sense that when inserting I don't have to search for the tail and then chain the new node to it, I just keep track of the tail and then insert, resulting in O(1). This is my insert:
#include <stdio.h>
#include <stdlib.h>
typedef struct Node {
in... |
I have a list of sales:
items = [
{'product': 'A', 'customer': 'A', 'count': 10},
{'product': 'A', 'customer': 'B', 'count': 15},
{'product': 'A', 'customer': 'C', 'count': 100},
{'product': 'A', 'customer': 'A', 'count': 50},
]
I want to find the total sales of each product to every customer, like this:
items... |
I am trying to improve my Rust coding skills. One thing which I find hard to tackle is how to shift from a polymorphism you can observe in e.g. Python to sth. similar in Rust?
Let me give you a specific example. I would like to implement a very simple Graph (undirected graph) and DiGraph (directed graph) structures in ... |
I have a working gizmo movement script made in Raylib that allows me to move an entity (i.e. entity_in_inspector) in a 3D space using 6 arrows. Each arrow is rotated at a 90° angle from each other, and when I hover my mouse over an arrow, it turns green and I can change the entity's position in the axis the arrow is ro... |
This code scrapes the website www.oddsportal.com for betting odds and historical games.
code:
import os
import threading
from math import nan
from multiprocessing.pool import ThreadPool
import pandas as pd
from bs4 import BeautifulSoup as bs
from selenium import webdriver
from selenium.webdriver.common.by import By
fro... |
I'm a total Python beginner and made a number guessing game as first project. The user has to guess the number the computer is thinking of. Please give me feedback!
print("Guess a number")
import random
x = random.randint(-999, 999)
g1=int(input('Enter your guess:'))
while x != g1:
if x > g1:
print("It's ... |
I am trying to help students visualize the central limit theorem and wanted to do this with simulated data.
I created a population dataset with three variables:
from random import seed
from numpy.random import normal, negative_binomial, binomial
import pandas as pd
data = pd.DataFrame({
"Variable A": normal(0, 1, ... |
The code works, but I think can be simplified, I don't know which specific steps, but my version seems to me quite complicated
I build a function that takes a specific string format and returns a datetime.datetime object.
This is the string format "Fri Oct 11 15:09:30 GMT+01:00 2019" that I want to convert into a datet... |
I have implemented my singly linked list in C and I tried to do it with the most efficient code as possible. Is there any place for improvement?
This post is the second version.
First version of this question
Third version of this question
These are the operations I defined:
append (insert at the end -- 2 versions, wi... |
I have a program that sorts the vector containing only 0,1,2 in the sequential order so the input array of [0,2,1,2,1] would generate an output [0,1,1,2,2].
Following is the functional code however I feel like considering the input [0,0,0,0,0,0,0,0,0,2,2,1], i and left are being iterated over the same elements and I fe... |
This is my first independent project. Do you have any criticisms or suggestions before I deploy it?
App.js
import './App.css';
import { useState } from 'react';
import CurrentWeather from './components/CurrentWeather';
import { getCities, getWeather } from './api';
import AsyncSelect from 'react-select/async';
impor... |
I've been a .NET Developer for almost 4 years. I'm stronly learning and trying using design patterns and following SOLID principles for 3 months right now (I know - a little late, but better late than never).
I have complex business logic for saving some metadata in database (mainly jsonb object to postgresql database... |
I have a macro that inserts data from Excel into an Access table. Each time it runs there may be 10k -250k rows to insert. I have experimented with using an empty database/table but it still takes 60s+ to run. Are there any ways to speed it up?
Thanks
Option Explicit
Sub CopyToAccess()
Dim accessFile As String
... |
Previous versions of this question
First Version
Second Version
Changes
I added these operations:
Pop_back
Pop_front
You are not allowed to insert_sll at the front or back, but only in position i such that 0 < i < n=size-1.
I also tested the functions, so everything is working!
Thanks in advance for any improvement... |
We have worked an idea out that seems to have a wide usecase and there seems to be no examples for it on the web for python tkinter. Having unlimited space to draw can be crucial and can be done wrong in many ways (trust me I tried I few before coming up with this example). However, I'm a hobby coder and just tried (th... |
I have produced this GitHub repository that compares the performance of:
Robert Tarjan's off-line lowest common ancestors algorithm,
An improvement of the above algorithm.
Typical demo program output
Seed: 1676201833609
Tree constructed in 0 milliseconds.
Number of nodes: 77487
com.github.coderodde.algo.lca.impl.Tarj... |
I have designed a a small frontend project, a sign-up page. It uses HTML, CSS, JavaScript and jQuery. Being a beginner to frontend development, I want to adapt to all the best practices. I am looking forward to all your feedback.
My website has the following features:
View the optimal layout for the site depending on ... |
I've written a bash script that creates a root filesystem on ZFS for installing Debian or Arch. The purpose of this script is to make it easier installing e.g. Arch without the need to make a ZFS pool and create datasets one by one manually.
Below is my bash script. Any advice on what you would improve if you were the ... |
I am new at python and trying to solve the longest collatz series question. So I want to find out between 5 and 8, which number produce the longest collatz series and listed the series.
Here is my code, but now it is showing all series:
def collatz(n):
collatzseq = 0
while n != 1:
print(n)
... |
Problem:
I'm trying to reduce the computation time and optimize specific functions of a Reinforcement Learning algorithm in the training phase and observed that one block of code takes too much computation overhead (the for loop described below).
for loop description
The function takes in range self.n = 3 (n is the num... |
This is a request-response model over sockets/websockets (like HTTP) where you technically match request id to response id and return the response. In addition to that, there is timeout in case that message is never matched. It does its job but the implementation is not disposing the CancellationTokenSource and TaskCom... |
Say, I have my POSIX script introduction stored in variable:
script_intro=\
'------------------------------------------------------------
-- Safe system files editing as root --
-- Code language: POSIX shell script --
-- Copyright: 2020-2023 Vlastimil Burian --... |
Previous versions of this question
First Version
Second Version
Third Version
Fourth Version
Changes
I built upon the previous singly linked list and implemented a doubly linked one.
You are not allowed to insert_sll at the front or back, but only in position i such that 0 < i < n=size-1.
Thanks in advance for any impr... |
not sure if this project fits on code review, but my code is getting extremely messy, and would love some tips to clean it up!
Overview
The project is designed to take in an HTML file (a degree audit), and a couple of course catalog datasets from my University. Then, I output a potential schedule.
Here is an example:
I... |
I decided to learn more about how interpreters work and made a simple Scheme interpreter in Python. I'd like to hear some advice on how I could have written this better, or on the mistakes I've made.
Parser.py (I thought about putting the Tokenizer and Atom classes in different files, but they are too small for that. M... |
I am a novice and would appreciate some guidance. I have been trying to create a machine learning code that will correlatate 10+ binary variable and maybe a couple continuous variables to a binary ( or ideal trinary) categorization. Using python
So far I am using sci kit learn and have a training set in the format of :... |
Before I learned that GoAccess was a thing, I wanted an analytics solution that I could use locally on my web server. My solution was to write a bash script that would give me some basic info on how my blog is doing. What it attempts to do is to:
Find all views of a given page (as determined by lines in the access.log... |
I am new to coding, I hope you can help me to improve my code :)
First of all: The code works correctly.
using System;
namespace _3_dividing_2numbers
{
class Program
{
static void Main(string[] args)
{
try
{
OperationDevide();
}
... |
Follow up post
Link to question:
Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for '?' and '*' where:
'?' Matches any single character.
'*' Matches any sequence of characters (including the empty sequence).
The matching should cover the entire input string (not partial... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.