instruction stringlengths 71 71.9k |
|---|
This is a very simple implementation of dragging elements in html/js. I'm working on a web application that could have thousands of draggable elements on screen at any given time.
Currently, this code works perfectly as shown below (with only one draggable element), however if I copy and paste that element (<span class... |
Is there a more efficient way to create the three files and write to those files using BufferedOutput and BufferedWiter I/O? The code works, but I thought there has to be a more compact way to accomplish this.
import java.nio.file.*;
import java.io.*;
import static java.nio.file.StandardOpenOption.*;
import java.util.S... |
I can coded a simple logging class in C#, my main aim for this is to make it easily usable, fast at logging and saving, and to handle pretty much everything that errors. Overall I am just looking for advice if this is a good logging setup, and how I can improve the code inside it.
I didn't want to manually save each er... |
How could I get a better performance in my C# application? Or what should I change in my source code?
I would appreciate any kind of help.
This code is reading each line of a textfile which stores values like var1:var2 and calls a class with those values.
Function which calls the class:
private void bunifuFlatButton2_C... |
I have a form that looks like this:
It is initialized with a Shortcut from the keyboard. It is in a module:
Public Sub ShowMainForm()
With frmMain
.Show vbModeless
End With
End Sub
The form has a button:
Private Sub btnRun_Click()
Call MainGenerateReport
End Sub
The button runs a proc... |
I am new to programming and wrote this code for a Tic-Tac-Toe game.
The game works as desired, however, I feel the code can be condensed a bit especially within the functions, Map_1st_Player_Input_to_Player_Board, Map_2nd_Player_Input_to_Player_Board, and Check_For_Win where I rely heavily on if, elif statements.
Can... |
I have created a database logger for ASP:NET Core's logging API and I'd like to publish it on NuGet when ready. The GitHub repository is here.
The library is partly modeled after Microsoft.Extensions.Logging.Console and I tried to follow good practices of object-oriented design.
I am slightly concerned about some decis... |
I wrote a Hotkey-System for command-based WPF applications.
Could you please take a look at my code (even if it consists of multiple classes :P). I am mainly interested in following things:
How readable is my code?
How well or bad is this programmed and designed?
Are there flaws in the design which could prevent this... |
I am crazy about needing to calculate my work shifts for my part-time job while attending University. This is because I cannot work more than 20 hours a week.
Yes, this code is crap, I wrote it in 20 minutes... my brain operates kinda like a pachinko machine, and whatever it writes for stupidly annoying scripts like ... |
I have a React app that I am testing with the built-in jest testing tools. In the process of debugging, I sometimes send data to the console (e.g. console.log, console.error, etc.) from my code-under-test. This shows up both in the browser console as well as in the testing output in the terminal which is what I sometim... |
I have created a simple ConfigManager in C# that loads each line of a file. If the line contains = then it gets the before = (the key) and the after = (the value).
For example, my config file would look something like this:
# Comment here
MyConfigKey1=MyValue1
MyConfigKey2=MyValue2
MyConfigKey3=MyValue3
Obviously my c... |
This code basically checks a cell for the current date and then fills out the report by finding that date and placing the correct values in the correct places. It works fine I just know that I am going to need to build something similar for many other reports so I am hoping to update, streamline and improve in any way ... |
I made a Poker game a while ago and looking at it now, I'm not really happy with the code structure and I decided to revamp some of the core functionalities there, starting with the different Poker combinations.
Card.cs
Obviously the first and most important thing are the cards themselves:
public enum CardColor
{
H... |
I have implemented a collection class that stores a single type of value.
At the moment it is immutable.
abstract class Collection implements Iterator
{
/** @var int */
protected $position = 0;
/** @var array */
private $items = [];
public function next()
{
++$this->position;
}
... |
Read the current inventory from a file. Either adjust inventory based on orders or generate a purchase of new inventory. When a product goes below a certain point, it will be asked to calculate it and then restock it to a target point. I am trying to make it more efficient, such as making it shorter.
check = 0
GTINC... |
This is a simple class that runs a timer every 10 seconds to update the title with some information like how long the application has been up, depending on the datetime that is set in another class when the application has finished booting up and is responsive. This application is part of a game server and it just disp... |
I have written a simple event handling system, which is intended for a game but right now I am just trying to get a general framework created. This is simply for practice for myself, but I am trying to design it as if someone else possibly had to use it and maintain it.
I would appreciate any comments on what I can do ... |
I wrote a small aggregator app that aggregates values from a json http post request and outputs the aggregated values. Now the aggregator function is somewhat large but the output appears correct.
I start it with gunicorn:
$ gunicorn --workers 2 --threads 4 aggregator:api
I test it with curl :
$ curl -X POST -d @aggr... |
I'd like to get feedback on whether my hash table is correct or not. Also, any ideas on performance?
template<class J,class K>
class List {
private:
struct Node {
J key;K data;
Node * next;
Node(J _key,K _data):key(_key),data(_data),next(nullptr) {}
}*head;
public:
List():head(... |
I am practicing my object oriented knowledge, so I created a very simple program that determines which is the lowest and highest number inside array.
This is my main method:
class Program
{
static void Main()
{
Console.Write("How many numbers would you like to enter?: ");
int num = int.Parse(Con... |
Here is my code to use range minimal query to resolve the LCA problem. Any advice on code bugs, performance improvement in terms of algorithm time complexity, code style are appreciated.
More specifically, my questions are:
I am using in-order traverse to build depth array. Should I use other traverse, like pre-order ... |
I am trying to do these online competitions where you get the given exercise and are supposed to upload the source file.
The site is not in English so I will try to summarize the exercise.
The first line of input states P, the number of problems ( 1 <= P <= 100 ). Subsequently, there are two lines for each problem. The... |
Here is my code for quick select in Python 2.7. I am trying to optimize code for fewer comparisons. And my specific question is marked in code, 3 lines marked with more safe way. Wondering if my code is safe enough to handle all corner cases (in more details, I think more safe way definitely can handle all corner cases... |
Every integer can be written in the form \$2^i*v\$ where \$v\$ is odd. This algorithm generates a list of numbers that are only odd. We want to ensure that all the composite odd numbers are marked out.
In the final list, all numbers will be of the form \$2^0 v\$. So, we only need to worry about odd factors. An odd numb... |
In Leetcode it states that my runtime is only faster than 38% all of submitted JavaScript solutions. Is there anything I can change to make it more efficient?
/**
* @param {number} x
* @param {number} y
* @return {number}
*/
var hammingDistance = function(x, y) {
var resultStr =( x^y);
let count =0;
whi... |
I am working on my first object-oriented programming project, written in C# for Unity. My code does what I want it to do, but I am wondering if there is a better way to do it. I think I am building something that will be hard to manage going forward.
Info
I have a set of semi-related manager classes that are responsi... |
I'm learning Python by solving previous GCJ problems. This problem is quite simple to solve, but I'd like my code to be reviewed for advance (more Pythonic expression and more efficient algorithm).
The magician starts by arranging 16 cards in a square grid: 4 rows of cards, with 4 cards in each row. Each card has a di... |
I'm trying to show to the user that the page is reading/loading by creating an animation of dots.
Here is the HTML:
<div id="dot">Authenticating</div>
<hr>
<button id="run">
Run It
</button>
<button id="stop">
Stop
</button>
And here is the script:
$(document).ready(function(){
var interval;
function... |
Please comment about code complexity, and coding style, I'm preparing for a code interview, so any comment would be appreciated.
Example:
Input
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
Output:
1 2 3 4 8 12 16 15 14 13 9 5 6 7 11 10
Code:
using System;
using Microsoft.VisualStudio.TestTools.UnitTes... |
I have written some code to find the longest line of empty space in a grid and I'd like to know if it can be simplified or shortened at all.
Here is an example of the input and output of the program:
Input
Output
As you can see, the program found the longest line to be near the top in the middle. The program is only ... |
This piece of code works fine. But I'm wondering if it can be done in a more efficient way. More specifically, this part (*(s1 + i)) if it possible to force it to sequence through entire array character by character via pointer, for example, *s1++.
My task to do this function compareStrings without index array []:
int ... |
Basically, there is an election on 3 regions where either candidate needs to win 2 in order to win the election. Idea is to simulate 10000 elections to see which candidate wins. I think my solution works but I am not happy with the huge list of if statements and wondering of if there is a better way for this.
# Assignm... |
I was asked in an interview to find the a number in an sorted array of numbers which has occurred maximum number of times. Also find the count of occurrence of that number.
I solved it in javascript, please follow the code
var numArray = [];
// takes the space separated numbers from commanline
// and inserts in arra... |
I'm in the process of writing a matrix like container to store objects. Despite many existing matrix implementations, I won't do numerics. Instead I want to replace a std::vector<std::vector>> variable to increase performance (memory allocation and cache misses are an issue with this double-vector implementation). I wa... |
I wrote this login program as part of my project for school. Should I use my implementation of a login program, or is there some standardized patterns of login programs, like the ones in encryption where we use made packages instead of writing our own?
Also, please correct me if am doing anything wrong or if there is a... |
Goal:
Wrap a vector. The wrapper can create view on part of the vector.
Support const_view and view.
view allows modification of elements while const_view does not.
The views are ranges (has begin() and end() methods).
Problem:
Code duplication between the const_view and view.
The actual code implements a 2D spar... |
I am looking for some advice on some speed increases on my Adobe Illustrator (AI) script. Just so you know, the script runs fine and is at a decent speed (couple seconds to maybe a minute max for large files), but would like to speed it up further.
A couple things to note about how AI and ExtendScript(ES) (my IDE) work... |
I recently got a take-home project for a company hiring for front-end developers. The task can be found here.
I was given two hours to complete it, and did, but was told they wouldn't be moving forward. I actually thought I did a pretty good job given the two hour limit.
Since companies don't give out any information a... |
I am doing an exhaustive search in N-queens code I wrote in C++. How can I optimize this code further?
It takes an input n (the number of queens) and returns a vector<vector<string>> having all possible arrangements. Looking at the code, I think the operations like pop_back() is slowing the entire runtime.
#include "st... |
I coded a server-client (kind of) chat, and I need your review as I'm sure it is a mess. I used lots of tutorials and tips form different websites and forums which were posted at different times (maybe now it's a lot easier to write what I want) and slapped them on Visual Studio. It's not like I wanted it to be a chat,... |
I am using Digital Persona 4500 Fingerprint Scanner for my project. I used U.are.U SDK 2.3 for Windows as the SDK and I am able to insert the serialized fingerprint minutiae data to database using this code:
void reader_On_Captured(CaptureResult capResult)
{
try
{
if (!_sender.CheckCaptu... |
This is started as a simple project, because I don't like software I'm using. Not that they are not good, but I wanted some custom stuff, so this little project started. This part of project is for live viewing while archiving is done with opencv (not shown here, I managed to get this work).
I am very new to python, bu... |
I already asked a Code Review question about Working with a new form instance every time.
As far as I have decided, that the most important part of the code is to work with the instance of the form and to learn how to handle them properly, I have remade the code (roughly using the code from @Mat's Mug) in a way that I ... |
There are a lot of times where you need to ensure that a number stays within some constraints and I got annoyed of inventing a distinct class for every case so I decided to solve the problem once and for all. So I wrote a template which has semantics the same as a number except it checks the predicate each time its val... |
I am currently using the following code to see if the current machine has joined a domain. I was wondering if there is a more efficient way of doing this. I am currently using the JNA to receive the Secur32 instance variable.
public static String CurrentDomainName() {
char[] userNameBuf = new char[10000];
... |
I have a need to search for ansible inventory in the current play by group type and grabbing an arbitrary number of them.
I mostly want advice on if the _first_run variable is the best way to handle this inspection. I put it there so that a key error doesn't occur during the iterable creation.
Also, I'm unfamiliar with... |
I started to try my hand at making a chess game. It works, but I know this isn't the most efficient way of writing code.
I'm just looking for advice and critique on how to get better. Please be tough!
MOVEMAP = {'a':0 , 'b': 1, 'c': 2, 'd': 3,'e': 4,'f': 5, 'g': 6, 'h': 7,
'1': 7, '2': 6, '3' : 5, '4... |
I have two dates, example :
date1 = "4-02-2017".to_date
date2 = "4-02-2017".to_date + 29
I try to get array of date by each week with this :
(date1..date2).select{|x| Date::DAYNAMES[x.wday] == Date::DAYNAMES[date1.wday] }
Rersult :
[Sat, 04 Feb 2017,
Sat, 11 Feb 2017,
Sat, 18 Feb 2017,
Sat, 25 Feb 2017,
Sat, 04... |
I'm exceeding the time limit for a 10,000 word test case provided on LeetCode:
Given an array of strings, group anagrams together.
For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"],
Return:
[
["ate", "eat","tea"],
["nat","tan"],
["bat"]
]
Note: All inputs will be in lower-case.
Any suggestions o... |
I have implemented a function, which logs the inputs and outputs of any function, indenting the log based on the depth of the call stack:
(def depth (atom 0))
(defn logfun [fun]
(fn [& args]
(do
(swap! depth inc)
(println (str (apply str (repeat @depth " ")) ">>> (" fun ... |
I am new to Python and I have tried to come up with a code for the number guessing game. But I am pretty sure this is not the right way to do it. I am able to get the right output, however, my code is pretty long. Any ideas on using a different logic or to reduce the code size would help.
I also would like to know how ... |
I have written the following code for the Three Cards Monte game. It works as expected and returns the required output.
However when I tried to turn it in to the teacher, he keeps saying its too long.
Is there any way to shorten it but make sure it returns the same output?
import java.util.Scanner;
public class Thre... |
I have a method which takes a parameter which is Partition enum. This method will be called by multiple background threads around same time period by passing different value of partition. Here dataHoldersByPartition is a map of Partition and ConcurrentLinkedQueue<DataHolder>.
private void validateAndSend(final Partit... |
I've been working on an small API wrapper for the GitHub API using Scala (full source on GitHub). I'm still very new to the language, so I was hoping to get some feedback about a couple of design decisions.
The main class is APIClient. Within this class, a query for a repository takes the following steps:
Make API ca... |
Here is my two versions of code to check if there is a circle for a directed graph. Any advice on performance improvements in terms of algorithm time complexity, code bugs or code style are highly appreciated.
More specifically, I have two questions:
My v2 method (refer to check_circle_v2) is an optimization which tra... |
I am trying to implement a DFS search and graphs. How can I make it better?
/**
* Depth First Search iterative implementation
* @param: graph to traverse and the starting node
* @return
*/
let DfsSearch = function(graph,startNode){
let stack = [];
stack.push(startNode);
while(stack.length... |
problem statement
Given an array of strings, group anagrams together.
For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"],
Return:
[
["ate", "eat","tea"],
["nat","tan"],
["bat"]
]
Note: All inputs will be in lower-case.
My introduction of algorithm
Understand Hash collision
I came cross the question on thi... |
I have a route I've rewrote to use promises.
router.post(
'/forgot-password',
(req, res) => {
//generate random password
let passwordString = Math.random().toString(36).slice(-10);
User
.findOne({'username': req.body.email})
.then(foundUser => {
foundUser.setPassword(
pass... |
I'm trying to make an RPG game and I would like to make the code a lot shorter.
This is only the first floor but there will be 5 floors. To advance to the next level, you have to defeat the boss of that floor. The only difference between the floors are the enemies and their strength. The game ends when you die or when ... |
I'm having trouble in my controller code because it looks ugly and the more i add stuffs to my controller, the more it become ugly and unreadable. Here is my codes
This is just a simply version of my first attempt
public IActionResult VersionOne(TestModel model)
{
if(!ModelState.IsValid)
{
model.SelectL... |
I would like my solution to Google Foobar's prepare_the_bunnies_escape checked for readability, maintainability, extensibility, style, design. I am looking forward to reading your suggestions on any of these aspects! Feel free to comment on other aspects as well.
Problem
Link to full problem
statement
Summary
You ar... |
Here is a design to achieve a simple model in Java which uses a Thread and has these features:
Starting the thread with an initial value
Pausing the thread
Resuming the thread with new value
Stopping the thread
Restrictions: Do not use already implemented java libraries (from the concurrent package).
A similar questi... |
I wrote this simple server in node. Actually my goal is to better understand exception handling best practices in Node.
So my question is more specific.
Is this code bullet proof to exceptions? Are all errors or exceptions propertly handled?
How would you make it more safe? Where would you put try/catch?
Is there a pl... |
I've been developing a compiler for a programming language I'm working on in Scala, and after having used Haskell's Parsec a lot for this sort of thing in the past I decided to reimplement the library in Scala (which can be found here). I'm pretty happy with the result, and it definitely works but I'd like to get a rev... |
I had some issues with sending huge data and receiving them with Winsock so I made some improvements on my RecvAllBytes function and the same with SendAllBytes. I would like you to review it because I made a lot of conditions and loops. Please let me know how to improve the code below.
constexpr int maxBufferSize = 81... |
A bit of background: some time ago I wrote a piece of code that can be used for memoization with functions taking one parameter. Now I want to extend this to deal with functions with arbitrary number of parameters. However, thats a different story and here I want to focus only on one part of it: When memoizing the para... |
So I have some code which solves the tower of hanoi problem. The code that I have written is pretty clunky and seems to repeat itself multiple times.
Was just wondering if there was some way of improving it and reducing the repetitive nature of it.
The move() method returns all the possible moves from a given compositi... |
I'm trying to make a safe "remember me / auto login" function on my site and as I'm just a hobby programmer I would like someone professional to take a look at my code this far. This site will probably never see the light of day I'm just doing this because I find it fun and learning, but I still like to do it correct. ... |
I have to create a program which calculates the result of an arithmetic term written in Polish Notation.
var parseNotation = parseNotation || {};
/**
* Computes the result of an given arithmetic term which is written in
* Reverse Polish Notation (https://en.wikipedia.org/wiki/Reverse_Polish_notation).
* @param {... |
I have a snippet of code here that uses C# and Linq. The ganttData variable I have has 12 warnings stating:
possible multiple enumerations of IENumerable
Should I change it to a List or leave it the way it is?
private IEnumerable<ProductLineDto> FilterAtHighestLevel(IEnumerable<ProductLineDto> ganttData, GanttFilterD... |
Is there a better way to do this (clean, efficient, good practices)?
import aws from 'aws-sdk'
aws.config.setPromisesDependency(require('bluebird'))
ebs.describeApplications().promise()
.then(({ Applications }) => Applications.map(app => { return { ...app, Environments: [] }}))
.each(app => {
return ebs.descr... |
I have recently delved into the world of OOP programming with PHP. I wanted to add my own custom menu to the WordPress Admin area, and came across a tutorial, which I have followed, and the code is currently working.
What I would like to know is: whether this is the correct way to go about it, is it secure (since it de... |
I am new to node, after I finished my APIs I realized that all of them are a mess, and are a callback hell, this forced me to learn about promises, now it was all good until I faced an API that has condition with more than possible function, my question is how to do nested promises, my code is about a parent object who... |
I'm working with audio which has a lot of two dimensional sound buffers passed around like this:
(float**, int numChannels, int numSamples)
I'm looking to implement a quick array_ref style view (quick, non-owning, traversable view, knows its dimensions), but which allows me to do range-based for loops like this:
Buffe... |
I've recently just finished my implementation of a DBSCAN in C++ for a machine learning framework. I've tried to follow the pseudocode implementation on Wikipedia as best I could. I also found some example implementations on Github to help as well. So far, this is what my code looks like. I was wondering if my implemen... |
I recently started solving programming challenges and this one is causing me performance trouble. The problem statement is the following:
You are given a 2d matrix where each cell contains an integer weight,
a start and an end position. The goal is to find the maximal
smallest element from all paths from start to ... |
The BST below slightly different from the ones I commonly see on here in that it uses std::unique_ptr to manage the memory. Thoughts?
#include <algorithm>
#include <cassert>
#include <memory>
template <typename KeyType, typename ValueType>
struct BSTNode
{
BSTNode(KeyType const &key, ValueType const &value) : key... |
Here is my word break problem in c#
static void breakSentenceIntoWords(string input,List<string> validWords)
{
if (String.IsNullOrEmpty(input))
throw new Exception("String cannot be empty");
int indicator = 0;
StringBuilder builder = new StringBuilder();
for (int i = 0; ... |
I attempted to solve a simplification of User Story 2 using shapeless:
Namely, define the implementation of:
trait IsValid[A]
object IsValid {
def apply[L <: HList](implicit ev: IsValid[L]) = ev
}
where valid means (per my simplification):
given 2 digits, it's valid if (A * 1 + b * 0) mod 5 == 0
So, (5, 0) is val... |
This is a follow-up from here. I have a further optimization for space complexity by store only direction status data for one row for each directions (refer to variable stats). Any advice on algorithm time complexity improvement, code bugs or code style advice is highly appreciated.
Problem:
For a given board, judge w... |
I am concatenating columns of a Python Pandas Dataframe and want to improve the speed of my code.
My data has the following structure:
Apple Pear Cherry
1 2 3
4 5 NaN
7 8 9
I only want to concatenate the contents of the Cherry column if there is actually v... |
This is a problem from exercism.io. View the repo here (contains full example of song).
Problem statement:
Generate the lyrics of the song 'I Know an Old Lady Who Swallowed a Fly'.
While you could copy/paste the lyrics,
or read them from a file, this problem is much more
interesting if you approach it algorithmically.... |
I have a problem with my interface-design. I especially ask for help with the overloaded compute-Method.
For a calculator I work with these Interfaces:
public interface ICalculator{
public double compute(String expression) throws IllegalArgumentException;
}
public interface IParameterizedCalculator extends ICalcul... |
I just start to learn OOP, and it's far more interesting than procedural style.
I have a complete working online store written in procedural style. After realizing that my code is becoming very huge and very complex, I'm searching for methods to make my code more maintainable and more comfortable. One solution of cour... |
I wrote this brainfuck interpreter in C++ using interpreter and composite patterns. I would like to make this code more scalable.
Indeed, if we need to add a extra command, we'll have to add a new class derived from AbstractExpression but we may also need to modify some initialization in the constructor CompositeExpres... |
I'm starting with new project where there will be used to delete product using AJAX, but sometimes with normal request. What do you think about this view? I'm trying to make it as universal as possible.
@login_required
@require_POST
def delete_products(request):
products_ids = request.POST.getlist('products_ids')
... |
I want to build a function that, given an area size (target), returns a list of three lengths. The last item of the list (my_list[-1]) corresponds to the square plate.
The first two lengths in the list correspond to an orthogonal plate whose length is approximately 1.5 times larger than the one of the square plate and... |
I have the following model in models.py:
class Question(models.Model):
title = models.CharField(max_length=100)
slug = models.SlugField(max_length=100, db_index=True, unique=True)
for which i use a generic view:
class QuestionCreate(generic.CreateView):
model = Question
fields = ['title', 'text']
d... |
I have a below class in which add method will be called by multiple threads to populate messageByChannelReference concurrent hash map in a thread safe way.
For each Channel, I will have list of Message object and I want to process all these channels in parallel. And that is why I am using thread safe data structures Co... |
I have made an attempt to make a single player mode for the Tic-Tac-Toe game. I am not sure if this is the right way to do it and wanted a second opinion.
// keeps track of all the valid positions.
bool validPos[10] = {false, true, true, true, true, true, true, true, true, true};
char user = 'O', computer = 'X';
i... |
I've been working on a simple MVC PHP framework on and off for the last nearly 12 months, so I thought that I'd put it out there.
The project began as a way to mentor and teach a junior (or a more junior than me) PHP developer, to show programming principles, OO methodologies and MVC-type file structures. The framework... |
My code has two main concerns
it seems unecessairly long
unable to use new each_with_object method without shadowing answer(variable)
How should I proceed to reduce my code and make my intention clearer?
require 'pp'
data = <<EOF
0 303567 3584 Write 0.000000
1 55590 3072 Wr... |
I have tried to make delete functionality with graphQL and php. I am using this library:
https://github.com/webonyx/graphql-php
It has examples, but it does not have mutations example. I tried to create mutation class on my own and it works ok.
The create and update looks ok, but delete looks non standard, but still wo... |
Is this the correct, most sane way to do variadic templates in C++?
All that this function does is to see if gate has a key, if it has, it adds it to a vector of values, if not, it default constructs an object in place.
This function belongs to a templated class called core_table where K is the key type and V the value... |
I am learning F# and implemented Conway's Game of Life as an exercise (There are also other implementations on CodeReview). I have tried to forget all my object-oriented background and practice "functional thinking".
Any feedback is welcome, especially related to alternative (more functional) solutions.
open System
[<... |
I was wondering if there was a better way to write this:
#Define Jquery Datatable
if $('#dtable').length
table = $('#dtable').DataTable()
#If job is created, make new row in Jquery datatables
if data.status == "Created" then (
count = 0
new_data = [
data.job_id
data.start_ip
data.end_ip
data.ilo_... |
I just want to train before interview. I googled concurrency interview questions and one of the question was write concurrent ready stack.
public interface ConcurrentStack<T> {
void put(T t) throws InterruptedException;
T poll() throws InterruptedException;
}
class BlockingConcurrentStack<T> implements Concur... |
#Get the service key and event id
for channel_sk in channel_sk_list:
auto_cur.execute(
"SELECT service_key, event_id, start_date_time, duration, prog_name, series_id "
"FROM autodb.ssr_events "
"WHERE (ca_details='FTA' OR ca_details='SUB') "
"AND service_key={} "
"AND reco... |
I've created my first basic API using Flask, that has the ability to create new tasks, delete tasks, update tasks, handles error pages, and has authentication required.
What I would like to know is if there are anyways to make this better, can I make the authentication a little more complicated? What did I do well? Wh... |
say that:
var stringToTest = "Hello i am walking"
And
var searchText = "Hello walking"
I have the following javascript function for filtering.
var searchSplit = searchText.split(" ");
var num_split = searchSplit.length;
var correctTested = 0;
searchSplit.forEach(function (testString) {
if (stringToTest.indexOf(te... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.