instruction stringlengths 71 71.9k |
|---|
I would like that this code would now be done in a faster way:
Sub TechMapping()
Set mappingWB = Workbooks.Open(Filename:="path\workbook1.xlsx")
Sheets("Sheet1").Activate
Dim Lookup_Range As Range
Set Lookup_Range = Range("A2:P1779")
Workbooks("workbook2.xlsb").Activate
Set sh = ActiveSheet
... |
I intend to convert strings that are UTC timestamps into a date format, say day + date number (e.g. 'Mon 27'). My current solution is:
Parse the UTC timestamp into a date object using d3.utcParse("%Y-%m-%dT%H:%M:%S")
Convert the date object into a timestamp without hours (i.e. just the date information), using d3.time... |
The tutorial is here
I want to build a RestFul API with Flask to query User Agent data. Curl script shows below. The api should work with three or two or one or even zero argument.
So how to change the code to make it more simple and readable?
curl -i http://localhost:5000/todo/api/v1.0/tasks -u miguel:python -i -H "Co... |
I have a software that does the following in sequence:
download text files from s3
reads the files
collect the data from files
The program is asynchronous-synchronous - each phase is asynchronous, but it heavily depends on the output of the previous phase, so I'm using Promises for build the chaining.
The problem of t... |
I'm currently working through "Algorithms in java" by Robert Sedgewick (3rd edition, german version) on my own and I'm trying to solve one of the exercises there.
Problem Statement
The exercise asked to create an int[][] 2D array with \$2^n\$ rows in which each row stores the binary representation of its own index bu... |
(See the previous iteration.)
Now all operations of the data structure work in exact constant time, yet it came with the price: the state of this set maybe non-sensical. A user may end up with the set with negative number of elements in it. Basically, the client programmer must keep track of how he/she work with this s... |
I was given the a test file with the following kind of content, an arbitrary number of integer pairs divided by a newline and a final line with one integer:
1 2
3 4
5
I had to use the couples as values for two data members of a series of objects and I had to put the last integer in a separate variable.
I eventually wr... |
So I created an algorithm that keeps score of the amount of pins knocked down per frame. Since I am totally self taught, I am trying to see how I could make my code more efficient/more pythonic. Any advice would help. Also, is it proper to return a score or list into the init method as I did with the "overall" variable... |
I've recently solved the LeetCode's "Same Tree" problem:
Given two binary trees, write a function to check if they are equal or
not.
Two binary trees are considered equal if they are structurally
identical and the nodes have the same value.
The problem itself and the idea is simple: traverse the tree in a way tha... |
I am implementing a simple Movie based CRUD API using Spring WebFlux and Reactive Spring Data MongoDB. I want to make sure that my implementation is correct and that I am properly using Flux and Mono to implement the CRUD operations. I also want to make sure that I am properly handling any errors or null values. I am v... |
I have tried to calculate the minimum distance between the two points in a 2D plane. I have used the divide and conquer strategy to attain the complexity of n logn. The steps that I did are:
Recursively sort a list in X plane and compute the minimum difference between the coordinates sorted by X plane.
Recursively sor... |
I have a WPF project which uses XAML and C#. It adheres (as best as I know) to the MVVM methodology.
As part of it, I have used a mediator class (the 'Gang of Four' design). You register for callbacks, and other classes can notify registered classes in the case of certain events. For example, some parts of the program ... |
I am studying chemistry in the university, and then I try to write all the things in the textbook with Perl6 or Perl, like balancing the chemical formula or other process!
Then I encountered the problem is on perl6 custom operator.
I feel I have been repeating my code and myself when i use the feature.
It is hard to re... |
I have implemented those two methods described as in 1 and 2.
I appreciate any kind of review to improve my method implementation.
Implement the method toString.
toString returns a string representation of the list
Implement the method remove .
remove removes a given course from the list.
If the course is not in th... |
I have a grid of different sized images. I made a click event function that grabs the image inside any clicked grid-item. It then saves the coordinates and size of the image and animates from the grid into its final resting place in the article. I was able to get the effect working perfectly the problem is that I need ... |
I'm implementing a clone of 2048 in C with SDL, and I have the following function for performing a movement on a column vector/array
/**
* collapseVector: Collapse a vector "2048" style, flush the cells in one direction, joining them if legal.
* @param _vector 1-D array to be collapsed
* @param _score Score counter
... |
Search and display all instances of a full/partial match in the first worksheet from all the other worksheets in the workbook after running a macro to clear formatting of previous search results.
I have data in over 1000 cells in one workbook, spread over 10 worksheets that I am able to search through using a button.
I... |
Problem
Problem is Maximum sum path from https://firecode.io
Given a binary tree, \$T\$, whose nodes have positive values find the value of a maximal path. A path is a simple path from a node to another node. The value of a path \$P\$ is
$$val(P) = \sum\limits_{u \in P} val(u)$$
that is, the sum of the values of the no... |
I am developing my first website in Flask using PostgreSQL and I want my database to have professors from all universities and courses in the USA.
As I am not very familiar with databases I have experienced some issues with my database model design.
Basically, I want to have a Professor, College and Course models.
1)... |
Sometimes code seems to write itself (kinda like a donut seems to eat itself) and that happened in this case, but I have thought that UI view models (MVC models folder) were supposed to be stupid to the max. But when this happened it solved some problems and made the code a little bit more OO.
TL;DR I had a bunch of "p... |
I think I have pretty much the best code you can get when it comes to this particular task, but I'm always open to improvement. This code will check everything I can think of to make sure that it will actually work and if it is an isosceles triangle. It will make sure that none of the sides are 0, it will check whether... |
I want to select top N related products using GetTopRelatedProducts method.
class Product
{
public string Name;
public double Rating;
public List<Product> RelatedProducts;
public List<Product> GetTopRelatedProducts(int N)
{
var relatedSet = new HashSet<Produ... |
I am trying to implement design pattern in my project and have been reading material over net.
we have a sales application ( in C# ) where in we are storing entities like
Customer
Contacts
Sales Order
Lead
Opportunity
This is how i am planning to implement design pattern.
Entity would be the base class and it has co... |
This might be a simple issue that I am overcomplicating, but I've spent quite some time reading about polygon scaling and I've come to the conclusion that it is not precisely what I need.
Given a set of (x, y) coordinates for N points (shown in blue) I need the new set of coordinates that result after zooming in/out a ... |
This is an \$O(n \sqrt n)\$ solution to the the following problem:
Given a sequence, compute the number of non-empty increasing subsequences
The algorithm is to compute g(i) = # of increasing subsequences that end at index i using dynamic programming, and then sum over i. A full description of the algorithm used can ... |
How do i refactor my code to fix the lint error i am getting?
def value=(val)
if val
if [:char].include?(@type) && val.length >= args[:limit] && val == 'true'
val = 'Y'
elsif [:char].include?(@type) && val.length >= args[:limit] && val == 'false'
val = 'N'
elsif [:bit].include?(@... |
Is there another better way to implement those two methods in 1 and 2?
Implement the method contains.
contains returns true if the given element
is a member of the set, and false otherwise.
Implement the method intersection.
intersection returns a set which contains the elements
in the set that are also membe... |
I am working with javafx making a simple Kings game. I am currently in a Java course at school and this is just a side project I am looking to get some feedback on.
Main.java
package application;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.stage.Stage;
import javafx.scene.Scene;... |
Below is my bash script to setup a proxy, I am by no means an expert in bash. I suspect there is a better way to write this, any tips would be appreciated.
Is there a better way to do nested while-loops and if-statements?
#!/bin/bash
set -e
#functions
function yesno() {
while read -n1 -r -p "[y/n/QUIT] > "; do
... |
Per the title date only class (or struct?).
.NET does not offer a date only data type.
I get there is time zone dynamic but then you have daylight-savings that can still kill you. I do document management and we just have a document with a date.
// minimal limited test
DateOnly date1 = new DateOnly(1901, 2, 1);
Date... |
So I'm working on an application where Javascript will first validate the email using a regex and then once sent to PHP, PHP will verify the user did not modify any of the javascript and validate the info again with filter_var.
For example, in JS I validate with this regex first using .test()
/^(([^<>()\[\]\\.,;:\s@"... |
How can I improve the tree searching algorithm, or can I?
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
Initiali... |
I've implemented a version of snake using GNU ncurses, and I'd appreciate some feedback! There are two main files, a main.c file that houses the main function and a few generic functions, and a snake.c file that houses mostly snake-related functions. I'll include the corresponding header files first, because they help ... |
I'm toying with Regexes to parse IP Addresses. I've got it to test for anything over 255:
public static boolean isIpAddress(String address)
{
String regex = "^((25[0-5])|(((1[0-9]|2[0-4])|[1-9])?[0-9]))(\\.((25[0-5])|(((1[0-9]|2[0-4])|[1-9])?[0-9]))){3}$";
try{
Pattern p = Pattern.compile(regex);
... |
I'm working on an Android (Java) project which utilizes different analytic metrics (sum of x group by date, sum of x group by id, etc) and I am projecting the data sets into different charts using MPAndroidChart.
For the backend, I'm following the MVP architecture and applying a Repository pattern for querying from Rea... |
In a project, a boolean can be mapped to an enum to display a custom string for true and false.
If I have a string interpretation of a value, I have a method that is checking against the custom enum names or/and against regular boolean expressions like true, false, 0 and 1.
The method looks like this
public Boolean cre... |
I am practicing interview questions, I wrote this code to perform BFS and DFS on a graph in Python.
How can it be optimized, and how can it be made more readable?
class Graph:
def __init__(self):
self.graph = defaultdict(list)
def add_edge(self, u, v):
self.graph[u].append(v)
def dfs(self,... |
This is my example for a 2D Space Shooter coded in C++ and I would like to have some opinions about the game code and general readability (and how to improve it).
The code should be readable for other trainees since this is meant to become an exercise which is supposed to show trainees how to work with foreign librarie... |
Well Iam trying to learn OOP for a while now, My idea here is to create a simple CMS kind of thing.And I did something like this:
App Class:
namespace System;
class App {
private $storage = [];
private static $_instance;
public static function getInstance()
{
if (is_null(self::$_instance)) {
... |
I have Python code that splits a given large csv into smaller csvs. This large CSV has an ID column (column 1), which consecutive entries in the csv can share. The large csv might look something like this:
sfsddf8sdf8, 123, -234, dfsdfe, fsefsddfe
sfsddf8sdf8, 754, 464, sdfgdg, QFdgdfgdr
sfsddf8sdf8, 485, 469, mgyhjd... |
Please review my skip list code that is implemented using a linked list. It supports the insertion and deletion of numeric values.
I'd like to know whether I implemented the skip list in its true sense or not.
Check it out on github also.
include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <ctime>
#inclu... |
I wrote a simple tron clone in C++ and would appreciate some feedback.
The pixelutility.h isn't included on purpose. Feel free to reuse the code where ever you want (It shouldn't be much effort to change from my library to std::vector etc.). My IDE does not support C++11 features so I am not able to use C++11 in genera... |
I am currently creating a program that can convert different units of measurement for temperature. It includes conversions for Celsius, Fahrenheit, kelvin and gas mark. Can someone tell me how I could make my code simpler so I can add more units of temperature measurement (e.g. Rankine). Also, is there any way to stop ... |
The goal this method was to emulate the way EF or Dapper return to you concrete POCO classes instead of recordsets when querying your db. Our current code is riddled with iterations over recordsets and I want to consolidate to an extension method that can convert the recordset into an Enumerable<T>.
Review
I'm concerne... |
Previous question: Decide whether a triangle is isosceles or not
Using the comments on the previous question (from people such as Carcigenicate, Luke Sawczak, dgnuff, alecxe and 200_success) I have revised the code and made an improved version but I'm sure that there is still more that I can do to improve it. (And whil... |
I have started teaching myself MySQL and created a simple application which asks for user input stores it and displays it. Can you guys please let me know if there is something I am doing wrong or any tips on what can be improved? I want to build a student management application which will use a MySQL database and want... |
Below I have posted the code I use for drawing pictures. The problem is that when I want to generate more images in full hd size (in loop), the generation time increases significantly. Can somehow optimize my code to speed it up a lot?
Bitmap bmp = new Bitmap(imageMask.Width, imageMask.Height, System.Drawing.Imaging.... |
Context:
When sending message across the network, the sender has to convert the message from host byte order to network byte order and the receiver has to do the the reverse - network order to host order.
There are multiple ways of going about it. One neat way to do is to convert the message to host byte
order as soon... |
I am new to security and I was wondering if I can make my program better by changing or adding something to make it better/secure.
Should I use a keyGenerator? I have my doubts from my program output.
Output:
Encrypted Message: +g@þóv«5Ùû`ž
keybyte: [B@71e7a66b
Original string: Message
Original string (Hex): [... |
I am just wondering what, if any, more elegant ways might exist to write a script to accomplish the task that the script below accomplishes. The script works, so I don't need it to be debugged, but I want to learn more. Other commands to be used, other ways of structuring it, etc. I have taken it through shellcheck.
Ye... |
It is about Stack of numbers, that can have transaction.
If you begin
transaction, you need to commit it in order to actually add numbers to
stack.
Transactions can be nested.
Transaction has rollback method,
then nothing is done.
If transaction is not started, numbers are added
immediately.
This is ju... |
As part of my stupidly large project Concaten, I'm writing a string escaper. It's the majority of the part that turns string tokens (like "hello world" or "buncha\n\n\n\n\n\nnewlines") into the string data that they represent. It's part of the token-to-object module, hence the prefix.
The code that calls the function b... |
I am using this syntax to bring in the names of all employees whom are active, then from there filter the data on subsequent worksheets and use a formula to bring the data over to the All worksheet.
This syntax works, but I am by no means a VBA guru, and would love any ways on optimization to speed this up!
Function Ga... |
I recently had an interview where I was asked to reverse the second half of a linked list. The driver program was unknown to me, I just needed to write the method to do this. The method was supposed to behave as follows:
1 -> 2 -> 3 -> 4 becomes 1 -> 2 -> 4 -> 3
1 -> 2 -> 3 -> 4 -> 5 becomes 1 -> 2 -> 5 -> 4 -> 3
The ... |
I would appreciate feedback on this Pomodoro Clock. I tried to use straight
Javascript for the logic instead of JQuery and I would be interested in any observations of
where that was a good or bad decision, my motivation was to learn Javascript more thoroughly
before using the JQuery library.
Additionally I employed ... |
I recently wrote a C implementation of Matrices with add, subtract, and multiply. I want to expand this out eventually where I can diagonalize, efficiently square, row-reduce, etc...
I was wondering if there are any more efficient ways to do what I'm currently doing (I'm really new to C and pointers/references in gener... |
I made a small game that does the following:
Displays a popup with the instructions of the game
Turns on the GUI
Start a list of trials for the player
For each trial:
It shows a symbol
Waits for a set amount of time
Show another symbol
Waits for the user to give an answer or for a timer to expire
Indicates the feedb... |
I have the following fully working code that
imports JSON files,
parses the tweets contained in JSONs,
records them in a table in a data frame.
Considering that per run I currently analyze 1,400 JSONs (about 1.5Gb), the code takes quite some time to run. Please suggest if there is a plausible way to optimize the cod... |
The function belows validates if a mathematical expression, say 12 + 2 * (9 - 3) / 4, does not have operators that are next to each other. It returns false if an operator is next to another operator. Otherwise, it returns true. For example, if the input expression is 2++1, it will return false. The function also recurs... |
I implemented code logic provided in the EPI book to determine if a binary tree is a BST. There were two approaches, therefore I used polymorphism for the common parts. I'm also using templates. I would appreciate code review on my use of smart pointers? Anything that I should have been doing that I'm not. I did not de... |
I'm new to this framework, LibGdx. I need advice/suggestion for my game. Is it okay if I load my images in a single class? I'm a beginner and started learning LibGdx. I already coded my game screen and it works perfectly as I expected. My concern is about the performance of this in another device. I don't know how to i... |
I've implemented Conway's Game Of Life with pure JavaScript and HTML5 Canvas. I'm not very good at JS patterns, so are there any ideas on how I can improve this code?
For Online demo refer to this link.
For the GitHub repository, refer to this link.
A sample screenshot of the code:
Here is the full code:
"use strict";... |
I am learning Scala and want to know, what is preferred style of writing a function for a trait.
First:
sealed trait Expression
final case class Addition(left: Expression, right: Expression) extends Expression
final case class Subtraction(left: Expression, right: Expression) extends Expression
final case class Div... |
I'd like to get a review on 2 regexes, one for email and one for phone validation.
/* Add jQuery validator method to check if phone numbers are in correct format.
Use regex101.com for explaination of the regex.
Using value.replace with / /g to remove all spaces. Normal replace with ' ' only works once. */
$.valid... |
I have some code that is helping to protect some online surveys. The surveys have an incentive in the form of an Amazon voucher or cash (which is manually/semi-automatically distributed post-survey) so as you can imagine, we get a lot of people attempting to get multiple vouchers, or undesirable respondents mainly from... |
I ported the Lisp Tic Tac Toe code from Chapter 1. to Haskell. The original code repo is down for some reason.
I believe I have completely rewritten that in Haskell (Less functional than one would expect ). It is being tested. But I have doubts about how the learning algorithm learns. I see this type of result from my ... |
So I've coded a fill in the blanks game but my last procedure, play_game() is far too long.
Trying to figure out how to divide it into two functions:
Initialize
process_answer
import time
from time import sleep
name = raw_input("Hey there, what's your name?") #Basic raw_input
intro = "Welcome to my Udacity, Mad-Lib... |
I need to fill an array with the last non-zero value.
Points of note I guess are that the array will either have all 0 values or end with 0 values.
Please review my code below.
<?php
$array = [1, 1, 5, 4, 0, 0];
$array2 = [0, 0, 0, 0, 0, 0];
function padArray($array) {
$length = count($array) - 1;
for ($i = ... |
I am trying to select the DepartmentName from Employee Table based on where condition. Is any way to simplify the code?
List<Department> lstdepartment=(from i in _context.Department
select i).ToList();
List<Employee>lstEmployee=(from e in _context.Employee
... |
(See the next iteration.)
I have this small library for solving the SAT (satisfiability problem) via brute force: we are given a boolean formula, which is a conjuction (and) of clauses. Each clause is a disjunction (or) of variables or their negatives. Also, each clause may be negated.
Given a formula, we want to compu... |
I'm building a clone of 2048 in C with SDL2, and I'm implementing the function that adds a number randomly to an empty cell on the board. The board is representd by a 2-Dim array board[BOARD_SIZE][BOARD_SIZE], and stores the exponent for the square value(10 for 1024 and so on). There must be a 90% chance of the cell be... |
I am going over a number of design patterns and today I ask you to please inspect my application attempt of the Factory design pattern. Please feel free to share what you think about it, because my goal is to improve my skills. I am using g++ 4.8.5. Note: this is not homework, just practice.
In short, several classes a... |
I have implemented as follows, a class applying singleton pattern to get a global single access to database.
I intend to provide a thread-safe implementation.
using System.Data.SqlClient;
public sealed class Database
{
private static volatile SqlConnection instance;
private static object syncRoot =... |
I am working on the SPOJ palindrome question. I'm using JAVA to solve it.
The problem:
A positive integer is called a palindrome if its representation in the
decimal system is the same when read from left to right and from right
to left. For a given positive integer K of not more than 1000000
digits, write the ... |
I have written an ordinary tableView to display a list of players, with the following data structure that's in place.
A Conductor (which is the user), has many
Orchestra? objects.
A Orchestra? has many Player? objects
All objects besides the Conductor are cast as Optional, meaning that a Conductor could have no Orch... |
I know this task could be done in more practical ways, but the professor only want us to solve it with the "if" statement. I tested and it meets the condition for each task, but I still feel this code looks a bit awkward, I think there is an easier way to get it done. Can someone give me any advice?
import javax.swing.... |
I'm working on a text-based football simulation game along the lines of Football Simulator. Below is a subset of my total code, specifically the functions used to create a new player. I also have functions (not shown) to create a new coach, create the teams, create the weekly schedules, etc. I'm hoping to be able to us... |
I've builded a 2D-shape area calculator. Currently it can only calculate:
Circle
Rectangle
Triangle
Originally I was thinking how to encapsulate the parameter(s) into a class, Parameters, so that I could delegate the responsibility of loading those parameter(s) to a specific shape, for example, a rectangle will need ... |
I'm fairly new to PHP and am following e-commerce tutorials. When exploring a way to resolve a problem I had with a PHP code block, I came upon a post another person had with the same code block. The post suggested a way to simplify the code.
Original code block:
<?php
if (isset($_POST ['pid'])) {
$pid = $_POST ['p... |
I solved the Longest Absolute File Path challenge from Leetcode.
The question is
Suppose we abstract our file system by a string in the following
manner:
The string "dir\n\tsubdir1\n\tsubdir2\n\t\tfile.ext" represents:
dir
subdir1
subdir2
file.ext
The directory dir contains an empty sub-direct... |
I have made a program that reads 3 numbers:
number of treasure chests
treasure hunter's position
number of moving instructions
It then reads a string (which symbolizes the treasure chests), being each character either T (chest has a treasure) or V (chest is empty). After that, it reads the moving instructions in the ... |
I've recently solved the LeetCode's "ZigZag iterator" problem:
Given two 1d vectors, implement an iterator to return their elements
alternately.
For example, given two 1d vectors:
v1 = [1, 2]
v2 = [3, 4, 5, 6]
By calling next repeatedly until hasNext returns false, the order of elements returned by next should be:
[... |
Working on a C programming question where I have to write a function which will determine how many words are in a given string. Assume that one or more consecutive white spaces is a delimiter between words, and that the string you pass to your function is null terminated.
Have to use pointers and only the #include(stdi... |
I'm working on a lead generation bot that helps you find the emails of people you want to reach out to.
The bot grabs your spreadsheet from gdrive, logs into several email finding tools, and collect emails for every prospect in the spreadsheet from the tool.
My goal is for non-techies (i.e marketers) to be able to use... |
I have this code for finding MST for undirected weighted graph, currently works for graphs with maximum 10 vertices. How can I update the code to scale for larger graphs?
# Python program for Kruskal's algorithm to find Minimum Spanning Tree
# of a given connected, undirected and weighted graph
from collections import... |
I'm new to python, and after doing a few tutorials, some about scraping, I've been trying some simple scraping on my own. Using BeautifulSoup I manage to get data from web pages where everything has labels, but without them I'm doing a poor job.
I'm trying to get the dollar exchange rate from:
http://www.bancochile.cl/... |
I have the following fully working code that:
Walks through all sub-folders in a given directory;
Captures dirpath and filename for the compressed file (i.e., Dir/*.json.bz2);
Creates a decompressed file with the same dirpath and new file ending (i.e., Dir/*.json). Notably, each newly created decompressed file has a u... |
I've found a lot of blog posts that seem to suggest publishing a library TypeScript (as source) and all to npm or to a private repository. It feels like we should be doing some transpiling first and then publishing only something that is ready to consume.
Can you critique my approach for publishing a angular-cli+angul... |
I'm keen to hear ideas for optimising R code to compute the cosine similarity of a vector x (with length l) with n other vectors (stored in any structure such as a matrix m with n rows and l columns).
Values for n will typically be much larger than values for l.
I'm currently using this custom Rcpp function to compute ... |
I have a method which compares two array О(n2), maxes with each element in nums against <= condition then it prints out the new array with total count for each case, but it's too slow for large arrays, what's the most efficient way to solve this problem?
def counts(nums, maxes)
total = 0
total_array = []
maxes.e... |
I took the source code from this question, (thank you gaessaki for the motivation!) and did a lot of refactoring.
I use 4 projects:
Common: contains mainly interfaces and enumerations referenced by other
projects.
Model: Knows nothing of the others, just maintains the game logic and state.
Presenter: References the Mo... |
I have a wind rose with 72 evenly-spaced directions, spanning 360°, each describing a direction-specific average wind speed and associated probability. We must condense this information to 36 evenly-spaced direction bins. "probability" is the normalized frequency of occurrences. The probabilities should sum to one. If ... |
Summary
I have a normal class which has a normal property but that property has access to an async backing field.
I'm not sure if this is the best/acceptable way to access the asyc method for this backing field.
Details
I've got a C# library that helps testing the .NET HttpClient class.
This class has a property publi... |
I have created a Simple Dictionary Chrome Extension. It is using JavaScript/ some HTML/ some CSS. The Manifest.jso file talks about the extension. The HTML is for a small/simple pop up and the JS is for the popup and user interactions.
MANIFEST.JSON
{
"manifest_version": 2,
"name": "My Simple Dictionary Extension",
"de... |
I am a newbie in C# and in OOP in general. I decided to create a class that should give out a "connection" object. I would like your advice and critique on improving it.
public class Connection_Factory
{
private string Last_Connection_Trying = "";
private string Last_Connection_Success = "";
public OracleConne... |
I was trying to solve this questions:
Given an input string, find all combination of unique substrings, which are anagrams of each other and distinct from each other. The substrings must follow 2 <= length(substring) < len(original string).
Example 1:
String: “vadapav”
substrings: va, vad, vada, vadap, vadapa, ad, ad... |
I am not sure what to call this type of code (16-digit alphanumeric code).
Conditions are like this:
Digits (or characters) are limited 16
Numeric, alphabet mixed
No duplication allowed (not yet implemented)
One class with the main method:
public class QuadraDigitCipherGenerator {
// Step 1. Generate 16 digit wic... |
would like to know if there is a better approach in doing a telephone/mobile number regular expression for specific country. this includes naming variables like how to know if format is international format (is it with + sign?), a national format (is it the area code enclosed in parenthesis) or a local format (no + sig... |
In my project I use std::set with custom Compare function for maintaining an event queue. It fulfills following criteria:
event duplication is not allowed
should maintain the insertion order
(tried std::vector first, but that performed poorly because of complicated duplicate removal)
The important code is:
template ... |
Background
For a future workshop I'll have to fit arbitrary functions (independent variable is height z) to data from multiple sources (output of different numerical weather prediction models) in a yet unknown format (but basically gridded height/value pairs). The functions only have to interpolate the data and be diff... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.