instruction
stringlengths
71
71.9k
I'm a computer science student who's just starting out with algorithms and their implementation. I wrote this code for a dynamically morphing square. I was wondering if I could get a review on it. I apologize if the comments are excessive, this is how I submitted on it at school. import time #imported the time module...
The following code works, but is it a good idea to call another method in a setter? public TypeSignalDTO SelectedTypeSignal { get { return _selectedTypeSignal; } set { _selectedTypeSignal = value; RaisePropertyChanged(() => SelectedTypeSignal); UpdateExtremitiesLosses(); //This reall...
When I am scraping from a web page I need a way to open and read it. Previously, I used two functions, one for requests and one for Selenium def read_page_w_requests(url): try: headers = {'User-agent': 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) \ Gecko/2008071615 Fedora/3.0.1-1...
I've started writing a fully functional Database program in C# that allows a user to access a HR system (with more systems planned in the future). I have come over to C# from Java around two weeks ago, whilst I understood MVC in Java I have been recommended to use MVVC in C#, something I am struggling to understand. Cu...
public class SimpleRandomCount extends RandomCount { /** * Generate an array containing elements in a random order * * @param size the size of the array to be generated */ public SimpleRandomCount(int size) { super(size); } /** * Randomise the array */ protected void randomise() { int[] copy = new int[array().le...
I've been learning Scala and I'd love to get your feedback in order to improve. As an exercise I made a simple framework for creating command-line user interfaces. Gist package com.ronyhe import java.util.Scanner import scala.collection.Set /** A framework for creating command-line user interfaces */ package object ...
I have written code to solve the prime generator problem. I am given an input which contains in the first line the number of test cases, and for each test case, I am given a range and I have to print the list of prime numbers in that range. However, it doesn't pass and says that time limit has exceeded. I tried optimiz...
I am building an app that currently allows the users to have 3 different roles: Consumer Merchant Admin I have three tables: user (Name, email, password etc with a status=0/1) user_role (The list of roles available) user_user_role (The table joining users to user roles in a many to many relationship. Also a status c...
I'm working on a Python script to migrate a MySQL database into a PostgreSQL database with a different Schema (different table structures, different datatypes and so on). I'm a sysadmin and unfortunately I don't code very often. So I'm having some doubts about this initial programming phase. I begin with the tables t...
Earlier today I asked a question as a guest (whoops) regarding my Database program. I could not comment nor post again asking for further advice from the people that answered my question. I have worked on the advice given to me in that answer which can be seen here; Database Connection Program With HR Functionality I a...
I'm working through Coffeescript implementing simple algorithms (started with Prim's as reviewed in this previous post) and wrote out Kruskal's algorithm as below, with a few helper functions. I'd appreciate any and all feedback, especially on making this script more idiomatic. # # graph information # nodesDir = 0 :...
I have implemented a thread safe inventory system. The Product is bound to a location in a warehouse. I have a Product class and a Location class. In the Product class constructor, you will pass the Location. Further, I have an Inventory class which will read from input file to build the inventory in a ConcurrentHashMa...
I thought I would give this months community challenge a try. This is my first time using Python. It does take quite a while to run and it's not very colourful but it works. from PIL import Image, ImageDraw img = Image.new("RGB", (2400, 2400), "white") draw = ImageDraw.Draw(img) max_count = 200 width = img.size[0] he...
I'm working with the Perforce command line client. I want to check for the case when a user tries to unshelve an unsubmitted changelist that has a valid changelist number, but...
I had this homework assignment: Create on the desktop a folder with your name. Copy from your account XYZ@xyz.com two files, "plik1.pdp" and "plik2.pdb". Combine them to make a new file, "plik3.pdb", but they have to be in special order. The second file should be first, and then the first one. Write down from the conn...
Disclaimer: This is live, production code for my hobby project: LSML (GitHub). Due to the size of the code I'm unable to include everything in this review. The application is a tool for configuring loadouts for an online mech game. Brief summary of the problem domain A mech has 8 components: Head, Lt/Rt/C Torso, Lt/Rt ...
To preface this post a little bit, I'll explain a little bit of the "backstory" here. The Stack Exchange site, Gaming.SE, also known as Arqade, often has a large influx of bad questions about the popular video game, Minecraft. Many of these questions are either easy to find on a search engine, horribly unclear, have be...
This program runs the game tic-tac-toe within the console. The players, X and O, take turns placing their character onto the 3x3 grid. When a player successfully makes 3 in a row, either vertically, horizontally, or diagonally, they win. If no winner is decided upon all squares being filled, it is a stalemate. I'm wond...
I am designing two methods to be used in a Java implementation of Yahtzee. For those not familiar with the game: Players take turns rolling dice and acquire points based on the face up values of a roll. 5 6-sided dice are rolled per turn. There are 13 categories that determine a score, which are listed here. H...
Code Review is running rampant with an infection. A zombie infection. Everywhere posts are becoming rapidly mutated into slobbering, green freaks of nature. But the citizens of Code Review are not running. No; they are fighting! These CRitters are shooting the zombies left and right to keep Code Review a safe and heal...
Is this the most robust and fastest way for finding the min and max out of an array without using STL functions? How can I improve it? #include <stdio.h> #include <stdlib.h> int main(int argc, char const *argv[]) { system("clear"); int c=9,n[10],max,min,i; while (c>=0) { n[c]=random()%100; printf("%d\n",n[c]); c--;}c=1...
I'm trying to create an alarm function with Python3. The below code does work but it doesn't seem like this is the most optimal way of achieving something like this. Is there a more pythonic way? #!/usr/local/bin/python3 import os import time def alarm(): os.system('amixer -D pulse sset Master 30%') # >> Set ...
Push a button and an LED lights up1 and sends a signal to another computer that plays a song. First project on the Raspberry pi, really simple but definitely fun and educational to implement. Also, second time using python and sockets so I'd especially appreciate input on anything I do inefficiently.2 Mostly feedback ...
I needed a node app that: reads a list in text file format from URL parses the rows on the list. (fields: id, name, longitude, latitude) finds names of the people who live maximum 100 kms away from a set location. sorts the list by user id Could you take a look and let me know what I could have done better here? T...
I am a beginner and I wanted to make programs that would help me while I learnt Java. I made a program to help me in my assignments. Any suggetions? Main method public class MirrorFormula { public static void main(String[] args) { Scanner keyboardInput = new Scanner(System.in); double u =0; dou...
I have been experimenting around with generating all the n-combinations of an array. This code quickly generates all \$\text{k-combinations}\$ of a given array. I am testing my own implementation because of some restrictions in coding competitions (also, knowing the basics never hurts). """ Generates 3-combinations of ...
This question is a follow-up of a previous question of mine: Genetic Drift Simulator. Following the advice given in the last question, and some more general improvements, the code has been slimmed down a bit. The major one was implementing Underscore.js, which slimmed down a few of the loops into functions. The config ...
I'm wondering whether anybody would be willing to review this code for a game I'm working on with my friends. I feel quite confident with Python but am wondering whether there are some places that it could be made more efficient or errors I haven't spotted. # Copyright 2015 Wet Ferret Studios # Initialize Player Stats...
I created a little wrapper for one of my JavaScript libraries to enable Angular functionality. Are there any pitfalls I should be wary of with my code? angular.module("signalR.eventAggregator", []) .run([ "$rootScope", function($rootScope) { function createScope(scope) { scope.$on('$dest...
I've got the following code. I want to loop through my dataset (which is a matrix) in steps of let's say 50.000 and perform biglm on it. lengthdata <- 100340 stepsize <- 50000 for (i in seq(1, lengthdata, stepsize)){ if(i+stepsize > lengthdata){ ## call function (i, lengthdata) print(paste(i, " - ", lengt...
I've build simple application that allows me to generate all numbers that have desired length and start with prefix. For example if I specify 12 as prefix and set desired length to 4 it will generate numbers from 1200 to 1299. I'm storing all generated numbers in List<int> then using shuffe method from Jon's answer I'm...
I'm trying to solve this challenge on CodeEval. Quoting: For example, you can put pieces together and get the original text: evil pl vil pla il plan The answer is ‘evil plan’. Your task is to print out the original text. Due to repetitions in the text, you will sometimes get identical pieces. Your program should accep...
Routine to merge two linked lists together and return a new merged list. One optimization I can think of is passing by reference instead of value. Any other suggestions ? Is there a shorthand to make lines 4 and 5 single/shorter? template<class t> Linkedlist<t> merge(Linkedlist<t> firstList, Linkedlist<t> secondList) {...
I tried to implement following class which should handle connecting to a server, as well as sending and receiving data. Your feedback is welcome. Please note I am beginner in .NET and don't give too advanced feedback. I tested it and it seems to work. So in case you see some major problems please let me know, otherwise...
This is code I'm writing for an android game where I want to be able to randomly generate small planet sprites. It seems like the best way to do this is to have a set of small PNG textures that can be layered onto each other. I found code for recolouring a drawable programmatically here that was very helpful. The idea ...
The purpose of the below code is to return different types of job objects based on an argument named "jobType." The original code for the below methods was implemented as a switch statement. I refactored the code removing the switch statement, and in place creating different classes representing different types of job...
I had a job interview take home test where I was asked a series of questions on object inheritance. In addition to answering the questions, I created the following application to demonstrate inheritance among different objects. The first piece of code are different shape classes. Some inherit from an IShape interface. ...
I maintain an application that has a method in a class for saving uploaded files to filesystem and I want to run asynchronously as it saves multiple files in a single request. I don't know if it's best to use Task.FromResult or Task.Run, but I've modifed the code to use Task.FromResult. public class AttachmentProcessor...
Here is my backpack system. Please critique and give me advice on the best practices. // #include <iostream> #include <string> using namespace std; void backpack() { string item1 = "item 1"; string item2 = "item 2"; string item3 = "item 3"; string item4 = "item 4"; string item5 = "item 5"; cout << item1; cout <<...
For an assignment I have to make a HashTable using double hashing, but for the hashing part I am not allowed to use Object#hashCode(), so I have to write my own. So far I have the following code and I am looking for feedback if I am on the right track or if I should go for a different approach (see hash and hash2 meth...
My code accesses an FTP server, downloads a .zip file, pushes the file contents as .gz to an AWS S3 bucket. import boto3 import ftplib import gzip import io import zipfile def _move_to_s3(fname): host = 'some_host' user = 'some_user' passwd = 'some_password' tmp_dir = '/tmp/' tmp_fname = fname.spl...
My input consists of a list of lists (not necessary of the same length), like [ ['a', 'b', 'c', 'd', 'b'], ['a', 'd', 'e', 'b'], ['f', 'a', 'g', 'e', 'b', 'h'] ] and I would like to have a matrix / dictionary that contains the co-occurences. The keys of the dictionary are the elements of the original m...
I'm working on class Striped_polyline which represents a closed poly-line filled with equidistant horizontal lines1: stripedpoly.cpp: #include <iostream> #include <vector> #include <algorithm> #include "Graph.h" #include "Simple_window.h" #include "stripedpoly.h" int main(){ Point tl(x_max()/2,0); int width =...
I've been working on Bill of Materials mini schema for a while. At first I had single Part table where I've referenced itself. I was told it would be better to have separate table because we'd need to have info like quantity and that quantity is not part of Part itself. Here's the script... CREATE TABLE Part ( ID I...
I recently was given a task to capitalize the first character of a string provided the string does not begin with a non-alphabet. Below are the requirements and my implementation. Just want to know if there is a more efficient way to implement this. Requirements Please implement this method to capitalize all first let...
I have a functional script that converts polar coordinates to Cartesian coordinates and then matches a value in a separate array to the coordinates. It works well, but I find that it takes a long time to run due to the length of the matrices being processed. Each file has four columns and 2,880,000 rows which means tha...
I used gradle-js-plugin to lint and minify my JavaScript, and wrote some tasks to automate uploading the scripts via FTP. Any feedback is welcome, but specifically I am concerned that: The tasks I wrote myself like viewJshintResults are all imperative and not declarative The section after the /********/ feels like sho...
I read many comments on this question that one really shouldn't use local classes for functionality like which my code provides, but I couldn't really put things into perspective and decide what better alternatives are there, if any (in terms of solving the problem locally). Some mentioned lambdas, although they also p...
Excel renders scientific notation in the engineering fashion, e.g. “4.2E-5”. That’s OK, but when you are writing a scientific paper, it’s likely that you want it to look like this: “4.2×10⁻⁵”. I have come up with a Scala script that does the job perfectly well: import java.awt.Toolkit import java.awt.datatransfer.{Stri...
I have an array called viewObject.terms. This array can contain up to 3 items, I need to iterate through this array and save the values into a data object. ie: data.term_id_1 = viewObject.terms[0].term_id data.ticker_1 = viewObject.terms[0].its_ticker This is what I first tried, but I get the error: Cannot set proper...
I have a corrupted png image. I checked and the crc32 checksum of the first chunk (size ~65k) does not match with the one I get. I am sure of this. Also, I have identified the 4 bytes that have the wrong value. I am sure of this. My question: Is there an efficient way to calculate the values of these 4 bytes, in order ...
I'm making a program that compares multi-key sequential search and Interpolation search in a sorted array by the number of array accesses for my assignment. /* * A program that compares Multi-key sequential search and Interpolation search in a sorted array by the number of array accesses. * * TODO: * - make Except...
I am trying to determine the number of factors of a large number efficiently. I have written this function but how can it be improved upon? long numOfFactors(long long n) { long i=0,num=0; for(i=1;i<=n/2;i++) { if(n%i==0) num++; } return num; }
I've spent my fair share of time criticizing other people's code on this site; but I'm finding out I'm kind of a hypocrite. Almost everything I've written so far has been some program whipped together to do some task for me. I have little experience actually starting out writing maintainable code. Then today I decided ...
This is for a single producer and single consumer wait free ring buffer. The writes need to be wait free for sure. It pre-allocates messages slots and uses a claim strategy to capture a buffer for write or read. For writes, it uses a ping pong strategy if the buffer is full which means if it find a read happening in th...
I was bored, and looking to do something that involved anonymous functions, and it was suggested by @Quill, that I create a summation function. I decided to also include a product function as well to top the whole thing off. For those who don't know, a summation is usually defined like this: $$\sum_{n=a}^{b}f(n)$$ An...
I'm working on an XNA project that loads several resources that are packed into a single file. XNA can take a WAV file stream and turn that into a SoundEffect (seen below in "case ".wav""). Since WAV files are large, I want to enable MP3 audio as one of the resources, so I found MP3Sharp, a cross-platform library that...
I recently took a test on HackerRank, and submitted my answer for the following question. I passed all the test cases but company told me that the answer is not efficient, and they are not moving forward with my candidacy. I don't have a screenshot of the question, so I will explain as much as possible. Question: We ha...
I have the following code to get the prime numbers between a range of numbers. Is this the best and fastest method? int[] numberCollection = Enumerable.Range(startNum,Count).ToArray<int>(); string primeNumbers = string.Join(",", from number in numberCollection where (IsPrime(numb...
I'm building a Markov text poetry generator. The main method, which is attached below, performs a depth-first search through the Markov chain, which is implemented as a NetworkX digraph of Word objects, which have methods for determining whether e.g. a Word rhymes with another Word instance. At each level of the searc...
I need to handle a resizable WPF ScrollViewer that scrolls vertically and stretches horizontally and contains stretched wrappable TextBoxes. I have the following XAML WPF layout (the smallest example I have managed to produce): <Window x:Class="ESiftClient.TestWindow1" xmlns="http://schemas.microsoft.com/winfx/...
I think my code is sloppy can anyone give me advice to do it better? This is a page pagination that get rows from mysql db and calculate the number of pages. <div class="row"> <div class="twelve columns tac"> <?php //Check for the current page and select one of the two versions of "back" link. ...
I have a text file composed of several subsequent tables. I need to get certain values from certain tables and save them in an output file. Every table has a header which contains a string that can be used to find specific tables. The size of these text files can vary from tenths of MB to some GB. I have written the fo...
The core of this question is removing a Static Class smell from my Web-Api/MVC solution. It presently works but feels kind of dirty. Present Solution Standard solution with 6 projects: MVC Api Api.Client - wrapped client to make in-code calls Api.Model - Dto's, Request models, etc. Domain - Entity layer, services, cl...
I have a function that formats a number (even a float) to a German decimal format. I got this function from here https://stackoverflow.com/questions/149055/how-can-i-format-numbers-as-money-in-javascript and it works. But every time I want to format a number that I stored in a variable I have to add .format(2, 3, '.',...
NOTE: Added a follow-up question with the reviewed code I am trying to get back to basics with C, so I am doing some data structures in it. The following is my implementation of a Single Linked List (The code is on github with tests). LinkedList.h /* * File: LinkedList.h * Author: antoniocs * * Created on 26 d...
I wrote a small JavaScript library for material design toasts (notifications). Here's the GitHub repo. I'd like to know what my mistakes are and how I can correct them. The code works correctly and was linted with jshint, but I'd like to know more about the code's level of quality. I'm interested in notes on readabilit...
/* * Power set is just set of all subsets for given set. * It includes all subsets (with empty set). * It's well-known that there are 2N elements in this set, where N is count of elements in original set. * To build power set, following thing can be used: * Create a loop, which iterates all integers from 0 till ...
Problem 62 of Project Euler goes The cube, 41063625 (3453), can be permuted to produce two other cubes: 56623104 (3843) and 66430125 (4053). In fact, 41063625 is the smallest cube which has exactly three permutations of its digits which are also cube. Find the smallest cube for which exactly five permutations of i...
Here is the Euler problem referenced, it says: The n\$^{th}\$ term of the sequence of triangle numbers is given by, t\$_n\$ = ½n(n+1); so the first ten triangle numbers are: 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ... By converting each letter in a word to a number corresponding to its alphabetical position and addin...
I've recently finished a prototype for a little Raspberry Pi website. The main page of the site displays current users found in the room (through bluetooth). I wanted this list updated regularly from data in a MySQL table, so no refresh is needed. When someone walks into or out of the room, the webpage shows almost ins...
I am getting two different lists of members, then if certain conditions meet, I add more members to the list before converting into an array. Is there any way this could be improve? I guess we can use Linq and cast but I am not advanced in either of the skills I mentioned. List<Member> Members = new List<Member>();...
I have this as part of a project to normalize DateTime values to more readable strings, localized to the relative time in the past that they happened. It allows you to make several customizations. If you don't want a time to show up, specify "" for the timeFormat, etc. You can change the reference DateTime so that you ...
A rags-to-riches of A method to capitalize the first letter of all words in a String. To recap the requirements: Please implement this method to capitalize all first letters of the words in the given String. All other symbols shall remain intact. If a word starts not with a letter, it shall remain intact too. Assume t...
I've been wanting to try out F# for some real world programming so I decided to try rewriting a program that is being used at work. It can be reduced to a few steps: Get report templates. In this step I query a DB and get some templates for reports Update data that the reports are working on. In this step I query some...
The following ingests a preexisting SqlCommand and returns the values. A couple caveats right now. 1 ) Type properties must be named identical to the SQL column 2) properties must be given a custom [SQLColumn] attribute. The attribute contains a string which I plan to use later for variation in property names while ke...
I'm learning from "Jumping into C++" by Alex Allain (sample chapter and TOC) and solved the first problem in Chapter 26 "Inheritance and Polymorphism". I'm especially concerned about my use of dynamic_cast, as that isn't covered yet and I suspect there's a better way. Implement a sort function that takes a vector of p...
Write a program that lets a user play "Rock, Paper, Scissors" against the computer. The program should ask the user to choose one of the three choices, and then the computer randomly picks one (without knowing what the user has chosen). For this problem, the user should be asked to enter an integer: 0 for rock...
I'm working with a legacy program that does a bunch of markup manipulation, some of it higher-level and specific to the proprietary markup, some of it lower level string stuff. I rewrote and documented the customized low level stuff (and used string.h stuff where applicable). I'm not not usually a C-coder, but I'm tryi...
I'm writing a method to insert objects into a MySQL database and while everything runs fine I feel my code is bulky and inefficient. What steps would you take to make this code more pleasant to look at and more efficient? public void addAuthorization(Authorization authorization) { try { // Builds the query...
For one place that I interviewed at (for a Python developer position) I worked with one of the devs on two Project Euler problems, one being problem 79. We talked through different approaches and came up with solutions together, but we coded separately. He seemed impressed that we were able to get through two problems....
In an attempt to get deeper down into Scala, I decided to make a BST using as many interesting concepts as possible in order to explore everything Scala has to offer. Taking inspiration from this question/accepted answer, I wrote: package bst object BST { def apply[T <% Ordered[T]]() : BST[T] = new EmptyBST[T]() } ...
I am trying to model person in OOPS using immutability. I have created an object bond with age as 25. To change the age I have created a new object and returned it. Is there any better way to change the age instead of passing all the values of object again? Is this a correct way to do? import java.io.*; import java.uti...
For one place that I interviewed at (for a Python developer position) I worked with one of the devs on two Project Euler problems, one being problem 85. We talked through different approaches and came up with solutions together, but we coded separately. He seemed impressed that we were able to get through two problems....
Here is a simple program that I created to print a file by breaking it after a fixed number of columns. I feel it can be optimized but not sure how. Any feedback is great. #This is a simple program that takes a file and the limits the columns length to #the number passed in as second argument if ($#ARGV < 1) { print...
I wish to use this sample to make my code more readable. Could you share with me your ideas on method naming, variable naming, if-statements etc. It would be great if you have any URLs. private boolean areEngineersHappy (List<Engineer> engineers) { int notHappyEngineers = 0; int happyEngineers = 0; for (Engineer ...
I wrote this code for this code golfing challenge on the CGPP sister site. It wouldn't really be a competitive entry because I had to write all the functions from scratch. (I didn't even golf anything in my code.) I'm looking for ways to improve performance all-around. Please see the above golfing challenge for a deta...
I'm trying to simplify this function, as there can be multiple type of data objects and for each type there is also a male and a female version. The number and name of the elements in the objects are always identical. As you see, most of the code is repeating... function calculate(type, j, value, s) { for (var i = ...
(EDIT: here is the follow up question) I have written a small program in C to calculate the smallest number where any of its permutations or the number itself is divisible by a set of given numbers. It works great when the number is only 4-5 digits but then it becomes very slow. Do you have any suggestions on optimizat...
I'm writing a theoretical MVC application to aid in learning more about ASP Identity 2. In real terms I'm new to ASP Identity as a whole but thought I'd jump in in this release as it's the default in new projects and everything I read about it seems to mostly suit my needs. There is one issue that I need to be able...
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms. I...
I have created an Arduino sketch that I am using to send and receive data via serial. It works pretty well and doesn't seem go wrong as long as the correct formats are received. Is there anything I could do to improve this/shrink it to clear up some code smells? String dataString; void setup() { Serial.begin(9600); ...
Please review my program for the Game of 31. The game of 31 was a favourite of con artists who rode the railroads in days of yore. The game is played with a deck of 24 cards: four labelled each of 1, 2, 3, 4, 5, 6. The cards in the deck are visible to both players, who alternately withdraw one card from the deck a...
This is one result of my work on Project Euler to learn Java. I'm interested in how well this conforms to best practices as well as any recommendations on efficiency. (I'm pretty sure this code is a lot more efficient than it is readable, but it's not deliberately obfuscated, I swear! :) ) import java.util.ArrayList;...
My view object: { description: "2tik 2tags" id: 100 portfolio: "TSLA" term_id_1: 260751 term_id_2: 285493 term_id_3: null ticker_1: "GOOG" ticker_2: "TSLA" ticker_3: "" timespan: "ld" top: "" } I need to grab the term_ids and stick them into a new array, but only if they are...
The C++ code below simulates the timecourse of the membrane potential (V) of a population of 128 leaky integrate-and-fire neurons using the Euler method for numerical integration. It produces data for three data points in Figure 1 of this paper. (Well, it produces 400 ms worth of data for three data points.) I have an...
I recently submitted the code for this for an 2 hour interview but I was rejected. The app shows book information with a image, title, and author. Each entry has a title but some entries have no image and/or author. Here is a screenshot: I was given this feedback: There is a lack of proficiency from what we would ex...
In my web app, I have a view where users can search in receipts and drafts. I've implemented this ability in search method at my view model, but I'm not sure if this is the best place to put it. So I'll let you take a look at it. public class ProductCardSearchViewModel { public IEnumerable<ProductCardRowViewModel> ...
I am trying to check if a list has any consecutive repeating elements and then reorder it such that the repeats are avoided. If that is impossible, then return False. For example: checkRepeat([1,2]) Out[61]: [1, 2] checkRepeat([1,2,2]) Out[62]: [2, 1, 2] checkRepeat([1,2,2,1,1]) Out[63]: [1, 2, 1, 2, 1] checkRepeat(...
I have an Engineer which doesn't look very good. How can I make him better organized? What about good practices? Interface: public interface Engineer { String HOMELESS = "homeless"; String ENGINEER = "engineer"; String SOFTWARE_ENGINEER = "softwareEngineer"; String TEST_ENGINEER = "testEngineer"; S...