instruction
stringlengths
71
71.9k
I just read and experimented with C++ implementation of the merge sort algorithm from the Wikipedia page. During the experiments I have slightly modified the source code and would like to know how much the algorithm is improved (if it is). //! \brief Performs a recursive merge sort on the given vector //! \param vec Th...
I have a function that compares the values of a tuple and a list of equal length. It compares each value in combination to see if it is equal to its respective value in the path or if the value in combination is '*', that is valid. So for example: combination=('dog', 'cat', '*'), path=['dog', 'cat', 'bird'] would retur...
I'm currently using this pattern in my JavaScript code. Somewhere in my code I use Dnianas.Post.init. init fires and it will bind DOM events. At first everything was OK. But then, when you look at likePost method you will see that, I'm not using the var keyword to declare my variables. Because I if do that, then it won...
Now that I have some infrastructure in place to test it (see my Battleship test framework and the updated GitHub project for the full context), I have finally written a non-trivial bombing strategy class for the May 2015 Community Challenge. The SmartRandom class guesses randomly until it gets a hit. It then checks fo...
One day I saw a question on Stack Overflow asking about changing numbers to words, I thought about it, and next day I started coding. When I had the code working, I thought it could, most likely, be much better. Then I started looking for some existing code about it and found this one. I wasn't able to understand much ...
I've made a simple in-browser syntax highlighter using JQuery. It's pretty simple, it just wraps keywords, integers, and such in <span> elements with color styles. "use strict"; /** * Replaces any JS code with * highlighted JS code. */ function colorJS(element) { $(element).html( $(element).text() .replace...
I created this for a project at class, and I already turned it in so I know it's too late for changing it and whatnot as it's the end of the semester, but I want to know from the community how well I did. Don't judge all the std:: stuff. I built this using using namespace std;. #include <iostream> #include <fstream> #i...
I recently started learning Swift through Stanford iOS8 Course. The first assignment is to add some features to simple Calculator which was presented during lectures. List of tasks: add button for entering decimal point (appendDot()) add sin, cos and Pi operations add Label which shows history of performed operations ...
I have some JS that I am not OK with. How can I reduce the amount of code? (function ($) { var allPanels = $('.accordion-modal > dd').hide(); $('.firstlink').addClass('green'); $('.firstlink > header').addClass('green'); $('.accordion-modal > .active-accordian').show(); $('.active-accordian').add...
I am going through some CodingAbbey problems to learn basic programming tasks, with a focus on taking input from a file, and saving to another. I have just completed this task: Of two numbers, please, select one with minimum value. Here are several pairs of numbers for thorough testing. Input data will contain number ...
I developed this grid which displays number of records for X & Y, user can click each number to see a list. (I didn't add list markup to fiddle yet - so lets not worried about it for now.) What I believe is that I overcomplicated this simple project by choosing SVG, and it can be improved massively by using simple HTML...
In my PowerShell script I'm trying to delete a folder, but only if it exists: if (Test-Path $folder) { Remove-Item $folder -Recurse; } I find myself repeating this combination of cmdlets quite a few times, and wished I had something like this: # Pseudo code: Remove-Item $folder -Recurse -IgnoreNonExistentPaths Is the...
Mod note: This question is being discussed on meta I tried to create a method, that given 3 int numbers and a bool returns true if they are in strict increasing order (by the same amount) like (1, 2, 3), (3, 7, 11) or (0, 4, 8). Except if equalOk is set to true, then equality of two adjacent elements is allowed, such...
I have a class for making datastore inserts with Google App Engine and WTForms. Now I want to refactor it into smaller units but I'm not sure how to do it. Can you help me find what needs to be done? The code consists of code for taking a form (AdForm) and its parameters to make a datastore insert. It also checks for i...
I have a script that alerts me via email when a partition grows past a defined threshold in one hour. My script is run from cron hourly. Everything seems fine for 99% of the time, but occasionally I get an email from my script stating that growth in the past hour is something like ".08%", well below my current threshol...
Full text of the problem 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 obt...
I have a program that reads in two xyz-files (molecular structures) and compares them by an intramolecular distance measure (dRMSD, Fig. 22). A friend told me that my program structure is bad, and as he is a programmer while I am not, I guess he is right. But as he has no time to help me much, I thought maybe some one ...
The next iteration is here. I have this small method for printing long integers neatly. For example: neatify(123L) = "123" neatify(1234L) = "1 234" neatify(12345L) = "12 345" . . . The code: import java.util.Scanner; public class Main { public static String neatify(final long number, ...
I was hoping I could get some feedback on performance of my animations overall. It could just be me but I keep getting a bit of lag despite being at 60FPS constantly. Objects on screen seem to tear a little bit. Here's my code in full. Here is my game loop: //clocks and times used to get custom game loop working sf...
I have been working on a web-scraping Reddit bot in Python 2.7 with the premise of going to /r/eve (a game sub-reddit) finding posts that contain a link to a website hosting killmail information (basically combat logs in-game) and then replying to the post with the TL;DR of the log. Can anyone take a look at my code a...
Place N amount of queens in such a way that none of them can attack each other. import java.util.*; public class NQueensRewrite { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.println("Enter amount of queens"); int n = input.nextInt(); i...
See the previous iteration. At this point, I have "digit group" length assumed to be always 3 the user can pass the delimiter character of his/her own handles (seems to handle) the minus sign gracefully hacked away a test in a conditional import java.util.Scanner; public class Main { /** * Handles <b>most...
This was the exercise: Exercise PSD Think about a number under 25. Write down the number. If the number is even, divide in to two en write down the result below. If the number isn’t even (the number is odd) multiply the number with 3 and add 1. Write down this number. Repeat until the answer is 1. Write the code...
I have an object that I am populating via mapping and lookup with Reflection: this.SearchResults = (from a in response.postings select new SearchResponseModel { Id = a.id, TimeStampDate = a.timestampDate, ...
I want to change all values in a multidimensional dictionary. I have written this line of code, which does what I want it to do and I am trying to find out if this is the optimal way or just some convoluted solution I came up with: dict_data = dict([x,dict([y, dict_data[x][y]+100] for y in dict_data[x])] for x in dict...
The challenge, from Tour of Go, "Exercise: HTTP Handlers": Implement the following types and define ServeHTTP methods on them. Register them to handle specific paths in your web server. type String string type Struct struct { Greeting string Punct string Who string } For example, you should be a...
Any suggestions on how to improve the code shown below for the Go-tour exercise? Exercise description: There can be many different binary trees with the same sequence of values stored at the leaves. A function to check whether two binary trees store the same sequence is quite complex in most languages. We'll us...
I've got a program in Java which simplifies input string using grammar-like rules. Length of string is up to 200 and number of rules is up to 300. In big cases it works too slow, so I need some advice on time optimization of the code. Example input: 4 4; a b a b; a b -> b; a b -> c; b a -> a; c c -> b Program show all ...
I wrote the following function in PHP to represent IPv6 addresses as short as possible: function ipv6_compress($ip){ // Shorten first group of zeros if(substr($ip, 0, 4) == 0000) $ip = substr_replace($ip, '0', 0, 4); // Shorten full groups of zeros $ip = str_replace('0000:', '0:', $ip); // Remove le...
I am writing an application that consumes a JSON web-service in Python. I have an outer loop and inner loop, my inner loop is pretty ugly; how can I codense this to function more like my outer loop? By elegant, I mean performs the same functions without as many lines of code. items = [] for sr in decoded2['Response'][...
I am getting Out of Memory errors when I try to parse through a large CSV file (2.5Gb). My computer has 32Gb of Memory but Perl uses all of it up. The CSV has 2 columns. The first is the time in epoch and the second is a 10000+ line XML file as a single-line. There are around 13k rows. I then use XML::XPath to retriev...
My task is here as follows : Input : A complex/nested JSON object with nested arrays as well objects Output : A JSON object that contains a set of URLs with their titles: ( key,value ) pair eg {"Title1":"URL1","Title2":"URL2"} In this code, I simply go through the JSON object battle. My task is to append all the...
I'm fairly new to Java and tried to recreate a Bejeweled game, what I've coded so far works as intended, but I'm not sure if my approach is smart. I set up the board with new gems, but by doing this randomly, patterns (multiple gems of the same colour next to each other) can occur. That's why I recreate the board if th...
I'm implementing an Entity-Component-System. Basically, an entity is a wrapper around an ID, a component is just a POD struct, and a System is a class that does work on components corresponding to the Entities subscribed to that system. I'd like to take advantage of smart pointers, so the cleanup will be much smoother....
I have created many sites that requires php and html. They all work fine, but I'm now thinking if all that time I do it in a wrong way. Usually, first I build the site template, then styling and last I code php. Then I just include the php functions etc in the HTML. For example take a look of a table that lists some...
I am in the process of making an assembler and one of the needed steps is actually getting the opcode from a table. However, the instruction set I'm working on has a handful of different addressing modes which give different opcodes. On top of that, even if you have the same mode the parameter size changes the opcode a...
I would really appreciate some feedback on the code I wrote to solve the following problem: Design an IdManager. IdManager manages a pool of integer ids. (from 1 to n). It should provide api’s to get_id() and free_id(). get_id(): It returns any id , available in the pool. An Id cannot be given away again, unless ...
JavaScript is my first programming language, and I'm still pretty new. I'm just looking for feedback. What can I do to make this more efficient and handle larger numbers? // Project Euler - Smallest Multiple // This program finds the smallest positive number // that is evenly divisible by all numbers between 1 and n. ...
I'm hoping I could get some help in understanding as well as optimizing code! I've been working on a few exercises on some online resources, and I decided to try and take it to the next level and start using methods. import java.util.Scanner; public class SpaceBoxing { static Scanner keyboard = new Scanner(System...
My goal is to return a specific sentence in a story that contains a given word. Returns null if the word is not in the story. I'm ok with returning the first occurrence if there are multiples. Is there a more efficient or cleaner way to do this? public static String getSentence(String text, String word) { String se...
I've written an image resizer / uploader, that takes an incoming image, resizes it, and uploads it to the server, under the /usericons/ folder. However, the code is sloppy. Can somebody suggest a better method / improvements? define ("MAX_SIZE","400"); $errors = 0; if ($_SERVER["REQUEST_METHOD"] == "POST") { $image...
I've been working on my own dynamically-typed, dynamically-scoped, imperative programming language called Honey Badger and feel that it's reached a stable enough state that I want someone else's eyes on my implementation of the interpreter. For context, I'm going to walk you through a sample program in the language ...
The code implements custom iterator, which skips duplicate integers. The array expected is to be sorted. public class GenericIterator<K> implements Iterator<K> { private K[] array; // Array will be set here private int index; GenericIterator(K[] array) { this.array = array; index = 0; ...
I attempted some (easy) coding with Java Native Interface. This is what I have: six_pack_Neatifier.h: (autogenerated by javah) #include <jni.h> #ifndef INCLUDED_SIX_PACK_NEATIFIER #define INCLUDED_SIX_PACK_NEATIFIER #ifdef __cplusplus extern "C" { #endif /* * Class: six_pack_Neatifier * Method: neatify * ...
I have created an Odds Calculator in Java. The program gives me the odds, but I want to make sure that they are correct. Maybe someone can tell me a calculator I can compare my results with or knows another way to check if the odds are correct? With the calculator you can set your own hand plus the cards on the table. ...
Problem Statement This problem is a programming version of Problem 3 from projecteuler.net The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of a given number N? Input Format First line contains T, the number of test cases. This is followed by T lines each containing an integer N. Output...
input 3,5 output should be 3,4,5 input 5,3 output should be 5,4,3 And the code public static void test(int a, int b) { if(a>b) { for (int i = a; i >= b; i--) { System.out.print(i + "\t"); } }else if(a<b) { for (int i = a; i <= b; i++) { ...
I was given this exercise: Build a game in which two players compete in a game of Rock-Paper-Scissors with different strategies. Who will win more rounds? The rules: Scissors beats Paper Rock beat Scissors Paper beats Rock If both players choose the same, the round is counted as a tie. Implement two players: Pl...
Given a list of 250 words of 4 letters each, what is the fastest way, in Python, to find a subsample of 100 words (drawn without replacement) so that the distribution of letters across the whole sample is most even? List of words: http://pastebin.com/2kpiNAcC Note there are only 18 different characters, and some occur ...
This is a task from lab classes at my university. Problem statement was to showcase following features: Multiple activities in app. Passing data from one activity to another. Changing behavior of back button in one of activities. Getting picture from camera and displaying it in app. Binding callback action in XML file...
I have created an inventory management sheet for a Lodge in Africa. The general conditions of the document are that it has to be easy to use, because the people who are using it are not very computer literate. I have generated a "generic" master document where I have pre-entered the items for sale in Column A, and th...
The program should accept a name of a country as input. It should then parse the Wikipedia page for that country and find all links to the wikipedia pages of other countries on that page and make a list of all such countries. For example, if the argument was India and http://en.wikipedia.org/wiki/India has links to wik...
Chandan got bored playing with the arrays all the time. Therefore he has decided to buy a string \$S\$ consists of \$N\$ lower case letters. Once he purchased the string, He starts formulating his own terminologies over his string \$S\$. Chandan calls a string str A Balanced String if and only if the characters of the ...
We have some BloomFilters (like a java.util.set without deletion) and we store them in ehcache (you can think it's as a java.util.Map): For example, Constant.BLOOM_FILTER_CACHE ehcache contains: key value aaa bloomfilter (of name aaa) bbb bloomfilter (of name bbb) ccc bloomfilter (of name ccc) If we call local...
I'm trying to generate a fresh XML file using Perl XML::Mini::Document. It's working fine, but I don't know whether it's the right way to do it. Performance is the problem for me; it takes more time when the when record count increases. Is there any other module better doing than this one in performance and easier way...
I've been going through some of the exercises over on exercism and this is one of my solutions: a basic RNA/DNA transcriber. I was happy enough at first but now, looking at it again, the solution looks very repetitive to me. The two methods below are needed because there are tests to ensure we've implemented them. It's...
I have a list of files, the files have the same names and are in various different formats like swf, jpg, gif and fla. Each swf may contain ONLY a gif image, it's possible a JPG image that does not have SWF, which should be listed. For example: file1.fla file1.gif file1.jpg file2.jpg The output should be: BasicDBObjec...
I needed to create a simple method that converts numbers in Base 26 (string) using, as expected, letters from a to z. But that's not all, this Base 26 needs to be One Based. Which means that there is no representation for zero absolute value and there is a representation for 26 absolute value. Let me show a example: In...
Please look at a small piece of code I wrote and provide some thoughts, critiques and any feedback you think is needed. The code is here along with the problem I have attempted to solve and I look forward to hearing all your thoughts on it. The Problem The surface of Mars can be modelled by a rectangular grid around w...
I have write a program to determine the color of last bean from a tin (char[] beans). "Beans" in a tin are only green or blue. The rule is: If two beans taken out are both greens or blues, put 1 blue "bean" back, else put the green one back. Repeat until there are only 1 "bean" left. I don't know whether my code is rig...
This is a wolfram language program I wrote for super-resolution, in this case meaning to guess at how to increase the the resolution, and so detail shown in a raster image such as a photograph. It uses a different but related approach to its predecessor, that I created some time ago: Super Resolution in the Wolfram Lan...
This recent question Print Consecutive numbers by comparing two parameters frustrated me because I could not find a convenient way in Java 8 to support the conditions that are required. I answered it in a somewhat cumbersome way for Java 8... (the non-stream part of my answer is "OK" in terms of usability). To reiterat...
Utility to calculate the square root of a number. The method also accept an epsilon value, which controls the precision. The epsilon value could range to any number including zero. I am expecting a general code review or if there is a better way to write the code. /** * The class MathUtil contains methods for performi...
I'd like to get an opinion on the code I've made for a Tic Tac Toe game in C++. I'm pretty new to C++ but I'd like to improve. I haven't been able to think of any improvements. One bug I'd like to figure out later is that if a user enters values that aren't two separate integers the program seems to loop as if stdin is...
Edit See the next iteration at Array slice type in Java - follow-up. I have this "slice" type for managing array subranges. It is kind of the same thing as Pythons slice notation, yet I did not add negative indexing (since Java's Lists don't do it). So, what you think? Slice.java: package net.coderodde.util; import ja...
This is in one of my AngularJS controllers: websiteService.get('websites').then(function(data) { $scope.websites = data; websiteService.get('groups').then(function(data) { $scope.groups = data; websiteService.get('websites_groups').then(function(data) { $scope.websites_groups = data;...
Here's a brief explanation of my method: Provide a string and parse it to HTML code respecting a specific format. The accepted format is: For dropdown menu : Test DropDown~Select:Options1; Options2;Options3--- --- For Text area: Test Text area~TextArea:text to display** I am inheriting this VB code from a legacy ...
Problem I need to convert a double to a std::string which contains no scientific notation and no unnecessary fillers. Using std::fixed with iostream yielded ugly results - extra fillers (0's). The closest working code I could get was to using sprintf("%g",...) and then dealing with exponentials, should they appear (be...
I am new to F#. This code is basically a port I did from C#. I am sure there is room for a ton of improvement, so how can I improve and make this more efficient? let SingleFIle (req : HttpRequestMessage) dirName typeDir (fileType : string) userName clearDir deleteExistingFile = async{ ...
Inspired by this question, I was curios, if I could solve it for large n. For n=6209, its fifth power overflows long and I decided to stop below such numbers. The current algorithm reimplements the one from the linked question (the description, not the code) and could use some optimizations (but I'm not asking specific...
I have an array whose members are arrays containing strings. Each array has 5 elements, some of which may be empty but always at the end of the array. The order of the strings matters because their hierarchical labels—call them catLists. I need all the longest unique lists, ie. some of the shorter catLists are containe...
I've been trying to simplify a search method in a project that I've taken over. Is it possible to make the code any cleaner than I already have done? purchase_controller#search (original) def search parms = search_params @purchases = [] if parms[:active].nil? active = false else active = pa...
This is my code for a simple rock-paper-scissors game. Users have the choice between playing against a computer or watching a "computer player" play another "computer player". The code for the computer vs computer mode isn't finished yet, so you must chose human vs computer mode for the program to work as expected. If ...
I've modeled the population changes for a group of agents that inhabit a 2D lattice (with wrapped boundaries) made up of M x M number of grids. At each time step: A parent reproduces offsprings that disperse independently -- the number depends on the grid location. The offsprings live if they land on a "patch" grid b...
I just recently got back into C++ and did a quick and simple exercise in the Rule of Three. The code for the copy constructor, overloaded assignment operator, and destructor follows below for my class (code is also below), and I was wondering if someone could take a quick look at it and point out anything that I overlo...
Given an array A[], write a function that segregates even and odd numbers. The functions should put all even numbers first, and then odd numbers. Example: Input = {12, 34, 45, 9, 8, 90, 3} Output = {12, 34, 8, 90, 45, 9, 3} Input = {6, 4, 6, 8, 1, 1, 1} Output = {6, 4, 6, 8, 1, 1, 1} public static void main...
I think DB transaction should be as small as possible, and close it soon. So I wrote a helper function like 'using' statement in C#. function transaction($conn, $closure) { $conn->beginTransaction(); try { $closure($conn); $conn->commit(); } catch (Exception $e) { $conn->rollback(); ...
I was writing this code to check if a tree is balanced or not and I ran into a situation where I would have liked the method to return 2 values at each step. First to signify whether the tree is balanced at that level or not, and second to return the height at the level so that I can use it to check the balanced nature...
I've added decimal (floating point) functionality to my calculator implementation; it's working but I'm having trouble making it more concise and less ugly. I'm trying to use the same method to handle both number keys and the decimal point, and whichever way I look at it, I either have to check for the button being pre...
I populate a ListView with Items. Each Item has data attached to its .Tag property. Over time, I have needed to handle many cases where something would be null or missing or corrupt or whatever. And so was born this beast: private void PlayRecording() { if (list.Items.Count >= 1) { if (list.SelectedItem...
I've some refactoring issue with one method. This method has a lot of dependencies function updateBuildChart(Filter, PagerFactory, ChartBuilder, LimitsManager) { Filter.clearFilters(); this.currentReports = $scope.$parent.reports; $scope.pager = PagerFactory.Create({ items: this.currentReport...
I'm creating an update function to show my users when the next update will be available. I'm using the jQuery countdown plugin to show the time. What is a more efficient way to write this? today = new Date(); todayDay = today.getDate(); todayYear = today.getFullYear(); todayMonth = today.getMonth(); todayMonth ++; v...
I have a situation where I have a ViewModel: // Main_ViewModel function MainViewModel() { var self = this; this.customerList = ko.observableArray(GetCustomersFromServer()); } // BIND VIEWMODEL ko.applyBindings(new MainViewModel()); // GET CUSTOMERS FROM SERVER function GetCustomersFromServer (){ var ...
One of the features that is missing from C++11 are lockless queues. Therefore I have decided to write one myself. A few remarks: I know the code isn't technically lockless. However the lock is only used for a blocking call and can be omitted. I have tested the code and it seems to work. However I found I had some trou...
I've got my full program working as expected. My full program looks like this: I'm posting a part of my code which changes the color of the circle. The user can change the color of the circle via two ways: By selecting a JRadioButtonMenuItem from the JMenu. By pressing one of the colors(JButtons) in the JPanel below ...
Using a Select2, what's the best way to refactor multiple if statements. This code returns Json to a select2 based on what information it gets in the query. The action result is used in many places so it has accommodate different parameter being passed. public ActionResult *********(string query = "", int? id = null,...
In these fiddles I am generating the number of textboxes and checkboxes depending on the input of user. This first fiddle deals with the first problem generate number of textboxes onchange of the input textboxes from errand (sample). The second one is from Guruprasad Rao that helped add an attribute value on the genera...
Boost 1.58 has new library spreadsort, so I tried it out. I wrote simple sample for sorting vector of pairs of int: #include <chrono> #include <iomanip> #include <boost/sort/sort.hpp> // based on http://www.boost.org/doc/libs/develop/libs/sort/doc/html/sort/sort_hpp/string_sort.html struct lessthan { inline bool o...
Is there a function or some easier way to draw this, each of this little circles should have 8 other smaller circles around them like the big circle... So far i made big circle in center with 8 smaller circles using canvas from Tkinter import * canvas = Canvas(width=700, height=700, bg='black') canvas.pack(expand=YE...
This is my very first complete, non-completely-trivial Haskell program, and I'm extremely unfamiliar with the language. I was hoping that I could get some pointers on how to make it more idiomatic. I'm especially unfamiliar with built-in functions. I'm specifically concerned with my main function and my scrollHelp gu...
I am processing file inside my method - basically preparing it for the download. But I decided to split actions for setting headers and reading bytes. As Java does not support method declaration inside methods, I decided to go with class inside method. public static String downloadFile(final String fileBody, HttpServl...
The following code comes from a simple Brainfuck interpreter I'm working on to learn the Rust language. Error handling is omitted for simplicity. It is tested on rustc version 1.1.0-dev (af522079a 2015-05-14) (built 2015-05-14). The code implements just the input and output routines for the interpreter. The read_cell m...
I'm looking to get rid of a couple dependencies that I have a sneaking suspicion are present in the code that I'm writing. Right now I have a service class that manages my subscriptions for part of my application in Rails. The problem is that we have Recurly as our management platform right now, but I don't know if we ...
Looking for feedback/critiques/alternatives to my solution for the 1st Project Euler question: {-| If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3,5,6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000. -} import Data.List -- Finds all mu...
This formats HTML for use in a locally hosted iframe so that you can manipulate the content in the iframe freely, without running into cross domain issues. It uses Goutte to retrieve the HTML. I'd like to improve the code, whether it's to fit a certain design pattern or just more efficient. I don't feel like it's as cl...
Problem Statement: Given an Array if ints, Find out all the subsets in the Array that sum to a given target value. Example: If the input array is: {1, 3, 2, 5, 4, 9} with target as 9 The resulting subsets are: 135 324 9 54 Below is my implementation in Java. Please free to review in terms of time, space complexity...
I just finished writing a function that computes the distance between two n-dimensional points. The original one was written in C and it's basically a translation of this formula: \$\text{dist}(x,y)=\sqrt{\sum_{i^1}^d{(x_i-y_i)^2}}\$ Here's the C code for completeness sake: void distanceC(float* source, float* destinat...
We use a student information system called Colleague that is developed by Ellucian. As far as I can tell, the system does not use any sort of session pool so rapidly opening and closing connections to the database is both expensive/slow and can use up a lot of resources on the server side. In response I developed a s...
I have three methods in API running similar code snippets. For this reuse the code inserted a switch-case according to the API method. It's good practice that? I mean, this isn't a high coupling and low cohesion? There is another better way? API @ApiOperation(value = "Gerar permalinks de todos os arquivos com validaçã...
The following code snippets are academic. I was required to make a PHP generated HTML interface for a MySQL database of a movie rental store, and the requirement was filtering the displayed movies by category. The approach for having the filter persist across all form actions (without using a session) was to have the h...