instruction
stringlengths
71
71.9k
I have created UrlRouter. It should call appropriate controllers methods with extracted values as a parameters. It works fine, but my boss told me that I should make it better. Could you give me some advice on how to improve this class, please? public class UrlRouter { private final static String pageRegex = "/pa...
I have implemented a LinkedList with the ability to add, get elements from a particular position and ability to show all the elements in the array in to the console (main purpose to implement this was to ensure that all the elements are being populated in the LinkedList correctly). I would highly appreciate comments ba...
Now I have incorporated all the suggestions made by bowmore in the previous and initial iteration of this collection. Also, I have added the Boyer-Moore algorithms, both conventional and naïve. As of now, the collection includes: Knuth-Morris-Pratt algorithm, Finite automaton matcher, Rabin-Karp algorithm, Z algorithm...
Now I've grasped the very basics of Pygame, I thought it'd be useful to make a few classes that I could use later on if I try make a simple RPG style game. I've done this to handle the coordinates for the player movement (and possibly for other things too), and tried to do it in a way where you wouldn't get the floatin...
I'm using Swift 2.1 and ReactiveCocoa 4.0.4 alpha 1. I'm combining multiple signals to enable a button based on if they have valid inputs. The following code works correctly, but I'm wondering if there is a more elegant and efficient way of accomplishing this with the ReactiveCocoa APIs, as well as if this is the prope...
Input - Standard input - HH:MM:SS[AM|PM] format. Examples: 12:00:00AM 12:00:00PM 01:00:10AM 01:00:10PM The program reads one line per instance. Output - military format (24 hour format): 00:00:00 12:00:00 01:00:10 13:00:10 using System; class Solution { static void Main(String[] args) { var tim...
Problem statement for finding given substring: Given a random string S and another string T with unique elements, find the minimum consecutive sub-string of S such that it contains all the elements in T. Example: S='adobecodebanc' T='abc' answer='banc' How could I have improved the code from construction of code...
I had a collection that I'm filtering in an EmberJS component. It's filtering by country, fulfilled, and mood. Each filter also has an all value which disables that filter. export default Ember.Component.extend({ markersByMood: function(){ if(this.get('selectedMood') === 'all'){ return this.get('markers'); ...
I've written a script in Powershell for zipping files into new folders. This script performs the following steps: Check whether each subfolder contains non-zip files which are older than 31 days If so, create a new folder within, labelled with the date Move the old files to the newly-created folder Create a zipped cop...
Here's all the functions in C that does all the arithmetic operators without using arithmetic operators themselves, mostly using bitwise operators. Recursive functions and comparison operators are also allowed. int add ( int augend, int addend ) { return addend ? add ( augend ^ addend, ( augend & addend ) << 1 ) :...
For starters, I'm a student taking AP Computer Science this year, loving it so far. Lots of fun, especially problems like this. I think I'm going to make it a regular practice to post some of my exercises and projects here for people to review, so I can get some feedback from programmers other than my teacher on differ...
I am using a ultrasonic sensor to detect motion by looking at the variance of the sensor readings, however my algorithm is very prone to give false positives thus erroneously rising a motion event. Algorithm Background What I do is send a ping 20 times a second and wait for a pulse to come back using the input capture ...
I wrote this class to handle login sessions for a framework I'm writing for educational purposes. My major areas of concern: Style I know my style is a little contrary to most coding conventions. Is it difficult to read? The nonce If the login is valid, the session checker punts a random hash to a cookie to compare...
I'm curious as to peoples thoughts on this small library I have made. I noticed there are no functions in the C standard library to accomplish this task. I have tried to make the code machine independent. If anyone has access to machines where short != 2 byte, int != 4 byte, long != 8 byte or where bytes themselves ar...
I am currently working on a Python 3.4.3 project which includes solving the Traveling Salesman Problem using different algorithms. I have just written a brute force algorithm and I would love some feedback. Now I understand that the number of operations increases by the factorial of the route length so brute forcing is...
This is a simple application that will eventually manage certain files for video games. For now, I'm only posting code that handles fetching, adding, and viewing games. I'm trying to keep things incredibly simple and pure while learning WPF and MVVM, so my goal is to avoid frameworks. Please note that I'm not too conce...
I am trying to draw thousands of lines between nodes, and the line positions are constantly changing (i.e. consider a node being dragged while connected to thousands of children by these lines). Below is a simplified example of an issue I have. When drawing several thousands of lines in WebGL or Canvas, the rendering t...
I've written a k-d tree implementation in C++11 in order to learn and practice the finer points of the language. I'd appreciate feedback on the code, e.g. is it good C++ code, missing functionality, could it be optimized, etc? I have written unit test (I can post separately), if anyone suspects bugs, I'm willing to pos...
While searching for a method in HashSet which allows me to actually find an object in \$O(1)\$ (not just Contains, I need the reference), I came across this question on Stack Overflow and specifically the latest answer drew my attention. I reworked the answer in a more generic approach and came up with the following; ...
I have a Notification model which inherits from the ActiveRecord class. Each notification is associated with a specific type of action, which is determined by an integer field (action) whose value is between 0 and 6. A notification is also associated with a model (e.g. User or Project) whose ID is stored as the object_...
Below is the code for user recommendations using mahout. DataModel dm = new FileDataModel(new File(inputFile)); UserSimilarity sim = new LogLikelihoodSimilarity(dm); UserNeighborhood neighborhood = new NearestNUserNeighborhood(100, sim, dm); GenericUserBasedRecommender recommender = new GenericUserBasedRecommen...
I have a controller called VacationController; in this controller, I retrieve a list of vacations which will be displayed in a grid. In the grid, I have the option to create a new vacation through a popup window. Should I create a new controller for this popup, considering that the model is represented by one row of th...
A while ago, I posted about creating a user tool for forum admins that allows them to add, edit, and delete users from their desktops. This still is not complete, posting for review on tool so far I've finished with the delete_user method and also added a couple new features to it, what this code does, is take your inp...
The task was to build a knight_moves method which when called would display the simplest path from one given square to the other given square. My Solution: class Square attr_accessor :x, :y, :children, :parent def initialize(x,y, parent=nil) @x = x @y = y @children = [] @parent = parent end end d...
I am currently building a small application that allows users to create a slideshow, each slideshow consisting of slides that are either videos or images. Although this will be relatively small at this point, I want to build it using best practices and keeping in mind that this project will no doubt grow. Before I get ...
Is there any way to improve this algorithm maybe making it so faster avoid using foreach? Maybe with a recursion? The output of my algorithm is a table with 3 merged columns, each row will have its own rowspan. $matrix=array("person1"=>array("wifes"=>array("diana"=>array("born"=>1982,"last_name"=>"chapelle"),"carla"=...
I am getting a date range from form inputs - the "from" month, day, and year, and the "to" month, day, and year, and then running a report on data for within that date range. I want to first check that the dates are valid and if not display an error indicating dates are not valid, then run the report only if valid. I w...
I wrote this package for monitoring the state of a network connection in the terminal because my net connection would go down for a few minutes at a time and come back up. I think it could be used in other applications. I'm looking for any advice on how to improve or extend this package in any way possible. Package rep...
In the database, I have a table with name photographs with the following columns: id filename type size caption I want to create two classes - one is Domain Model named photo.php and the other one is a Repository class (photorepository.php). So, I started like this: photo.php: class Photo { private $id; priva...
I'm working on a project to clone a subset of requests going to our production servers to one or more non-production endpoints. I opted to do this in Nginx and Lua because at the time, I could not find a tool that fit the requirements I needed, namely, only forwarding all requests for a subset of session IDs (as oppose...
This is a follow-up to Binary trees in Rust: iterators, where Shepmaster suggested that I implement a non-consuming iterator. This was relatively straightforward. I chose to mirror the design of the consuming iterator, although the caveat that I mentioned in the previous question (which forced that design) probably doe...
There are a number of questions on this site about s-expression parsing: e.g., Calculator parsing S-expressions and Code from "Write Yourself a Scheme in 48 Hours" tutorial. However, these don't parse quasiquote, and quasiquote is amazing! So I wanted to parse quasiquote. Making the simplification that s-expressions ar...
I am currently working with an app that should load various info on a very specific zip file which contains the XML config file, using the DotNetZip library on C#, here's the code: public static void InitializeData(string configFilePath) { if (File.Exists(configFilePath)) { using...
I came across a CocoaControl ZFPlot and wanted to extend here. I ended up writing a base class (ZFPlot shown below) as well as several extensions (ZFLine, ZFScatter, ZFBar, none shown here for brevity). I'd really love feedback on everything in the code below but especially on readability, performance, and structure. I...
I wrote a class that I'm using to calculate conditional probabilities of a given distribution as well as perform naive Bayes classification. I'd like to get a code review done to tell me if there is anything that I can do to make what I wrote neater or perform better. Probability class: package edu.uba.filters; import...
This class is similar to QDoubleValidator, but it improves slightly on the editing comfort. The comments mention "comma" but it's actually the decimal point of your locale (comma for me). class DecimalValidator(QDoubleValidator): def __init__(self, *args): QDoubleValidator.__init__(self, *args) self...
My counselor in a camp I went to over the summer gave me a code challenge. To take 6 challenges (listed below) and have all of them in one program, and have the user choose which one to use. Please review all of my code. If there is anything wrong, inefficient, or if I use bad practices, let me know; I'm still new at t...
I would like to know how I can improve this chat application of mine. This has been my side-project for a while. I have made it to support on desktops, tablets and smartphones. GitHub link Online Demo (feel free to try it out) Node.js: index.js // load all node modules var express = require('express'); var app = expr...
This is a (letter, or whatever the user decides to change it to) guessing game I wrote which implements both a mechanic to randomly change the order of elements in a list, as well as limit the number of attempts you get to complete the game. There's not much else to say about it. I'm just looking for some suggestions o...
I am working on a problem to develop auto-complete functionality to practice different applications of Tries. The auto-complete function will return all the possible words in the wordlist given a prefix. I came up with the following solution which returns the result as expected. I need some help to review my code, in o...
I wrote a small script to visualize the runtimes of list algorithms. The script works by creating a list of lists with sampled lengths from 1 to max_size. Next, I map the given algorithm over each list element and replaced the list with the resulting runtime. The runtimes of each list are plotted against the length of...
I have a bunch of exact-duplicate pictures that I've acquired over the years. I'd like to create a list of all them so I can eventually delete some. My idea was simple: dump the hash and location of every image file under a path in MongoDB for later analysis. This is what I came up with: import com.david.mongodocs.Imag...
I am writing a piece of code that returns all the unique variants that a product is available in for an ecommerce app. For example, a shirt product can be available in different colors, sizes, and linen. If the available attributes are red, green, L, XL, Cotton, and Polyester, then a list of the unique variants should...
I've made a plug-in for Unity3d for iOS. The plug-in's job is to get the Pedometer data from history within a specified period of time and return that to Unity for later use. I am confident in my C# code, but Obj C part is what troubles me. I'm afraid I have some potential memory-leaks should the requests come more oft...
I did write the GitHub Auto Copy Committer. The purpose is to copy an existing public GitHub repository to in another repository - commit per commit. It's reason is not a full copy of a repository. There are way easier ways for it. The key feature is the ability to redo the original commit behaviour as the origi...
I need someone review my sharedPreference class , which better to create sharedpreference with constant name MyPREFERENCES like this , or like they I do in class SharedPreferences sharedpreferences = getSharedPreferences(MyPREFERENCES, Context.MODE_PRIVATE); Editor editor = sharedpreferences.edit(); editor.putStr...
Recently I asked this question: Generic methods for serializing and deserialzing xml files using streams However it has come to my attention that this gives me an (harmless) exception when trying to deserialize. System.IO.FileNotFoundException occurred Message="Could not load file or assembly '[Containing Assembly of...
I started learning Java 2 weeks ago, so I don't know that much. I recently made a working console quiz and I'm wondering if there is a simpler way to do it. import java.util.*; import java.io.*; class StudyBot { static int[][][] GradeValues = {{{93, 100}, {90, 92}}, {{87, 89}, {83, 86}, {80, 82}}, {{77, 79}, {73, ...
I have a ContratMercan with 2 Timestamps containing start and end dates. I have to create a new entity SeguimientoSeccion for each month between this 2 dates. I have 2 questions: There is a way to improve it? After this I will need to manipulate the List<SeguimientoSeccion> secciones to see which one matches other en...
This was brought about by this codegolf question. Problem A program is said to be pristine if it is: A working program (No errors). The program will produce errors by removing any contiguous substring of N characters, where 1 <= N < program length. My goal is to check if a given C# program's source is pristine or no...
I have a class that makes calls to a Web API (Using RestSharp), which works fine but the code is super ugly. What would be the best way to refactor it? I thought of just doing a Facade pattern so all the calls that goes to cart will be in a separate class and order will be in an order class and so on. All the methods ...
I have such cases: stock status can be in stock, undefined (there is no such field in the object) or any other text stock status is true if it is 'in stock' or undefined all others are false so this is my test object obj = one: stock: 'in stock' two: some: 'x' three: stock: 'not in ...
For fragments I have this code to create a new instance: public static FoodDetails newInstance(Food food) { FoodDetails foodDetails = new FoodDetails(); Bundle args = new Bundle(); args.putParcelable(FoodConstants.BundleConstants.FOOD_OBJECT, food); foodDetails .setArguments(args); return foodDetail...
var fruitList = []; var fruitExpired = GetFruitStatus(); var fruitName = "Mango"; var companyName = "Limited"; if(fruitExpired) { var expiredCrateId = GetExpiredCrate().ID; list.push({ expiredCrate : expiredCrateId, fruitName : name, fruitCompany : companyName }); } else { var CrateId = GetCrat...
I'm writing Selenium code in Java. And below is one of the methods. private static void getPaceNumber(WebDriver chromeDriver, String dBName, XSSFSheet paceSheet, String pubName, int i, XSSFCell cell, XSSFWorkbook workbook) throws Exception { System.out.println("DBID is " + dBName + " and fpn is " + pubName)...
I recently posted my old .NET MSSQL Wrapper to be code reviewed: .NET MSSQL Wrapper I had some good feedback and based on that, I was able to re-factor it quite a bit and ended up with the following version: http://pastebin.com/Yhd6RTeS The above wrapper library is used like this: Program.cs test console app using Syst...
So I implemented the LCS algorithm once using a 2-D matrix to store values while the other one used a python dictionary. I found the dictionary implementation was easier to implement and was a more natural and intuitive way of solving the problem. I just wanted to make sure if it's a correct way of implementing the LCS...
My goal was to write a factory that the code did not have to be edited. Thus I am registering my factory functions into a singleton factory. I am going to be using this code in Apache thrift server RPC system. I want to make the factory thread-safe. #include <string> #include <iostream> #include <stdexcept> #include <...
I've created a program for my own purposes in three different languages, Perl, Python, and Ruby. Each program will be posted in with their own tag but I will add links to them through on each post. The program itself is very simple, all it does is ask the user about three different languages which are saved into an arr...
For my project, I'm required to create three training datasets from a set of about 45000 elements (32000 after cleaning incomplete elements). Each line looks like this: 38, Private, 215646, HS-grad, 9, Divorced, Handlers-cleaners, Not-in-family, White, Male, 0, 0, 40, United-States, <=50K I'm supposed to sample them...
I've created a program for my own purposes in three different languages, Perl, Python, and Ruby. Each program will be posted in with their own tag but I will add links to them through on each post. The program itself is very simple, all it does is ask the user about three different languages which are saved into an arr...
I've written a parser with the help of some experienced Haskellers. The parser is not bad, but the same kind of parser written in PHP7 with regular expressions is much faster (takes 25% of the time that takes the Haskell one). This is a subset of the file I want to parse: lpaste link The main objective of the parser is...
I've just started writing asynchronous methods for the first time having watched some tutorials. I have a method where I run two tasks in parallel (notifySales, insertDownload): Task insertDownload = _downloadService.InsertDownloadRequestAsync(model, Request.UserAgent); if (product.NotifySalesByEmail) { Task notif...
I have some part of my code that uses reflection and there is some slowdown issue that I have to fix. After some research I found that expression tree seem to be a good candidate to fix it also it MUST work under .NET 3.5. I have less than a week of experience with expression tree and the code below was found on some b...
I have two threads, one produces images and one processes them. For the synchronization, I created a class where you can set and get images, and it always waits until an image is available or a worker thread is not busy anymore. Additionally, a call to SetFinish stops both threads, while a call to Clear clears the curr...
This is my first attempt to make a game on my own. I just want to see if anyone has any comments. Am I doing things, at least, sort of alright? Is there a better way I could deal with the input? import sys, platform, os import time, random, math class Entity(object): '''Basic entity object Has position and...
I am studying data structures and I have implemented a stack using a linked list. stack.h #ifndef STACK_H #define STACK_H #include <stdbool.h> typedef char StackElement; typedef struct stack_CDT *Stack; Stack stack_init(); void stack_destroy(Stack s); bool stack_is_empty(Stack s); void stack_push(Stack s, Sta...
I call a service which returns an array of tags. The array may be empty, and if so, it just saves the tag. Otherwise, it checks if the tag is in the array. If so, then the tag is removed, otherwise it's saved. Can this be optimized for efficiency? function processTag(total, tag, associatedTicker) { var foundFlag = ...
I tried to draw a Sierpinski triangle by shading the even number entries of the Pascal triangle. Could you please suggest improvements? public class Sierpinski { public static void main(String[] args) { int no_of_row = 50; int[][] tri = new int[no_of_row][no_of_row]; for (int i = 0; i < no_...
The last time I wrote any serious code was the 90's, so a lot has changed and I am finding I am having to relearn pretty much everything. I have leaned a lot from previous posts and this is the result. So as the title states I need a code review to help me identify where I am making mistakes by today's standards. To th...
In my program there is the following piece of code where I must delete a ' ' from the second to last index in a StringBuilder: builder.deleteCharAt(builder.length() - 2); I do not surround it with checks to either condition builder.length() >= 2 or builder.charAt(builder.length() - 2) == ' '), because I am 100% sure t...
I'm currently working myself through K&R and just read about implementing getch() and ungetch(). In K&R these functions are implemented like this: #include <stdio.h> #define BUFSIZE 100 char buf[BUFSIZE]; /* buffer for ungetch */ int bufp = 0; /* next free position in buf */ int getch(void) /* get a (p...
Description of challenge: Using names.txt (right click and 'Save Link/Target As...'), a 46K text file containing over five-thousand first names, begin by sorting it into alphabetical order. Then working out the alphabetical value for each name, multiply this value by its alphabetical position in the list to ob...
Post a cursory read of this I implemented a simple dictionary and an interface to assign, replace, look up, and redefine its terms to apply the concepts. It's simple, but I'd still like to know any way I could make this cleaner and more pythonic. def print_dict(dictionary): for key in dictionary: print("{} : {}"...
I have only dabbled in Java before (my previous experience being mostly with PHP and JavaScript) but a request come through for a small application that seemed like a good chance to get some experience. We receive two types of .csv from a third party: The first is the 'offer' file, which contains a collection of detai...
I am very fresh to python. As part of an assignment, I've written the following code to remove punctuation from a string and convert it to lowercase. import string words = "Dave, Laura, Maddy, Dave, Laura, Maddy, Dave, Laura, Dave"; translation = str.maketrans("","", string.punctuation); new = words.translate(translat...
I am trying to speed up a function to return the longest common substring. The requirements: The function takes two strings of arbitrary length (although on average they will be less than 50 chars each) If two subsequences of the same length exist it can return either Speed is the primary concern This is what I have ...
Inspired by the work Charles Duffy did in this answer and the work of Jonathan Leffler in this one and because I couldn't leave well-enough alone. I went and wrote expandTilde.sh: #!/bin/bash doExpand() { local path local -a resultPathElements for path in "$@"; do : "$path" case $path in "~+") ...
I have a program that reads a .txt file from a given directory. Each record line contains a data and I am parsing it. I think this is costly with it comes to performance but I might be wrong. Here is the method. How can I improve it to improve performance? currentLine = uploadFileReader.readLine(); while (!isBlankOrNu...
I have developed this 8-puzzle solver using A* with manhattan distance. Appreciate if you can help/guide me regarding: 1. Improving the readability and optimization of the code. 2. I am using sort to arrange the priority queue after each state exploration to find the most promising state to explore next. Any way to opt...
I wrote a wrapper for Java's ConcurrentHashMap that enables you to add a decay time to inserted values, meaning they will be automatically removed after the given time. This functionality is implemented by a cleaning thread that runs until .close() is called. I deliberately did not extend the ConcurrentHashMap because ...
I've created a caching service using OOP techniques combined with the revealing module pattern and the angular-cache library. New CacheDataClass objects are instantiated using the Factory pattern with RequestFactory. It has generic methods for get, set and reset data. It can be extended to override those methods. I wou...
I am trying to find non bouncy numbers under \$10^x\$ where \$1\le x\le 1000\$. \$123456\$ is an increasing number where every digit is greater than or equal to the previous digit (\$1223344\$ is also counted as an increasing number). Similarly a decreasing number is one where every digit is smaller than or equal to th...
I wrote a small function in powershell that works fine, however I feel its extremely hacky and I'm sure there must be a smarter way to do this. In the interests of learning, what can I do to improve on this? function WhatsMyIP { return ((Invoke-RestMethod -Uri http://ifconfig.co).split("`n") | where {$_ -match "`"ip`""...
I read three files and parse a few individual fields from each row of the XML. Using these fields, I find the dictionaries that contain the same keys (ItemK and either SensorK for sensors or PointK for points) I then append the masterkey and Sensor/Point ID to a new list. Is there any improvements i can make? from xml....
I needed to write my own lightweight GO multi-output logger for a work project and I've come up with https://github.com/asticode/go-logger. Basically the projects works like this: // Create the logger l, e := logger.NewLogger("myproject", logger.LevelDebug, "%message%") // Add a stream handler h, e := logger.NewHandle...
I have the following function, it works exactly how I need it to; however I think there is room for improvement. The script is supposed to loop through all input and text area html elements. It should only work with elements that have a name, and a value, and it should ignore "hidden". However some of the elments do no...
I'm fairly new to JQuery/JavaScript and I'm trying to refactor the following code: $('#hour').click(function() { $('#clockHours').slideToggle(); $('#clockMinutes').hide(); }); $('#minutes').click(function() { $('#clockMinutes').slideToggle(); $('#clockHours').hide(); }); //print clicked onto views $('.timeSel...
In a recent interview I was asked to solve the below problem. Problem: Given a string with variables in them, e.g. "I am a string with {{ variable }} in them" Create an output where the {{ variable}} is replaced with their actual values. So if given the input: var template = { "sentence": "The {{ object }} {{ ver...
I've written this program yesterday, and I was reminded why I dreaded C++ before turning to Java: pointers and associated terms (like destructors, initializations and copy/move constructors) are making me rather anxious about possible logical oversights every time I need to write a C++ program, however simple or comple...
I need a procedure that "centers" a string inside a string that is consecutive characters of a fixed length. For instance, ======================== Instructions ============================ or **************************** hehe ******************************** might be printed by calling PrintBetweenChars("Instruct...
is there an easier/more efficient way to join two JSON objects on a common property than this? It's a GeoJSON file (basically an array of objects), and I want to pull in a property from another JSON file (array of objects) based on a common property, similar to a SQL SELECT a.*, b.* FROM a LEFT JOIN b ON a.id = b.a_id ...
One year ago I published an F# solution of the same task and there is an old C# solution. But I think it's a simple task and require a simple solution. What do you think? using System; using System.Collections.Generic; namespace SalesTaxes { class Program { static void Main(string[] args) { ...
The following is my implementation of a command-line Tic-Tac-Toe game, written in Ruby. This was my first attempt at practicing object-oriented design principles. require 'colored' module TicTacToe class Player attr_accessor :symbol def initialize(symbol) @symbol = symbol end end class Board ...
Here's a function: func checkIfObjectsHaveCoordinates() { PFQuery(className: "Products").findObjectsInBackgroundWithBlock { (objects: [PFObject]?, error: NSError?) -> in if error == nil && objects != nil { for object in objects! { if object["Latitude"] == nil || object["L...
I have the following task: to find the largest sequence of increasing numbers in an array. I'll give you an example : 2 3 4 1 50 2 3 4 5 will return the sequence of 2 3 4 5 - that is the largest sequence of increasing numbers in the given array. Another one is : 5 -1 10 20 3 4 which will return -1 10 20. If there are t...
I am still a Python beginner and would appreciate some help with this code. I am looking through some firewall log files, more specific all lines with Deny in them. For those files I am extracting the protocol, source IP, destination IP and destination port. The output is summarized and a hit counter is added (thanks m...
I'm working on a program that corrects all punctuation spacing in a String. Examples: // "Hello ,World" -> "Hello, World" // "9 :00 A .M ." -> "9:00 A.M." // "can 't even." -> "can't even." Here's how it works: My process is to first add a space between all punctuation and then remove any unnecessary spaces. T...
Having mostly used Qt and its classes like QString, I wrote a little exercise with plain C++11. I'm looking for two kinds of input: generally improving the code and/or doing it better in an entirely different way (still standard C++11 or C++14, no Boost or anything). The code is for printing doubles with given number o...
A continuation of this queston. The task's description can also be found there. After reformatting the code and getting rid of the ArrayIndexOutOfBounds check,it now looks like this: public static List<Integer> findLongestIncreasingSequence(int[] numbersToBeProcessed) { if (numbersToBeProcessed.length == 0) {...