instruction
stringlengths
71
71.9k
I can feel that something is wrong with my code. Here's an excerpt where I think the code smell is... internal Hazen(IRawDataReceiver rawDataReceiver) : base(rawDataReceiver) { SerialPortConnection = rawDataReceiver as SerialPortConnection; } private SerialPortConnection _serialPortConnection; ...
Assume that you have the ready sorted array Is it a good solution? Plunker OR: <script> var score = [10, 20, 20, 20, 40, 50, 60, 60, 60, 60, 70, 80, 80, 90] var j = 0; var k = 0; for( i in score ){ var grade = ''; if( i== 0 || score[i] > score[i - 1] ){ grade = j = j+1+k; ...
I have the following "upsert" trigger in SQL Server 2005, which is handling a large data import from a SSIS package. It is taking a very long time to complete - I suspect due to the concatenation and CASTing of keys. Is there a better, faster way of doing this? CREATE TRIGGER [dbo].[MP_VOD_UPSERT] ON [dbo].[vwMP_VOD...
I'm writing a shell in C for Linux and BSD. My code was unreadable before but I did a rewrite and now it is much more readable. The purpose of the code is to create a command pipeline and execute it. int run_cmd(const char *cmd) { struct str_list *chunks = list_split(cmd, '|'); struct pipeline *pipe = malloc(c...
I am trying to figure out a good way to store and load a password in the application configuration of my C# application. To achieve this I use the BouncyCastle library and the DPAPI from Windows. To protect the password from getting decrypted by other applications just using DPAPI under the same account it got encrypt...
I have the following snippet of code which gets a load of time intervals (every hour, every 2 hours etc), then groups the results for each of the intervals (e.g, the max value for each hour). This data needs to go into an array (which will be sent to a Chart). The user can select if they wish to group my Min, Max or A...
At my new job, with new young developers, we are seriously discussing improving code structure and performance. (They keep more than 80 lines of code in a method). However I've read more tutorials, and based on my experience, I think I should use some method to wrap that code by its conditional and call it back but tho...
I have a code that fetches rates from a website called X-Rates, and outputs to excel the monthly averages of a chosen country. The code runs quite fast, but I still think I could improve the code a little bit, but just don't know what to look for. I've done the obvious things like, making the option explicit and disab...
I was lucky enough to stumble into this task during a job interview. I was gently guided to use string reversals and a few other things to speed up my process. I kept thinking that I wouldn't have done it the way I was coached. It bothered me enough that I went home and coded up my version. How could I improve this...
The purpose of the class is to set permissions for a user. These include delete, download, upload, view, etc. These properties often depend on other properties, and setting them has side effects. For example, if I set CanUpload=false, then I need to also set CanManagePermissions=false since you cannot be an admin witho...
So I have implemented Single link list using java.Please advice if this is OK or can be made better. public class SingleLinkedList<Generic> { private Generic data; private SingleLinkedList<Generic> next; public SingleLinkedList() { super(); } public SingleLinkedList(Generic data, SingleLinkedList<Generic> next) ...
I wrote this header for generic use of a queue. The one thing I'm wondering is if I understood the usage of void*. I hope that if somebody teach me some conventions when coding in C. /* * array-based queue implementation by using void* * written by kidkkr * May 6 '16 */ #ifndef QUEUE_H #define QUEUE_H #define QU...
I need a custom exception for network errors that holds a related exception and more than one URL (the first one as the used service has its URL but it indirectly calls other URLs), so I wrote this: class ExtendedNetworkError(Exception): def __init__(self, reason, *args, **kwargs): kwargs_copy = dict(kwarg...
I need to find 2 different string and compare their hash value. Both string must contain "abc". I looking for the first eight character that are the same and stop. I have been running for more than 24 hours and still not found. My code has no problem running but i am wondering is there any more effective ways to find t...
I've made a small thread pool that i'll be using to communicate with a Redis server: #include "redox.hpp" redox::Redox rdx; void my_cool_function() { // do stuff with rdx } int main() { rdx.connect("localhost"); int max_threads = std::thread::hardware_concurrency(); std::vector<std::thread> pool; ...
This question is part of a series solving the Rosalind challenges. For the previous question in this series, see Wascally wabbits. The repository with all my up-to-date solutions so far can be found here. Problem: PROT The 20 commonly occurring amino acids are abbreviated by using 20 letters from the English alphabet...
The following method is part of a class that imports zip archives, and part of that class's job is to verify that a given zip archive contains "complete filesets". A "complete fileset" is one such that, for a given file name prefix, there exists a file in the zip archive with that prefix and each suffix. There are alwa...
I've been coding a helper container template to contain tiles in 2D games. What I figured out I would like when writing code for my games is forgetting all resize stuff, allowing negative indexes (for proceduraly generated worlds, that I hope to achieve in the future) and returning a default value (and not some error) ...
I have written a solution in Clojure for the following question: When starting from the number 1 and adding three numbers on each row a 3x3 matrix is formed as follows: 1 2 3 4 5 6 7 8 9 Starting from the upper left and spiraling inwards in a clockwise direction the following series is obtained: 1 2 3 6 9 8 7 4 5...
I've found a few places where control updates take longer than the redraw cycle. I started off surrounding them with Suspend and ResumeLayout: container.SuspendLayout(); updateControls(); container.ResumeLayout(true); After doing that a few times, I realized it could be refactored into a context: /// <summary> /// ...
I'm writing a program that has to check which are the two largest three digit numbers that are missing from a text file. I'm writing this in C++ and I'm trying to solve the mystery in a while loop. How can I "move" the search back to the beggining of the text file? More explicit: if the checking is now around the middl...
I am working on refactoring this method on the API. It's very slow, and can take the browser 12+ seconds to receive the result from the API. Can someone give me something to get me started or point me in the right direction? public List<LicenseProduct> GetProducts(int licenseId) { var totalpercentage = 0....
I am creating a sort of Sales Report for an Invoicing System. I have an extremely complex MySQL Query that takes a very long time to execute (usually about 10 - 15 seconds). It involves multiple tables (containing hundreds or even thousands of rows) in a database that an even more complex system is built upon. At this ...
I've got a simple Excel Data Manipulation Script to match one of my daily tasks, written in python 3. Intro Let's assume that I have 3 excel files: main.xlsx, 1.xlsx and 2.xlsx. In all of them I have a column named serial numbers. I have to: lookup for all serial numbers in 1.xlsx and 2.xlsx and verify if they are in ...
I seriously didn't know how to write this in Google, there must be an answer lying around. Here it goes: I'm using Ninject (IoC) and ASP.NET MVC 5. I have a business layer with a couple of classes. Is it ok if I have one class that holds all these classes? Like this: public class BusinessLayer : IBusinessLayer { ...
I am making a Connect Four type of game in Java. I want to make sure that all the code seems nice before I decide to add more. This is what the applet game looks like: Player input: Victory screen: I have three classes: Make4: import java.util.Arrays; import java.awt.*; import java.applet.Applet; import javax.swin...
I had a problem in my system where the class that sends messages to other systems sometimes gets flooded and so I needed to add rate limiting. I threw together something that would work, but I would really like to see what I can do to improve and/or clean it up. This class does not do the actual rate limiting, it only ...
I'm working on creating a user registration script in PHP. I have two tables that need to be inserted into. One that stores some general user information, and another that stores their login credentials. My issue is that my code to perform these insert is a mess of if/else blocks and I'm trying to figure out a good ...
I will be given the following input: const input = [ { value: "a1", colspan: 1, rowspan: 1 }, { value: "a2", colspan: 1, rowspan: 1 }, { value: "a3", colspan: 1, rowspan: 3 }, { value: "b1", colspan: 1, rowspan: 1 }, { value: "b2", colspan: 1, rowspan: 1 }, { value: "c1", colspan: 1, rowspan: 1 }, ...
During an interview I was asked to consider the following: You are trying to find an instance of an error code within a number of log files within a directory. The goal is to count the number of times that the error code appears within the specified files. For the written function, it was to be passed the following a...
I created a simple command line calculator, and then after some reading I made a few tweaks and then remade it with a friends idea to make it more simpler. I'm wondering if this can be more optimized or if any part of the code can be done "better"? I recently started learning Java and wanted for this first project of m...
I'm writing a finite state machine based on a transition table in C++ 14. My code so far looks like: #include <array> #include <functional> template < typename _State, typename _Event > class FSM { static constexpr size_t state_count = static_cast<size_t>(_Event::_); static constexpr size_t event_count = static_ca...
So for example, getTimes("12:00", "15:30"); should return: ["12:00", "12:30", "13:00", "13:30", "14:00", "14:30", "15:00", "15:30"] The input parameters are always in :30 or :00 intervals(so 06:00, 06:30, 07:00, ...). getTimes("06:00", "17:00"); -> should work getTimes("06:30", "17:00"); -> should work getTimes("06:25"...
In a project for fun/practice, I made a few builder classes that all started to feel the same, so I decided to generalize them by creating a factory that would automatically assign the similarities that they all shared. Each of my builders had a private variable, data, which would eventually become the built class. Ea...
The following code calculates the biggest number of consecutive ones in a binary representation of a number. For example 6 -> 2 (110), 5 -> 1 (101): String numberAsBinaryString = Integer.toBinaryString(number); List<String> listOfConsecutiveOneStrings = Arrays.asList(numberAsBinaryString.split("0")); System.out.printl...
Is there a more conventional / standard / easy-to-read way of building an index of tuples from an iterable than this: # ----------------------------------------------------------------------------- def build_index(itable_tup): """ Return an index for an iterable container of tuples, all the same length. The...
Being that I needed a min-heap implementation for a project, I implemented one. Now that it's finished I though about having a review for it. I'm interested in all aspects: readability, performance, naming, comments, everything. I'm planning on extending it afterwards with other features like the possibility to choose...
In my attempt to help improve Using Array to store calculations in VBA, I figured a good way to do it would be to create two dictionaries of values to lookup. So this was my attempt at creating two dictionaries from two sheets and then gathering data from a third sheet into an array and looking up the items in the arra...
I have a class which inserts a list of tweets to a database table and also inserts the tweet's key with the associated filter's key to a many-to-many table. I am testing the sole public method of this class: class TweetByFilterDatabaseRepository { private final DatabaseFacade database; private final Mapper<Tw...
This is meant to be a bidirectional flow BidiFlow that works exactly as BidiFlow.identity, except that it completes the stage as soon as one of the Flows (in1 -> out1 or in2 -> out2) is completed. This can be useful to automatically close a connection fully when one of the two sides is closed. There are a few tricks to...
I have created a function that parses a directory tree, and returns a list of lists that groups specific files within for later program specific parsing. I feel like it could be done better, considering I've used dummy variables, and was hoping some of you could help. def get_output_files(path) -> list: """ Th...
Hear this problem: Write a C/C++ program that reads all the values from the "BAC.TXT" file and determines which are the two largest three digit numbers that are missing from the file using a time-efficient algorithm. This is the code that I wrote and it returned good values for all the input sets I tried: #include <io...
I had the following piece of code for populating a list of currently running processes in an IT Self-Help application : var proclist = ProcessHelper.GetProcList(); var i = 0; var j = 0; foreach (var process in proclist) { if (process.ButtonText == "") continue; var button = new Button(); if (i < 7) ...
I am designing a database and I am just wondering if I am doing it correctly. I have tables for things like State with all the states in them and then I reference the ID in other tables. But should I just handle this in my UI and then store it as a string or is this the correct way? The goal of this database is to hand...
About I'm trying to implement a simple virtual machine. Now it supports only three operations: ADD(reg0, reg1, reg2) -> reg0 = reg1 + reg2 LOAD(reg, value) -> reg = value EXIT -> finish process It has 8 registers and no memory (for now). Source code main.rs: use std::process; mod opcodes; mod utils; const REGISTERS...
I have the following javascript code that I'm trying to modularize using ES6: import $ from 'jquery'; $('.select-element').change(function() { const $this = $(this); const $nextElements = $this.nextall(); const $nextElement = $this.next(); $this.val() === 0 ? $nextElements.addClass("hidden") : $nextE...
I wrote the following code for a coding challenge I was given and it received the following criticism: it was quite a beginner attempt using Angular. <body> <div id="view" ng-view ></div> <script > angular.module('myapp', ['ngRoute']). config(function ($routeProvider){ $routeProvider. when('/',{ ...
I have the case of repeated very similar logic that is used to check if a boolean value was changed from the initial value and prevent it from changing back, or to summarize multiple boolean return values like: bool SomeMethod() { bool endResult = true; foreach(var obj in objs) { bool result = obj.M...
I have a problem similar to the baseball elimination. Given some teams, the number of wins they have and the number of games they have left between each other I have to find for which team it is still possible to win. I am using the maxFlow algorithm to solve it. First I build a graph without the team I am currently ch...
I'm currently having a go at some past Google Code Jam problems to help me practice my programming skills. One of these problems is Problem A ("Googol String") from Round A APAC Test 2016. Here is the problem for reference (you can find the details via the link): Problem A "0/1 string" is a string in which every chara...
Here is my personal implementation of the clustering k-means algorithm. from scipy.spatial import distance import numpy as np import random # (x,y) coordinates of a point X = 0 Y = 1 def get_first(k, points): return points[0:k] def cost(cetroids, clusters): cost = 0 for i in range(len(centroids)): ...
My code works perfectly, however, I know my approach isn't best practice practice. I would appreciate the effort of anyone who tries to explain in details on how I could refactor this code using either(presenters, decorators or poros) - I have no deep understanding of either yet. Here is the code below: In my events c...
Here is what I'm trying to accomplish: Suppose you are trying to control an embedded system with several external hardware resources/components/devices. Naturally, you are concerned with the issue of sharing these resources, locking them. Also, the control flow of the overall program must not be unnecessarily impeded b...
From the Project Euler challenge series: 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. The brute force method runs in 1.8s per loop on my machine: def get...
I am trying to convert a tri-gram containing 3 characters of type wchar_t to an integer type (an uint64_t at the present time). It's been quiet a while I've been working with shifting and squeezing bytes. Here's what I've come up with so far and it - at least the few test cases in the tri-gram list - seems to work so f...
I'm working on a simple LRU cache for C++. There's nothing spectacular or unusual about it, but I would like it to be thread safe. (I'm going to be using this for instructional/benchmarking/entertainment purposes in a blog post, not in production, so mostly I just want to avoid embarrassing myself or causing undue har...
I would like to use Haskell to do some image processing so I have been writing small programs to test performance. I wrote a program to batch convert PNG images from color to greyscale. I compared the performance of the program below with a Python script using PIL. I found when compiled with -threaded -O2, the Haskell ...
I would like to ask your advice on my simple code to login and registration sessions. In the User class, login function: public function login($username, $password){ $this->db->query("SELECT * FROM users WHERE username = :username AND status = :status LIMIT 1"); $this->db->bind(':username', $username); $...
The following is my first successful running C# program. The lessons that I personally learnt through this include: The value of asking for help after having tried several times The advantages of being adaptable about one's methods of reaching an end The (a?) proper placement of functions in relation to a main program...
I have been working on a Project Euler: 125, which took me ages to solve. The problem and source are cited below The palindromic number 595 is interesting because it can be written as the sum of consecutive squares: 6^2 + 7^2 + 8^2 + 9^2 + 10^2 + 11^2 + 12^2. There are exactly eleven palindromes below one-thousan...
This is my first TDD Kata I've done and I'd appreciate it if someone could review it. String Calculator Create a simple String calculator with a method int Add(string numbers) The method can take 0, 1 or 2 numbers, and will return their sum (for an empty string it will return 0) for example “” or “1” or “...
I wrote a script that you can use to open the file explorer from command line like e db --> opens my Dropbox folder (e.cmd is the name of the script) e bin --> opens my script folder (I’m not very happy with the way I define the relationship mnemonic <--> folder.) Remarks, anyone? @ECHO OFF SET "target=%~1" if "%targ...
I'll define template <typename...> class VariadicTree with the following example: VariadicTree<A,B,C,D,E,F,G,H,I,J,K,L,M,N,O> is a binary tree whose type for insertion, removal, searching, etc... is A. But it will also accept insertions, removals, searches, etc... of objects of type B,C,D,E,F,G,H,I,J,K,L,M,N, or O as ...
I've written a script that recursively goes through a directory tree and looks for folders containing folders with NOT INVOICED in the folder name. If it finds one it prints the name of the containing folder and the names of any folders inside it with NOT INVOICED in the folder name. The output is: FOLDER 1 NOT ...
I have a library which is being used by customers and they are passing DataRequest object which has userid, various timeouts and some other fields in it. Now I use this DataRequest object to create a URL, then make an HTTP call using Apache HttpClient for which my service returns a JSON response which I use to create a...
Here was my first, simple C fizzbuzz: #include <stdio.h> void main() { for (int n = 1; n <= 100; ++n) { if (n % 3 == 0) printf("%s", "fizz"); if (n % 5 == 0) printf("%s", "buzz"); if ((n % 3 != 0) && (n % 5 != 0)) printf("%d", n); printf("\n"); } } I was messing around, trying to separate the trans...
Rubberduck's Code Explorer was recently redesigned from scratch: Anything from modern features, such as virtual folders (limitation of the VBE--it doesn't support real folders), to ancient features in the original VBE, such as printing. Here are some of the commands I wrote that I'd like to get reviewed: The Indent co...
I'm using Microsoft SQL Server 2014 Express. I found myself wanting to add the Columns CompanyNameChangeDate (1 through 10) and CompanyNameChangePreviousName (1 through 10) to a table in my database. I wrote the following query to do it: declare @i int set @i = 0 Declare @nameChangeDatePrefix as varchar(255) = 'Compan...
I wanted to put this out here and see if there were any security vulnerabilities that I'm not seeing. Also, if I can improve performance without sacrificing security, that's always a plus. Thanks in advance! Typically, when you want to validate an e-mail address, you store an activation key and expiration date in the u...
I am sharing a viewset between two types of routes in Django: one is a nested route (/users/:id/comments/:id/), and a regular route (/comments/:id/). The query set returned is either filtered by the user_pk or it's not. What is an idiomatic way of writing the following? if(user_pk): queryset = Comment.objects.filte...
I have these scripts I made that work absolutely perfectly as I need them to. Is there any improvements that can be done to these scripts and make them more efficient for Mobile Platforms? Or even just combine them into one script? These 4 scripts are just about identical except that each one controls a different obsta...
Do you see any security issues with this authentication approach or have any suggestions? WebAPI is REST-based. The user logs in by calling the Authentication Controller and expects a 401 if unauthenticated or a 200 with a session token in the header. GitHub Session session = null; try { session = Models.User.Logi...
Can someone please review this design I created for deck of cards in Java? package prep.design; import java.lang.reflect.Array; import java.util.*; /** * Created by rohandalvi on 5/14/16. */ public class CardDeck { private ArrayList<Card> cards; CardDeck(){ cards = new ArrayList<>(); for(C...
I am studying algorithms and I solved this problem under Dynamic Programming section: Alice is a kindergarten teacher. She wants to give some candies to the children in her class. All the children sit in a line ( their positions are fixed), and each of them has a rating score according to his or her performanc...
I am developing a WPF component that can be used to create interactive tours for WPF applications. To further improve the API in terms of usability and intuitiveness, the input of other developers is needed. The following feedback would be helpful: Do you see potential to improve naming? Do you like that organization ...
The problem is as follows: I have a matrix with impassable fields those are marked by the input. There is also a castle which reaches up the right side of the matrix. I have to find how many paths can there be in such a matrix, starting on the right above the castle and terminating on the right below the castle. I proc...
I have implemented a splash screen, to hold/pause the screen for few seconds and then launch the next screen. I am very enthusiastic to know if there is a more basic way to write the code. public class SplashActivity extends BaseActivity { private final int SPLASH_TIME_OUT = 2000; @Override protected void...
I'm relatively new to C++ and am trying to learn good programming practices and habits from the beginning. The code I wrote finds the largest common subsequence between to strings (and output the resulting subsequence, not the length of the subsequence). I was wondering if there were any improvements I could make to ma...
I'm building WPF/MVVM application and I'm struggling implementing Unit of work pattern. The part, about which I'm not sure is UnitOfWork class. Here is my thought: It's coupled with my repositories and MyDatabaseContext. At first impression, it doesn't sound good. But, I think, UnitOfWork should be coupled with DbConte...
This is the first program I've created without help from a tutorial. Written in Python 3.4, it gathers a specified number of media files and opens them in the default player (I use VLC on Windows 8.1). Python is my first language I have been learning mostly through trial and error. I am posting here to see what I can ...
I always have enormous difficulty working out 2D grid addresses, so for me it is easier to work with the List functions. All tests pass and I'm looking for feedback on clarity, functional programming concepts, or extra edge cases. Source: class Board(values: Int*) { require(values.length == 81, "Board must contain...
I wrote a simple JavaScript SEO keyword counter. The user enters their SEO keyword in one field then enters their webpage text in a textarea field. It then calculates (in realtime, as the user types) how many times the keyword appears in the web page text. It also calculates the keyword density. It works but probably i...
I wrote code that chooses a random set of Chinese characters, asks the user what the characters are, and if they meet a certain criteria they level up (ex. get more than 50% correct). I want to know if there is a better way to have fewer lists, better organization, etc. # -*- coding: utf-8 -*- import random allnumbers...
I have a class called TicTacToeBoard that has a [3][3] array of TicTacToeBoardCells. Doc neck if board has a winner, I check if any of the 8 possible combinations have 3 of these are type. Is there any way to make the check of the 8 states more elegant? I am not looking for optimizations like reducing number of checks...
This project was made to replace the stock Android CountdownTimer class. It is more responsive when completing the timer and adds additional functionality such as lap counting and start, pause, resume, and stop methods. However, I am not so familiar with threads and was wondering if I am doing it right and how it can b...
I am in my first object-oriented project and wrote this method for updating the database. The PDO include is just for convenience, so I could work on a single file temporarily. I'm not entirely clear on how or why to use the __constructor for this particular situation. <?php include 'pdo.php'; class database{ functi...
I'm scanning a CSV file to see which values fit inside of a given box. The CSV file has X and Y coordinates, and the arguments to the function are the perimeters of a box (i.e, top, bottom, left side, right side). I don't want to use any external libraries; part of the purpose of this is to learn how to speed up code m...
I've created little block of code that should update a external program, but I've checked it through and have not seen possible error or warnings. There are no errors in my testing but I wan't to publish it so tried to make it as comfortable to many users as possible. I hope that someone could check it too and tell me ...
For educational purpose I implement recurrent merge sort without recursion. The algorithm idea seems absolutely clear but my implementation appears to be really slow: 5 seconds to sort 10,000 values; 6 minutes to sort 100,000 values; it was not able to finish 10,000,000 in several hours (while lib sort() function does...
I would like to know if the below VBA can be streamlined to process faster, since it takes on average 9hrs to complete a sheet (800 000 lines), and I have quite a few to get through. Running on 3 computers already to get ahead of the work. Sub Calculate_Sheet() Dim orderSh As Worksheet Dim wiroSh As Worksheet Dim last...
This code is a proof-of-concept which I intend to convert into a static utility / helper class. I'm looking at this review from a structure or performance viewpoint. Small detail such as whether it prints or returns something, or whether the output is well-formatted, don't concern me too much. The purpose of this code ...
I need help reviewing my code snippet copied below. The below code counts the number of continuous ones in a given array of Size 11. #define size 11 #define ONE 1 using namespace std; #include <iostream> #include "stdio.h" int arr[11] = {1, 0, 1, -1, 0, 0, 1, 1,0, 1, 1}; int sequence_count = 0; ...
So I have following piece of code which basically validates five date fields in angular service. But the catch is that there may be one to five field(s) visible on the screen based on some other criteria.So the code checks if one datepicker is shown it will only validate one input.If three datepickers are shown it woul...
Here is my Graph class that implements a graph and has nice a method to generate its spanning tree using Kruskal's algorithm. I want to: Make it pythonic Improve readability Improve the abstraction (but not changing the use of outer and inner dicts to represent the graph) Performance is not a concern. Code: class Gra...
I am brand new to Scratch (and animation in general) and have been playing around with various techniques I feel will probably come in handy. My project in question can be viewed here. It started as a basic, infinitely scrolling background and a sprite (in this case a dragon) with a fixed position. The scrolling of the...
Edit: I found a potential solution. Changing all of the Dim as Long to Dim as Integer allows the scripts to run smoother. However, there is a potential that the number of rows in some instances will exceed 32767. Is there a way I can put a condition on the first few statements, to use integer only if there are less tha...
This is a piece of code that implements an image-processing algorithm I came up with. I call it Dynamic Colour Binning. It's a fairly academic exercise that was more about providing a learning experience than about producing something useful, but here is what it does: Input: A set of images with a limited colour space....
I just got some negative feedback on some code I wrote and I was not able to know exactly what was wrong with it (I tried). It is a program that verifies to see if a social security number is valid or not. The program is working fine.So I would really appreciate it if somebody could take a look and tell me if this can ...
I have written a basic event emitter in JavaScript and I'd like some feedback on my design. I tried to make it as simple and minimalist as possible, as I'd like it to be understandable by anyone. I have wrapped the code itself in a top-level "module" that adds it to the global namespace under the name events. I have al...
Given the following code: namespace AtBash { class Program { static List<string> letters = new List<string> { "Aleph", "Beis", "Gimmel", "Daled", "Hei", "Vav", "Zayin", "Chies", "Teis", "Yud", "Chof", "Lamed", "Mem", "Nun", "Samech", "Ayin", "Pei", "Tzadik", "Kuf", "Reish", "Shin", "Taf" ...