instruction stringlengths 71 95.1k |
|---|
This post is the follow-up of Checking whether a string is a permutation of a palindrome in C++20.
So, what's new? Well, nothing else except that the procedure is now generic and accepts all string_views of char, char8_t, wchar_t, char16_t and char32_t:
string_utils.h:
#ifndef COM_GITHUB_CODERODDE_STRING_UTILS_HPP
#def... |
In the snippet below, I'm creating a banner for my website. If I change the variable in the html file, I want to call a different banner. It does work as is.
<?php $pencilbanner='hol'; include($_SERVER['DOCUMENT_ROOT'] . '/includes/banner.html'); ?>
In my banner.html file, I'm holding all the banners. Each one with it... |
I've recently started learning python to gain some fullstack skills and am working on a backend for a webapp as a learning project. Before I get too far down this path I was wondering if someone wouldn't mind taking a look through my first few routes to let me know if I'm going about things in a totally wrong way or no... |
While upgrading some meta-program running in production for years to the latest (c++20) standard, I rewrote this particular compile time string utility.
Even though this new version produces desired output and correctly evaluates at compile time as well as dynamically, it's difficult to get a grasp on a new standard as... |
I wrote this code as a reference implementation for this challenge. How can I make it more readable and/or efficient?
The goal is to take an integer and create patterns like the following:
/\
\/
/\
\/\
\/
/\
/\/\
\ \/
\/
/\
/ \
\ /\
\/\/\
\ \/
\/
For n=1,2,3,4 respectively.
Code:
(
n‹[
n 4 % 2 = [... |
I implement sum element of array using multi threading but my question is when my program work with one thread the time is better than using 6 thread . I am using a CPU with 8 threads.What am I wrong
public static int threadss = 7;
public const int count = 1000000;
public static List<int> a = new List<i... |
For an angular project I need a customized version of the mat-list-option component.
I've found a solution by creating my own component and using mat-list-option inside of it.
Unfortunately the parent mat-selection-list didn't recognise the custom component as list options and therefore it didn't work with the reactive... |
I'm writing the following:
def make_table(data: str, w: int) -> List[List]:
pass
data is a string containing items separated by ,. Some items may be an empty sequence so multiple commas are possible, the input can also start/end with comma which mean that first/last item is empty.
w stands for width and is th... |
How the program works is that the user sends 2 inputs over (userinput and passwordinput). These are compared against the filename of a textfile (which is the username) and the context (which is the hashed password). The passwordinput gets hashed and if it returns the same as the hashed original password "Access Granted... |
I have binary files that need to be efficiently processed. The first 8 bytes correspond to metadata, and all the rest is data. From the first 8 bytes I need the last 4 bytes to determine how to structure the rest of the data.
Since I'm new to rust, this seemed like a good exercise. The following code complies and produ... |
The code below will print a 10x10 table of random numbers between 1-3.
Is there something to make the code faster?
Can the code be made more readable?
import random
import numpy as np
x = str(np.reshape([random.randint(1, 3) for i in range(100)], (-1, 10)).tolist()).replace("[", "").replace("]", "\n").replace("\n,", ",... |
The following code is applying the depth-first search and breadth-first search algorithm to find the shortest path from bottom left to top right in a 10 x 10 grid. I need reviews to improve my implementation and code quality.
Graph.h:
#include <iostream>
#pragma once
using namespace std;
struct point{
int x, y;
... |
How can I find the unique phone numbers (and collapse them into a single column) from table_1 (while keeping the IDs and date fields), and remove phone numbers that appear in table_2?
table_1
id
phone1
phone2
date
1
1111111111
2021-12-31
5
2222222222
3333333333
2020-11-08
8
5555555555
2021-03-15
14
7777... |
I wanted to get my code reviewed as I have tried to implement a basic Money class to represent money values in c++. Can anyone tell me if I am implementing my basic arithmetic operator overloads incorrectly? or if there are any c++ best practices I am breaking since I am new to c++ but tried to do as much research as p... |
This question is about how best to encode, send and store information between JavaScript, PHP, and MySQL
I am doing a GET request from HTML/JavaScript to my PHP server, which is then storing the data in mySQL. My solution in the one case I've been using it in, and I think it should work in all cases (If it won't, pleas... |
Here is my effort to implement extensions for FileInfo object:
public static class FileExtensions
{
public static async Task MoveFileAsync(this FileInfo file, string destinationPath, string destinationFileName = "")
{
await CopyFileAsync(file, destinationPath, destinationFileName).ContinueWith((x) =>
... |
Basic Background
I have an ASP.NET Core MVC application that uses Client (e.g., "customer") information for every HTTP request. The collection of Clients, as well as their information, rarely changes and is stored in a database. If it does change and some subsequent requests still use the old information, or even if th... |
I manage my dotfiles in a github repo. The idea would be that I could clone the repo if I ever have to develop on a new system and symlink them to the home directory. I could do this piecemeal manually but I wanted to write a script that automates it.
The script calls a recursive function that symlinks to my dotfiles... |
I'm writing a simple start page and it's my first time with JavaScript, my previous background is Python/VBScript. Is it good enough? What best practices should I apply? Should I compress and nest the functions like this? Is it better to let each function do its thing and write different functions?
function doubleDigit... |
As I am a new programmer, it is very often that I find features of JavaScript that aren't any good, or I am not using them well.
I recently discovered a module for storing data called localStorage and I thought of many ways to use it. One is to implement it into a code I have already created to make things easier for t... |
Is there a better approach to find a digit at a position in a number instead of converting it to a string, I feel what I have done doesn't seem best practice and arithmetic!
tests = (
(1, -494848, 4, 8),
(2, 0, 1, 0),
(3, 100010, 4, 0),
(4, 9383.787, 4, 3),
(5, 1, 1, 1),
)
def run(tests):
for ... |
Thie programs is written in Sympy 1.9 and it should find a polynomial g of degree dim for a given polynomial f such that f o g = g o f as described here, where I already posted program written in Maxima.
This is my first program in SymPy so I am interested in your feedback on this program except on the algorithm itsel... |
I created a simple script to monitor the backup process for veeam, script accept only drives that should be on current days (to avoid override of data), monitor 2 backup jobs. Definitely could be done better, please suggest something to improve performance or tip with good practices.
#Mon Z1Z2E34C
#Teu WD-WCC5D2T... |
Given an array, the method should return true if you can split it to two groups with the same number of cells and so the sum will be equal. It needs to be done by recursion, and can't change the array values/order, recursive private methods are allowed.
Examples on random arrays:
//{-3,5,12,14,-9,13} returns true
//{-3... |
Reaserching BouncyCastle for C# is not for the faint of heart. After navigating an ocean of Java dead ends, I have arrived at the following code.
I believe it's very useful for someone who wants to create these files in C# to use it anywhere.
It basically generates the 3 files every webdev who uses NGINX http server wo... |
I've been working on a lockless multi-producer, multi-consumer queue in an effort to learn as much as I can about concurrency, without the use of mutual exclusion. The queue uses a bounded ring buffer to store/load the data from. Two cursors are used two track the next available index on the buffer, one for producers a... |
This is a follow-up question for Dictionary based non-local mean implementation in C++. There are some issues about operators (operator+ and operator-) mentioned by Edward's answer and JDługosz's comment. I am trying to propose the fixed version of Image class as below.
operator+ and operator- operator overloading:
fr... |
So I am getting packets from TUN interface and after that processing the packet, and then try to send correct TCP handshake response message.
It does handle sequence and ack sequence handling but That needs to be reviewed with useful feed back. Also the tcp checksum code is I am bit unsure about
This is main function f... |
I have built a very small program that is a command line utility for generating alphanumeric characters of a certain length (up to a max. length) called randchars.
$ randchars 12
Prints twelve pseudo-random upper-/lower-case alphanumeric characters to stdout. The command line options -l and -u can be given, if somebod... |
I have used a queue, which has been implemented using a singly linked list, to facilitate the level-wise creation and traversal of the binary tree.
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
typedef struct tree_node
{
int num;
struct tree_node* left_child;
struct tree_node* right_child;
}... |
I need a better implementation than the below code (O(N) Solution), I am grouping countries by language ( data ) is the countries JSON, each country could have 0, 1 .. or more language as the object key, value
where the key is the language shortcut and the value is the language official name.
module.exports.groupByLang... |
This is a follow up to https://codereview.stackexchange.com/questions/272333/conversion-from-long-double-to-string where I do the reverse conversion. This time around it is string to long double. It parses up to 38 dignificant digits, and I used a 128 significant bit floating point multiplication to convert decimal to ... |
This is a script I created that downloads Project Euler webpages and combines them to PDF. The script also downloads animated files.
#!/bin/sh
for i in $(seq -f "%03g" $1 $2); do
URL="https://projecteuler.net/problem=$i"
# chromium print to PDF, wait for rendering https://stackoverflow.com/a/49789027
chrom... |
Hope everyone is having a good Christmas.
First of all, this is working code in a production environment.
I recently wrote some code for work.
The goal is to find users that contain more than one role. On the frontend, if a user has more than one role, the person using the program will see a message suggesting that the... |
I'm rewriting a Python script into an Android app. This script uses difflib.SequenceMatcher to compare sequence of strings. I haven't been able to find something equivalent in Java so I decided to rewrite a part of this class.
I'm not interested by a review of the algorithm which is not mine but about its implementatio... |
I've just coded a little function to check and get a deep array value. Basically, I need to return the value or null if it's not set or does not exists, or in general not useful for databases records. I need to check things like $myarray[key1][key2][key3] etc..
function get_array_deep_value(array $array, array $fields)... |
I'm making a simple program that outputs the squares. I have a question: Is there a way to improve the speed but make the Code readable?
Code
∇F
f ← 1
:While f ≢ 100
⎕ ← f × f
f ← f + 1
:EndWhile
∇
F
Output: a lot of squares
|
This is a next/prev function for use in a circular array. What do you think?
template <typename T, std::size_t N>
struct circular_array
{
T a_[N];
template <std::ptrdiff_t I>
constexpr auto next(T* const p) noexcept
requires ((1 == I) || (-1 == I))
{
if constexpr((N & (N - 1)) && (1 == I))
return... |
I've created a function that exponentiates common factors.
I'd like to optimize/simplify it because, as you can see, it's very messy and not very performant
function App() {
return (
<View results={ [2, 2, 3, 8, 8, 8, 100] } //only an example
)
}
function View({ results }) {
const defaultView = results.reduc... |
My problem is with code about translating a single word into 5 languages
My code:
#include <iostream>
#include <map>
int dict_number;
static const int dict_length = 10;
struct Dictionary
{
std::map<int, std::string> dictionary_no{
{1, "Eple"},
{2, "Banan"},
{3, "Hjem"},
{4, "Hallo"... |
I have been working on an audio player with Vue 3 and the Napster API.
const musicApp = {
data() {
return {
player: new Audio(),
trackCount: 0,
tracks: [],
muted: false,
autoAdvance: true,
isPlaying: false,
currentTime: 0
};
},
methods: {
async getTracks() {... |
Well, I just have a lot of strings that have common parts between them and not all of them. By this reason, I wanted to group them by their longest common part and take from that the minimum from each list of groups. So I have this code:
namespace Program
{
public static class Utils
{
public static stri... |
I'm learning C++, and now I have to implement a table data structure.
I don't know a lot about C++, so I have implemented using a vector of vectors. To access the rows of the tables I have defined eight constants with the name of the planets. And, to access the columns I have defined other nine constants.
This is my co... |
I am currently writing an Engine that runs on a background thread which produces outputs asynchronously. Those outputs are gathered by a Pipe, whith a readabilityHandler that sends back the messages the main thread using DispatchQueue.main.async like so:
private init() {
myPipe.fileHandleForReading.readabil... |
Over the holidays I was bored due to lockdown and implemented a mine sweeping game for the terminal. Any feedback is welcome.
#! /usr/bin/env python3
"""A mine sweeping game."""
from __future__ import annotations
from argparse import ArgumentParser, Namespace
from dataclasses import dataclass
from enum import Enum
fro... |
Learning Rust, I've written a small CLI tool which will
Fetch the existing data in S3
Iterate through local folders
Upload the files which don't exist in S3
I'd be keen to hear anything I might have done that doesn't follow Rust best practices.
use async_recursion::async_recursion;
use aws_sdk_s3::error::ListObjectsV... |
This is my first full formatted webpage done while doing the odin project.
Is there any redundant divs? Can I reduce my css file by grouping some classes?
And how to give styles to a button under a specific div without using class?
html{
font-family: 'Roboto',sans-serif;
}
body{
margin:0;
display: flex;
... |
I have two methods to do the same thing: convert a number to ternary.
void dectotern1(int dec) {
const int dim = 9;
const char* idigits[dim] = { "00", "10", "20", "01", "11", "21", "02", "12", "22" };
const char* ldigit[dim] = { "", "1", "2", "01", "11", "21", "02", "12", "22" };
std::string re... |
I program in Python as a hobby and decided to try to use tkinter to make an application.
I decided to make a YouTube video/audio downloader using youtube_dl. It's really slow, and the tkinter window freezes during the downloading process. But it still completes the download.
Because this is the first time using tkinter... |
This is a subclass of Operation that attempts to combine the requirements of KVO compliance and thread safety. Do I have the KVO notifications and thread safety done correctly?
class ConcurrentOperation: Operation {
private let stateQueue = DispatchQueue(label: "operation", attributes: .concurrent)
private var ... |
I have a page that shows the result of a quiz and depends on the number of right answer, the user get some rewards. So, if the user get just one right answer, he will get one reward, the others will be blurred. If the user get two right answers, he will get two rewards, the others will be blurred, and so on. The total ... |
I organized the factory design pattern but I'm not sure if I used it right or wrong.
Here's my data model;
@Data
@AllArgsConstructor
@NoArgsConstructor
abstract public class Ga implements Serializable {
private static final long serialVersionUID = -1977929156280284414L;
private String id;
private GaStaEnu... |
The term, I used, binary thread scheduler means a scheduler that orders the execution of two threads for two tasks that has a specific dependency. Rather than using some mathematical expressions to explain this, think about scheduling two threads for double buffering. Thread 1 ends writing in buffer 1 and signals threa... |
I have made a Body mass index-calculator using ViewModel and LiveData.
Source-code of the MainActivity:
package com.example.bmirechner
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.SeekBar
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProvider
... |
I wanted to write some code which reads in a FASTA file and one hot encodes the sequence which is consequentially saved to a file. A FASTA file is a text based file format commonly used in bioinformatics. Here's an example:
>chr1
ACGTCTCGTGC
NNNNNNNNNNN
ACGTTGGGGGG
>chr2
AGGGTCTGGGT
NNNNNNNNNNN
It has a header string ... |
C Typed Vector
I wasn't happy with the various dynamic array / vector implementations in C, so I made my own. In general, I'm not the biggest fan of C-preprocessor madness, but alas for this particular purpose and with the features I wanted to implement in mind it was the only option.
That being said I wanted to write ... |
I have the following VBA subs that run before and after query refresh. However, it's taking quite a while to run through the code (about 20 seconds or so from clicking 'Refresh All' to being able to use the spreadsheet again, more time when there are more lines). I'm fairly new to VBA, so please let me know if you see ... |
I just wanted to make a fun project for practise and as far as I know the program runs just fine without any flaws, but I would like to add an option to it, if a round ends to ask the user if he wants to play another round. Maybe I should put the whole thing in a while loop or something but everything I tried failed. A... |
I'm trying to make a responsive hamburger menu for a project that has been assigned to me.
I've (kinda) managed to do it, but I don't actually know if the way I reached it is the proper one.
What I'm asking you
I've made two equals <ul>'s in order to hide one of them, when the dimension of the screen is above/under 700... |
I need to write a program where the user can switch between rect positions.( rects position re-ordering rellevant for activating other functions that not rellevant for this question.)
My algorithm works good but I'm sure there are better ways in terms of logical structure, memory and runtime. Unfortunately I did not fi... |
This is a follow-up question for Parallel 3D Discrete Cosine Transformation Implementation in Matlab and Operator overloading in Image class implementation in C++. I am trying to implement 3D Discrete Cosine Transformation calculation in C++. The formula of 3D Discrete Cosine Transformation is as follows.
The 3D discre... |
Inspired by a question on StackOverflow I decided to code a GUI that is simple, efficent and can be used in other projects as well. I wanted to share this code since it probably is usefull to other people as well. You may want to share some practical hints how to make this code even better.
The code produces a table of... |
Moving from Google Chrome Extensions’ Manifest V2 to Manifest V3, service workers replace background pages. Background pages can be configured to be persistent, but service workers can’t be persistent. Service workers get automatically terminated at times of inactivity, and their variables are hence lost.
Google’s docu... |
I have the following code which finds all the unique values from a hashmap of String to Vec. I cobbled it together (eventually as I was getting various borrow errors along the way), but it looks a mess to me and I'm looking for a more idiomatic way of doing it in rust.
fn main() {
let mut my_map: HashMap<String, Ve... |
I write/maintain an open source library for doing Optical Navigation (OpNav) for spacecraft (you can find the full library at github.com/nasa/giant).
One component of the library works with point spread functions (PSF) (how a single ray of light is spread out over multiple pixels by the camera system), including modeli... |
I created a quick monte-carlo simulation which seems to do what I want (simple version below). The code basically simulates a Poisson distribution, say this results in a simulation of 10. it would then simulate 10 values from a lognormal distribution. It then applies two parameters to the results of that simulation, li... |
I'm trying to learn the "functional" part of C#/.Net for work, and I'm not sure if this is a good way to write this statement.
I was also trying to reduce duplicated code while not introducing too many allocs. From my understanding everything created by new here will be flagged for release once the .ForEach() is finish... |
In this code (reproducible example) I want to generate a dataframe composed by random dates in the first col, and by random numbers (in reality they will be generate from a socket) in the second column.
Another important feature I want to keep is that: since I need to update this date every n-period a "missmatch" can h... |
I want to extract tar.gz file and store the contents in the same directory. I got below method which does the job but I wanted to see if there is any way to improve below code if there is any efficient way?
func ExtractTarGz(gzipStream io.Reader, logger log.Logger) (err error) {
uncompressedStream, err := gzip.NewR... |
I'm trying to create a program in python to automatically get conjugations of French verbs.
I do not want to hard-code any conjugations, and I could not find an API, so I decided to write a program that would send a request to the Reverso French Conjugator.
I find my code, however, to be untidy and hard-to-follow. I al... |
I've created a numbering system that compliments another javascript library for numbering documentation.
I know this can be done in CSS but because this gets rendered and outputted as static HTML afterwards this is the least client side rendering opposed to some CSS bugs I was fighting.
I'm particularly interested in t... |
Intro:
Hello, I'm a python beginner. I haven't had anyone use my code or anything. I want to improve and become a "professional python developer". I thank you for taking the time to help me along that path.
Question:
In context of this forum my specific question is; regarding my codes clarity of purpose. Does my code c... |
In the following code example, the main issue begins with // begin code duplication and end with // end code duplication. As you can see, I need to process the String[] exactly the same way, then put the processed string into indexMap. The problem is that the name of each map keys are different. How do I generalize the... |
I have the following C# code (.NET 6):
public async Task<IEnumerable<Foobar>> RetrieveFoobar(string accessToken, CancellationToken cancellationToken)
{
try
{
using var httpClient = new HttpClient(new HttpClientHandler())
{
BaseAddress = new Uri(_baseUrl)
};
httpClien... |
I am learning algorithms and trying to implement them in c++, I have chosen to try to implement a red-black tree due to its self-balancing properties and its ability to stop the worst case of O(n) when searching for a value. I also needed to allow duplicates to have a vector to hold duplicates in node objects, and a ke... |
Recently I started learning c++ and I had an idea to make a calculator, that can take any imaginable number and I wrote this code:
#include <iostream>
#include <string>
#include <vector>
// Advanced calculator by xxnoflz;
// This calculator works best with summation, subtraction and multiplication
// and can work with... |
I have an MFC application where I need to determine if a file's last write time is older than n hours.
I thought there was a method to get total seconds from either system or file time, but I ended up coding this method which works, but there might be a leaner method.
bool FileOlderThanHours(HANDLE hFile, int hours)
{
... |
I'm learning Haskell and even though I have experience with Functional Programming the Typesystem has been a challenge. I did this yesterday (after like 2 days) and I would like to know whether this is idiomatic Haskell. What this does is basically receive a Tweet ID and if the Tweet is replying to something then it pu... |
In https://doc.rust-lang.org/book/ch13-01-closures.html the author recommended to try to implement Cacher that:
Stores values in a HashMap
Allows the closure to be defined with various input/output types.
Here's my implementation of it:
use std::hash::Hash;
use std::collections::HashMap;
fn main() {
println!("He... |
I have two lists of objects
localList and remoteList, both lists have a consent attribute
I want to check the value of the consent attribute if the same for both lists.
If not, I want to remove all objects from localList that don't have the same consent value as in remoteList and add all objects that have a consent va... |
This is a follow up on c++20 compile time string utility, as suggested by G. Sliepen posted as a new question, so it can be reviewed on its own.
The following code has suggested improvements from the original question integrated, another round of polishing, and a bit extra.
substr is added as an exercise to conform "st... |
I am currently trying to solve the problem "Is my friend cheating?" on Codewars. The Text are the Details to the Problem:
A friend of mine takes the sequence of all numbers from 1 to n (where
n > 0).
Within that sequence, he chooses two numbers, a and b.
He says that the product of a and b should be equal to the sum o... |
Recently I've been entertaining the idea of making a small encrypted chat app as a way to learn about UI, encryption and networking in C#. After some research/work, I've produced the below protocol class that can reliably and asynchronously communicate over TCP Sockets in a console integration test.
However, I've still... |
I reverse engineered the API from adac.de and wrote a client to query it for traffic news (constructions sites, traffic jams etc.).
Here 's what I came up with:
#! /usr/bin/env python3
"""ADAC traffic news API Client."""
from argparse import ArgumentParser, Namespace
from functools import cache
from hashlib import md5... |
I've created a lock-free lamport queue in rust. My code should be clear enough that you won't need to understand a lamport queue before reading it, but if you'd like a reference, this paper give a good outline of the design.
It is a multi-threaded queue that requires no locking on accesses, although there can only be o... |
I wrote a binary heap structure class in C++. It is a templated class with a comparison type as one of the template parameters to allow for a min or max heap.
I have not written anything in C++ in a bit and I am primarily looking for feedback on whether I am using obsolete practices, generally incorrectly using try/th... |
So, I have been trying to understand this simple code and why it doesn't produce the expected result. Here is the code :
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
double *x;
double *y;
int i;
x =(float*)malloc(11*sizeof(float));
y =(float*)malloc(11*sizeof(float));
for(i=0;i<11;i++)
{
x[i] ... |
I I'm trying to make an multiplayer game using golang and unity. Golang server side checking units on scene(like a character move). It also sends the information (position, health) of the units on the scene to the Unity 20 times per second. a unit contains 15 bytes of information. there is an average of 10 units in a ... |
My goal is to aggregate a DataFrame with several million rows including Decimal('...') columns without any precision loss. My current implementation works - but might there be more efficient ways to get the job done?
Original DataFrame (sample)
game
position
amount
1
a
0.264825920790318533
1
a
0.1362555644966... |
I have an interesting algorithm to build and I have tried a couple of things but couldn't get it just right.
I have the following set of rules:
16 people to fill every day of the month (let's call it 28 days to make it even weeks)
4 people per day
Each person should have a maximum of 7 days a month
There has to be two... |
I have the following .txt file structure that i want to parse in Java(8):
string1
string2
B|C|D
R|S|T
100 200 300 400
1 2 3 4
H|A
B|C|D
R|S|T
200 300 400 500
2 3 4 5
H|A
If there was string3 then there would be another related set of lines such as:
B|C|D
R|S|T
200 300 400 500
2 3 4 5
H|A
The parsed values will then b... |
Here's a small experiment about handling boilerplate tasks via service pipelines. It's similar to the HTML pipeline but simpler and multipurpose.
I've updated the question and this is the 2nd version of this project. The first one turned out to have some substantial weaknesses like inability to invoke more than one co... |
after looking at the pseudocode for the Sieve of Eratosthenes on wikipedia I tried implementing a similar version using F#. The code runs just fine, that is, it returns all prime numbers up until a given number. But I was wondering if the implementation could be improved. See below for the code:
let rec sieve xs count ... |
I'm trying to implement a homogeneous multithreading example that multiple threads process portion of a huge task. In order to achieve this, I thought of clustering data/resource and multiple threads handle/process each clustered data/resource. In the meantime, I wanted to maintain singleton like structure that can man... |
I was/am working on an interpreter for a scheme-like language. Just some time back I shifted my implementation from C++ to Rust, which I just started learning. I know there are parser libraries like LALRPROP and nom in Rust that could parse easily for me, but I wanted to try and write it in Rust from scratch. Any comme... |
Usage :
Multiplication
Multipliction is simple, Enter your first digit in (eg. 1)
Enter your operator (x)
Enter your second digit in (eg. 1)
Squaring
Enter your first digit in (eg. 1)
Enter your operator (s)
Cubing
Enter your first digit in (eg. 1)
Enter your operator (c)
Division
Division is also simple, Enter you... |
#include <cryptopp/cryptlib.h>
#include <assert.h>
#include <cryptopp/queue.h>
#include <cryptopp/secblockfwd.h>
#include <iostream>
#include <fstream>
#include <cryptopp/integer.h>
#include <cryptopp/rsa.h>
#include <cryptopp/osrng.h>
#include <cryptopp/files.h>
#include <cryptopp/secblock.h>
#include <sstream>
void... |
I recently took a ~three month break from professional software development and am feeling a bit rusty. I thought a good way to ease back into things before looking for a job would be to take a swing at one of the excellent coding exercises that The Guardian use in their interview process (GitHub link). I attempted t... |
Note: I'm still very new to the code-review stack exchange, so if this question does not align with the community guidelines please leave a comment below explaining and I will do my best to modify it to adhere to the community guidelines.
Explanation
I'm attempting to implement a filter() function that functions most... |
This is a follow-up question for 3D Discrete Cosine Transformation Implementation in C++. In this post, I am trying to follow user17732522's answer to update dct3_detail and dct3 template functions, and propose idct3_detail and idct3 template functions. The formula of 3D Inverse Discrete Cosine Transformation is as fol... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.