instruction
stringlengths
71
71.9k
I have a Part of Speech Tagger written in PHP that currently takes a relatively long and unpredictable time to execute - just wanted to know if any of you knew of any quick ways I can improve time efficiency in this class - not necessarily related to the algorithm itself, but even the construction of the PHP code. <?ph...
Lately there has been some questions regarding calculators, where the response typically has suggested simplifying the logic and using either abstract syntax tree or token lists (like I did myself in a Java calculator question). To prove the concept, and as a training exercise for my self I implemented this calculator ...
I have made a little shop keeper program and I would love someone to critique it and list all of the improvements I could make. This is my first time using OOP techniques so I imagine there is a lot to be improved upon. This program allows you to purchase - and sell - up to 5 items from a shop seller and has a currenc...
After reading this article, I've decided to take a crack at implementing a "safe_strcpy" function that would remove some of the errors that the author speaks about. Obviously, my safe_strcpy() function is inspired by his. Below, I've created a simple class that houses a std::array of one of the many different kinds of ...
I have created canvas (800x400) - and filled it with a grid. It works but the rendering of the grid (lines) takes around 3 seconds, which seems excessively long. Am I doing something wrong? var drawGrid = function(w, h, id) { var canvas = document.getElementById(id); var ctx = canvas.getContext('2d'); ctx...
I do not have a whole lot to do over winter break, so I wrote this little script to automate a Wordpress install (currently can only install once instance) on a fresh Debian server (tested, working with Wheezy). It may be pretty sloppy because it's the first thing I've actually tried, but it's a start I guess. I was no...
Following-up to my previous question, this class is now based on an iterator. The class, instead of forcing the programmer to use up a bunch of memory just to get each progressive number once, they can now use an iterator. The class itself is also now based on an iterator, which makes my life easier too. No more initFi...
Following function will parse string resp, which will be like shown in following example. I will get an IP address in the form of a hexadecimal string like "C0A2AA32" and I need to convert that string and save it to a file. Example of resp: "This is just a string with ip="2342A022" now I need to parse it" void WritePub...
I'm trying to practice STL so I implemented breadth first search and depth first search. I have designed the graph class so that vertices can be arbitrary hashable object. Any feedback would be appreciated #include <deque> #include <vector> #include <unordered_set> #include <unordered_map> #include <iostream> template...
I have created a StopWatch class to measure the performance of any code. I use this StopWatch code in any of my multithreading projects as well. public static class StopWatch { public static ConcurrentHashMap<Long, Long> histogram = new ConcurrentHashMap<Long, Long>(); /** * Creates an instance of the ti...
I have a below code which constructs the URL given a FlowType enum. private String getURL(FlowType type) throws Exception { StringBuilder url = new StringBuilder(); if (TestUtils.isProduction()) { if (type.equals(FlowType.HOLDER)) { url.append(VISITOR); } else { url.appe...
Yesterday morning I decided to stop procrastinating and start learning me some Haskell. So far I've made this, which is a simple cli 'dice rolling' utility that can be used like: $ ./dice 3d20 You rolled: 17 The code looks like this: import Data.List.Split import Data.Char import Control.Monad import Control.Monad.Ran...
I need the byte representation of a given type, especially double, float, int8, etc. typealias Byte = UInt8 enum ByteOrder { case BigEndian case LittleEndian } func pack<T>(var value: T, byteOrder: ByteOrder) -> [Byte] { let valueByteArray = withUnsafePointer(&value) { Array(UnsafeBufferPointer(s...
I request a review on the way multiple producers and consumers access multiple shared queues. What I have done here requires the threads to check for the space in queues minimum two times. Can it be made better someway? Of course, I can create another queue where these queues will be kept in the decreasing order w.r.t ...
The code has been test to work by the parameters listed below I just wanted to know if there were any details that I missed or blatantly overlooked. Develop a Java application that determines whether any of several department-store customers has exceeded the credit limit on a charge account. For each customer the foll...
Requirement I have an entity named ImportData which can be processed once in order to extract data from a file fed to the application. I need to make sure that, in case of concurrency, only one process is capable of processing that import data. Other processes shall not attempt to read the file and insert data into dat...
So, I have two tables, customers and orders and I want to get all orders associated with a customer. The tables look like this: Customers customer_no order_no 1027 V327 1027 V391 1028 V400 etc.. Orders order_no article1 article2 size order_date quantity V327 Jeans Bla...
I'm just wondering what is the cleanest way you can write your GUI/Swing code? Right below is the code I have for my main frame. Could you guys let me know if it looks clean/understandable, and if there is any way I can improve it? The code I have provided is the main frame of my program, which is basically a GUI progr...
Problem statement Create one form having registration and student login fields for course using HTML5 elements and CSS3 styling. Expected Output Solution <style type="text/css"> .div{ height: 20px; background-color: #2A646C; width: 60%; margin: auto; ...
About / Background This is indirectly a follow up from: General Game Loop 3.0, if you prefer to test against it, feel free to. That code is very outdated now though. A test suite is given at the end. For the actual class to direct feedback against: MyText.java, a short description of it follows beneath, as well as a te...
I wrote a program to simulate this week's 538 Riddler, reproduced below: You’ve just finished unwrapping your holiday presents. You and your sister got brand-new smartphones, opening them at the same moment. You immediately both start doing important tasks on the Internet, and each task you do takes one to five...
I have a third-party object with asynchronous start and stop methods. Each start and stop may fail with exception. The object is not re-entrant, i.e. I can only call its start or stop method after the previous start/stop has completed. I need to have a class that handles those transitions to the correct (=last asked) s...
This is something I put together from a 3D Soft Renderer I previously wrote in Java. I have less experience in C++, but I thought that being able to render 3D shapes in a console simply by printing characters (Like Perspective ASCII Art) would be a fun challenge. This was mainly for educational and learning purposes an...
The following code finds the max depth of nested parentheses in the given string - for example, for {}{}{{}} it outputs 2. If the given string doesn't contain correct sequence of parentheses (like {{}), it outputs "NIE". User enters the length of the string and the string. My concerns: the algorithm is somewhat slow, a...
On my site I have a navbar component that I want to customize for each and every ng-view I end up loading. Currently I'm doing this as follows. I have a NavCtrl for the navbar itself and my ng-view directive sits outside the scope of this controller. And I use a navbar service to change/override functionality in the na...
I am beginner in EmberJS. I have made todomvc for ember v2 for learning Ember. My implementation works without controller. I use components instead controllers. In the documentation I see: Controllers are very much like components, so much so that in future versions of Ember, controllers will be replaced entirely wit...
This is my Queue implementation in Java. Would appreciate a review of the code. import java.util.Iterator; public class Queue<T>implements Iterable<T> { private Node first, last; private int size; @Override public QueueIterator iterator() { return new QueueIterator(); } private class...
I have 2 methods for getting data from the database (the data I get are both List of tuples with doubles and datetimes in it). I would like to know if it is possible to use one method for both queries. How can I make this code DRY? In my opinion I'm defining 2 methods which clearly does nearly the same. How can I impro...
I have two files, namely: File1: CL1 AA XX YY ZZ SS \n CL2 3_b AA File2: AA string1 AA string2 3_b string3 My expected output is: CL1 AA string1 CL1 AA string2 CL2 3_b string3 CL2 AA string1 CL2 AA string2 For this I wrote a following code: import numpy as np print("Reading Files...") header = open('File1'...
I have the following code which sets input values using jQuery/AJAX. Can the repetition of the code be shortened in anyway? It's mainly the AJAX requests I'd like shortened. It doesn't seem right to be making so many AJAX requests but despite my research I can't seem to find a way to improve things. // set property def...
I just some reviews on how I can make it more efficient or cleaner and what I should fix in general. class bankAcc { public: bankAcc() = default; bankAcc(string fn, string ln) : firstName(fn), lastName(ln) {} bool createUser(istream &is); bool login() const; private: bool correctLogin(const string&,...
I have lines_list_copy of the form: [['a1', 'b1', 'c1', 'd1', 'e1'], ['a2', 'b2', 'c2', 'd2', 'e2'], ... ] I needed to remove all duplicate entries where a,b,c,d are identical. So note that I don't care about what value e has. So for example, If lines_list_copy = [['a1', 'b1', 'c1', 'd1', 'e1'], ['a2', 'b2', 'c2', 'd...
The challenge is simple: Return the length of the longest word in the provided sentence. The solution is just as simple: function findLongestWord(str) { arr = str.split(' '); size = 0; for (var s in arr) { if (arr[s].length > size) { size = arr[s].length; } } return size; } However, I vaguely...
I have created mini-opengl program that draw simple chess board on screen by using SFML windows model only. The program runs fine. The main purpose of this program is to keep it as simple as possible and it is not rely on any of OpenGL helper functions like glOrtho or gluOrtho2D for converting coodinates. Also, it is n...
Here's my implementation of a Singly Linked List. Would appreciate a review. public class SList<T> { private Node head; private int size; private class Node<T>{ public Node(){ item = null; next = null; } public Node(T item){ this.item = item; ...
Here's my implementation of a Stack in Java, all feedback welcome. import java.util.Iterator; public class Stack<T> implements Iterable<T> { private Node head = null; private int size; @Override public Iterator<T> iterator() { return new StackIterator(); } private class Node<T>{ ...
This is my implementation of the stack data type in C language. It is static meaning it does not grow in size. Any suggestions or feedback would be much appreciated. #include <stdio.h> #define MAXSTACKLENGTH 6 #define true 1 #define false 0 struct stk{ char content[MAXSTACKLENGTH]; int top; }; typedef struct ...
For practice in Python OOP (first time) and for some relaxation from trying to learn Serialization in Java, I decided to write a LinkedList in Python. Now, this class would be pretty useless, because in Python, instead of: (Java) int[] array = new int[size]; // initialization... // Now add an object to the end int[] ne...
I solved the problem but for two test cases, it's giving me timeout error. It's taking longer than 2 seconds on their servers. I tried using <ctime> to calculate the run time of the program and on my system, it's taking between 1.3-1.6 seconds. It's only giving me error for TestCases #9 and #10. The question is to find...
I was searching for a non-recursive odd-even mergesort implementation and found this one: Sedgewick R. The resulting sorting network is not an odd-even-merge sort network. When one draws a diagram of the pairs, it can be seen that too many pairs are generated and others are missed. So here is an image of a correct ne...
This piece of script will take one argument (file which contain list of ip, one per line) and convert it to its hostname. For now this will only work with IPv4. This definitely doesn't look good and I want experts to review it and suggest some good ways of coding it in Python. #!/usr/bin/python import socket import sy...
It is not related to GUI. I have a class with: Private List, which is edited inside the class. Open IReadOnlyCollection property for access to private List Public event for notification on List changing A list stores objects with properties. The class can changed an item's properties and notify about it. The user c...
This is my initial Facebook helper class. Is this code efficient or is there a way to improve this code? using UnityEngine; using System.Collections; using Newtonsoft.Json; using Facebook.MiniJSON; using System.Linq; public class FacebookManager : SingletonEternal<FacebookManager> { public string accessToken; ...
I'm trying the write a threadpool that can safely be added inside a signal handler or in code forked by multithreaded code. Are there any corner cases that would cause this code to fail? What could be done to improve this code? #include <pthread.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <s...
While I do know that there are many questions regarding "password generators," I have a different approach and would like to know if it is effective. 1) The below password generator takes on a different approach that other basic password generators, creating an empty string of x length, x being the desired length of th...
In the following query, I am fetching all the projects items with specific project id. At the same time, I am using a join in Select to fetch the delivered quantity of items of this project only. The delivered quantity join feels very costly because if I have 7000 items, it will multiply the iterations. In there any be...
Are there any advantages on using array_map & trim vs using simple str_replace? The input for both is an array of matched URL segments. I find it nice to be able to provide extra logic when using array_map but seems to be ~2 times slower. I did some trivial benchmarking for ($i = 0; $i < 10000; $i ++) { array_map(f...
In the standard library, there are no algorithms for element updates. This makes it unsuitable as a queue for a Dijkstra's algorithm, for example. Thus I implemented generic heap update functions with the interface in line with the standard library. Warning: the standard does not specify implementation detail of a heap...
I have written a server-side and the client-side of a chat application. I would like to improve it and I am unsure about my server construct and have absolutely no idea if there is a better way to do it. I haven't found anything on Google, therefor I ask you. The construct I have used is from a tutorial from Oracle I f...
I was trying to replicate Python's internal round() function. The program asks for a number, converts it into a float (catches the value error if present) and gets the absolute value of the float (to handle negative numbers). def rounder(): number = input("Give me a number to round off!: \n") #Makes sure you...
I want to improve the performance of this code: #!/usr/bin/env python # -*- coding: utf-8 -*- import numpy import random import math random.seed(42) class TrainModel: def __init__(cls, scheduling_interval, trains): cls.scheduling_interval = scheduling_interval cls.trains = trains class Train: ...
I was using dataTables.net's responsive plugin before this, and am happy to say that my (much simpler) code runs about 5 times quicker than that did. On my machine the fiddle averages about 50ms versus 250ms if I use DT responsive. Is there anything I should do to improve performance of my code? Can it be made better?...
This is an updatable priority queue. In contains an index (implemented as std::unordered_map) which maps a value to its position in the queue itself. The queue is implemented as a binary heap in a std::vector. This class stores each value twice: once in the queue and once in the index. Internally it uses a self-reporti...
I have a text file that contains 100,000 numbers from 1 ~ 100,000 in an unsorted manner (no duplicates). The name of the file is "IntegerArray.txt" My task is to count the number of inversions in the text file. An inversion is a pair of elements a, b where a comes before b, but a > b. Thus "1 2 3 6 4 5" contains two ...
Scenario: I want a task scheduler that enables my application to schedule some tasks in small time interval. I want to use it in my socket server application. For example, when the user connects to the socket application schedule some task in 15 seconds to disconnect user if no actions were made. Queuing task for spec...
I managed to make a simple function that calculates the Hailstone sequence of numbers and print it out, and I just done a calculator that grabs the number with the largest sequence smaller than n — and it may disprove the Collatz conjecture. Code with input numbers: #include <iostream> #include <string> using namespac...
I'm currently developing a TYPO3 Extension in PHP and developed a Hook. TYPO3 has the concept of Hooks where you can execute your own code as specific points. As defined in our definition of done, we want to PHPUnit-test our code base. I did some small tests before, so I'm familiar with the basic concepts. Below you ca...
I came across this SO question on why std::max_element requires a ForwardIterator (as apposed to an InputIterator). Having a max_element-like algorithm for InputIterator would be useful, as it could then be used with objects like std::istream_iterator or boost::transform_iterator. I came up with the following algorithm...
I am attempting to create functions for getting an algorithm, hashing and un-hashing a string. As it stands, it works, and very well. But, I feel this is not secure enough and someone could easily break it! Can someone help me to improve this? Code: <?php function HashIt($string) { $return = ''; $algo = GetAlgo...
I already posted this program numerous times, always surprised by the amount of improvement that is possible suggested by people here. Is it possible to make it even better, without nitpicking? At this point this is a special curiosity of mine =). # win sequences constant WIN_SEQUENCES = [[0, 1, 2], [3, 4, 5], [6, 7, 8...
I have made a tool that is pretty useful for me. I have made it open source on github. It is a server that listens for requests and returns an HTML static version of a single page app. It works with a convention that when the title of the page changes means that the new page is rendered. The way it works is very simple...
My AngularJs app is currently working fine. I'm working on modularity, refining my code design, and making it more readable. I have a app.js file that contains the module, the run block, and configuration definitions. By default Ionic uses the Ui-Router for route definition, so the routes are defined in my config block...
I have an class that cheaply imitates a lazy evaluation scheme. The class is for representing a file and additionally providing meta data on the file. Some of the meta-data can be expensive to evaluate so I only want to evaluate it when requested, and only evaluate it once. My implementation is such: All private membe...
This is a problem from my Introduction to Algorithms textbook. Consider the infinite sequence of numbers An|n>0 = (1,1,3,4,8,11,...) defined recursively as follows. $$ A_n = \left\{\begin{aligned} &1 && n = 1,2\\ &B_{n-1}+A_{n-2} && n > 2 \end{aligned} \right. \\ B_n = \left\{\begin{aligned} &2 && n = 1,2\\ &A_{n-1}+B_...
Am I commenting enough? Are my variables properly following correct styling format? Is there a more efficient way to code my "Label coloring" conditions? from tkinter import * import subprocess import re running = False # Infinite loop condition idle_status = 'To begin, please press "Start"' # Message for Idle Status ...
The purpose of this little program is to: Separate IPv4 addresses and IPv6 addresses Will be able to sort them even if the formatting of the input is not great Sort them into an order Print them into the system terminal in ascending and descending order I would like to know if you think the program what it is meant t...
I wrote a router class which accepts a URL and calls the appropriate controller method based on it. I'm a little worried about the amount of dependencies it has (eg ErrorController, RequestMethod, etc), because it might make reusing it in other projects difficult. It feels especially bad because a lot of the dependenc...
I'm trying to get into C, and I was wondering if I messed up regarding correctly implementing a linked list. node.h typedef struct node { int n; struct node* next; }node; code #include <stdio.h> #include <stdlib.h> #include <stdbool.h> // struct for linked lists #include "node.h" bool searchLinked(node* list...
After almost completely redoing the first version I think I finally have it. I still have a few things to add/change, but I think it's pretty good and safe. I've improved security features as well as overall functionality. I haven't run this program through pycharm yet, so there might be a few PEP 8 errors. It took me ...
I have a website, where one of the options that a user gets is to change their avatar. I would like to know if there is anything that I shouldn't or should be doing... So here is what I've got. Here is my PHP file that handles uploads: <?php include('./config.php'); $user = $_SESSION['user']['id']; $hash = rand...
I have written a class that is intended to execute a unit of work to be run in a separate thread. The intended use case for this class is running business logic off of the user interface thread so as not to lock it up while waiting for long running processes to finish. Here is the class: import javafx.beans.property.Ob...
I have solved this simple challenge on Advent of Code: Santa is trying to deliver presents in a large apartment building, but he can't find the right floor - the directions he got are a little confusing. He starts on the ground floor (floor 0) and then follows the instructions one character at a time. An opening...
This is a rather simple grade calculating application. Typical assignment or text book project. I've recently finished an introductory course to java, and have been continuously practicing by picking up random projects to see what I can do. I just recently made this Grade calculating project that I'm sure everyone is...
After studying several ways of doing OOP in JavaScript I think I finally came up with one that seems OK to me. Is it okay? Do you see some problems I can face by using OOP in JavaScript like this? JSFiddle test var Operators = (function ($, self) { var self = {}; //private var IPT_X = '#x'; var IPT_Y...
Here is a description of Project Euler problem 530: Every divisor \$d\$ of a number \$n\$ has a complementary divisor \$n/d\$. Let \$f(n)\$ be the sum of the greatest common divisor of \$d\$ and \$n/d\$ over all positive divisors \$d\$ of \$n\$, that is \$\displaystyle f(n)=\sum_{d/n}\gcd\left(d, \frac{n}{d}\right)\$....
I'm quite new to React and was working through the "Thinking in React" example, I noticed they used refs for updating state, but I also read on SO that using refs isn't that good in the long run, so I tried to redo this without using refs: JSFiddle var SearchBar = React.createClass({ handleChange: function(event) {...
This works, but I would like suggestions to improve it. For one I think the get posts shouldn't have to be repeated twice, but it only pulls the first two posts if I don't do it this way. Also, I think $incNum == 0 ? 'class="active"':'class' can be simplified, but if I take the second part out I get an error. <div cla...
I have the following code which switches between the states of hide() and show() of show prices button.I am aware about .toggle() in jQuery.But I couldn't find a workaround of it in this instance. When I click the button the <p></p> element is appended to .msg class in the div and when I click it once again it hides it...
This is my game manager script and is there anyway i can improve this code. using UnityEngine; using System.Collections; using System.Collections.Generic; using System.Linq; using UnityEngine.SceneManagement; public class GameManager : Singleton<GameManager> { public Game game=new Game(); public PendingGam...
I've written a generic implementation of the A* algorithm as a first Go program, since I had implemented that both in C and in Python before and Go reminds me a bit of both. I'm looking for general commentary on bad practices, specially concerning the following: References I don't think I've ever seen a struct being pa...
I have the following requirements: /* Collection Write a program that counts the number of unique words in a large text file. a] Store the words in a collection and report the number of unique words. b] Once you have created the collection, allow the user to search it to see whether various words appear in the text fi...
I am working with some Java code. Basically I have a wrapper class that holds a string and implements some of the many useful python string methods in Java. My goal here is to implement the Python method .ljust and my hope is to be as efficient as possible. Currently, I am using a while loop which I imagine is terrible...
I am creating simple quiz app in Django. It works, but I think that way I've done it is not the best. I have Exam detail view, which display questions related to that exam and answers for these questions. What are your suggests about it? I pasted only models, because I think that this is the problem here. from django.d...
Have you got any suggestions to improve this code? The idea is to generate a one-line string that is visually symmetric. Revisions at Github <p id="display"></p> <script> var display = document.getElementById('display'); var chars = [33,34,39,42,43,45,46,48,58,61,72,73,77,79,84,92,94,95,111,124]; var double_chars = [...
This question deals with the ability to construct a structure that is able to be easily iterated through. The problem: I have four different "boxes": Box A: Always has 1 apple and 1 pear Box B: Always has 1 orange and 1 pear Box C: Always has 1 peach Box D: Can have varying amounts of apples and oranges (0 - 10+) but ...
Problem Statement Create one form having following fields 1) Email ( with html5 email validation). 2) Password (It should take minimum 6 charactors ). 3) Your project URL ( with html5 url validation). 4) Project completion date ( with html5 date validation). 5) Current month ( with html5 month validation). 6) Current ...
This is a pretty basic bash script (3.2 on Mac). I am downloading 584 images from a site in order to create an album. #!/bin/bash urlFirst="http://150.216.68.252:8080/adore-djatoka/resolver?url_ver=Z39.88-2004&rft_id=http://150.216.68.252/ncgre000/00000012/00011462/00011462_ac_0" urlSecond=".jp2&svc_id=info:lanl-repo/...
From K&R exercise 1-21, Write a program entab that replaces strings of blanks by the minimum number of tabs and blanks to achieve the same spacing. Use the same tab stops as for detab. When either a tab or a single blank would suffice to reach a tab stop, which should be given preference? My solution: #include ...
I have written a small app that fetches news items from an endpoint and displays them in a grid. I used React to create components and use them throughout the app. This is the first thing I have built using ES6 - mainly for syntactic sugar. I tried to match the BBC News page style, so it should look very similar. It's ...
One of my latest refactorings for Rubberduck is Move Closer To Usage. The refactoring will take a field and move it just above the reference to it only if it is used in a single method, or take a variable declaration and move it just above its first call. As promised, I moved many of the duplicated support methods int...
CATS, willing to get a hold of all the bases, asked Dijkstra to give him a hand designing the most powerful algorithm to reach all bases with the least distance travelled. I tried to implement the Dijkstra's algorithm using TDD. This algorithm is designed to find the fastest route to reach all nodes of a graph. Right...
This is one of the first Verilog programs I have written. I have a Xilinx Artix-7 FPGA card. Right now I just have it transmitting an "X" every second. It works and I can see the result in my serial terminal. It uses a UART over USB connection. I'm just wondering if I can get some feedback on my code and if you see ...
If I am not mistaken, this method has a complexity \$O(N^2)\$: int[] exampleArray = { 4, 6, 2, 2, 6, 6, 1, 55, 55, 2, 5, 6, 90, 8, 8, 8, 10, 70 }; int k = GetMaximumCycle(exampleArray); public static int GetMaximumCycle(int[] anArray) { int length = anArray.Length; int result = 0; for (int i = 0; i < length; ...
In a small game project I'm using 'Init' and 'Shutdown' functions on Systems/Managers/Components to make resetting them easier without having to call the constructor/destructor. For example when reloading a level you can just call Shutdown and Init to reset to the starting state. A potential problem however I noticed i...
I have a block with an undefined data and a pair of REP [code]: arr: [ REP ["code1"] | 'something "f" | [ f | 3 ] REP [40 + 2] ] The pair can be everywhere in the arr. I replace every occurrence of a pair REP [code] with a value from evaluating the code. t: true while [t == true] [ f: fin...
I have been tasked with creating a report for a high-volume restaurant that shows hourly sales information for a given timespan. When generating this report for a single day, it's very quick, but when generated for even two days, the length of time grows tremendously. I was originally doing subqueries to get the data t...
This method finds the maximum in a binary tree. I have used generics to make this code more usable. However, I am not sure if I have written efficient and good Java code. This is a method inside a class using generics and implementing Comparable interface for the generic parameter E. private E maximumElement(TreeNode<E...
Here is a description of Project Euler problem 530: Every divisor \$d\$ of a number \$n\$ has a complementary divisor \$n/d\$. Let \$f(n)\$ be the sum of the greatest common divisor of \$d\$ and \$n/d\$ over all positive divisors \$d\$ of \$n\$, that is \$\displaystyle f(n)=\sum_{d/n}\gcd\left(d, \frac{n}{d}\right)\$....
Details about spring's caching framework are here. When I was reading this link, I thought the composite cache mentioned there was one that used levels of caching based on the order given to the constructor. On reading the documentation here, I realized that it was not so; this was so that different caching solutions c...
Originally, this script stemmed from a small script that watched stars and who made them, but a few days after launching, SE patched it so the people behind the stars aren't sent. Regardless, BigBrother, named after the character from 1984, had other functions, like monitoring obscene or unsightly chat messages and mon...