instruction
stringlengths
71
71.9k
The Rubberduck 2.0 Code Inspections UI was recently redesigned (again!), this time featuring a GroupingGrid control (thanks @BrunoCosta!), and what appears to be a dynamic grouping: Resources The UserControl's resources include two CollectionViewSource definitions, which determine the sorting and grouping rules for th...
I am trying to create an application where I need to know where to put the logic. Here is the code HomeController.java @Controller public class HomeController { private EmployeeService employeeService; @Autowired(required=true) @Qualifier(value="employeeService") public void setEmployeeService(Employe...
While looking at a recent question, I realized that there is no CSV parser in the standard Java library. I decided to write one that complies with RFC 4180. Highlights of the standard include: Whitespace is significant. Strings may be double-quoted. Inside a double-quoted string, newlines are treated literally, and...
t is number of tests; each test contains two lines: n and sequence n is number of integers sequence is a sequence of integers from 1..n (e.g. '3 6 1 2 4 5' if n is 6) Rotate sequence until you maximize the number of integers that match their position in the string. (e.g. '3 6 1 2 4 5' should output '1 2 4 5 3 6'). Pri...
I'd like to know if I can improve the performance of my recent bot, and maybe some design patterns too. So far, it's warning a user if it's using some bad words (which are parsed from bad_words.txt) and it's entertaining the users by posting jokes from jokes.txt. from selenium import webdriver import time import random...
I recently completed this code challenge so just looking for some feedback on my code. The task is to read polygon coordinates from a file and calculate the perimeter, I was provided with a script containing bugs and asked to fix and improve the code. Example input data.csv x,y -16,-18 -18,-10 2,6 1,-2 9,-13 -7,-14 -9....
Here is my code without using additional data structures. Assuming all the characters are alphabetical and character checks are case-insensitive. public static boolean isRepeated(String s) { if (s == null) { return true; } int length = s.length(); for (int i = 0; i < length; i++) { if (!...
I have CSV file which has structure like this (separated by tabulators): VariableName DateAdded ValueNumeric VariableName DateAdded ValueNumeric VariableName DateAdded ValueNumeric Examples of lines in input data: VariableName DateAdded ValueNumeric St.podatkovnih_blokov 1.12.2015 0:00:21 0,200...
I made this function to get rid of writing numerical option values in a HTML-select manually. From what I have seen so far it works as expected. But hints and suggestions are welcome anyway. // Trying it out. var selects = document.querySelectorAll('.drop-down'); selects = Array.prototype.slice.call(selects); create...
This is a customer information data entry form. First name and Last name are required. In addition phone number, e-mail and birth date are used to check the database for existing customers with the same information. Either of these fields (phone, e-mail or birth date) can be empty or filled in. In order to validate aga...
I'd like the function below reviewed. I'm especially interested in improvement ideas to process the API responses faster. products_list is the API response in the form of list of dictionaries which returns all products for one supermarket only (out of many). def encode_products_response_list(products_list, rows_list): ...
This is the implementation of BFS and DFS i have tried to follow from CLRS.Please suggest what can be improved in this code. import java.io.File; import java.io.FileNotFoundException; import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; public class Graph { VertexList[] row; int time;...
I have several hundred "A" rasters, numbered from 001_A.tif to 100_A.tif. I also have several hundred "B" rasters, numbered from 001_B.tif to 100_B.tif. I want to multiply them like this: 001_A * 001_B = 001_result 002_A * 002_B = 002_result 003_A * 003_B = 003_result . . . I have a loop in R which works fine, but it ...
Task: My implementation: public class Main { public static void main(String[] args) { String fileName = "Brackets.txt"; Path filein = Paths.get(fileName); ParentStack s = new ParentStack(); if (!Files.exists(filein) || !Files.isReadable(filein) || File...
Here is my approach. 1. Checking there is no cycle.(Using BFS) 2. All nodes are connected. (visited) public static boolean isTree(int[][] adjMat) { int numVertex = adjMat.length; State[] isVisited = new State[numVertex]; for (int i = 0; i < numVertex; i++) { isVisited[i] = State.UNVISITED; } ...
I have this java.util.Set implementation that is based on AVL-trees, which implies that the set is sorted. However, it provides two additional operations: get(int i)returns the ith smallest element in the set, and indexOf(Object o) returns the rank of the object o (the rank of the smallest element is 0, the rank of th...
Here is my approach. Do DFS and check in stack whether the new node is already in the Stack or not. public static boolean isCyclicDFS(int[][] adjMat) { int len = adjMat.length; boolean[] isVisited = new boolean[len]; for(int i =0; i<len; i++) { isVisited[i] = false; } ...
I have two DataTables: dt: is populated from a CSV file with over 1.7 million rows dataStructure.Tables["AccountData"]: is populated from a database query also roughly a million rows I use the following code to iterate through and compare the data from each set of rows. The code takes over 48 hours to complete. I hav...
this.action = function(value){ var deleted=false; for (var row in binaryObj) { if(value == 3){ for(var i = 0 ; i < binaryObj[row].length; i++){ binaryObj[row].sort(); if(binaryObj[row][i]+binaryObj[row][i+1] === value) { ...
I explain the nonlinear correlation coefficients in this paper and provided the code in this post. The nonlinear nonparametric regression is an extension of this work and its description can be found in the linked paper. In short, the subset means are the regression points and we can achieve a better fit by increasin...
I'm calling an expensive function that dynamical changes as the end user types in a textbox. To reduce the amount of calls to the function I've used setTimeout to delay calling the function, and if the function is called again whilst waiting to run, it'll also remove the last function request via clearTimeout. The func...
I wrote this script for adding information to a compressed file and compressing the output: #!/bin/env python3 import argparse from Bio.bgzf import BgzfWriter import gzip import sys def main(): args = parse_args() # with BgzfWriter(args.out, 'wb') as fd_out: with gzip.open(args.out, 'wt') as fd_out: ...
Background This is a follow-up of this CR: Compile-time plugin system. The code exposed below can also be browsed on this gist, which shows the differences between both questions (original is version 1, this one is version 3). This is a simple factory which is able to serve the requested specific implementation of an i...
I'm looking to improve the runtime and efficiency of my VBA code that performs multiple Replace operations on an Excel Spreadsheet. I started out with the following (please forgive me for this horrendous mess): Note: Some values/symbols did not show up correctly in this first piece of code(blank values displayed in 'Wh...
I am currently implementing pyramids in Lucas Kanade algorithm for optical flow. To be able to build pyramids, I need to pad the images (mirror edge matrix elements) for the required amount of rows/cols determined by parameter half_window. I have written this code which works but I am new to C programming and it looks ...
Background information for those of you who don't know what 4chan tripcodes are: Via Wikipedia: A tripcode is the hashed result of a password that allows one's identity to be recognized without storing any data about users. Entering a particular password will let one "sign" one's posts with the tripcode generated from...
For string similarity, it is defined as longest common prefix length. For example, "abc" and "abd" is 2, and "aaa" and "aaab" is 3. The problem is calculate the similarity of string S and all its suffixes, including itself as the first suffix. For example, for S="ababaa", suffixes are "ababaa", "babaa", "abaa","baa","a...
I read through other questions here and improved the code and added a new feature. The old question can be found at: Email a notification when detecting changes on a website The improvements that are done until now: Using a difflib.SequenceMatcher Added a logger Using format for strings Exceptions are now logged and t...
This is my first dice game and I have spent countless hours working on it, yet it is still very basic. I was wondering if anyone could spare the time to suggest improvements. import time import random import sys Password= 'password' while True: password= input('ENTER PASSWORD:') if password == Password: ...
My first piece of code encrypts text by moving each letter in the string 5 letters across in the alphabet. encrypt = input('Enter text to encrypt : ') encrypt = encrypt.lower().replace(" ", "") for i in encrypt: print(chr(ord(i) + 5)) decrypt = input('Enter text to decrypt : ') decrypt = decrypt.lower().replace(" "...
As part of an interview, I had to submit a code sample to solve the classical "triples sum to 0" problem. The reviewer said the algorithm needed to be in n2 time, and I was later informed that the code I wrote did not accomplish this. Can you guys help me identify where I went wrong? I've written comments explaining my...
We have three integers: A, B, C where the first (i.e. the most significant) digit of C is the first digit of A, the second digit of C is the first digit of B, the third digit of C is the second digit of A, the fourth digit of C is the second digit of B etc. If one of the integers A and B runs out of digits, the rema...
The following code is a computing quiz: import random #the questions/answer dictionary my_dict = { "Base-2 number system" : "binary", "Number system that uses the characters 0-F" : "hexidecimal", "7-bit text encoding standard" : "ascii", "16-bit text encoding standard"...
I want a JSON object of the following structure to plot a chart chartGroup = [{name: 'A<->B', to: 254, from: 247}, {name: 'C<->D', to: 208, from: 211}, {name: 'A<->C', to: 46, from: 41}, {name: 'A<->D', to: 10, from: 38}, {name: 'B<->C', to: 56, from: 55}, ...
Can I optimize the BuildEntity method more? protected IEnumerable<GroupTitle> BuildProductGroup() { var productGroups = new List<GroupTitle>(); using (var connection = new SqlConnection(_dbConnection)) using (var command = new SqlCommand(_getProductGroups, connection)) { ...
I'm new to akka and would like to get some feedback on my first attempt. The code takes text from stdin and finds the top 10 most frequently occurring words. Specifically, I would like to know Is passing the wordFrequencyAccumulator to the tokenizer a reasonable thing to do? Are there better alternatives? Is the use...
I have a server side operation which takes a percentage value from 0 - 100. The user controls this percentage using a SeekBar on the android client. Time-wise the operation is expensive, so I don't want to send commands faster than the server can update. To limit the amount of actions sent, I have limited the client it...
I'm learning command design pattern right, so I decided to make this project. Basically it's a remote controller and it issues commands to VCR. I've seen different implementations of this pattern so I'm not really sure if I got it right. So the key points are: Is the implementation correct? If not, what's the problem?...
I wrote this up out of necessity, then realized that I actually needed to write it in PHP. Just so I didn't waste the last hour, I'd like a review of it. My concerns: This is my first time using the module pattern. Am I implementing it correctly? To restrict the creation of Either objects, I'm using Success and Failur...
I'm working on a game using the now abandoned Famo.us Javascript framework. I have the game in a running prototype and I'm building with Cordova and running it on an iPhone 6 using PhoneGap. There seems to be some performance issues with it and I can't help but notice that a bit of lag happens right as a new enemy is ...
Recently, I redesigned the Rubberduck settings pane. Here is the unit test settings view, which is posted in this question: The part we are referring to is the section in the right pane. The rest of the window is part of a parent control that will be posted in its own question later. This is the XAML for this window...
I am writing a function gives all possible ways of merging two ordered lists such that in the merged list, the elements are still ordered according to the elements in their respective starting list. For example, merging (a b) with (1 2) would result in: ((a b 1 2) (a 1 b 2)(a 1 2 b) (1 a b 2) (1 a 2 b) (1 2 a b)) My i...
Here is the code I wrote to calculate the minimum of a complex function. The code uses the incremental steepest descent algorithm which uses gradients to find the line of steepest descent and uses a heuristic formula to find the minimum along that line. The algorithm should zig zag down a function and find a local mini...
The following code reads from Microsoft EntityFramework 6.0 domain model and returns the single view_patient object. The view_patient object is defined in the backend database and uploaded to the .edmx model of EF. I am new to EF, but it seems there should be a better way--(better means less typing)-- of going from mod...
Trying to print the closest sibling in a BST. How can I improve on this algorithm in terms of space/time efficiency? Please point out any potential bugs too! I'd appreciate that. import java.util.ArrayList; import java.util.List; public class ClosestSibling { public static void printClosestSibling(Nod...
I am writing a storage for articles and I have decided to use GridFS from MongoDB. I have found and tested some code, but I am not sure that it is a best one. Could you advice me how to make it better? private GridFS gridFs; public String getPostContent(String name) { GridFSDBFile file = gridFs.findOne(name + ".ht...
My code below find the duplicates based on 2 criteria: The first criteria is the Name in Column A The second criteria is the Country in Column D Sheet("RawData") : Sheets("Conso") after the macro: What I am looking is to increase the speed of this code, because I am working with more than 150K rows and it takes hou...
We've had a situation whereby we have to cater for certain exceptions and retry a particular method whenever these exceptions occur. This is required in various parts of the system. In addition, we (might) want to invoke a 'callback' upon the need to retry. I'll show you the code, then give you an example of useage: ...
I am writing an R package. The package consists of a main function and lots of auxiliary functions that perform different calculations. The main function The idea behind the package is to make the user use only the main function and through it select which auxiliary function to use. This would imply that only the main ...
Is there any way I can make this function more inline? def nDimensionalArray(n, s): x = 0 for i in range(n): x = [x for j in range(s[i])] return x
I want to add red borders to required fields, if the fields are empty. The ShowSelection() function is run when the interface is loaded, and everytime the interface is refreshed. I have the following form fields: First Name, Last Name, Birth Date, Email, Cell Phone, Address, Post Num, Post City, and Consent Checkbox. ...
Here is my code for a sprinting game in Python. You have to tap the 'a' and 'd' keys as fast as you can to run 100 meters. Any improvements? import msvcrt import time high_score = 50 name = "no-one" while True: distance = int(0) print("\n--------------------------------------------------------------") print...
At work we have a need to know what printers are getting dangerously low on their toner, and paper consumption, etc.. So I've created a program that pulls the printer information off the websites the printers are located at and outputs the information. This program has the option to use two separate flags -e for every ...
Using various answers from Stack Overflow and Ask Ubuntu, I've hacked together this simple C program that wipes terminal history. It works but I'm relatively new to C so I'm not sure if everything is correct. #include <stdio.h> int main(void) { // check if the program is being executed in a terminal if (isatty(0)...
I wrote a package a few years ago to make my interactions with the Stack Exchange API more straightforward. I've maintained it over the years and used it in several scripts I've written that interact with Stack Exchange. Now my goal is to release it to PyPI. Before I do so though, I'd like to ensure it's a clean, well ...
I have a dedicated stylesheet <style id="dynamicStyles"></style> for my page's dynamic styles. They are controlled by this JavaScript: function style(className, sty) { var sheet = document.getElementById('dynamicStyles').sheet; sheet.insertRule('.' + className + ' {' + sty + '}'); } // No validation, do not pa...
This is my second Ruby coding attempt. Also - this is my first OOP usage in Ruby. I'm using if __FILE__ == $0 form here - same as it is in Python because it's really comfortably as for me. Is there is any objections/restrictions for such usage? Any other tips/links about this code appreciated as well. Script intended ...
Here is a serializer. My concern is to make the convert_to_internal function more pythonic, efficient and ideally more functional. Maybe I could also get rid of three nested loops. class TimeSerializer(serializers.Field): DAYS = { 0: 'monday', 1: 'tuesday', 2: 'wednesday', 3: 'thursd...
Here are the app.js, users.js and user.js routes of a node application I am building. As you can see I am connecting to the SQL DB in each route, and this is not ideal. I have tried passing the connection to different routes at least 3 different ways based on examples online. I have failed multiple times. Please advise...
In PHP how can I follow the DRY (don't repeat yourself) principle in this piece of code? The 2 classes in question share an awful lot of code. <?php interface iSelect { public static function display(); } class CountrySelect implements iSelect { static $template = 'select_template.php'; public static f...
I have a list of Comment objects comments. Each Comment has several properties, one of which is the date the comment was posted. I've sorted this list by date and there is at least 1 comment per date in a range. I would like to loop over comments and for every date, create a new list of comments just for that day. Howe...
I just wanted to implement the enum singleton in java. Here is my implementation where I have tried to create a singleton DataSource instance: public enum EasySingleton { INSTANCE; private DataSource dataSource; private EasySingleton() { this.dataSource = MYDB.getDataSource(); } public D...
Summary: How can I best write tests that override socket-based communication for a library, capturing what is sent over the socket, and simulating responses based on what is sent? Details I'm adding a new feature to ruby-mpd, and it's extensive enough that I'd like to add tests covering many scenarios. The library comm...
I am working on a script for an automated workflow. It expects a CSV and a disk image to be present in the directory that is supplied as args.input. I want to check for and handle every possible scenario: no CSV, no disk image, too many CSVs, too many disk images, and any possible combination thereto. I've written the ...
For this project, I'm using the non-Boost version of the ASIO library. The basic idea is that it is a relatively simple stand-alone class capable of functioning either as a server or client depending on its needs. It performs all networking in an asynchronous paradigm, and as best as I'm able to determine, it can handl...
I wrote this function to convert an array of bytes to a C/C++ string representation using hexadecimal escape codes (\xhh). Any suggestions are welcome: std::string toEscapedHexaString(const std::uint8_t * data, const int dataSizeBytes, const int maxCols = 80, const int padding = 0) { ...
I want to see if I used the Observer pattern correctly. Right now I'm using a VolumeManager.cs that implements ISubject and a MusicVolume.cs that implements IObserver. I'm doing this to make it easy for me to change volume along a lot of different sounds and musics. My VolumeManager.cs is set the execute first in th...
I have used PHPmailer to send email to users upon registering to the site. Now, everything works as should, however, I find myself doing painstaking work adding the HTML elements in. Here's an example piece of HTML code: <p>This is a paragraph</p> <span>Now this is important!</span> <h4>Uh Oh!</h5> Now in the PHP cla...
After writing this answer, I was inspired to try to design a more elegant solution to the problem of printing binary trees. And what better tool with which to seek elegance than Clojure? Overall design The solution I ended up with involved creating, merging, and printing what I'm going to call sparse strings. A sparse ...
I am fairly new to Python but I have been improving, and I wanted to try writing a simple program that simulates locker with multiple chambers (4) for storing "objects". I recently used lockers at a theme park with a similar functionality. A chamber can be reserved by simply typing a unique PIN. In the real world, the ...
My code will check if the variable myString has 20 running numbers. I'm new to JavaScript and I'm wondering if there is a simpler way to do this. How can I shorten my code and possibly make it more efficient? var myString = "tuxwuhkocx14789470019215498263ljmgwsxvne"; var runningNumbers = 0; for (i = 0; i < myString.le...
I'm learning F#, and have challenged myself to write a good functional implementation of FizzBuzzWoof. (The difference from "standard" FizzBuzz is that any number that either is divisible by or contains the appropriate number must be replaced by the appropriate string of text: 3 = Fizz, 5 = Buzz, 7 = Woof. Also, the st...
There are two methods I am using here for merging day, month and year. First one $scope.firstOption = moment(new Date($scope.register.db.day + ' ' + $scope.register.db.month + ' ' + $scope.register.db.year)); Second One $scope.secondOption = moment($scope.register.db.day + $scope.register.db.month + $scope.register....
I am a bit worried about this small PHP base as it has been running a bit slow. Can anyone notice anything majorly wrong with it? root/Index.php: define('START', microtime(true)); define('RAM', memory_get_usage(true)); define('ROOT', dirname(__FILE__) . '/'); define("SECURE", true); ini_set('date.timezone', 'Europe/Lo...
I'm working with Apache POI framework. This code go through sheets, row and get value of cells. I will try to get value from directly indicated column. I need this because I want convert only some information from xls to csv. FileOutputStream fos = new FileOutputStream(outputFile); Workbook workbook = null; for (File ...
I was doing a programming question in C++ at HackerRank. Given a set of up to 500 bitstrings, each up to 500 bits long, the task is to find the pair a and b such that the bitwise OR contains the most 1s. I solved the question with Time Complexity of O(n3). I can't figure out how i can solve the question with a better ...
I am trying to create a class that parses a JSON and selects all labels, or just a particular label that you prefer to later do a calculation with the value pair extracted off that label. This is working well for .all() This is the first function, wich selects ALL available labels. But then I want to make it flexible a...
This is not very memory-efficient. Can you please suggest a better way or improvement? public class Test{ public static void main(String[] args) { System.out.println(replaceSpace("All men must die")); } public static String replaceSpace(String s) { String[] stringArray = s.split(" "); ...
We are new into hibernate, in our project for saving an entry the below given code is used, please have a look. public void save(Object obj) { Session session = null; Transaction transaction = null; try { session = sessionFactory.getCurrentSession(); transaction = session.beginTransaction();...
I'm having trouble with a current algorithm I'm writing that takes a corpa, a list of characters in sets (1 one or larger) with a frequency number attached to it. Against another list of character sets that need to be created using the most frequent occurrences of the combined sets... if that makes sense. I'll explain ...
I don't know if this method uses a lot of time to process, or if it is bad but I wanted to know if there is any better way of actually doing this? I have a few class files that I want to stop users viewing through the browser, and only allowing them to view it if actually load it from the index.php So I have this nice ...
I am making an ArrayList, keeping note of all the indices where zero has occurred. Later on, I am taking out the indices from ArrayList and making the corresponding row and column to zero. Please suggest improvement and the better ways to do it in place. public void setZeroes(int[][] matrix) { if(matrix.le...
In my Symfony (v2.7.9) project I have a set of entities which share some view functionality i.e being displayed in a table with some of their values as columns. Following the separation of concerns principle, I've made a ListTable class which handles getting the table headers, rows and column values and I'm extending t...
Please suggest improvements and a possible better way of doing it in place. public static void main(String[] args) { int[][] mat = { { 1, 2 }, { 3, 4 } }; rotate(mat); } public static void rotate(int[][] matrix) { if (matrix == null) { return; } int n = matrix.length - 1; int temp = 0; ...
Want to create time series for the nuclear power plant performance using the equation for Time to fail and time to repair for 8736 hours in the year so that I have the time series in hours when the generator is operating in when is not. The starting condition is that the generator is operating on the first hour. For s...
This essentially performs the same function as exact-integer-sqrt in math.numeric-tower. (defn isqrt "Returns the greatest integer less than or equal to the principal square root of n." [n] {:pre [(not (neg? n))]} (let [n (bigint n)] (if (zero? n) n (loop [x (.shiftLeft BigInteger/ONE (quot (...
In my spare time I'm working at a perl library, which is the lightweight implementation of a package I did some time ago. In the previous iteration I used Moose as object-oriented framework, as suggested by many people on the Internet. Later in time I realized how Moose was a total overkill for my use case (I'm not a b...
Could you please tell me what you liked or may have disliked about this code? What can be made better? #!/usr/bin/python3 def change_char_at(ch, s, indx): """ Strings in Python are immutable objects. So, it is not possible to change a certain character in a string in place. For example, an attempt to run t...
I developed a Chinese Poker game for better understanding classes in Python. It is not finished yet, but the main part is. The game mechanics: There is 1 board for each player. Each board have 3 rows. The first row can receive up to 3 cards, and the other 2, 5 cards each. A total of 13 cards in each board First, each ...
I made an ASP.NET MVC application using Entity Framework for code-first migrations to the SQL Server database. I also use Unity (DI/IoC) for managing the services and repositories. I made an overview page but I'll limit the items on that page to 10, 50 or 100 (variable named pagecount) items as selected by the user. Th...
I was reading a typical interview question found here. Given an amount and a list of denominations, count the number of possible ways to break the amount into different combinations of coins. For example, if amount = 4 and denominations=[1, 2, 3], there are 4 possibilities. Here's my Python solution. def _get_num_of_c...
I recently built a Docker image for Composer. I'd love to get a review of the image, the Bash based wrapper script, its recommended use, and the repository structure. Here's the Dockerfile for the latest tag: FROM alpine:edge MAINTAINER Samuel Parkinson <sam@graze.com> RUN echo "http://dl-4.alpinelinux.org/alpine/edg...
I currently have two projects. One called Models, a second called TaskEntityModels, a model first Entity Framework 6 project. Here is an example of a class in my models project: public class ImportRequest { private readonly TaskEntities _taskEntities; public ImportRequest(TaskEntities taskEntities) { ...
I have an Active Record update with the following data model: TvMenuProfile has one rich_text_special Bar has zero to many tv_menu_profiles Special has one bar_id and one description I want to copy all of the Special.description columns to each TvMenuProfile. The link between the two is tv_menu_profile.bar.specials.f...
I have a REST WS in Java using Jersey that connects to a database. I don't know what should be the ideal time for execution but I feel the time it takes is too much. The actual call to DB completes in range of 0-3 milliseconds but the overall time to complete the REST request takes >9 milliseconds. Here is one of the m...
I wrote a function template to compute the GCD of two integers. This function checks that its arguments are an integral type. I also wrote a function template which accepts a pair of iterators in order to compute the GCD of two or more integers. It calls the first function to compute the GCD of pairs of integers. Here ...
Is there some way to speed this up, since it keeps timing out while running? The spreadsheet is shared with a Google Group with editing permissions. I've loaded what I can into memory but each .addEditor and .removeEditor takes up to 3 seconds each x 100s of cells. I have the sheet deleting the first row in the spreads...
I created a highly effective Reverse Polish Notation calculator using Java 8, but am uncertain if there are any better ways to handle the problem. Feedback on any evident taboos and bugs is greatly appreciated! public final class RPN { /** * Removes all characters that are not operators, whitespace, or digits...
When I'm writing Python, I wanna be able to pull up an interpreter quickly, and import what I need easily. Previously, this involved: bash4.3 $ python3 >>> import os, sys, readline, lxml I was irked by the amount of typing in that, so I wrote a couple of tiny bash functions that live in my .bashrc, so I can just do (f...
In an answer to this question I mentioned best effort. Here I try to explain what I meant. Please keep in mind that the implementation is intentionally incomplete (missing features such as NAN are trivial to add) and focuses specifically on the numerical stability. It was surprisingly hard to get it right, but it paid ...