instruction
stringlengths
71
95.1k
This is the follow up for a question you can find here: replacing words with their abbreviations The goal here is to compare two petential way of answering said question that was: This particular function's goal is to replace words with their abbreviations by compairing each word with all of those in the config file a...
Hypothetically, I have a bunch of generators that never end, like: function* progression() { let n = 0; while (true) { yield n++; } } I want to take first N items from that generator. So I made a function take for that: function* take(n, generator) { let i = 0; let values = generator(); for (let v ...
I would like to know opinions about the design I came up with to handle stdout capture to show progress in a PyQt5 application. So, I have this module which is meant to be run as a command line application. When called with some arguments, it takes time to run, giving progress to stdout and in the end returning some da...
I'm looking for feedback on ways to improve the maintainability and readability of my code. I'm especially interested in hearing about ways I could improve the code's adherence to good object oriented practices. Thank you! Purpose of the code: Reject a client's requests if that client has already made 100 requests in...
Input n number of workers and m jobs to be scheduled, followed by m lines of time t taken by a particular job to be completed. workers(or threads) take jobs in the order they are given in the input. If there is a free thread, it immediately takes the next job from the list. If a thread has started processing a job, it ...
When you try to use several decorators it can get ugly pretty quickly and you'll end up with: new RelativeFileProvider( new SystemVariableFileProvider( new PhysicalFileProvider() ), "%TEMP%" ); or if you prefer one-liners then like that: new RelativeFileProvider(new SystemVariableFileProvider(new Physic...
Question is taken from Leetcode and solution works for their test cases. I do see a scope of improvement and make it more functional (getting rid of vars and mutables data structures). Please suggest improvement to help me. Problem Given a string, find the length of the longest substring without repeating characters. I...
I don't know anything about parsers but I had to write something to read COBOL for a work project. What are some things that I could improve with my Python coding and parser design? Note: This isn't COBOL feature complete yet, just the things I need for the project. """ Parse COBOL copybook files to a Python list for E...
Question is taken from leet code. Problem Given two strings s and t , write a function to determine if t is an anagram of s. Examples Input: s = "anagram", t = "nagaram" Output: true Input: s = "rat", t = "car" Output: false Here is my implementation in scala import scala.collection.immutable.HashMap object ValidAna...
I have this code to display a counter on the side of <i class="fas fa-bell mr-3"></i>. I want to know if this code is good on security and perfomance. I just started using jquery and ajax, i had heard people saying that someone could disable the javascript and do bad things. What you guys think about my code? <div> ...
This is a typical C implementation of a (doubly) linked-list. I want to avoid passing the element and the list itself to functions which operate on and possibly modify the list; the element alone should be all I need. I separated the prev and next into it's own struct. This is not closed; start has nothing pointing t...
I would like to know if there is a more efficient way to speed up below code. This function is meant to fill in a set of poker hand with the remaining cards using Mersenne Twister for a Monte Carlo simulation. void HandEvaluator::RandomFill(std::vector<std::shared_ptr<Card>>& _Set, std::vector<std::shared_ptr<Card>>& ...
I am working on multi-threading application to learn multithreading better. My application has a queue with 400 unique links, 4 threads and each thread is pulling link from the queue and sending a Get request to this queue. My application seems to run, and it takes 18 - 22 seconds for it to finish on 400 links. I am ...
I'm working on R and using regex to keep only numeric figures in a column (I need to keep digits, negative and decimal sign). Suppose I've a value t = "$%-123,()@5./6 5ABC" My expression t1 = gsub("[^0-9+-.]", "", t ) returns "-123,5.65" Now to remove the comma (,) from the result I've to write another line of cod...
I have a dataset composed of ~700k samples. Each sample is composed of n_features features. Each feature is a word. Each feature has his own vocabulary. The size of the vocabularies range from 18 to 32000. np.shape(x) -> (n_samples, n_features) Instead of having lists of features I would like to have lists of indexes...
From a data frame d I have to select the longest possible sequences of x. variables. Example: > d id X1 X2 X3 X4 X5 1 A 1 11 21 31 41 2 B 2 12 22 32 42 3 C 3 13 23 33 NA 4 D 4 14 24 34 NA 5 E 5 15 25 NA NA 6 F 6 16 26 NA NA 7 G 7 17 NA NA NA 8 H 8 18 NA NA NA 9 I 9 NA NA NA NA 10 J 10 NA...
I made a basic cube that can move around of container and jump too. It's basic but I want to know if I can use better methods, better formatting, or shorten the code. This my HTML: <div class="container"> <div class="cube"> <div class="box"> </div> </div> and this is my Javascript code with a little jQ...
First of all i made a simple code to insert data on my table, with the information from this code i made a loop to insert data on another table for a notification system. I'm new to PHP and i think that this query that is being executed into a loop is really poor in performance, example: if i have like 100K users, this...
I'm trying to print the elements of an array in a fashion that resembles thism where SIZE is a constant: 0 10 20 30 40 50 60 70 80 90 1 11 21 31 41 51 61 71 81 91 2 12 ...
Here is the problem: Part Two You notice that the device repeats the same frequency change list over and over. To calibrate the device, you need to find the first frequency it reaches twice. For example, using the same list of changes above, the device would loop as follows: Current frequency 0, change of +1; resulti...
This is a wrapper that can be used to do additional external REST call to some API. Since I have to provide support to legacy code so I added three static functions to support them. However, the question that comes to my mind is where to actually set default value either in the constructor or it should be in the main f...
I would like to share my code that is meant to help me add 2 vectors together. It is very simple and I would like to kindly ask you whether you could review my code. Also, I decided to keep separate variable for angle in degrees % 90. Do you think that was a good idea? import math def pythagorean_theorem(a,b, c=None)...
I'm writing a parser to get the IP address from a string I get from a GPRS module. Examples of the string I get from the GPRS module: +QIACT: 1,1,1,\"10.162.143.228\"\r\n\r\nOK\r\n +QIACT: 1,1,1,\"10.184.110.91\"\r\r\n+QIACT: 2,1,1,\"10.184.110.91\"\r\n\r\nOK\r\n The string have the following format: +QIACT: [ctx_id]...
I tried to do the second part of the 1. December challenge of Advent of Code in Haskell. I'm fairly new to Haskell but I have plenty of experience in other (procedural) languages. I struggled with the challenge for hours because the program would hang and it wouldn't produce any output although I couldn't find a proble...
I'm working on problem 91 on Leetcode.com called Decode Ways and I've successfully managed to get a working recursive solution but it results in Time Limited Exceeded (TLE). I'm new to utilizing memoization and I've been unable to discover how to properly memoize my results at each recursive step and check if I've alre...
This code is supposed to count each character in a given string and account for error handling and type casting as well, and it should do it in the most efficient manner possible, with O(n) being an upper limit for both time and memory. I have gone through my process for problem solving which involves explaining the pr...
I'm making an app using Rails. I have 4 Boolean columns in a table like below, and I want to show a message if that column is true. class CreatePosts < ActiveRecord::Migration[5.2] def change create_table :posts do |t| t.integer :user_id, null: false, default: 0 t.string :title, null: false, default: ...
function scramble(str1,str2) { let result; for(let i = 0; i < str2.length; i++){ let found = str1.match(new RegExp(str2.charAt(i))); if(found === null){ result = false; break; } else { str1 = str1.replace(found, ""); result = true; } } return result; } The purpose of ...
The code below is my attempt at trying to create a hash table. I'm currently stuck with the rehash function as I think it's not efficient enough (I believe it's O(n^2). I'd be grateful if someone could give some comments and suggestions on how I could improve my rehash function. class Hashtable{ private: int sze; /...
I am using the coding puzzels of https://adventofcode.com for improving my F# skills. Problem: Day 1 Part 2: Starting with frequency 0, a list of numbers should be added successive generating new frequencies. Searched is the first frequency which occurs twice. If the end of the list has been reached without success; th...
class Program { static void Main(string[] args) { var priceList = new List<int>() { 10, 20, 30, 40 }; var totalAmount = InvoiceCalculator.CalculateTotalPriceWithTax(priceList, 5); Console.WriteLine(totalAmount); } } static class InvoiceCalculator { private static int CalculatePr...
I am using below code to get a video file path from uri. Need review for the following: 1.Code optimization 2.Crash(Code is working fine in the devices I tested but i need to make sure that it doesn't crashes in any case) 3.Performance 4.Overall code review /** * Get a file path from a Uri. This will get the the ...
I'm working on a new service, for the past year I haven't needed to write tests from scratch. I've either been bug fixing, or adding features that require modification of tests, but not writing everything from scratch. I need to make sure I'm doing things right. The unit tests below test a service that queries a databa...
I made this simple traceroute implementation using the libpnet library, which sends ICMP echo probes with an increasing time-to-live, and then outputs the IPs of the hosts replying. I'm new to Rust, so any style/performance tips would be appreciated! extern crate pnet; use std::env; use std::error; use std::net; use s...
I have a requirement to write a Python 3.6 script which should be able to detect following case within a time period and be able to create a text file report that lists the condition violated and transaction that caused the violation: Redeeming over 3 time on same stamp card within 10 mins The required table in datab...
I have created several macros that delete rows based on cell values. I run it 5 times for different data, but think there should be a way to combine them and speed up the macro. Currently, it is running a little slow. It is pulling a date from another worksheet and if it doesn't match, removing the line. I am basicall...
This is a finished project where Two people roll a dice twice and if the total of the two dice are even it adds 10 points to the two dice rolls and if the total is negative it takes away 5 points from the two dice rolls. import random import time total_score2 = 0 total_score1 = 0 rounds = 0 playerOnePoints = 0 playerT...
I tried to write BRGC recursively. I've really recognized that intrinsic of recursion helps for some problems in which I think BRGC is included. is the way I wrote it recursively adequate solution? Can it be improved w.r.t recursion? Do both methods have same complexity Theta(n), right? T(n) = T(n-1) + n, T(n) = T(n/...
Advent of Code 2018, day 2, part 2: The [two IDs you are looking for] differ by exactly one character at the same position in both strings. For example, given the following IDs: abcde fghij klmno pqrst fguij axcye wvxyz The IDs fghij and fguij differ by exactly one character, the third (h and u). Those must be the co...
This is a function written in Python I wrote to process galaxy catalogs for cosmology research, however it is more generally applicable than just my pipeline. The goal is to take a Python list of coordinates in 3D, optionally with associated weights, define a cubic grid over the coordinates which divides the points int...
I am trying to write a lab/program that loops through a .txt input file. Reads an entire line of data as a string, then splits that string into an array delimited by a space. If there are 4 items in the resulting array, and each item is a valid double, I want it to determine the distance between the points & return inf...
I implemented a Trie in C++11, but I am not sure if my usage of struct and std::unique_ptr, and std::unordered_map are correct and idiomatic. Therefore, I hope someone could provide constructive criticism on my code. My Trie implementation has three simple methods: void Trie::Insert(const std::string& word); bool Trie...
I made this program to rename variables in json files, part of the functions rely on recursivity which i'm not confortable with so I would like some feedback on readability and performance. import configparser def seek_in_array(json_array, conversions): """seeks all data in a json array""" converted = [] ...
I've been in an interview some time ago. They objected my Symfony API code with following line: Too much code in controller actions. Can be moved to services to keep the business logic apart from the representation. Also violating single responsibility. I have been trying to improve my code since then. Trying to...
A little code I wrote that will check if the entered 4-digit number is Harshad or not (Harshad number is one which divided by the sum of its digits will leave no remainder, special Harshad is the same but will also work with flipped sum of digits, example - 1729/19 (19 is the sum of digits) and when flipped 1729/91 wil...
This function is from my attempt to write a Big Integer class in C++. Below, I have a simple addition function. It takes two strings of arbitrary length which contains only digits (no '-' sign as well). It returns the sum of the two integers. Could someone help me optimize for performance? Since this is my first attem...
This is my first project in pygame so I am open to suggestions how I can improve my python/pygame skills. I have started programming in python couple of weeks ago and I really want to know what I am doing wrong/harder way. Main game file import pygame from time import sleep from square import square, superior import co...
I just subscribed to the daily coding problems and received my first today. The problem is: Given a list of numbers and a number k, return whether any two numbers from the list add up to k. For example, given [10, 15, 3, 7] and k of 17, return true since 10 + 7 is 17. This is what I came up with: def anyequalto(x, y)...
I use Autofac a lot and for everything and when you make a mistake and forget to register a dependency etc. it'll tell you exaclty what's wrong. Although its exceptions are very helpful, the exception strings are at the same time hard to read because it's a large blob of text: System.Exception: Blub ---> Autofac.Core....
I created a templated Hash Map class in C++, which supports most of the basic C++ types (e.g. int, float, char...). I would like some feedback regarding my implementation and what is bad and can be improved. #ifndef _LIB_HASHMAP #define _LIB_HASHMAP #include <exception> #include <string> namespace lib{ namespace ...
I am try to practice the leetcode and hit the following question 'image smooth'. Basically the question is to calculate average the around cell value from a 2D array. I have following code. But if there is better way to do it at least better performance? def imageSmoother(M): """ :type M: List[List[int]] :r...
Learning to code with python this is what i came up with. But looking at the code i am sure there are ways to improve. I would really appreciate a constructive review and some guidelines. from itertools import cycle game = [[0, 0, 0], [0, 0, 0], [0, 0, 0]] player = [1, 2] current_player = cycle(playe...
I've written a short implementation of the Eratosthenes' sieve. def sieve(n): l = list(range(2, n + 1)) out = [] while len(l) > 0: out.append(l[0]) l = list(filter(lambda n: n % l[0], l)) return out Is it lacking in efficiency? Are there any improvements or changes you would make?
This is my program for the Game of life, I created it by myself with no reference or peer review so I need some comments and reviews on it. I created 3 modes: A. User Mode: The program asks the user to enter the coordinates (x,y) where live creatures are to be placed on the board, until the user enters a negative coo...
After a while of working on it, I've finally got my screen recorder to work in C#. I'm looking for suggestions to improve the video quality as well as clean up the code a bit. Specifically I want to create a method that resets everything after the screen recorder is finished, but I can't think of an efficient way to do...
Description This is a utility algorithm that selects a number of elements from a source list without repeating elements. Background My use case is creating a random path for a NPC that has to investigate a zone (polygon) containing predetermined interest points. Different effects are triggered upon reaching a point: ac...
Giving the following table: id sender_id receiver_id msg date_added 1 2 5 hii 2018-10-24 16:42:41 2 5 2 hello 2018-10-25 16:42:41 I want to extract data as: [2018-10-24]=>[{ sender_id=>2, receiver_id=>5, msg=>hii}], [2...
I saw that interview question online and gave it a try: Implement a function that gets a string which represents an arithmethic expression: contains only numbers or the the operators: '+', '-', '*', '/'. The function returns the calculation result of the arithmethic expression which appears in the string. This need to ...
I am an experienced programmer, but a complete beginner with React. My goal is to teach myself React. I've made a simple die-roller application. The application presents a drop-down, and the user can choose what die to roll (e.g. a d6 is a six-sided die). When the user clicks "roll", an appropriate random number is gen...
I am attempting to create a fast & robust object management system that allows adding, removing and retrieving objects from a "scene". I am trying to wrap my head around the best way to do this regarding ownership and object lifecycle. Code: main.cpp: int main() { r3d::scene main_scene; game_object& obj = main...
Have been playing with the undocumented NHL API for some days. I'd love to see any input about this little script. About overall structure, style, performance enhancements, etc. Not sure how to properly use long links in Python, should I even follow the PEP in this case? The same problem in a couple of other lines, it ...
I've created a utility class that expects a logger to be passed at a method level, since I prefer legitimate errors to be written out for troubleshooting later on. Another developer hates passing the logger to the method, because he does not care. Cannot use optional attribute, since ILogger is not a constant. Cann...
I have a query like this to select the only row with title contains specific programming topics. SELECT posted_date, CASE WHEN LOWER(title) LIKE "%c#%" THEN "c#" WHEN LOWER(title) LIKE "%c++%" THEN "c++" . . . WHEN LOWER(title) LIKE "%sql%" THEN "sql" ELSE "" END AS single_topics FROM ...
I am writing a WordPress plugin that allows shipping calculation on the product page. Originally, shipping calculation is only available in the cart. To calculate shipping costs on product page, three things are necessary: A product with valid dimensions, the quantity and the destination postcode. Here's what it does b...
I have this example code in which I have very big numbers as you see. The problem is that when I use this algorithm for some small numbers, it works well, but when I use it for big numbers like in this example, this algorithm is so slow. Can you tell me why this algorithm is so slow for that big numbers? How can I make...
I'm trying to develop a simple Rust chat server. I'm not a Rust expert and come from Java and Kotlin. This same server in Kotlin is: import java.io.* import java.net.* import kotlin.concurrent.thread import java.util.concurrent.ConcurrentHashMap fun main(args: Array<String>) { val serv = ServerSocket(Integer.pars...
I’m learning Swift and decided the Huffman Coding algorithm would be a good exercise while learning this new language. Below is a working version that encodes a string and decodes a string. Here’s an example of how the API is used: let huffEncoded = Huffman("MISSISSIPPI_RIVER!") let decode = huffEncoded.decode() I’d...
I use Python for various computational reactor modeling activities. While there are many components to the models I develop, the basic structure of the project folder tends to be similar to the following: pyreactor/ ├── gas_properties.py ├── geometry.py ├── main.py ├── parameters.py ├── results │   ├── fig1.pdf │   └──...
For practicing Python I wrote a script which scans the harddrive for large files and lists them in a report. The script takes the root path and then all the subfolders are scanned aswell. Also the minimum size for the files needs to be defined. Smaller files are not listed. The code: find_big_files.py """ Find big file...
I am currently working on a simple app to check the stats of popular javascript frameworks. For this I am using the Github API to get certain data sets and have come close to finishing my project. const frameworks = [ { name: "angular", logo: "img/angular.png", url: "https://api.github.com/repos/angular/a...
The output should display as follows... PROGRAM: Vowel count Please, enter a text string: fred 4 characters a e i o u 0 1 0 0 0 b c d f g h j k l m n p q r s t v w x y z 0 0 1 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 It works; but, I believe is way over long...; maybe, I should have used arrays/or, ASCII count/-etc.? vo...
The question description: put a deck of cards in order by suit (in the order spades, heart, clubs, diamonds) and by rank within each suit, with the restriction that the card must be laid out face down in a row, and the only allowed operations are to check the values of two cards and to exchange two cards (keeping them ...
I'm writing a small program to store data in a database (a discord bot mainly). I know cleaner ways of using dependency injections and DAO exist, but I haven't written a DAO (or the user class) and don't know how to proceed. With that, can anyone optimize my SQL calls? They look like a mess right now. I need to able to...
I have this code for calculating the number of days passed from a given year: for (int currentYear = localDate.getYear() - 1; currentYear >= STARTING_YEAR; currentYear--){ LocalDate date = LocalDate.of(currentYear,5,5); //an arbitrary day of year jdn += date.lengthOfYear(); } jdn += loca...
I'm currently reading on how to implement design patterns. I'm trying to implement the design patterns but need help on whether my understanding is correct. I have a windows form in C# project that keeps some information. I created a bunch of TextBox and ComboBox dynamically, depend upon user input. For each component ...
I'm coming from C and C++ and have often troubles using Python's full potential. This is a script I wrote to translate LaTeX documents into different languages. A parser replaces all latex specific syntax with hashes and then sends it all to deepl. The pydeepl wrapper is from Github. What do you think of this code? imp...
What would be the best approach to write this class. This class validates 3 types of passwords, Normal Medium Strong Github Link <?php namespace azi\Rules; use azi\Arguments; use azi\Rules\Contracts\RuleInterface; /** * Class Password * * @package azi\Rules */ class Password implements RuleInterface { con...
I'm trying to construct an output table containing 80 rows of table status, that could be EMPTY or USED as below +-------+-------+ | TABLE | STATE | +-------+-------+ | 00 | USED | | 01 | EMPTY | | 02 | EMPTY | .. .. | 79 | EMPTY | +-------+-------+ I have a vector m_availTableNums which contains a list ...
I want to sanitize my user input in my class. All is working as expected but first of all, I would like to avoid to set a default value for my digit parameter. Secondly, I would like to avoid to put everything in a big while-loop and instead call implicitly a function which asserts the user input. Initially, I thought ...
My program contains some very large integers and uses the GMP library. The output contains integers (probably small enough to fit into int). I would like to make the output easy to read by adding commas between every three digits with any left overs on the left side. Examples: 1234 => 1,234 12345 => 12,345 123456 => 12...
Edit: I've added everything I can... I have the following query, which gets the last comment from the user in a given topic, then I check in the while loop if there are newer comments. My problem is, that the while loop runs through every thread the user commented (imagine a user commented 2000 times, then this runs 20...
PHP realpath($path); is insufficient for some cases since it returns false on paths that dont exist on a file system. I need a function that extends realpath($path); to return even path that does not exist yet. Such function would be used for keeping a user within his filesystem directory and/or restricting modificatio...
This is a finished login system where 2 players have to enter their username and password to proceed onto the game. The usernames and passwords are stored in a text file in this formatusername: (username) password: (password). If one of the players enter their details in wrong it will loop it 3 times and if it is sill ...
I have created this unbalanced binary search tree in C. Can anyone say this is a true approach or not? I have two scenarios for insertion and search: in the first scenario I am inserting 10000 random values to tree, and in the second scenario I am inserting 10000 sorted values from 1 to 10000. Am I on the right track? ...
I'm new to Clojure and using some Project Euler problems to familiarize myself with the language's capabilities. Problem #10 asks to find the sum of all primes less than two million. I wanted to solve this problem by building a generalized Sieve of Eratosthenes, then adding up all the primes: (defn sieve [size] (-> (...
Problem Given an arithmetic string like 2+2*3 calculate result 8. Assumptions you can make string will be always well formed (no error checking needs to be done) only operators passed in string will be + and * only single digit numbers allowed Example input = 2*2*2+2*1*5 output = 18 input = 2+2*3 output = 8 He...
I tried writing a simple python script using the python module ecbxrate that outputs to a CSV file a table with the daily exchange rate between EUR and USD since 2013. Below is my code, it works, gives the correct output. I tried using methods rather than a long script. I specifically wanted to use Ecbxrate. import ecb...
This function works, but seems unnecessarily complicated. I would like to simplify but performance is vital as it is called many times. The conditions are: 1) If either value is negative, then result is -1 2) If both values are zero, then result is zero 3) If NeedMax is true, result is largest value 4) If NeedMax...
The problem I'm solving is given as follows: You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose one from + and - as its new symbol. Find out how many ways to assign symbols to make sum of integers equal to target S....
So this code already works, but I would like to shorten it using list comprehension. Would it be better if it was in 1 line, or many? (I do know that readability is more important than short code, but I would like to master list comprehension, ternary operators, and conditional expressions). Oh yes, if there is ANYTHIN...
I'm importing millions of rows into a PostgreSQL database using a foreign data wrapper. To speed this up I've written this context manager to DROP all the indexes and constraints (except the primary key) on the target table for the duration of the data move and reinstate them afterwards: import logging import types imp...
I'm relatively new to programming, but am really enjoying it. I have taken a couple of classes but mostly code for fun (for now). I decided to make a program implementing some basic functions, switch statements, and user input. Please leave any feedback on how to make this program better. I understand that I am not act...
I often query a database to get a batch of items to procees. I do this as long as the query returns some items. I use this pattern quite a lot so I thought I create a small helper so that I don't have to implement this logic again and again. It's a small class that executes the query until there is nothing more left: p...
I need to collect all the data from the stream and resolve it as promise. I created this stream: class CollectToPromise extends Writable { constructor(options) { super(); this._result = "" this.result = new Promise((resolve, reject) => { this.on('finish', resolve):w this.on('error', reject) ...
I've written a script in python which is able to collect links of posts and then fetch the title of each post by going one layer deep from the target page. I've applied @get_links decorator which scrapes the titles from its inner page. However, I wish to get any suggestion to improve my existing approach keeping the de...
This is an exercise from Deitel&Deitel's "Java. How to Program (Early Objects)", 10th edition. 9.8 (Quadrilateral Inheritance Hierarchy) Write an inheritance hierarchy for classes Quadrilateral, Trapezoid, Parallelogram, Rectangle and Square. Use Quadrilateral as the superclass of the hierarchy. Create and use a Point ...
Problem We have a robot that can pickup blocks from a stash, move them horizontally and lower them in place. There are 10 positions available to lower blocks number 0 to 9. Each position can hold up to 15 blocks. The robot understands the commands 'P', 'M' and 'L': P: Pickup from the stash and move to position 0 M: M...
I have material property entries in a cell those look something like this: cell.value="O2 Permeability [cm^3/m^2]" The goal is to format the numeric value after each ^ to be superscripted and to remove all ^. Here my code: Public Function FormatSuperscript(cell As Range) As Boolean Dim i As Integer Dim value As String...
The controller is currently inserting a record into the database and returning a JSON response as shown below in the try-catch block. I can see the Inserted Successfully within the try-catch block!. Although, I haven't seen this message Error in Inserting Record! so far since my webservice haven't errored out till now...
Problem Take an array of ints as input and run a special sorting algorithm on it. This algorithm must first sort by int frequency, less frequent first, then sort by value. For example [4,5,6,5,4,3] is sorted to [3,6,4,4,5,5]. I'm looking for feedback on my use of data structures to implement this sort, memory manageme...