instruction stringlengths 71 71.9k |
|---|
I am writing a program that is capable of reading a matrix supplied from a text file. One intended feature of this program is that it should be capable of detecting various delimiters in the text file.
So, for example, these inputs should be interpreted equally:
1,2,3,4
5,6,7,8
9,10,11,12
1:2:3:4
5:6:7:8
9:10:11:12
M... |
I am making a small script, which, when run in the console on Vocabulary.com, picks one answer (the third or fourth) and clicks. Then the code checks if the answer was wrong or right and goes to the next question. Because the animations between the time the question is answered and the appearance of a "next question" b... |
I have an extremely large function for turning my database output of menu links into a multidimensional array that nests each of the links in a menu fashion. I'm wondering if anyone sees a way this class function can be shortened or simplified in some way.
The mysqli query:
private function _interactions($product, $pe... |
I wrote a simple tree data type in Java consisting of nodes which are themselves trees, and where each tree has its own list of children (not a binary tree). I plan on eventually using it in a minimax algorithm where I keep track of future game states in a board game by holding different board states in nodes and holdi... |
This is my latest brain child for clojure, could it be done with less code, cleaner, or in a more re applicable way? I am at a pretty early stage in my clojure learning so an in depth explanation of how and why my code is faulty would help me get a handle on what I am doing wrong so I do not build bad habits.
(def next... |
I want to make a Ruby nested hash table class to avoid repeating ugly code and to keep my programs as true to the OOP paradigm as I can. Are there any ways to make this class definition smaller and/or simpler?
To clarify, the class essentially creates an arbitrarily-deep hash table. For example, if you had a NestedHa... |
I have a table where I'm storing a row for each transaction that records the type of transaction along with the amount of money being recorded for the transaction type. I then need to write a report to sum the amounts of various types.
At the moment I'm doing this with a series of CTE's, but I'm sure there's a better w... |
What I've created is a CacheBuilder service that will be passed in a list of items, and will build a results cache. The results are produced by making calls to another service (AsyncService) which will take a variable amount of time.
At the same time, other consumers can be checking the results cache, to see if the ite... |
Context
I have a bunch of data points that look roughly like this:
(defn rand-key []
(into [] (repeatedly 3 #(- (rand-int 19) 9))))
(defn rand-val []
(rand-nth [:foo :bar :baz :qux]))
(def data (into {} (repeatedly 10 (fn [] [(rand-key) (rand-val)]))))
Obviously the actual coordinates would have a much greater ... |
Inspired by this CR question, I decided to create my own queue! If you guys see anything taboo or have any improvements, please let me know. Ultimately I want it to be feature rich and bug free, with every possible case tested, so if there's anything else that can be added (like an iterator) and thoroughly tested, plea... |
Say we have these data:
var mat = [
{
"id": "A-B",
"x": "1",
"y": "0",
"weight": "100"
},
{
"id": "A-C",
"x": "2",
"y": "0",
"weight": "77"
},
{
"id": "A-D",
"x": "3",
"y": "0",
"weight": "95"
},
{
"id": "A-E",
"x": "4",
"y": "0",
"weight": "... |
This code takes id, name and marks of 3 subjects for 5 students from user base, calculates the total of 3 subjects per student, and then takes a criteria level with which to sort; level 1 sorting does sorting based on 1 criteria only, while level 2 will sort based on criteria 1 and if similar occurs (like if select lev... |
.globl inet_addr_asm
inet_addr_asm:
movq $0xff00000000000000, %r8
movq $0x3000000000000000, %r9 # load ASCII '0' into register nine
movq $10, %r10
movq $100, %r11
movq 8(%rdi), %rsi # load eight byes from string address
shlq $8, %rsi # get rid of prefixed '.' (if any)
movq %rsi, %rcx # load... |
The following code is a C solution to the following problem UVA 10018.
The Problem
The "reverse and add" method is simple: choose a number, reverse its
digits and add it to the original. If the sum is not a palindrome
(which means, it is not the same number from left to right and right
to left), repeat this proc... |
Here is a GPA calculator in C#. I am feeling like the code that I write and format are quite long and would like it to be shorter. This program is using radio buttons to enable and disable the text boxes according to the number of subject chosen. Perhaps that part can be shortened.
public double gradePoint1, gradePoint... |
This is a time line for control over the events of some containers in a train station.
It gets all the data to build the time line by getting a JSON from a database via REST service. The app resets every minute to refresh the results and every dot representing a container has some info in a tooltip activated by hoverin... |
I'm pretty new to Angular. I wrote a weather app and need my code reviewed. I especially need help on best practices for handling edge cases on the response from the JSON endpoint.
Here's the HTML:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scal... |
I would like get some suggestions for improvement of this function, and alert me about any dodgy practices that you find.
I have been trying to learn python for a short time now and I would like to get some pointers on writing more pythonic code before I develop bad habits.
from string import ascii_uppercase, ascii_lo... |
(See the next iteration.)
I have that application for en-/decrypting files. Here, I will post the actual GUI and command line code. In order to run the program refer to this GitHub repository.
Some images:
My code is as follows:
App.java:
package net.coderodde.ciphertool;
import java.awt.BorderLayout;
import java.a... |
I'm still new to programming. (First exposure was school about a year ago), and for some reason this problem really gave me a lot of problems trying to solve it. Can you help me understand what I could have done different/better here?
import java.util.*;
public class Lab10 {
public static void main(String[] args) t... |
Given these two methods, is it defensible that one is better than the other?
In what terms? Performance? Elegance? Readability?
public static void AddFirstNotNull(List<object> onlyNotNull, List<object> source)
{
var item = source.FirstOrDefault(v => v != null);
if (item != null)
{
onlyNotNull.Add(item);
}
}... |
I'm using Spring HATEOAS to create some links on my REST API. However, the entities i'm returning are very close, so the code to generate the links are the same:
private Iterable<Link> getTemperatureSensorLinks(Links sensorLinks, Integer curPage) {
Integer lastPage = sensorLinks.getLastPageNum();
Integ... |
I've started to learn PHP classes, interfaces, extends and things related to those.
Before this i've worked only with functions and it started to be quite a mess with hundreads of separate functions.
What i'm trying achieve is the following:
Html table, which has 25 products listed. Each product has its quantity and ... |
I'm new to Java and is trying to find a substring within a string using regular Expressions. I was just wondering if there are any alternative ways to achieve the same goal, or in a more elegant or efficient manner.
while (true) {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System... |
I took a look at Speed up processing between VBA and IE, but I didn't see anything that addressed the speeding up of the retrieval of information via IE.
Since MS got rid of the stock retrieval database (MSN Money), there wasn't an easy way to get current stock prices. From what I gather, there are some add-ins availa... |
I'm trying to improve the portability of a file format converter, specifically to POSIX platforms other than Linux. I'd appreciate a review of the following functions used for converting between little endian and host endian 32bit unsigned integers and back. This is basically to replace le32toh and htole32 on platforms... |
This function is a working function, which builds a number of queries depending on the values of $_POST.
group, class, category, subcategory, brand, product are all arrays sent via post from a userform which uses the Chosen jQuery plugin for multi-select boxes. So here I assume that the user cannot maliciously enter th... |
I'm making a web-service for an app with a (partially) crowdsourced movie database.
These two functions allows users to add and remove which genres a movie is liked to, and get the log of whom have done what changes.
I need to make many very similar functions for other data.
[HttpPost]
[Authorize(Roles = "Us... |
I have written a program that takes in some amount of money, and prints the equivalent change (starting at hundred dollars, to fifty, to twenty, down the pennies). Here is the code:
System.out.print("Enter amount of money: ");
Scanner scan = new Scanner(System.in);
double value = scan.nextDouble();
int valueIntegral =... |
I implemented a simple tool to find duplicate files, by applying the following strategy:
Take a list of files and return the sets of duplicates (set of sets)
Implement a custom Comparator<File> to compare files by content
Implement another comparator that calls the first one, and when two files are equal, mark them as... |
My code will generate a spelling mistake inside of a string 50% of the time.
It will retrieve a letter from a random index in the string like, "t" and then duplicate that letter like, "tt" and store it in the spelling mistake variable.
It will then replace, "t" with "tt" in the string to replicate a spelling mistake. (... |
I'm a self-taught (on the job) programmer, always looking for ways to expand my skills. Seeing all the FizzBuzz examples with hard-coded logic checks made my head hurt, so I thought I'd try my hand at it. Leaning heavily on KISS, I'm ignoring exception handling and such, and all that's required to add new fizzbuzzers i... |
I am looking for an elegant alternative of the following code where wordXX contains always 16 bits:
uint64_t wordHi = 0xaa; // I would like u_int16_t over u_int64_t here
uint64_t wordMi = 0xbb; // because it represents the real data better
uint64_t wordLo = 0xcc;
uint64_t largeword = (wordHi << 32) + (wordMi << 16) + ... |
I have created a basic checkbox custom meta box in order to set a post as "featured".
//create the boxes html markup
function custom_meta_box_markup($object)
{
wp_nonce_field(basename(__FILE__), "meta-box-nonce");
?>
<div>
<label for="meta-box-checkbox">Featured Article </label>
... |
I'm not great with javascript. I need some code to rename all iframe src attribute names to data-src, for a lazyload plugin to work. I couldn't find out how to rename the attribute names, but with some trial and error I managed something similar and it is working OK:
$( document ).ready( function() {
$( 'ifra... |
For educational purposes and to understand how iterators are working in C++, I've create an input iterator and I would like others to look at and provide any feedback on my code.
template<typename T>
class iter_input {
public:
typedef T value_type;
typedef T& reference_type;
typedef const T& cons... |
I have been learning object oriented programming for quite a while. I understand many concepts about it but I quickly realized that I made a big mistake just reading theory and not doing any actual coding . There was no practise at all and when I started to write some code, I felt it was harder to think and come up wit... |
This JavaScript file is part of a large Ruby on Rails app. Any feedback is appreciated.
Update 3.7.16: as per @Jonah's suggestion, here's a description of the code's purpose:
I've built a bus-tracking application using Ruby on Rails that displays a user's location as well as the location of several nearby buses all on ... |
Requirements were to create a constructor for a complex number, that receives a string. For example: \$3+5i\$. The regex extracts positive or negative numbers from the string with optional decimal.
My professor told me that my regex was "beyond wrong":
public Complex(String str) {
ArrayList<Double> list = new... |
I have been learning AngularJS and have written my first app. It's a Hangman AI which learns words and guesses the solution based on the words it knows.
Please look over my code and provide some pointers towards better practices, techniques and overall criticism.
Here is a CodePen demo, as the Stack Snippet may have cr... |
I have a library that defines a bunch of ISprite interfaces, like IPieceSprite and ITileSprite. Then, it defines a global ISpriteFactory that should be supplied to the library upon initialization. ISpriteFactory should create concrete objects based on the interfaces mentioned.
I made this rough implementation, but it m... |
//convert the comma separated numeric string into the array of int.
public class HelloWorld
{
public static void main(String[] args)
{
// line is the input which have the comma separated number
String line = "1,2,3,1,2,2,1,2,3,";
// 1 > split
String[] inputNumber = line.split(",");
... |
(Everything needed for running the app is here.)
I have refactored my previous version a bit.
App.java:
package net.coderodde.ciphertool;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;... |
I want to make show/hide logic more maintainable in my codebase.
Because they are too faraway located in separate js files, it hard for people to maintain.
The flow in my codebase is:
require.js init (hide the target DOM at first) → app.js → load_comments.js (show the target DOM if the comments length > 0)
main.js (... |
I would like to improve the function below without calling twice InserisciRigaNote.
Before I fill my dictionary. When I compare idNota with the current database id I check if it is equal or not, if different means that the dictionary is filled and I can proceed with the insertion of the row in DataGridView
I have a que... |
I am tring to learn coding in clear way. I developed easy application to simulate EKG. I would like to ask some experts, if the code is clean and if they have any suggestion, what could I improve. Possible improvment is not to avoid first loop (no counter of data is set to -1, to avoid first read), but I do not have an... |
I was working on LeetCode to practice myself with Java programming. I encountered a question about insertion sort a linked list. My code currently runs correctly, but it failed on an instance with more than 8000 nodes. I guessed there must be a bottleneck for my code and I need your help.
My code :
/**
* Definition ... |
I have created REST API in codeigniter. REST sever created in codeigniter 3.0 and REST client created codeigniter 2.x.x.
I have wrote simple code for login. After login client created dashboard page. So for creating dashboard page I am sending so many request to REST server and it's taking too much time.
Below is the ... |
I'm writing a function divideMoney that takes the value of a sum of money and divides it according to some percentages, then rounds each division to the nearest denomination.
For example:
//divideMoney(sum, percentages, denomination);
divideMoney(102, [0.5, 0.30, 0.20], 0.25);
This should divide the sum of $102 to 3 ... |
I am new to the functional style, and I wrote a curry function to practice this new style. This curry function takes a regular function and returns the curried version of it. Currying is a technique, with which you can partially evaluate functions.
function curry(f, self) {
return function () {
if (arguments.le... |
Here is a function in a django rest api, that takes data in json and registers a category for a given website. I'd like to merge two try...except parts that check 'site_id' and 'category_id' but I am not sure how to do it. Also any other suggestion to make it pythonic is appreciated:
@myql_view(['POST']) ... |
I require that the Feature set of my Licence to have a non-empty intersection with a set of features that the module I am loading contains. I expect other lists in my License to form similar requirements, and I wish to be able to specify as much information as possible on the license object, i.e. I do not wish to need... |
I'm trying to figure out double linked lists. I'm looking for any type of comments you might have for my code. Anything that will make it better.
#include <iostream>
using std::cout;
using std::endl;
using std::clog;
using std::cerr;
class List {
private:
struct node{
node* n_next;
node* n_prev;
... |
Let's say I have a square matrix of size (n*m) x (n*m) that is composed of n x n sub-matrices, with each submatrix being a square of size m x m.
I want to select the diagonal indices of the off-diagonal submatrices. This is the code that I have so far, but I would like to do this without the calls to itertools.permuta... |
I have written a small JavaScript function which performs an AJAX request every x seconds.
I was hoping some of you could give it a look over and give me any pointers on redundant code or bad practices.
The idea of the function is to:
Allow for polling to be initiated
Once initiated, poll once every x seconds and perf... |
Here is code that retrieves an access token from SharedPreference.
public static AuthToken getFromPreference(SharedPreferences p) {
try {
String at = p.getString(ACCESS_TOKEN_KEY, "");
String uid = p.getString(USER_ID_KEY, "");
long t = p.getLong(EXPIRES_AT_KEY, -1);
if (at.isEmpty() || u... |
I'm a newbie with Haskell and I'm trying to learn the language and its idioms while working through a small data analysis project. The first step of my analysis is to take a very long list of data, generate the set of ngrams from that list, then create a histogram from the generated set of ngrams.
This approach seems ... |
I am making a game for my computer science class. My professor's requirements are:
Write a Processing program that draws a triangle in the middle of the window.
Rotate the triangle when the left and right arrow keys are pressed using the translate and rotate methods.
When the spacebar is hit, create a torpedo that app... |
I want to store the information returned by the dis function of the dis module in a structured way, using a dict, associating the mnemonics of each code of a line to the correspondent line number.
Note: Instruction is a subclass of _Instruction, defined in the dis module as a namedtuple.
Output:
disassembled_dict =
{
... |
I'm trying to do some basic math comparing some course groupings to completed courses. The original code shown below seems huge and maybe not pythonic?
I'm trying to write better view code then what I currently have. The reason? I want to improve and secondly, I'm checking manually for each and every course. There has ... |
I'm writing a program/tests in C# using Selenium and Chrome web driver. Everything works well, however I would like to simplify the code and make it object-oriented. I thought about extracting some parts of the code to different classes, and perhaps refactor the area of driver.FindElement... by using it only one time w... |
I have an interval array like below:
var interval = [[1], [1,3], [3,5], [5,7], [7,9], [9]];
I want to compare an input value say 1.5 with in the interval, and create an array drawData = [0,1,0,0,0]. To do this, i'm using a if loop like below:
if(attr.freq < interval[0]){
freqData = [0,0,0,... |
I want to make a simple wrapper for sklearn models. The idea is that the wrapper automatically takes care of factors (columns of type "object") replacing them with the average value of the target, while preserving the syntax of sklearn models.
If the factor is too scarce, it is replaced by the overall average value of ... |
This code checks if string has correct format for passing to struct. Correct format needs to be [123456789'\t'First Name'\t'Last Name'\t'City]. I didn't know how to enter tabs, so I used '\t'. I use them to separate different word blocks so e.g. first and middle name can be read to a first name in struct.
I wrote alter... |
I have the following function and want to simplify the code to make it more readable by eliminating redundant lines:
Function AddSheet(shtName As String, Optional readOnlyFlag As Boolean = True) As Boolean 'Add new worksheet to current workbook at the end
If readOnlyFlag And IsSheet(shtName) Then
AddSheet... |
I just wrote a function that will loop through two multidimensional associative arrays and merge them together based on the key names and their values. While I'm satisfied that this function works, I have a strong feeling that it can be improved. Can I get some feedback?
<?php
function array_merge_defaults (array &$ar... |
The previous version of my function was scalar-valued and employed a WHILE loop to do the comparison, this is SLOW. This new version is tabled-valued and uses a typical tally table in place of the loop. The result is an implementation that is MUCH more efficient while being slightly easier to comprenhend (IMHO).
There ... |
This one of my first Python games in PyGame I decided to make for fun. Basically, you control a from top down perspective and shoot people in a maze.
This is the rewrite of the original code, and I'm aware that it is still probably very inefficient and has does many things frowned upon by many such as many repeated if ... |
I'm making a sliding tile puzzle using C++, and have code that exchanges the blank tile for one adjacent to it.
Using user input, the program takes the input and puts it in the function which uses a switch statement to determine which direction the user wants to switch, then preforms the switch if applicable.
I was sim... |
I'm using the MEAN stack to make a small chat app, which will soon support braided messaging. This is my first Angular app so I am not sure how I'm doing on the front end portion in terms of keeping it neat and organized appropriately (might be too monolithic). I have not used any directives, and my HTML feels like it ... |
I have tried to come up with a solution to the longest increasing subsequence problem.Can this solution be optimized further?
Example 1:
Input: {5,4,3,7,8,9,11}
Output: 3, 7, 8, 9, 11
Example 2:
Input: {1,2,1,2,1}
Output: 1, 2 (the latest one)
Implementation:
public class LongestIncreasingSubsequence {
pu... |
I've recently started learning how to code in Python, and have even more recently learned the basics of object-oriented programming. Feeling inspired, I started on a program that would generate random cards. I'm really excited to have completed a project like this for the first time!
I had a problem of duplicates, whi... |
Here's my implementation to factorize a positive integer:
def is_prime(n):
if n == 1:
return False
if n % 2 == 0:
return False
i = 3
while i * i <= n:
if n % i == 0:
return False
i += 2
return True
# @timeit
def prime_factors(n):
prime_factor_list = ... |
I've been trying to implement the basic search algorithms: Sequential search for ordered and unordered arrays and the binary search algorithms, as part of a package.
So, this is the implementation:
"""
`seqsearch{T}(x::AbstractArray{T}, item::T)` ↦ found::Bool
Searches for an item using the **Sequential Search** approa... |
Here's the code
max="$1"
date
echo "url: $2
rate: $max calls / second"
START=$(date +%s);
get () {
curl -s -v "$1" 2>&1 | tr '\r\n' '\\n' | awk -v date="$(date +'%r')" '{print $0"\n-----", date}' >> /tmp/perf-test.log
}
while true
do
echo $(($(date +%s) - START)) | awk '{print int($1/60)":"int($1%60)}'
sleep 1
... |
I'm really new to programming, currently following several tutorials and guidelines.
After a couple of days of studying, I've learnt the basics of Java and conditionals and took on my first program. It was written all out of my head.
The program is a sort of gambling machine. Each turn, the player has to guess a number... |
I have written a simple Euler solver for the 1D shock tube problem. Eventually, I plan to extend this code to solve the full 3D compressible Navier-Stokes equations. Therefore, I want to start with good programming practices as it will be more difficult to modify the code further down the road. The idea is to find good... |
I've written the following helper class to help serializing objects to and from Json.
I would appreciate some feed back on the style of the class.
using System;
using System.IO;
using Newtonsoft.Json;
namespace Helpers
{
public static class Json
{
public static void SaveContractToJSON<T>(T contract, st... |
I had read the question: Bush Wanderer - code intended for teaching and wanted to play with PowerShell. Including the rules of the game from that same question.
Bush Wanderer
Task 1
Create a 5x5 grid of hashes(#) where the player is an x on the
board
Prompt the player to move in either N, E, S or W direction and the... |
Background
I’ve started putting all my configuration files (which include many shell files) under version control. In the Git repository, I’ve configured a pre-commit hook that runs the checkbashisms utility from Debian’s devscripts package on each sh file in the repository as a simple sanity check to ensure that I do... |
A project I'm working on often has lists within lists within lists etc. The original author often uses complicated linq expressions, but when adapting them I mostly get hopelessly bogged down and resort to foreach's which makes me feel like a lesser being (joke). With an expression such as the following, what would t... |
My program's Journal consists of unique Pages identified by their Day. Within those pages are a collection of Entry (wrapped in an interface of their own, Entries).
Users will be directly interacting with unique Pages supplied by the Journal upon passed an instance of Day.
Within those Page he/she could opt to change t... |
I'm trying to make my QuickSort faster than it is and I have got no more ideas about how to make it more efficient for all types of arrays but mostly very big arrays. It uses random to create the Pivot and it uses InsertionSort when the array is less than 15 elements. What do you think guys?
I appreciate for any help h... |
A low-level jet is a local wind speed maximum near the surface. Baas (2009) defined a low-level jet as follows:
the lowest maximum of the wind speed profile in the lowest 500 m of the atmosphere that is at least both 2 m/s and 25% faster than the next minimum above (...) A minimum is neglected if the wind speed above... |
First of all I am a newbie in Go. I wrote a CRUD REST API that consists of handlers, a database layer and so on, and it contains a lot of code duplication. I see some patterns here, and I know how to reuse code in some other languages like JS or Java using generics or dynamic types.
What are my options in Go? Note that... |
A while back I had opened this topic: Tic Tac Toe - Stage 1: console PvP
I had to put that mini-project on hold due to exams, but I've started working on it again a couple of days ago. Now it's possible to play vs. an AI, or to let two AIs play against each other. The choices can be made in a menu.
I've studied in the... |
I've designed a class ObjectPicker that can be given objects and weights. Objects can be picked randomly out of the ObjectPicker, with heavier weighted objects having a higher chance of being selected.
The pick() method is designed to be recursive and provide \$O(\log n)\$ speed. What I'm not sure about is the defaulti... |
Background:
Recently, I've been working through Coroutining Folds with Hyperfunctions. Don't bail out now if the whole thing makes little sense - it's just the motivation for the existence of my code, not what I actually want reviewed.
I followed a rather typical approach of starting with the data structures and types ... |
For a project I had to do a memory management problem without creating any custom classes or templates using the provided pool array and poolSize.
I implemented all functions and created two extra, SizeConversion and GetSize. My main question is this: is there a better way to implement this and is the code that I have... |
I have the following code in a Symfony site that validates a user's credentials and logs them in via the Session class:
/**
* Validates an Affiliate
*/
public function validateUser($username, $password, $session, $securityContext)
{
$repo = $this->em->getRepository('JCMainBundle:Affiliate');
$user = $repo->f... |
A TreeView on the left which just displays a list of files saved by the application. A DataGridViewon the right to display data from a file clicked in the TreeView, or to type directly into to create a new file. Files in the application are just Dictionary<string,string> objects written to disk with a BinaryFormatter.
... |
This problem is using dynamic libraries so that additional calculator functions can be added by dropping a library into a specific directory.
What I'd like to get out of this code review is:
What do I still need to do to make this more C++ and less C?
Is the object oriented nature of the code good, or am I missing som... |
I would really like to hear out some suggestions as well as general response to the code I've written for 4 players snake game. It's my first time using pygame module, as well as trying to design a simple game, in general. I've encountered few bugs which I've managed to fix, but I would like to improve my code and refa... |
I am practicing my coding on leetcode, and my submission, although correct for small cases, is timing out for large ones. Could you please let me know how to improve my code?
The question is as follows (https://leetcode.com/problems/longest-increasing-path-in-a-matrix/):
Given an integer matrix, find the length of the ... |
I have a slice of strings, and within each string contains multiple key=value formatted messages. I want to pull all the keys out of the strings so I can collect them to use as the header for a CSV file. I do not know all potential key fields, so I have to use regular expression matching to find them.
Here is my code.
... |
I am developing a poker application using C#. It is almost done, and I'm looking for improvements. One of the things I wonder is whether I should change my method that checks if the player has a flush. It's quite big compared to the others but it works just fine, however, something can be improved. Maybe put some of th... |
I have a method on my user model to calculate the user's age and return a human readable string. My user's can be between 1 month old and above so the returned string is different depending on if the person is "2 months old" or "1 year old" or "2 years and 3 months old".
I have reviewed a few SO posts to come to this ... |
I need to find which percentile of a group of numbers is over a threshold value. Is there a way that this can be speed up? My implementation is much too slow for the intended application. In case this changes anything, I am running my program using mpirun -np 100 python program.py. I cannot use numba, as the rest of th... |
I am trying to implement a singleton CacheDependencyManager, by combining this CacheDependencyManager from Steve Greatrex with a singleton pattern from Jon Skeet (example 6).
I'd really appreciate any feedback on it's correctness and / or suggestions for improvement.
ExplicitCacheDependency
public class ExplicitCach... |
I'm trying to improve my Angular skills by writing some basic applications that use a particular feature. The following application uses the UI Bootstrap modal to add users to a list, or remove them again.
Any feedback on any part of the code is very much appreciated, but I have some specific concerns around the way d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.