instruction
stringlengths
71
95.1k
I'm still working on a parser that can parse log entries from a game called HearthStone, the overall idea is that it will read the log file live when the game is running, parses the log file and show interesting and useful data in real time. The focus for this question is to load the card data from JSON files, as can b...
I'm creating a simple function to verify whether or not a string is a palindrome, and must use stacks in solving it. bool isPalindrome(string word) { // #1 determine length int n = word.size(); // #3 make sure we have an even string if (n % 2 != 0) word.erase(0, 1); // #2 load the stac...
The code I have now is currently working, but I'm looking for ways to optimize it, and really, to just get any feedback. I'm implementing this code through Ensighten (a tag management platform) as a custom javascript tag. Ensighten works by injecting tags either sync or async scripts on to a page. I've set this tag to ...
I've created a program which recreates the Queen Ann's Lace fractal. However, when the amount of points that are being plotted increases, the points are plotted way slower. Is there any way to make it so that I only add a point, instead of adding a point and repainting all of the others? I've looked everywhere for an a...
In my answer to this question, I wrote a new solution. Personally, I would not use a stack, but given that a stack was required, how good is this solution? In this solution, I add half of the word, not including the middle character if applicable, to the stack and remove it from the string. If there is a middle chara...
I have created a space encoder program, because it is fun to generate invisible messages. (This programme is not cryptographically secure, it is just for fun) import doctest def to_spaces(text): """ Each char with ASCII code x gets converted to a line of x spaces. >>> to_spaces('a').count(' ') 97 ...
For my third assignment in CS2, I was given the following: A set is a special bag that does not allow duplicates. Specify each operation for a set of objects by stating its purpose, by describing its parameters, and by writing preconditions, postconditions, and a pseudocode version of its header. Then write a C+...
I am working on an interview question from Amazon Software. The particular question I am working on is "to write a program to find \$a^n\$." Here is my recursive solution to this problem (in Java): int pow(int a, int n) { if(n == 0) { return 1; } else { return a * pow(a, n -1 ); } ...
I've created some methods to help me convert PDF to text and then text to a JSON object. I've never done this before and I'm using this exercise as a way to improve my knowledge of Ruby. The following code does what I want, it works. It just returns a very ugly object. Right now I'm trying to craft some regular expres...
I am new to programming and want to know if this is really bad code. I know my variable names may seem arbitrary but I spent some time trying to get them right. I am struggling on that. Would you do this the same way? #include <stdio.h> #define MAXLINE 100 void printHistogramHorizontally(int alphabetofline[]); int ma...
This is a very lengthy class called Particle, it relies on two other headers, one of them is a simple struct which contains an x and y (Vector2), and the other header gets a material's properties (materialProperties.h). The class is no where near done, and I am struggling to get my collision detection function to work....
This code fragment from 2009: #include "../asklib.hxx" std::vector<AskBase*> questions; AskUI<std::vector<AskBase*> > ui(questions); ui.add(new Ask<std::string>("Enter your name: ", 3, 25)); ui.add(new Ask<std::string>("Enter your city: ", 2, 25)); ui.add(new Ask<std::string>("Enter your state: ", 2, 2)); ui.add(new As...
I was creating a program and I was trying to explain it to some of my coding friends. They commented that it was too tedious typing out all the "if" commands. How do I streamline this code? Note: this is a ".bat" program. Waiter.bat @echo off set /p Food="What would you like to eat? " if /i %Food%==pizza findstr "Pizza...
I did a few times ago what I called a plasma in plain JavaScript: jsFiddle The idea is to use 2 oscillators (LFO) which have their frequency + phase driven by two oscillators each. Then we use those 2 main oscillator output to decide of the r, g, b of each point. To test the quite new API asm.js, I've ported it to be ...
I'm working on graph mining, so I'm trying to find the best library to do that. I've read in here that "graph-tool" is faster, so I tried the same program who count the duplicated graphs (I call them frequent in the program) in networkx and graph-tool. The graph are in this .txt file: t # 0 v 0 0 v 1 3 v 2 9 e 2 1 68 ...
I was asked to code a solution in Python in 15 mins. Print all possible word combinations for a given phone number. Numbers 0 and 1 will not be part of the phone number, the numbers can be repeated, phone numbers can be of any length. For example if the number is 245: All combinations of 'ABC', 'GHI' and 'JKL" is: ['AG...
Following some great advice here from Simon, I realized that I had over-engineered things, and that the Task builder methods were a horrible Java8 abstraxction. In Simon's words: "From a usability perspective, this is a bit weird...". After messing with things a bit more, the original use-case like: uBench.addTask(Tas...
Here's an implementation of Hangman using Java 6. I've split the code into 2 classes - a logic class & a gui class. Is it ok to have so many static member variables? Please let me know if there are any design improvements that I could make. Hangman logic - main class import java.awt.*; import java.io.*; imp...
Before I get started, I feel I need to list the following. I am not looking for an existing DI or Framework this is a personal project to shift from procedural to oop programming. Tear this apart. I am trying to learn the latest best practices i do not want to be stuck creating broken code for future builds/projects....
Given points on a two dimensional graph, find a line that passes the most number of points. Any comments please? import static org.junit.Assert.*; import java.util.*; import org.junit.*; public class Solution { public class Point { double x_coord; double y_coord; public Point(double x, double y) { ...
I am using jQuery UI Tabs for a web application and I would like to navigate thru different tabs with these four buttons: next-tab: takes you to the next tab prev-tab: takes you to the previous tab preview-btn: takes you to the preview tab (a specific tab or the last tab) back-btn: takes you to the last active tab fro...
Release 1.1 of Rubberduck only had a handful of implemented code inspections, more as a proof of concept than anything else. For release 1.2, we now have 19 implementations of our IInspection interface - here is what happens when the user clicks the refresh button on the Code Inspections toolwindow: private void Refre...
I've been asked to create a bubble sort function that checks whether the array has been filled sorted before all passes are complete, thereby avoiding unnecessary passes. This is to involve "remembering" the last sort. Below is the code I have for just a normal bubble sort that goes through all passes, and is quite in...
I have started a project in PHP with PDO and I'm almost done, but I've read somewhere that PDO escape alone is not secure and we have to consider some settings of PDP. I am a little confused about my PDO class and usage. public function __construct(){ //set DNS $dns = 'mysql:host=' . $this->host . ';dbname=' . ...
It is meant to be given strings over time and output all NewLine delimited substrings. The ColumnReader is meant to be a solution for Delimiter-separated-value files, like CSV or TSV. using System; namespace fbstj { public sealed class LineReader { public string NewLine { get; set; } string _b...
I'm working on a tool to import data from one database to another. One requirement is that I have to split a string from one source field into three (shorter) fields at the target. If possible the string should be split at a space character. If the string doesn't fit completely into the target fields, the rest can be o...
Given a string, this code Multiplies odd numbers Subtracts even numbers, do nothing if only one even number is found Turns uppercase letters to lowercase and vice versa I think this code is too long for those operations. There are certainly better ways of doing this. How can I make this shorter, better and faster? An...
I am trying to learn DFS and BFS. However, I just want to make sure that I am not doing anything wrong. Would you please determine if the BFS and DFS functions are correct? #include <iostream> #include <vector> #include <queue> #include <stack> using namespace std; class Graph { private: int num_of_vertices; v...
I've recently been fiddling around with a type safe implementation of cartesian co-ordinates (and a few operations on those co-ordinates). Often it's easy to get units mixed up: is something in metres, or in some other unit? The idea for this code is to provide a framework to catch all such errors at compile time. This...
I'm working on a small custom backend app in PHP for personal use (and practice MVC) and I thought it was a nice opportunity to try (and learn) requirejs to 'organize' my scripts and load just what the page needs. I wrote some lines just to test its functionality, and works pretty well... but I've been wondering if thi...
The branches I need to merge are called test and test-passed. Merging will always be fast-forward, from test to test-passed as commits to test-passed are only done automatically from test. This is currently working, just wondering if the approach is correct. The script is executed by Hudson, once all testing is complet...
The following pascal function (compiled with Delphi) will split strings. It works perfectly, but how to improve the code? For example, to avoid using the repeat-until loop. type TSarray = array of string; function Split(Texto, Delimitador: string): TSarray; var o: integer; PosDel: integer; Aux: string; begin...
I have a component that I want to render with certain styling based upon the props that it will receive. I'm currently defaulting the prop types, and then creating the styling at render as such: getDefaultProps: function(){ return{ size: "small", shape: "rounded" }; }, statics : { function getShape(shap...
I have created this unit containing a class derived from TXmlIniFile. This class uses the common TCustomInifile methods to write to and read from an XML file. It comes from an idea of Chris Rolliston from his book "Delphi XE2 Foundations" (which I warmly recommend): unit PAXMLIniFile; interface uses System.SysUtils...
It works, but it seems a bit long winded. I'd like some critiquing. #include <stdio.h> #include <stdlib.h> struct node { int data; struct node * previous; struct node * next; }; struct linked_list { struct node * first; struct node * last; }; struct linked_list * init_list(struct node * node) { struct l...
The code reads an input with numbers and find the sum with the minimum difference of the first two big numbers. The sums are three. Is there is any way to make the code cleaner? (Note that I don't need to take any restrictions such as NULL parameters, etc) Moreover, there is an int in my program pA = -1 with that value...
I want to write a library to parse any valid or invalid HTML-like things. First of all, I am trying to build a lexer. Here is what I did; /* A html lexer */ #include <stdio.h> #include <stdlib.h> #include <assert.h> void *memcpy(void *, const void *, size_t); #define TOUPPER ('a' - 'A') /* This lexer is UTF unaw...
My goal is to find the sum of the exponents of the prime factors of an integer. I wrote the code below with the complexities specified here (I am not 100% sure of the complexities though): Runtime complexity: findPrimesSmaller: \$O(n \log(\log n))\$ exponentInDecomposition: \$O(n)\$ primeExponentsCount: \$O(n^2 \log(...
I am writing a method to create a folder tree. I am getting the data from a database and creating the list of nodes. Is there a way to get the method to execute quicker? Perhaps using parallel task library? Each node looks like this: public class Node : INode { public int Id { get; set; } public int? ParentId {...
I'm a very inexperienced VBA user, I've just created my first "For Each" loop but it's very slow. I'm happy that it works but eager to know if there is a alternative method that is quicker. Any advice would be appreciated but please bear in mind my inexperience! My routine takes two variables "UserSelectionMin" and "...
I'm trying to write clean code, but I'm not so good with exception handling. How can I improve this method? Or is it good enough already? This method gets a hash from a file. public String getLatestHash() { String hash = "none"; URL packURL = null; try { packURL = new URL(ConfigManager.get("play_ur...
I have a section of code that I've been attempting to clean up and hopefully speed up. The section of code where I pass values in order to generate a key and update a table on a different sheet I think is my biggest problem. However I would like any suggestions/modifications to clean this section up first. An overview ...
I wrote a small program that collects the server status, caches it for a certain amount of seconds, and then sends that to a mothership server. It's broken down into a few pieces, starting with main.py, config.json, and a few small 'libs' to keep things visually separate: main.py #!/usr/bin/python import os import sys ...
I have something like a generic build script for a group of projects. I am using Fake but my F# skills are pretty bad. Would you please take a look and point where I can improve it? ORIGINAL #I @"./bin/tools/FAKE/tools/" #r @"./bin/tools/FAKE/tools/FakeLib.dll" open System open System.IO open Fake open Fake.Git open F...
This is my first open source release and I'd like to get some feedback on my code styling/organization. Implementation tips are appreciated as well. The code is for an AngularJS select box that allows you to select from a list of values, or enter in free text. The control can be configured to: compare against an attr...
I am currently taking a computer science class in high school, and it is my first time programming (2 weeks since I started). I have currently finished my program; however, there were a few details that bothered me. I was supposed to create a program which can calculate average of individual marks and then calculate al...
I have created a simple Pseudo "Sieve of Eratosthenes," for a class in Java. I am looking for the most optimized option, or at least an option that is more optimized than current. If there is any other advice that you have to offer, I would be more than happy to hear that as well. import java.util.*; public class Siev...
I wrote the following implementation of a Vector in Java. I was wondering what you folks thought of it. package space; public class SpaceVector { private final double x; private final double y; private final double z; public SpaceVector(double x, double y, double z){ this.x = x; this....
I'm relatively new at programming in general including Python. But I've tried to create a program in Python that alerts users through a pop up window to perform an action every 2 hours. import time import ctypes count = 0 print "This break message was sent on "+time.ctime() messageBox = ctypes.windll.user32.MessageBo...
I have implemented the following in order to handle JS XHR requests coming from HTML pages. Is there a better way to do this with OWIN? public class Startup { public void Configuration(IAppBuilder app) { app.UseFileServer(new FileServerOptions { FileSystem = new PhysicalFileSystem(st...
I have the following table: <table> <tr class="rowUpdate"> <td>Corredor</td> <td>Id Corrdor <input type="text" value="dfdfgdf23231fg" class="validate" name="idcorreo" /> </td> <td>Nombre <input type="text" value="rertretert" class="validate" name="nombre" /> </td> <td>Email ...
I wanted to get some criticism for the below ADT. This is just a basic ADT that will be fed into a TVM calculator. Main purpose is to have it initialized and correct for input errors. Full disclosure: I am modeling it after Code Complete 2 guidelines. You should notice if statements stating nominal cases first followed...
I'm looking to optimize a simple sum calculator used in Project Euler+. The premise is simple: Find the sum of all the numbers divisible by 3 or 5 under X. At first I did it like so: def main(testCases): final_answer = [] for x in range(testCases): answer = 0 test = long(input()) for num...
I have a server which has a permanent state which has to be saved on stable storage. It is composed by three fields: List<LogEntry> log int currentTerm int votedFor They have to be set during the server setup (in other words, when the server object is created). Every time that I update their "volatile" value, the re...
I am generating a searchable and sortable data table using bootstrap. All works fine. I am looking for the best approach to get it. Can anyone can please update/suggest the right way, if you find anything better? jsfiddle var tableMaker = function (columNames, parent, data) { var table = $('<table />', { id...
I wrote a quick prefix tree implementation. I know it may be far from perfect, but I need to make sure that I got the basics right. My main concerns are: Have I settled for the correct data structures? Is this a scalable solution? What sort of problems can I run into if this is a huge tree? public class PrefixTree {...
My task is to write a program to store files in object store. One of the subtasks requires to send json or xml format response to the file uploader/downloader as requested by client. The following rules must be followed: entry +-------------------------+...
I working on a calendar app on Android, using roomaorama, which is nice. I am fetching all the events from Events table in Calendar provider once which seems not good performance wise. The library uses a infinite view pager. It uses 4 adapters to display dates. CaldroidGridAdapter adapter0 = getNewDatesGridAdapter( ...
In reply to previous question I rewrote ColumnReader and would like more suggestions using System; namespace R2D.IO { public sealed class LineReader { public string NewLine { get; set; } string _buffer = ""; public void Parse(string text) { _buffer += text; ...
I have this JSFiddle that generates a random number of progress bars then assigns a random number and percent to them. I am wondering if you know how to better optimize this code to have better run-time. /*Creates a random amount of bars*/ function runBars() { var start = new Date().getTime(); /*Sets the max...
I want to optimize my code for performance and fine-tuned logic. import java.util.ArrayList; import java.util.List; import java.util.Arrays; import java.util.Scanner; import java.util.Collections; import java.util.Comparator; /** * Created by ShrivasA on 1/30/2015. */ /* Take an Element and Apply the following condi...
I'm doing a program in Delphi, writing in all kinds of files, either text or executable: var openfile: TextFile; begin AssignFile(openfile, 'test.exe'); Append(openfile); WriteLn(openfile,'[test]hi world[test]'); CloseFile(openfile); end; How can I improve this?
I have this "generic" implementation of an array-based FIFO-queue. As I have written very little code in C, I don't have an idea what to ask, so feel free to tell anything that comes to mind. array_queue.h: #ifndef ARRAY_QUEUE_H #define ARRAY_QUEUE_H #ifdef __cplusplus extern "C" { #endif /**********************...
Below is a snippet of code of a little practice project. I am still pretty new to EF and I was wondering if there is a way to write the below statement so that all required data is eager loaded since I have the ID parameter. public ActionResult Index(int? id) { var viewModel = new InstructorIndexData ...
This program connects to Soundcloud and turns the supplied username into a CSV file with the user's like list. The code accomplishes this although it looks rather messy and was wondering what I could change to improve it. import soundcloud import urllib.request import json import requests client = soundcloud.Client(cl...
In the current project that I am working on, we are using dapper to query the database and sometime when mapping from dynamic types to concrete types we end up with a messy block of code. I created a folder called mappers and have created an Interface<T>, an abstract class inheriting from that interface and I have also...
I do HTML5 Video player with some controls. I have a button, where I change classname for make play, pause or replay button. I have a mute/unmute button, volume range slider, timer and fullscreen mode button. Maybe I can do some functions better or faster, and also, maybe I need to change comments? Logic: "use strict" ...
Looking for feedback on a set of templates I've just created. I'm planning on converting them to Yeoman but want to make sure they're ready for prime time before doing so. They are currently in CodeSmith Generator format. Their main goal is to generate the guts of a MongoDB / Mongoose / ExpressJS web service from SQL...
I am mainly trying to avoid the nested forEach statements and am trying to move towards a lazy evaluation type solution. jsFiddle var skus = [{ "id": 25175837, "giftOptions": 1, "rmsSkuId": 53750485, "available": 1, "backOrder": "", "channelId": 1, "photoGroupId": 0, "colorId": 19219...
I am a web developer, trying to have fun with C++11, so any positive/negative feedback is very welcome. This is a toy virtual machine with 3 registers and 3 commands: vm/vm.h #ifndef VM_H #define VM_H #include <iostream> #include <vector> #include "vtypes.h" namespace violet { class Vm { bool runnin...
Based on the solution provided in this question , I have written non-recursive Java code to find the path form to a given element in a binary tree. This code is working for all the elements except root. Is this the correct implementation of the algorithm provided? Please check and suggest the required changes for the...
I'm using WordPress ( PHP Based Platform ) and I'm trying to read an external XML File, convert it into a usable array, then compare two arrays - one from the xml file and another from an options database. I've coded it so that it does work but it just looks messy. I'm not sure if it's my naming conventions or how I'm ...
I have a method that load my walkthrough view. I have my view controller composed of a scroll view. And others views controllers used only for the walkthrough (maybe I should used xib uiview instead of uiviewcontroller). And when I'm on the viewWillAppear, I'm calling this method: /** Prepare dynamicly the walkthrough ...
My instincts are telling me a seasoned Scala programmer will find my code less than optimal. As will no doubt be obvious, I'm a Java guy who has just started in with Scala. Is there a more 'functional' way to accomplish this that I'm missing? /** * takes a file object and returns a string representing the fully qual...
# Comment: You can iterate through any number of Enumerables in lockstep e = { numbers: 1..10, letters: %w(a b c d e f g h i j), notes: %w(do re mi fa so la ti do), phonetic: %w(alpha bravo charlie delta echo), rainbow: %w(red orange yellow green blue indigo violet) } # Titles puts e.keys.map(&:c...
I am trying to create a class that takes a screenshot of the screen, makes it blurry and saves it to NSUserDefaults. - (UIImage*)blurImage { UIImage* newImage = [[UIImage screenshot] applyBlurWithRadius:20 blurType:BOXFILTER ...
I ported the Star Trek 1971 game to Clojure to help me learn more about the language and functional programming in general. You can see the entire game on Github. The game plays (you can start it with lein run). Instructions are i game or you can see the first link to get more details on the history or gameplay. While ...
I'm looking for some help on how I can optimize adding multiple data attribute tags to elements, and really, any feedback at all. Background Client uses a analytics tool through a tag management application (Ensighten) that picks-up data attributes when links are clicked. I'm adding attributes when the DOM is ready to ...
I've created the function below to get the SHA-1 of the repository used by my CI server. The hash is then used to update the pass/fail status of the commit on GitHub. I'm a python amateur. What stands out below? def get_sha(): root = os.environ["PWD"] repodir = os.listdir(root)[0] # /Library/Developer/Xcode...
I came up with the following solution for rotating an NxN matrix 90 degrees clockwise, to solve this CodeEval challenge: Input The first argument is a file that contains 2D N×N matrices (where 1 <= N <= 10), presented in a serialized form (starting from the upper-left element), one matrix per line. The elements of a m...
Here is some code I have written as a connect four negamax evaluation function. The state of the board is stored inside a class state. state.get() is \$O(1)\$, state.getBoard() is \$O(1)\$, and state.getWinnerColor() and state.getDraw() are also constant (although they have a higher constant coefficient). The real meat...
I have a method which extracts the logged-in user details from a SpringSecurityContext object. I have read that only utility methods (which does certain calculations) should be static. Here is my method; it doesn't seem to be a utility method but I don't find any reason why I shouldn't make it static as I am using it i...
I've implemented Game of Life in Python for a programming problem, in two different versions: one is a simple script and the other uses a class with a dictionary to initialize the various parameters. Here is the version with a class: # Object oriented implementaition of Conway's Game of life import random import time...
I've got a small tomcat web application that's used to receive customer data from an iPad app. After receiving those information they will be saved on a local MySQL database and then sent to an SAP system. I'm focusing on my "concept" of handling database connections since this is my first ever productive web app that ...
I have a problem where I need to find the second maximum element of the user inputs. It's an online practice problem and I can't figure out why the server responds back with a Non-Zero Exit Code error when I submit my code. The program produces right outputs every single time when tested locally. Can someone tell me w...
I'm trying to simulate the malloc function in C by using mmap and having 2 linked lists to act as memory blocks. The program works by reserving a region of memory and then keeps track of the free and allocated memory address with size in the linked lists. I have tested the program with normal cases like free memory > ...
I have a data representing several elements (that could be rendered at some point as div), composed of y position (property top) and its height (property height). These elements are always positioned vertically one next/on-top of each others based on their order. At the moment I am using the following script to calcula...
Does this code show proper implementation of bubble sort algorithm? If not, why? Can this code further be improved? <?php function swap($arr,$p1,$p2) { $temp = $arr[$p2]; $arr[$p2] = $arr[$p1]; $arr[$p1] = $temp; return $arr; } function bubble($arr) { $count = count($arr); for ($j = 1; $j < $c...
I've prepared a script to manipulate csv files in Windows that simply adds quotes as requested. The script creates a backup of the original files and overwrite the wrong originals in its same folder. It works as expected but I'd be really happy to learn from gurus how to improve my code, my thinking and my Python. #!/u...
I have some enums that define measurement information, such as volume, mass, distance etc... They are defined as such: /// <summary> /// Units for measurement of area. /// </summary> public enum Area { /// <summary> /// Meters squared. /// </summary> M2 = 0, /// <summary> /// Feet squared. /...
I've decided to go tech and learn a language. I have been reading Java for a week and here is my first attempt. I am making a habit to write JUnit test cases so that I start on correct path. Here is an attempt to write program that dispenses coins in the denomination in the range of $20 to 1 cent inclusive. package org...
I am building a WPF application which uses a third party library to fetch objects which I want to allow the user to interact with. The objects are returned as interface types. Am I right in thinking it is good practise to create wrapper classes for these objects instead of binding directly to the interface returned e.g...
I have a list called all_dates which contains timestamps for a number of days (hourly). I wanted to select each day (i.e every 24 items in the list) and pass it to a function. Here is my implementation that works: count = 0 while count < len(all_dates)-1: day_list = [all_dates[count]] for i in xrange(23): ...
I have a bunch of different ports I want to listen on and the iterate over the available data to send to a Dataflow pipeline. In total I'm listening on 14 ports. I'm looking for any advice on how to reduce the CPU usage of the following code. I'm just passing in the ports to a method then adding them to a list: publ...
I created my own implementation of a Singly Linked List. Is there anything I can improve on, in terms of effciency. Also, what other methods would you recommend for me to try and implement. My goal is to just understand the components of basic data structures. LinkedList: public class StratchLinkedList { private Node ...
I have a web scraper that I use in a part of a larger program. However, I feel like I semi-repeat my code a lot and take up a lot of room. Is there any way I can condense this code? def read_mail(mail): url = [mail] # Ignore this line, please. i = 0 # Ignore this line, please. droppedSource = '<...
I am working on a project in Java which includes a lot of database related tasks. For instance, I would have to insert, update, retrieve data so many times within the application. To use code reusability, I've just written this abstraction for my database class. I'm planing to call its methods where ever its needed to ...
I've modified this example to better suit my needs in handling multiple custom file uploads on the same page. It also renders the filename or truncates if it is too long for each of the 3 file fields. This solution works well however, I think it could be DRY'd out a lot? This is where I landed: $(document).on('change',...
I asked for a review of my code, and after making the suggested changes I feel that now the OOP version is clearer in its meaning and overall the code looks cleaner. """Object oriented implementaition of Conway's Game of life""" import random import time import os class GameOfLife(): FILE_NAME = "grid.txt" ROW...
I have a map in which I store total bytes as the key and count of users as the value: Map<Integer, Integer> userHistogramInfo = new HashMap<Integer, Integer>(); Now I need to make a histogram as mentioned below: How many users have data with 200,000 bytes (200 kilo bytes) How many users have data with 500 bytes How m...