instruction stringlengths 71 95.1k |
|---|
I wrote a simple program to encode a local text file with password and decode it back. There is one text file and it is either encoded with a password or is in plain text.
I had a version in Python for this, but nim compiles to an executable, so I gave it a try.
I'm not perfectly happy with command line argument handli... |
I need a menu with buttons of months previous and after a given month,
something like this:
| month | month | month | current month | month | month | month |
Can this function further be improved?
/**
* Generates array of months previous and after given date
* @param $p_base_data - array of base year and months,... |
I have given a series problem 1,2,1,3,2,5,3,7,5.... in which the odd terms forms the Fibonacci series and even terms form the prime number series. I have to write a code in which I have to find the nth term. Following is the code for finding the nth term, I want to know whether it can be written more efficiently or not... |
Here is my solution to the Tower of Hanoi problem using Python
def helper(number_rings: int, origin: int, target: int, spare: int, list_result=[])->list:
"""Helper function works out which ring to move"""
if number_rings == 1:
list_result.append([origin, target])
else:
#Move all but 1 ring ... |
I saw this Puzzling problem and thought I would try to write a Python program to solve it. The task is to transform "four" to "five", forming a new four-letter word at each step, replacing one letter at each step, in as few steps as possible.
But turns out I don't know how to optimize recursion, so I'm posting here for... |
I have a use-case where I need to retrieve all members with specific attributes in the class and interface hierarchy - I usually need the first match and apply its rules to child members. The built-in GetCustomAttributes are too limited becuase they work only for a single member and don't support interfaces.
Implement... |
Implement a multi-threaded stack, with freedom to use existing
implementations of stack. On top of being thread-safe, it must block
(not busy-wait) a pushing thread when stack is full and a popping
thread when stack is empty. It must signal the threads out of sleep
when stack has space again or elements to pop... |
Please review for performance
https://leetcode.com/explore/featured/card/top-interview-questions-easy/92/array/727/
Given a sorted array nums, remove the duplicates in-place such that
each element appear only once and return the new length.
Do not allocate extra space for another array, you must do this by
modify... |
https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/
Please review for performance.
Say you have an array for which the i-th element is the price of a
given stock on day i.
Design an algorithm to find the maximum profit. You may complete as
many transactions as you like (i.e., buy one and sell one sha... |
I developed this group of scripts to validate users againts a LDAP server and presenting the appropiate message to the user after sending the information.
I wonder if I'm handling everything properly according to best practices. I'll appreciate any advice on how to improve the code in order for it to be easier to maint... |
I have completed an university assignment on C. While the code is fully functional based on the specifications of the exercise, I like high-quality code and would like to ask for opinions on how can certain parts of it be improved. Be advised that I cannot change any function signature.
The first part is the below loa... |
I am attempting to do object oriented programming in right way, and appreciate any review to see if my approach is correct.
class_blogpost.php as below:
<?php
class BlogPosts {
function __construct() {
# code...
}
public function ListAllBlogPosts() {
$DB = DatabaseFactory::getFactory()->Connect();
$query ... |
Here is a very simple solution to the 100 doors challenge
You are in a hotel with 100 doors. Initially every door is closed. On the first round, you change the state of every door (if it is open, close it. If it is closed, open it). On the second round, you change the state of every second door. On the third round, ev... |
I'm toggling the class of an element with this code but I'm pretty sure it can be written more efficiently.
$('.expandable_header').click(function() {
toggle_expandable_icon($(this).find('i')[0]);
$(this).nextUntil('tr.expandable_header').slideToggle(100, function(){
});
});
function toggle_expandable_icon... |
I would like to change row names values from a first data frame if these rows names are present in another data frame, and change it to a corresponding value (defined in the second data frame). I could do it with a for loop, but I wonder what would be some other more suitable ways to do it in R.
Here is a toy dataset ... |
I find it irritating that in standard C++ I can't do std::max(a, b) = x when it's possible and that it can't handle more than 2 arguments. For the second concern I found this std::min tutorial and it looks interesting but the usage of pointers confuses me because I don't understand why they are needed here. Since I wan... |
I can do this in one line in Python:
sum([i for i in range(9,9999999) if i == sum([int(x)**5 for x in str(i)])])
Not very fast, but works nicely. I thought it might be quicker to do it in Haskell, a language I'm quite new to:
-- helper func
toDigits :: Int -> [Int]
toDigits 0 = []
toDigits x = toDigits (x `div` 10... |
I'm experimenting how a Relation (a cartesian product's subset) can be implemented in Haskell using different data classes.
Forest and Tree allow to keeps together in a single data structure different relations each one of different n-arity.
This set of functions require only the Eq constraint and a simple Normal Form.... |
On an Internet forum a person came with their homework, to write Arkanoid in a console - it seemed they wanted someone to do their homework for them so I did not respond. However, I found the task interesting, especially when I broadened the scope of the assignment - so I wrote such arkanoid for my own entertainment. H... |
Im trying to access the attribute directly in the parent component, that why Im using the ref method.
here an example of why Im trying to achieve: https://stackblitz.com/edit/react-lupsr2
Im accessing it using some for in loop currently, so far it works, although I think there is probably more efficient way to do the... |
I am not looking for a detailed review of this code as I am aware it is very inefficient. The main reason for posting this is to see if there is a better way to achieve my goal (I am certain there must be)
I have created code to find the fewest number of dice rolls that would permit someone to move from the first to la... |
Below is a segment of a game I am writing to stay in practice with my Java.
EDIT The class this method is in is the Encounter class. This class just manages the encounter between the player and an enemy, and the other methods are victory() and defeat(), which add gold/experience when player wins, and removes gold when... |
I am trying to write a method that takes in a String and returns an Object. The catch is I want to parse it to one of a few different data-types, and if that fails, return the original String. I currently have the code below. Is this the best way to handle what I want or is there something obvious that I'm missing?
pri... |
In F# the Railway Oriented Programming pattern can be implemented synchronously using the Result<'t,'terr> type as result value for functions, so they can be foreward piped like:
let result =
func1
|> Result.bind func2
|> Result.bind func3
|> Result.bind func4
I would like to implement the same patter... |
When I was looking to use std::bitset instead of GCC's __uint128 in my RDS error-corrector, I found that it was hard to use, because there's no way to widen or truncate a bitset to one of another size. Nor is there any ability to do bitwise arithmetic (&, |, ^) or comparison (==, !=) with a bitset of different width.
... |
https://leetcode.com/problems/intersection-of-two-arrays-ii/
Please review for performance, I am having a problem with using TryGetValue, if someone can explain how this can be used in here.
Given two arrays, write a function to compute their intersection.
Example 1:
Input: nums1 = [1,2,2,1], nums2 = [2,2]
Output: [2... |
I'm a few weeks into javascript and had to make a simple "crystals collector" app. The app works as intended, but the code is obtuse and repetitive.
I'd like to make the app work using just one on click event, rather than using four for each crystal. I can't make an array of each color crystal and loop through them sin... |
Earlier I posted a fairly inefficient recursive solution to the problem of getting across a snakes and ladders board in the smallest number of moves.
I have created a much faster solution to this using Dijkstra's algorithm and I believe it is correct.
Each square on the board is linked to any square that is between 1-... |
There's lots of code out there for basic adapters of std::deque to provide a thread-safe queue. I've adopted that, but wanted to provide a relatively full analog to std::queue, so I've added the whole set of constructors and operator=. The queue works fine. My questions are mainly related to the constructors and operat... |
I have two tables:
tableA
aid name age sex email password
tableB
bid idno aid
The steps should be
Enter, verify email and password
If email and password are correct, insert random number into tableB as idno
Select name, age, sex, email, idno from both tables and return an array as result.
If email and password are wro... |
I have the below code to pull messages from a FIFO SQS queue. Using the while (IsRunning) loop makes me feel to question the code design. Is there a pattern I am missing or some SDK that will do this more efficiently with recovery on error and other features for a subscriber that won't need human intervention to restar... |
This is a Leetcode problem -
On an \$N\$ x \$N\$ board, the numbers from 1 to N * N are
written boustrophedonically (starting from the bottom left of the
board), and alternating direction each row. For example, for a 6 x 6
board, the numbers are written as follows -
You start on square 1 of the board (which is... |
Follow-up to Python program to find a word ladder transforming "four" to "five"
I'm trying to write a program to solve a word ladder puzzle to brush up on my Python. For those who don't know:
A word ladder puzzle begins with two words, and to solve the puzzle one must find a chain of other words to link the two, in wh... |
My goal is to implement Strongly Connected Components algorithm using python.
I have splitted up my code on 3 parts:
Data Load:
import csv as csv
import numpy as np
import random as random
import copy as copy
import math
import sys, threading
import time
sys.setrecursionlimit(800000)
threading.stack_size(67108864)
st... |
I have a list of objects and a query. I need to rank the objects, based on how do they match the query. An object would match the query 100% if it contains all properties in the query.
My program works correctly, but I have a design issue. From the console input, I have a location of a these objects. In this location ... |
I have this image:
I want to whiten the black contours (borders) around it without affecting the image content.
Here is the code I used:
import cv2
import numpy as np
import shapely.geometry as shageo
img = cv2.imread('filename.jpg')
# get the gray image and do binaryzation
gray = cv2.cvtColor(img, cv2.COLOR_RG... |
This is a Leetcode problem -
Given an array nums of n integers, are there elements \$a, b, c\$ in nums such that \$a + b + c\$ = 0? Find all unique triplets in
the array which gives the sum of zero.
Note -
The solution set must not contain duplicate triplets.
Example -
Given array nums = [-1, 0, 1, 2, -1, -4],
A sol... |
So I have an user which can create his own Locations.
I implemented a webservice in order to add and update locations. If the user is not the owner of the location i want to throw an appropriate exception so that the user knows whats wrong.
The current method looks like this:
private void updateLocation(String loginTo... |
With this algorithm I update an automatically generated verilog-file. The update within this file is done by commenting the assigned wires to specific ports of module instances.
Is there a better, more elegant or more optimized way to do this than with this algorithm?
file_name = "test.v" # name of the verilog file
... |
I work as an IT intern in a multinational and I was given a tedious task of combing through a 2500+ long multi-column excel report file in search of inactive servers.
Here's a sample row from that file:
Then, I got another excel file but this time with just the DB Codes (80+ of them).
My task was:
Go through the big ... |
I am learning to work with OOP design patterns and so I challenged myself with the idea of creating a way to generate a pdf invoice based on some information entered. So, this is what I have done so far and would like to have some review on my approach and design.
Invoice.py
import fpdf
from datetime import datetime
... |
I've made a section of my site to have two grids side by side. On the left-hand side is one big static (sticky in my case) image, on the right-hand side is a (grid) long column of several other images, that is scrollable. So as the user scrolls the grid on the right-hand side of the page, the grid on the left remains '... |
I have a water reservoir with input and output rates. I want to determine when the input is exceeding the output by a certain constant. To accomplish this, I need to cumulatively sum all cases where the inflow exceeds the outflow. Thus, I've written this function:
def pos_diff_cum_sum(flow_in: np.ndarray, flow_out: np.... |
Regarding the Character picture exercise located at the end the following page:
https://automatetheboringstuff.com/chapter4/
Say you have a list of lists where each value in the inner lists is a
one-character string, like this:
grid = [['.', '.', '.', '.', '.', '.'],
['.', 'O', 'O', '.', '.', '.'],
[... |
This is a Leetcode problem -
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
An input string is valid if -
Open brackets must be closed by the same type of brackets.
Open brackets must be closed in the correct order.
Note that an empty string is ... |
When handling errors in C#, is it acceptable/appropriate to re-throw exceptions that are caught in a try/catch?
My scenario is that I am making an HTTP request and then checking the content of the response for a specific key (access_token). If that key is missing, I throw an error.
However, as all of the code within th... |
Is there a way to speed this guy up? The code is designed to go into a directory, open up all of the .xlsm files in the folder, and copy specific data into a target file. This code works as is, but it is extremely slow. Is there a way to speed it up?
Const FOLDER_PATH = "C:\Users\maxd\OneDrive - Nortek, Inc\Coil Test... |
I am sharing this function I wrote with the community to provide an alternative to slow VLOOKUP and/or Index-Match functions. Also, if you have any feedback/suggestions to make this better please let me know. I tested this function using a lookup of just under 160,000 rows and it returned results in 2 seconds. This sur... |
I've recently started work on a hobby project that's basically a sandbox file system written in Java, slightly inspired by PhysicsFS. The point of the project is to separate what files a user can read/write to by restricting read/write to predefined locations on the disk. A "location" can be either a directory (folder)... |
I'm writing my own version of a Mandelbrot set generator, with pan and zoom functionality. (There's not yet a color overlay of sets generated with various beta values; the beta value is changed manually with a spinner.)
Pan: drag left-click
Zoom: roll mouse wheel
The main problem with this code is that after zooming ... |
I have a simple program that "minimizes" a file path. Minimizing simply means replacing unnecessary file entries with entries that mean the same thing:
path1/path2/../path3 is replaced with path1/path3
path1/./path2 is replaced with path1/path2
I've achieved this using regex and it seems to cover all cases, but it al... |
Backstory
This is a buffer I wrote for use in multiple personal projects. It is designed
to handle pretty much any data in pretty much any way. In particular I intend to
use it in such instances as recursive-descent parsers, where it will be
important to be able to 'undo' operations.
Undo
This 'undo' functionality is i... |
Obviously, 'select *' is never a good idea.
HOWEVER, I have taken a job with an org that allowed this cancer to spread.
They have huge queries, using select * as SUB-QUERIES, when the coder only needed 3 or 4 columns.
select t.field1, t.field2, t.field3, x.field4 ...
from table t
left join (select * from table w... |
Please review the code below and provide constructive feedback to improve.
Multiple threads call the SendMessageToMSMQ method to send messages to a msmq queue.
Occassionally messageQueue.Send(sendMsg); throws insufficent resources exception. Dont know why it's happening. Storage is not an issue, since I have checked th... |
A coding challenge in which we are to write a function that compares two strings and returns the one that is smaller. The comparison is both lexicographical and numerical, depending on the content of the strings as explained below and in the comments of the code.
Both strings may contain any characters. Consecutive num... |
I need to fetch data from an server that isn't always reliable and unfortunately fixing that is out of my hands. My team determined we would attempt the request up to 3 times.
So I thought of using a try-catch inside the while loop but didn't like the extra indentation for no good reason and thought to remove the brace... |
I started to work on this CUDA C matrix class to learn both the object oriented programming in C++ and to learn CUDA. The initial goal of this project was to make a matrix class that can have almost similar syntax as MATLAB has. However, on the way I faced one big issue which was number the of host to device and the d... |
I solved a problem with JavaScript which has the following requirements:
Two non-empty linked lists representing two non-negative integers.
Digits stored in reverse order
Each node contains a single digit
Add the two numbers and return it as a linked list
Sample I/O:
Input: (2 -> 4 -> 3) + (5 -> 6 -> 4)
Output: 7 -> ... |
To stay in practice with my Python I've decided to write an explicit song checker. It checks each word in the song against an array of 14 explicit words contained in the text file. I've decided not to include the words that are to be checked against, for I am not sure about the rule of having explicit words in a progra... |
I am a newbie when it comes to Object Oriented Programming and I have read a lot of online articles and lessons so I want to try it out on my own. I've written a console app in C# and tried implementing Object Oriented Design and SOLID Principles.
The console app checks if a person has an access to a certain floor. Al... |
I have a "back to top"-button on the page, It should be visible after the user has scrolled a certain amount*.
This means I have to add or remove a class active every now and then.
I have two solutions:
Update the class on every scroll.
Test whether the class is set/ not et and then test, whether it is necessary to in... |
I am relatively new to C programming and I am currently working through the CS50 EDX course. The problem I have solved below is for week 1 (credit).
Any suggestions on how to improve this code to further my learning would be most appreciated. I feel like my solution is very clunky although it does the job!
#include <cs... |
I want to hash an array of strings into one hash as shown on scheme on the image below. But I do not want to implement some class based Merkle tree. It's just a simple function. Is this a good implementation or are there any possible improvements?
public static String hashStrings(@NotNull String [] strs)
{
if (str... |
Here is a practice exercise — Fantasy Game Inventory \$-\$
You are creating a fantasy video game. The data structure to model the
player’s inventory will be a dictionary where the keys are string
values describing the item in the inventory and the value is an
integer value detailing how many of that item the pla... |
I have a PR implementing Ooura and Mori's method for continuous Fourier integrals. I used it here to compute an oscillatory integral that Mathematica got completely wrong, and then I thought "well maybe this method is pretty good!" and figured I'd finish it after letting it languish for over a year.
Here are a few conc... |
I have a loop in a php file to HTTP_Request Server Via CURL->POST.
But I don't know if I'm missing any security considerations. Also, is there a better way to perform this http request?
<?php
$j = 0;
while ($j <= 1) {
$url = 'http://127.0.0.1/index.php';
$fields = array(
'input1' => 'variable1',
... |
I've created a CV eager for corrections. Once it is properly written it'd be converted into a template, in order to share it with the community.
Can you suggest some starting corrections or ideas? (I'm willing to implement them by my own, if I can) A brief, compilable version is pasted below:
\documentclass{article... |
Write a function that takes 2 inputs:
a matrix, for example 2-dimensional array, and
indices, for example [row, col]
This function should return the sum of all the second input's neighbors (up, down, left, right, diagonals).
Below is my solution. Just wanted to know if there is a better way to solve this problem. A... |
There is a simple form which takes two numbers num1, num2 and an operation op. After submission, a new object is created. I'm new to OOJS and any correction and improvements are appreciated. Is this the best way to code this small calculator in Javascript using Object Oriented approach?
window.onload = function() {
... |
Could use some help with my presentation in Software Development. I'm presenting how I reworked a game's parser (SpaceTaxi). Basically we take in a .txt file with ASCII characters and convert them into entities that can be rendered in our game.
Input, Output
In between the input and output I've written a parser. I've ... |
As part of small MIDI library i've implemented the conversion of a VLQ (variable length quantity) for byte[] -> bigint and bigint -> byte[]. Even though the maximum value for a MIDI VLQ is defined as 0x0FFF_FFFF i've decided to allow larger values for the moment.
If there are any improvements for the code, coding style... |
In https://github.com/pc-magas/tcp_command as an attempt to learn C++ I made a simplistic TCP server in GNU/Linux that will receives simple "commands" in ASCII form. Each command ends with '\n' and a user can send multiple commands at once.
My background is a web developer in php using symfony mostly and sometimes PSR-... |
Here is a practice exercise — Regex version of strip() \$-\$
Write a function that takes a string and does the same thing as the
strip() string method. If no other arguments are passed other than the
string to strip, then whitespace characters will be removed from the
beginning and end of the string. Otherwise, ... |
The goal of this problem is to determine if a string with brackets is valid. Below is a summary of the question from careercup.
Check if string s is valid based on brackets
"(({{}}))" is a valid s
"{[]}" is a valid s
"[{[}]]" is not valid
I know this is a rather basic exercise. I am looking for feedback on whether my... |
This is a translatable password validator for django, based on zxcvbn-python and available with pip. zxcvbn is a password strength estimator inspired by password crackers. It permits to prevent users to have to choose a password with one upper case, one special character and a number, but still check the password stren... |
I have two code snippets, doing exactly the same thing and both get the job done:
use defaults
use from config
Which is cleaner to use in golang and why?
first option:
package main
import (
"fmt"
"strings"
)
func main() {
fmt.Println(getShCfg(Cfg{}), "\n================")
fmt.Println(getShCfg(Cfg{... |
What I want is getting all names (first, middle, last) of the users along with each of their total hours of work which will be calculated by the SQL statement: CAST(SUM(timediff(dateTimeOut,dateTimeIn) as time).
I was able to achieve this with two queries, but somehow, I feel that this is inefficient (?):
$sql = "SELEC... |
This code is a mix of the same question one time rotating to the right and one time to the left.
I tried to simplify the code since I'm struggling with all of the indexing here.
https://leetcode.com/problems/rotate-image/
https://www.geeksforgeeks.org/rotate-matrix-90-degree-without-using-extra-space-set-2/
Rotate the... |
I am new to C programming and wrote the following algorithm for the calculation of the Jacobi Symbol. Though there are some faster versions of this algorithm available I am only looking for some feedback on my coding style. I should mention that I was taught to ONLY USE ONE return statement in functions and NOT to use ... |
I started learning c and wanted to challenge myself by making a linked list. I am stil new to the concept of pointers and pointers to pointers, so there might be something in my code that I could have done differently, but hey, I'm still learning. I would like to hear any advice or tips so I can improve my programming ... |
I wrote the following code which when executed prints the score of https://github.com/dhh.
require 'typhoeus'
require 'json'
class DHHScoreChallenge
def getData
req = Typhoeus.get("https://api.github.com/users/dhh/events/public")
body = req.body
json_body = JSON.parse(body)
end
def ... |
As I'm learning elixir, I wrote some code for printing elements in the spiral of a matrix(2D array). I was wondering if there is any room for improvements with regards to its performance or refactoring of any kind.
defmodule MatrixSpiralPrint do
@moduledoc """
Solution to Spiral print of elements of a matrix(2D a... |
This is a question that I encountered in one of the competitive coding tests. The question goes as follows:
A 2-player game is being played. There is a single pile of stones. Every stone has an amount (positive) written on top of it. At every turn, a player can take the top 1 or 2 or 3 stones and add to his kitty. Bot... |
I built a small project using Django-Rest-Framework. Please comment on the best practice style for the code below, which will make it simpler.
class LoginSerializer(serializers.Serializer):
phone = serializers.CharField()
password = serializers.CharField()
def validate(self, data):
phone = data.get... |
So, I decided to write my own little command line argument parser for various other projects I work on. I am aware that there are many good command line parser libraries, but I did wrote my own anyway (practice & implementation specific reasons).
The parser works fine, but I have a feeling that it can be improved a lo... |
I am beginning to learn rust and I created this snake game for practice. I am looking for some feedback on my code.
main.rs
extern crate rand;
extern crate crossterm;
mod canvas;
mod snake;
use std::{thread, time};
use rand::Rng;
use crossterm::{cursor, terminal, input, ClearType, RawScreen, InputEvent, KeyEvent};
us... |
To keep in practice with good techniques of java programming, I've decided to write a database. All it does it stores employees, allows users that are logged in to get/set employees, and has a login mechanism that prevents any methods from being used if you are not logged in. I'm looking for feedback in the following a... |
Here is my code in Python for to find a common ancestor between two nodes in a particular tree. This is a question from Cracking the Coding Interview that I decided to implement on my own. No one has talked about the solution that I implemented below.
import unittest
from Tree import *
from list2BST import *
def tra... |
I'm studying Object-oriented Programming and decided to apply some things doing an Object-oriented Tic-Tac-Toe.
I wanted to know if you have some hints of what to improve and why!
class Board:
"""Represents one board to a Tic-Tac-Toe game."""
def __init__(self):
"""Initializes a new board.
A ... |
I have created dynamic Bootstrap 4 modal using JavaScript OOP. Please verify and give your reviews how I can improve the code. I have passed four parameters to create a dynamic modal:
openPopup class (for click)
data-title (dynamic title)
data-href (dynamic load html in modal)
data-target (target id if i have multiple... |
I started to have HUGE doubts regarding my code and I need some advice from more experienced programmers and architects.
On the button click, the application runs a method, that is running a ScrapJockeys with parameters:
if (UpdateJockeysPl) await ScrapJockeys(JPlFrom, JPlTo + 1, "jockeysPl"); //1 - 1049
Purpose of thi... |
I am a newcomer to the Julia world, so I started trying to implement a very simple program:
Sample a signal
Reconstruct it (various ways, just rectangular for now)
Plot it
Everything is fine and 'working' properly, but coming from a OOP (java) and functional (python) background, I'm thinking that the following snippe... |
The other day I ran into this question on stackoverflow.
Just for curiosity I wanted to implement suspending and resuming the thread, so I used signals and used pause() in the signal handler.
Is it OK to use this way? This question has many answers how to suspend/resume a thread, but I want to know what is wrong with m... |
I am new to Javascript and Node.js but wanted to create a minifier in order to minify and escape double quotes in the HTML file. Could you let me know what I could improve in the code and how I can make it more efficient.
Here is my code:
'use strict';
var minify = require('html-minifier').minify;
const fs = require('... |
I'm a bit new to PowerShell (version 5) and was wondering if there are any improvements I could make to the following script. Any suggestions for style, code, etc. are all welcome.
The script creates a csv of file attributes and extended properties recursively from a directory parameter. I'm going to then load the csv... |
I am having some trouble figuring out how to modularize this code without rewriting it entirely. I know I should be able to break it up into modules for main, gathering info, doing calculation and the example sum array that's out of place, but in to meet requirements.
#include <iostream>
#include <iomanip> // G... |
Because I'm quite naive regarding C#'s Task Asynchronous Programming and concurrency in general, and because it's so difficult to test, I'm concerned about the safety of this code. It's likely that those topics, or something even more esoteric to me (e.g. processor-specific issues like volatility rules), caused me to o... |
I want to run the function addItem() for every item. Multiple items will belong to the same slot (category). For each category I have to run the function with the same slot. I don't want to manually write down the slot for each and every item, because there could be 100's for each category.
The goal is to get the best ... |
I have a controller for Post and Put request for the same entity: MyModelDTO with some ModelState's attributes.
The users can make a Post request without the Id attribute, because it is being generated on server side, but for Put request the Id attribute is needed (And has to be different than an empty guid).
I want to... |
I have a python print statement and inside the string I wish to print are four digits. I would like to apply the same formatting function to each param. I am not familiar with the latest and greatest features of python PEPs.
Is there a slick way to do this?
Code
statement = "Splitting up the {} file into {} chunks, wi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.