instruction stringlengths 71 95.1k |
|---|
The initial problem that led me to learn VBA is as follows:
You have a table that can be up to 10,000 rows (several hundred pages) long in a Word document. The table has a title in the form of a paragraph above the first row. This title is styled such that it links to a Table of Contents (Style = "Caption"). The table ... |
I was recently asked an interview question with regards to algorithm design. The challenge is as follows:
Given a 6 or less digits positive integer (0 - 999999 inclusive), write a function englishify(number: int) that returns the full English equivalent of that number. Here are some samples of the structure you are ex... |
I'm trying to optimize the following function f, written in python.
It is a function of an integer k.
First it calls another function G(k), which gives back a long list of certain objects. We want to manipulate this list as follows: two elements a,b are equivalent iff the function H (which is a given function that can ... |
I want to use the android component autocomplete:
https://developer.android.com/reference/android/widget/AutoCompleteTextView
There are some possible values the user can select, but I also want that, the user starts typing and, if there is no match with any of the "possible" optionsm, then, the text the user wrote is a... |
I've a C# WinForms application that relies heavily on sending HttpWebRequests. I've build an HttpWebRequestBuilder, and WebRequestBodyBuilder.
public class HttpWebRequestBuilder
{
private HttpWebRequest _httpWebRequest; // The object that will be built.
public HttpWebRequestBuilder(string url) : this(url, Const... |
I'm looking for general feedback as how to improve my code. I wrote the program starting out with no functions, making it very difficult to adapt. When I separated the program into functions it became very repetitive.
How can I improve my code?
"""
A program for comparrison of triangulation (wave or skipping stones, no... |
I have written this code that connects to a mysql database. The function should be able to be used as a context manager - via with. It is working, but I am not sure if this is a great way of doing it.
conect.py
import os
import mysql.connector
from mysql.connector import errorcode
import contextlib
_CFG = {
'user': ... |
I wanted to know is this the best way to handle a SegmentedControl using the e.NewValue? Base on the selected segment I hide and select different data?
XAML
<telerikInput:RadSegmentedControl.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Option One<... |
I made a very basic social network Java program. I was wondering if my design could be improved. I have 2 classes (+ 1 driver) : Person and Graph. I would like now to add a new method hasAccount(Person person) in the Graph class to check if a Person is on the graph. However, so far I don't have any data structure that ... |
I'm working on an audio player with a terminal interface. I'm designing it for eventual use on a Raspberry Pi with a 480x320px display.
I've broken the code into three main files with the intention of keeping the business logic (player.py) and graphics (view.py) separated and connected only through the main file. I've... |
I am trying to make a very simple event system for learning purposes, after seeing some much more complicated code on the internet I was wondering if what I am doing is fine of if it has major issues. The code works but I am not sure if it is fast and safe.
The part that worries me is that in my test Listener class (K... |
I'm working with thousands of large image files in a regularly updated library. The following script does the job (on average reduces my file size ~95%) but costs me around 25 seconds to compress one image. Obviously, I can just let the script run overnight, but it would be cool if I can shave some time off this proces... |
After a conversation with my math teacher about a base algebra (base 43 using all the algebra symbols) and finding it more than the 30 min of work I was looking for, I decided to make this instead.
import math
letters = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T... |
My mask translator is performing poorly in scenario where I have 30 masks and 10,000 ownerships. This is a bit field and similar to bit masks such as enum.IntFlag.
I though about creating a list with all combinations of masked values and names (1 - alex, 2 - ben, 3 - alex/ben, 4 - clark, 5,... sum from 1 to 30 = 465) a... |
this is my first code review post :) So I wrote this Black Jack game as part of an online Python course and would love some feedback about my coding style and whether or not I have correctly used a 'Pythonic' style in terms of the OOP.
Any general comments are also extremely welcome because I am making a move towards ... |
So I am attempting to scrape a website of its staff roster (https://www.milb.com/greenville/ballpark/frontoffice) and I want the end product to be a dictionary in the format of {staff: position}. I am currently stuck with it returning every staff name and position as a separate string. It is hard to clearly post the ou... |
Hello guys i wrote this function code:
function gematria(text){
var newText = text.toLowerCase(); // handle capital letters
var startValue=0; //initialize value to zero
for(let i=0 ; i<newText.length; i++){ // loop through every letter on the text
let currentCharValue = newText.charCodeAt(i) - 96; // get the... |
Helo everyone, I need to review on function swapNode in doubly linked list. It works but I want to make it clearer and better. Are there any errors like memory leak in my code?
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
struct node;
struct list;
typedef struct node node;
typedef s... |
Can anybody help me to minimize my hard coding? Also please give me any suggestions for improving my code for the future?
My Source Code:
export default class App extends React.Component {
render() {
return (
<View style={styles.container}>
<View style={styles.border}>
<Image source={{... |
I know this code worked as I've tested it with the case tests commented below in the code, and even added a few of my own, but the developers who were testing me came back with the following critiques:
All in one file, no attempt to modularise or separate out concerns
No tests at all. You could possibly forgive an ent... |
I am trying to solve the Dynamic Array problem on HackerRank:
Create a list, seqList, of N empty sequences, where each sequence is indexed from 0 to N-1. The elements within each of the N sequences also use 0-indexing.
Create an integer, lastAnswer, and initialize it to 0.
The 2 types of queries that can be performed... |
This is my JavaScript function to get a break time taken. I have two times (time_start and time_end). And with these two times, I have to get my break time. (break time hours are 12:00-13:00 and 17:45-18:15). The code below works but it contains a lot of nested if and else. Is there any method to reduce them?
function ... |
I'd like feedback on my solution to the outlined programming challenge. Is numpy a good candidate module for this? What might be a more efficient or Pythonic solution?
Closest Enemy II
Have the function ClosestEnemyII(strArr) read the matrix of numbers stored
in strArr which will be a 2D matrix that contains only th... |
I have two database tables UsersDownload, Non-UsersDownload. There is also two model object and two service that take in the object and insert the data into the correct table. Is this the best architecture for this? or is there a better way to handle this? Would it be better to use an interface?
public class UserLog
{
... |
Overview
I've just written a package in Python (which I've named sibstructures) whose purpose is to assist staff in managing a coldstore, which is a warehouse-sized refrigerator holding (in this case) boxes of potatoes.
The code below is one file taken from that package, the file which defines the centrepiece Coldstore... |
In effort to learn OCaml, I'm going through some easy LeetCode problems and attempting to implement them. I arrive at the correct answer, but I'm still developing an intuition for canonical OCaml code. I'd appreciate any feedback on my implementation.
As mentioned, this is problem 1 on LeetCode. A quick summary of the ... |
EDIT: Refer this answer for improved solution with incorporated feedback and extended functionality. eg Automatically hexdump both parts of a stack/heap obj like std::string.
Inspiration / Motivation
Modern C++, certainly compared to C, provides a lot of abstractions which protects us from / hide from us the details ... |
I have a code to scrap data from webpage using selenium and python.
The code selects a URL the database and search it using selenium chrome driver and fetches the result and insert into a postgreSQL database.
Can anyone can review this code and let me know what I need to modify to make it better and organized.
The belo... |
I am attempting to learn Python. It was suggested to me to try a web scraper, so I thought to get myself to look at multiple Nagios instances. I have not programmed in Python before, but learned from other code reviews to adapt my standards to PEP8. The online checker says the code passes.
from bs4 import BeautifulSoup... |
I am learning to clean my code and make it more efficient, however I'm having trouble with my code, because most of the post about the subject are specified to a given code. The code below looks like a lot, but it's the same step for different sheets (the code below is for two sheets, there are five more sheets).
Sub F... |
I have a few hundred mp4 files (thanks android =/) that I need to convert. I only want to convert videos that are too large (>= 1080p) and I do want to keep the exif Information so the timeline is not broken.
I hope someone can look over the script to point me to some grave mistakes or give some improvement.
Anything I... |
Can you provide some advice on how I can simplify this code?
I am a beginner with Python, and I'm pretty sure that my code can be much simpler. I think the check() function is far too complex. But I have no idea how to simplify it, and still check which player has won the game.
def check():
win = 0
if gameTable... |
The code below takes a directory of XML files and parses them into a CSV file.
Right now parsing around 60 XML files is fast and the output is a CSV file that is around 250MB.
That is a really big file and the reason is because columns are being repeated. I'm repeating the columns for the reason that every element shou... |
I decided to split the SQL Part away from This Question.
Before we get started I need to let you know a critical piece of information: Due to permissions within an offsite database I am NOT allowed to create tables even temporary ones within the database that I am getting the data from.
With that being said: All of the... |
I'm creating a parser, and I have just finished my lexer. I wanted to ask if there is anything I should change, add, or reconsider in my code! (I don't think the grammars matter much, since it is only a lexer)
lexical_analyzer.h
#pragma once
#include <iostream>
#include <string>
#include <vector>
// kinds of lexemes ... |
I'm using my own Action-based Event Manager for a while and looking for ways to improve it.
Mainly it's used in game development, where excessive garbage generation can lead to severe consequences. That's why I'm trying to avoid any boxing which normally exists in such managers.
There are different event types (dozens,... |
I've a string as an input which is having some specific patterns and I'm trying to parse it into a desired json. Here is my code:
const input = "status:all,applied_date:2019-04-15--to--2019-04-15,screen_status:SR|NS";
const output = { and: {} };
const dateSeparator = RegExp("--to--");
function parseStr(s... |
Background
The code below is (obviously minimally) ripped out of a current live project. The project does reasonably sized data extraction, cleaning, analysis, clustering and visualisation (on a budget, and that's why we are not using graphistry or similar for the visualisation part).
So for our sins, we are using gra... |
I'm relatively new to programming as I've just started university. My assignment was to develop a program (by using a function and a linked list with pointers with integer elements) which does the following:
The function visits every element from the beginning. If the current element plus one is <= to the following el... |
After discovering Float Toy, my goal was to create my own version using Python and Tkinter. The results of the endeavor is shown below. Most of the functionality is complete, but the Equation widget does not automatically update itself yet. Does anyone have any simple suggestions for updating its labels?
#! /usr/bin/en... |
Problem
I am trying to convert my synchronous code to an asynchronous implementation. Using aiohttp I was able to almost get where I want. My problem is how to deal with synchronous requests. I have 3 types of functions:
Take argument, make one request (easy to turn async)
Take argument, make multiple, independent req... |
This is my first Objective-C++ code, so I'm a bit lacking in the knowledge of methods.
I need to resolve a macOS alias and get its original location. I have access to the C string, which is the file path (in a human readable form). It also needs to be verified in this code itself that it is a true alias, and contains b... |
Here is the Question. Find the largest GCD of the input variable with the values of an array.
Inputs are as follows:- First-line contains two integers, N and Q.
Second-line contains N integers which form the arr[].
Next, Q lines contain an integer M, the time in seconds she wishes to go back.
#include <stdio.h>
int ma... |
For testing purposes of a platform I'm working on, I must automate the process of initiating Dota 2, accepting an invite that shows on screen, choose the right spot for that player (team A or team B), wait until the game starts and then exit it.
All of that could be done with simple clicks on static coordinates but Ste... |
I have written this code and I wonder if there is a better way to do absolutely any of it. Also, if there is any way to optimise it or if there is a problem please also tell me preferably with fixed code as I am still sort of a beginner. It is one of my first school projects and I would like to show my teacher that I r... |
I have written this code which provides advice based on user's favourite YouTuber. I wonder if there is a better way to do absolutely any of it. Also, if there is any way to optimise it or if there is a problem please also tell me preferably with fixed code as I am still sort of a beginner.
The code is below:
import ra... |
Rust is one of my first forays on a strongly typed language, beginning to like it's strictness, and am looking to improve my comprehension.
Rules
Fizzbuzz is a programming challenge with the following rules for output;
n mod 3 => "Fizz"
n mod 5 => "Buzz"
n mod 3 && n mod 5 => "Fizzbuzz"
else n => n
Examples;
10 => "... |
This is a follow up to the code found here:
Multithreaded HD Image Processing + Logistic reg. Classifier + Visualization
Description:
This code takes a label and a folder path of subfolders as input that have certain labels ex: trees, cats with each folder containing a list of HD photos corresponding to the folder name... |
I am working on struts 2 based web application, where an Action Class render 7000+ records in UI. The query which fetches the record is already been optimized by the DB developer, but instead it took around 7+ seconds to load UI it also freeze the UI for a moment,on deep inspection I have found there is something wrong... |
I am using the least_squares() function from the scipy.optimize module to calibrate a Canopy structural dynamic model (CSDM). The calibrated model is then used to predict leaf area index (lai) based on thermal time (tt) data. I tried two variants, the first did not use the "loss" parameter of the least_squares() functi... |
I have a system of 49 equations and 49 unknowns (\$x_{1},...,x_{49}\$). All equations have the following form.
\$x_{s}\sum_{r=1}^{R}\sum_{t=1}^{T}a_{s,t}b_{rs,t}=\sum_{r=1}^{R}\sum_{t=1}^{T}a_{r,t}b_{sr,t}x_{r}\$
where \$s = 1,...,49\$ with \$S = R = 50\$ and \$T = 30\$. The \$a\$'s, the \$b\$'s and \$x_{50}\$ are kno... |
I do genetic programming. I have 5 parcours, the first on the left is the easiest parcour.
The first parcour can be solved by place one belt in the middle pointing downwards to solve the problem. If placed in the middle downwards, the puzzle is solved because the iron-ore flows downwards to the robotic arm. The roboti... |
Currently my solution for calculating wages based on average weekly hours and any other wages field is very long and elaborate. I think it can be concised and make more readable but when I try to do it it creates some nasty bugs as it is based on field changed. Any elegant refactoring suggestion would be much appreciat... |
Is this the best way to prefix all lines written by a Bash script to standard error?
#! /bin/bash
exec 3>&2
exec 2> >(sed 's/^/ERROR: /' >&3)
echo stdout
echo stderr >&2
I am wondering, if I have to close file descriptor 3.
|
I've created a tiny (723 bytes compressed + gzip) animation library. Is this a good way of animating arbitrary numbers?
const map = (value, x1, x2, y1, y2) => (value - x1) * (y2 - y1) / (x2 - x1) + y1;
const clamp = (value, min, max) => Math.min(Math.max(value, min), max);
// Courtesy of @gre from https://gist.github.... |
I've got such an input object, which I should modify in order to use it with some charts library.
const input = {
foo: {
bar: 'biz',
},
statistic: {
"2019-11": {
A: 11,
B: 11,
C: 11,
D: 11,
E: 11,
},
"2019-12": {
A: 12,
B: 12,
C: 12,
D: 12,
... |
I just got done coding this C program:
Read the description of a deterministic finite automaton from standard input.
The first line of input is the number of states in the automaton, n
n lines follow, each one describing a state. Each line is composed of the name of the state, followed by its transitions, colon-separa... |
I have been following along with a Udemy OOP basic course in Python. One of the sections prompted to make a banking system before watching the following videos. And so I have created a rudimentary banking system. I believe the system as is, is rather basic. I think there are some tweaks that can be made to it.
I have n... |
I was thinking of adding a very high-level implementation of the event/observer pattern to my project. The implementation would manage adding and removing observers as "needed". You can use an almost DLS-like API to define when an observer should be added or removed.
Here is an example of the API in use. We want to tra... |
Based on my answer to another code review question I wrote my own python script for DLA (Diffusion Limited Aggregation).
The DLA algorithm task:
Place seed at the center of the canvas.
Release a random walker from the edge.
Random walker sticks to the neighboring sites of the seed/previous points.
Repeat N(particles) ... |
Version 1 - Beginner web scraper for Nagios
Current version changes:
Moved NAGIOS_DATA dictionary to separate file (and added to .gitignore)
Used functions with DOCSTRINGS
Removed the multiple redundant print() statements
Actually read the PEP8 standards, and renamed variables to match the requirements
Again, beginne... |
We start off we the following Person class:
class Person:
def __init__(self):
self.moods = {
"happy": 5,
"angry": 5,
"sad": 5
}
def updateStates(self, stateUpdates: {}):
for mood, valChange in stateUpdates.items():
self.moods[mood] += valC... |
I was wondering what is the better way of writing? Having several variables to show the steps or rather do method chaining?
function count(string) {
const array = string.split("");
return array.filter(element => element === "a").length
}
function count(string) {
return string
.split("")
.fi... |
I have a set of code that calculates how well a templates fits a users details. It's kind of long, so I've cut out all the code that does it's job well and only included the bottle neck and surrounding code. My target here is speed!
A couple of notes on the variables:
Calculated at run time (changes each user):
TopSec... |
So I was coding Inversionless ECM using Prime Numbers: A computational perspective and when I finished and tried running my program it ran way, way slower than it is supposed to. I have no idea what I am doing wrong. The algorithm I'm coding is here and is algorithm 7.4.4(Ctrl-f it)
[Choose criteria]
B₁ = 10000; ... |
Here is the code to a progress bar component. Is there anything that you feel I should improve to it?
If I state that the progress prop is required, is it ok NOT to check in the code that progress is not null?
import React from 'react';
import PropTypes from 'prop-types';
export default function ProgressBar({ progress... |
Main Goal
My goal is to create a chat app for my company (they are all software developers). I first make a console version and if it is working fine, I will make a GUI version. The program will run on an exchange drive, so using networking features is not neccessary.
Project description
The software will consist of th... |
Here is a function that formats a phone number and adds a country code prefix if it is not included in it.
So, as an in input value it could be, for example, '23581010' or '4923581010' and in output it would become via the formatNumber function '(02) 358 10 10'.
Is the positioning of the let assignment ok in this code ... |
I'm using Flask along with Flask-SQLAlchemy and Flask-WTF.
I have a model:
class Trip(db.Model):
id = db.Column(db.BigInteger, primary_key=True)
author_id = db.Column(db.Integer, db.ForeignKey('users.id'), index=True,
nullable=False)
name = db.Column(db.String(2000), nullable=False... |
I recently faced an interview question where you have to find minimum needed items from an array that can added together to generate X value.
For example giving:
[1, 9, 2, 5, 3, 10] and the goal is: 13, => it should be [10, 3]
You can't use any number out side of array.
I have tried to sort items and take from the he... |
I made my first open-source project and wonder if I could do it better.
I'll give briefly description, ask some questions and then post whole code.
Open to any opinons and suggestions, thank you.
So, Aiohttp is asynchronous HTTP Client for Python. You can find it's documentation here. However all you need to know is t... |
As an exercise to familiarise myself with smart pointers, I implemented a template linked list class in C++, closely following the very good tutorial at: https://solarianprogrammer.com/2019/02/22/cpp-17-implementing-singly-linked-list-smart-pointers/, which I duly acknowledge and from which I borrow freely.
The code se... |
So on my checkout page when I push final checkout I want to store my users address and shipping address into a database. I am wondering if this could be shorter. Currently, users have multiple options:
Logged in where they use same or other shipping address.
Not logged in and they want to create account with same or d... |
Utility to generate sequences of predetermined addenda that add up to a given number.
There is also a function for orderly printing and one for converting list of lists in sequence of sequences.
The answer that Gurkenglas gave invites me to specify the objective that I set myself by defining these functions. The field ... |
This is my first working 2sum solver. It works by finding the difference for our target in s to determine if that 2sum exists.
Suppose our target is -5. I start with the first index in s and use subtraction, (-5-(-8) = 3), and the result is 3. The code will check the difference in s. If the difference exists in the lis... |
I am writing a textual chat app for exercise purposes. All Chatters using my program have access to a network directory, and there my program is stored. This chat app consists of three programs. The user management program allows you to create and delete users. The messaging program allows you to write messages. The vi... |
I recently had to submit my 12th grade final project in C++, so I decided to make a game engine! That panned out just as you would expect (I am not touching OpenGL until they touch OOP), so I switched and ended up making a project on graph coloring instead!
For context, in the actual project this was used to calculate ... |
I have an interface under development using an object-based approach. Objects should be statically allocated by the application writer (Dynamic memory allocation is not allowed). I want to obfuscate the object data so the application writer can only access the struct members using the provided methods. So I came to thi... |
I am very confuse what is better approach to display child view and subscribe to its event on ReactiveUI WPF, so far I have 2 implementation that somehow works for my case:
Implementation 1:
public class ChildWindowView
{
public event EventHandler<Exception> Error;
public event EventHandler<bool> Closed;
i... |
I am learning C and therefore decided to build my own, little shell. Currently I am concerned with input parsing. I want to split a line of text into tokens with delimiters. But it should be possible to escape the delimiter.
A simple example would be:
Input: "echo Hello World"
Output: [echo, Hello, World] with n=3 toke... |
I have a piece of python code doing fuzzy matching which works very well and is pretty fast. For reference, it uses the following files:
https://raw.githubusercontent.com/datasets/s-and-p-500-companies/master/data/constituents.csv
https://raw.githubusercontent.com/nlintz/pyBros/master/sp500/sp500.csv
import csv
from fu... |
I have written some code for calculating a count of common factors. Please help me remove anything unnecessary and shorten it.
Please tell me if any function in Python 3 can calculate common factors directly!
# a string of 2 numbers
# is input e.g. '10 15'
a,b=str(input()).split(' ')
a,b=int(a),int(b)
n=0
if a>=b:
... |
Hello I made this calculator in Python, I know it's pretty basic but I want your opinions if I made it well or not, and if you find any mistakes or not.
P.S ( I know I could do another better than this one if I looked in internet but I want to evolve that's why I'm here )
#Commands
print("Operations that you can use:")... |
I'm a beginner programmer and I was hoping someone would be able to review my program. Everything has been tested for user validation, error-checking and conforms to the specification with a few slight additions of my own. I want to know what I've done well, what I haven't done well, improvements I can make e.g. how ca... |
I made the looks of asteroids using pygame. I still need to implement collisions but since it is running incredibly slow with 'amount' anything above 10. Please rip my code to shreds and explain why it is bad so that I can improve. :)
import pygame
import pygame.locals
import numpy
import random
asteroids = []
paused ... |
all!
I am developing a web "app" with JavaScript and jQuery with the help of a couple of other libraries for ease of use.
Its purpose is to collect user ID's and to build a list of "attackable" targets for the game at https://torn.com
Details for the API can be found at https://api.torn.com, although I'm pretty sure i... |
I made a program (C#, .NET) that calculates time for XML and CSV export and please I have a question for improving my knowledge in programming. Do you think that I can improve the structure of the program? Or what do you think about code refactoring? Way of solve... Is it good? I uploaded the project to github.
Thanks ... |
Problem
HackerRank Range query:
You are given an array A of n integers. You have to perform m
queries on the array. The queries are of two types:
Modify the ith element of the array.
Given x, y, print min{Ai + Ai+1 +…+ Aj | x ≤ i ≤ j ≤ y}.
Note: A brute force solution may not work; Try using an efficient data stru... |
I'm trying to learn Python, so I started with a program to convert length units, mixing imperial and metric. First I wrote a bunch of small simple functions, but then I wanted to solve the issue of having an intuitive way of calling one function with some easy to remember parameter values in order to convert from any u... |
I've wrote a simulation of Langton's Ant in Java, and hope you have some suggestions to improve the code.
The class Control.java contains just the main:
import java.io.IOException;
public class Control {
static boolean exit = false;
public static void main(String[] args) throws InterruptedException, IOException... |
When I am developing in Bootstrap, I need to make sure that what is on the screen looks good. Bootstrap have various cutoff points where the flow can change. So to help with the visual debugging, I have created this tool that just shows what the current screen is according to Bootstrap.
<cfscript>
sizes = [
{ ... |
This is a function for checking if the checksum provided by card[] is valid. card[] contains six pairs of characters. The first five pairs make up a hexadecimal number, and the last pair contains the checksum. The checksum is valid if it is equal to XOR of the first five pairs.
It is working fine, but the code is awful... |
Asking for a review of my implementation of a command pattern. In a Editor, words can be entered and the entering of words can be undone.
General purpose Interface
public interface Command {
void execute();
}
The concrete write word command
// Command
public class WriteCommand implements Command {
private Edi... |
I'm solving a problem with find and replace a substring in a string. I've solved it using Python with a couple of lines, in C++ using std library and now solved it with C by using allocation on the stack. I want to get genuine feedback on the code I wrote and perhaps make it simpler.
The constraints:
do not use standa... |
Here is the Interface I am using in my working app.
<?php
declare(strict_types=1);
namespace midorikocak\nano;
use Exception;
interface CrudInterface
{
/**
* @param array $data Array data of an Item.
* @return array Array data of an Item with id.
* @throws Exception if the data does not pass v... |
I'm writing toy parsers for toy languages to understand how parsers work.
Assuming a language as follows (in sketchy EBNF patois)
expression := lparen [datum] [expression [datum]] rparen
datum := any string of characters other than ( or )
rparen := (
lparen := )
These are some valid expressions
(hello... |
I posted a question here ffmpeg batch script for video resizing but I forgot the issue of the rotation and the video files were scaled with wrong dimensions.
Below is the improved version of the script
#!/bin/bash
set -eu
status=true
fail() {
echo "$@" >&2
status=false
}
# Resize a single file
resize() {
... |
I am a beginner so please keep it in mind while answering!
For player vs CPU is there any more effective way to make CPU better ??
import numpy as np
board=['-','-','-',
'-','-','-',
'-','-','-']
def check_win():
global winner
global game_over
if board[0]=='X' and board[1]=='X' and board[2... |
I've recently completed a vanilla JS challenge . It is a method for calculating and ranking scores.
If possible, I would love to make it better. Any suggestions are welcome.
Challenge Directions:
The input array contains a series of objects that hold user scores. Scores are ranked both individually (within the object) ... |
First I have two conditions on the number of list elements,then in one of these conditions I have two others conditons to treat it :
My code:
List<StringBuilder> result = ReadResult_WS_Import(NameFile);
if ((result != null) && (result.Any()))
{
var is_No_Errors_Found_Exist = result... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.