instruction
stringlengths
71
71.9k
I just had the idea to develop an algorithm to calculate and highlight the difference between two strings. I know that there are already some libraries to do the job but I just tried to make my own. I really don't know whether this one is similar to the existing ones but it seems to work fine. As of now it's still in i...
The following code is not one of my proud moments. In its initial state, I had only a single purpose, but know I'm up to three purposes and I don't know if it would stop there. I'm using mailin.io to forward mails to my endpoint as JSON data. There are three main purposes, I've tried to describe it as best as I could ...
I have a small application that checks some system status and display it details. I have the following code which is working. But I want to make sure it's optimal: public partial class MainWindow : Window { // Dictionary to hold info Dictionary<string, int> dataHolder = new Dictionary<string, string> { ...
I need to run a sequence of runnables on the main (ui) thread with a given delay between them indefinitely until signalled to stop. Code: public class UiLoop { private Handler h; private AtomicBoolean breakLoop; @UiThread public UiLoop() { if (Looper.myLooper() != Looper.getMainLooper()) { ...
The method medianOfThree returns the median of the first, center and last element in array sorts the first, center, and last element of the array, so they are in order EXCEPT places the center in the second to last position. Examples: INPUT: 1,2,3 RETURN:2 EFFECT:1,2,3 INPUT: 3,2,1 RETURN:2 EFFECT:1,2,3 IN...
I have the following piece of code: for (var i = 0, len = legend.allItems.length; i < len; i++) { (function (i) { var item = legend.allItems[i].legendItem; item.on('mouseover', function (e) { var posLeft = 0, posTop = 0, parentWidth = chart.chartWidth; ...
I have a case class that is recursive and looks like this: case class Config(name: String, isEnabled: Boolean, elems: Map[String, MyCase]) case class MyCase( id: String, isActive: Boolean, elems: Option[Map[String, MyCase]]) Where the Config contains the id of the MyCase entries contained as a Map. I have to it...
I got this out of an article on interviews / code challenges. The challenge text goes like this: A palindrome is a word, phrase, number, or other sequence of characters which reads the same backward or forward. Allowances may be made for adjustments to capital letters, punctuation, and word dividers. Examples in...
The problem Project Euler 1 is one of the most asked questions on site. However I wanted to solve the more general problem of division. Multiples of a list If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multipl...
I have a question concerning the correctness of the reading and displaying the image in ASP.NET Core MVC web application. This is the way I am reading image names from a specific folder (I am using IHostingEnvironment _hostingEnvironment to get the rootPath): public class GetRandomImageForGalleryView : IGetRandomIma...
Introduction In template meta-programming, integer sequences and ranges are very useful. I've made a couple of utility classes that do various operations on compile-time integer packs. The implementation is non-recursive (except for \$log(n)\$ recursions when generating a pack), allowing faster compilation and a greate...
The challenge is to find and print the largest palindrome prime under 1000. def reverse(integer): result = 0 while (integer != 0): result *= 10 result += (integer % 10) integer //= 10 return result def is_palindromic(integer): return integer == reverse(integer) def produce_sie...
This code gets a list of signals with predefined frequency from struc.num I need to encode it to wave format, so i use this code. This works, but i dont sure it is a correct decision to encode like this in python. Is there any ways to do it better? def compiler(): import out print("Loaded out.py") print("C...
I have a simple class which holds my product. Someone can add a serial to this product and also a purchase id. On change of the properties, I want to check whether both properties are set, and get the license class and add it to the product. public class License { public bool IsTrial { get; set; } public bool ...
Could anyone tell me if this code is well written and if it has bugs / vulnerabilities? class.user.php: <?php class User { public $authorized = false; public $uid; public $username; public function __construct() { $this->db = new PDO($dsn, $db_user, $db_pass); ...
I have finished my first project for Python. I would be very grateful if you could check it and give me some feedback. Just simple game with possibility of replay. There are probably lots of mistakes and code could be half the size, but I just started with programming. I tried this game on a few computers and unfortuna...
This allows me to search each cell J4:J6525 in range K4:K6525. If it is found it will paste the values in Offset(0, 2) (column M). I run it for files with more than 60000 lines, and sometimes much bigger. It takes a long time to complete. How can I make this run faster? Sub Finder() Dim WhereToSearch As Range, WhatToS...
In the C# Player's Guide book there's a challenge in which you have to write the PigDice game in C#: It's a multiplayer game, every player starts with score 0. Player X rolls 2 dice. Player X's score is increased by the sum of the 2 dice' numbers. If Player X gets 1 on either die, his score becomes 0 again and it's t...
I have written a constexpr sin function using c++14 and would like to know what I can do to improve it. I am trying to balance code clarity/maintainability with performance. My goal was to have every part of the algorithm that does not depend on a run-time parameter be evaluated at compile time. #include <type_traits> ...
I'm sure there is a better way to implement this feature. I am making an app that allows a user "upvote" or "downvote" a post. Right now, the code works and disables the upvote button if pressed and vice versa with the downvote button (the idea is that a user can only upvote or downvote once). post.js import React, { C...
To start off I'd like to note I am aware of int(val, base). My goal was to write a short function capable of taking in a base int, and a string defining the value to be summed. The function rests upon the equation: represented_value = value * base ^ placeholder >>> base_v = lambda base_v, num_a: sum(int(num_a[len(num...
This is a game about matching the right colour. In the first level you start with 3 cubes that each have a different colour. After 2 seconds the colours of the cubes disappear and the cubes become white, so you need to remember the colours of the cubes. Above the cubes you have coloured circles of the previous colours ...
This program was written on Windows 7 using Visual Studio 2012 Professional. Some of the issues encountered may have been fixed or changed in a more recent version. This is a quote from my second question in response to a comment made below: The algorithm in KnightMovesImplementation.cs implements a recursive tree se...
Was just wanting some general feedback on the below code regarding 1. Readability 2. Structure 3. Efficiency import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Scanner; /** * Created on 5/27/2016. * * Simple functions used to reverse either a sentence or a word. */ ...
This is for a client of mine: Enbridge Gas. I had to turn 2 .psd file into html and CSS. This client is my first real client by myself and I want to make sure my code is improved as much as possible. I would love feed back on my style, naming conventions and ect to improve the code. If you'd like to see the full projec...
I was inspired by this Reddit /r/dailyprogrammer challenge: Contrary to popular belief, the tetromino pieces you are given in a game of Tetris are not randomly selected. Instead, all seven pieces are placed into a "bag." A piece is randomly removed from the bag and presented to the player until the bag is empty. When ...
Task: Given a set of points on a line and a set of segments on a line. The goal is to compute, for each point, the number of segments that contain this point. Input Format The first line contains two non-negative integers \$s\$ and \$p\$ defining the number of segments and the number of points on a line, respect...
I have a small program in Java with GUI, which is showing NBP currency data in specified tabs. It downloads data from www.nbp.pl using XML format and saving it into Apache Derby database using hibernate. I am posting my code here because I want to correct myself in style and, eventually, in efficiency of writing code. ...
I am trying to create a Data Access Layer using ADO.Net. I have created a generic method for ExecuteNonQuery. The stored procedure I am calling will return two parameters. The output parameters from the stored procedure should be assigned to DTO object and the DTO should need to be returned to BLL. I am a bit concerned...
I've created a working Android app for my project website. I'm newbie too android dev so please review the code of this app. Any simplification or suggestion to optimize it much appreciated. Thank you. MainActivity.java public class MainActivity extends AppCompatActivity implements MyWebChromeClient.ProgressListener { ...
I just decided to get a bit more acustomed to using templates. Maybe this is a stupid question, but in my experience in C++ there is always some pitfall lurking aroung the corner. Thus I prefer the danger of embarresment instead of building up on bad habbits. Mainly as an exercise I wrote this: #include <functional> #i...
I've written a ISBN-validating annotation. It is to be used in conjunction with Hibernate Validator. I'm pretty satisfied with this code as it works as expected, but I've had to make a design choice that I totally dislike. This is why I post this question. The method checkISBN returns an Optional regarding the error re...
I have written a basic PHP upload script a few years ago and recently I discovered some phishing html pages in the website's root. This website is located in /www/sitename, while I upload the files to /gstorage/sitename, which can't be accessed from the web. I have found a lot of html files in /www/sitename and it see...
I'm creating my own game and for some statistics I need to get the names of specific objects. The problem was that I had them declared like "SmallFireBall" but I wanted them to appear like"Small Fire Ball" because that's something the user is able to see, so I decided to create my own extension method to help me out: p...
I'm writing a simple tool as a helper on Route Cipher for fun. In summary, the tool breaks input string into a two-dimensional array of characters with the dimensions specified by the user, and after that it's represented as a table on HTML. The tool also has a function to shift table data on a row to left or right, an...
I'm looking to improve a loop within a script that performs scheduled server restarts. Currently, I'm using a DO While loop with an exit condition within an IF statement once a counter reaches a limit. I'm looking to change this into a more simpler loop using a Labeled While loop containing a For loop that breaks when ...
I've exceeded the time limit on Sherlock and Squares on hackerrank.com. Problem Given the number of test cases and a range (inclusive), find the number of numbers within that range that are perfect squares. Sample Input 2 (number of test cases) 3 9 (first test case) 17 24 (second test case) Sample Output 2 (in ran...
I've just started to teach myself Rust. I've written the following code to read a text file and store the contents in a String. Is this the typical way of doing this? Can anyone suggest any improvements to this? use std::fs::File; use std::io::Read; use std::io; fn main() { let file_name = "test.txt"; let mu...
Below I've written a simple version of what I'm attempting to accomplish. I'm new to asynchronous functions, so it's difficult to wrap my head around this. My goal is to wait for the loop to finish all the callbacks before console.log() runs, but I want all the callbacks inside the loop to be asynchronous, so they don'...
I came across the below problem in a coding challenge: Let's define 2 functions, \$F(i)\$ and \$Val(i,j)\$, for an array \$A\$ of size \$N\$ as follows: $$ \begin{align} F(i) =& \sum_{j=i+1}^{N} Val(i,j) \\ \\ Val(i, j) =& \begin{cases} 1,\qquad & \textrm{if } A[i] < A[j] \\ 0,\qquad & \te...
This is one simple crawler that downloads images from websites, the website's URL to be crawled to must match the regex, as well as any image-to-download's URL. (Also, I know, I made my own thread pool, because I did want to keep my crawler lightweight...) Code: import BeautifulSoup import requests import re import jso...
Inspired by Reddit r/dailyprogrammer A vampire number v is a number v=xy with an even number n of digits formed by multiplying a pair of n/2-digit numbers (where the digits are taken from the original number in any order) x and y together. Pairs of trailing zeros are not allowed. If v is a vampire number, then x and y...
How can I improve my code, make it more efficient, and are there any tips you have? Project Euler 3: The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ? public class LargestPrimeFactor { public static void main(String[] args) { long num = 6008514...
Introduction This problem is essentially equivalent to this HackerRank problem. The task is to remove all duplicate characters that are adjacent to each other in a given String, until no adjacent characters are the same. If a String only contains adjacent duplicate characters then return an empty String. Examples: baa...
Problem In the famous eight queens puzzle, one must place eight queens on a chessboard without letting any queen threaten any other queen. There are 92 (or 12, depending on how you count) solutions to the original puzzle, but it can also be generalized to smaller or larger boards. Solution My strategy is pretty similar...
Very new to Raspberry Pi and bash, but working on a headless server that will run a streaming app from USB audio card. The plan is to take a USB card with settings file, and when inserted, the usb will automount, check for settings file, load the streamer using config file and wait for the audio input stream to start A...
In some code that I am writing, I am manipulating some heterogeneous containers of user-defined types. I desperately need to be able to move-assign these types without generating exceptions. However, this can cripple the usability of my code because on many older compilers, important standard library types do not have ...
I made a triple-type container, that is, a single type that can store a value, under one of the three types used. It's somewhat similar to Boost::Variant. The header file (multitype.hpp): #ifndef MULTITYPE_HPP #define MULTITYPE_HPP #include <iostream> #include <cstdlib> #include <typeinfo> typedef void* vp_t; // Void...
I am new to PHP development. So Kindly, review my code and guide me make it better/optimize. Currently, it works well with inputs that I have tried. <?php // Program to find the word in a sentence with maximum specific character count // Example: "O Romeo, Romeo, wherefore art thou Romeo?” // Solution: wherefore // Ex...
For fun I decided to write a 'real' Haskell program. The intention of the program is that it listens on a socket on a given port for input. The client can send some raw text on it and the server generates a paste for it. As an example: Client dino :: ~ % echo "Schoolbus" | nc call-cc.be 9999 http://call-cc.be/files/3DF...
I am learning JavaScript and I have written a code snippet. Can someone suggest some improvements? Array.prototype.pushIfDoesntExist = function (item){ if(this.indexOf(item) === -1) { this.push(item); return true; } return false; } var Testing = { clickedList: [], applyListeners: func...
I made a Blum Blum Shub pseudorandom number generator implementation in JavaScript. Blum Blum Shub (B.B.S.) is a pseudorandom number generator proposed in 1986 by Lenore Blum, Manuel Blum and Michael Shub that is derived from Michael O. Rabin's oblivious transfer mapping. Blum Blum Shub takes the form \$x_{n+1}=x_...
I currently use this method to count unread messages for a user (self here): def unread_messages_count number = 0 conversations = Conversation.where {|conversation| conversation.user1 == self || conversation.user2 == self } conversations.each do |conversation| number += conversation.messages.select{|message|...
I am making my first object-oriented program in python and I am having trouble with the __str__ part of Board() class. I want it to be a visual representation of the tic-tac-toe board. I have achieved this but the code looks ridiculous and I know there must be a better way! Here is my project so far: class Space(object...
The filenames.txt contains all the names of the files that you want to change in a given directory. It is generated by: import os walk = os.walk("./app/") for dirpath, dirs, files in walk: for filename in files: fpath = os.path.join(dirpath, filename) with open("filenames.txt", "a") as f: ...
I implemented Karger's algorithm with the function find_min_cut and it works, but I don't feel satisfied with the code I wrote. from numpy import inf from random import choice from copy import deepcopy # We use the karger method for finding the minimum cut in a graph. # Each row of "original_Graph" needs to match a v...
I know B-Trees are meant to be used for external memory, but I implement it to understand the algorithms involved in insertion and deletion. Also, I didn't use a vector because I was asked not to use it (I will probably reimplement this using vectors later). namespace mds { template<typename T, typename Func = std:...
I am developing an application that works with files and folder on a network share (similar to the windows explorer). The application is used by multiple users and provides some commands for modifying the file system. Problem The parallel access to the file system may result in conflicts. Example: User A renames a fo...
I am working on a project for Udacity, where I should use CSV files to display data on fake corporate dashboard. Structure of the data I am working on is like this: I am using AngularJS for this project, I created service for getting the data, formatting it to JSON and summarizing data into months. It works good, but I...
That's already known problem: to return an array of linked lists that contain values of elements at each level. Eg for tree with depth n there should be n linked lists. I wrote the solution: public ArrayList<LinkedList<Integer>> levelLists() { class NodeLevel { public BinaryTreeNode node; public int le...
I have to reverse a string in JavaScript and cannot use the built in reverse() function. It does not seem efficient to have to create two arrays but is there a better way? function reverseString(str) { newarr = str.split(""); result = []; x = newarr.length; for (i = x; i > -1; i--) { result.push(newarr[i]);...
I am trying to learn how to write clean HTML5 code and I came across a sidebar. I need to get something like this: My code: <aside> <section> <header> <h1>Naujienos</h1> </header> <ol> <li> <article> <header> <h3>2015-09-20</h3> ...
The only way I could think of doing this is creating a text file and modifying it each time the program is executed and outputting the average but this has many flaws so I was wondering if it was possible to do this any other way. int num1, num2, counter = 0; num2 = rand(); do { cin >> num1; counter++; } while(num1 != ...
I wrote a solution for SPOJ "It's a murder!". I'm exceeding the time limit even after n log(n) solution and fast I/O. Given a list of numbers, I need to calculate the sum of the sum of the previously encountered numbers that are smaller than the current number. For example, given 1 5 3 6 4, the answer is (0) + (1) + (...
I've made a simple web plot with D3 JS version 4. I've drawn a discontinuous function: $$f(x)=\frac{1}{x(x-2)}$$ which has 2 vertical asymptotes and 1 horizontal asymptote. I add a legend with LateX: I'm not a master using JavaScript and D3, so I'd be thankful for any suggestion about a more efficient use with arrays....
Here is the JS Fiddle: https://jsfiddle.net/4jo9hvpk/ The code is fully functional. Could someone point out any mistakes in style? Any redundancies? I want to work on making my code look better and being more efficient. $(document).ready(function(){ var button = $(".buttons"); var allButtons = [$("#red"), $("...
This XOR function is costing my program too much time (specifically the conversions.) How can this code be made faster? string xor_str(string astr, string bstr){ unsigned long a = strtoul(astr.c_str(), NULL, 16); // Convert strings to longs unsigned long b = strtoul(bstr.c_str(), NULL, 16); stringstream ...
In the C# Player's Guide book, one of the challenges was to make the game Game of Life in the console. Program.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; using System.IO; namespace GameOfLife { class Program { ...
I create login form with session with four files: connection.php login.php plan.php logout.php Please check my code and tell about any smokestack. Database educate (create table users) CREATE TABLE users( id INT AUTO_INCREMENT, username VARCHAR(50) NOT NULL, password VARCHAR(100) NOT NULL, PRIMARY KEY(id) ); Connect...
I am new in Golang, and decided to create a function that could cater to my needs of reading an integer from stdin. I need the function to be as efficient and fast as possible. package main import( "fmt" "bufio" "os" "strconv" ) type NoIntRead int func (err *NoIntRead) Error() string{ return fmt.S...
I have used multiple map/flatmap combinations. Could anybody help me with the review? var Rx = require('rx'); var RxNode = require('rx-node'); var request = require('request'); var _ = require('lodash'); var cheerio = require('cheerio'); exports.getResult = function(req, res) { var result = ''; fetchContent(...
The code is supposed to group start and end time logs and provide log counts and unique ID counts. The grouping will be variable 1 hour, 6 hours, 12 hours, 24 hours, etc. What is the better way to rewrite the simpler version for this code? Input: No of day reamins 'x' in inputs. import pandas as pd fn = r'Dart.csv' ...
I'm working on a report of quality control. I've got a table, with all the points of control inside, and each time, when I get a new test result, Excel should fill this table. My code already works, but slowly (I have 15000 lines in this table, and it takes me 4 minutes to fill it), so I wish I can accelerate a little ...
I want to check if a file exists in a given directory or in the parent one, so I wrote this code: if (File.Exists(fileName) || File.Exists(Directory.GetParent(Path.GetDirectoryName(fileName)).FullName + Path.DirectorySeperatorChar + Path.GetFileName(fileName))) However, this seems quite odd to me...
I have started to implement cross site scripting prevention (xss) within my code. However as I am using symfony for this particular project I have read up that nothing needs to be done for xss in symfony as it is already protected from it, is this case? If this is not the case I want to make sure that the code I have ...
This a solution to the CodeEval's challenge "Lucky Tickets". After a failed attempt with brute-force calculations (no surprise here), I have tried to implement an algorithm that I found on StackOverflow. The code runs without errors and my results match the output given in the example. However, when I submit the code f...
I have decided to make a game of text-based Tetris in C. At first I had no idea how to start so I settled for threads. Each thread moves its own piece down the grid and all the main thread does is redraw it every 16ms. However, now I see that multi-threading a game like Tetris isn't necessary at all. Now I can't figure...
I have a (large) number of nodes and (triangular) cells, e.g., cells_nodes = [ [0, 3, 1], [0, 2, 3] ] This example represents the small mesh (Please call me Picasso from here on out.) Now, I would like to create the edges for these meshes (in red above), specifically edge–node and edge–cell relations. For...
I need to run several identical threads. All threads must wait to do their job, until all threads are running (alive). I use wait/notify to synchronize: when a thread is created it waits until it gets a notify to continue. It works, but not sure it's the best way. Is it efficient? I read from Java 5, is it better to...
I have implemented an event bus library for Java - JBus. Anybody please care to review my code? It is an open source project and link is provided above. Usage Define events: public class UserEvent { /* Additional fields if required */ } Create subscriber: public class Listener { @Subscribe ...
I'm developing a game in Unity 5.3.5, I have a player statistics system with 10 different stats, as in probably every game the user is able to see the points put in each stats and also the benefit each stats is giving him. I have 2 panels with 2 text the first one is responsible for the points in each stats and the sec...
This game has a few basic functions: ask users trivia questions based on user input, add or substract points. save game data when user inputs save. allow old user to log in and play the same old game. I only have two main questions: In this game,I tried not to write too many things in the main.js and let most thing...
Here is the code I have written for a HackerRank challenge which takes multiple arrays, and attempts to determine if there exists an element in an array such that the sum of the elements on its left is equal to the sum of the elements on its right. If there are no elements to the left/right, then the sum is considered ...
This program calculates common factor for given numbers. The original use case is to find a possible resolution for pixel games that scale well with new screen resolutions (that's why I don't have any check and optimizations for big numbers and use simple brute force). (define (fun1 l d) (if (apply = (map (lambda (...
2 days ago as I was working on my game I decided I wanted to include some sort of a video showing sneak peaks of the themes and tutorials and such. I then decided to check how to record my scene or nodes. After looking around i concluded there was no easy way to do it so I decided to make my own utility which I want to...
I'm ultimately trying to compare the MD5 hashes for files in two disparate directory trees to see if files are missing from one directory or the other. More broadly, I'm pushing photos from my DSLR camera to Google Drive, and need to know which files need to be synced up. Pictures from my phone are automatically being ...
I have a MVVM application that fetches data from active directory and displays it in a DataGrid. The exact data displayed is determined by which query a user runs, and there are multiple available queries. Each query requires slightly different logic, but they all have the same general idea. These methods are all in my...
Please help me make this code more object oriented. I also want to use a few more classes and separate the input processing code to another class. Question: A hotel chain operating in Goa wishes to offer room reservation services. They have three hotels in Goa: GreenValley, RedRiver and BlueHills. Each hotel has separ...
In my project, I have 3 payment mode. Via Manually Entered , Card Swipe, and cash. I have 2 fragments named RecordCardManuallyFragment and SwipeCadFragment and they both are almost identical according to functionality except in RecordCardManually you have to type info manually and in swipe card fragment you informaion ...
Input: Set of elements (String) Output: Printing the elements of the power set of the given set public class PrintPowerSet { public static List<String> permuteSet(String inputSet){ List<String> powerSet = new ArrayList<String>(); int n = inputSet.length(); //size for binary for(int i=0;i<Math.pow(2,n);...
I'm writing a 3D space graphics program and I just changed the build system to using gradle. This is my first gradle project. It works but I'm sure there is room for improvement. apply plugin: 'java' apply plugin: 'application' apply plugin: 'eclipse' apply plugin: 'idea' mainClassName = 'spaceworld.UFOSpaceWorld' r...
I'm a beginner to Java and Android programming, and I wrote this app in order to get some practice. It works, but it's most likely not as good or efficient as it could be, since I'm new. I'm hoping to get some feedback or maybe some revisions to help me learn. MainActivity.java: // this app can't: // accept blank val...
I thought this question made a good excuse for some basic OOP code, so I whipped up a little bit of code to demonstrate it in VBA; the idea is to have tutorial-grade code, to show how interfaces and default instances can be used to implement immutable types and factory methods to simulate constructors in VBA. Here's th...
Inspired by Reddit r/dailyprogrammer Help! My keyboard is broken, only a few keys work any more. If I tell you what keys work, can you tell me what words I can write? The program works fine, not really any additions I wish to make to it. Was just wanting some general feedback on the layout, structure and efficiency...
I was curious on what, if anything, I could be doing better. I have been spending the last few days working with Java and learning some basics and wanted to try this challenge and making it two classes. I found the scanner is sometimes strange and doesn't take input the first time. import java.util.Scanner; import java...
(See the next iteration.) I have this easy to use facility that maps input elements to output elements concurrently by the means of a thread pool: concurrent.h: #ifndef FORP_H #define FORP_H #include <functional> #include <initializer_list> #include <iostream> #include <thread> #include <vector> namespace net { ...
Please help me improving this code(golang), thanks! Why I need built a API for xkcd Can't get the data provided by xkcd directly in front-end(CORS). So we can package the data to 10 comics per request. Instead of 1 request match one comic. main.go package main import ( "encoding/json" "fmt" "log"...
today I coded a simple API class in C# with just a WebClient instance in each void and just simple voids to do simple things, can anyone give me any support in how I can improove it? Thanks. using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Text; using System.Threading.T...
I have a ColorFormat class that contains a string format for a color and its format name. In the software, I will define multiple instances of this class and regroup all of them in the class ColorFormats: [XmlRoot("ColorFormats")] public class ColorFormats : Collection<ColorFormat> // <-- Notice ColorFormat { priv...
I’ve got my first real PHP web application up and running. It is working as expected, but being my first time, I’m sure there is plenty of room for improvement. Right now, there is one particular aspect that I’d like some Code Review love on: my session handling class. I haven’t used any frameworks this time around, b...