instruction stringlengths 71 95.1k |
|---|
This is an app wherein you have to find the word that represents the image. It's the same concept as the course app but I did this one myself.
How can I improve this code (put more commentary, put more space, you can add that, etc.)? I finished the second part of app development with Swift. Please explain why I should... |
I am trying out different data structures to learn more about smart pointers. I have created a queue implementation which has push, pop, front, back and size functions.
#include <iostream>
#include <memory>
#include <cstddef>
template<typename T>
class Queue
{
std::unique_ptr<T[]> q_ptr;
int front_idx = -1;
... |
I decided to make a stopwatch as I decided it would be useful, and also as a challenge to learn more about how forms work. I'd just like some simple advice as to anything I can do better, thank you.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
usi... |
I need advise whether the approach I took is the optimal one (not sure whether this is the right 'stackExchange' site).
I have an MVC application, which is supposed to be able to render an HTML page uploaded by a user of the app (this is a 'preview your data' feature).
These HTML files are like templates into which I i... |
I have written a function which finds the largest prime factor of some number. This function works but the problem is that it is too slow. For instance, when I enter 600851475143 as a parameter, the process of finding largest prime factor lasts too long. How can I modify it so that it works faster?
class test {
static... |
Question-
In short question says that you have N bus stops and K bus routes.
Every bus routes is linked to two bus stops. Each route has some cost
of travelling. It says one person visit any one bus stop(N-1 bus stop
require N-1 person). Task of person is to start from bus stop 1 and
visit his bus stop stay t... |
I recently started writing REST API, I wanted to have a proper structure of project and an approach which is more readable and make more sense interms of organising in a logical order. I took advantage of namespace and I have put endpoints of each name space into separate python package.
project
|______init__.py
|____a... |
I was asked this question in an interview.
You are given an array consisting of N integers. You need to determine whether any permutation of a given array exists such that the sum of all subarrays of length K are equal. N is divisible by K i.e. N mod K = 0.
If the array is [1,2,1,3,2,3] and K = 2, it is False.
I... |
I'm creating a rest api using Spring which utilize javax.crypto as library to do some encryption stuff. While everything works well, I'm curious whether the error handling like this is acceptable or not?
@Slf4j
@Component
public class RSAEncryption {
private static final String ENCRYPTION_ALGORITHM = "RSA";
privat... |
Hexadecimal 0xdead, 0xbeef are the magic numbers because they're also English words.
I decided to find such words as many as possible. How to do it? We need large English text let's say Ulysses by James Joyce and a program which extracts all words consists of hexadecimal digits. For simplicity, I decided to drop leet-... |
I am working on an 2048 AI and this is my code so far.
In the game 2048 you have a 4x4 grid in that some random so named tiles spawn.
Each tile has a number. The lowest number is 2.
By using the left, right, up and down-key you can move all tiles into the specified direction. If two tiles with the same number "collide"... |
I have a function that calculates the biggest number in an array after doing the following:
arrayManipulation(4, [[2, 3, 603], [1, 1, 286], [4, 4, 882]])
The array initially consists of only zeroes. The first parameter tells what the length of the array of 0s should be.
Here it's 4, so [0,0,0,0]
The second parameter ... |
I am currently working on the implementation of Event System on a game engine. I have zero experience in Event System implementation or the patterns that are used. What I have done is what I've seen online. This is also the first time I am posting here, so apologies if I've accidentally violated any rules for posting.
... |
I've been trying to understand Dynamic Programming lately, here's the question I just attempted:
You are given an array A of N positive integer values. A subarray of this array is called an Odd-Even subarray if the number of odd integers in this subarray is equal to the number of even integers in this subarray.
Find t... |
For learning purpouses I wrote a class that is supposed to find all divisors for a given integer. My class makes use of primes and prime factorization to speed things up a bit.
What can I improve in my class?
Are there any microoptimiztations that could speed up the process? Any bad practices that should be avoided? I... |
I have never written program in file handling. Help me improve this program.
book.h
#ifndef BOOK_H_
#define BOOK_H_
#include <string>
class Book
{
std::string book_num;
std::string book_name;
std::string author_name;
public:
Book() = default;
Book(const Book&) =... |
The code below takes header variables, retrieves the column index, and then, using an Index/Match function, returns data from a matching account number.
The reason it is written this way is because I wanted to make the code "reusable". By being able to change the hard-coded header names, I can update the Macro based on... |
I am trying to use a dictionary in Odd Occurrence. Any suggestions on how I could optimize the program? Codility is giving me a result of 66%.
var dictionary = new Dictionary<int, short>();
int oddVal = 0; //Collect the number with Odd Occurrence
//Add the numbers in the dictionary with value 1-odd pair or 2-pair
if(A... |
This is my original take on providing an interface for calculating the dimensions of a rectangle, given optional parameters. I also broke out perfect squares in the instance where only area or perimeter are supplied. I output the rectangle as a JSON string because I have designs on also building out a user interface.
T... |
I've implemented a simple class for managing a Tic-Tac-Toe game's logic and state in Typescript. This code is intended to be used by a larger program; it doesn't implement any aspects of a UI. I've designed the class to present an immutable API, although it's mutable internally; I'm not using ImmutableJS or other, simi... |
This is a calculator that only sums numbers:
module Data.Calculator where
data Expr = Plus Expr Expr | Value Int
evaluate :: Expr -> Int
evaluate (Value a) = a
evaluate (Plus (Value a) (Value b)) = a + b
evaluate (Plus (Plus left right) (Value b)) = (evaluate left) + (evaluate right) + b
evaluate (Plus (Value a) (Plu... |
I'm trying to learn functional programming and Scala, following through Project Euler problems.
I'm solving get the sum of multiples x & y in a list. So for a list [1,2,3,4,5,6,7,8,9] get multiples of 3, 5 returns 3, 5, 6 and 9, the sum being 23.
I'm accepting two parameters list and multiples
Mapping multiples to li... |
I have addressed the critique for this post and resubmitted it for iterative review; C++20 multithread pool class.
This is an iteration from a prior post; C++ thread pool class.
Class for creating thread pools with upcoming C++ standard C++2a (-std=gnu++2a -fconcepts).
It does not accept args for functions unless they... |
Here, my function is getting four integer values and one CSS class name. Based on their equality I'm creating few more CSS proprties. If all four elements passed are different then I'm using default CSS properties.
How can make this code elegant? I wanted to get rid of if else conditions.
Note: I tried with switch stat... |
Writing code could be divided into three parts.
1.Interface structure
At this stage programmer should describe all the devices used in his project. Of course, only those of them which Arduino programmaticaly interacts with (sensors, chips and not intermediate resistors, for example). Each device at this stage is repres... |
This is a follow-up to Boggle board solver in Ruby
class Trie < Hash
def build(string)
string << '.' # Terminator indicating end of a complete word
string.chars.inject(self) do |h, char|
h[char] ||= {}
end
end
end
# Build the trie from all the words
@trie = Trie.new
File.foreach('wordlist.txt') {... |
I wrote a Counter subclass suitable for anagrams, with a more visually user-friendly __str__() method using alphabetic ordering and Unicode superscripts(/subscripts) for letter-counts, so you can compare at-a-glance if two phrases are anagrams or not:
c1 = LetterCounter("PRESIDENTTRUMP")
print(c1)
D¹ E² I¹ M¹ N¹ P² R² ... |
I wrote an NLP script for processing Turkish language. Yesterday I added syllabication but I wonder if it could be done better. It is kinda hard-coded, so I would like to know if I can improve it.
Here is the syllabication part.
def syllabicate(self, word):
"""
:param word: The word to be syllabicated
:ret... |
We have hundreds of employees and for tracking each employees' data, and I am using this code:
<?php
$sqldelivery9 = "SELECT COUNT(*) as count FROM orders WHERE employeename = 'nawaz' AND DATE(reattemptdate) = DATE(NOW() - INTERVAL 2 DAY)";
$resultdeliverys9 = $db_handle->runSelectQuery($sqldelivery9);
$numrowsresultd... |
I wrote a perl script to import local files with "File-Ending-Versioning" (like file.1.12.pm) into a git repository. I tried to use the concept of roles in this script and I am not shure if I applied the concept right.
The basic idea is, that the script must be able to operate in a so-called "dryrun-mode": If invoked ... |
I have a two-dimensional array with M rows and N columns, with each element having a value between 0 and 255.
I have a second two-dimensional array with m rows and n columns, m < M, n < N.
The second array is like a box inside the first array, and loops from the top left to bottom right corner of the first array. With... |
The problem is the following: I have a list intervals which consists of tuples of the form (start, end) [with start <= end]. Each tuple represents an interval (of the real line). We assume that the intervals in intervals are not overlapping each other. Given a new interval (s,e), I would like to write a Python function... |
I have this code to generate symmetric matrices for testing how the design of the canonical correlation analysis I am performing works out. This is a extension of this solution
Each row of the matrix represent a dataset (it is symmetric), and if the value is 0 it means no interaction between the datasets, if it is high... |
I am relatively new to javascript ES6, the code I've written is working fine. However I am curious if this would be the best approach. I am trying to write a reusable module that I can use in multiple projects. On top of an API I've written a simple module to geocode adresses in the Netherlands. The suggest function wi... |
Currently i am using 2 queries - one for reattemptdate & one for holddate.... if we merge both queries & get the results in single query , than will it give better performance? if so how to merge ?
1st query :
$sql = "SELECT employeename, DATE(reattemptdate) as date,
COUNT(*) as count FROM orders
WHERE DATE(reattemp... |
An array is given with 'n' Values ( n <= 10^5 ) ; we have to calculate xor of each pair of elements and count those pairs whose xor can be written as sum of two prime numbers with the same parity(both odd or even). My code is:
#include <iostream>
#include<vector>
using namespace std;
int main() {
ios_base::sync_with_s... |
I am posting this here because it was suggested that it is the best place by a seasoned user.
This is a project I already submitted, but I never received feedback. All my upcoming assignments will be based on this, so I wanted to make sure it is correct. I got this program to work as far as calculating the information,... |
I'm relatively new to PHP OOP, currently I'm practising how to use it, however I am not really certain I'm building my classes correctly, I think perhaps I'm missing something out but I'm not entirely sure what, any advice would be appreciated
Class
class Validation
{
private
$password,
$repeatPass... |
I am solving a HackerRank problem called 'Morgan and a String'. Given two strings, each consisting of up to 105 uppercase characters, the task is to form the lexicographically smallest string from those letters by taking the first remaining character from either of the strings at each step. Example, for input strings... |
My code in full plus the task scheduler definition: https://gist.github.com/DaneWeber/0c5e7978bd3927734173e3afdc3d6338
This is my first non-trivial PowerShell script. This was a pretty major learning experience. I only went down this path once I discovered that xcopy wouldn't be sufficient.
My Ask: What do I not know t... |
This is not an actual administration system. It is just homework. I haven't finished the project yet, but I would like some advice on how to improve what I have done so far.
main.py:
from file import File
from random import choice
class Main:
def __init__(self):
# The file_handler object will be used to... |
I have an array. Now I want to find the total of, sum of the subarray multiplied by its last element, for all the possible subarrays. This is what I have right now:
n = int(input())
a = []
for _ in range(n):
a.append(int(input()))
total = 0
for i in range(1, n+1):
for j in range(n+1-i):
temp = a[j:j+i]
... |
I recently learned Python using the book by Mark Summerfeld and I am now doing a few katas of mine when I learn a new language. This helps to get the “how the language works” and I wrote a simple lexer for Apache logs.
An example of log records are
64.242.88.10 - - [07/Mar/2004:16:05:49 -0800] "GET /twiki/bin/edit/Mai... |
I have two list of tuples:
[[1,8],[2,7],[3,14]]
[[1,5],[2,10],[3,14]]
and a desired sum 20. I need to find two tuples from two list whose second element either add it to the sum i.e 20 or the next lowest sum. In this case if we consider [3,14] and [1,5] the sum is 14+5=19 hence the output should be [3,1]
[1,3000],[2... |
I'm trying to get and save in an ArrayList Reddit posts and comments.
The code is very similar for both:
The RedditThing is a parent of RedditPost and RedditComment:
class RedditThing {
String author; String subreddit; String body; long score;
public void setAuthor(String authorUsername) {
this.autho... |
I've been working on this probability game that has a gun with 5/6
bullets. When there's a dodge the game removes a bullet and then the
game continues, the goal being to get to 0 bullets.
I don't use a var to keep the score counts because it's easier to flush it by adding the new sentence in. Are there any big mi... |
I am trying in R to "center" a matrix (i.e. remove mean) group-wise (i.e. remove group means for each variable).
Input is a matrix (including the grouping variable), and output is the same matrix, where columns are now group-wise centered (possibly excluding now grouping variable).
I tried 3 solutions:
Using dplyr: us... |
Can anyone here comment on the quality of this test case? I am here testing for the exception should be thrown scenario. I mean it works but is it the correct way to unit test for the scenarios where the expectation is that exception should be thrown?
it('should throw exception if config.env.json is malformed', async (... |
I have to create a form, which enables users to move stock of items to different statuses. The form will show the current stock(quantity) in a given status and then 5 input fields corresponding to 5 statuses. The user can input into one or more fields as to the quantity that they want to be moved into the new status. O... |
I'm working on my Django project and I'm trying to develop this one with 'Class Based View' (CBV) method in order to keep the code maintainable.
I have a class named FreepubHome with some methods and a very important post method. I would like to split this method into three methods and I don't know how I can do that.
T... |
These string arrays are used to classify whether the incoming feed/message is a driver feed or team feed.
private static final String[] DRIVER_FEED_TYPES = {
"SEBASTIAN_VETTEL", "LEWIS_HAMILTON", "CHARLES_LECLERC", "MAX_VERSTAPPEN",
};
private static final String[] TEAM_FEED_TYPES = {
"FERRARI", "MER... |
Currently I have this code
function foo(firstId, secondId){
var boolOne = false;
var boolTwo = false;
for (var i = 0; i < arr.length; i++) {
var current = arr[i];
var id = current.id;
if(firstId == id){
boolOne = true;
}
if(secondId == id){
... |
I've been implementing a simple Python calculator for learning purposes. Since there are no properties or bindings like in Javafx, I implemented my own MVC pattern. I'm aware of missing logic like checking for division by zero and stuff, but I wanted to keep it simple for this review.
So there are some questions:
Is t... |
I'm looking for an efficient way to validate multiple rows originating from multiple .csv files. Below is the current code to accomplish that.
The validation logic is in the function ValidateRow(DataRow row) (not presented here).
I could think of an alternative with using Linq and performing batch.All( row => ValidateR... |
I currently had a colleague reviewing my code and he had a comment on a factory class I created. It's very simple:
class ResponseFactory
{
public function create(array $curlInfo, array $rawResponse): ResponseInterface
{
return new Response($curlInfo, $rawResponse);
}
}
$responseFactory = new Respon... |
This is the first question for this language, and I decided I would do a FizzBuzz.
I used a template literal as a proof of concept, same goes for the pipe (|>). The code creates a function that recreates the traditional FizzBuzz in FreezeFlame:
var fizzBuzz = (max) -> {
for(var i = 0; i < max + 1; i++) {
(i... |
This is a calculator I created. It can take all basic operators, including brackets. I am a beginner with Python so I want to know what can I do better next time I write something similar.
def eval(expression):
current = 0
while current < len(expression):
x = expression[current]
if x == '(':
... |
Ive been sitting here for the past 20 minutes trying to make this simple/tiny function more 'readable' and 'clean'. Am I overthinking this or am I missing some major tips that could help me out?
string findSameSales (int numSold, int salesArray[], string namesArray[])
{
string ssList = " ";
for (int counter = 0; c... |
I wrote a simple python port scanner today and I would like to get some advice on how to improve on the code in different ways.
I am aware that I can implement threading to reduce runtime but I won't for now as it feels a bit advanced at this time. Rather I would like tips/opinions on how to improve the program in othe... |
I want to find a quick way to see if a matrix M has at least one value that is, say, 2. In R, I would use any(M==2). However, this computes first M==2 for all values in M, then use any(). any() will stop at the first time a TRUE value is found, but that still means we computed way too many M==2 conditions.
I thought on... |
I currently have a number factors program that performs the following things: The user enters a number, checks whether it is a perfect square (yes or no), prints the square root if it is a perfect square, determining the number if it is prime or not, and the number factors of that specific number.
import java.util.Scan... |
I am using 4 queries to get below 4 values , like this I need to use about 14 queries , Is there any way to reduce the number of queries ?
<?php
echo " " . date("Y-m-d")." ";
echo "Reattempt : "." ";
$sql =
"SELECT
COUNT(*) as count FROM orders
WHERE DATE(reattemptdate) = CURDATE()
";
$results = $db_handle->run... |
I'm implementing a TCP client to read data from a sensor. The sensor sends messages to connected clients framed with a start sequence, messages, checksum and end sum bytes. Because the sensor is installed at a remote location, I'm currently reading previously captured network data from a pcap dump into a MemoryStream. ... |
I've written a script that semi-automates the process of configuring/creating a new systemd service.
The script is working perfectly well, however, I've had some trouble with the styling and readability, as well as with the argparse logic (argument parsing works well, but there is just too much to handle manually and n... |
It is with great difficulty that I resolved to solve my problem, so I allow myself to submit here the solution.
I wanted a playbook that could replace on all hosts the root password with a string containing the last 3 digits of the IP address of the remote host.
Example:
suppose the password is my_password and my LAN i... |
I must implement thread-safe queue with buffer. According to the advice from the previous post: Thread-safe queue mechanism I resigned from Concurent Collections and used lock.
Is it thread safe now? What can I improve?
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Th... |
In my company, we use git as VCS, the main server run under linux but all our code is for Windows and we all develop on Windows.
The git tag system is case sensitive on linux but is case insensitive on windows.
That is:
under linux Test/Tag and TEST/Tag are different tags
under windows Test/Tag and TEST/Tag are the sa... |
I'm writing a lot of R in my spare time and am trying to get into good habits by using TidyVerse as much as possible. A large part of this has required reading entire directories of dated log files into R for processing. The volumes of data are well into the GBs so I won't post one here and it shouldn't matter so long ... |
My use case is that I have a list of emails and I need to find if the email is in the chain:
emails = [
[' RE: I just got your test || This is a top level email roughly 300+ words in length on average'],
['RE:RE: Something | RE: Something | This is another entirely distinct email that is the top level'],
... |
I've written a script to look for coordinates in KMZ files. I've tried to speed execution up using the ProcessPoolExecutor. I'm quite new to Python, so any recommendations are more than welcome.
#!/usr/bin/env python
from zipfile import ZipFile
from lxml import html
import os
import concurrent.futures
def process_fil... |
I'm just starting out in Rust and I find the concept of ownership confusing so I wrote an implementation of the echo command. I would like to know if I could have set the initial value on the echo variable any better or just any general improvements.
use std::env;
fn main() {
let args: Vec<String> = env::args().co... |
I created a utility class to keep track of all objects inheriting from it. My main motivation here was to have a clean solution to select which entities in a multiplayer game are synced with the server. I tried to make it as hard as possible to make mistakes (eg. inherit from the wrong crtp parameter) and keep things e... |
You know how whenever you download a file you should really compare the hash of the download to the one provided on the website? This makes absolute sense, but it's a pain to do it letter for letter, digit for digit. So, I wrote this little script to take care of the job. Any comments are welcome.
#!/bin/bash
# hash_c... |
I've implemented a basic TransactionManager class that manages undoing/redoing of arbitrary Actions which have access to the TransactionManager's type via template parameter.
Here's the basic usage:
#include "Transaction.h"
TRANSACTION_MANAGER(TestTransactionManager) {
public:
TestTransactionManager() : value(0) {... |
I have received this question during an interview I did earlier, but I found that my solution might not be correct. And I would like to know whatever there is a better way to solve this.
Question:
Lots of people are making a reservation for appointments
Writes a function to let people make appointments reservation bef... |
Context
This program will control a robot. It is written in Java 7 and compiles into an Android app, but these classes are not Android specific. This program was written for FIRST Tech Challenge and uses some classes from their SDK, available online at https://github.com/ftctechnh/ftc_app.
Purpose
These classes are des... |
I have a connection with my database to show all my records on a webpage, and I'm not sure if this code is safe:
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'root');
define('DB_PASSWORD', null);
define('DB_DATABASE', 'publicacoes');
define('DB_PREFIX', 'bn');
define('DB_CHARSET', 'utf8');
function DBEsca... |
I wanted to create a histogram from a list of positive integers. I want to bin it so that I show all single numbers, say K through N, with more than k elements in the data set, as well as the number of elements greater than N.
'''
The goal is to max a histogram from integer data.
The last bin should represent all case... |
I have a text file where any name followed with sequence word is considered a dictionary. The task is to go through the keys and values of a particular dictionary, which is already identified, and see if any of the key's values is of dictionary datatype. Then, to identify the value is not a dictionary, I scan the file ... |
Each User has a field called id. And I want to create a vector containing all ids of the users returned by the API call.
vector<int> ids;
Users* users = // API CALL HERE
for (auto i = 0; i < total_users; i++)
{
logins.push_back(users[i].id);
}
Is there a way to do this in a more clean way in C++?
|
We have an event file which I'm processing to get the status of a job (process), whereas a single job contains multiple fields which I want to segregate based on what I required, for example, "JOB_NEW", "JOB_START" etc.
As in my current code I'm processing the file line by line and with a loop and that again processed ... |
Tried to make a binary search algorithm, how did I do?
def homogeneous_type(list1):
i_list = iter(list1)
listtype = type(next(i_list))
return True if all(isinstance(x, listtype) for x in i_list) else False
def binSearch(list1, value):
if not list1:
raise ValueError("list is empty")
if no... |
Is there any better and compact way to write this code:
String output = "NAME OS ACTIVE\n" +
"---- -- ------\n" +
"ABCD Windows Yes\n" +
"EFGH Windows Yes\n" +
"1234 Windows No\n" +
"5678 Win... |
I'm making an audio frequency trainer as a learning exercise. It could be useful for audio technicians who need to recognize audio frequencies (eg. when ringing out feedback during a live concert or soundcheck).
A few days ago I posted the humble beginnings. I got very useful feedback and went further. Here is a workin... |
I have been programming about 4 months now and I am looking some way to improve my code. Currently I am using a book "JAVA an introduction to problem solving and programming" to learn programming. I think I understand basics of loops and if statements.
After couple of projects in this book, I feel like I am only using ... |
I have submitted the following bit of script as the answer to one of the tasks I was set by a recruiter. My submission has already been made and cannot be altered. However, I am keen to ask how you would improve the solution.
Task:
Using Javascript and no library or odd ons, create a script that can take 2 HTML Hex c... |
I am just wondering if I need to refactor this code into smaller functions, or if it is OK as it is. I know that code should be as clean as possible, but I don't see a need to declare a new function every time I have more than 5 lines of code. Anyways please tell me what you think.
The code itself is used for file hand... |
I am trying out the following former Google interview question.
The Challenge Given a string S and a set of words D, find the longest
word in D that is a subsequence of S.
Word W is a subsequence of S if some number of characters, possibly
zero, can be deleted from S to form W, without reordering the
remaining c... |
I have a SELECT query I'm executing which has a MAX() column and a GROUP BY clause, and in addition to the results of this query that I need to return to the client, I also need to return the total count of all results as well.
Essentially my query is this:
SELECT id, col1, col2, MAX(col3) as col3
FROM tbl
GROUP BY col... |
LENGTHS_TO_CENSOR = {4, 5}
CENSOR_CHAR = '*'
CENSOR_EXT = "-censored"
def replace_inner(word, char):
if len(word) < 3:
return word
return word[0] + char * len(word[1:-1]) + word[-1]
def create_censor_file(filename):
output_file = open(filename + CENSOR_EXT, "w+")
with open(filenam... |
Historical Friday: this was my first useful C program, written around 1993-1994 (with only occasional access to a compiler and runtime environment). It's also my first non-trivial Postscript, too.
Background
I was a student at the time I wrote this, and unable to transport a turntable to and from my accommodation, so ... |
Currently, I am using the below code to make JSON data from list of objects.
public IActionResult getWardsFromVDC(long vdc_id)
{
try
{
List<Ward> wards = wardRepo.getByVdcId(vdc_id).ToList();
List<Dictionary<string, string>> values = new List<Dictionary<string, string>>();
foreach (var ... |
I wrote a method in java which fetches the data from third part database, store the results in our database and then acknowledged them by updating their tuples. I want you people to review my code, because it contains multiple try and catch and suggest me the best practice to improvise the same, Find the below java
pub... |
I'm implementing Curiously Recurring Template Pattern(CRTP) in Java as follows.
The Interface:
/**
* Reason for the generic Value<T extends Value>
* Value<IntValue> x; // legal, IntValue implements Value interface so allowed
* Value<Integer> x; // illegal, does not implement Value interface
*/
@SuppressWarnings(... |
I have a program that includes sending data to our backend servers upon completion.
Due to the occasional connection issue at either side I have coded into the main script a JSON dump as a backup in case we are unable to connect to the BE server.
The JSON file is simply a Key/Value mirror of the SQL database fields in ... |
I want to make this faster, I'm not a great coder and just want to learn. This program reads paragraphs of common artists separated by commas. The user inputs the name of a desired artist and the program searches through the paragraphs to find all related artists and sorts them into order of most common to least common... |
The program I have been working on has been developed almost exclusively as "train-of-thought" style code. Things happen linearly (for the most part) thru the code. The goal of the program is to house Arabic language lessons, somewhat similar to how Duolingo works. Right now I have four questions hard coded in with pre... |
As per the instructions are given in MaxCounters-Codility,
You are given N counters, initially set to 0, and you have two possible operations on them:
increase(X) − counter X is increased by 1,
max counter − all counters are set to the maximum value of any counter.
A non-empty array A of M integers is given. This a... |
Needed a simple CSV file that had headers and no nesting of data to consume in Tableau. The JSON file I was consuming had nested dictionaries and lists (which sometimes had in themselves nested lists/dictionaries).
The output is a pipe delimited format (because free text fields have comments in that mess things up) wit... |
I have this userform that looks up into a sheet. The problem is that when there are a lot of rows to look up it takes too long to execute (for example 100 thousand rows). Is it possible to reduce the time?
Here is the userform's textbox code where I put what I am looking for, and the data is shown on a listbox ("LSTART... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.