instruction
stringlengths
71
71.9k
Here is my code to retrieve a class from a different solution (both solutions are in the same folder) using an XML file: var xml = XElement.Load("settings.xml"); var query = xml.Elements(); foreach (var XMLProtocol in query) { string NameSpace = XMLProtocol.Element("NameSpace").Value; string...
This is a follow-up to the other post I made (less than an hour ago) about my Google reCAPTCHA C# implementation: Google reCAPTCHA Validator This adds support for error messages, so that you can determine why a reCAPTCHA request failed (if an error was returned). This also fixes a bug if you were to use the ReCaptchaLo...
I'm very new to JavaScript, so I'm not sure how to optimize the following code (which seems to run fine) further, though I did try to implement a few tips found on the web — such as using local variables for document elements, using do/while loops instead of for, or using join for string concatenation. I've read about...
My goal is to obtain the nth weekday of a given month. Parameters are a date from a given month and the nth weekday I'm trying to obtain. It returns the Nth Weekday of the month if it exist and returns DateTime.MinValue othewise. For my purposes weekdays are M-F. Is there a more elegant or efficient way to implement th...
I wrote a script to turn a file like this one into a colored 2D histogram: xbins, ybins, xmin, xmax, ymin, ymax 12, 12, -0.1, 24, -0.1, 25.1 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0...
I would like to make this code more elegant and have it written in a more standard manner, but I cannot write anything better with my current JQuery knowledge. So I would appreciate any suggestions to refactor the code below for better performance. (function ($) { var Doc = function () { this._init(); ...
I submitted this exercise for a potential job. I really was hoping to get some meaningful feedback, so I can improve. Instead, they gave me a one line response: "showed a limited understanding of data management techniques and dom interaction." Not sure why they said dom interaction as this has nothing to do with the ...
Linked: Google reCAPTCHA Validator: Iteration II I have also created a simple Google Recaptcha Validation class to handle verification. I used some code from CodingFusion's post Google New reCaptcha I am not a robot using asp .net, but I have altered it so that it fit my use case, and to make it extendable and reusa...
I've been thinking about error handling in C++ lately. Exceptions are a great way of handling errors in most applications. However, I work in the games industry where it is commonly accepted that exceptions should be avoided, so I'm looking for a clean and simple alternative. (The validity of avoiding exceptions in gam...
I have three text fields (DevExpress ButtonEdits set to read only) on a Windows Forms app. They look like this: They're used by dragging and dropping a single file on each field. If a dropped file belongs on a particular field (correct file type with legal contents), the file is parsed and its contents are used to p...
Our quest: Create a big simulation for Conway's Game of Life, and record the entire simulation history. Current Approach: Cython is used for an iterate method. The history of life is placed in an HDF store, with help from pandas, and matplotlib is used to visually check results. What I could use help with: While I'd lo...
I've built a calculator. I would not use angular or bootstrap because I am becoming addicted to them. I also wanted to check for double '.' use, and to limit the screens max text length but did not make it in time. I am new to JavaScript, CSS and HTML and would like to know how I am doing. <html> <body style="font...
This is my first text-based game I made. It's very small because I just learned Python and wanted to start small, and then code bigger programs. I added some stuff since the last time. Please give your honest opinion. Here is my original question about this game. import random import time import sys def fight_enemy_3...
Out of fun, and to practice my rusty C# skills, I've made a very basic program. It only has 1 function: When you move the mouse to a side of the screen, it shown on the other side. Like an infinite scroll! I am totally aware that there are users with 2 or more screens. I'm sorry, but it only works for 1. It's a limitat...
I'm trying to come up with a script that will add license headers to certain files (depending on extension). My Bash is very average, so any guidance would be much appreciated. I'm not quite sure what to ask for except for whether I'm making any gross mistakes. #!/usr/bin/env bash set -euo pipefail shopt -s globstar ...
I'm working on some code examples in 'Automate the boring stuff in python...' to prepare for my first year of CS. I want to know if its better to use an array with random selection below or rather multiple if/elif conditionals to generate output. Any and all suggestions are welcome. import sys import random import time...
This code checks 2 images' pixels, compares each pixels based on the threshold (<= 7), finds a best fitting watermark image from the system given 6 images, and loads that image next to the cover image. For a 100*100 watermark image this particular code takes nearly 130 secs to give output. Please suggest some ways to o...
Here is the source of the question. Given a singly linked list, swap the list items in pairs (reconnect the pointers, not simply swap the values). For example: Before: A->B->C->D After: B->A->D->C Revision 1 Revision 2 Revision 3 Revision 4 This revision is available on GitHub. I decided not to delete my iterator...
I'm trying to make a program that will create an account on Reddit using an HttpWebRequest. I ONLY want it to do that. (I don't care about it storing a cookie or anything else.) I just want it to be a simple program where you type a username into Username_TextBox.Text and a password into Password_TextBox.Text and then ...
I've been looking for quite some time to fix the wobbly spinner issue. Many people made numerous suggestions using fonts / pure CSS / CSS + JS. Unfortunately, none of the proposed solutions were acceptable to me. The problem with fonts like FontAwesome is that the icon has to be perfectly centered in a container for it...
What I have is a grocery list. Once I select a grocery by ticking the checkbox, I can select an amount for that product and a unit (unit is referred to in my below code as group). Once I am done, I click save and the values are updated in the database. But for all checkboxes that are unchecked, the values should be upd...
I'm going to job interviews soon. How I can improve my coding style and write better code? package com.amoghantarkar.Stack; import java.util.*; class ArrayStack{ private int capacity; private int top; private int[] array; public ArrayStack(int capacity){ top = -1; this.capacity = capa...
Problem: Classify the user (such as infant, child, teenager, adult) based on user's age. Solution Please run the solution here. The code snippet written below works well as expected. I want to know if there's a better way to do or refine this. package main import ( "errors" "fmt" ) func age(urAge int) (int,...
I am a casual C# programmer, not formally trained in OOP at all; mostly I focus on Transact-SQL in SQL Server, and so when I write C# apps I get grief about the constructs and methods I use. Here is a simple app I wrote for this blog post - it was not meant to be a production app, and performance is certainly not a pri...
This code basically checks for four types of alarm flags in .ItemArray[5] to .ItemArray[8]. If an alarm flag is true then its corresponding setpoint is checked for realtime value. The setpoints are in .Itemarray[1] to .Itemarray[5] and the real time value is in engValues[i] If an alarm exists a row is added to a table ...
I would like to know how to improve the performance of the following query: SELECT Kunde.Nachname, Kunde.Vorname, Kunde.Debitorennummer, sum(Abmeldestatus) AS Abmeldestatus, Ab1.Fruehstuck, Best1.Menu1, Best2.M...
Can someone tell me how I can improve this code? It works ok, but I feel that I'm using too many pointers. #include <iostream> using namespace std; struct link{ int data; link *next; }; class link_list{ private: int boundaries = 0; link *tail; link *temp; link *head = NULL; public: void add...
I plan to work on Introsort, which requires a working implementation of heap sort. Also, the heap sort implementation must be able to sort arbitrary ranges within an array, which, in turn, requires some more involved index manipulation. Heapsort.java: package net.coderodde.util.sorting; /** * This class implements he...
So, I took a look at the August Challenge: The top-voted answer is Racetrack1: "In the game of Racetrack2, cars race around a track bounded by two concentric closed loops drawn on a square grid. Implement a program that plays this game." 1Links to answer in meta 2Links to wikipedia article of game and I tho...
Yesterday I found myself struggling with creating an A * algorithm in Java, but this morning I finally figured it out, so I would love to hear what Code Review has to say about it! The goal here is not performance since it was a learning exercise. I tried to make the code and algorithm as readable and simple as possib...
As part of a project I'm working on, I need to measure FPS. In the past, I would do this within the actual project itself, but recently I've been trying to implement more abstract (and reusable) manners of doing such simple things. So, I built an FpsCounter class that handles all this for me! /// <summary> /// A utilit...
Now I have this Introsort for integer arrays. Basically, Introsort is the same algorithm as Quicksort. However, in the very first invocation of that "Quicksort", it computes an integer threshold that is logarithmic in \$N\$, where \$N\$ is the length of requested range. Whenever Introsort notices that its current recur...
I created a R package to calculate Pi with a Monte Carlo simulation. My goal is to optimize the parallel function SnowPi as much as possible. This is the SnowPi.R code: FSnowPi <- function(DARTS, ROUNDS, proc_num, numprocs) { retvals <- .Fortran("snowpi", avepi = as.numeric(1), DARTS = as.integ...
I made an attempt to implement a Properties File MRU Cache with a limited cache size which are of the most recently used properties can only be held in. A read miss from this cache leads to a read from the file for that particular property and keep it in the cache until it goes out of the limit where other recently pr...
Here is a simplified implementation to obtain the duplicate words in a text using lambda expressions. public class FindDuplicateWordsInText { public static Set<String> findDuplicateWordsInText(String text) { String[] words = text.split(" "); Set<String> duplicatesRemovedSet = new HashSet<>(); ...
I am relatively new to Bash, regular expression and stuff. In a directory, I need to read the last line of all the files that contain the word "fitness", and list (on one line and separated with comas) the first element of these last lines (where elements are defined by spaces), whenever the second element (or any elem...
In order to learn Go, I've implemented the cat program in Go. I want to know if the code is idiomatic and what could be improved. package main import "fmt" import "io" import "os" var errors int func main() { catFilesOrStdin(os.Args[1:]) os.Exit(getExitValue()) } func getExitValue() int { if (hadErrors(...
I want to check some timing of my (pre-C11) C++ and wrote a class: class ScopedTimer { timespec start_,end_; std::string name_; /// name of this timer (used in output) bool active_; /// if not active, no output is printed clockid_t clock_id_; /// clock type used for this timer public:...
Right so I was doing a quick project, and sought a quick way to finish one section of my Python code. I handed it in, but I'm well aware that it's bad code, but I was wondering if there was a good way to condense this code into fewer lines. def nGen_army(level, strength, weakness): if weakness == 1: if lev...
I have this piece of code, and I want to make if the way I'm calculating the time complexity is valid: void traverse() { int currSum = 0; for(int i = 0; i < original.length; i++) { currSum = original[i]; for(int j = i + 1; j < original.length; j++) { if(max <= currSum) { ...
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...