instruction
stringlengths
71
71.9k
An overview of what I've done: I've inherited System.Windows.Forms.TextBox and added a few properties to help me out in creating forms that generate SQL statements. I use to create a large function that would check for changes in the TextBox compared to a string. Then it would take text and concatenate it to a SQL sta...
I wrote a class, which intends to work with regular expression (as a String or Pattern object) to get capturing groups of given regex, but it operate on regex. I wrote it to implement in my regex app and it is working quite well. I wanted to make it simple to implement, reusable, and as much as possible easy to read an...
I've written my own jQuery code to make a little slideshow. Functionally, it does what I want but I find that the jQuery animations are fairly jerky and because I'm a beginner in JS and web development I don't really know where to go to improve it. You can see it here. function screen_width() { return window.inner...
I am trying to improve the performance of the current solution for calculating commission in a betting platform. The following is the code currently used to solve the problem. The primary problem here is the CalculateCommission method, which is ugly and seems to do the same thing multiple times. I've tried but not been...
On my free time, I was working on a system that could help some little private companies, like game servers, etc. The last few days I have been working in such small companies, and I noticed that some of them give direct access to their developers to update game servers, restart them etc., which is insecure, and some d...
I have this code for parsing for parsing a list of floats of variable length. on_message = function(event_data) { var data = event_data.split(" ").map(parseFloat) var size = data.shift() + 1; while (data.length >= size) { // put the data in a buffer // could be replace by console.log() for t...
I have spent countless hours trying to speed up my bilinear interpolation up. I even tried implementing an SSE version (a double version and a float version), but that was even slower than this version. Does anyone have any ideas? I wrote this under VS2010 and it is intended to be called from MATLAB as a MEX function (...
I've made this script above for GRE Tunnels and I'd like to know how I can improve it. Also, at the bottom, you'll see "Do you want to forward more ports." I want an easier method of asking this and inputting the info. The method I have right now is lone and not neat. I want to be able to input ports separated by comma...
I have an enum let's say with four values. Let's call them A, B, C, D. public enum Categories { A, B, C, D } I then have a Thing which stores something and has one of the values from my enum. public class Thing { public final Categories category; public int var; public Thing (Categories ca...
I was creating a Volunteer Signup Report report in Microsoft Excel yesterday for my job and I had a moment of inspiration. What if I turned it into a website and made it dynamic? The volunteers sign up, the data is logged in a MySQL database, and then the report is automatically updated for the managers to view. Obviou...
This implements a builder pattern for RPG game characters. Is this a valid builder pattern implementation? There are 3 characters: Paladin, Wizard and Elfo. There are 3 items: Potion, Sword, Arch. using System; using System.Collections.Generic; using NUnit.Framework; namespace RPGEngine.Tests { [TestFixture] public...
I'm learning Dynamic Programming, following the topcoder guide. I just solved the BadNeighbors puzzle. It passes all the test cases, but I don't have much experience, so I don't know if it's good. Puzzle Description: Each of the town's residents is willing to donate a certain amount, as specified in the int[] donation...
I wrote a function of type Seq[Either[String,Int]] => Either[String, Seq[Int]] scala> xs res11: List[Either[String,Int]] = List(Right(1), Right(55)) scala> acc res12: Either[String,Seq[Int]] = Right(List()) scala> xs.foldLeft(acc){ (acc, elem) => { | acc.right.flatMap(list => elem.right.map(_ +: list) ) ...
So after I finished my fractal generator, I decided that text is ugly, at least compared to pictures, so I made a text-to-picture converter: require 'chunky_png' require 'etc' require 'pathname' class Array def chunk(chunk_size) self.each_with_index.with_object(Array.new(size / chunk_size) { [] }) do |(elt, ind)...
Given a table represented as a javascript array of objects, I would like create a list of unique values for a specific property. var table = [ { a:1, b:2 }, { a:2, b:3 }, { a:1, b:4 } ]; var groups = _.groupBy(table, "a"); var array = []; _.forOwn(groups, function(value, key){ a...
I'm drowning in Swift optionals and error handling syntax. I'm just converting a text file into an array of Strings. One would think that this could be a simple two or three liner but by the time I got it to work, I ended up with the following mess: enum ImportError: ErrorType { case FileNotFound case CouldntGe...
I have a script I need to "duplicate" and modify to allow it to delete certain images based on properties I give this app/script. Currently the script just moves/sorts the images into folders based on numbers (e.g. each folder has 5000 images before a new folder is created and more images propagated). The requirement o...
I'm really new to C++ (very surprised at the leap from Python and others to C++!). The code compiles and works well. This took all day to get to work, and I've the tendency to move on after I get [what I see as] basic functionality. I'd really like to become a good programmer, though. I assume there are a ton of things...
Is there any way to make this function shorter? I want to calculate the characters up to 1.000.000. My reverse function looks like the same also... function toABC(num) { switch (num) { case 1: return 'A'; case 2: return 'B'; case 3: return 'C'; case 4: return 'D'; case 5: return 'E'; case 6: ret...
I was curious, how in-place radix sort compares to the variant which uses an auxiliary array in order to speed up the sorting. I implemented both and tested it against java.util.Arrays.sort(int[]). Seed: 1439451337582 Radixsort.InPlace.sort in 12074 milliseconds. Radixsort.sort in 6937 milliseconds. Arrays.sort in 163...
The game basically has a player (PlayerCharacter class) that can move around the world. It has a 2D world made of tiles managed by TileEngine class. The player can shoot projectiles and can collide with the boundary of the map and any solid tiles. Entity.h: #ifndef ENTITY_H #define ENTITY_H #include <cmath> class Ent...
I want to count specific strings from array values $array = array("report=D","report=D","report=D","report=I","report=I"); I am going to count the number of D,U & I, as well as their meanings. D = Delivered U = Undelivered I = Invalid I am expecting an output of: D = 3 U = 0 I = 2 First, I replace "report=" using ...
I'm currently working on this problem for my own practice. It's a paintball problem where I should determine if everyone can get a unique target. The problem is as follows I get a number of pair like: 1 2 3 4 3 2 4 1 If I get 1 2 it means that 1 can see 2 and therefore 1 can target 2. It goes the other way around to ...
Let \$D\$ be a \$N\times N\$ positive definite matrix. I am minimizing a quadratic funtion $$ f(w)=w^T D\ w$$ with respect to the weight vector \$ w=(w_1, w_2, ..., w_N)\$, subject to the following constraints: \$\displaystyle\sum_n w_n =1\$ \$w_n\geq 0\$ \$w_n \geq \theta \$ or \$ w_n = 0 \quad \forall n\$, for so...
I've written a Xonix clone in Javascript/Canvas. It seems to work fine. However I would like to refactor the code of detecting conquered regions which seems to be bulky (see methods conquer, _conquer, _findOutline and _buildConquerRects). Below is the relevant code. The full code is available on GitHub. // cell attribu...
I've execute this code in Android for inserting 100+ rows in SQLite database. My current approach takes more time to initialize the database. private void getInitialization() { try { dao = new IdentifyImageDao(MainActivity.this); dao.open(); level = new Level(); for (int i = 0; i < ...
I need to send and receive data. Here is solution for my original problem. I want to know how safe my finished code is and how I can improve it. int sslWrite(SSL *ssl, const std::string &data) { return sslWrite(ssl, &data[0], data.size()); } int sslWrite(SSL *ssl, const void *buf, unsigned num) { const int IN...
This question is regarding my approach to the following implementation requirement. Can you suggest a better alternative that doesn't suffer from the issues I'll point out in my implementation? REQUIREMENT: Create an input field (View) that updates itself automatically whenever a specific property on the Model changes....
I have telerik radgrid that has an SQL backend. What this function is doing is conditionally formatting the cells with in the radgrid. It checks each column to see if the min and max values are within range and the min and max values change depending on the value in the sample_hour column. My question, is there any mor...
In the past I have always called the repositories directly from the controller, but that is a bad practice and now I am implementing a "Business Layer" to my project. Would I have two UnitOfWorks? One for the Service and then one for the repositories? BaseController: public class BaseController : Controller { prot...
I am developing a .Net application that involves reading data from XML and writing to HTML. The methods to do these tasks are all in the same class as the data they read/write are properties of objects of that class. The problem is that while they perform their function, they are rather long winded and complex. I would...
Problem: You are given n types of coin denominations of values \$v(1) < v(2) < ... < v(n)\$ (all integers). Assume \$v(1) = 1\$, so you can always make change for any amount of money \$C\$. Give an algorithm which makes change for an amount of money \$C\$ with as few coins as possible. #include <stdio.h> #include <s...
I have a port of titlecase, originally in Perl and ported to other languages such as JavaScript and Python. import android.text.TextUtils; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Titlecase { protected ...
This stored procedure takes user defined table type as parameter. It contains data imported from an Excel file. Values inside that type are the same as in #InconsistentRestriction temporary table. It's working fine, but since I'm not an SQL expert I'm afraid it's not written the best way possible (or not even close). C...
I made a Range class (like an Interval) that takes Integers and implements List<Integer> (actually it implements UnmodList, but whatever). The contains(), indexOf(), and lastIndexOf() methods of java.util.List can be implemented efficiently (using math instead of iteration) in a Range, making the List interface fit R...
Started picking up D recently. I wrote an application to create journal entries (text files) based on user input. //this program will write to files. It should be able to read them. //implement a command interface? import std.stdio; import std.string; import std.datetime; import fileio = std.file; import std.conv; enu...
I have this HTML down below that creates a list with two columns, the left one containing profile information, and the right one containing checkboxes of the user feedback in a horizontal list. The list behaves so that when the element of the questionAnswer array is true, there is a font-awesome checked square, and whe...
I wrote this class to one-line all my JSON serialization, and I'm curious of any input on it. It's only responsible for serializing/deserializing any type to/from JSON. The comments and code are pretty self explanatory, but if you want any extra explanation of it please feel free to comment. Not a lot here, so comment ...
I haven't been learning Python for too long and I was just wondering how this Pokémon style battle looks? It's based off of this: Turn Based Pokémon Style Game. It's my first proper time using classes so I'd love advice or critique on the usage. Also, where I make the CPU more likely to use heal when under 35 health, ...
I am showing templates in popups according to the user navigation links. It works for me, but, is this the correct way to do it? var app = angular.module('plunker', []); app.service('modalService', function( $rootScope ) { this.hide = function () { this.show = false; } this.showIt = function () { ...
The idea here is that rather than placing objects directly into the scene, these building objects are instantiated at run time and placed in the correct locations. This gives me full control over where and how to place the buildings. The workflow is still a little involved. I have to import the model and texture image...
I am currently learning C++, and as an exercise I tried to implement a BST in a C++11. I am not sure at all if what I have done could be considered a good example of c++ programming, thus I would love to know from you if you believe my code could be improved in terms of functionalities, efficiency, or just programming ...
Given a string of uppercase characters, return a string corresponding to the next item in the following series: A, B, ..., Z, AA, AB, ..., AZ, BA, ..., BZ, ..., ZZ, AAA, ... My code: def increment_char(c): """ Increment an uppercase character, returning 'A' if 'Z' is given """ return chr(ord(c) + 1) if...
My code works (as far as I can tell), so I'm looking mostly for readability and efficiency tips. Goal of my code: Generate a list of all numbers that have more divisors than any lower number up to a certain limit. In other words this sequence: https://oeis.org/A002182 Background: The number of divisors of \$n=p_1^{k1}...
I made a simple marijuana information program in which I give the user a list of strains and give the user information about it, like: effects, medical, negatives, and its cannabis type (sativa-Indica). It's pretty long and I'm sure some stuff can be removed. First package Marijuana; import java.util.Scanner; //SANCHI...
I am wanting to use a cell editor and a DocumentFilter to prevent the user from entering certain characters into the table cells. The columns are as follows: Product ID Product Description Inventory Count Cost Minimum Quantity For Inventory Count, Cost and Minimum Quantity I am going to use a JFormattedTextField. How...
I'm changing the Viewpager items programmatically using mViewPager.setCurrentItem(position); with a regular interval of time recursively. Please tell me if this is the best way to achieve this or if there are any problems with my code. ViewPager mViewPager ; mViewPager = (ViewPager) findViewById(R.id.viewpager)...
(Follow-up on RPG Character Builder) This implements a fluent interface for RPG game characters. Is this a valid implementation? There are 3 characters: Paladin, Wizard and Elfo. There are 3 items: Potion, Sword, Arch. [TestFixture] public class RPGEngineTest { [Test] public void GivenAPaladin_WithSword_Return(...
I took information from a series of posts and some prior knowledge to implement the following hashing algorithm. However, there is a lot of talk about what implementations are secure and not secure. How does my method measure up? Is it secure? Are there more secure methods in PHP for hashing tokens and matching with ...
I have this Dijkstra's shortest path algorithm: net.coderodde.graph.pathfinding.AbstractWeightedPathFinder: package net.coderodde.graph.pathfinding; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; import net.coderodde.graph.AbstractGraphNode; /** * This abstract...
I want to change all the pixels in an image to have the same value, in terms of the HSV colour space. At the moment I'm running the following code: private Bitmap changeVForAllPixels(Bitmap bitmap, float newV) { int width = bitmap.getWidth(); int height = bitmap.getHeight(); int[] rgbs = new int[width * he...
I'm imagining go generate would be a good tool for this. I want to convert strings to ints to save space. type Source int func NewSource(s string) Source { switch s { case "Twitter": return Twitter case "Facebook": return Facebook case "Gplus": return Gplus case "Spotify": ...
Please help in improving the code. I would like to hear comments on syntax and an approach to development. This is my first experience in writing a simple application for the site. window.onload = function() { /* инициализация таблицы-прайса Вначале проверяем наличие таблицы-прайса на странице. Класс табли...
I was wondering if you guys could point out any mistakes I've made in this program, and how to improve the code. It's a simple console-based Connect Four game. You use 0-5 to place your piece in the column you want. The goal of the game is to get four in a row, either vertically, horizontally or diagonally. //imports i...
I previously posted a code here. It turns out that the code is not following the correct dynamic programming principles and instead it was based on a greedy approach. Hence, I started again, keeping in mind helpful guidelines from here and here. I would now like to know if my code is efficient, or if it can be further ...
Is there any way I can simplify this re-sizable solution? It seems too difficult and messy to me. Working example $.ui.plugin.add("resizable", "alsoResizeReverse", { start: function (event, ui) { var self = $(this).data("resizable"), o = self.options; var _store = function (exp) { ...
Yesterday was JSON serialization, today is XML serialization. I've taken some of the suggestions from there and made modifications, as well as making other modifications that were not suggested but should be made. /// <summary> /// Provides methods for Serialization and Deserialization of XML/Extensible Markup ...
I am currently working on some fade out alert boxes where once the fa-close is clicked, it will then fade out and then slide the rest of the alerts/content upwards. Here's what I've got: $(document).ready(function() { $(document).on('click', 'div.alert > i', function() { var trg = $(this); var parent = trg....
I have a switch statement that works just fine, however, it has a lot of duplicate logic within it. I have an enum that my controllers use to say which is making the publish request, so ProductInfo controller passes in ContentFields.ProductInformation into PublishTable public static void PublishTable(string user, Cont...
I'm writing a singly-linked list that implements the List interface. I decided going in that I'd try to implement every method as an exercise; even the optional ones. I started writing the ListIterator, and found the need to return the node previous to a given node for operations like add. Unfortunately, I didn't antic...
I've made a userscript that oneboxes links to GitHub repos, issues or pull requests in Chat after seeing the request One-box repositories, issue tickets and such on GitHub in the chat on Meta. It uses the GitHub API to get any relevant information and displaying it in a onebox-like manner. It uses MutationObserver to c...
I'm learning Dynamic Programming, following the topcoder guide. I just solved the AvoidRoads challenge. It passes all the test cases, but I don't have much experience, so I don't know if it's good. Challenge Description Linked description contains images and better illustrates the problem. You are standing at the corn...
Most of my programming experience is in PHP, and I have always been a bit wary of JavaScript. I have a JavaScript class to manage executing, caching and displaying search results. class Search # @property {string} The previous search term. @previousSearch = undefined # @property {HTMLElement} The element ...
This code determines which index for a given string if that character is removed will produce a palindrome string. For eg s = "baa" After removing b the string "aa" is palindrome. Here this is what I have written until now. Due to time complexity problems, it exceeds 2ms. How this can be made faster? #include...
I am trying to make my code as legible as possible, and today I wrote the following snippet and I'm unsure as to whether it can be improved in an obvious way. There's always room for improvement, of course. private Date extractTestRunDateFromLog() { Matcher testDateMatcher = Pattern.compile(regexes.getTestDateRegex...
I am trying to implement graphic objects that can be either Sprite, Base, Point or some others, but not very many types at all. That's why I do not make separate classes. All types exist in 1 class due to unions and few short switches. I use directly objects, not pointers, and no virtual methods. The question is also, ...
I made this simple addition calculator in Java and I'm wondering how I can improve it. package com.craftxbox.main; import java.util.Scanner; public class Main { public static void main(String[] args){ int inInt1; int inInt2; int outInt; @SuppressWarnings("resource") Scanner...
(See the next iteration.) I have this adaptive counting sort for integer arrays. Basically, it maintains a doubly-linked list of nodes. Each node knows its integer \$a_i\$ and contains the counter describing the number of \$a_i\$ encountered so far in the range. As you might know, the running time of counting sort is \...
For a recent project I was in need of excessive bit manipulation. Specifically, I had to write to or read from a variable number of bits up from the least significant bit towards the most significant bit. I created the following helper class since I had spare time and wanted to learn something. I made it work but feel ...
I'm writing code to generate artificial data from a bivariate time series process, i.e. a vector autoregression. This is my first foray into numerical Python, and it seemed like a good place to start. The specification is of this form: \begin{align} \begin{bmatrix} y_{1,t} \\ y_{2,t} \end{bmatrix} &= \begin{bmatrix} ...
Since I'm new to HTML and CSS, I was wondering whether my HTML layout is correct? Before I used div id for everything and everything seemed to work fine, however I recently heard about the use of span and div classes, so I've attempted to make use of them on a page from my website. The issue is I have no idea if I've u...
I wanted to get some eyes on some code that I wrote, and see if anyone can help improve what I did. Just looking for some constructive feedback to help make my code more performant, and more elegant. From a high level my code needs to accomplish the following: Create a function that takes an array of objects that eac...
I recently added this CubeMap class to my engine to make handling skyboxes easier. I would like to ask if my OpenGL coding semantics are good, and if I could improve this class in any way. CubeMap.h: /* * CubeMap.h * * Created on: Aug 9, 2015 * Author: mattmatt */ #pragma once #include <GL/glew.h> #include...
I have two lists List<Person> list1 = new ArrayList(), list2 = new ArrayList(); (Not the same size), of the class Person: public class Person { private String name; private int age; public Person(String name, int age) { this.name = name; this.age = age; } public String getName() { ...
I'm currently converting a PSD to a web template and attempting to overlap content and I'm running into a issue with the 3rd section because there is more padding than the first overlap and using the CSS style background-color covers wherever there is a block element but if there isn't anything in the pace a image tak...
I am retrieving data from Postgres (jsonb type) and I need to return an OrderedDict that has a predictable order for human and machine consumption. There are some common(ish) keys that should be used to direct precedence of values of common types (based on a predefined order and if sort_order is defined). Otherwise, ...
My solution for the topcoder ChessMetric challenge seems really slow. I feel like there should be a better way, but I'm not sure. Challenge Description Suppose you had an n by n chess board and a super piece called a kingknight. The kingknight can move either one space in any direction (vertical, horizontal or dia...
I have a little applet that I wrote in Python and Tkinter, and I was wondering what a good way would be to make it public, or open source or whatever. I think it's quite fun. You can add players, add singles games, add doubles games, and then it gives you a table of recent games and ratings with a bunch of stats (game...
I'm new to Ruby and don't know all the methods, so I was thinking there would probably be and easier way to do something like this. I'd love any input on how to refactor this. define_singleton_method(:delete) do |id| revised_words = [] @@words.each do |word| if word.id() != id r...
I've posted an excerpt from my Nginx configuration with the hope that someone can give me advice on anything I've done wrong or could do better. Please note that the below config works, but has been edited for brevity. The area I'd like you to focus on is TEST1 and TEST2. TEST1 is redirecting any requests to /folder/...
I built a calculator in C# with WPF for the UI. I'm still a beginner at WPF and C# in general, and I'm just looking for some constructive criticism. XAML <Window x:Class="Calculator.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/20...
I have 10 large (34 million cell) 2D gridded vectors storing doubles. When written they are over 200 MB in size. I use an ofstream object to write them to a text file (.csv format), one element at a time, using two for loops (one for my rows, one for my columns). They take way to long to write. Is there a faster way to...
The user will input two numbers, say 19 and 5. We need to equally divide 19 equally into 5 groups and output the start index and the end index of each group (using zero-based indexes). Example: Grp 1: 0 1 2 3 Grp 2: 4 5 6 7 Grp 3: 8 9 10 11 Grp 4: 12 13 14 15 Grp 5: 16 17 18 The output should be...
Telling the time based on the "set theory principle", the Mengenlehreuhr consists of 24 lights which are divided into one circular blinking yellow light on top to denote the seconds, two top rows denoting the hours and two bottom rows denoting the minutes. As a morning exercise I have been writing an implementatio...
I have the following tables: val postTable = TableQuery[Posts] val postTagTable = TableQuery[PostTags] val tagTable = TableQuery[Tags] One post can have multiple tags and postTagTable just contains the relation. Now I could query the posts and tags like this: val query = for { post <- postTable postTag <- post...
Sometime back I came across a bug where a particular object was leaking but it was very hard to identify the root cause. I knew that it was due to a cyclic dependency (which usually indicates a bug in the design), but couldn't get a clue where the design went wrong. I wrote a small utility class view on github to help...
This is an extension method to get a string that is truncated to a maximum length. Any comments? public static class StringExtensions { public static string WithMaxLength(this string value, int maxLength) { if (value == null) { return null; } return value.Substring(0...
I have this iterator class that expects in its constructor two directed graph nodes, source and target, and upon each next() generates another possible directed path from source to target, that was not generated previously. What comes to algorithm, it is basically a depth-first search. Since the nodes store their child...
I would like a review of the RAC implementation for the function setGist() I've posted the code on GitHub for easier reading. Description: You create an instance of GistService() let gistService = GistService() Then use public functions .resetGist() -> Bool and .setGist(string: String) -> SignalProducer<(URL: String,...
I'm currently taking Harvard's CS50 course via EdEx.org, and we're learning about sorting algorithms. More specifically, we're studying bubble, insertion, selection, and merge sorts. Just for kicks and giggles, I went ahead and decided to write a program that compares all three. Basically, what it does is takes arrays ...
A new diagnostic has seen the light of day! This one will alert you when you have a string.Format() call where the formatting placeholders are in the wrong order. The right order is defined as: For each placeholder with index N, its value should be higher or equal to the placeholder at index N-1 If you want a more el...
I'd like to get a review for the function build_list() which reads a file containing words (separated by spaces) and returns a linked-list of words: #include <stdio.h> #include <assert.h> #include <stdlib.h> typedef struct ListNode { char* word; struct ListNode *next; } ListNode; typedef struct List { Lis...
I've completed a program as a learning experience to make sure I've got the concepts down. I found a practice project online and decided to try it out. The program compiles and runs exactly how it should with no problems. The program is a game called Artillery. You have to fire a cannon at one enemy at a time until you...
I wrote a Python sort function that uses shell sort: # shell sort # ignore the comments def shell_sort(sequence): # shell sort needs an increment sequence # the increment sequence used here is 1, 2, 4, 8, 21, 56, 149, 404, 1098... # the sequence is defined by the following equation: round(e^(n-2)) + 1 ...
Whilst developing a game I needed a delay routine capable of doing delays ranging from 0.5 sec to just a few msec. The obvious choice was to use the BIOS delay function 86h on int 15h. In a true real address mode environment it works correctly but I saw that an emulator like DOSBox messes up things. Tons of illegal rea...
Warning: This implementation is obsolete, because it doesn't meet the standard. Specifically, while the standard guarantee any pointers and references to elements to remain valid after insertion or erasure at the front or the back element, this implementation doesn't. This issue will be discussed later. In fact, entire...
I've always found coding UIs in Java very inefficient, and hopefully this is because of my misunderstanding. Here's a great example. I have a UI class which is returning the String "Hours", which is effectively going to be a CSV file containing opening and closing hours of a business, Monday through Sunday. Each of the...
I started following Harvard's CS50 (Introduction to Computer Science) on edX, and as part of their Hacker edition set 1 was the following assignment: I am supposed to write a program (in C), that takes as input a long long int from the user and proceeds to check whether the entered number is a valid credit card number....
Is the following helper idiomatic ASP.NET MVC? All the built-in DropDownListFor helpers only accept IEnumerable<SelectListItem>. If the Model doesn't have this list, but an IEnumerable<SomeEntity>, avoiding this conversion in the Razor template seems to require some more of its helpers. namespace CompanyName.ProjectNam...
A friend of mine asked me to write a script for showing the most used tags in her Tumblr blog in the last days. I saw it as a great opportunity for learning JavaScript and accepted it, as it seemed simple enough while being useful. I "chose" the requirements to be: Simple basic usage, not requiring JavaScript knowledg...