instruction stringlengths 71 95.1k |
|---|
This code reads binary file. Read data is converted into signed values and gets plotted if the user wants it.
Data looks as below:
00000000: 0800 01dc 0500 02a4 0000 88ff f918 a9ff ................
00000010: fa53 88ff 3200 0161 2d00 029a 2e00 feff .S..2..a-.......
00000020: f933 f6ff fa14 efff ebff f9bf eaff fa0e ... |
I wrote a Python script to format plain text to markdown title.
for example, modify multiple lines
['1 Introduction\n',
'Part I: Applied Math and Machine Learning Basics\n',
'2 Linear Algebra\n',
'3 Probability and Information Theory\n',
'10 Sequence Modeling: Recurrent and Recursive Nets\n',
'11 Practical Methodo... |
i finally have been moved to PDO (from MySQLi) and i m now trying to make simple login and registration page (for training purposes).
This code does work! But i want to know if it is secure?
Also witch way is better for prepared statements to pass values with ? or :username?
Is the way i use PDO is simple or should i c... |
This is my Todo script. It's working well.
I'm looking for feedback on what I've done well, and what I could have done better.
todos = {
// It needs to store todos
todos: [],
// Settings
settings: {
quickDelete: false
},
// Target container
targetElement: document.getElementById("todos"),
// Input... |
I made this small system that checks if you're old enough to drive. I'm new to C#, but I do know most of the basics since I also know Java. I'm trying to make my code more efficient. Any suggestions or help would be appreciated.
using System;
using System.Threading;
class EfficientCode
{
static int age = 0;
st... |
I'm using the below code to call different methods from an API:
import requests
import json
from unidecode import unidecode
from datetime import datetime
temp_county = 'County'
temp_locality = 'Locality'
# Function - login
session = requests.Session()
def login():
# Application header
header = {
'C... |
I had to write code for a competition which calculates sum of the perimeter of three overlapping rectangles in a 2D space. rectangle A and rectangles B and rectangle c is overlapping each other.They have also one common point of interaction.
i need to calculate the overlapping area of each rectangle.
But there is one... |
I'm working on a JSON to CSS converter in NodeJS, which takes a .json file and generates a .css file with its utility classes from it.
.json example
}
"breakpoints-map": {
"default": "0",
"sm": "only screen and (min-width: 508px)",
"md": "only screen and (min-width: 768px... |
There is a need to have a specific structure of XML string when interacting with 3rd party system. Here are two examples:
<DocumentElement>
<Country>
<CountryCode>UA</CountryCode>
<Name>Ukraine</Name>
</Country>
</DocumentElement>
and
<DocumentElement>
<Currency>
<CurrencyCode>UAH</CurrencyCode>
<Descriptio... |
I have a general question pertaining to a component from one of my apps. I have a function, renderConditionals that is at the core of my UI. It's incredibly sloppy looking and I am not even sure, from a conventional standpoint, that I am utilizing react correctly with regards to putting functions within the render fu... |
I have some code that I want to repeat in the best way possible. I'm looking for some advice to an approach. Function, object, other?
Thanks!
// There are many #mad-1, #mad-2, #mad-3 etc
// There are many radioButtons1Value, radioButtons2Value etc
// There are many radio1subtract, radio2subtract etc
let radio1subtract... |
Roy is working on HackerEarth Profile. Right now he is working on User
Statistics. One of the statistics data (Code Streak) is as follows:
Given the User Activity Data, find the maximum number of continuous
correct solutions submitted by any user. Seems easy eh? Here's the
catch! In order to maximize this number... |
Problem
Write a method to return a boolean if an input grid is magic square.
A magic square is a \$NxN\$ square grid (where N is the number of cells on each side) filled with distinct positive integers in the range \${1,2,...,n^{2}}\$ such that each cell contains a different integer and the sum of the integers in each... |
The Mongo-Scala Driver (v2.6) currently only supports asynchronous operations, although my use cases often seem to lend themselves well to synchronous reads. This may be to block downstream code execution, or to save off the result-set of documents for later use. I'm guessing there may be a way to do this with Futures,... |
TLDR: I don't develop for a living. If someone could point me in the right direction to make my script more readable/pythonic I would appreciate the assistance.
In particular I'm struggling with the charts found in makeCharts() and code-flow throughout.
I have tried writing makeCharts() section as a for loop for work... |
https://leetcode.com/problems/daily-temperatures/
Given a list of daily temperatures T, return a list such that, for
each day in the input, tells you how many days you would have to wait
until a warmer temperature. If there is no future day for which this
is possible, put 0 instead.
For example, given the list o... |
This past week, I had a coding interview where I have failed badly. The feedback that I get from the recruiter was that my code reminded the team of older ways of coding in C#. This led them to believe that I haven’t had much experience with newer version of the framework.
This made me quite confused as I literally don... |
My task was : Create a Python application to display the active status of your IT project. Everyone the project has its own unique number that is generated at the stage of receipt
project into the company. The company offers three types of project implementation:
Standard Project, 10 Day Project, and Investor Project. ... |
I am trying to solve this problem:
Igor has fallen in love with Tanya. Now Igor wants to show his
feelings and write a number on the fence opposite to Tanya's house.
Igor thinks that the larger the number is, the more chance to win
Tanya's heart he has.
Unfortunately, Igor could only get v liters of paint. He di... |
Problem: JavaScript does not provide a random BigInt so there is a need to generate a random BigInt within a given range that is evenly distributed.
Solution
I have tried many algorithms with a emphasis on speed. The best solution builds an array of random Int32 converted to string and padded with zeros which are then ... |
In this class I made a webscraper for a cryptocurrency website to get the name and the price of each currency. There are maybe API's that I can also use, but I thought it is better to gain some knowledge doing it with scraping.
import requests
from bs4 import BeautifulSoup
import json
class Coins:
def __init__(s... |
This is my OnAppearingAsync method where I as a page load in Xamarin I filter data, group it together, set data based on it, order the groups e.t.c. However the code is rather long and looks a bit messy, I've tried to refactor it myself but I always get stuck on where I'm supposed to start.
How can I improve this? Eve... |
Consider this example
Suppose that 3 balls are randomly selected from an urn containing 3
red, 4 white, and 5 blue balls. If we let X and Y denote,
respectively, the number of red and white balls chosen, then the joint
probability mass function of \$X\$ and \$Y\$, \$p(i,j) = P\{X=i,Y=j\}\$, is given by
This co... |
I am practicing Go and try to implement Boyer Moore Horspool Algorithm in Go, It returns all ocurrance of a "phrase" in a given text. This code is working, but I would be pleased to have any feedback and suggestions from Go Gurus, about all aspect of my code.
package boyer_moore_horspool_search
type badMatchTable str... |
I am learning C# and for an experiment I tried implementing the Caesar Cypher cryptography method which just offsets every character of the string n characters. How can I make this simple program better?
string original = Console.ReadLine();
string encrypted = "";
int key = 1;
foreach (var l in original)
{
if (!l.E... |
this is an update of the implementation after I followed the feedback from Iterator for traversing a tree. After that I did changed quite a bit on the design and decided to ask for another round of review. Hope this is allowed.
First is on what I want to achieve and the tests I made to ensure it is correct. For this, p... |
OK, I have a customer list that has approx 80k records. I need to search and compare looking for duplicates, but duplicates could be an exact match, or a similar match (only some data matches) so it gives a confidence score.
My first block of code takes 3 hours to process and returns 1.25 Billion results.
Does anyone ... |
This function will check a word with some letters missing, missing letters will be indicated by an "_ " (notice that there is a space after the underscore).
The word with missing letters needs to be checked against a full word and if both words are found to be identical ( disregarding the "_ " the function should retur... |
Problem
Write a program to return a boolean if an input grid is magic square.
A magic square of order \$N\$ is an arrangement of \$N^2\$ distinct integers in a square such that the \$N\$ numbers in all rows and columns and both diagonals sum to the same constant, known as magic sum or magic constant, \$magic\_sum\$. A... |
I have a class, 'TaskCoordinator' which has 'BaseTask's applied to it.
The BaseTasks have OnStarted, OnFinished and OnCancelled events which are triggered to notify the calling class of their events.
GroupTasks consist of a collection of BaseTasks to be executed one after another or all at the same time.
Tasks which d... |
I need to inizialize an JArray with a JObject that contain a property areaNum that is an incremental integer.
Right now I wrote the below code, which works ok if I have a small number of JObjects, otherwise it takes too long.
I'm looking for a way to write the below code that take in consideration the performance at ... |
I have an array of nested objects. How do I get an object with null values using only a particular key in the array of objects?
let headers = [{
title: 'Arun',
id: 'arunId',
onClick: 'onClickArun'
},
{
title: "George",
id: 'georgeId',
onClick: '',
children: [{
title: 'David',
... |
I've been slowly learning Haskell over the past few months. I made a small module to graph functions using Gloss, and I would like feedback on how idiomatic it is (looking for ways to simplify using standard functions and to make it more pointfree).
Graph.hs
module Graph (graph) where
import Graphics.Gloss
graph :: (... |
Writing an EventLoop in C++. Few requirements, from a user perspective:
Must be simple to use (as simple as the Javascript event loop)
No type casting, no complex registering of event handler. Plain and simple API.
Event handlers have the proper event type passed to them as reference.
Should be able to register handle... |
I have implemented the 3Blue1Brown's description of Fourier transform in Python+numpy for irregular and unsorted data, as described here.
import numpy as np
import matplotlib.pyplot as plt
def polarToRectangular(radii, angles):
return radii * np.exp(1j * angles)
def frequencyGenerator(time, steps = 100):
= ... |
Hi friends i have this code for select input change, i need some good advice if this code is ok like that or is a way to optimize this code? thanks!
This code is used for changing info's between selected input options.
This code is for two select inputs "SECTIONS" and "AGE CATEGORY".
If a user select a value from secti... |
I got a mixture of two languages C and C ++
The code finds the folder my documents and creates additional folders in it when the program starts, I found no other way to implement this better.
I also did not find any ready-made example where all this has already been implemented so as not to make a bicycle, I like whe... |
I am not a Docker guru or expert in Flask or Redis. However, I need to leverage these technologies. I managed to cobble something together that works and would like to submit it for review.
The MWE repository here has three main directories:
backend: the task-based Flask API
frontend: a Nuxt app
pyapp: a custom python... |
I'm trying to create a generic class for decorator pattern.
I successfully did it with the example code by metaprogramming:
#include <iostream>
struct Action1 { };
struct Action2 { };
class Classe
{
public:
// Default template.
template<class U, class ...Args>
auto go(Args ...args)
{
//static_assert(false... |
I'm very new to programming and C# and had some homework this weekend to create a simple string check. I've expanded upon that and came up with this. This is way more complex than what was asked but I wanted to push myself and see what I can learn.
I would like feedback and criticism for what I am doing right and wrong... |
I need an encryption algorithm that would be secure enough to store credit card data. So it should be reasonably secure.
Here's what I've come up with. I'd appreciate any constructive criticism.
public class Encryption
{
// Algorithm meta sizes (in bits)
private const int SaltSize = 256;
private const int B... |
Problem: Given a vector of strings, I want to print out all possible permutations where the strings may contain an OR operator (the | character, as in regular expressions).
Example Input: the strings race and car|horse
Example Output:
race car
race horse
car race
horse race
This code uses -std=c++17 and helper code fr... |
Note: The topics of performance and Selenium/BS4 have not yet been addressed,
so this question can still receive a better answer!
Chat Room: https://chat.stackexchange.com/rooms/100275/anipop-discussion
This is a recreational script made to update my home server w/ the latest season of anime from HorribleSubs. I'd... |
If the default task is executed here, the file name to be compiled is passed to the argument of the CompileSass function. When the sass task is executed, the callback function to be executed at the end is passed by gulp.
The CompileSass function logs the file name when it is passed. Also, when anything other than the f... |
I would like feedback on my benchmark script, for use on Linux. What's another method for benchmarking that might be better/easier?
Overhead
I've found that subprocess.run has an overhead of about 0.01 seconds by using this test function.
import time
import subprocess
def overhead():
start = time.time()
pro... |
I wrote this to teach myself how to make a menu with buttons and I want to know if I've done well and if there's any way to make it shorter and/or more efficient.
import pygame, sys
from pygame import *
run = True
global newBG
newBG = False
#-----------------------------------------------------------------------------... |
So I'm working on an implementation of the Atbash Cipher for Rust - it is an exercise on exercism.io. I come from a little C experience and found my code to be rather round about and kind of tortured. Doing str and String manipulation in Rust is something I haven't really grokked yet. It seems like this would take up f... |
I have a DataFrame of size 3,745,802 rows and 30 columns. I would like to perform certain groupby and transpose operations which will finally end up with more (unimaginable) columns/features.
I also tried parallel processing,Dask,Modin and the pandarallel package, but couldn't do this because all these packages don't s... |
I have written a function to get the actual page range to display that page range in pagination.
My function is working properly. But I think that I have written bad code. Can someone review my code and give me some feedback to improve my code?
Here is the code:
const pageRange = (() => {
let startPage = activePage <... |
Recently, I applied for a job that required skills in object-oriented programming. Although I have coded in Java at odd times, those were very small assignments. I have been mostly programming in C language. Recently I applied for a job that required object-oriented programming skills. They gave me a pre-interview asse... |
I'm hoping someone can help me here, I'm working with a file which has about 38000 rows and 180 columns. I'm using a macro to update the fields in the one workbook with the values in the other workbook, but it takes about 2 minutes to run. I'm looking for a way to reduce this time, I've tried everything I could find on... |
I was tasked with writing a function, that checks whether a date is valid in the following format: DD.MM.YYYY. Here's what I wrote:
bool isValidDate(const char* date)
{
int a, b, c;
size_t len = strnlen(date, 255);
for (size_t i = 0; i < len; i++)
{
if (!isdigit(date[i]) && date[i] != '.') retu... |
I am new to rust and wanted to get going with a medium-sized project to help learn. I've settled on creating some basic quantum mechanics code which starts with this bare-bones file reader. It takes a pdb file which is just a list of atom coordinates and the connections between them - with some extra information. I've ... |
I'm trying to follow MVVM pattern in a VB.net WPF application, and I would like to implement IEditableObject.
Is this code acceptable for an MVVM application? In particular is it okay to have the IEditableObject implemented here on the Model rather than the ViewModel?
Public Class Component : Implements IEditableObjec... |
https://leetcode.com/problems/shortest-common-supersequence/
Given two strings str1 and str2, return the shortest string that has
both str1 and str2 as subsequences. If multiple answers exist, you
may return any of them. (A string S is a subsequence of string T if
deleting some number of characters from T (poss... |
I have implemented a class Vector to learn about data structures and algorithms and how to implement them using C++.
I have yet to implement some std::vector functionalities e.g. custom allocator template parameter, iterator/const_iterator classes.
I'm learning C++ through a C++11 book and trying to learn C++14 and C++... |
I'd like some input on my implementation of bst-range, which follows below.
Before we can get to bst-range, we first need some setup code to build the BST.
(You can imagine that node label count didn't exist if you want, as it's not used for range search).
Setup
(defstruct
(node (:print-function
(lambda (n ... |
I'm beginning to learn Go. I've decided to write some file utilities to help me with some bigger projects I intend to write. Coming from mainly a Python background, I'm sure there are plenty of stylistic and efficiency improvements to be made. I'm looking for general feedback, as I want to kick bad habits to the curb b... |
I've written a solution to a Codewars challenge:
You have to create a function that takes a positive integer number and returns the next bigger number formed by the same digits:
12 ==> 21; 513 ==> 531; 2017 ==> 2071
I am getting the following error on Codewars: "Execution Timed Out (12000 ms)". I am a rookie, and wo... |
I am working with a system that needs to consume product images uploaded by employees and resize them / add white padding to the sides to create square images to be consumed by our e-commerce site. I'm attempting to keep things somewhat light on the memory usage because this will live in a windows service on an azure ... |
This is a follow up to the code here: Web scraper that extracts urls from Amazon and eBay
A multi-threaded modification to the previous version that is Amazon focused and most of the necessary documentation is in the docstrings.
You'll find a copy of the source code as well as necessary files here including (proxies.tx... |
I've written some C++ code, intended to run on an Arduino, the purpose of which is to talk to SparkFun's Simultaneous RFID Reader.
The current situation:
The code runs fine, most of the time.
However, sometimes it throws up a "Module failed to respond..." error.
The above error tends to occur - perhaps only occurs - a... |
I have a string, for example: dashboard/12398911/overzicht and I want to check that string for 2 values. For dashboard and overzicht. If the first check is false, then the second check doesn't need to happen.
This is my current code:
private pageTypes = ['dashboard', 'klantenkaart', 'complexkaart', 'objectkaart', 'coll... |
I wanted to build a bot for playing Jaipur board game. I started by implementing a simplified version of the game without bot. Want to make sure I'm going in the right direction.
Few of the simplifications from the actual game:
Prices of commodities are fixed
No camels
Only one card is visible and can be picked from... |
I've implemented a wrapper for AES 256 CTR mode using the cryptography.hazmat module, I am wondering if there are any vulnerabilities in my implementation, specifically about the counter and its encoding. Here is the code:
from cryptography.hazmat.primitives.ciphers import Cipher
from cryptography.hazmat.primitives.cip... |
I'm implementing this date class based on <ctime>
I'll appreciate your comments, critics and advice.
Please review, thank you!.
Date.h
/*
* Date.h
*
* Usage:
* Create object, and then call Set(day, month, year)
* Throws invalid argument exception if Teb 29th is set with the wrong year (is not leap year)
* TODO: t... |
I wanted to ask if this is a better way to find a latest file in given directory. This is my current approach:
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.BasicFileAttributes;
import java.nio.file.attr... |
I have a simple lock-free queue, which supports multiple producers, but only one consumer. It is based on a constant-sized ring buffer and stores only pointers to a class and not actual instances. Also it uses pre-C++11 and GCC-specific functions.
Is is implemented properly or does it have a data race? I only care that... |
I'm trying to implement a multi-variate, multiple-step model to forecast the day ahead electricity prices (h+1,h+2,...,h+24). I know how to do one forecast, but I'm confused with how to implement a multiple output approach where each forecast gives a vector of predictions for each hour in the day head for one shot (the... |
I built a merge sort in python just to have a more thorough understanding of how the algorithm works. What I have written works fine, but I assume there is room for improvement and ways to make my implementation more efficient.
I would appreciate any feedback or critiques!
"""
2019-10-17
This project simply re-cr... |
I'm trying to implement a simple service in the true OOP way. This means for me that the domain objects has no technical or non-business-related methods (in practice no getters/setters).
Here are the domain interfaces to implement:
public interface Person {
void register();
void changeName(String name);
}
publ... |
I'm writing a code to read data from text file in Rust. The target files have two columns and non-fixed length rows, for example,
example.txt
1 1
2 4
3 9
4 16
To achieve this, I wrote following code.
use std::fs::read_to_string;
pub fn open_file(filename: &str) -> (Vec<f32>, Vec<f32>){
let data = read_to_stri... |
I wrote a code to calculate the lengths of strongly connected components in a graph. The results I get are correct but it scales horribly.
This is the code I have. I understand that the runtime complexity of a graph traversals should be O(V+E) and as far as I understand, I am not visiting any node twice. And yet it ta... |
As part of my training, I implemented a n-body class in C++ to simulate gravitational interaction of bodies and to get more familiar with features that C++ offers such as object oriented programming.
This implementation uses a direct integration (Verlet integration) of the differential equations which results in a time... |
I just want to create masonry vertical layout with two divider .card-lef`` and.card-right`. Anyone have an idea to place #cardTemplate in left or right based on data Odd/Even? Or maybe in my .ts separate odd/even array?
HTML:
<ng-template let-data="data" #cardTemplate>
<div class="card">
</div>
</ng-template>... |
I wrote a feature. And it works correctly. But in my opinion it is not optimal. But I have not found what standard features you can use to unleash it. Since I made it a simple sort of values. And it takes a long time to execute.
char getMaxOccuringChar(char* str)
{
int count[ASCII_SIZE] = {0};
int len = strlen... |
Below are the two things I'm trying to solve, logically. This is just a proof of concept; and I'm not implementing this on real data nor via full plugin at this time. Just looking at logic and syntax solutions.
Below are the (2) requirements.
1.) Given an API route for retrieving a specific record, do the following:
... |
I have the following sample data:
target <- "Stackoverflow"
candidates <- c("Stackflow", "Stackflow", "Stckoverfow")
I would like to filter the string from candidates that has the lowest (levensthein) distance to the target string.
I decided to use the pipe operator to improve readability. However, i find it suboptima... |
So, I'm coding a simple Bloom filter. Current implementation works as expected, but I'm looking for ways to improve efficiency / speed. The code is being tested on a large chunk of data (~30k+ lines), so every little bit counts.
Also: Is there any way I can initialize a vector only one time, not using resize()?
set(... |
I wrote a function that downloads a file https://www.ohjelmointiputka.net/tiedostot/junar.zip if it not already downloaded, unzips it and returns the content of junar1.in found in this zip. I have PEP8 complaints about the length of lines that I would like to fix. Is there a way to make the code more readable?
My code ... |
As part of the prologue of all my console applications, I need to determine the extents of the current terminal so if there are less than 132 columns or 43 lines the user can be warned output may not appear as expected. Code has been tested with;
$ AppName /usr/include/*.h
Assemble with source being whatever name you... |
I am trying to find out if there is any difference between two implementations that currently do the same thing - gracefully shutdown applications/servers, for example, when Ctrl+C is hit. Both work fine and are based on the documentation.
What a friend of mine says, is that Example 2 handles shutdown at the applicatio... |
Problem
Write a program to return True, if a string is a strong password.
A password is considered strong if below conditions are all met:
It should have at least 6 characters and at most 20 characters.
It must contain at least one lowercase, one uppercase and one digit.
It must NOT contain three repeating characters... |
Recently I rewrote some methods/functions written by a previous developer mostly due to the fact that the previous implementation overdid the whole 'OO' thing, and used inheritance inappropriately. The code also leaked memory like crazy in production long running tasks, so my rewritten code is a response to that, by be... |
I started learning compilers development and as pet project decided to implement c compiler.
The first step is implementing simplest lexer.
Also, I decided to try new programming language and chose go. This is my first go program and I will be grateful for any advice. Thanks.
package lexer
import (
"errors"
"f... |
This code takes a list of words that all (pairwise) share at least one letter, e.g.
words = ["forget", "fret", "for", "tort", "forge", "fore", "frog", "fort", "forte", "ogre"]
and creates what I'm calling a "sparse crossword" puzzle that looks like this.
-------FORT
----------O
------F-FOR
----FROGR-T
----F-R-E--
--OF... |
Within Matlab there exist a function to create a structuringselement in the form of a line.
SE = strel('line',len,deg) creates a linear structuring element that is symmetric with respect to the neighborhood center, with approximate length len and angle deg. For a couple of morphological operations I need to filter out... |
I wrote a simple logger class for my project. Some key points:
The interface is heavily inspired by Java's logging libraries (you can tell from the getters/setters that I'm a Java programmer). In particular I'm using printf style functions instead of std::ostream style, which I don't like very much.
verify is a macro ... |
Update from Paper label system in Python
I have not updated the security on the app, need to have a proper look into it.
Have decided to use docx module, instead of using print-screen.
I have added few important if statements when handling .docx files in folders depending what the user has clicked etc..
My current is... |
I'm trying to make a function that asks for a string input and then validates it. If the answer is not correct, the function asks them again for valid input with a while loop.
In order to validate the string input, I'm using a string array with all the possible answers to the question.
Because I'm using a string array ... |
I want to create a factory to return all Source instances that match given entry parameters- that is, I want to iterate through some Collection of objects and for each entry check boolean method.
I thought about enum, as I'm guaranteed to iterate through them all.
I came up with something like this:
simple interface
p... |
I'm mostly wondering if I can simplify the code. I've been told that it's
needlessly complicated.
HTML:
<div class="board">
<div id="tl" class="tldarkmode" (click)="fill(1)">{{ valtl }}</div>
<div id="t" class="tdarkmode" (click)="fill(2)">{{ valt }}</div>
<div id="tr" class="trdarkmode" (click)="fill(3)">{{ valt... |
I have 271 million records, line by line in a text file that I need to add to MongoDB, and I'm using Python and Pymongo in order to do this.
I first split the single file containing the 271 million records into multiple files containing each 1 million lines, and have written the current code to add it to the database:
... |
I am currently developing a windows service in C# which is supposed to run a data import every day at configurable times. For this purpose I have created a class "ExecutionTime" which contains the attributes "Hour" and "Minute" to specify a time when the data import should be executed. When the service is started, the ... |
I want to make testable network calls using Swift.
For example, I want to download the latest from AWS if and only if it's version is newer than the downloaded file.
In order to do this I've created a function:
func requestDownloadLinkForAWS() {
DispatchQueue.global(qos: .background).async { [weak self] in
... |
I'm trying to improve my algorithm to make it faster. Also might help to have a few sets of eyes for any bugs or gaps in logic I didn't catch. One thing to note: because of the nature of the algorithm, there will be periods at the beginning and end of the data that are dead zones, where a peak/valley will not be detect... |
I made my custom heap, that allow to change and delete elements.
Please review it and tell me about any found bugs: https://bitbucket.org/nshatokhin/priorityqueue/src/master/
Is this implementation optimal? Is any better implementations exist?
#pragma once
#include <cassert>
#include <cstdint>
#include... |
This is my first program so no doubt I've made mistakes. The code works and meets all requirements as far as I can see.
(Further info: program to calculate Body Mass Index (BMI) allowing user to enter weight in stones and pounds or kilograms
It allows user to enter height in feet and inches or centimeters.
It then calc... |
Let me preface this with a few things before I get into my question:
I am making the leap from VBA/VB6 to .NET, (boy is it a big one), so I am noob to .NET best practices and so on.
I am re-writing en existing excel add-in (written in VBA) that has a library of subs and functions which are used to execute queries and... |
I'm learning AJAX JSON. I'm just testing how to pull the data. The idea is, when hovering over the number, it pulls the data and show the content for name and email. Number 1 is to show name and number 2 is to show email.
The api is working, but I'm not quite sure how to refactor or make the code less redundant. Righ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.