instruction
stringlengths
71
71.9k
I'm new to rails and this is the situation I'm in: I have a User model that has many tournaments, a Tournament has many users and questions and a Question belongs to a tournament. I'm trying to write a query for all questions that are in tournaments the user is a part of, for example if we have the user A in tournament...
Is pattern matching within a unit test a code smell? Do I really need to throw an exception just for my test to fail if the function under test receives invalid arguments (i.e. not Succeeded case value)? Here's my test: [<Test>] let ``get available positions for black soldier`` () = // Setup let piece = Blac...
A number is a prime when it is divisible by 1 and the number itself. To check if a given number is a prime we can divide the number by primes which are less than the square root of that number. If there is at least one prime which properly divide the number then the number is composite otherwise it is a prime number. I...
I am working on a project to automate utilities of our application on Linux. The utilities are basically chunks of programs with specific options for specific tasks. They are run like UNIX commands. We need to validate command outputs and at times the files generated by them. The automation needs to cover all options f...
I have made this class for database connections to my applications. It eases out the task of making connections to the database with knowing the credentials in advance and provides a way to execute the queries. Class dbConnection { public $CONN; private $dbservername, $dbusername, $dbpassword, $dbname; pu...
I have recently started looking into networking with Python. I saw some tutorials about the socket library so I decided to give a "live chat room" idea a go. It works (on Windows, os.system("cls") may be problematic) but was just wanting to see how people could improve upon it server.py from socketserver import Threadi...
This sorts two lists (a, b) according to aand returns two sorted lists separately: a = ['apple','carrot','banana'] b = [5,15,10] s = sorted(zip(a,b)) a,b = map(list, zip(*s)) print a print b ['apple', 'banana', 'carrot'] [5, 10, 15] Are there any better ways to do this?
I decided to write a console program that can generate a random alphanumerical password in the C language. It's quite useful for when I'm making a new account and need to make up a quick password on the spot. I've noticed a lot of the password generators people have shown on this are written in Java and maybe Python or...
I'm looking for ways to make this calculator more efficient and/or make the code a little easier to read. #include <iostream> #include <cstdlib> using namespace std; // variables to be used in the program double result, valueA, valueB, valA, valB; int choice; char cont; //functions to perform the calculations doub...
I have implemented simple BubbleSort algorithm. How can I optimize my code? Any suggestion would be helpful. public class BubleSort { private int arr[]; public static int COUNT; public BubleSort(int array[]){ this.arr = array; } public int[] getArray(){ return this.arr; } public void setArray(int[] a...
This class will take just the table name and data array and will do the rest, update or insert. I know it's not perfect, but I could use some feedback. <?php class DataBaseAction{ private $tableName ; public $tableId ; private $fieldNames = array() ; private $fieldType = array() ; private...
I'm attempting to improve my OOP design skills through solving sample problems. Below is an implementation of a flight booking system where the passenger can only request a seat class, but no number. Also, flight statistics must be printed. In your review, please focus on design: How can I design the classes better (or...
I need to parallelise a for loop that does quite a lot of processing over thousands of items. I came up with this basic loop that seems to work quite effectively on a small test. template<class T, class C> void parallel_for_each(std::vector<T>* ts, C callable, uint poolsize = (std::thread::hardware_concurrency()+1)*2) ...
The following program is a lexical analyser for a simple and small grammar. Please read my code and answer me these questions: Is my code easy to understand? Is my code well organized? Are there bugs in my code? Is the lack of comments a problem? Can you make my code more performatic without modifying all the structur...
I have two arrays and I want to combine them both in a manner similar to this: arr1 = "1a, 1b, 1c" arr2 = "2a, 2b, 2c" arr1.zip(arr2).flatten(1) # => [1a, 2a, 1b, 2b, 3b, 3c] That is, put each arr2 element right after the arr1 element sharing an index. Since arr1 elements come before their arr2 counterparts, arr1 can ...
I'm roughly trying to follow the guidelines in "Effective Java", "Item 15: Minimize mutability", hence the class is not "final" on purpose. Information is gathered from a number of temperature meters. Some may fail to report, so the size of the map is not known. The serializing bothers me. Is there a simpler way to...
I have been trying to develop online food order application. I have taken the concept of zomato.com where a user or say owner registers his/her restaurant. After adding the restaurant, an executive from the company will fix a meeting with him/her, take pictures and menu of his/her restaurant by himself/herself or ask h...
Some time ago I was experimenting with an Extendable format provider but I wasn't satisfied with the implementation. It didn't feal very SOLID so I've rewritten it to this: The base class is the Formatter: public abstract class Formatter : IFormatProvider, ICustomFormatter { protected Formatter(CultureInfo culture ...
Uncle Bob in his Clean Code says: So all the same rules apply. Functions that take variable arguments can be monads, dyads, or even triads. But it would be a mistake to give them more arguments than that. void monad(Integer... args); void dyad(String name, Integer... args); void triad(String name, int count, Inte...
Based upon feedback received in this post I've amended my game and would very much appreciate further feedback on it's current state(work in progress) and any suggestions on what I could implement in the future. An @classmethod was introduced in Enemy() and these are completely new to me so a confirmation that all is c...
I wrote list, which I think is more elaborate than usual. I would like to ask you for some tips, criticisms, and general feedback about my code. #ifndef _LIST_HPP #define _LIST_HPP #include<memory> #include<iostream> #include<cassert> template<typename T> class List{ private: struct Node{ std:...
Could you review my code for finding max, min, and mode? #include <iostream> #include <vector> #include <algorithm> int main() { std::vector <int> v = { 2, 5, 3, 4, 3, 2, 3, 3, 3 , 6, 6, 6, 6, 6, 6, 6, 6, 1}; sort(v.begin(), v.end()); int number = v[0]; int max = v[0]; int min = v[0]; int m...
I've written a simple C# class to use as a dll for simple math calculations: addition, subtraction, division, and multiplication. How can I improve this code, specifically for addition and multiplication? I've tested it with a C# GUI and a VB.NET GUI. I've tried it with VS 2005, 2008, 2010, 2012, and the Community Edit...
I use SQL Server 2014 and I have three tables: Student (ID, Name, Age) Product (ID, Name) StudentProduct (StudentID, ProductID, Date) TABLE Student(ID, Name, Age) >> ID Name Age 1 Adam 20 2 Bob 17 3 Ben 18 4 Joseph 18 5 Jon 18 TABLE Product (ID, Name) >> ID Name 1 SQLServer 2 V...
I love politics, and I love programming, so I figured why not try and combine the two for something to do? I'm making a work-in-progress (but runnable at this stage) Politico api that I call "pylitico.": from bs4 import BeautifulSoup import requests import time import ast import re story_link = re.compile('a href="(...
I have decided to give python a try and have to start out at the very basics, so I chose this well-represented kata. The code aims to convert Arabic numbers between 1 and 3999 to Roman numerals and back. Here, Roman numerals are 'well-formed', that is, no 'XM' or similar, even though I know they were occasionally used....
The following script is meant to be a user script, but it should work on the console. It takes the id of the question and adds the corresponding /posts/id/timeline link to the post-menu element, just besides others. It's meant to not have problem with other scripts. The same as above for the answers, just that in this ...
I'm trying to recreate a printer in Java. I'm fairly new to programming so I'm using huge if/else blocks inside a single function to dictate the logic of the program. I'm noticing this is creating a mass of code inside the same function. I was wondering if there was a more eloquent/efficient way of doing this Printer c...
Can the below code be done in one line? Do you think it should or is it ok like this? function() { var str = {{Click URL}}; var str1 = str.split('/').pop(); return str1.charAt(0).toUpperCase() + str1.slice(1); }
I've started learning java. I've written a small program I've done in C before. It's simple input analysis. If there is number, program checks if number is prime. Then write number: (value of input variable) (prime) for example date in format DD/MM/YYYY, if does program will print date: DD/MM/YYYY Day (Day represents...
I'm using the flexbox for the first time for a responsive grid system. It seems to be working as far as I tested but want to make sure it works on others too and see ways to improve this. Please see style.css for the grid system with flexbox on github. *{ box-sizing: border-box; -moz-box-sizing: border-box; } htm...
I built an Order Statistics tree on top of a Treap in order to solve this HackerRank problem. It works (passed all test cases). Any comments whatsoever would be greatly appreciated. class EmptyTreeError(Exception): def __init__(self): self.error = "Empty tree" class node(object): def __init__(self,val,...
Question from the book: (Geometry: closest pair of points) Write a program that lets the user click on the panel to dynamically create points. Initially, the panel is empty. When a panel has two or more points, highlight the pair of closest points. Whenever a new point is created, a new pair of closest points is highli...
I've created a program that will create work notes for me, however, I've been under the impression since I started writing in Ruby that while loops are bad. How can I write this differently in order to gain the same effect or an even better effect? def prompt(input) print "[#{Time.now.strftime('%T')}] #{input}: " S...
This is basically the beginnings of a battleship game. There is only 1 ship which takes up 3 of six locations on a 1 x 6 grid. The locations are created by finding a random location on the grid and then taking the next two points as the other 2 locations. I basically just make sure the the guess is between 1 and 6, mak...
I'm currently working on a small project that uses Java to handle a socket-based MMO browser game. I'm still at the beginning of the project and I'm currently writing a class that logs errors and debug messages to the console and writes these to the appropriate file, based on the error. I'm wondering if this code is cl...
I kind of started making an API for my site in a Django class based view because it seemed logical and now it has gotten quite large and unruly and I am starting to wonder if I am doing this correctly. class URLAPI(View): def get(self, request): if request.GET.get('param') == "foo": ... ...
I've been making games using the Pygame module recently. I've noticed that Pygame has no builtin GUI elements. To save time for me (and hopefully other people), I have created some very simple GUI elements: buttons and labels. The button module was the first to be created, and is probably the most thoroughly tested. Th...
I wrote a React app to adjust the serving size of a recipe. For example, if the recipe serves 4 people and requires 4 eggs, scaling it down to serve only 1 person should only require 1 egg. I try to also keep the units singular/plural accordingly while converting units when they become too big or too small. These featu...
I am a new Pythoner. I have solved a OJ project with Python. Can you tell me how can I solve it more Pythonically? Problem Description: There are n coin denominations, each with an unlimited supply of coins. Use them to make a given total amount m. Requirements: Every denomination must be used The number of coins of...
I have written JavaScript code for fetching data from a MySQL database. I have used connection pooling and Promise API. var mySql = require("mysql"); var Promise = require("promise"); var pool = mySql.createPool({ host : "localhost", user : "root", password : "rahul", database : "testDb", //schema connectio...
I'm executing a cursor. I have cut off the code how the procedure is called and executed. This part is efficient. At last I have a small cursor. I'm calling the procedure, which returns this cursor many times on the page and I need to create a multidimensional array from it. This array should look like the following: $...
I'm writing a TCP server using tasks and I wanted to know if there's something I can improve and how I am doing. ConnectionHandler.cs: public class ConnectionHandler { private List<TClient> CLIENT_LIST; private TcpListener LISTENER; private const int PORT = 8080; private const int ACCEPT_DELAY = 75; ...
Here is an array based stack. I tried to implement this basic stack from memory. I want to make sure it is correct. import java.util.*; public class Stack{ private int[] stack; private int size; public Stack(){ stack = new int[5]; int size = 0; } public Stack(int capacity){ ...
I have 9 sheets with 1668 rows and 34 cols. The code collects all data from every sheet into one Summary sheet in the following format: service 1 supplier 1 price etc.. service 1 supplier 2 price etc.. Unfortunately excel freezes around the 7k row and I receive 'out of memory' error. Any suggestions how to solve imp...
I wrote this simple function to rename columns in a data frame to standardized names in R. This function is useful when we have a very large data set with large number of columns especially for machine learning applications. colRename<-function(x){ for(i in 1:ncol(x)){ colnames(x)[i] <- paste("column",i,sep="")...
I have a large dataset (78k instances x 490k features) that is loaded as a scipy.sparse.csr_matrix format. From this dataset I want to filter certain features (i.e. columns) for which all values fall below a certain threshold. Loading the dataset as a dense matrix is not an option, nor did I find sparse matrix operatio...
There's been a lot of questions lately about database provider and repository design especially without entity framework or alike. I thought I try myself to create a reusable framework for this kind of stuff. So let's begin ;-) TL;DR - There's an example at the bottom Core The main part of the framework is the DbProvi...
I've written the following script import shutil,os,glob # setting up destination folders PYDEST = "/home/ubuntu/python-scripts/python-test" TEXTDEST = "/home/ubuntu/python-scripts/texte-test" def move8files(pwd): PWD = pwd + "*" for files in glob.glob(PWD): if files.endswith(".txt"): pri...
I'm going to start small here because I actually have several questions but I'll go one at a time. In the app I am making to better learn Java/Android/SQL/OOP, I have a page where a user can define Places (e.g. "New York City", "Seattle", etc). You could add made-up stuff if you wanted, too, doesn't matter. The user ca...
I am currently working on a new version of my application, and I just finished rebuilding the log part. It works well but I am skeptical about the choices I made. I am a student and I work alone in some side projects, and I am afraid of developing bad habits. I use java.util.logging, because it is simple enough for wha...
First of all, I'd want to represent, in my application, two different users (admin and client) which can access to two different classes, through two different graphic interfaces... My idea is to represent faithfully what is in the e/r and I'd want to generalize shared information (like nick, pw, email) using an interf...
I wrote a program (hard-code) in MIPS that gets an array of 10 integers and calculates the sum and the square sum of them. The array is {23,-2,45,67,89,12,-100,0,120,6} .data array: .word 23,-2,45,67,89,12,-100,0,120,6 # array = {23,-2,45,67,89,12,-100,0,120,6} length: .word 10 # the length of the array is 10 sum: .wo...
I'm trying to alternate if a button is checked. I've come up with this, which works but its feels unnecessary to write 70 lines of code for such a simple task. How would I go about to shorten this up, is there any way I can call the base toolStripButton and tell it to uncheck other buttons when clicked on and check it ...
I wrote some code to execute remote commands over ssh, using expect, from c++. The code works but is a bit of a mess of c / c++ since there doesn't seem to be an idiomatic way to achieve much of what I wanted in pure c++. I appreciate that there are nominally some security concerns with the way I'm using passwords, but...
I'm developing a document merger that utilizes an FTP site containing hundreds of documents. FTP Connection Function private static function establishFTP() { $ftp_conn = ftp_connect(getenv('FTP_HOST')); ftp_login($ftp_conn,getenv('FTP_USER'),getenv('FTP_PASS')); ftp_pasv($ftp_conn,true); return $ftp_co...
I have a view that displays details of a work order request submitted by a user. As far as security and database querying is concerned, which one of the following options would be better if I'm going to update a table named "Requests" with some changes to the properties? Is the extra query to the dbcontext in option 2 ...
I have this script working pretty well but I know that there must be many things that I could do better to make it more efficient. from selenium import webdriver import re from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_...
This a problem from Hackerrank.com and Project Euler #8. The problem statement is as below. Is there a specific algorithm to solve such problems? Can my code be made more efficient? Find the greatest product of K consecutive digits in the N digit number. Input Format: First line contains T that denotes the number o...
I wrote this little class to wrap around a work-in-progress, poorly documented API and I'd like to know what else can be improved. I feel like there's a lot of repetition in the functions and I'd love to know if I could turn all those functions (which do the same thing, just setting a different command in the request o...
This is a hyperid implementation of a linked list and ArrayList: The total capacity is divided into \$\sqrt{n} \text{ "arrays count"} \sqrt{n} \text{ "array size"}\$. This will lead to, as I assume, \$O(\sqrt{n})\$ for operations like indexing, insertion and deletion, along with \$O(1)\$ for adding We start with on...
The problem (from Cracking the Coding book): Given an NxM matrix in which each row and each column is sorted in ascending order, write a method to find an element. I thought of a modified version of binary search, and I haven't found this solution anywhere on the internet (some solution about quad partitioning is ver...
As part of my learning Java I'm doing various tasks I set myself - one such task is a postfix calculator. It seems to work with all tests I've given it, and I would really appreciate some review of the code I've created to complete this, both logic and style wise: package com.VortixDev.PostfixInterpreter; import java....
So far, I've been using codes based on solutions other people wrote, and I'm trying to learn by modifying those codes. My problem now is that my code ended up too messy (a lot of script tags, jquery mixed with javascript, etc). I would like to know what should I do to clean this mess. Since I'm a beginner, I'm not look...
I have a method in C# which communicates with REST API.It has a several small task like splitting of a string ,checking a commandText is valid or not,POST and GET JSON payload to/from REST API. public string PostToAPI([FromBody]string value) { string input = value; //splitting of str...
When the application connects to the database it keeps the connection open until the user closes the file using File->Close. Is this bad practice? Should I be opening and closing the connection every time I need to use it? using System.Data; using System.Data.SQLite; using System.IO; using System.Windows.Forms; namesp...
I have Matlab code that is very inefficient and I need to run it several times. The code is basically a big parfor loop which I guess there is almost impossible to get around. The code starts by loading several parameters and 4-D matrices, and then needs to make a few interpolations. All need to be done 5000 times (t...
This is a POC for a clock using moment.js, eventually I plan to recreate this in Raect.js. Any opimisations or a better way to do it? <!DOCTYPE html> <html> <head> <title>Html clock</title> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.14.1/moment.min.js"></script> ...
I wrote a simple daily horoscope in Python using Beautiful Soup as scraper. It works fine but the code can use some sort of a... direction if you want to put it that way. I have used underscores in my variable names which is a folly. Please point out how can I correct this and also, please tell me how I can expand this...
Wrote a php site to gather/filter/search daily archived logs from the archive directory using bash cat and grep commands. How can I make the code more readable? How can I follow conventions better ? (functions/indentation/comments/ using php and html together etc) Is there a different approach to this problem I shoul...
I solved the Circular-Array-Rotation problem on HackerRank. I conceded defeat and looked at the answers given on HackerRank itself but the ones I saw used things like vectors, which are concepts I'm a noob at as my knowledge of C++ thus far extends only as far as virtual functions and classes and such (junior COE stud...
This is how I used to implement quicksort: def quickSort(alist): quickSortHelper(alist,0,len(alist)-1) def quickSortHelper(alist,first,last): if first<last: splitpoint = partition(alist,first,last) quickSortHelper(alist,first,splitpoint-1) quickSortHelper(alist,splitpoint+1,last) def par...
I am working on learning more about arrays and loops! I have been trying to create a method which will allow me to take for example an unlimited amount of arrays and append or concatenate them to each other! The method takes multiple arrays as arguments and creates a merged array in the order in which the arrays where...
I have a 'read more' angular directive copied from: https://github.com/doukasd/AngularJS-Components/blob/master/dd-text-collapse/dd-text-collapse.js Some of my text can already have <br> tags in it (I ONLY allow just <br>) so I just needed to handle that...below is only the extra code I wrote for this purpose. Does it ...
So I am very new to programming and I am trying to pick up Python as a first language. I have programmed a simple game of naughts and crosses, but it is very wordy and there must be a simpler/quicker way of doing this! Any modifications or tips would be gratefully received. from random import randint #initialise game...
This Delphi (Seattle 10) routine resizes a JPG image if one of its sizes is larger than AMaxDimension pixels, and gives it a compression factor of ACompressionQuality. Images smaller than 128x128 pixels are left alone. As the name says, it ignores alpha channel. I'm not an expert in image manipulation and wonder if thi...
I've done a function that does the following : It takes an argument length that it will be the length of the result array. The Array should start with alphabet values first : ['A', 'B', 'C', ...] If the length of the Array is greater than 26 (The number of letters) it should look like : ['A', 'B', 'C', ..., 'A1', 'B1...
I'm checking each variable to prevent null exception, but still wondering can this be improve in much simpler and cleaner if you will be writing the same code? Please see the below snippet: [AjaxOnly] public ActionResult GetInstitutions(string parent) { if (string.IsNullOrEmpty(parent)) return Json(string.E...
I have the following class which represents a set of properties. public class Properties { /** String type properties. */ private final List<String> m_stringProperties = Arrays.asList("str1", "str2", "str3"); /** Float type properties. */ private final List<String> m_floatProperties = Arrays.asList("fl...
I have a function which takes a string representing a text file, joins lines which were wrapped, and returns a slice with the wrapped lines. I'm interested in making my code maintainable, idiomatic, and fast (in roughly that order). var startLine = "^([A-Z][A-Za-z ]+[0-9]+)- " var startLineRegex = regexp.MustCompile(st...
I have solved problem 12 on Project Euler website, which reads: The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be: 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ... Let us list the factors of the firs...
I just learn a little bit about C Programming and try to create a modular program so I created simple program to read memory usage by pid(s) in Linux. #include <stdio.h> #include <stdlib.h> #include <string.h> void print_memory_info(char *pid, char *vmpeak, char *vmsize, char *vmhwm, char *vmrss) { ...
First, my Book object: public class Book { public static final String TABLE_NAME = "BOOK"; public static final String COLUMN_ID = "ID"; public static final String COLUMN_TITLE = "TITLE"; private long id; private String title; public Book(String title) { this.id = -1; this.titl...
In perl, is there a canonical practice or idiom for assigning value to an argument which, if "empty", is assigned a default value? Here, "empty" is defined as an argument value which is either undef or the null string (''). Notably, 0 (or perl false) is a valid, non-"empty" value, which rules out the construction $min_...
I'm trying to implement some simple logic using rails. Code is working fine but its look uglier to me, could any one help me on refractor or implement in a efficient way. Context: Data hash assetType key which can be image/clip and Sizes key has array of hashes. if asset type is image then I'm filtering Sizes array if ...
I have a database class that connects to a database and runs CRUD operations. I need a critique of how well this class adheres to SOLID principles. A class to run all database operations seems like 'Single Responsibility' to me. Is there any need for further abstraction, such as an interface of some kind? <?PHP class ...
I was asked to make a String encryption utility without using encryption API. I basically had to come up with my own encryption methodology! the program was to be able to encrypt a string and decrypt a string and to of course make it nearly impossible for anyone to figure out what the encrypted string says! I would rea...
Below is some jQuery I recently wrote and I'm quite sure there is a more elegant and/or efficient way to write it. The gist is, when a user clicks on a Primary Nav link, its Secondary menu slides down. When a user then clicks another Primary Nav link, instead of the jumpiness if the prev menu sliding up and the new one...
Can someone review this code, just have look if it's logically correct or If you may point me to a more simple and minimalist program import java.util.ArrayList; import java.util.Arrays; import java.util.PriorityQueue; import java.util.Queue; /** * Created by aishwat on 17/8/16. */ public class PrimsMST { publ...
Designing a micro ORM inspired by Dapper. I'm building this as an exercise to learn. I would appreciate if you guys can review my code. I would also appreciate any suggestions regarding the features that can/should be added to this ORM. The source is available here. ConnectionStringProvider.cs public interface ...
I solved Project Euler 4 using Clojure Lisp. A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. Find the largest palindrome made from the product of two 3-digit numbers. I'm not very experienced with Clojure yet. I tried to break th...
I am doing Java exercises from HackerRank.com and bit confused about this problem. Here is my code that pass the test case. import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); // String input = in.nextLine(); ...
This workbook is used to track projects. I have this VBA code linked to a Form Control button. When I press the button it will run through and get information from all the project sheets and feed it to the appropriate areas. My workbook currently has 25 worksheets for projects, they are labeled 1-25. These projects all...
I am practicing my coding at HackerRank. The exact problem statement can be found here, but to summarize, it is finding the distances of the shortest path from a starting node to every other node in a non-directional graph where every edge is weighted 6. If a node is unreachable, the distance is -1. The nodes are named...
I have a program that will format a phone number in this format: (###)###-#### def obtain_phone_number loop do print 'Enter phone number: ' phone_num = gets.chomp if !(phone_num[/\d{10}/]) puts 'Invalid phone number, must contain 10 digits only' else formatted_phone_num = phone_num.insert(0...
I just began learning how to use signals and slots in PyQt5, and so I made a cute (pun intended) little program to display just one button. When the button is pressed a thread is spawned which will count from 0 to 99 and display the current count onto the button. However, when the button is counting, the program will n...
I made a random password generator in Java using a GUI. In the program, the user can choose the length, and whether to include lowercase letters, uppercase letters, symbols or numbers in the password. I believe that my code could be much better and I want to know how I can make it so. Full code: import java.awt.event.A...
This code was tested on IBM's 5-Qubit processor as an implementation of Grover's search algorithm, but for an unknown number of solutions. This code is based on Arthur Pittenger's book, "An Introduction to Quantum Computing Algorithms" and the mathematical structure was posted as a proof-verification question here. h ...
So I am working on a small RPG in Unity. Right now I am writing some business classes, POCOs, that have no link to Unity except being in the required C# flavor and using Debug.Log and stuff. I have been doing a lot of Java for years and some C++11, but no C#, so some concepts are not familiar to me. I think most of t...
I have here a simple webapp for displaying different D3 demonstrations: The idea is - the user can select one of many modules in the control bar at the top, and the corresponding controls for that module will be displayed. The image generated by each module will be displayed in the main area below the control bar. Es...