instruction
stringlengths
71
39k
Right now I'm mixing JS and jQuery. I would like to find one unique solution with JS only possibly. How can I organize the code according to best code practices? Another thing I need to add is a check at the beginning of the function. If the classes are there nothing should happen, if not there then add them just as b...
A while back, I asked a question about implementing an idiomatic iterator in C++. I've recently revisited the code, and I'm bothered by the duplication in the begin and end iterators. The code goes over a collection/iterator over a domain, and lazily produces the range using the iterator. After trimming down some code ...
I'm an iOS developer new to Android. I'm creating my first Android app and I have several questions. My app uses Android Studio, gradle, and it's based on Parse (the backend). Basically, takes messages from the backend and shows them. User has the possibility to delete them, or click them and see the detail, and of cou...
This is a solution for the June 2015 Community Challenge: a program that decrypts a monoalphabetic substitution cipher. It's written in Python 3, but should be portable to Python 2 if you use from __future__ import division. Please review! Is the technique clear and the code easy to follow? Does the code correctly impl...
I'm developing an application in which there are many short-lived tasks which are run in separate threads. I've developed a generic and reusable system to handle such a requirement. The code snippet given below is using this system code plus the example client code to show how to use the system's API. package com.demo;...
The goal is to list out some data, but the methods vary on options, and whether the user is on a touch device. This is my current function declaration. Very non-DRY. Values of isTouch and headlinesOnly don't change during loop, so I don't want to make if tests inside the loop. Edit: This is primarily meant for a memory...
I am attempting to implement the quick sort algorithm whereby the pivot will be chosen by the user, and can either be median, first, or random. I am supposed to return a long that measures the number of times comp.compare() is invoked. I am wondering if you could review for me. /** * The quick sort * @param ...
I've written a Controller for the keyboard so that I can map certain keys to callbacks within a game. A key can only call one callback, but a callback can be called by many keys. Currently, a Controller has two std::maps - one for when the key(s) is pressed/held, and one for when the key(s) are released. These maps are...
I have built Python objects to simulate a one-to-many relationship and then store the object in a MongoDB instance. I am using lots of composition to achieve what I want. The code works perfectly fine but I get the feeling that the overall design can be improved a lot. The problem statement Each Portfolio can have zer...
I'm looking for advice on how I could improve this. I'm using VS2015 to compile so whatever language features are supported in there is fair game! Problem: Create a program that reads a username and a password from the user and grants access if that username and password exists in code. Bonus points for storing the po...
Here is my switch bulb GUI program: import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.ImageIcon; import javax.swing.SwingUtilities; import java.awt.Color; import java.awt.Rectangle; import java.awt.CardLayout; import java.awt.FlowLayout; imp...
I am implementing a generic repository pattern. I have done this quite a few times now but every time I do it there is something bugging me. If I have a database design like below. (All the tables relate to one another.) And I make a call like the following: public IEnumerable<Domain> GetRealEstate() { return _r...
I'm currently making my first steps into the territory of network programming, using the SFML Network library to simplify things. Later on, my bot shall post new pull requests and changes concerning issues to an IRC channel. I've got the bot to connect to a server (irc.euirc.net is hardcoded for now) and to a channel, ...
I am quite new in web application back-end development and I have an architectural question. I have defined Hibernate entities in my application and I want to send them to client. Currently for each entity I have defined data transfer object, that is almost the same as entity. Is it good practice to create DTO for eac...
I'd like to Select columns from Table 1 with a Row Filter, Select columns from Table 2 and join. This works but it's a bit verbose. I was wondering if there is a cleaner way to write this. SELECT * FROM ((SELECT JOB_NUM, ITEM_NUMBER, DATE_COMPLETED, QTY_COMPLETED, STD_USAGE, ACTUAL_USAGE FROM JOB_ROUTERS WHERE RESOU...
I am currently rewriting a legacy PHP4 application to a MVC-style object-oriented one. As the most complex part is the models, I came up with the following controller-view scheme. I wanted to use only variables in my views, using only <? if ($foo === 'bar'): ?>-like blocks if necessary. The controllers instead generate...
After moving from mysql_ to PDO I created a PDO handling function. Basically this function takes parameters, checks them and returns end result. The thing is that I created this ~1 year ago and haven't really optimized it and after looking at it again I wanted to see if I can improve it somehow, but right now I can't r...
I would like to know how to make my code better. I'm still a newbie in Android, so any tips are appreciated. The code is an AsyncTask class extender that formats data into a nice looking Spannable String. It works, but it's quite slow, even if ran on a background thread. //SlideContentType is an enumerable with 4 optio...
I read this article that I really liked and wanted to implement the ideas it had. It basically says don't use $scope or ng-controller; instead, use directives with templates that get their angular magic from the directive's controller. angular.module('myAppContestantList', []) .directive('myAppContestantList', functi...
I am wondering if someone can review my code and tell me if there is a way to enhance it and make it more efficient. import java.util.Scanner; public class apples { public static void main (String[] args){ Scanner input = new Scanner(System.in); int selection; for (int i=0; i<4;i++){ ...
I just wrote a singleton base class for a hobby project I'm currently working on. Python is not my first language, which is why I am not sure if everything is done the pythonic way. I also used multiple resources/tutorials/articles for Python2 and 3. My singleton is supposed to be Python3 compatible. The implementation...
I had to make a message queue in an android app which my thread takes messages from and processes them. There can be multiple producers and duplicate messages should be avoided. Rate of insertion is erratic but not fast. Rate of consumption is slow. I came up with the following : public class MessageQueueHolder<T> { ...
In light of the recent "SQL frenzy" of sorts in The 2nd Monitor, I decided to take a stab at writing my own SEDE query. Essentially, what it does is find questions that could be answered based on the following parameters. -- @MinQuestionVotes - The minimum amount of votes on a question. -- @MaxQuestionAnswers - The max...
I needed this to clean up a couple of similar music libraries, which also contained some empty files and duplicate files with different names. # dupFinder.py import os, sys, shutil, datetime import hashlib def findDup(parentFolder): # Dups in format {hash:[names]} dups = {} for dirName, subdirs, fileList i...
The output that I want: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 <ul> <li> <?php $i; $a = 1; $b = 0; for($i = 1; $i < 29; $i++){ echo $i; if ($i == $a){ echo "</li><li>"; $a = $i + 2 + $b; ...
For example, if we have 120, the answer should contain (2,2,2,3,5),(2,60),(4,30),... Here is my not-so-good attempt for (int[] x : getPossibleProducts(120)) { System.out.println(Arrays.toString(x)); } public static List<String> getPossibleProducts2(int n) { List<String> possprod = new ArrayList<String>(); ...
I have written a Cached-Object store with a Redis Client for persistent storage. The application that is going to use this is a heavy read application with the occasional write. I assume that entire model will contain somewhere around 500k - 1m entities. The tests I have done so far with a far more complicated model th...
I've got the following code in my _ViewStart.cshtml file: @using System.Text; @{ string controllerName = (string)ViewContext.RouteData.Values["controller"]; ViewContext.Controller.ViewBag.BodyCssClass = ConvertControllerNameToCssClass(controllerName); } @functions { private static string ConvertControllerN...
I'm implementing a C++ layer on top of the sockets api of the OS (i.e. man 7 socket)1. Tcp sockets go through various states. Using the RAII principle leads to distinguishing the states: unconnected2, bound_to_address, listening and connected. To implement this I use move semantics and constructed to move construct ...
This is a challenge I found here. You're suppose to list how many steps it takes to convert a number to a palindromic number, where each step consists of adding number to the reverse of itself. For example, 196196871 takes 151 steps and gives me 3588816724276188853. import java.util.ArrayList; import java.util.Scanner;...
I have a fragment with a ScrollView and, inside of it, I need maybe 5 or 6 lists. To make things simpler, let's say there are three lists - list of names, list of places and list of events. The problem is, I can't use lists inside of ScrollViews so I need to use LinearLayouts and do the adding to the list thing by ...
This is a simple program meant to show how dynamic JavaFX is. It moves one list item to another and back without having to update the screen directly, thanks to the Observable Collection classes. It also exemplifies how links would work. In the same vein as Hello parallel world, I practiced and illustrated some ideas w...
In a YouTube video I watched, the speaker said it is important to know how to calculate between numbers of different bases; i.e. two, ten, and sixteen. I was then inspired to write a small C program to ensure I understand how such conversions are done. I then wrote a short Python2 script to test the program. I'd like a...
I am using this code in my controller and would like to know if this is good code to use or if I can write it better, or more compact, and so on. I am just trying to learn from this. It does work, so that is not my question. public function search() { $search = Input::get('search'); $result = Categories...
I have a dilemma. I have a messages table containing fields id, sender, receiver, body I need to select all users a given user has had a conversation with. A conversation may be a single message without a response. Here's a show create table for you to see the indexes (as I may have set them up incorrectly): CREATE TAB...
I wrote this code to learn how to work with State monad. Then I added Either result to gracefully handle error condition (stack underflow). I believe most of this code is actually unnecessary. I know there are stateful and monadic lens out there, there is EitherT transformer and also StateStack monad. How can I go abou...
I want to run couple of Runnables. If one is failed, all others' execution should be terminated. Here is my approach. I got idea on this from this question and this article. In my code, I check the runnable which completes its task first among all and evaluate it. If that checking is failed (completionService.take()...
I wrote this function to be passed as a param in spl_autoload_register(). It autoloads PHP classes from their respective directories using their namespace, named the same as path. I am not sure if there would be any easier way but this is quite simple and does what it needs to. spl_autoload_register(function($class) { ...
After the Reorder Parameters refactoring, I implemented a Remove Parameters refactoring (no, it didn't take this long, just been busy). Also, we completely refactored all the refactorings and implemented a couple interfaces for them all, which you can find here; for reference, the Remove refactoring code is found here...
Source/Context: What is the copy-and-swap idiom? Rule-of-Three becomes Rule-of-Five with C++11? The C++ Programming Language 4th Edition June 2013 - Section 17.1 Introduction 483 class X { X(Sometype); // ‘‘ordinar y constructor’’: create an object X(); // default constructor X(const X&); // copy constructor X(X...
Challenge can be found here Problem Statement Watson gives Sherlock an array A of length N. Then he asks him to determine if there exists an element in the array such that the sum of the elements on its left is equal to the sum of the elements on its right. If there are no elements to the left/right, then the ...
I am working on a stock analysis application in Python and I have the need to determine whether an input ticker symbol is an Exchange Traded Fund (ETF) or not. First I need to determine if the given ticker is even valid. Second I need to determine if it is an ETF or a company stock. So, I have some simple functions ...
I've been working on a non-blocking IO library, and wanted to get some feedback on my generic event loop class. The goal is that this class will manage select() calls as well as other "events" which must occur on the same thread that the IO is processing. I'm hoping that this can scale to a relatively large size of...
I have designed a small method to generate a salt for a password. All this does is create a random salt and does nothing to add it to the password. I have a few questions regarding my very simple method: Is this a secure generator? Currently, it encodes in base64. Is this an issue in any way? Are there any other poten...
I created a simple slide-in animation for my game. The box is shown at the bottom with character dialog. The animation is as follows: A square slides in from the left, then waits a bit, then expands to its full width. The box is made using Unity's GUI Box. The timing is extended for debugging purposes (I need to be abl...
Below is my solution to finding the minimum product sub-interval. It passed 8/12 or so test cases, but the other test cases timed out if they hadn't finished within 2 seconds. When I compile this code as Release, optimized, and to target x64, it takes about 7.6 seconds to finish on large input sizes, such as this test...
I've been working, for a month, on an OpenGL library called alpha++. Basically, it is a framework that allows the user to create 3D scenes easily. I would like to ask your advice on how I could make the user interface simpler. Here is the way I use my classes at the moment in Main.cpp: Main.cpp /// _______ _ _...
I am here to discuss what are the possible improvement can be made in order to make the following code covering all the principles of programming paradigm ( SOLID , DRY ...etc ). Basically, I am practicing Design Patterns. Example to create multiple types if Cascade Dropdown list of different types ( single select / m...
What this method should do is return a String that displays how many albums and songs there are. This method is a private method of my Artist class which has a method called albumCount() and songCount(). The whole class probably needs an improvement but I will try that later. First I'd like this single method to be imp...
I have to edit a config automatically before starting a service in a docker container (a storm supervisor), and I want to append something like this in /opt/storm/conf/storm.yaml: storm.local.hostname: 1.1.1.1 (extracted from /etc/hosts) What I currently do is that: echo -n "storm.local.hostname: " >> /opt/storm/conf/...
As you will soon see I'm not the best jQuery developer out there (I'm a designer). At best, I make a prototype barely work. That said, I envisioned this Persona-slider which is just like any other jQuery header sliders out there, but slightly different. See it in action here. Each persona has its own story consisting ...
I am new to programming and I am taking CS50 2014 online through iTunes University. This is the change-making problem in Problem Set 1: Write a program that first asks the user how much change is owed and then spits out the minimum number of coins with which said change can be made. Assume that the only coins availabl...
I use this code to make sure that the user didn't leave the combo box empty before pressing OK int option=-1; while(cboFruits.getSelectedItem() == null){ option = JOptionPane.showConfirmDialog(null, message, "Fruits", JOptionPane.OK_CANCEL_OPTION); if (!(option == JOpti...
Given there's a list of random number and the amount I want to find. For example: [80, 98, 83, 92, 1, 38, 37, 54, 58, 89] And I want two numbers that add up to a given total in this case it's 181. So, it's going to be (92+89). The list could be really big. Here's the solution I come up with. But it's kinds brute for...
I am currently learning how to write code in Java. To improve my understanding of OOP concepts, I am creating a playing card and deck class. The deck has the functionality of drawing and shuffling. I also attach an image to my card class (using JavaFX). Am I doing it right? I am also planning to extend this class into ...
I'm making a simple to-do list with jQuery. This is my first step in JavaScript and jQuery. How can I improve my code? User enter tasks in input field, submit by pressing 'Enter'. On double-click, he can edit his record. He can mark check-box, and record will make completed. By clicking bottom check-box all records wil...
I am using Laravel 5. To pass the users his favorites and permalink, I edited the AppServiceProvider. I was wondering if my solution is the most reasonable solution. Of particular concern is future extensibility in terms of adding additional views. I only have the two now but I think it's quite possible that I'll add ...
I have three data frames A, B and C: set.seed(0) N <- 5 A<-data.frame(cbind(date=c(2,3,5,1), x=NA, id=sample(letters[1:2], 4, replace=T)), stringsAsFactors = F) B<-data.frame(cbind(date=1:N, y=runif(N)), stringsAsFactors = F) C<-data.frame(cbind(date=1:N, z=100+sample(N), id=rep(letters[1:2], N, replace=T)), stringsAsF...
I'm very new to Swift and programming in general. I'm creating a quiz application and am trying to create a function that will save the number of times a user has completed a quiz. It appears to work through testing but I was wondering if there was a more elegant way to write this function: func plusTestsTaken() { ...
I've been fiddling around with some programs, and since most of them are for fun, I haven't bothered with little things like making the output non-verbose until I, say, put it here, for review. I was idly wondering how I could make converting it easier, and naturally I thought of writing a program, because that's all I...
I wrote this as a convenient way to batch together multiple, repetitive AJAX calls. I was working in angular at the time, so I use the $q service, but I'm sure it could be adapted for a more general promise framework. I find it so useful, I'm interested in polishing it for general consumption. // A utility function tha...
I've written a command line calculator as an exercise to get ready for my upcoming first programming job. The whole program source is around 450 lines of code, which I think is too long for a single question. I'll therefore post the code in parts starting with this one. Any software needs to validate it's data. The fun...
I have been studying the architecture of the Siamese neural network introduced by Yann LeCun and his colleagues in 1994 for the recognition of signatures ("Signature verification using a Siamese time delay neural network".pdf, NIPS 1994). I had some problems in understanding the general architecture of this Siamese ne...
I want to keep trying to get response until its code is 200 or unknown yet. In first case it should be stored in response variable. In another case I should raise any kind of exception. response = nil 1.times do response = begin http.request request rescue Net::ReadTimeout puts "Net::ReadTimeout...
I am currently developing a family of keyed collections, and I wanted to have one which would implement the IBindingList interface. My BindingKeyedCollection is derived from a KeyedCollection which owns a look-up dictionary, used to make the researches by key. However, I have suspicions about my implementation of the A...
I will be implementing MVC model in my program but before that, I have done a simple program based on my understanding of the MVC model. I have three pages: The user will enter a value in page one and click the next button. The value will be printed in page two and a picture will be displayed. page three is the end of...
I have a table vanrust_corev2.tblPlayerLog that has approx 6.7k records, I also have a table in a different database vanrust_forum.tblPlayerAvatars which has approx 6.7k records. The purpose of this script is to pull the SteamID of players who don't have an avatar stored for them yet. However the issue here is, the exe...
The repetition is super obvious here. How can I rewrite this code? I need one base method in which I pass a Django model, to call objects.filter, but I can't figure out how to do it. from profiles.models import BasicInfo, BillingInfo, DocumentInfo __author__ = 'vol' class BasicInfoService: def __init__(self): ...
I want to code the following scenario: One Producer: produces n (n=100 here) objects m Consumers (m = 5 here): consumes k (k = 10 here) objects at a time in a round robin fashion; Consumer 1 first consumes the first 10 objects followed by Consumer 2 consuming another 10 objects and so on. This means that consumer 1 ha...
How can I optimize this piece of code and avoid the multiple if/else call for returning error message ? if ($cardStatus == true) { $cardEmailContent = $this->setCardEmailContent(); $sendUserEmail = $this->sendCardToUser($cardEmailContent); if ($sendUserEmail) { $this->sendA...
I have implemented the Binary Search Tree in Java and would love to get reviews. I would like to have some comments on multi thread implantation. Note: Corrected Code is in the Answers package com.atleyvirdee.myDataStructures.tree.binarytree; import com.atleyvirdee.myDataStructures.tree.ITree; import com.atleyvirdee.m...
Is there any way to improve it? #include <iostream> #include <windows.h> #include"MMSystem.h" #include <conio.h> #include <fstream> #include <ctime> #include <string> #include <string.h> using namespace std; /****************************************************/ /**<Stores Player's Name and Score>*/ struct player { ...
I am adjusting Fast Report to create some reports, and I have created a loop that runs through query results stored inside a datatable and assigns each TenantName to a variable. However, the code I wrote seems bulky and would get out of hand if I needed more variables. Would there be a more sensible way to do this? If ...
I have done the supermarket pricing kata in TDD style and I would appreciate it if someone could review it for me. Kata: "...checkout that calculates the total price of a number of items. In a normal supermarket, things are identified using Stock Keeping Units, or SKUs. In our store, we’ll use individual letters o...
I have previously attempted to write a object-cache that I use in co-junction with Redis keeping a persistent data-model. Old post can be read here Cached-object Store c# with Redis client for persistent storage Not focusing on Redis it's the Object-cache that is the important portion, one of the questions i previousl...
Would it serve much purpose to work at refactoring the latter parts of this code? // This part is OK function isScrolledIntoView(elem, trigger_height) { var docViewTop = $(window).scrollTop(); var docViewBottom = docViewTop + $(window).height(); var elemTop = elem.offset().top; if (trigger_height == false) {...
Simple task - deploy war-file from TeamCity agent to remote web-server. I realized it with Fabric, because of it make readable output, and give opportunity to login via SSH with RSA-key. Also - during deploy - build agent must make some additional steps - create backup, stop-start Tomcat service etc. URL to deploy to c...
I'm developing an open source annotation processor for Android (ngAndroid). Part of the library is a small Java subset compiled language that can be used for data binding, events, etc. I plan to extend the functionality of this language but my Tokenizer is getting out of hand. The Tokenizer parses strings such as getT...
I wrote some ugly JavaScript that is responsible for sending Ajax requests and update the DOM. I'm using it to show user progress of background jobs. this.AjaxPoller = { poll: function() { setTimeout(this.AjaxPoller.request, 5000); }, request: function() { $(".ajax_poller[data-url]").each(function(i, ele...
I have the following method which under code review gives me a CA1502 avoid excessive complexity error (although if I suppress the message it will build fine): private void OrderResults() { switch (_orderColumn) { case 0: default: _fitleredResults = _orderDirection.Equals("desc", Str...
I have a piece of code that generates some tables: bp_rows: where I take a snapshot of some "headers" for each row of the table. bp_flussi: where I store a date and an amount only if the amount is not equal to 0. Flussi can be positive or negative. When this is done, I use different code to populate a table with one ...
I have this jQuery form with 4 text inputs. The first one only accepts digits, the second one formats value into 'de-DE' price format accepting 2 decimals, the second does the same but accepts 5 decimals after decimal separator, fourth one automatically adds periods for date input. $(window).ready(function () { ...
I tried this problem and I saw that my solutions was way too slow compared to others. I want to know how I can improve time complexity. A job has been assigned to Jar Jar Binks, it goes as follows: There are N spaceships parts, each with a weight of Wi kg. Given a weight W, he has to show how many parts can be use...
In the past when I needed something like a dropdown menu, it was really easy to toggle the appropriate CSS classes with jQuery. Here is my first attempt to do the same thing without any dependencies: // create object containing all .dropdown elements var dropdown = document.getElementsByClassName("dropdown"); // loop...
I am using an API that returns a JSON object that has "encoded_polyline" fields that tend to result in errors like this one: UnicodeEncodeError: 'utf-8' codec can't encode character '\udb6e' in position 2: surrogates not allowed Since the offending fields don't offer useful data, I decided the best would be to get ri...
This checks whether it's valid to make a processing. Processing can occur if: there are files and spreadsheets (spreadsheet is the spec attribute) there are any files or spreadsheets (it never occurs if there is at least one of the two) AllFiles is empty only if one has sent a zip, but it wasn't unzipped and has been...
I have written the following Auction Algorithm implementation in C++ and I am having issues with performance. On my machine a problem size of 500 is solved in about 7 seconds while a similar Matlab version solves the same in about 4-5 seconds. Since C++ should run faster, what are some ways that I can squeeze some more...
I'm trying to make a program where user will put in his birth date in DD/MM/YYYY form and he will get back amount of seconds between his birth day and 01/01/2015. It counts with fact that different months have different amounts of days and also with leap years. What should be improved or focused on more? I already foun...
I have an enum of stock tickers, then from the database I get details for an analysed ticker (stock). In the loop, I compare the details of the analysed ticker to details of the rest of tickers, compute the correlation, then add it to the treeSet. This is my first time using multithreading and I wanted the method execu...
I am using JGoodies Looks to change the look and feel of the application I'm currently working on. I've just created a JMenu with some different themes options for the user to choose. The thing is, I want to make sure the changes affect the program instantly, on all current windows, so I did this: @Override public void...
At the moment I'm writing a parser and interpreter for a custom scripting language, to learn more about the basic concepts involved and to get more familiar with tools like bison and flex. The parsing process requires the allocation of a lot of small data structures to store intermediate language symbols and syntax tre...
There are many instances of prime number sieve implementation both here and other places on the web, but I wanted something a little different. In particular, I wanted to create a static array of the first 1024 prime numbers at compile time as a simple reusable structure. I also wanted to allow for relatively simple ...
The purpose of the following code is to, given a vector, compute the two accumulators: 1. head-till-nth element, 2. (n+1)th element-till-last (where n, and this is the catch, iterates from 1 till length-of-list, inclusive). (let [my-list [1 2 3 4 5 4 3 2 6]] (loop [elem 0] (when (<= elem (count my-list)) (...
I have made significant changes in the code and now it takes about 20~40 seconds to process each worksheet. This will conditionally copy column based on the column headers in sheet2 that match to the ones in sheet3. Here is the main module: Option Explicit Public Sub projectionTemplateFormat() Dim t1 As Double, t...
I spotted this tutorial example at compactcpp: #5 – Parsing strings into “tokens” #include <iostream> #include <string> //This program is extremely crude, but it indeed works for its intended purpose. //There are many other better ways to do this. int main() { //Here, we use a std::string to hold our input. ...
I developed a server which takes a directory name then lists files in it and sends this list to a client. And I want that server to work with Telnet. It works but I have some questions on how I can do this better: My client can take some directory names from arguments and sends them to the server in a cycle. Server re...
In my presentation layer I use an MVC pattern with DI to achieve thin controllers like so: public class HomeController : Controller { private IHomeService _service; public HomeController(IHomeService service) : base() { _service = service; } public override ActionResult Index() ...
This a basic filter I created with Angular that does temperature conversion. I'd like to get thoughts on how to improve this code from both an Angular and general JS perspective. The filter should take 2 arguments: scale: The temperature scale to convert to label: Whether to append a degree symbol to the number In th...
I have a system that will be sending telemetry or events to a DB table and I want to limit how many HTTP connections it opens to my server but at the same time I don't want the events accumulating and sitting on the client machine for too long. For example I could get a burst of events or I could get one event and not...
I am trying to find out what would be the Big O notation of a quick sort implementation I wrote. If I can get some analysis on the code, that would be great. public class JavaApplication1 { public static void main(String args[]) { int[] input = { 23, 31, 1, 21, 36, 72}; System.out.println("Before sorting : " ...