instruction
stringlengths
71
71.9k
I just came back to programming and decided to create a car leasing system (GitHub page here.) to teach myself about databases, gui programming and web development. And I would like some input on what I can imporve on a specific function that I just rewrote. What the function does is add a car lease to the customers n...
I want to achieve this: digPow(89, 1) should return 1 since \$8^1 + 9^2 = 89 = 89 * 1\$ digPow(92, 1) should return -1 since there is no \$k\$ such that \$9^1 + 2^2\$ equals \$92 * k\$ digPow(695, 2) should return 2 since \$6^2 + 9^3 + 5^4 = 1390 = 695 * 2\$ digPow(46288, 3) should return 51 since \$4^3 + 6^4 + 2^5 + ...
I am comparing two columns of data (~20k rows) to find the items that do not match. Actually one of my files is an export from an Oracle database, but I have not gotten to the point of working with databases in python yet. The code works as intended, but as I am new to this I am wondering if there is a more efficient ...
I have a matrix of ~4.5 million vector [4.5mil, 300] and I want to calculate the distance between a vector of length 300 against all the entries in the matrix. I got some great performance time using the answers from the following post: Efficient numpy cosine distance calculation. from scipy import spatial def cos_m...
Given a dictionary of cows and their weight: cows = {'Betsy': 9, 'Oreo': 6, 'Herman': 7, 'Florence': 2, 'Maggie': 3, 'Moo Moo': 3, 'Milkshake': 2, 'Lola': 2, 'Millie': 5, 'Henrietta': 9} I want to get a list of lists to move all cows, each nested list of cow's a total weight <= 10, hence to first two trips will have j...
This needs some optimizing without any additional variables or loops. The difficult part of the task was no additional variables subroutines/functions or loops. If that seems (near) impossible then break those rules. The output should look like: 5 X 4 X 3 X 2 X 1 = 120 Private Sub FactorialCalculation() Dim Number...
This is a basic spell checking program that I wrote earlier today. It accomplishes the tasks that I had in mind, but was curious about improving my coding style and improving efficiency of my program. Any advice is appreciated. I have read through the PEP-8 style guide and some others as background information. The har...
My background is in C, and I'm finally learning this new-fangled "Python" that all the cool kids are talking about. I want to create a list of formatted hexadecimal values like so: ['0x00','0x01','0x02','0x03' (...) '0xfe','0xff'] Please note that the leading zero's shouldn't be stripped. For example, I want 0x03, not...
I just completed the Tic Tac Toe challenge at freecodecamp. I am looking for input on how I could shorten the code. For the click events such as s1.onclick, I feel that it could have been shortened in some way, maybe using the this object. I feel as though that my detectWin function has too much code as well. Codepen ...
This code is meant to sort a list of integers using merge sort. I'm doing this to improve my style and to improve my knowledge of fundamental algorithms/data structures for an upcoming coding interview. def merge_sort(l): if len(l) == 0 or len(l) == 1: return mid = len(l) // 2 left = l[:mid] ri...
I am trying to find an efficient solution for finding overlapping of n rectangles where rectangles are stored in two separate lists. We are looking for all rectangles in listA that overlap with rectangles in listB (and vice versa). Comparing one element from the first list to second list could take immensely large amou...
I've written a Haskell function to count the number of partitions of an integer - it's basically an implementation of the same algorithm as this one, using Euler's Pentagonal Number Theorem: $$P(n) = \sum_{k=1}^n (-1)^{k+1} \left[ P\left( n - \frac{k\left(3k-1\right)}{2} \right) + P\left( n - \frac{k\left(3k+1\right)}{...
I am creating a web page in which I have 4 different numbers which show companies stats. I am using javascript to dynamically show these numbers from 0 to n (where 0 is the starting point of counter and n is the end, I have n=74, n=86, n=285, n =97). I am using javascript to start the counter from 0 to n, everything is...
Our company needs a localization/translation behavior which allows incomplete (ResX) resources. If a String isn't available in italian fall back to the next roman language, like french fall back to our invariant (in this case: german) The easiest approach was a custom CultureInfo. /// <summary> /// A <see cref="Cultu...
I have a working C# code of a TCP server that runs inside a windows service. It accepts incoming connections and starts sending/receiving data based on some complex rules. The top-level class for this server looks as follows: public async void StartListen() { var endpoint = new IPEndPoint(IPAddress.Parse(_host), _p...
I'm working on some VB.Net code to generate data sheets for giving user rights on a per folder level. I came up with this code but it's very slow and I feel like it could be improved. Public Shared Function CreateExcel(groupOwnerOf, sourceLocation, Optional groupOwner = Nothing) Dim ini As New IniFile(Directory.Ge...
I have written this recursive code to find all interleaves of two strings, where the order of strings are preserved. For example: s1="abc" s2="1" a1bc ab1c abc1 You can see that the order of s1 and s2 is preserved. // Interleave_Two_Strings.cpp : Defines the entry point for the console application. // #include "st...
At my work we're dealing with a lot of PHP files written by a third-party company and sometimes we want to "quickly look at" these files in Notepad rather than having to open up a full IDE. The problem is that these files have \n line endings which as many of you know Notepad doesn't handle correctly. Sure, there are s...
I'm on my way of understanding basic data structures and sorting algorithms through implementing them in c++. Post is followed of my implementation of Vector. I decided to weld the heap behaviour right into Vector class, although I'm not sure if it's a good solution/practice. The heapSort method is not yet implemented....
I thought I'd ask for a review to make sure I am headed in the right direction. Would really appreciate pointers to what I can fix/change or think of to help me improve my coding standards and be a better programmer. /** * Doubly Linked List data structure implemented as generic to fit multiple types. * TODO: Impleme...
import nltk req_modules = {'from nltk import punkt': 'punkt', 'from nltk.corpus import stopwords': 'stopwords', 'from nltk import pos_tag': 'averaged_perceptron_tagger', 'from nltk import ne_chunk': 'maxent_ne_chunker'} for m in req_modules: try: print("Trying:...
I wrote this if statement event listener to add and remove a class to a couple links based on changed.owl.carousel. However, I know this is not the most DRY method in writing the code and often find myself writing more than is needed. Is there a cleaner way to write this code? owl.on('changed.owl.carousel', function(ev...
For an assignment I had to create a client and a server that communicate over a well known FIFO. The server is required to use three threads to serve the client, managed by a semaphore. The code was pretty hastily written due to my busy schedule, but works as intended from what testing I've done. Feel free to rip it ...
I have created an hex viewer in python, as a timed-challenge by friend. My implementation was in the form of a class, with a separate main file running with argparse to allow choosing the file (runs with a demo file by default). I was pretty satisfied with the final result. However, I have used many list comprehensions...
I have two arrays dates = ["20161010","20161013"] values = [5,3] which represent dates and a view count. To display them in a graph, I also need the values between the dates, which are 0: ["20161010","20161011","20161012","20161013"] [5,0,0,3] I came up with a fairly complicated solution: dates = ["20161010","2016101...
My aim is to merge k different sorted array with unique elements and I want a code review about it, here is my code below which is written in java; public class MergeDemo { public static void main(String[] args) { int[] arr1 = { 1, 2, 6, 7, 18, 19 }; int[] arr2 = { 3, 4, 5, 8, 9 }; int[] ar...
I've been making an app, which gets data from external device (via bluetooth) and displays received data. I'm still pretty new to programming and I'm struggling to finish this app. I wrote some code, that works well, but I wanted to ask you if my solution can be considered as a good one. Firstly, some background. Exter...
I have to reproduce some basic functions in C and one of them is strlcat. After reading the man and testing the strlcat from <bsd/string.h> library, I wrote the following code which seems to be a working copy of the function: #include <string.h> size_t ft_strlcat(char *dst, const char *src, size_t size) { size_t ...
I am in the middle of developing a Spring Boot application, which has a service acting like a bot. advertisementService.update(Advertisement ad) is a method which parses some HTML. It is important that it cannot execute periodically. For now it is pseudo random, but in the future there will be some logic returning the...
I've have experience in unit testing but I'm fairly new to acceptance testing and REST-assured. I would like to get some feedback on my style. This is not a complete list of all my test but a few that I felt didn't need context. In the code there are two methods that need describing. validHolidayScheme is a JSON builde...
As the title suggests, this is my FizzBuzz implementation in Scala. I started learning Scala (and functional programming in general) in small steps about two months ago, and one recent assignment was the FizzBuzz task. Here is the simple code I came up with to solve the problem. It runs perfectly, but I figured CodeRev...
I made this function to calculate the difference between 2 arrays and return it in a third array. I'm using this function as a part of stocktaking functionality I apply in my accounting system. function stockdiff ($array2,$array1){ //inputs : //$array2 is the stocktaking result in an array that has the format "...
I need to write a function that searches the two-tier board according to certain parameters, which works, but I question whether there is a simpler, lighter way to perform this task. <?php function findValue(array $array, array $parameters, $multipleResoult = false){ $result = array();//used when $multipleResoult =...
Could anybody have a look at my HTML code and tell if it's build upon the correct semantic way using the right tags, and not using unnecessary divs? I'm still not sure if there any divs in my code which don't need to be there. .main-club-bar-music-festival { overflow: auto; } .main-club-bar-music-festival h3 { ...
I've been working on this login screen logic. It checks for the parameters in the JSON response to decide which action to follow. It works but it's kinda ugly and verbose. Any suggestions to refactor to make it look more elegant and simple? Alamofire.request(apiLink, method: .post, parameters: parameters, encoding: ...
I've done a test for a job (which I failed) and I'd like to know in which ways my code could've been better. Here are the questions and my answers, it's not very long. 1) Make a program that checks if a string has balanced parentheses or brackets. Braces: (), [], <> For every closing brace, there must've been an op...
I wrote this script and it's working quite well however I think there's too much if else statements on it. How could I change them for a switch statement? @IBAction func sendLoginParameters(_ sender: UIButton) { if correoTextField.text?.isEmpty == true && contrasenaTextField.text?.isEmpty == true { let ale...
This code is meant to sort a list of integers in place using quick sort. I'm doing this to improve my style and to improve my knowledge of fundamental algorithms/data structures for an upcoming coding interview. def quicksort(l): quicksort_helper(l, 0, len(l)-1) def quicksort_helper(l, lo, hi): if lo >= hi: ...
I've written a Pyspark program that will completely solve a tiered board game (no loops, each game position is a member of only one tier) and writes each tier to a file. It also determines the remoteness for each position, the distance to an end game state, where a winning position wants to reach an end state ASAP and ...
For a tilt maze general reference, you can refer to this example. The previous related code review discussion could be referred here. The problem I want to resolve is to find all possible path (so that in the future I can find minimal path) from source to destination. My major idea is: Represent the maze by flag which...
I have a class with multiple methods which return a URL string of an API endpoint. Each method takes different parameters based on what the endpoint have to include. Examples (among others): GET: http://api.mydomain.com/v1/shopping_lists/items/categories GET: http://api.mydomain.com/v1/shopping_lists/items?last_sync_d...
I've been thinking my posts aren't that great, and so I've been wanting to improve them. One sure fire way to do this is to look at all of my downvoted posts. Not knowing if Stack Exchange allows you to do this already, I decided I should learn SQL, and wrote a SEDE query. The query, downvoted posts by user, takes a si...
I have never worked with Ruby before, and thought I'd start working on learning it. For my first little implementation, I have created a simple fraction class. It would be nice if someone would check what I did wrong or could improve upon. I am coming from a JavaScript background which is classless for the most part wh...
I have 5 (or more) instances of an application running on same or different machines. Each of these application will pass a comma separated string of UserIDs and the app should pick up a unique unused record (UserID) from a DB table, matching the user IDs as passed through the SP. So if App-1 picks User-3 and marks it ...
I've made a Collatz Conjecture sequence calculator and I would like some feedback on what I can do better in regards to the code I've implemented, i.e. bad practices you see, improvements that can be made to make it faster, errors that might arise from this code that I am not managing, etc. public static void CollatzCo...
Please note: I have a follow up question with updated code, here. I have written a file-copy routine, as I experienced unreliable results using standard Python when copying file over very slow networks. The requirements are as follows: to be used on Windows only not to be limited by the 256 character limit of Windows ...
Right now I'm finishing my very first web application, and I will buy my first domain name in my life shortly. My project is about a personal website that I'm going to upload every application I program on it. Right now I only have an accounting system and a program used by the market researchers. The PHP file that I n...
So I have a file containing a huge list of sentences, some containing keywords, and some not, so in order to specifically focus on the ones with keywords, I used this method. It works, but is there another way to this without having to create a new file? keyW = ["love", "like", "best", "hate", "lol", "better", "worst",...
The application is designed to read in class results of individual students from a single text file, and then manipulate the data to give information such as class mean, median, max, min, individual student averages and updating the result file if need be. The format of the text file for each student is as such: 2 ...
I have written my own deque class to get a better grasp of C++ pointers and memory management. The following code is part of a larger 2D isometric game I am developing. It compiles and runs fine using MSVS express 15. I have provided a unit test source + output. I am fairly sure there are no memory leak issues (using ...
I am trying to implement a singly linked list. What is the most optimal way of implementing a RemoveBefore(ListNode) method? I have done this: Check if node being removed is the head. If so, return. Check if there are two nodes and node being removed is the tail. Then set head and tail as the same. Old tail will be au...
I'm doing some programming challenges over at CodeEval and came across a pretty straight forward simple one: Given numbers x and n, where n is a power of 2, print out the smallest multiple of n which is greater than or equal to x. Do not use division or modulo operator. So the input looks something like this: 13, 8 f...
I've been toying with this idea for quite a while. Needless to say that this really enables a lot of possibilities, Especially when combined with a SignalR Backend. Added below is what I came up with. Would love your input! EDIT: I know that this code has a "vulnerability": the cursor or its source must not be used out...
When giving away or selling a PC, one should be careful not to send personal data with it. I'm in such a situation and was using dd if=/dev/urandom of=/dev/sdb bs=8M, but it was only averaging 22MB/s. Way too slow since I have to drop it at the post office next morning. So I decided to write my own and see what kinds o...
The function tokenize generates tokens from a mathematical string. It can chain characters together to form longer tokens. This can be used to build a parse tree, in order to evaluate the math expression. def get_char_type(char): """ Returns a string denoting the type of char. >>> get_char_type('x') ...
I am trying to build a function to find the highest number in a list without using the built-in functions of "apply" and "max". I created the following code: (define (highest-num lst) (define (iter lst accu) (cond ((null? lst) accu) ((< accu (first lst)) (iter (rest lst) (+ accu (- (first lst) accu)))) ...
I've written concurrent queue based on std::queue. #include <queue> #include <shared_mutex> #include <condition_variable> template <typename T, typename S = typename std::queue<T>::container_type> class concurrent_queue { // no std::shared_mutex yet using mutex_type = std::shared_timed_mutex; public: expl...
I need a function to determine whether or not a string has HTML in it or not so that I can know whether I'm dealing with a plain-text format or HTML format. It seems simple enough in C#, using HTMLAgilityPack. Recursively go through the tree of nodes, and if any are an element node (or comment too) then we say "Yes, ...
I wrote this code where I have to rotate an array of 'n' elements by 'd' elements in the anti-clockwise direction.Can it be done in a better and simpler way? public class RotateArr{ public static void rotate(int[] arr,int d,int n){ System.out.println("Array before rotating : "); for(int l=0; l<n; l++){...
Last night in The 2nd Monitor there was a discussion about postless users - I wanted to see how many there are, whether they're one-timers that showed up once, registered and never came back, and whether they vote at all. So I whipped up this query on SEDE, showing voters and their post count, as well as other informat...
My original deque implementation and efficiency question lacked move semantics. After ratchet freak provided an example of how to define them I decided to try adding them to my deque. The unit test + output below shows that the code is working. However, my new question is: Are there edge cases in any of my move semanti...
This code is meant to implement a hash table class which uses linear probing. I'm doing this to improve my style and to improve my knowledge of fundamental algorithms/data structures for an upcoming coding interview. class Hash: def __init__(self): self.size = 11 self.vals = [None] * self.size ...
When I have to write a report or an article, I usually have my bibliography as PDFs in a specific folder, so I wrote this script to automate the generation of bibtex entries. It works so far, but I'd like to have suggestions about what I could improve #!/usr/bin/env bash FOLDER=$1 BIBTEX_FILE=$2 cd $FOLDER for f in *...
This is my contact.php file which has only 2 functionalities: Response with the default page if it is requested by the get method Process the message posted by the client if it is requested by the post method It didn't designed to process any ajax or any other request, just the "get the page" and "post this message" ...
I created a program for a college class. After I got it working, I wanted to improve it. As a beginner, it is probably a mess. Description It uses a HashFunction and a HashTable and quadratic probing for collisions. It will tell the user to enter a word and after that will check if that word exist in any of the 3 text ...
I am working on a project for a Raspberry Pi that requires some image processing. The aim is to find a white line on a black background by finding the weighted mean in each row/column. However to avoid this being skewed by other parts of the path that may also be in the picture I want to restrict the mean to within a t...
What do you think about this solution? I guess there are too many lists... vowels = "aeiou" def reverseVowels(string): vowels_list = [] string_list = list(string) for index,letter in enumerate(string_list): if letter in vowels: vowels_list.append(letter) reversed_vowels_list = lis...
I'm working on my ability to write loosely coupled applications that follow SOLID principles. This is a simple application trying to demonstrate the concept. Is it OK? Am I going along the right lines? What needs to be improved or changed? I'd just like your overall opinion on the design structure and the code please. ...
The problem: In C++ arrays and SequenceContainers http://en.cppreference.com/w/cpp/concept/SequenceContainer (std::array, std::deque, std::vector) are necessarily zero-indexed. However, from the semantical point of view, elements of an array may be assigned a completely other range of indexes. One common example is the...
I have been asked to write Java method code to do the below: +---+---+---+---+---+ | 0 | 0 | 0 | 0 | 0 | +---+---+---+---+---+ | 0 | | | | 0 | +---+---+---+---+---+ | 0 | | | | 0 | +---+---+---+---+---+ | 0 | | | | 0 | +---+---+---+---+---+ | 0 | 0 | 0 | 0 | 0 | +---+---+---+---+---+ I am assuming th...
You need to design and implement a generic pool for storing objects (implementing poolable). The pool should support the following: A support for creational pattern which would be used by the pool to create objects automatically when needed Maximum and Minimum number of objects which can be created and made available...
I have 2 Excel files: the first is the source file "Practice_New.xlsx" and the second is a mapping file "A_File.xlsx". A_File is a mapping file which contains cell reference of the source file ("Practice_New.xlsx") to the target file (I need to create this file, say "Practice_New_Output.xlsx"). I have written this code...
I'm writing a simple sanity tool for a simple USB driver. The customer is directly facing the output so I have to care about how it looks. The log messages that I need to print are varying length, and they have "[ SUCCESS ]" and "[ FAIL ]" trailing part too and the middle is filled with dots. So what I do is calcula...
I'm simply getting the 3 future days from an array of objects based on the current day to display for a weather component. This is the first time I've attempted using ES6 and it's features so please take this into consideration. Is there a better way to do this and save the values? Have I overcomplicated the whole thin...
This is a follow up of a previous question I have written a file-copy routine, as I experienced unreliable results using standard Python when copying file over very slow networks. The requirements are as follows: run on Windows (other OS's are not a requirement at the moment, however not limiting at the moment) not to...
I a list of strings A and a list of keywords B. Now I want to return all strings from list A which have all keywords from B in it as a new list. def string_search(strings, keys): res = [] for s in strings: full = True for k in keys: if not(k in s): full = False ...
I have a bunch of concurrent threads carrying out operations which return alerts. The alerts have to be persisted to a DB, but this cannot be done concurrently as it may cause duplicate alerts being created. To avoid duplicate alerts I have written a class containing a ConcurrentBag<T> with a Timer that triggers Action...
This is some code I wrote in order to see if it was possible to tile a 9x9 grid using trominoes that are shaped like this:   _ | |_ |___| (They can be rotated.) One issue I had while writing this is that I had to fix too many small errors (like having a 0 instead of a -1); is there some way to reduce the number of erro...
I just started to learn Elixir and to train on Codewars. I solved this kata but I'm not very satisfied of my code and I have no clue (literally) how to improve it. Recursion seems the way to go here, but I'm convinced the code can be optimized a little more. Here is the full problem : The input is a string str of dig...
I want to implement the singleton pattern in a header only c++ library. (Please refrain from sharing your opinion on the pattern itself!) This would be trivial if I could rely on the compiler implementing thread safe c++11 function-local static-duration object initialization. i.e. static inline MyClass& singleTon() { ...
This is a GCSE practice problem, to practice for the actual coursework. Computing's my passion and I'd like to impress the examiners (note: any tips would be appreciated) Essentially, this is simply splitting by lines into an array, printing said array into a file, then reassembling it by looping through one list by in...
Need some comments on making the below code more effective. I'm pretty new to Haskell. The sequence in generateSeq is generated by the rule that if x is in the sequence then x*2+1 and x*3+1 are also in the sequence. getNumberAt gets the n'th number in the (sorted) generated sequence. The code works but somehow I feel t...
I have re-written my DataGrid filtering method to try to improve performance and I feel that although this is the fastest yet, there is still room for improvement on some of the slower machines my program runs on. The DataGrid is bound to an ObservableCollection, as the user enters text into my searchBox each CompanyMo...
As suggested by the name of source file (ex1.12.scm), I just started learning mit-scheme by reading SICP. In Exercise 1.12, I'm asked to "compute elements of Pascal's triangle by means of a recursive process." For fun and extra practice, I wrote a program to print the whole triangle. (It took me several minutes to prin...
I'm looking for an effective way to parse html content in node.JS. The objective is to extract data from inside the html, not handle objects. It is a server-side thing. I tried using jsdom and I found two major issues: Massive memory usage (probably some memory leak) Won't parse properly if the code is a malformed htm...
Whilst self-studying algorithms, I came across the Karp-Rabin rolling hash search algorithm here. I decided to have a go at implementing it in Python: For ease of reading; the data-structure description and formulas embedded in append() and skip() are: import random from time import process_time def is_prime(n): ...
I have a c# WinForms application in which I have tried to implement the Model View Presenter pattern with Passive View. I create new Views in the Presenter of my 'home screen'. I was wondering if this is bad practice, and if it is, what an alternative might be to resolve this. Also, general improvements are more than w...
I have a small bot for social network, which accepts message "unicode XXXX XXXX XXXX ...", where XXXX - HEX values which I should convert to Unicode characters. Initially command accepted only one HEX value, and it worked fine and fast. After I modified code to accept multiple values, process slowed down (1-2 seconds r...
I'd like you to help me review a small camera app. Most of the code comes from here; I just changed it a little bit. I started dabbling with react-native for the first time. It seems kinda neat but I need some guidance especially with export default class DashCam extends React.Component section. The most important func...
Given a file containing adjacent IDs: i1, i2, i5 i3, i4 i2, i6, i7 i4, i8 i9, i3 I would like to print each of the connected components: i1, i2, i5, i6, i7 i3, i4, i8, i9 I decided to accomplish this using a BFS on a Map datastructure: /* Input, can be read from file easily by splitting on ", " */ val lines = List(Li...
I just started learning Python this week and put this together for my first program (outside of a Hello World one). Does anyone have any feedback/suggestions for improvement for this? I've tried to forsee potential user input issues but I'd love to hear some thoughts from people who know what they are doing! import ran...
I have written the code below for the following experiment: Subjects get simultaneous stimulation of left and right thumb and have to tell which one was stimulated "stronger" (with higher intensity, i.e. with higher amplitude of the sine wave we output) One of the two signals does not change, while the other signal is...
I'm building my own scheduler and I took the first step by creating a cron expression parser. To test it I used this expression to cover each case. (I guess the 52W is wrong but this doesn't matter yet - validation comes later). "14,18,3-39/3,52 0/5 14,18,3-39,52W ? JAN,MAR,SEP MON-WED,FRI#3 2002-2010" Core It start...
Are these good implementations of parallel and sequential "extension" methods, and do they accomplish what I think they do? My understanding is that the first one is parallel because the await applies to each invocation of the async lambda that is passed to map. So each invocation will block asynchronously and run in p...
This is a simple program to test if integers will follow an interesting, improvable statement that if disproven, calls for a bravo. But, ignoring the pretentious poetry, this code allows the user to input a number, which, if it is a finite, positive integer, will be calculated according to the Collatz Conjecture as sta...
Following this reference, below is the list abstraction implementation using array, /* list.h */ /* List is an ordered collection(sequence) of homogeneous type elements(unique or duplicate). By definition, List is not suppose to have collection of heterogeneous type elements. All elements in a List are rela...
for my c++ class I was asked to write a class with the following characteristics: Implement a vector replacement that operates only on integers (you don't need to use templates like the normal STL). Your class should have the following interface: • A no-argument constructor that allocates a 32-element vector • A c...
We have a (Spring) REST API that I was tasked to write integration tests for. I wrote various ways to test our REST API and then just decided to make 1 integration test class that processes all JSON files that can be submitted in PUT requests against our REST API and also tests security and various GETs and DELETEs. ...
The first part of the query grabs Policy's Premiums, Effective and Expiration dates. The second part creates Calendar, and third part (final SELECT statement) returns Earnings broken down by Month and Year. Everything works fine and takes just 3 seconds to display the result. But then I need to filter what PolicyNumbe...
I'm studying alone, so I don't know if I'm writing efficiently. Could this slot machine simulator be improved? How? import acm.program.*; import acm.util.*; /* * THIS PROGRAM SIMULATES THE SLOT MACHINE */ public class cap6ex5 extends ConsoleProgram{ private RandomGenerator rgen = RandomGenerator.getInstance(); pr...