instruction
stringlengths
71
71.9k
I was trying to use the ES6 Promise with the "co" module to write the async code without callback. Though actual async call is neat and clean, I still have to add wrapper method to return Promise object which made it little bulky. Any feedback to improve this code quality will be appreciated. crud.js 'use strict'; cons...
Alright, so I've got this script which basically drains the thumbnails and streams from the twitch API/JSON. $(function() { var i=0; var twitchApi = "https://api.twitch.tv/kraken/streams"; var twitchData; $.getJSON(twitchApi, function(json) { twitchData = json.streams; setData() });...
The following code does three things: The filename is determined by the RawData class The reader and writer send data through a processing pipeline (Hopefully) makes changes and extensions easy Regarding (2), the processing pipeline consists of "processors", that can process and deprocess data. For example, if you r...
I would like to calculate the average for the same days (e.g. Monday, Tuesday, etc) in a selected period: $data = array( '2016-05-01' => 100, '2016-05-02' => 150, // monday '2016-05-03' => 5, '2016-05-04' => 5, '2016-05-05' => 25, '2016-05-06' => 25, '2016-05-07' => 25, '2016-05-08' => ...
While I'm not aiming for a drop-in replacement for AsyncTask, I would like a utility class that accomplishes some of the same goals. Considering the criticisms of AsyncTask, in many cases I just deferred responsibility to the user - if the work you're pushing to a background Thread needs to be aware of your Activity li...
While I can often understand the performance reasons behind using fixed-size arrays to store vertex, triangle and UV data, I've often found it annoying because it makes dynamically generating meshes somewhat difficult. In order to fix this, I've built a small helper class to make the process much easier. It currently o...
I'm trying to get an efficient algorithm to calculate the height of a tree in Python for large datasets. The code I have works for small datasets, but takes a long time for really large ones (100,000 items) so I'm trying to figure out ways to optimize it but am getting stuck. Sorry if it seems like a really newbie ques...
Below is a python script which scrapes specific google apps url for example https://play.google.com/store/apps/details?id=com.mojang.minecraftpe and save the developer email,application name and price in mysql database with database name "app_database" and inside table named "app_table". There are lot of data type conv...
Problem 8 on Project Euler which asks Find the thirteen adjacent digits in the 1000-digit number that have the greatest product. What is the product? This is my solution in Visual C#. class ProblemEight { static byte[] input = new byte[] { 7, 3, 1, 6, 7, 1, 7, 6, 5, 3, 1, 3, 3, 0, 6, 2, 4, 9, 1, 9, 2, 2,...
Write a multithreaded C++ application (executable) for Windows Platform. This program uses the two threads to read and process the input data and store it into an output file. Candidate is free to make it console or UI based Windows application. Detailed description Program should accept an input text file with...
I'm using the Spring Framework in my web application and I'm curious as to whether my controller implementations are good or not. I've used many Hashmaps to make a object that serves my purpose for grouping from list of objects as per provided date params The following is my controller method, I am curious as to its qu...
I want to extract a price for a single index fund, the price of which is available on dynamic web pages. Being new to this, my original idea was to download the single page of static HTML and get the price from that. How hard could it be? Inspired by an article on F# for fun and profit I imagined it would be easy. ...
I have a database table storing information about documents (MigrationMaster). There is another table with security information on these (DocumentSecurity). There are 4 steps I can see that I need to perform. I've listed them here with the average time (or range of times) I've recorded they take (you can also find them...
I wish to take an XHTML source document (e.g. demo.in.xhtml below) and add class attributes to every td element whose content is one of the following six strings: A1, A2, B1, B2, C1, or C2. The corresponding classes will be mytable-a1, mytable-a2, mytable-b1, mytable-b2, mytable-c1, mytable-c2. Any other td elements in...
I recently joined the website www.hackerrank.com for programming challenges, and one of them was a time conversion from 12 hour to 24 hour. Rather than using the Date class, I decided to write the code for it, and in the end I came up with this: String time = new Scanner(System.in).nextLine(); String suffix = time.subs...
I have the following code that displays a standard AdMob banner depending on whether the user has purchased an ad-free (banner-free) non-consumable In-App Purchase or not (i.e. If purchased, no banners) UITableViewController - static cells (1 section, X no of rows): import UIKit import GoogleMobileAds class WorkoutFor...
Problem: Write a program that, given a word, computes the scrabble score for that word. Code: import java.util.regex.Pattern; import java.util.Optional; import java.util.Map; import java.util.HashMap; public class Scrabble { private static final Pattern WHITE_SPACE = Pattern.compile("\\s+"); private static fi...
I am working on a monthly billing application that utilises a rate band pricing mechanism to reward increasing consumption within a designated billing period. For example: Say I have the following rates bands: Minimum Quantity | Price --------------------------- 10 1 20 0.5 50 ...
I have a list X containg the data performed by different users N so the the number of the user is i=0,1,....,N-1. Each entry Xi has a different length. I want to normalize the value of each user Xi over the global dataset X. This is what I am doing. First of all I create a 1D list containing all the data, so: tmp = lis...
This is a Tic Tac Toe game in Java in preparation for my seconds personal project (chess game). I'm having a little problem though and am thinking that my for loop to create those buttons is a mistake. I believe I should instantiate all 9 JButtons implicitly instead of using a for loop because then I know for sure I wi...
Here is a REPL of the code. The idea here is to learn how the basic insertion sort algorithm works rather than to use existing sort libraries. How can it be clearer and more efficient? function insertionSort(array) { for(var i = 1; i < array.length; ++i) { var currentItem = array[i]; for(var j ...
Revision #1 for Simple spinlock for C using ASM The code: static inline void atomic_open(volatile int *gate) { asm volatile ( "jmp check\n" // Renegade selected, lets skip the line! "wait:\n" // Honest citizens wait in line. "pause\n" // ...
I have built the following application which searches Flickr API and returns photos. I am presenting the code: index.html <html ng-app="myapp"> <head> <meta charset="UTF-8" /> <title>F1000 coding challenge</title> <script src="https://code.angularjs.org/1.5.3/angular.min.js"></script> <link rel="stylesheet" typ...
Project Euler problem 54 asks: The file, poker.txt, contains one-thousand random hands dealt to two players. Each line of the file contains ten cards (separated by a single space): the first five are Player 1's cards and the last five are Player 2's cards. You can assume that all hands are valid (no invalid characters...
Whenever I try a new language I always try to write a speed-distance-time calculator as well as possible. I did this with C++ a while ago now. This is a similar question but this time in Rust. The program calculates speed, distance or time from the other two variables in the equation and the idea is to try to do this w...
I found this old piece of code that I wrote while I was learning C a while back: #include <stdio.h> #include <stdlib.h> #include <math.h> int main(int argc, char *argv[]) { if (argc < 2) { fprintf(stderr, "Usage: %s <N>\n", argv[0]); return 1; } size_t limit = strtoul(argv[1], (char **) N...
I was asked to find all the numbers that added up to 100 with no duplicates in Ruby. I float between Python, GoLang, and Ruby in a day. I am always concerned if I am doing something in the most optimal way. require 'pp' sumdata = [ 95, 5, 95, 5 ] def find_sum(data) result = [] processed = [] data.each_with_inde...
I've written these 2 methods and I'm wondering if the 2nd method, which uses yield is more efficient or if I'm using yield wrong. Can someone refactor the 2nd method to make it more efficient for reading system os calls with large output? def exec_cmd(command): proc = subprocess.Popen(command, ...
I'm learning regular expression as part of my Java course. Now I know sometimes the best use of regex is to not use regex at all. But since I have to use it for this course and learn it, I figure I might as well learn it properly. I am matching (##/##) or (##) where # is a number 0-9. All white space is ignored (except...
I'm really concerned about my transaction with a database and my code structure. I have created more methods to insert, update, delete data to the database but sometimes some of them will break or miss. That's why I try to use Laravel transaction and PHP catch and throw exceptions to rollback and avoid any errors happe...
Was playing around tonight and thought this problem was interesting enough to post here. Given a 2D array of digits, try to find the location of a given 2D pattern of digits. Input Format The first line contains an integer, T, which is the number of test cases. T test cases follow, each having a structure as descr...
I just started learning C++, and this is one of my projects. It's just a simple 2-player (No AI) TicTacToe game that runs from the console. The project was to familiarize myself with arrays, so review on how I used arrays is mostly what I'm looking for, but any other advice is greatly appreciated. #include <iostream> u...
DIVSUM - Divisor Summation #number-theory Given a natural number n (1 <= n <= 500000), please output the summation of all its proper divisors. Definition: A proper divisor of a natural number is the divisor that is strictly less than the number. e.g. number 20 has 5 proper divisors: 1, 2, 4, 5, 10, and the divisor...
This code works so far and it is a TicTacToe game (Personal Project of Mine). I'm kinda new to programming. My question is I really do not like how the Connected method is at all, because well it's fairly large for no reason. Is there a way to make it more compact because I have to add the middle and bottom row then do...
I am trying to fetch weather data from the OpenWeatherMap API. The responded JSON will be deserialized into a object which has the same structure of the JSON, then we need to transform this object into another class to meet our needs. Following is the class which the JSON returned by OpenWeatherMap will be deserialized...
It is the case where data contains some field indicating what type of strategy should be picked. I mean, I often ignore solving the problem like shown below and duplicate the problems that strategy pattern is out to solve in the first place. Is there a pattern for it or is it not viable at all in this case? Recent exam...
I'm creating a counter picker for a game called League of Legends, and for this I need to compare effects of abilities, which each champion has. For this I'm using 4 lists of champions, the returnList, the banned champion list, the enemy champions list, annd the allied champion lists. However, seeing that the returnli...
results is a list of dict having panel name and work type and price to do that work on that panel. There can be two dicts for same name and work type where one of them is on car model level and another is on car type level. In such cases we would give preference to car model level dict. output is the group of panels an...
I have a winforms app and I've been using the following approach to update controls on the main form from worker threads: GamepadManager class has: public static event EventHandler OnGamepadConnected; Main app class has: GamepadManager.OnGamepadConnected += OnGamepadConnected; private void OnGamepadConnected() { I...
When trying to follow single responsibility principle, I often find myself in a position where there is so much to do that I do not know where to start. Maybe there is there a rule of thumb that I could use? A concrete example originating from my test project. // doing way too many things public InvoiceDto Get...
The aim is to have that: list ["Hello", "World", "in", "a", "frame"] And make it printed like this: ********* * Hello * * World * * in * * a * * frame * ********* I did this and it works fine: a = 0 for nb in listA: if a == 0: print("*"*10).center(20) a += 1 if len(nb) == 2: prin...
I am starting out in Haskell and thought I would try to make a function that got the index (nth) from the end of the list. So getNthFromEnd 5 [1..10] would equal 5 The code I have so far is getNthFromEnd :: Int -> [a] -> a getNthFromEnd _ [] = error "Empty list given" getNthFromEnd nth list | listLength < nth = err...
Project Euler problem 9 says: A Pythagorean triplet is a set of three natural numbers, \$a < b < c\$, for which, $$a^2 + b^2 = c^2$$ For example, \$3^2 + 4^2 = 9 + 16 = 25 = 5^2\$. There exists exactly one Pythagorean triplet for which \$a + b + c = 1000\$. Find the product \$abc\$. My code finds the correct solu...
Is there a simple way to DRY this jQuery code? $('ul.icons li.size').click(function() { $('ul.icons li.size').not(this).removeClass('selected'); $(this).toggleClass('selected'); }); $('ul.icons li.color').click(function() { $('ul.icons li.color').not(this).removeClass('selected'); $(this).toggleC...
Here are 2 functions defined that do the exactly same thing: take input a template (in which one wants to replace some substrings) and array of strings values (key value pair to replace, such as [subStrToReplace1,value1,subStrToReplace1,value2,.....]) and returns the replaced String. In second function I am iterating o...
I am creating a tile based game in Unity and ran into a problem with my architecture of the Map and Tile types. The tile class contains logic like events when the tile type changes. When I tried to save the type to disk those events were being serialized as well, which I don't want (causing several problems in Unity). ...
I want to be sure that my code below properly secures the website based on all of the information provided. Login System Overview When a user logs in, the following user info is saved to a persistent cookie: User Id (Primary Key) First Name Last Name User Role Login Token (randomly generated guid value) Valid (bool - ...
I have 7 source files that I am searching and cross-referencing. I have tried a few different methods inside Excel (cell-by-cell iteration, dictionary), and found select statements as recordsets to be the fastest thus far. Unfortunately, it still takes around 5 seconds for my code to search 4 of the files for all inst...
I'm just learning C# and wrote a little program to check if a word contains vowels. It's fairly simple and not to exciting but I would like to know if there's easier ways to do this: using System; namespace check_vowels { class Program { static void Main(string[] args) { string word...
I am currently learning JavaScript and the project I have been working on is creating a basic Blackjack game. Some code was provided for me, with the additional instructions: "How would you edit the above code to PRINT what you and the Dealer have? How would you edit the code to let you know if you beat the dealer or n...
Problem Statement: Write a function to convert from normal numbers to Roman Numerals: e.g. 1 => I 10 => X 7 => VII Code: import java.util.HashMap; import java.util.Map; import java.util.NavigableMap; import java.util.TreeMap; public class RomanNumeral { private final int number; private static final Map<...
Given a number between 1 and 7, this will display which day of the week corresponds to that number, starting with Monday. This is pretty simple and pretty easy, but it seems that there would be a much better way to do this, where I wouldn't have to write out each day of the week, and possibly iterate through an array.....
I am currently building my first game/app in javascript. It is a very simple script that has about 130~ lines of code. I feel like what I did so far is not optimized, can anyone please help me optimize the code also, can you please explain your changes? How the game works: At the start of the game every player gets 20 ...
I'm practicing my JavaScript skills by trying to create a Pokemon game. So far, I've made the dataset and the functions required to work the game. Can someone help me optimize the code and tell me why they made that change? function pokemon(name, hp, critical_attack, lowest_attack, highest_attack) { this.name = nam...
I have implemented the LEB128 encoding for unsigned integers. I'm fairly new to Haskell so I have some doubt about the coding style I'm using, particularly the definition of byte and then 2 lines later byte': import Data.Bits import Data.Word uleb128 :: Integer -> [Word8] uleb128 0 = [] uleb128 n = let byte = (fromI...
The code currently works as it should and seems to work dynamically as I need it to but I am pretty new to Excel so I think there is probably a better way to do some of the things I have set up. I also would like to make the code a bit prettier. '************************************************************************...
I have not had any experience with coding before, and after beginning to learn I stated working on this calculator which runs different functions on the console. I'd like to hopefully be taught what I could have done differently or easier. { class MainClass { public static void Main (string[] args) ...
Can you help me verify my test result? I'm testing different malloc() implementations with a small program that allocates gigabytes many times: int main(int agrc, char **argv) { int i; for (i = 0; i < 1000000; i++) { void *p = malloc(1024 * 1024 * 1024); free(p); } return (0); } If I ru...
Looking for feedback on any bad practices and general advice on how I might better structure my code. $(function() { // Load song on page load var song = new Audio('./songs/DJ Snake - Middle (Bad Royale Remix).mp3'); song.load(); // Update song duration display song.addEventListener('timeupdate', f...
Project Euler #15 is to find out all the distinct possible ways there are to move from the first point (1,1) to point (n,n) in an n*n lattice. def lattice_paths_of_n(n): list2 = [] my_list = [] for i in range(1, n+2): list2.append(i) for i in range(1, n+2): my_list.append(list2) for ...
My program is supposed to sort a stack such that the smallest item are on the top. I can use a temporary stack, but you may not copy the elements into any other data structure. The program works overall, but I was wondering if there is anything that I can do to make it more efficient/better. import java.util.Stack; pu...
I have been tinkering with generic methods in Java but still haven't figured out a way to optimize this code. Here I need to write similar piece of code for both plan and add-on. public Set<SubscriptionDto> getCustomerSubscriptions(Integer customerId) { Set<SubscriptionDto> subscribedProducts = new HashSet<>(); ...
I have to make a program which creates a number of threads that are waiting at the beginning, then the main process creates a doubly linked list where random numbers are put and then a signal tells the threads that a number has been put in the list, then the threads should "process" these numbers (is simply calculate t...
I am trying to estimate a good approximation for the arclength of the curve \$ y = \sqrt{1-x^2}\$ for \$x \in [0, 1]\$. I did this using a Bezièr curve, and made it so that the area under the two curves are alike. In order to estimate the error I want to calculate the differences in arclength. The arclength of a quarte...
I'm writing a C# WPF project built with a MVVM pattern. This software is written to use a medical diagnostic device, so in our planning it will be certified IEC 62304. Since I've been mainly writing only C++ software for the last few years, I don't have much exeperience with C# programming. So I would like to receive a...
As part of my own C++11 learning exercise I have implemented this Blocking Queue using the new C++11 thread API. One of the aspects I would like to improve is efficiency i.e. in the take member function while returning the Job template type to be returned by reference instead of by value. /* * blockingqueue.h * * C...
I just started learning Haskell and this is my first big project (ie not factorials, fibonacci or graphers). This is kind of a gift for somebody so the language is a bit different. The program works, but I felt that some parts of the code could be improved, specifically: Is Vector the best choice for representing curr...
I am making a responsive horizontal scroll UI. The horizontal scroll position is calculated according to the mouse horizontal position: $(document).ready(function() { var docWidth = $('body').width(), slidesWidth = $('#imgs').width(), rangeX = slidesWidth - docWidth, $images = $('#imgs'); $(window).o...
I was trying to write a code from scratch for Chi-square test.This is the code that I had written in python using pandas.I had a doubt whether the code can produce the desired output or can be written in a more compacted way. import pandas as pd from scipy import chisqprob from scipy import stats def chi_square_of_df_...
I am trying to write industry standard code. https://www.quora.com/How-do-I-follow-a-user-on-Spoj-for-solving-problems-Refer-Details Someone gave me this A2A. And I wrote this code for it //compile with g++ -std=c++11 #include <bits/stdc++.h> using namespace std; struct PROBLEM { string name; string links; ...
I'm trying to transition myself from my old coding-style (if-else, for.. in) to functional programming. I've tried to update the following code: Old class test { childrenCount(group) { let childCount = 0; let excluded = ['html']; let iterable = group.children || group; for (let key ...
I've written a "simple" interpreter for a programming language in Python, called Tellurium (named after the element of the same name). So far, it's working pretty well, but there are some things I'd like to fix/remove. Tellurium is a tape-based language, so it uses a tape to store data. import string, sys, random, time...
It's using four sections of code block, I just want it to be reduced to one contiguous set that does either a or b with the two sections not a copy/pasted approach as done here: public function process_bulk_action() { //Detect when a bulk action is being triggered... if ( 'delete' === $this->current_action(...
It chooses for each chunk some points inside that chunk that work as the center of each island. Then for each tile on the map it calculates the distance from the points in the 9 chunks around the tile's chunk and subtracts the value from a Perlin noise (as described here). The "problem" came when trying to reduce the t...
Sometime ago I asked a question regarding a slow Filtering method for my DataGrid. Months later and I have a relatively quick method, though I am still looking to improve performance, especially when the user is deleting text from the SearchBox as this seems to slow down more than if the user is typing characters in. O...
I realized I had just created two classes that were virtually identical for simply saving objects to their own json files, so I've attempted to make it more generic. My only noticeable problem is because I am using gson to serialize / deserialize, that requires an explicit class type, which gets squashed if I use the g...
Below is my implementation of a generic linked list in swift. Unfortunately, Swift playgrounds won't run until the compiler is totally happy - often, that involves clang making me explicitly unwrap some optionals. I just want a general idea of how to restructure my code to avoid unwrapping optionals and to make more us...
I recently started Learning COBOL from Lynda and this is my code for the first challenge . The Objective is that the user will provide the radius and we have to calculate the Circumference and the area of the circle and then display it. Here is the Code. IDENTIFICATION DIVISION. PROGRAM-ID. CIRCUMFERENCE AS "...
The following Macro sorts through a worksheet, copying and removing lines based on what appears in column A. If ("A" & i) is not a number, it triggers and moves the data to the appropriate place. The script at the moment is very slow, however. Is there an easier way to achieve this? Sub FixAbstracts() Application.Scree...
Recently, I encountered this coding exercise on codility and the idea is A zero-indexed array A consisting of N integers is given. Rotation of the array means that each element is shifted right by one index, and the last element of the array is also moved to the first place. For example, the rotation of array A = [3, ...
I'm learning Clojure, and decided to write a Conway's Game of Life clone as my starting project. I ended up dicking around for a bit before diving in, and came up with a few functions that I'd like looked over. Mainly, I'm concerned about writing them more concisely and idiomatically. I'm planning on using a 1D vector...
I am learning Ruby and would like to know how I am doing as far as writing the actual code. Please keep in mind that this is my first Ruby script program, but I am trying to learn ruby in a very short period of time. I would like to know about nitpicks in the language that every Ruby writer should now, nuances in syn...
Problem Statement: Write a program that will convert a binary number, represented as a string (e.g. '101010'), to its decimal equivalent using first principles Implement binary to decimal conversion. Given a binary input string, your program should produce a decimal output. The program should handle invalid in...
This is code which must run on XP, so no GetTickCount64, and which should correctly handle the value wrapping around after 49 days. Can it be improved? // DWORD timeoutMs is a given parameter. DWORD beginMs = (timeoutMs == INFINITE ? 0 : ::GetTickCount()); DWORD endMs = beginMs + timeoutMs; // unsigned arithmethic is ...
JSON is quickly becoming the formatting standard of choice for quick, convenient, and reliable machine to machine communications. It is flexible and widely supported but it has some drawbacks when it comes to data payloads like those from databases. A JSON payload from a database table named fruits might look like this...
I've created a simple little file archiver that will run through a given directory and extract your files into an archive folder. It's pretty cool if I do so say myself, I would like some critique on what I've done, and some ideas on how I could better this program, better syntax, easier ways to do this, etc.. using Sy...
The problem: You are given a list of cities. Each direct connection between two cities has its transportation cost (an integer bigger than 0). The goal is to find the paths of minimum cost between pairs of cities. Assume that the cost of each path (which is the sum of costs of all direct connections belonging to this ...
I am refactoring a legacy codebase to use spring. I am newish to spring and was wondering if you have any suggestions for the following code I refactored. Specifically about providing the ExpeditionEntitiesService. Here is a REST service which uploads a file: public class myRestService { @POST public Response...
I have the following code where I need to execute 2 Linq-to-SQL statements. If I do not have the Any() in the if statement, then I receive error when the result is no data. However, I am not sure if my approach is efficient enough. Do you have any suggestions? My goal is to achieve the following with single Linq statem...
I've made two symmetric methods which serialize an int array of any number of dimensions into an OutputStream, and read such an array from an InputStream. I was wondering if there is ways this code could be improved. (I have tested this code and it works correctly.) Thanks! import java.io.ByteArrayInputStream; import j...
I'm creating a game and I need some properties to work as percent chance to hit/dodge. I implemented a small testing program that takes percent chance and the amount of hitting attempts as input and outputs the successful hits, failed hits, and overall success rate. My game will have decimal percents (1.5, 54.8..) The ...
I have coded a program to scrape YouTube data (for educational purposes). When the link of the channel is entered it scrapes the channel name, description of the channel, the videos posted by the channel, number of views and links to those videos. But I hardly managed to make these things work. I am not sure it is the ...
I made a small script for Unity3D, meant to be use as GameComponent for GameObjects. It is supposed to represent values that have a max value, and an actual value. In games that would be the case, for instance, for the Health Points, the Stamina, Magic Points and so on. I would love to hear your feedback. /////////////...
My history of C/ASM locks here in codereview: Simple spinlock for C using ASM Simple spinlock for C using ASM, revision #1 (basis for this approach. If this one fails, then so will the one below.) Once you have gotten taste of assembly, there is no turning back. I don't care if I am not ready/worthy, I going to step...
I am currently working on my YR9 (I'm 14) IST web development project and I want to know some tricks for optimizing my website. I know that I shouldn't have the same CSS rules in the style tag on every page (something I will fix), but my JavaScript seems to have a slow response on the "gallery" page. http://htmlforscho...
Considering the lack of general purpose library to manipulate trees (not to mention zipper ones), I may end up packaging this piece of code, so I would like it to be reviewed first. Any comment is welcome, notably on the following points: the use of Map within the Tree data type (e.g. versus HashMap or bare lists) the...
I'm trying to make a small shooter game, where you can only see a small portion of the map around you. The map will also be much larger then the actual JPanel (The panel is 1000 by 1000, the map currently is 5000 by 5000). When I added movement, the game seemed to lag slightly, mainly noticeable in the graphics flicker...
This is part 2 of the game I am building. After some good feedback on my first post I decided it was time to post my updated code. The differences in this part are: Updated code after feedback, new dodge mechanic and better formatted code. What I am looking for are: performance feedback, code style feedback, things I c...
I need to use elasticsearch in my node.js project, whose API looks like the following: var elasticsearch = require('elasticsearch'); return new elasticsearch.Client({ host: 'localhost:9200', log: 'trace' })); However, my elasticsearch host is stored in zookeeper, so I first need to fetch it before returning the cl...
I have tried to implement a smart copy in C# for Windows CE, my version is somehow not performing better that the File.Copy method it's almost the same performance. Is there a way to make it more efficient? public class SmartCopy : IDisposable { private List<CopyEntry> _entries = new List<CopyEntry>(); ...