instruction
stringlengths
71
71.9k
Consider this python 3 snippet, where when an import exception is raised, a string 'e' is created that says: "No module named ' packageName'". The goal is to simply say on exit, that the import error can perhaps be solved by installing a package of the same name. I came up with this, and it works but I'd like to make i...
My application takes a .csv (comma separated values) file and serializes the data into a binary file. Then it converts the binary file back to a .csv file (identical to the original file). For example, consider the following .csv file: John, Appleseed, 435, 89.2 Debbie, Downer, 924, 70.3 Shirley, Temple, 0235, 93.7...
Can someone please review my code and let me know if there are some bugs or possible improvements? /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ public class Solution { //return true ...
I was assigned to create a simple Tic Tac Toe game in java for class, and here is what I got. I would like to know how the code could possibly be shortened without using really advanced topics since I haven't covered them yet. Here goes: import java.util.*; import javax.swing.JOptionPane; public class TicTacToe { ...
The text of a website is checked in a given time period. If there are any changes a mail is sent. There is a option to show/mail the new parts in the website. What could be improved? #!/usr/bin/env python3 import urllib.request, hashlib, time, html2text, smtplib, datetime, argparse class urlchange: def __init__(se...
I worked around using strtok function so to assign first name and last name to a struct PERSONNE from a char *names[] array. It was not possible to directly modify the *names[] using strtok since it was throwing an exception. This code works fine but the last loop shows a lot of '\n' until it reaches 10. I am unable to...
I have 2 alternatives for executing recurring tasks in ASP.NET MVC. We just need to add some code in Global.asax First alternative: private static void ThreadSendNextMail() { while (true) { HostingEnvironment.QueueBackgroundWorkItem(async cancellationToken => { using (var db = new EFDbContext()) ...
Desired output: Can I get an shorter version of this code? My instructor just wants me to figure it out my self. #include <stdio.h> int main() { int month,week,day; printf("Enter month: "); scanf("%d",&month); printf("[ 1=Sunday 2=Monday 3=Tuesday 4=Wednesday ]\n[ 5=Thursday 6=Friday 7=Saturd...
This is the task: Write a recursive program, which prints all subsets of a given set of N words. Example input: words = {'test', 'rock', 'fun'} Example output: (), (test), (rock), (fun), (test rock), (test fun), (rock fun), (test rock fun) In fact I need to generate all subsets from 0 to words.Length. In Pascal (i...
I have this class that iterates over all permutations of an input list: PermutationIterable.java: package net.coderodde.util; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; import java.util.List; import java.util.NoSuchElementException; /** * This class implements an {@code Iterable}...
Let's say I have this User model: class User { public $id; public $email; public $password; public $errors; public function isValid() { if (strpos($this->email, '@') === false) { $this->errors['email'] = 'Please enter an email address'; } if (!$this->password...
My task for uni is to create a program using structures. In this program I have to make an entry of students, their name, birth date and group (a random number). And I have to search the students according to the input age. Please note that I am still learning :) #include <iostream> #include <cstring> using namespace ...
Given a list of \$n\$ objects and an integer \$k \in \{ 1, 2, \dots, n \}\$, this iterator generates all possible ways of partitioning the elements in the list into exactly \$k\$ disjoint, non-empty blocks (partitions). There is exactly \$S(n, k)\$ such partitions, see https://en.wikipedia.org/wiki/Stirling_numbers_o...
This is my function for determining the Longest Substring between two strings in Java. public class Main { public static String longestSubstring(String str1, String str2){ int row = str1.length(); int col = str2.length(); int[][] checker = new int[row][col]; int max = 0; i...
This program makes a call to an API (http://api.football-data.org/) and obtains data for fixtures of Chelsea FC for the next 100 days in JSON format. The JSON is parsed into a Java object and then displays match details in the console. I am looking for any possible improvements I could make to this program. Also, if th...
Class Student { Int studentId, List<ClassB> Books, Bool IsPassed } Class Book { Int bookId, List<int> pages } I am creating a list of students the way below static void Main(string[] args) { var students = GetStudents(); var result = students.GroupBy(r => new { r.StudentId, r.IsPa...
We have a StreamBuffer class which is not inherited from std::ios_base (or some of it's derivatives such as std::ostream) so that I can use std::fixed operations and I am trying to prevent number showing up in scientific notations. With my below code some numbers are getting shown in scientific notations. We want to av...
I have written my own CMS for learning, and have included all of my core files below. This is my first time playing with OOP and prepared statements, so I imagine there may be alot of changing. There is one problem I am having, when I try and check if a username/email already exists in the register function by using ei...
I have implemented the atof function. Here is my implementation double atof(const char *str) { double a; /* the a value in a*10^b */ double decplace; /* number to divide by if decimal point is seen */ double b; /* The b value (exponent) in a*10^b */ int sign = 1; /* stores ...
I've been trying to improve my C++ skills as well as work on some general coding techniques so I've attempted to build my first binary search tree in C++ using templates. I've mostly done Java programming but have worked on some smaller C/C++ projects. There are three things that I'm most concerned with to make sure I'...
I implemented a Vigenere encoding and decoding class. Ideally, the program should be able to take any abritrary file, read into an array of byte, and decode it. import java.io.*; class VigenereFilterReader extends FilterReader { private final char[] key; private int i = 0; VigenereFilterReader(Reader in, ...
I have developed the following implementation of an immutable struct Maybe<T> monad for use in my game project; as an practical exposition on monads to present to my local User Group; and an a demonstration of the use of Static Code Analysis for verification in conjunction with TDD. I am interested in any and all comme...
I'd like to make sure error details are never sent out in responses from my restify-powered API. The best way to achieve that seemed to be via wrapping server.formatters in another function which filtered-out Errors before passing the transformed body on to the relevant formatter. I've probably missed some more obvious...
I decided to try and learn Julia for doing scientific computing, and I decided to tackle the problem of finding $$ \int_{D_{\frac{1}{4}}} x^4 + y^2 dA $$ where \$ D_{\frac{1}{4}} \$ is the part of the unit circle in the first cuadrant. My code in Julia is the following: using Distributions e = 10.0^(-3); p = 0.85; var...
This is an exercise from my computer programming class. This program reads in student scores from the user (input) and displays the total points earned along with a grade. I am tasked with modifying it to ask the user for confirmation when a score higher than 100 is entered. Plainly, it should not add a score greater t...
I have a Windows program that prompts the user to input a file path and filename. I then check that the file exists with Directory.Exists. Then the user inputs a filename and I check it using this answer to check whether the filename is valid or not (it may or may not yet exist). using System; using System.IO; using Sy...
My code is basically the home page (index.php) of a website for finding products. It accesses a database table to get a list of all countries and then populates a <select> so the user can add a country to their search filter while finding products. Are there any website "code smells" in this code? Is it considered cle...
Given a 2d array, the problem is to find the largest sum, where each subsequent is >= the previous digit but < all of the 'neighbour' digits. You can only move up, down, left and right. My solution will run in \$O(N*M)\$ time with \$O(N*M)\$ space (please correct me if I'm wrong). The solution is as follows: Start at a...
I have implemented an Array class using templates. I have used a std::allocator object for memory allocation. Will it be better to use operator new along with placement new for memory allocation? array.h #ifndef ARRAY_H #define ARRAY_H #include <memory> #include <cstddef> template <typename T> class Array; template<...
This is my first app I have made after learning programming on iOS. Most of the app is complete just the UI and some features are left to be added. Any optimizations and coding practices would be very helpful. The code can be found on my github repo Download link for zip if there are some problems with github version:...
I have written code to find whether the path exists between source and destination in a directed graph. I have used BFS and instead of ArrayList or queue. I have written my own helper class. Please let me know how the code can be improved. public class Graph { private int numVertex; // Helper class, which can ...
I started writing a script to handle my file downloads in osx because they quickly pile up and it gets time consuming to do this manually by drag and drop. I am looking forward to get some feedback. require 'filewatcher' require 'pathname' require 'fileutils' class FileAction def initialize(filename, event) @fi...
I'm very new to C++ and Arduino, with a background in Python. I've written this code for a countdown timer and a simple menu to set the time available to each player, using button handling code from here. It works as expected, but I don't know whether this is good idiomatic C++/Arduino code or if I could be using bette...
The purpose of this code is to log the inputs of a form (which is a menu for a shop) to the database to be kept as records as well as printed out as a receipt at the store. I have been learning how to code from the internet and tried to put together my knowledge in a project. The code is working, but I would like to ad...
Below is the code I have written to enhance my understanding of Command Pattern in Java. As per my study and understanding, when we have some entities [ which we call as receivers ] then Command pattern is useful in encapsulating those unrelated receivers and the operations in command objects. Please provide me feedba...
Our Sonar code analysis server tells me Boolean literals should not be redundant. Redundant Boolean literals should be removed from expressions to improve readability. Tag: Clumsy and categorizes it as a minor bug. Is this an error in the associated Sonar/FXCop C# rule (maybe it cannot handle nullable types?!) ...
I've implemented a BackgroundWorker in my WPF app. My code is pretty ugly though. I've been told to write as little as redundant code as possible. IS there some generic Method I could employ to reduce the amount of code? //BackgroundWorker Databases private void worker_updateDatabases(object sender, RunWorkerCo...
Soo... I recently read a meta-post about the inherent problems of reputation. It listed some things like: Confirmation bias. Demotivating for low-rep users. Hubris and elitism of high-rep users over low-rep users. Incorrect representation of competence. ... So I thought to myself: "How would the network be, just with...
How can this method that inserts a hashref into a database table be improved? It assumes that the columns of the database table are named identically to the fields in the hashref. The return value is the id field created by the insert. sub insert(){ my ($table, $data) = @_; my ($fields, $placeholders, $values...
Is there a better way to do this Java 8 String Unique Permutations in Parallel package com.bos; import java.util.Date; import java.util.Set; import java.util.concurrent.ConcurrentSkipListSet; import java.util.stream.IntStream; public class StringPermutation { private static Set<String> set = new ConcurrentSkipLis...
I am coding a proof of concept on the danger of JavaScript poisoning, XSS and other client side attacks. Therefore, I coded some JavaScript payloads. As I am not very familiar with JavaScript (I actually hate this language). I would really appreciate if you could give me some recommendations in order to improve the cod...
I am slowly learning PHP and have been using prepared statements. I have a simple category.php page, which takes a category tag to display posts from that category, such as localhost/php/category.php?tag=sysadmin. I want to select the Category Title from the "j_oracle_cat" table based on the value of the incoming tag i...
I've made the following VBA script to analyse text recurrence in a huge batch of descriptions. For a small part of the batch the code run smoothly, but when I include everything it tends to loose control, get stuck and both Excel and VBE freeze. What I did to avoid this (at least most of the times), is to include tempo...
Script intended to remove Vault & Consul setup before run re-provision them on server. This is my first Ruby script, so will be perfect to see my mistakes here. #!/usr/bin/env ruby require 'net/ssh' $me = File.basename(__FILE__) print "\n[#{$me}] Vault & Consul DESTROY started on the #{$HOST}.\n" if not ARGV.empty?...
I did not find a single working implementation of using an Executor Service with a Blocking Queue. So , I have come with with a working sample. Thoughts? import java.util.Map; import java.util.concurrent.BlockingQueue; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ExecutorService; import ja...
In an effort to learn C# / improve my coding skills, I've started working on the Project Euler problems. I see that I may have been overthinking things a bit after finishing problem 7: By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. What is the 10 001st prime num...
When a user clicks on "Case", it pops up a box where they have to input a number, which is later used to calculate the value to Euro and around to other values. After this, it checks which value is larger than 0 and writes it to the display box with a white line between each value. I want to optimize this code. What's ...
This is my first PHP project - just to write to something to learn from. I made a page with form to send some quote to server and display some quotes from db. I'm just starting with PHP so point out anything that could help me improve. Live version. quote-a-day.php <?php require_once $_SERVER['DOCUMENT_ROOT'] . '/...
I have code that backup files to remote servers. There are 2 pandas data frames: storedfiles: that points to the files already stored in previous runs filelist: a list of candidates to be stored in one of the depots (comes from a config file). Filelist structure has the following columns: In [10]: filelist Out[10]: ...
What I need to do is fetch the XML link using curl then get a student ID and check if the ID is present in the database. If yes, then I need to get other details from another database table. My code works fine but it's kinda slow. I later need to add more functions in this which will make the loading speed slower. Is t...
I have create a functioning automated traffic light sequence using an array and if statements. It all work correctly but I am wondering if there is anything more I can do to improve my code without changing to structure or way it works, so without the use of dictionary's etc. <!DOCTYPE html> <head> <title> Traffic...
I'm a freshman in Python world, I used to program in C. I wrote a function/method that returns the power of a number: def pow(x, y): powered = x if y == 0: return 1 while y > 1: powered *= x y -= 1 return powered Mine is a logic question (correctly): if I set y = 0 then it ...
I am trying to write code for simulating movement of single elevator. This was a question to me and was pretty straightforward as the use-case was explained properly. So the problem contains following data: inputFloors : all floors elevator should go to. e.g. {5, 2, 9, 3, 8, 1} currentFloor : current floor where eleva...
I have this (recursive) binary search implementation in Python, and I want you to criticize every aspect of it. It is a naive implementation, (drilling the basics and stuff), but, I want you to comment on the perceived clarity, maintainability of the code, defensive programming practices, test cases that could be usefu...
This is one part of my website, it fetches a list of habits from my Restful API. Each description of habit in list gets append to a list item in the HTML. During this loop, a event click listener is attached to each description. After that, a page navigation will get created. I made it so that every page will only disp...
As an exercise, I limited my self to the man pages. I didn't look for a previous existing implementation because I wanted to see how well I could do on my own. I also tried to handle as many cases as I could think of. I am sure there are weaknesses so feel free to point them out. Where can I improve my usage of the C s...
I'm from PPCG so I was making an esolang and I decided to write it in Python. Eventually it went from an esolang to an OEIS (Online Encyclopedia of Integer Sequences) lookup tool. I'm very new to Python. Essentially this program takes an OEIS sequence number (e.g. 55 for sequence A000055) and the nth number in the seq...
I have been working on a simplistic weather application that utilizes the openweathermap.com API. I have an ajax call to make an HTTP request to get a JSON object that contains the data which is returned in the success callback from the HTTP request. I use JQuery to display the response object's data. All of which resi...
I have a lot of experience in Python and Haskell but am new to C++, so I'm wondering if my code is idiomatic. For one of the first assignments in my class, I wrote a linked list class (the "cities" are nodes in the linked list, the teacher wanted to make things interesting, I guess). Here's the header I had to implemen...
I'm taking in a string of input from the command line, and when prefixed by 0o or 8# interpreting it as an octal string. I'd like to convert it to a byte array more directly, but I'm not sure how to perform the bit carrying in LINQ. All three of these methods are fully working; you can checkout the repository or just d...
This module is going to be part of a larger ElixirChess library for validating chess positions and moves, but I started with the core of it which is parsing a position from FEN notation into a more consumable format and back again. I'm basing this somewhat on Chess.js, so I decided to convert the board to a tuple of pa...
I'm willing to listen to any advice you have for improving it. from collections import defaultdict import nltk import numpy as np seq, freq, sample = [t for ts in [[None] + nltk.casual_tokenize(line) + [None] for line in open("file.txt").readlines()] for t in ts], defaultdict(lambda: defaultdict(int)), lambda curr: n...
Here is my code for converting a sorted array to a binary search tree. Please review and let me know the improvements or some better way of solving this. /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeN...
Here is my code. /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ public class Solution { public List<List<Integer>> levelOrder(TreeNode root) { List<List<Integer>> list = new LinkedLi...
I just finished writing a program which working with a database. Throughout the process when working with people to get past some of the hurdles I faced I was ridiculed for my SQL statements. I have never fully understand what to do to protect myself and I know there is a lot of information out there to read. But now t...
The Rubberduck 2.0 Code Inspections UI was recently redesigned (again!), this time featuring a GroupingGrid control (thanks @BrunoCosta!), and what appears to be a dynamic grouping: Resources The UserControl's resources include two CollectionViewSource definitions, which determine the sorting and grouping rules for th...
I am trying to create an application where I need to know where to put the logic. Here is the code HomeController.java @Controller public class HomeController { private EmployeeService employeeService; @Autowired(required=true) @Qualifier(value="employeeService") public void setEmployeeService(Employe...
While looking at a recent question, I realized that there is no CSV parser in the standard Java library. I decided to write one that complies with RFC 4180. Highlights of the standard include: Whitespace is significant. Strings may be double-quoted. Inside a double-quoted string, newlines are treated literally, and...
t is number of tests; each test contains two lines: n and sequence n is number of integers sequence is a sequence of integers from 1..n (e.g. '3 6 1 2 4 5' if n is 6) Rotate sequence until you maximize the number of integers that match their position in the string. (e.g. '3 6 1 2 4 5' should output '1 2 4 5 3 6'). Pri...
I'd like to know if I can improve the performance of my recent bot, and maybe some design patterns too. So far, it's warning a user if it's using some bad words (which are parsed from bad_words.txt) and it's entertaining the users by posting jokes from jokes.txt. from selenium import webdriver import time import random...
I recently completed this code challenge so just looking for some feedback on my code. The task is to read polygon coordinates from a file and calculate the perimeter, I was provided with a script containing bugs and asked to fix and improve the code. Example input data.csv x,y -16,-18 -18,-10 2,6 1,-2 9,-13 -7,-14 -9....
Here is my code without using additional data structures. Assuming all the characters are alphabetical and character checks are case-insensitive. public static boolean isRepeated(String s) { if (s == null) { return true; } int length = s.length(); for (int i = 0; i < length; i++) { if (!...
I have CSV file which has structure like this (separated by tabulators): VariableName DateAdded ValueNumeric VariableName DateAdded ValueNumeric VariableName DateAdded ValueNumeric Examples of lines in input data: VariableName DateAdded ValueNumeric St.podatkovnih_blokov 1.12.2015 0:00:21 0,200...
I made this function to get rid of writing numerical option values in a HTML-select manually. From what I have seen so far it works as expected. But hints and suggestions are welcome anyway. // Trying it out. var selects = document.querySelectorAll('.drop-down'); selects = Array.prototype.slice.call(selects); create...
This is a customer information data entry form. First name and Last name are required. In addition phone number, e-mail and birth date are used to check the database for existing customers with the same information. Either of these fields (phone, e-mail or birth date) can be empty or filled in. In order to validate aga...
I'd like the function below reviewed. I'm especially interested in improvement ideas to process the API responses faster. products_list is the API response in the form of list of dictionaries which returns all products for one supermarket only (out of many). def encode_products_response_list(products_list, rows_list): ...
This is the implementation of BFS and DFS i have tried to follow from CLRS.Please suggest what can be improved in this code. import java.io.File; import java.io.FileNotFoundException; import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; public class Graph { VertexList[] row; int time;...
I have several hundred "A" rasters, numbered from 001_A.tif to 100_A.tif. I also have several hundred "B" rasters, numbered from 001_B.tif to 100_B.tif. I want to multiply them like this: 001_A * 001_B = 001_result 002_A * 002_B = 002_result 003_A * 003_B = 003_result . . . I have a loop in R which works fine, but it ...
Task: My implementation: public class Main { public static void main(String[] args) { String fileName = "Brackets.txt"; Path filein = Paths.get(fileName); ParentStack s = new ParentStack(); if (!Files.exists(filein) || !Files.isReadable(filein) || File...
Here is my approach. 1. Checking there is no cycle.(Using BFS) 2. All nodes are connected. (visited) public static boolean isTree(int[][] adjMat) { int numVertex = adjMat.length; State[] isVisited = new State[numVertex]; for (int i = 0; i < numVertex; i++) { isVisited[i] = State.UNVISITED; } ...
I have this java.util.Set implementation that is based on AVL-trees, which implies that the set is sorted. However, it provides two additional operations: get(int i)returns the ith smallest element in the set, and indexOf(Object o) returns the rank of the object o (the rank of the smallest element is 0, the rank of th...
Here is my approach. Do DFS and check in stack whether the new node is already in the Stack or not. public static boolean isCyclicDFS(int[][] adjMat) { int len = adjMat.length; boolean[] isVisited = new boolean[len]; for(int i =0; i<len; i++) { isVisited[i] = false; } ...
I have two DataTables: dt: is populated from a CSV file with over 1.7 million rows dataStructure.Tables["AccountData"]: is populated from a database query also roughly a million rows I use the following code to iterate through and compare the data from each set of rows. The code takes over 48 hours to complete. I hav...
this.action = function(value){ var deleted=false; for (var row in binaryObj) { if(value == 3){ for(var i = 0 ; i < binaryObj[row].length; i++){ binaryObj[row].sort(); if(binaryObj[row][i]+binaryObj[row][i+1] === value) { ...
I explain the nonlinear correlation coefficients in this paper and provided the code in this post. The nonlinear nonparametric regression is an extension of this work and its description can be found in the linked paper. In short, the subset means are the regression points and we can achieve a better fit by increasin...
I'm calling an expensive function that dynamical changes as the end user types in a textbox. To reduce the amount of calls to the function I've used setTimeout to delay calling the function, and if the function is called again whilst waiting to run, it'll also remove the last function request via clearTimeout. The func...
I wrote this script for adding information to a compressed file and compressing the output: #!/bin/env python3 import argparse from Bio.bgzf import BgzfWriter import gzip import sys def main(): args = parse_args() # with BgzfWriter(args.out, 'wb') as fd_out: with gzip.open(args.out, 'wt') as fd_out: ...
Background This is a follow-up of this CR: Compile-time plugin system. The code exposed below can also be browsed on this gist, which shows the differences between both questions (original is version 1, this one is version 3). This is a simple factory which is able to serve the requested specific implementation of an i...
I'm looking to improve the runtime and efficiency of my VBA code that performs multiple Replace operations on an Excel Spreadsheet. I started out with the following (please forgive me for this horrendous mess): Note: Some values/symbols did not show up correctly in this first piece of code(blank values displayed in 'Wh...
I am currently implementing pyramids in Lucas Kanade algorithm for optical flow. To be able to build pyramids, I need to pad the images (mirror edge matrix elements) for the required amount of rows/cols determined by parameter half_window. I have written this code which works but I am new to C programming and it looks ...
Background information for those of you who don't know what 4chan tripcodes are: Via Wikipedia: A tripcode is the hashed result of a password that allows one's identity to be recognized without storing any data about users. Entering a particular password will let one "sign" one's posts with the tripcode generated from...
For string similarity, it is defined as longest common prefix length. For example, "abc" and "abd" is 2, and "aaa" and "aaab" is 3. The problem is calculate the similarity of string S and all its suffixes, including itself as the first suffix. For example, for S="ababaa", suffixes are "ababaa", "babaa", "abaa","baa","a...
I read through other questions here and improved the code and added a new feature. The old question can be found at: Email a notification when detecting changes on a website The improvements that are done until now: Using a difflib.SequenceMatcher Added a logger Using format for strings Exceptions are now logged and t...
This is my first dice game and I have spent countless hours working on it, yet it is still very basic. I was wondering if anyone could spare the time to suggest improvements. import time import random import sys Password= 'password' while True: password= input('ENTER PASSWORD:') if password == Password: ...
My first piece of code encrypts text by moving each letter in the string 5 letters across in the alphabet. encrypt = input('Enter text to encrypt : ') encrypt = encrypt.lower().replace(" ", "") for i in encrypt: print(chr(ord(i) + 5)) decrypt = input('Enter text to decrypt : ') decrypt = decrypt.lower().replace(" "...
As part of an interview, I had to submit a code sample to solve the classical "triples sum to 0" problem. The reviewer said the algorithm needed to be in n2 time, and I was later informed that the code I wrote did not accomplish this. Can you guys help me identify where I went wrong? I've written comments explaining my...
We have three integers: A, B, C where the first (i.e. the most significant) digit of C is the first digit of A, the second digit of C is the first digit of B, the third digit of C is the second digit of A, the fourth digit of C is the second digit of B etc. If one of the integers A and B runs out of digits, the rema...
The following code is a computing quiz: import random #the questions/answer dictionary my_dict = { "Base-2 number system" : "binary", "Number system that uses the characters 0-F" : "hexidecimal", "7-bit text encoding standard" : "ascii", "16-bit text encoding standard"...
I want a JSON object of the following structure to plot a chart chartGroup = [{name: 'A<->B', to: 254, from: 247}, {name: 'C<->D', to: 208, from: 211}, {name: 'A<->C', to: 46, from: 41}, {name: 'A<->D', to: 10, from: 38}, {name: 'B<->C', to: 56, from: 55}, ...
Can I optimize the BuildEntity method more? protected IEnumerable<GroupTitle> BuildProductGroup() { var productGroups = new List<GroupTitle>(); using (var connection = new SqlConnection(_dbConnection)) using (var command = new SqlCommand(_getProductGroups, connection)) { ...