instruction stringlengths 71 95.1k |
|---|
I have implemented Dijkstra's algorithm for my research on an Economic model, using Python.
In my research I am investigating two functions and the differences between them. Every functions takes as input two parameters:
F(a,b) and Z(a,b).
Every cell of the matrix is defined as: $$M[a][b]=|F(a,b)-Z(a,b)|$$
The purpose ... |
I have a problem that I solved in 2 different ways and I would like to know which one is better, cleaner and easier to read.
Problem:
Write a while loop that starts at the last character in the
string and works its way backwards to the first character in the string,
printing each letter on a separate line.
Example 1:
c... |
I've written something (i.e. frankensteined from stack exchange) that appears to work but I haven't done much testing on the edge cases. Signed up here for some feedback on what optimizations or other functions/methods I could have used, and whether or not I've missed something critical -- this is my first time dealing... |
Here is my solution for the Quiz game exercise from https://gophercises.com/. The goal is to write a program that will read questions and their correct answers from a CSV file, ask them from a user one by one, and print the number of correct answers. The interesting part is that a user has a limited amount of time for ... |
This is exercise 3.1.39. from the book Computer Science An Interdisciplinary Approach by Sedgewick & Wayne:
Write a program that takes the name of an image file as a command-line
argument and applies a glass filter: set each pixel p to the color of
a random neighboring pixel (whose pixel coordinates both differ from
p... |
Please review my System information class.
Systeminfo can be used to retrieve system management data from the BIOS. This data is mostly strings.
Is the code easy to understand and maintainable?
Is the code efficient?
How could it be improved?
systeminfo.hpp:
/*
SystemInfo class is a C++ wrapper for the System Manage... |
Background
The basics of this project are already covered here.
I received the suggestions to:
not create the exercise with JavaScript.
use pictures instead of plaintext.
I tried to implement the suggestions like this:
The code
Example-form:
<form method="POST" action="../php/send.php" class='input'>
<label>Your ... |
In pandas lot's of methods have the keyword argument inplace. This means if inplace=True, the called function will be performed on the object itself, and returns None, on the other hand if inplace=False the original object will be untouched, and the method is performed on the returned new instance. I've implemented it ... |
I wrote a login system for an app I am developing, but I'm not really happy with the code I have at the moment. I feel like there is a better way at tackling a problem like this. In particular I'm not happy with the way my callback method has to be called specifically on the ui thread, I thought maybe there is a better... |
I wrote this log function and it works but is there a better way to write into the file stream and console at the same time?
//The function
void log(int lvl, const char * format, ...) {
va_list args;
va_start(args, format);
//If lvl < 0 the prefix will not be used
if (lvl>=lINFO) {
time_t now ... |
technical interview question i got from daily interview pro
A palindrome is a sequence of characters that reads the same backwards and forwards. Given a string, s, find the longest palindromic substring in s.
Example:
Input: "banana"
Output: "anana"
Input: "million"
Output: "illi"
i was wondering if there is any way... |
For my first Raku program, I thought it might be a fun challange to port over a program I'd written in C# about two years ago, and I was right: it was.
There's just one problem: while the C# program runs in 5 seconds, the Raku program takes nearly 5 minutes. I think the Raku program is doing more or less the same as th... |
This is web exercise 3.1.41. from the book Computer Science An Interdisciplinary Approach by Sedgewick & Wayne:
The scytale cipher is one of the first cryptographic devices used for
military purposes. (See The Code Book.) It
was used by the Spartans in the fifth century BCE. To scramble the
text, you print out every k... |
This is web exercise 3.1.45. from the book Computer Science An Interdisciplinary Approach by Sedgewick & Wayne:
Write a program that reads in a list of words from the command line
and prints true if they form a word chain and false otherwise. In a
word chain, adjacent words must differ in exactly one letter, e.g.,
HEA... |
I'm in the process of making my first GUI with Python. I'm trying to make something for work, so I've replaced all the info with fruits. It just lets the user tick some boxes, then creates a word doc
It's quite messy, and the variable names will be renamed later. But what I wanted to ask about was the functions I've de... |
Here is the raw data
anycasestr = "<div style="color: rgb(51, 51, 51); background-color: rgb(253, 246, 227); font-family: Menlo, Monaco, "Courier New", monospace; font-size: 12px; line-height: 18px;"><div>refinement</div><div>decent</div><div>elegant</div></div>";
to extract all the textcontent to an array l... |
I am currently going through and implementing basic algorithms and data structures as I feel I didn't learn enough about this during my Data Structures and Algorithms unit. So far I've done the following algorithms, yet to get to data structures.
Sorting
Bucket
import random
#toSort = [round(random.uniform(0.10, 0.99... |
Introduction
I've improved, IMO, Laravel's base Model and FormRequest. It's working as expected. But, before actually implementing this any further in my application, i want to have my classes checked on any problems i did'nt oversee. Also any suggestions for improvements are welcome. And feel free to use it in your ap... |
I have a situation when there could be and could not be values in database, which is why i return optional, so the response object that goes back to the UI could be different depending on the existing or not values.
Examples :
new UserLogsResponse(auditEntity.get().getTimestamp(), latestRetrievedDocumentDateAndTime.g... |
I am studying algorithms and I did this "Union Find Like" algorithm.
I have one array of objects with a reference and I make the union pointing to the same reference instead of have two int[] with numbers and weights.
Its not necessary to initialize the array.
You will have a maximum of N/2 extra objects ( if you do a... |
Hello I've just finished coding one of my first websites.
And I would love some feedback. I know that I really need to improve my design and improve my code and for that I need some tips from you guys
The webiste (hosted on github.io) can be viewed here, and the code itself is also available on Github.
*,
*::after,
*... |
Below is my Code, I want to know ways to improve it.
const findOdd = (A) => {
newObj={};
A.filter((cur,index) =>{
return A.indexOf(cur)===index;
}).forEach((cur) =>{
newObj[cur] = 0
for(let i = 0; i<A.length; i++) if(cur === A[i]) newObj[cur] +=1;
});
const keys = Object.keys(newObj)
key = k... |
I have below code for implement toggle button.
After including below code, processing power consumed over 90% in my embedded application.
Is there any way to reduce this processing power.
ToggleButton.h
#ifndef TOGGLEBUTTON_H
#define TOGGLEBUTTON_H
#include <QtWidgets/QAbstractButton>
class QPropertyAnimation;
cl... |
So I made a game during the pandemic, and I really enjoyed seeing it grow and learn a ton of stuff and implement it.. The game is about small moving circles that cross a line and when they intersect with the line they start to drag the line with them, until a new circle is born again. You can play and see the source co... |
I've just implemented a search box, so I can search on employee object by (name, part of the name, phone, email ...).
Ex. if the name: Moamen Abdulraouf Mansour, I can search with ( moamen | moa | moamen mansour ...).
The Idea I've followed is:
split some values from the object to be not included in the search.
conver... |
This is web exercise 3.1.63. from the book Computer Science An Interdisciplinary Approach by Sedgewick & Wayne:
Write a program that reads in a command line input N and plots the
N-by-N Thue-Morse pattern. Below are the Thue-Morse patterns for
N = 4, 8, and 16.
Here is my program:
public class ThueMorse
{
pub... |
I have written a little program that converts a CSV-File to an HTML-Table. It works for my purposes. But are there parts in my code that can be written more clean? Can you improve maybe the performance? Are there maybe any bugs? I searched for bugs and fortunately I did not find some.
Postscript
Maybe I should have pro... |
I'm quite new to web development. I want to implement basic session ID authentication. Here's the implementation
package httphandler
import (
"context"
"fmt"
"io/ioutil"
"net/http"
"sync"
"time"
"github.com/satori/go.uuid"
log "github.com/sirupsen/logrus"
"github.com/yura-under-rev... |
I am trying to write a function which execute the given command with given number of retry and delay. If the return code is 0 and output string have expected_output(partial) have to break the loop and return the return code and output. Is there any better to write this code?
cmd check_output_and_retry(cmd, expected_out... |
I am passing a in as a parameter and want to return b.
This works, however I feel like it is wrong because I shouldn't have to pass a in at the return. Also, if I don't include the type for a, I get an error that says Parameter 'path' implicitly has an 'any' type.
async function exampleFunc(a: string) {
const b = a... |
I need an encryption system with a super simple API. I'd prefer something as simple as the following. The output should also be browser-friendly and ideally url-friendly.
$encrypted=encrypt(data);
$decrypted=decrypt(encrypted);
I'm not a cryptographer, however I have come up with the following to achieve this.
<?php
d... |
I have a function that adds a class name to a DOM element is met. The script provided works.
function rm_row(){
var chk_inherent = arcapi.dataResult().columnNameToIndex('Inherent Risk');
var chk_residual = arcapi.dataResult().columnNameToIndex('Residual Risk')
var chk_perf = arcapi.dataResult().columnNameToInd... |
I have implemented the following code which works as intended. However, I would like to improve my code in terms of performance and efficiency
Code in Question
import pandas as pd
from scipy.stats import norm
# data frame of length 40,000 rows, containing 25 columns
for indx in df.index:
matrix_ordered_first = df.... |
I am making a simulator game "BEE HUNT SIMULATOR" and in that game we have bees and we have to collect pollen from different fields,this is fully command line game that means a typing game so i have made all things that should be there but the main thing is of collecting pollen out of specific storage for that i had tr... |
This is web exercise 3.1.14. from the book Computer Science An Interdisciplinary Approach by Sedgewick & Wayne:
Set pixel (i, j) to the color of the most frequent value among pixels
with Manhattan distance W of (i, j) in the original image.
Here is my program:
import java.awt.Color;
public class OilPaintingFilter
{
... |
I'm practicing back-end programming and NodeJS. As an exercise, I'm attempting to build a REST API for a MongoDB collection. I'm also learning to use the Express and Mongoose middle-wares, so that's what we'll use for the server and database respectively. Also practicing async / await to handle promises.
The requiremen... |
I have a pandas dataframe, my_calculation, that is a Cartesian product of 4 different categories (Name, Freqset, Formula, and Location) and two additional Address categories. There are 3 different names, 12 different frequency sets, 14 different formulas, and 13 different locations making 6552 rows. There can be any nu... |
I am trying to write a program to get the count of the maximum number in an array of integers. The below code is what I have written. Is there any better way to write this code in Ruby?
def max_number_count(my_array)
max_num, max_num_count = my_array.inject([0, 0]) {
|arr, age| age >... |
I created a library with two CLOS class to implement a deque structure similar to the one available in C++, plus a few Lisp-ian twists. The two classes are node, which implements a doubly linked list, and deque, which uses node to implement the actual deque.
The main deque operations are available, including push and p... |
I am pretty new to assembly I would like criticism on two "methods" I have written. One converts string to int and the other prints an int to stdout. Any advise helps out.
bits 64
section .data
endl db 10, 0
endlLength equ $ - endl
section .bss
string resb 100
section .text
global _start
global _strToInt
global _... |
I'm relatively new to python and coding in general, and I decided that this would be a good little practice project. This was also my first project involving classes and objects so I kept their implementation a little basic just to get the feel of it. I would appreciate any constructive criticism on how I could improv... |
I've written the following data analysis code (using just a couple lines from CERN's ROOT data analysis framework). It's designed to find coincidences in three sets of data (timestamps from an experiment for a given year) by pairing up each timestamp in one dataset with the closest possible timestamp in both the second... |
I'm after some constructive criticism on my code and maybe some ways to simplify before I expand it to include other sites. I am new to R and coding and have been working on this problem for weeks now.
I need to graph the last 10 days of data from 20 remote sites. There are 3 csv files from each site that I bring in vi... |
I try to implement the features of the js Promise using Go.
Currently, I had implemented Promise.all(), Promise.allSettled() and Promise.race() static methods.
Code here:
package go_promise
import (
"sort"
)
type Promiser interface {
AllSettled(iterable []Workload) []Result
All(iterable []Workload) []Resu... |
I recently reviewed a PR and saw the following.
const parts = someString.split('.');
return parts[parts.length - 1];
was changed to
const [last] = someString.split('.').reverse();
return last;
I commented that I am against the change for the reasons that it is harder to read and not performant.
The answer was that it... |
I have created a module that validates the credentials against different databases.
module Authentication
DATABASES = %w[mysql mssql oracle].freeze
DATABASES.each do |database|
define_method("#{database}_connect") do |args|
client = case database
when 'mysql' then Mysql2::Client.new args.... |
I'd like to know what you think of my insertion sort version. I tried to be pythonic and avoid while loops with "ugly" index-management:
def sort(a):
for i, x in enumerate(a):
for j, y in enumerate(a):
if y >= x:
a.insert(j, a.pop(i))
break
On lists of 1000 rando... |
i am rather new at python and this is my very first project i did myself. i am wondering if there is anyway i can improve this or give me advice on making this better. thank you
import sys
valid = ["+", "-", "*", "/"]
invalid = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', '... |
The following microservice is just handling loan application and response the result of the application is accepted or rejected. It is part of my assignment for an interview.
The project description is that; A user sends them Id, username, surname, and monthly salary via REST API. Assuming that you have got already cre... |
I wrote a dynamic stack in C that uses an array as a structure. I tried to maintain O(1) for push and pop and believe I have done so. I want to know what can be written in a cleaner way and if there are any non-trivial bugs.
#include <stdio.h>
#include <stdlib.h>
int push(int val, int *c);
int pop(int *c);
int *sta... |
I've been tasked with adding RTL support to Material UI project. I've stripped non-essential code down to a simplified version of the UI/Theme module. My solution involves the following:
a language module which has a list of RTL language identifiers and some methods for determining language directionality;
a theme-spe... |
I started learning Django and now I want to write some tests for my application. After reading some blog posts and watching youtube tutorials I wrote tests for URLs. Look at below.
urls.py
from .views import HomeView, ArticleDetailView, CreatePostView, UpdatePostView, DeletePostView, StatisticcsView, CreatePostCatego... |
This is my first project using Python. I made a simple password generator that checks user input. How can I improve it?
import random
def password_generator():
password = []
letters = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u",
"v", "w... |
So, I am learning Swift and as a little exercise I tried to implement a BruteForce algorithm. That algorithm is pretty simple however it is a bit slow too... Well, I am new to Swift, so maybe some optimisations are possible ?
Let's start with some useful prerequisites:
extension String {
var digits: String { r... |
My program tracks betting odds for the given list of events and sends notifications when odds reach specified value.
The odds are in the database collected by another program. The required odds are in the same database.
Each N seconds the required odds are retrieved from the database, compared with the actual odds and ... |
I hope that the word "decompose" is correct, but the problem is simple:
I got two lists after an operation and I want to know what change happend from one list to the other.
As such I want to "decompose" the two lists A and B into "Both", "Only A" and "Only B".
template <class T>
void decompose(std::vector<T*> &a, std:... |
I'm working on a data analytics dashboard in Node.js as a portfolio piece. I've built a pipeline that gets the data where it needs to be for more processing, however, I feel the below code can be improved but it overlaps with my inexperience with Node.js and async/await.
The below code looks redundant to my eye. I trie... |
This code tries to solve the sudoku board using the rules of sudoku. When it does not make progress in solving, it assumes a cell value and tries again. Please review my code and help me understand how I can make it better.
import math
import copy
import sys
# GLOBALS
reccursion_depth = 0
dead_end_counter = 0
assumpti... |
I have the two following algorithms. My analysis says that both of them are \$\mathcal O(m^24^n)\$ i.e they are equivalent for big numbers (more than 32 bits). Is this right? Note that m and n are the bits numbers for x and y
def pow1(x, y):
if y == 0:
return 1
temp = x
while y > 1:
y -= 1
... |
I solve projecteuler.net Problem 2 deferent way
Generate number from 1 to range ex 100 and get the even number
Get Fibonacci numbers from list
Reduce array
I have one problem with a large set of numbers like 1000000 or 4000000.
can I ask how can I optimize the code? I am trying to solve the problem as a collection ... |
For continuity, my last question was with adding numbers together with a function call: Example x86-64 program. In this one I've tried to apply the lessons pointed out in the previous answer (stack alignment, using edx instead of rdx where the results will fit). I've tried to comment inline with the code:
# We are goin... |
Id like feedback on my code. Specifically the parts where i use graphemes. I use cloned strings because the grapheme functions eat my strings. But feel free to comment about anything else that looks like it could be improved.
https://github.com/MonkeyToiletLadder/Hangman
Dictionary
pub mod prelude {
use std::io::... |
I am working on a text normalizer. It works just fine with small text files but takes a very long time with large text files such as 5 MB or more.
Is there anything to change in the code to make it run faster on large text files? My guess would be something in the __preprocess(tmp) and __prenormalise(text)?
# -*- codin... |
I built an auction site with a dynamic caching layer after I seeing how expensive a dbaas is. The site is now done, but like any site that grows, my caching solution grew too. The cache currently caches every page on the site so I made sure everything gets invalidated appropriately, but the amount of stuff I'm invalida... |
I'm looking into fixing some obvious performance-related issues in my code but I tend to employ bug-introducing tricks as I do so.
My code uses a library which defines Field<scalar> and uniformField<scalar>:
template<class T>
class Field
{
List<T> v_;
public:
explicit Field(const Mesh&); // There are more args,... |
I want to get exactly n unique randomly sampled rows per category in a Dataframe. This proved to be involve more steps than the description would lead you to believe.
n = 4
df = pd.DataFrame({'category': [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 1],
'value' : range(12)})
category_counts = df['category'].va... |
I am trying to solve the "Ransom Note" problem on hackerank.
Why isn't my code getting submitted?
What can I do differently?
is my total time complexity, in this case, it is O(n^2)?
#!/bin/python3
import math
import os
import random
import re
import sys
# Complete the checkMagazine function below.
def checkMagazine(m... |
I am new to writing java code and I would like to improve my skills. I would like someone to review and critic me on where I can improve on. Here is a small program I wrote in java about matrices and a few arithmetic methods applied on it.
import java.util.*;
public class MatrixArithmetic{
private static Scanner i... |
So I recently applied to this job for iOS Developer and was invited to complete the following code challenge:
As a next step, please complete this coding exercise in order to proceed with our interview process. If you do well & pass, you will be connected to a Software Engineer to discuss your exercise for an hour zoo... |
I'm a hobbyist programmer(just having fun) created a small script that takes a photo and
resizes it, then cuts it up into 24 pieces. The chunks are transposed and made into buttons. Your task is to get it back to it's original state without out going negative on points. My questions are: was it fun? Could you play it o... |
I need to calculate the value for the following function:
$$f(n) = -1 + 2 - 3 + ... + -1^n$$
The time limit to calculate a given value of \$n\$ is less than 1 second. My approach does not meet that requirement at large sizes, for example \$f(1000000000)\$.
My code:
program A486;
uses wincrt, sysutils;
var
n: LongI... |
While I know that Shaders are often made with glsl or hlsl because that is want those languages were made for I wanted to see if there was another way to accomplish Shaders while also using the GPU. as a result I decided to use CUDA for the Shaders and win32 for the actual window. also most of the Shaders were ported f... |
Any one can help me optimise those three functions? I did profiling and timing of my original python file and found that most calls and time duration was because of those three functions.
The three functions are from a text normaliser for text processing. The full python file is available if anyone wants to have a look... |
This is my first modeling exercise on the particle flow. Recently, I read a paper https://acp.copernicus.org/articles/20/3181/2020/. After reading the paper, thought of modeling it in Python. It seems like that the model came out well but I am not entirely sure.
Since I don't know how to fit the parameters alpha and be... |
I have this code that gets a CSV string from a list of objects where the first row in the string is the object's properties and the rows underneath are the properties values. I then create a MemoryStream of the string so it's about the same as reading from an actual .csv file into a Stream. Is there any way to cutdown ... |
After blowing up my environment again messing around with installing random programs and packages I decided to write a bash script I can clone from github and use to reinstall everything like I had before
The idea is that I'll be able to keep adding to it as I find more programs to use so that it will always be a stabl... |
So i wrote a program with the documentation for my fx cg50 calculator's micropython to calculate various items, each of which are:
Pascal Triangle Entry
Pascal Triangle Level/Entire Row
Binomial Expansion
Binomial Term Finder
First num of terms
Combinations
if you look at the code below, you'll notice, I haven't used... |
I have made a function to drop a row in a pandas.DataFrame. Since, in general, the input dataframe of a function is just a reference to the dataframe. So any change made in that function to the dataframe will be preserved outside that function. Therefore, there are two choices when designing the function:
simply make ... |
I am trying to create a secure file upload using PHP 7+ where I only allow PDF files. I found a lot of posts on this topic on different websites but couldn't find a complete solution that ensures that no harmful files can be uploaded this way.
So far I have the following code. Can someone tell me if I am missing any im... |
I solved a Risk game question (http://www.pyschools.com/quiz/view_question/s3-q12) in two ways, but as I am currently learning Python, I'm just wondering how to rate my methods of solving this question. Like which one of these ways is really a better, effective, and efficient method to solve this question? Or maybe the... |
I've been coding for a couple weeks now and have nearly finished the first version of a gatsby site for a landing page. My aim is to make the addition of new pages to the website as fast as possible by setting up a system where this can be done quickly, but still work across mobile or desktop. I'd really appreciate som... |
Much like this question I'm attempting to write in C++ something which can resemble Haskell's (.) function as much as possible, which is basically Chapter 1's second exercise from Bartosz Milewski's Category Theory for Programmers.
This similar question about writing the identity function served as a reference too.
Thi... |
Is there a better way to check if the variable x is in the 0-255 range and:
if x is less than 255, add colVel to it
if x equals 255 minus colVel from it.
My implementation, in Python 3.8.
if 0 <= x < colVel:
flag = True
if (255-colVel) < x < 255:
x = 255
if (255-colVel) <= x <= 255:
flag = False
... |
Below is my app's start/stop procedure, start/stop code is handled by a single-threaded ThreadPoolExecutor, so I'm guaranteed there's only one thread can be active at the same time.
I'm asking about isRunning variable. Is making the variable volatile enough?
The variable will be accessed (read/modify) from different th... |
The following is the program 3.2.6. from the book Computer Science An Interdisciplinary Approach by Sedgewick & Wayne:
// This data type is the basis for writing Java programs that manipulate complex numbers.
public class Complex
{
private final double re;
private final double im;
public Complex(double... |
I'm trying to code in a Rust a function, that gives the maximum product of adjacent digits.
So given the string 123456789, with 3 adjacent digits, the maximum is 7 * 8 * 9 = 504.
I've tried to come up with this current functional solution (see previous edit for longer solutions). Could it be shortened? Comments are wel... |
My programming background is mostly C++/C#. Lately i got interested in writing some C. So i implemented Conway's Game of Life using SDL2 for visualization. This is actually my first program written in C. Since im quite comfortable in writing C++ it's probably not completely awful.
I would like to get some review/feedba... |
I have files in a store folder, which I want to trim to a particular length by removing bytes from the beginning. My app uses a temp folder for the files manipulation. All files from the previous operations must be taken out form temp, so I use the folder for temporary storing the trimmed files. I also log the errors.
... |
I have the following multi thread scenario and the codes. It looks kind of messy and want to know if I can make it better or if there is any flaw to fix.
When a request arrives, one thread downloads it and the remaining operations are dependent on download so it needs to wait for download to finish. But there can be ma... |
This is my first program code ever, and it actually works.
My goal is to scrape information from the website and store it in a database.
It is a site that has historical data on sporting events and odds.
https://www.oddsportal.com/hockey/sweden/shl-2019-2020/results/
For example, there are 50 matches on this page and t... |
This was for a school project in my Data Structures class (I am still a very very young programmer). The purpose was to pass an interger and a base into a function and print out the result of changing that integer into that base. The project guidelines state that we can only pass an integer that is >= 0 and <= 10000000... |
Can I make this code somehow faster and is this readable? I'm a beginner and in later I'll make another class with Decimal to Binary conversion, but first I've to know how to do that.
package convert.console.binaryToDecimal;
import java.util.InputMismatchException;
import java.util.Scanner;
public class ConversionProg... |
Given a sorted array consisting 0’s and 1’s. The task is to find the index of first ‘1’ in the given array. I submitted the below code in geeks for geeks and the execution time is 5.77. Need help in optimizing the below code.
class FindIndex {
public static void main (String[] args) {
Scanner scanner = new ... |
I have written a code for my purpose to send bulk email dynamically (Name,Document,Expiry date,email address will be changed dynamically)..Everything is working fine but it take a approximately ( 4 Second/Mail sent for without using array and 2 sec / mail sent using array)...Any one know another way around to make it ... |
The Sequences & Series involved are Arithmetic and Geometric.
stores and allows you to calculate using these given formulas
and import fractions into micropython
Support for micropython! Micropython, however, only has a subset of functions of pythons, and it's standard library is very limited, so i had to reinvent the ... |
Here's one way to solve the serialization problem in c++20, using a json library:
#include <functional>
#include <unordered_map>
#include "json.hpp"
namespace nlm = nlohmann;
class properties
{
struct property_info
{
std::function<void(nlm::json const&)> deserializor;
std::function<nlm::json()> serializ... |
I'm doing a Coursera assignment on an HTML-CSS course. The assignment is to do a simple responsive page, which can be found here.
I think I came up with a solution, but I ended up having around 100 lines for the stylesheet, so I suppose that there is some ways to achieve the desired layouts in a more intuitive and easy... |
here below a working implementation that finds the minimal distance between k(set =4 below) clusters in a graph.
I have doubts mainly on the implementation of the Disjoint Set structure: instead of using STL containers, I went along with an array of pointers as data structure hosting the leader nodes, in order to have ... |
I have this tiny function that expects an int and returns an int with the bytes swapped:
public class Main {
public static void main(String[] args) {
int cafeBabe = 0xcafebabe;
System.out.println(Integer.toHexString(cafeBabe));
System.out.println(Integer.toHexString(byteSwap(cafeBabe)))... |
I've written an API that unlocks some serious MVVM capabilities with VBA's MSForms UI framework.
This is the complete code-behind for an example UserForm "view" - it's not the code under review, but since I'm 99% sure I won't have enough room to fit everything here I figure it gives a nice idea of what Model-View-ViewM... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.