instruction stringlengths 71 95.1k |
|---|
I am creating a program to show NRRDs which are a format of medical images. In addition it loads a gallery of thumbnails, where each thumbnail has a link to change the selected NRRD. Plus there is a list on the bottom left with a list of the different bones inside the current NRRD.
Here is an explanation using the UI i... |
In order to keep my coding skills fresh, I am going to be implementing a simple D20 RPG engine/library to use in creating a text-based game. I am coding in with IntelliJ using Java 8. I'm focusing on best practices, especially testing and documentation as I'd like to start contributing to Open Source projects. I finish... |
This question is a follow-up question of this question. These features are added to the new class -
Generic class
User is capable of setting the size
List interface has been added
Iterator class has been added
As of now I still have some questions after developing this class.
Does this list interface have enough me... |
I realized that after nearly five years of programming and one year of actual being employed as a programmer professionally that I have never actually sat down and implemented a linked list from scratch. I figured it would not hurt to brush up on "The Fundamentals" a little bit in my spare time. (I am primarily self ta... |
Given an array of n integers(duplicates allowed). Print “Yes” if it is
a set of contiguous integers else print “No”.
INPUT: The first line consists of an integer T i.e. the number of test
cases. First line of each test case consists of an integer n, denoting
the size of array. Next line consists of n spaced inte... |
Im am solving Count total set bits:
Find the sum of all bits from numbers 1 to N.
Input:
The first line of input contains an integer T denoting the number of
test cases. The first line of each test case is N.
Output:
Print the sum of all bits.
Constraints:
1 ≤ T ≤ 100
1 ≤ N ≤ 1000
Example:
Input:
2
4
17
Outp... |
I have performed this test and they have not given me a conclusive answer (they really have not given me any response). I have to paint a graphic, do you think the implementation is correct? Is there any possible improvement?
Given a GPS track with variable number of points of latitude, longitude and
altitude (m).
Ex... |
I implemented the Brodal heap from Brodal & Osaki 1996: Optimal Purely Functional Priority Queues in haskell. The paper gives an implementation in ML but without higher-kinded types. The goal was to introduce some more type-safety by tagging the types Heap and SkewBinomialTree with their ranks. I am aware that an imple... |
I've been using the InstagramPhotoLink extension for Opera for some time but instagram broke it recently. I thought I could try to fix it... and I did.
The original extension is rather limited and it supports only a link to the first image and no videos so while fixing it I completely rewrote it in order to extend it.... |
I know questions with this text has been asked and already answered, but my question is mainly limited to only one method of this flow and where it should be.
I have an assembly for Shape's area calculation (ShapeAreaCalculator) and this functionality is exposed to client program:
public enum ShapeType
{
SquareShap... |
I've made a quiz where you get a random question, and you have to guess which StackExchange site it's from.
const optionsCount = 6;
const sitesURL = 'https://api.stackexchange.com/2.2/sites?pagesize=999&filter=!SmNU3t0u7kg0gEzR5B';
const questionsURL = 'https://api.stackexchange.com/2.2/questions?page=1&pagesize=100&... |
I wrote the functions for opening a file, getting a file size and getting a file contents. I would welcome any suggestions to improve my code.
You might think I'm over-commenting the code. But I do it mostly just for the visual separation of the code parts. I hope to know your opinion about it.
P. S. English isn't my n... |
I have an exercise in my ANSI C book:
3.3. Write a function expand(s1,s2) that expands shorthand notations like a-z in the string s1 into the equivalent complete list abc…xyz in
s2. Allow for letters of either case and digits, and be prepared to
handle cases like a-b-c and a-z0-9 and -a-z. Arrange that a leading o... |
The intention of following code is to dynamically change the logging level of a running python process that has imported this module.
#!/usr/bin/python
import logging
import time
import signal
logging.basicConfig(level=logging.ERROR)
logger = logging.getLogger(__name__)
# create logger object with 'ERROR' level loggin... |
Problem from www.interviewbit.com.
Problem : Given a singly linked list, modify the value of first half nodes such that :
1st node’s new value = the last node’s value - first node’s current value
2nd node’s new value = the second last node’s value - 2nd node’s current value,
and so on …
NOTE :
If the length L of l... |
I wrote this basic calculator class using php.It will only execute the basic arithmetics operations so any suggestion for new functions add and improvements will be accepted. Thank you.
<?php
class Calculator{
public $x , $y , $z;
public function __construct($x,$y,$z){
$this->x = $x;
$this->y... |
I have a table (Oracle):
customer_quote
------
int id
int part_key (fk)
int condition_code (fk)
number unit_price
int qty_quoted
date entry_date
With a query that selects data from the past year:
SELECT cq.part_key
, cq.condition_code
, COUNT(*) AS cq_count
, SUM(cq.unit_price * cq.qty_quoted) AS cq_tot... |
Task
You are given a string S containing only decimal digits ('0' through
'9') and a number N. Your task is to insert an arbitrary number
(including zero) of plus signs '+' into S in order to form a valid
expression whose value is equal to N.
Input
The first line of the input contains a single integer T denotin... |
I'd found myself getting back into programming, and had recalled a fascinating little 'game' many might know of. I'm a very inexperienced programmer, and I know this is sloppy, but I'd wanted to make something that had a sort of pseudo-cellular life kind of behavior.
There's no real pattern to their movement, but it do... |
For each ID found in Column A in the XLS file, run a query to
retrieve and save a customer.
"Customers" table in db.accdb Access file
+----+-----------------+
| ID | Customer |
+----+-----------------+
| 1 | Thomas Moody |
| 2 | Natalie Laguna |
| 3 | James Robinson |
+----+-----------------+
.xlsx E... |
I recently played around with prime factorization using a prime wheel. Much of the heavy lifting is done by the PrimeWheel class. I think the implementation is nice to anyone who is interested in wheels but a little confused on how to use them. Note the PrimeWheel class could also be used for a fast but simple IsPri... |
I was solving a problem 20, Factorial Digit Sum, on Project Euler.
Factorial Digits Sum
\$n!\$ means \$n \cdot (n − 1) \cdot \ldots \cdot 3 \cdot 2 \cdot 1\$
For example, \$10! = 10 \cdot 9 \cdot \ldots \cdot 3 \cdot 2 \cdot 1 = 3628800\$,
and the sum of the digits in the number \$10!\$ is \$3 + 6 + 2 + 8 + 8 + 0 + ... |
I am trying to improve the algorithms for the following code!
The problem I am trying to solve is that I have nested loops that don't look efficient. This includes the Sales_item.h file from C++ primer 5th edition that may have to be updated if we want to go another design route.
#include <iostream>
#include <fstream>... |
I'm trying to learn more about counting sort and I just implemented the example given in CLRS, my question is: How can I improve this code?
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void counting_sort(int *, int, int);
int find_max(int *, int);
int main(void)
{
int l_size;
int i;
scanf(... |
I'm creating a Node.js app that allows the user to create their own social network. This code doesn't do anything special yet except creating a basic server and making it available on the Internet via a persistent address. As the address can be assigned to any person at any time, I make the server check for available a... |
I've published my first react project for pagination purposes. It's likely I'm making mistakes or there are any improvements to my code. I'd appreciate if anyone has any offers.
jQuery(document).ready(function($){
/*
Simple project to implementing pagination with React
Developer: Alex Jolig
Licence:MIT
... |
I've written a script in python to parse different names and phone numbers of various restaurant names from yelp.com. The scraper is doing its job just fine. The most important feature of this scraper is that it can handle pagination on the fly (if there is any) no matter how many pages it traverses. I tried to create ... |
I am new to assembly and I want to know how I can improve this implementation both by speed and/or binary size optimization and making code to read and support easily.
Platform: Linux, x64
Assembler: NASM
Code
section .data
; Consts
%define XChar 'X'
%define OChar 'O'
%define filler '+'
%define LF 0x0a
%define sepa... |
I am trying to write a generic function for loading a function from a DLL library. I am in no way an expert on DLLs, that is why I ask.
We have discussed it first in my Stack Overflow question to discover the most obvious errors, and there were some crucial ones.
Current version of my code follows:
function LoadFuncti... |
Problem Explained:
Imagine there is a list of running results of 1000m, like following:
[
{ id: 1, date: '2017-01-01 00:00:00', duration: 195 },
{ id: 2, date: '2017-01-10 00:00:00', duration: 270 },
{ id: 3, date: '2017-03-12 00:00:00', duration: 220 },
{ id: 4, date: '2018-01-10 00:00:00', duration: 2... |
We have a todo list, which by default holds two of them. The newTodo means what has been recorded in the input form to be the next todo to be added. needsUpdate and idOfTodoToUpdate are used to handle the submission as an update to an existing todo.
First to handleSubmit we check if it is an updating operation or a cre... |
I wrote a class that downloads the HTML of a page from the internet. This class also manages redirects. This works well but I'm not very satisfied about time management for slower servers. In fact, if the website is slow, the method GetHtml will return an empty string, so how can I optimize this class, to prevent such... |
I'm new to bash scripting. I have pieced together a bash script to rsync my website files and databases.
Any guidance on ways I could improve or make my script more secure would be greatly appreciated.
#!/bin/bash
set -e
site_host=(
"test1@grid.co.uk"
"test2@grid.co.uk"
)
backup_dest=(
"/Users/computer... |
I am trying to write a multi-threading program which implements the Producer/Consumer model. Typically, I want to use one Producer which reads lines from a file and puts them in a BlockingQueue, and have multiple Consumers do some processing after retrieving the lines from the BlockingQueue, and store the results in a ... |
This code takes a list of filenames as arguments or from stdin (or from a provided file) and dumps a list of disk blocks used by those files.
An attempt is made to use the linux ioctl function fiemap and if that fails (ex. on FAT filesystems) falls back to using the fibmap function.
This code compiles with VS Community... |
I'm working on an Spring Integration application that transforms a XML (converted by Jaxb) into a custom Object by checking various information given in the XML.
The problem is that I can't trust the data that has been sent to me and I have to do null checks everywhere. Can't decide if storing the result of a null che... |
I am a self-taught programmer and I just started learning Java and wrote a simple program. If anyone more experienced than myself can go over my code and give me some pointers I would really appreciate it.
The program starts by asking the user to enter either 0 for the name generator or 1 for the hypotenuse generator (... |
"Inserting" part of a bitset into another
This is Exercise 2-6 on the K&R book, 2nd edition. The reader is asked to:
Write a function setbits(x,p,n,y) that returns x with the n bits that begin at position p set to the rightmost n bits of y, leaving the other bits unchanged.
Parameters Description
Here's what each par... |
I have very little experience with cmake, this is really the first time I used it for a project. In the past I used some autotools and recently mostly bazel. I would appreciate some suggestions how to better structure the code. For example during compilation I noticed that the same targets get compiled multiple times, ... |
The idea here is to implement a configuration system using INI files for a pathfinding library nammed Kraken. This library is in java and I am helping implementing it in C++. The goal is to make it cross platform and to specificaly aim embedded systems. For now the INI parser uses inih for simplicity, but should be abl... |
A very bare-bones timer class created using the std::chrono library. I would like to know if any optimisations are possible and just to clarity, I am using MSVC (this code will not compile with certain compilers).
Timer.h:
#pragma once
#include <chrono>
class Timer
{
private:
std::chrono::time_point<std::chrono::... |
I am working with a code base where unfortunately I cannot replace all raw arrays with std::array. The spec provides no guarantee that the memory layout of a std::array is the same as a raw array meaning it can't be a drop in replacement in all situations (the data() method won't help you out if your code expects a poi... |
As a conceptual implementation of the default c++ std array interface, would this be a suitable implementation & what is the safety of this implementation?
template<typename T>
class Array
{
private:
T* arr;
public:
Array(const size_t size)
{
arr = (T*)malloc(sizeof(T) * size);
}
~Array()
... |
I'm working on a firmware on a bare-metal ARM single core processor (Cortex M4), with no RTOS. I need to add a multiple-producer, single-consumer, lockless fixed-size circular (ring) buffer to the firmware. It must handle multiple interrupts writing to the queue, but will be dequeued from a single, lowest level interru... |
I am working on the "Bovine Shuffle" problem from the December 2017 USA Computing Olympiad, and have got it to work for every test case beside two. When I run these two cases on my own computer, they return the correct answer, but not within the time limit.
The "Bovine Shuffle" consists of [Farmer John's] \$N\$ cows ... |
I come from a C# background and recently have been trying to improve my C++ and OpenGL. I've hacked together a basic 3d engine and am looking for feedback as to how to improve it.
One bit I'm most unsure about is the render loop for multiple objects, I've set it up like this and would love some feedback on it. For inst... |
I want to write small server that has one thread that pushes some jobs into queue and several threads that pull the jobs and process it somehow.
I wrote (of course no, I found an example) of blocking queue. Then I wrote cFakeWorker that is server prototype. In general it works ok, but I'm not sure that the way I implem... |
I faced some issues in a project with spring and hibernate where the stream given to Blob is not closed.
Blob blob = Hibernate.getLobCreator(currentSession).createBlob(inputStream, size);
I can't use things like try with resources since the stream is only read after the transaction commits. One of my friends suggested... |
The goal of this function is to print the contents of a file. Pretty much what the simple invocation of cat does.
Since C is famously hard, I am looking forward to your comments.
void showlog(char const * const filename) {
FILE *f = fopen(filename, "r");
if(f == NULL) {
printf("ERROR: failed to open fil... |
I'm new to Android programming. I am going to make lots of HTTP requests: 500, 1k, 2k, 10k.
I have tried to create a singleton class for OkHttp. I wrote this:
public class OkSingleton extends OkHttpClient {
private static OkSingleton minstance;
private final OkHttpClient myClient;
private OkSingleton (){
myClie... |
The goal of this code is to format any log to STDOUT and STDERR with the file and the line of where the call is made. I took inspiration from different C loggers that I found on the internet. I want it to be small and efficient while using C++17.
I'm a bit suspicious about the call to std::data at line 30 not being nul... |
Inverse transform sampling is a method to generate random values that follow an arbitrary distribution. For some reason this method was never implemented in any popular scientific libraries. And as I often need to use it, instead of calculating it by hands every time, I decided to implement the function doing it for me... |
This is a 2 player (Will soon have AI in it - I am not asking for help with AI) game with mechanics similar to the card game named Magic the Gathering.
Bear with me, this is a lot of code. If you feel like you need to review one file at a time, do so.
The code is hosted here if you wish to see how it works.
When you f... |
I'm pretty new to Java and I've been trying to use top-down design and make my code very readable, so I would appreciate any comments as to the clarity and efficiency of this program.
Looking for feedback on: readability (spacing, comments, etc) and just overall quality of code!
The task is to produce a histogram tha... |
It's a question which lies me for years on the tongue.
Given a LoginViewModel:
public class LoginViewModel : ViewModelBase
{
public string Email { get; set; }
public string Password { get; set; }
public bool RememberMe { get; set; }
public string ReturnUrl { get; set; }
public IEnumerable<Authentic... |
Background
I am using many link breeds in Netlogo. I created various getter/setter and lookup functions for each of these breeds.
Issue
I need to increase my links from 5 different breeds to 44 breeds. And I'm sure copy and pasting these lines of code is not the best approach. If this was a Bash-Shell I would use Indi... |
I was bored and in a mood to write some macros, so I decided as an exercise to try and remake each of the standard threading macros: ->, ->>, some->, some->>, as->, cond->, cond->>, and doto. doto doesn't seem to be considered a "threading macro", but it's very close to the same idea, so I wrote an implementation of i... |
I have a thread as part of a class that access the class's data members. The class has a move constructor that moves some of the old class's data members into the new object being constructed. Before moving the class members of the old object, I need to shutdown its thread. I do this by calling thread_shutdown in the m... |
I'm new to React. I major in Angular. And for me it's realy not so obvious here... Do I use this props & state variables in a good way or do I need to refactor/change something?
Main goal is such: simple app with table, search & pagination. URL-state with query params should lead to a proper page, sorting etc when some... |
I created a class of a directed graph and a method for finding if graph has an Euler cycle and updating a vector accordingly.Is there any optimization or a nicer way to do this.
class Graph {
private:
int V; // No. of vertices
list<int> *adj; // Pointer to array of lists
bool cycleHelper(int... |
I am developing JSafebox, a portable safebox project written in Java.
A first review have been completed here.
The goal is to provide a secured environment where the user can browse encrypted files without leaking data on the drive.
The project is highly focused on security and I would appreciate any feedback that woul... |
In need of making a range selecting feature I made my first jQuery plugin. I tried to mimic the structure from some open-source plugins. I wonder if this can be improved.
Here is the source code:
(function($, window, document, undefined) {
"use strict";
var _instances = {};
var _instancesCount = 0;
var... |
This is a follow-up to my previous question.
I followed the given advice and implemented the MVC design pattern. As I've never used MVC before I am quite unsure about the quality or if it is even considered a "valid" MVC implementation.
The design is (I believe) quite straight-forward. Main acts as the user interacting... |
I made my first console game in C++. It is a simple game. The game is also known as Concentration, Pelmanism, Shinkei-suijaku, Pexeso and Pairs. This is a simple console implementation of this game. There are 3 levels: easy, normal and complex. Also after the game the game statistics is displayed (for how many moves th... |
My function needs two params(a,b) and if...break, which seems redundant. Can it be made prettier?
def slice_list(lst,num):
"""
Given a list or Numpy array,
get consecutive tuples based on specific window.
"""
rst = []
for i,_ in enumerate(lst):
a = i
b = i + num
if len(l... |
I have a program that controls a custom machine. I wanted to add some simple HTTP comms so I could control it from the network or other programs.
My server class is:
public class Server
{
private volatile bool stop = true;
private Action<string> methodOne;
public Server(Action<string> methodOne)
{
... |
I'm wanting to model a family tree in the F# type system. The basic requirements:
A family tree is made up of family members
A family member has a required ancestor
A family member has an optional partner
My struggle is what to do with the "root" family member. I thought about making it an option:
type FamilyMember... |
I have a table SlideList that defines all available slides that can be put into a PowerPoint presentation. I have a table ReportList that defines which slides go into a presentation for a company and the order they're to be inserted.
I've been maintaining ReportList by hand (yes, that's a nightmare and needs to be fixe... |
I wrote a C# program that converts decimal to string. It is not the best but it works. I'm looking for inputs from others on how can it be improved? One aspect that baffled me was how to find out total number of digits after decimal point? Right now I've to pass it as a separate parameter. It is in C#, but I'm open to ... |
I'm very new to JavaScript so I thought I'd ask for someone to have a quick look over this to make sure it isn't brittle, buggy, or completely unnecessary. It may be all three. I also thought it might help someone in the future (if correct), as I found lots of different suggestions I don't think I needed including loop... |
I have tried to create the async task using the RxJAVA2. The code is working fine. WHat enhancement can I do in this code?
private void createObservable(){
progressDialog =new ProgressDialog(ProductActivityRx.this);
progressDialog.setTitle("Data fetching...");
progressDialog.setCanceledOnTouc... |
Here's the current logic to convert strings in the format hh:mm:ss, mm:ss or ss to milliseconds.
Any comments on how to improve this?
hhmmssToMillis(hhmmss) {
let time= hhmmss.split(':').reverse();
let millis = 0;
switch(time.length) {
case 1:
millis = parseInt(time[0]) * 1000;
break;
... |
This is my solution to a problem from MIT's 6.034 Artificial Intelligence course (see the heading Tree reference on 6.034 Artificial Intelligence, Lab 0). Can you please help me improve my solution (keep in mind I am a beginner with no formal education in Computer Science)? To be clear, I am NOT taking this for school ... |
I have created a contact form that originally did not have any mechanism for sending out the email with whatever the user inputted in the fields. I have added it in here along with ReCaptcha check. I would like to get some feedback on the code, and I am especially looking at upgrading the email body to send out emails ... |
This is a followup post to version 1, and version 2.
The following code is a website with a nav-bar on it. It uses some simple JavaScript and CSS (with media-queries) to make it work:
index.html:
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8" />
<title>SigmaCubes</title>
<meta name="author" co... |
I have implemented a little Flappy Bird clone with swing.
I'm pretty new to Java, especially in graphic programming, so I'm really glad if someone an give me a feedback to my Code and maybe to movement of the bird, because it's not really smooth.
The bird is represented as a red square and the pipes are green rectangl... |
This is another Brainfuck interpreter in Python. I personaly think this is better than most of the other once you find online, because it keeps a bracket_map, which makes both [ and ] instant actions. The data array is a simple defaultdict(int), so it is infinite is size in both directions (which maybe a bad decision?... |
Here's a pretty rookie attempt at creating a shell script to squeeze videos into Twitter's 140s limitation:
for f in "$@"
do
/Applications/ffmpeg -i $f -filter_complex "[0:v]setpts=140 / \
$(/Applications/ffprobe -i $f -show_entries format=duration -v quiet -of csv="p=0") \
* PTS[v];[0:a]atempo= \
$(/Applic... |
I have a nested state which is needed to set its state by a key's value:
state = {
income_source: {
type: 'text', label_name: 'Income Source', value: '', helper: 'dropdown',
},
employment_status: {
type: 'text', label_name: 'Employment Status', value: '', helper: 'dropdown',
},
...
I'm... |
I had a foreach loop which used to loop Membership users and create list of a custom class. Following was the for loop:
foreach (MembershipUser usr in userlist)
{
userandGroup usrgp = new userandGroup();
usrgp.id = ((Guid)usr.ProviderUserKey).ToString() ;
usrgp.Name = usr.UserName;
ProfileBase profile ... |
I have a javascript function written which I think is horrible for multiple reasons (which I have tried to mention in the comments in code below).
I want to give it a rewrite following some best practises in general.
I am trying to solve following two problems.
Do I need to include multiple try-catch statements in th... |
I'm toying around with a Caesar cipher that supports keys. The cool thing about it is that, unlike most Caesar ciphers you see, it works with byte arrays, not just strings, so you can encode text as well as files and other data. Of course, if you're looking for true security, you wouldn't want Caesar encryption of any ... |
For the purposes of unit-testing in Python, I've written a very simple function for generating variable-length lists populated with random objects:
constructors = [
object,
dict,
lambda: bool(randint(0, 1)),
lambda: randint(1, 1000),
lambda: ''.join(choice(digits) for _ in range(randint(1, 10)))
]
... |
I am trying to solve this problem. The problem is to sort a linked list containing only 0s, 1s and 2s by changing their links.
Sort a linked list of 0s, 1s and 2s by changing links Given a linked
list of 0s, 1s and 2s, sort it.
Examples:
Input : 2->1->2->1->1->2->0->1->0 Output : 0->0->1->1->1->1->2->2->2
Input : 2... |
So this is (I think) a premiere for python. A function that translates brainfuck code to python code. It does a few optimizations (It chains +,-,>,< together to one operation). I don't think you can do more optimizations, but I am open for ideas. At the beginning of the created source code there will be a few imports (... |
I needed to make a multi-page form, with slides, but without using too much js code like slick.js or the likes. So I tried to figure out how to make it really simple, but still cross-browser and responsive. I ended up with a small test using transform transitions. My question is: do you maybe see any relevant drawbacks... |
This is a continuation from the previous post found here. I made most of the changes that was suggested. I just want to see if there are any additional changes I should make to my code.
Here is my header file:
#ifndef DoubleLinkedLists_h
#define DoubleLinkedLists_h
template <class T>
class DoubleLinkedLists {
private:... |
I was solving Project Euler Problem #52:
It can be seen that the number, 125874, and its double, 251748, contain exactly the same digits, but in a different order.
Find the smallest positive integer, x, such that 2x, 3x, 4x, 5x, and 6x, contain the same digits.
in C++, and this is the code I used:
#include <algorithm... |
I am looking for some feedback regarding my Java Tic-Tac-Toe implementation.
Player.java
class Player {
private String coordinate;
private String name;
public Player(String coordinate, String name ) {
this.coordinate = coordinate;
this.name = name;
}
public String getCoordinate()... |
We are all tremendously happy about back slashes in Windows file systems and do not think that their sole purpose is to make life complicated for smart people who are capable of using different OS. Upvote if disagree [ :) ].
Converting paths from/to Windows backward slashes is a pretty monotonous task. Here is a librar... |
I have implemented a simulation which is called "Langton's Ant" with Java. Here is a short summary of basic rules:
A ant is placed in a 2D matrix and looks to north, west, east or south. First, all cells are colored white.
If the ant is on a white cell, the cell is colored black and the ant turns 90 degrees right and... |
For decoding binary data (in my case, delivered by a Bluetooth device), I've written this struct:
public struct ConsumableByteArray {
private let bytes: [UInt8]
private var idx = 0
enum Error: Swift.Error {
case notEnoughBytes
}
init(data: Data) {
bytes = [UInt8](data)
}
i... |
I've been working on a program which calculates, given a point and 4 surrounding points, the Lagrange polynomial, in order to interpolate a value. Consider that I'm not a mathematician and I better understand code than formulas.
I've came up with the following code, which works, but I really don't think is general (and... |
Every day Duga reports the number of unanswered questions and percentage of answered questions (after she calls the API endpoint /info) in The 2nd Monitor (so we can keep the Zombies at bay).
I created a script to read the messages by her in the past few months and plot the percentage of answered questions on a line ch... |
A web page has a nested list. The goal is to insert the number of descendants for each li node (except for leaf nodes).
Here is an example of the expected output:
Animals [9]
Mammals [4]
Cows
Donkeys
Dogs
Tigers
Other [3]
Snakes
Birds
Lizards
Fishes [5]
... |
I've created a security helper class that attempts to adhere to the National Institute of Standards and Technology (NIST) "Digital Identity Guidelines" SP800-63B [June 2017] specs. These guidelines propose new rules for password creation and storage. In a nutshell, my implementation addresses the following rules:
Passw... |
IReadOnlyCachedRepository<T>
public interface IReadOnlyCachedRepository<T>
{
void RefreshIfExpired();
void RefreshSubset(Expression<Func<T, bool>> selector);
IEnumerable<T> All();
T Get(Expression<Func<T, bool>> selector);
bool Exists(Expression<Func<T, bool>> selector);
int Count(Expression<Fun... |
I'm sending some data over to a database. There is a particular part that requires me to send a bunch of stuff all at once. It seems a little silly to me to write it this way. I feel that I could do this with an array and for loop, but I'm not sure about how that would look. I tried finding implementations elsewhere bu... |
I've created this database structure to store tabular information (it's a simplification of my real structure but enough to show the point). In it I have Sheets and each Sheet can define different Columns. The important part is that with this structure I can define different datatypes for each Column.
Those could be di... |
As you may know, I like birds. The Cornell Lab of Ornithology has a tool called eBird where you can submit records of the birds you identified. I recently learned they have an API that I can query, yay! Before this I was just hitting pages and parsing source code.
I've never really queried an API before.
Oh and I norma... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.