instruction_seed
stringlengths
71
95.1k
_source
stringclasses
1 value
Ages ago I made a small bash script which would add a command cdp, standing for "change directory - project". What it did was simple, it added all folders in ~/projects as autocompletion and CD'd me into them using only the project folder's name. Over time I switched to a different company where I started working with ...
stackexchange/codereview
I've been interested in writing something meaningful in C++ for a long time, yet I had a hard time not picking Java or C# for a new project... Now I've found something for which C++ seems to be the right tool: Writing a Database Management System. I'm going to show you the code for the first step: Storing databases. Th...
stackexchange/codereview
I just started making a text adventure game in Haskell. Because this is the largest project I have done in Haskell, I wanted to ask about it here before I got too far on it. I am still pretty new to Haskell, so I would really appreciate any advice at all on how this could be improved. To compile the game, I just used g...
stackexchange/codereview
This is sourced from the Stanford Coursera self study DB class SQL quizzes. Students at your hometown high school have decided to organize their social network using databases. So far, they have collected information about sixteen students in four grades, 9-12. Here's the schema: Highschooler (ID, name, grade) ...
stackexchange/codereview
I have coded more in Python but I am learning Ruby now. So I am trying to write a solution to create a family_tree and add and get relationships. The code below is of the file that contains the main function which is called from the command line. The below code works and solves the problem but I have written methods wi...
stackexchange/codereview
I have code that is accessed by multiple threads. If by any chance it has a problem, all accessing threads will wait for recovery. By default, the first thread that fails, will have to recover and all others will have to wait. When the process is complete, everyone leaves the method. [TestMethod] public void Recover...
stackexchange/codereview
I have a button (or icon) which can have three states. On hover, it changes state and on click, the new state gets transferred to another state. This state is kept until you click again for which it gets back to normal. The code is working, but it does not look or feel good. Is there any way I can re-factor this? Fidd...
stackexchange/codereview
I calculate the lowest quarter-hour using the following code: public Date getQuarter() { Calendar calendar = Calendar.getInstance(); int mins = calendar.get(Calendar.MINUTE); if (mins < 15) { mins = 0; } else if (mins < 30) { mins = 15; } else if (mins < 45) { mins = 30; ...
stackexchange/codereview
This is a query to return search results, but I feel it could be cleaned up a little. I just don't know how. var queryResult = (from r in dc.Retailers where (string.IsNullOrEmpty(firstName) || SqlFunctions.PatIndex(firstName.Trim(), r.FirstName.Trim...
stackexchange/codereview
Based off simple controller implementations like those seen in micro-frameworks like Slim, Silex, F3, Laravel, Tonic, Flight, Klein, etc. /EDIT tried to link the above sources, but as a new user I only get 2 links... Any potential issues? Improvements? class Router { private static $routes = array(); p...
stackexchange/codereview
This is a c# class I use to implement web database applications with Microsoft IIS and Microsoft SQL server. It passes the http context to a selected SQL stored procedure, and writes a response based on the result sets generated by the stored procedure. Thus the entire application is coded as SQL stored procedures, apa...
stackexchange/codereview
I can feel the following is definitely not the optimal nor the cleanest way to do this. But I'm not quite sure how to refactor this. const formatBtnText = (txt, color, image) => { const regex = /{image[\d]*}/g; const matches = [...txt.matchAll(regex)]; if (!matches) { return <Text style={[styles.buttonText, ...
stackexchange/codereview
After reading some articles about immutability, I found out that there are persistent data structures. In the following, I implemented a stack as a persistent data structure. What I like about the code in the current state it contains no if-statements no method is longer than one line it works like recursion Implem...
stackexchange/codereview
This function takes a string array, {"foo", "#123", "#124", "bar", "#125", "#126"} makes a new array with the numbers converted to a range: {"foo", "#123:126", "bar"} and returns: "foo,#123:126,bar" Note it doesn't and shouldn't change {"#1", "#2"} to {"#1:#2"} using System; using System.Linq; using System.Collecti...
stackexchange/codereview
Following is the main file in the project (executing tasks). It uses the mpi4py module, and multiple processes execute the same code. Please review the code and post your suggestions on making it more efficient and pythonic. from mpi4py import MPI from Peers import Peers from SegmentHandler import SegmentHandler from C...
stackexchange/codereview
I have the following code for separating out overlapping rectangles vs. non-overlapping rectangles in C++ 11: #include <stdio.h> #include <opencv/cv.h> #include <opencv/highgui.h> #include <opencv/cxcore.h> #include <math.h> #include <array> int main() { auto detected = get_detected(); std::vector <Rect> singl...
stackexchange/codereview
I'm looking for some feedback on my lock-free queue, based on Disruptor, mainly for any potential concurrency issues, such as where I need additional fences. It looks correct to me, and I can't seem to able to break it, but I'm only testing it on my x86 machine. #pragma once #include <atomic> #include <cstdint> templ...
stackexchange/codereview
I want to get the number if items with state 4 and 1 from my database for each day between a certain date. Is there a smarter and more performative way than this one? I am aware that I should use MySQLi and that MySQL is deprecated. Code explanation: the for loop is to go through everyday between 2 dates $sql_conditio...
stackexchange/codereview
I'm designing and developing wizard-like app for populating the database I created with data from different sources. It's my first attempt to design and develop well-structured object-oriented software from scratch (including database, web API + web site + client desktop app and this app for working with database). Sin...
stackexchange/codereview
I'm learning C# and have written a function which generates an easily-pronounceable fictional name by alternating between taking one vowel and one consonant. The one parameter, halfLength, will be the amount of vowels added and the amount of consonants added, meaning that the length of the returned string is double the...
stackexchange/codereview
I need help to optimize my code for huge lists with approx. 10000000 elements. Is there a way to improve my algorithm or should I try to build a new one using a completely different approach? Task: given a list of integers and a single sum value, return the first two values (parse from the left please) in order of appe...
stackexchange/codereview
I may introduce a Python code of prime factorization which is from my personal project that I'm working on. import timeit import gmpy2 import math A = gmpy2.mpz(11111111111) # Input a positive integer to factor. # Put it inside the parentheses as "A = gmpy2.mpz(....)" def factor(A): B = gmpy2.mpz(math.sqrt(2 * A ...
stackexchange/codereview
What do you guys think about this? I myself think it is pretty usefull, But how does it look from an OOP perspective? Here's an example class public class Person { private string firstName, lastName; private int id; private static int statId; private static List<Person> persons = new List<Person>(); ...
stackexchange/codereview
I was trying to explain the mediator pattern to a new developer, and ended up writing a simple event mediator. Thoughts? EventMediator class EventMediator { private $events = array(); public function attach($event, Closure $callback) { if(!is_string($event)) throw new \InvalidArgumentException(); ...
stackexchange/codereview
I'm trying to understand memoization using Scala. I took the Fibonacci sequence as an example because of the high cost of recursively computing numbers in the sequence without memoization. class memoize private (val f: Int => Int) { import scala.collection.mutable val cache = new mutable.HashMap[Int, Int]() def m...
stackexchange/codereview
I have the following tables productstbl =========================================== SegmentCode CategoryId ParentId ============================================ ----------------------------------------------------- categoriestbl ================== CategoryId name ==================== ------------------------------...
stackexchange/codereview
I'm creating a MUD and am running into some design issues regarding Items. Items are stored in an ItemDatabase after being read from a JSON file. template <typename ItemType> static void load(std::string const& filename) { PropertyTree propertyTree; boost::property_tree::read_json(filename, propertyTree); ...
stackexchange/codereview
I've been messing around with the SE Data Explorer and I've come up with a query that basically returns information about questions that have a high number of views per day, that have few or no answers. SELECT TOP 500 Question.ViewCount, DATEDIFF(dd, CONVERT(date,Question.CreationDate), CONVERT(date,...
stackexchange/codereview
Attached below is my code for generating the confidence maps for the joint locations, it is in the same vein as the maps generated for the paper Convolutional Pose Machines and OpenPose. I am wondering if anyone has input on how to speed up the process, as when I try to train my own variant of OpenPose or Convolutional...
stackexchange/codereview
First of all i made a simple code to insert data on my table, with the information from this code i made a loop to insert data on another table for a notification system. I'm new to PHP and i think that this query that is being executed into a loop is really poor in performance, example: if i have like 100K users, this...
stackexchange/codereview
Idea After a handfull of small javascript-projects, I also wanted to work a bit with php now. I decided to create a simple contact-form. Of course, I wanted it to be as spam-save as possible, so I used some of the ideas I found online (honeypott and some sort of CAPTCHA). I realized the CAPTCHA-idea in the following wa...
stackexchange/codereview
I'm trying to convert a string (here after called input) into a vector of key-value pairs, all in C++03 (cannot use C++11, cannot use Boost libs). The string in question can contain whitespaces. A comma (,) delimits key-value pairs and the equals sign (=) separates the key from the value. A sample string (also in the c...
stackexchange/codereview
I am used to accessing items from an array, returned by the Split function, directly. This is lazy, I know. Usually, I know the element I want and I say something like: Debug.Print Split(href, "/")(0) Questions: 1) Can I do something similar to access the UBound of the array returned? 2) What is the "best practice" wa...
stackexchange/codereview
I run a script to download a file and unzip it. An import process then runs and leaves the files in their source location. I wrote the fully functioning code below to clean up that directory to be ready to use the next night. I streamlined as much as I believe possible. I realize ~15 lines of code isn't exactly verbose...
stackexchange/codereview
From the last few days I have been studying scraping webpages and for further development I challenge myself to transform the script I have created into a class which will receive inputs from a user. The main reason I'm posting this is because I would like advice and insights on how should I approach and manipulate ins...
stackexchange/codereview
For self-study homework I made a Java program that takes user input, creates people as objects, and says "Happy Birthday" to each person. I am just wondering what mistakes I made here or how it could have been better. PERSON CLASS public class PeopleObjects{ // For practice, make the people objects rather than just...
stackexchange/codereview
(This is a follow on to this question). Having given an implementation for some of the graph structures, here is a portion of the algorithms that are defined to work over them: graph_degree.hpp /*! \file graph_degree.hpp * \brief Algorithms relating to node degree. * * Defines core algorithms to investigate inde...
stackexchange/codereview
isPalindrome :: Integer -> Bool isPalindrome n = reverse x == x where x = show n is3x3 :: Integer -> Bool is3x3 n = any (\x -> cond1 x && cond2 x) [101..999] where cond1 x = n `mod` x == 0 cond2 x = length (show $ n `div` x) == 3 main = print $ head [p | p <- [999^2,999^2-1..], isPalindrome p...
stackexchange/codereview
I am using Python with libtcodpy to build a turn-based strategy game. In this game each unit has a maximum range which varies from 4-10. This range determines how many "steps" the unit can take and therefore the distance it can move on the game map. I wish to output all the squares which the unit can move to, based upo...
stackexchange/codereview
I have created a script (mediawiki gadget), which iterates over every redlink in a rendered wiki-page (that is, over every href with class new, signifying an internal link to an article that does not exist), and checks if the title exists in a set of known pages. If it does, a few attributes are changed. The execution ...
stackexchange/codereview
This is my 2nd shot at dynamic memory allocation. This project is for practice purposes. So many things were considered whilst writing this minimal project. I considered using placement new to dynamically allocate memory, this would be optimal for large objects. I finally resolved to restrict user of my class to c++ b...
stackexchange/codereview
For a web application, I have to transform a LaTeX document on the fly into an HTML string, that is delivered to connected clients via websockets. Thus I installed a filewatcher that waits for file updates and whenever the file is modified, I run transformToHTML to parse the LaTeX code with regular expressions and buil...
stackexchange/codereview
I needed a way to cache a large number of objects with two different types of keys. In my case: A String key represents my object in a serialized form. This way if I get the same serialized object from an outside source, I an easily determine if it already exist and avoid re-parsing it (I just re-put() the existing en...
stackexchange/codereview
I am using this code to display all the permutations of a given input string. Any advice/solution will be very helpful. #include<iostream> using namespace std; /* Function to swap two characters */ void swap(char& a, char& b) { char temp; temp = a; a = b; b = temp; } /* Function to obtain permutations of string c...
stackexchange/codereview
I am working on sending a reset token via email to a potential user in Node.js, Sequelize, and Express. The code works, but I still think it could be improved by handling the promises better. exports.sendResetToken = function(req,res) { const username = req.headers.username; User.findOne({ where: {username: use...
stackexchange/codereview
I wrote my own version of a search binary tree in Java. Could someone kindly review it? public class Tree { private Node root; public Node find(int id) { Node current = root; while(current != null) { if (current.getId() == id) // Node found retur...
stackexchange/codereview
I'm pretty new to Go, and I do not know the best or idiomatic ways to do most of the stuff, so I'd appreciate feedback on how to make my code better, faster or more idiomatic. My program is a set of methods/functions to parse an infix notation expression then convert it to reverse polish notation using Dijkstra's Shunt...
stackexchange/codereview
I order to speed up opening of a file (which contents are displayed in a series of tabs), I made it so that tab content is generated only when the user first clicks on the tab. If user never opens the tab, code never executes. The problem is I could not any find any TabPage events that would trigger when that tab is se...
stackexchange/codereview
I created a small console application to recursively search a folder and all subfolders for files that contain a match for a regex. The command line arguments are the path you're looking to search followed by the regex (in .NET regex format). I break this up into two threads: the main thread loops through the files and...
stackexchange/codereview
Recent take-home challenge I was assigned from a recruiter prior to technical interviews with the team. The team wanted it written in GOlang (I had no experience in the language) but told the recruiter I was confident I could complete the task. He mentioned he would let the team know of my inexperience with the languag...
stackexchange/codereview
This is a simple implementation of Conway's Game of Life in Java. The algorithm I use is inefficient however. Every Cell's neighbors (alive or dead) are checked on every iteration. import java.util.Scanner; public class GameOfLife { public final static int BOARD_HEIGHT = 20; public static Cell[][] board = new...
stackexchange/codereview
I want to write a function that validates the German tax identification number (Steuer-ID). The identification number consists of eleven digits. The last digit is only for checking. This is not what this question is about. The first ten digits of the identification number contain one digit exactly twice and another dig...
stackexchange/codereview
This is a component for a lexer which operates on a byte input stream that handles reading and decoding the contents of a string contained within double-quotes. The validity of the encoding is handled by CharsetDecoder#decode() which will throw an exception on an invalid buffer. The charset argument defines the encodin...
stackexchange/codereview
I wanted to write some more JNI code and decided to (re)implement a semaphore for MacOSX. In order to assert somehow correctness of my implementation I hereby supply a (multi)consumer/(multi)producer demo. semaphore_impl.h (autogenerated by javah): #include <jni.h> #ifndef MACOSX_SEMAPHORE_IMPL_H #define MACOSX_SEMAP...
stackexchange/codereview
import java.util.Scanner; import java.lang.Comparable; class InsertionSort { private InsertionSort() {} private static boolean less(Comparable v, Comparable w) { return (v.compareTo(w) < 0); } private static void exch(Object[] a, int i, int j) { Object swap = a[i]; a[i] = a[j...
stackexchange/codereview
I have a Lambda function that processes incoming messages and sends emails based on an enum type property in the message. I have N number of "handlers", one per type, and this number grows from time to time. I could register them in a simple object or Map, but I'd prefer to register them all automatically in a store th...
stackexchange/codereview
I started out creating a simple game in an Object Oriented way to practice. The rules are pretty simple There are two players You let one player choose if they want Heads or Tails. You assign the leftover option to the other player. You simulate a coin flip and say who won that game. More than the logic, naming con...
stackexchange/codereview
Here is some code which loops through an area in a spreadsheet and executes the code based on the condition that the source cells do not contain the value "(blank)". The code works, but it's very inefficient to run nested if statements in this manner. I've tried to have a go at making it more efficient in the long run...
stackexchange/codereview
I want to build Git class where i can store integers. FilesSet is where I store current state of integers. Commits' key is basically commit number so I can checkout pretty fast. Hashes is used for quick search of hashes that I need in commit part. Update is for updating current state of integers. In Commit I want to sa...
stackexchange/codereview
I have a piece of code that is used to calculate the cell centers in a rectangular mesh. The mesh size is pretty large (650 columns by 1150 rows). The code runs very slowly. I was wondering if I could employ any tricks to reduce the runtime. In the example below, deltax is a 1D array of column spacings and deltay is a ...
stackexchange/codereview
I'm learning how to use SequelizeJS. What i found was that (at least for me) the definition of the DB model was too invasive in my code when creating object. I was thinking that the user of your model should not have to learn how to use sequelize (or even that i use it at all) So I created 2 class that add a layer on t...
stackexchange/codereview
Here is a simple program that I created to print a file by breaking it after a fixed number of columns. I feel it can be optimized but not sure how. Any feedback is great. #This is a simple program that takes a file and the limits the columns length to #the number passed in as second argument if ($#ARGV < 1) { print...
stackexchange/codereview
In sort(arr), I want to sort an array. Children must be beneath their parent. And children of the same parent are sorted using orderPos value. I guess the complexity of this algorithm is quite high, is there a way to make it more performant for very long lists? (the language used here is typescript) interface data...
stackexchange/codereview
I have a medium sized project that uses a class hierarchy that essentially boils down to: class Mach { public: virtual ~Mach(); //... virtual void common_action() =0; //... A lot of common actions //... }; class MachStrato : public Mach { public: //... // ...Implementation of the common inter...
stackexchange/codereview
I've designed a database schema to store multiple translations with the objective of it being easy to retrieve data and add more translations if ever needed in the future without needing to make any change at all. Here's a dbdiagram.io of the part of the database that's relevant to this post. One of my bot commands ta...
stackexchange/codereview
I discovered that the JavaScript sets are ordered but don't offer a method to take the first element out of the set. For the arrays this operation exists and it's called shift. A very basic implementation can be written in this way: function shiftSet(s) { let res; for (let v of s) { res= v; brea...
stackexchange/codereview
In my object Dish xxx.Dish, I want to access the Choice class price and name to display . dish data load from web API and I tested data loaded success full and put the data to the object dish and it return the object list to viewcontroller to load tableview. Output of printed console Optional([xxx.Dish, xxx.Dish])...
stackexchange/codereview
I'm new to VBA programming so the following code may look terrible which is why I want ways to understand how to better optimize it and other future codes. Sub Sequence() Application.ScreenUpdating = False Application.Calculation = xlCalculationManual Application.DisplayAlerts = False Dim unique_string1, unique_string2...
stackexchange/codereview
I have implemented some methods to make the creation of multithreaded programs easier for me in the future The requirement was: Be able to add as many Tasks as I need to the pool Be able to restrict the amount of concurrently running threads Be able to set the thread creation speed Be able to cancel the thread creatio...
stackexchange/codereview
Here is the original C++ class I converted to Lisp at the very bottom of this post. class TrainingData { public: TrainingData(const string filename); bool isEof(void) { return m_trainingDataFile.eof(); } void getTopology(vector<unsigned> &topology); // Returns the number of input values read from the f...
stackexchange/codereview
Here is the code: pub fn insertion_sort<T>(vec: &mut Vec<T>) where T: Ord + Copy { fn insert<U>(vec: &mut Vec<U>, pos: usize, value: U) where U: Ord + Copy { assert!(pos > 0); let mut pos: usize = pos - 1; loop { let value_at_pos = vec[pos]; if value_at_pos <= value ...
stackexchange/codereview
I have this small Java program for computing particurly large Fibonacci numbers (10000th Fibonacci number is computed in about 220 milliseconds). The key idea here is to use lists of digits, which is exactly what is done in java.math.BigInteger, yet I wanted to implement a simple digit list addition on my own. import j...
stackexchange/codereview
This is an assignment presented to me. I don't have much experience building servers in Python so any comments would help me improve. The point of the server is to save and retrieve messages in a memory expensive environment. Those are the constraints presented to me: You don’t need to implement pagination Write every...
stackexchange/codereview
I created a class EmailParser and check if a supplied string is an email or not with the help of the standard librarie's email module. If the supplied string is not an email I raise an exception. Is this a pythonic way to deal with inappropiate input values an assertation error? How do you generally check input valu...
stackexchange/codereview
I'm relatively new to python and for an assignment I had to write a program that fetches a webpage with BeautifulSoup, extract all Paragraphs from it, and extract all words ending with "ing", and in the end save it to a file with the format "Word" + tab + "wordcount" + "newline". This is my code so far. Is there a more...
stackexchange/codereview
I am creating a static site in HTML and CSS. I'm using Sass for the CSS. The whole repository can be found here on Bitbucket. I wanted feedback on the way I've done the sidebar. The code is split across many files, so not sure if I should add them all or not. CODE _variables.scss file has this: $sidebar-width: 20%; $si...
stackexchange/codereview
A little while back, I wrote in a review of a Ruby bowling sim that I might try my hand at modelling the game myself, focussing on the funky "deferred scores" system. Since a2bfay, who posted the original question, has since posted a thoroughly updated piece of code, I figured I'd better get mine finished, especially s...
stackexchange/codereview
I made an attempt to implement a Properties File MRU Cache with a limited cache size which are of the most recently used properties can only be held in. A read miss from this cache leads to a read from the file for that particular property and keep it in the cache until it goes out of the limit where other recently pr...
stackexchange/codereview
My task was to write a server class, which uses select(), for a student projet. It was working, but i'm now willing to improve it a lot, and be able to use it in other personnal projects, so any critique and improvement idea is welcomed ! Here is the main.cpp : // example packet typedef struct packet { char ...
stackexchange/codereview
System76 sells laptops that come preloaded with their Ubuntu spinoff Pop_OS. The laptop keyboards have backlights that can change color and brightness, but so far I haven't found any way to keep the setting when I restart the machine; it goes back to bright white. Here's someone else struggling with the same problem so...
stackexchange/codereview
My code-editor "show hints" says that the method length exceeds 20 lines. How can I refactor the setEmailTemplateBcc function? private function setBcc($bcc) { if ($bcc) { $this->bcc = explode(',', $bcc); } } public function setType($type) { $this->setEmailTemplat...
stackexchange/codereview
I have a few resources set in my class – coins, diamonds, hearts, enum of these resources names, and method for increasing specified resource. I want to make single "Increase" method for all resources that wouldn't have switch statement. Sort of single-line not overloaded "generic" method independently on which propert...
stackexchange/codereview
Please tell me ways I can improve this code to be more efficient. #Moving Character in 2D Plane ''' Made by a beginner ''' arena = [] # This is a map file def make_board(place): #Generates map terrain for i in range(5): place.append(["O"] * 5) def list_to_string(alist): #Makes map easier to read for i...
stackexchange/codereview
I'm looking for a review paying special attention as to whether the code can be optimized in the form of number of variables used, especially for the delete() method. public class circularLL { Node start; Node last; circularLL() { start=null; last=null; } class Node { ...
stackexchange/codereview
I have a myDiv.mousedown, window.mousemove, and window.mouseup event. I'm trying to organize my code, and have it clean. So I created a function and returned the 3 event handlers. The mousedown event adds a mousemove event, and the mouseup event removes the mousemove event. Since I need to pass the exact same object to...
stackexchange/codereview
Here I implement N-Ary tree in C#. namespace ConsoleApplication1 { public class tree { public int info; public tree child; public tree siblings; public tree(int data) { info = data; } } public class NAryTree { public tree ROOT; ...
stackexchange/codereview
Given a set, generate all permutations: (permutations #{1 4 5}) => ((5 4 1) (4 5 1) (5 1 4) (1 5 4) (4 1 5) (1 4 5)) Here's what I cobbled together: (defn perm-r [allPerms currentPerm input i] (cond (empty? input) (conj allPerms currentPerm) (< i 0) allPerms :else (perm-r (perm-r ...
stackexchange/codereview
I was hacking around this morning and wanting to use automatically generate safe-to-use variables from $_POST. Probably not the best use of extract() and compact(), but extract() allowed me to prefix variable names and compact(explode()) seemed like a neat way to stick everything back into an array after being prefixed...
stackexchange/codereview
I am working on an API that is mostly intended to be used interactively/little scripts. There are some classes with methods that could act slightly differently depending on the intention of the user, I have explored several options and would like to get some feedback on caveats, and alternative options. I will use a si...
stackexchange/codereview
Here is my solution to Project Euler 23: Non Abundant Sums. I know I'm doing the Divisors function brute force, but I can't seem to get it to work any other way. Any improvements are welcome. #include <iostream> #include <vector> //Calculates divisors void Divisors(unsigned number, std::vector<unsigned> &result){ ...
stackexchange/codereview
I want to check if a given string is a date of the form YYYY-mm-dd, including all the steps in it, i.e. YYYY-mm-dd, YYYY-mm and YYYY. For example, all of the following dates are valid: 2014 2014-07 2014-07-03 This is my current regex: ^\d{4}(:?-\d{1,2}(:?-\d{1,2})?)?$ Is it OK?
stackexchange/codereview
I have written a small program which has 2 main classes : ServerSideMMS: This can access the SharePoint Managed Metadata Services, but only from the server which is running SharePoint ClientSideMMS: This can access the SharePoint Managed Metadata Services from any client machine These can both be used to access MMS ...
stackexchange/codereview
This is a follow up to this question. I have taken the suggestions given to me and implemented them in my code, as well as moving towards adding more features to the program. I am unfortunately required to use a linked list for storing contacts, so I cannot adapt to your feedback for that, but thank you all for helping...
stackexchange/codereview
I have a invoiceList which is a List<Map<String:String>> and am trying to find out if all the invoices have same SENDER_COUNTRY and CLIENT_COUNTRY or not. If not, it will add the message to a JSON array. [ [INVOICE_DATE:20150617, INVOICE_NUMBER:617151,SENDER_COUNTRY:USA, CLIENT_COUNTRY:USA] [INVOICE_DATE:201506...
stackexchange/codereview
I have started dabbling with golang. I wrote up a binary search tree implementation. I was wondering if there is a cleaner way. Here is my implementation: type BNode struct { left *BNode right *BNode data int64 } func insert(n **BNode, data int64) { if *n == nil { (*n) = &BNode{data: data, le...
stackexchange/codereview
Our solar system has 8 planets, including earth. Our calendar has some very confusing concepts such as leap years, which I still don't fully understand. In fact, since where I live, we use a different solar calendar that is different from the Gregorian reforms of the Julian Western calendar, I think I'm born in March b...
stackexchange/codereview
This is my first attempt with a basic text adventure game, and I was wondering if there was a way to make it more efficient (or any other things I could add to make the game better). It isn't totally finished yet, but if there is a way to make it better, please post in the comments. #lets me use the exit function impo...
stackexchange/codereview
Print all combinations from dictionary which will result in the number N Input: Dictionary { “flag”:4.5, “temp”:2 ,”foo”:9} and N = 11 Output: temp*1+flag*2 flag*2+temp*1 foo*1+temp*1 temp*1+foo*1 code: public class Combinati...
stackexchange/codereview
This is my implementation of the bell() function to calculate the n-th bell number in C. Along with it I made the factorial() and binomial() functions. I have serious doubts about their efficiency, in particular whether my implementation of the factorial() function should be correctly optimized for tail-recursion, and ...
stackexchange/codereview
vir.php <?php require_once '../db.php'; session_start(); if($_SERVER['REQUEST_METHOD'] == 'POST'){ $username = trim($_POST['username']); try{ $Query = "SELECT * FROM users WHERE username = :username"; $statement = $conn->prepare($Query); $statement->bindValue(':username', $username); $statement->execute...
stackexchange/codereview