All Questions
0
votes
0answers
2 views
Splitting the Java builder to avoid writing same code multiple times
I have a piece of code which looks like below:
...
0
votes
0answers
3 views
Assembly x8086 program to input a 16-bit signed number (in string form) and output its binary equivalent
I'm working on an exercise using Assembly x8086 which inputs a number (in string form) then output the binary form. Here is what I did (tested on emu8086 by the way):
Part 1-Convert the string to ...
2
votes
1answer
8 views
One Time Pad, Am I going about it wrong?
I'm new to python, but I really want to get into the swing of doing things the pythonic way. First, does my code follow the pythonic path? Or does it run screaming bloody murder, as it zig-zags ...
1
vote
0answers
7 views
Binary Search in Haskell
I have been trying to pick Haskell back up so I decided to try to implement binary search as practice. I am aware that binary search in Haskell in inefficient because Haskell's lists are implemented ...
1
vote
0answers
4 views
0
votes
0answers
7 views
How can I ensure my content on my website fits within size portion of the browser? [on hold]
I'm building my own website for an assignment project for college and wondering if anyone could help me with this major issue I'm having.
When I open the html file of my website on my macbook which ...
1
vote
0answers
7 views
UVA 100: “The 3n + 1 problem” take 2
This is my second attempt to solve this problem, my first attempt is here: UVA 100: "The 3n + 1 problem"
This time I tried to take lessons from the failures and mistakes You pointed out in ...
2
votes
1answer
16 views
Functions asking for user input, with default prompts
I succeeded in the first part of the exercise, this attempt is the second part. I am not sure I have accomplished the goal, and would appreciate the input of more knowledgeable minds. As always, ...
-1
votes
0answers
7 views
Matrix multiplication in OpenCL [on hold]
I'm new in OpenCL and I try to make my first program matix multiplication(3*3). But the result is incorrect. Can some one help me? Thankyou
the code is:
include
using namespace std;
include
#...
3
votes
0answers
10 views
Adding filters to images in C#
Here is some code I wrote as part of a project that I am working on to learn C#. It is a class responsible for applying filters to images. In this case, my code offers filters such as sepia and ...
1
vote
1answer
10 views
Library to verify GTINs of various lengths
I'm writing a library to verify GTINs (GTIN-8, GTIN-12, GTIN-13, GTIN-14) and calculate their check digits. The calculation of the check digits don't differ from type to type, so I can use the same ...
1
vote
0answers
11 views
Solve a set of “restricted” linear equations efficiently
I was recently asked to solve the following challenge (in C++) as part of the interview process. However, I haven't heard from them at all afterwards, and based on past experiences of unsuccessful ...
1
vote
0answers
8 views
Batch convert images to PDF
I wrote a simple program that converts graphic files in a folder to a single PDF using Magic.NET. It works fine. I'm interested in general comments about the code ...
1
vote
0answers
18 views
Allowing switching between operator[] and at() based on NDEBUG macro version
The problem:
std::vector and other containers have two functions for accessing / modifying their content: operator[] and ...
2
votes
1answer
15 views
Valid Parenthesis
Recently, I've solved the "Valid Parenthesis" problem on LeetCode:
Given a string containing just the characters '(', ')', <...
1
vote
0answers
19 views
Allowing switching between operator[] and at() based on NDEBUG
The problem:
std::vector and other containers have two functions for accessing / modifying their content: operator[] and ...
3
votes
0answers
16 views
C++ benchmark v2
The purpose of the code is to simplify benchmarking of arbitrary functions. The reason I want to benchmark things is that I would like to get a "feeling" of performance. Although the framework leans ...
4
votes
1answer
47 views
Hackerrank Modular Range Queries
Given an array, A=[a0,a1,a2...an], perform queries in the form left right x y. For each query, print the number of elements satisfying the following criteria:
left < i < right
a[i] = y(mod x)
...
3
votes
0answers
12 views
Angular UI Datepicker Popup with Default Time
I need to set date and time (12 hours 0 minutes) via Angular UI DatePicker Popup.
plunker
I had two issues:
1. When page was loaded:
Input had value 17-March-2017 12:00:00.000. It's right.
But ...
-3
votes
0answers
21 views
0
votes
0answers
19 views
Can't figure it how to optimize this code for reduced time complexity? [on hold]
The code that I am putting up here is my solution for the problem at this link. I am unable to figure out how to do it more efficiently.
Here's my solution code for the problem:
...
2
votes
0answers
13 views
Dynamically re-index all indexes in all databases on server
The intent of this SQL Server query is to:
Dynamically work rebuild/reorganize all indexes in all tables in all databases on a server.
Rebuild or reorganize depending on the specified fragmentation ...
3
votes
1answer
27 views
Chaining async functions of a module without Promises
I know that promises are the current recommended way to go for asynchronous chaining but, every time I use promises, I don't feel as comfortable as I wish. All that "then" statements and managing ...
3
votes
0answers
25 views
ThorsSQL Lib Utility
These are some utility functions that I use for building error messages:
SQLUtil.h
...
2
votes
0answers
16 views
ThorsSQL Lib: Part 3: Layer 2
Have a working version of MySQL implementation of ThorsSQL library done.
If you want to check it out you can find the whole thing on github ThorsSQL.
This is a follow on to previous code Reviews:
...
2
votes
1answer
12 views
How to refactor / re-architect the components/state here in ui-router app
https://plnkr.co/edit/bOZW1a9u62W1QA6cYjYj?p=preview
My goal has been to separate the Dashboard states from the Feed state.
...
4
votes
1answer
32 views
Increase performance of Bayesian likelihood equation
I need to calculate a Bayesian likelihood in its negative logarithmic form:
$$-\ln L = N\ln M -\sum\limits_{i=1}^{N} \ln\left\{P_i \sum\limits_{j=1}^M \frac{\exp\left[ -\frac{1}{2}\left(\sum_{k=1}^D \...
3
votes
3answers
29 views
Perf wrapper for Excel VBA
For a while now, I've been using this wrapper to avoid retyping most of it :
...
2
votes
0answers
18 views
Doubly-Linked List Implementation in Python With Unit-Tests
I am soliciting some feedback on my doubly-linked list implementation. In particular, I am looking for your take on my unit-tests and their coverage of the code itself. That is, I developed this class ...
2
votes
0answers
7 views
AngularJs: Preventing multiple $q.get() per url
I've wrote a pretty useful method to prevent multiple requests per single get url. There is a well known pattern - to store promise and return it for each next ...
3
votes
1answer
31 views
Excel 'big' data processing with vlookups
I was given code a while back that was a mess, and have completely rewritten it. However now the code takes .2 seconds per line which for a 500,000 line document is much too long.
Purpose of the ...
2
votes
1answer
30 views
Call third parties in parallel
I am trying to speed up some reporting on all employees but I am having difficulty determining where the "proper" place to parallelize my tasks. In order, this is what my code is currently doing.
Ask ...
1
vote
0answers
13 views
Replace file with variable (javascript) [on hold]
I have created a PHP programm which allows to load a random .json file on my computer. When I select the file I want to display, I get the data from the selected .json file. At the beginning, I used a ...
3
votes
0answers
28 views
Pin an array in memory and construct a Bitmap using that buffer
I'm using some resources in the code below to pin an array in memory and construct a Bitmap using that buffer. I'm not sure if I'm handling all of the resourced in ...
8
votes
4answers
438 views
Login form C# SQL
Basically this is my first login form.
I am using sql and c# winforms.
I made user roles such as "Admin" and others and the user is taken to a specific winforms, according to his appointed role (...
2
votes
1answer
33 views
Loading components on startup, with timing measurements
I was just wondering, is there a way to load these better and log the times they each took? It seems like a headache having to write about 90+ stopwatches, which is what I will have to do as I have ...
2
votes
1answer
15 views
Minimize the number of workers/test rigs, with a capacity constraint, using Excel VBA Solver loop
I created a code that runs 60 optimizations through solver through 4 series of loops (each with 15 'iterations'). The code works great but it is taking FOREVER to run through (over an hour). Each ...
5
votes
1answer
119 views
switch to create number of symbols
This code shows an icons from the Segoe MDL2 Assets font, depending on the number in a variable. However, I'm sure there is a more elegant way of doing this.
...
5
votes
1answer
44 views
Flight combinations between two cities
I am trying to obtain all possible ways to go from a city A to a city B on a given day by plane, with a maximum of 2 stops.
I have as input a list of dictionaries:
...
2
votes
0answers
27 views
REST API client
I am new in iOS development and Swift. I am going to develop a simple application which communicates with external REST services. This is my first experiment.
I appreciate feedback on best ...
2
votes
1answer
50 views
Iterator based version of quicksort, allowing user defined pivot-selection-strategy
I have implemented a iterator based version of Quicksort, which allows the user to define and pass his own pivot-selection-strategy:
...
-3
votes
0answers
14 views
Xampp:Php form with checkbox to Delete mysql records,Update cells anyway and Insert's 1 row [on hold]
I created 2 pages:
The first page:
Retrieves data from compact_discs table and via checkbox can select and delete the corresponding row,
I can alter any column,field except the 1st's column fields ...
0
votes
0answers
24 views
Recording item creation events on a blog engine [on hold]
On a website there are various content types: blog post, user and comments.
Each time one of those is created, I record a corresponding "event" in an "event" SQL database table, so I can display a ...
3
votes
1answer
27 views
Scroll animations - setInterval vs. setInterval & requestAnimationFrame
I've recently made a slightly similar question with respect to the rendering performance, however my question this time is a bit different and with respect to which kind of JavaScript approach is the "...
-6
votes
0answers
446 views
Range Modular Queries [on hold]
Given an array, A=[a0,a1,a2...an], perform queries in the form left right x y. For each query, find the number of elements in satisfying the following criteria ...
3
votes
0answers
32 views
Raw replacement of space by %20 in Java
I tried coding this for practice. Is there a more memory-efficient way to work in place without using more arrays etc (using raw array operations)?
...
10
votes
0answers
41 views
ThorsSQL Lib: Part 3: Layer 1
Have a working version of MySQL implementation of ThorsSQL library done.
If you want to check it out you can find the whole thing on github ThorsSQL.
This is a follow on to previous code Reviews:
...
4
votes
1answer
27 views
Remove duplicate elements from array along with element using Java 1.7
I need to write a method where a int[] will be supplied as an input and it should return an array, but with all of the numbers that occur more than n times removed entirely.
Input:
...
10
votes
1answer
32 views
Reading and processing histograms stored in ROOT files
The Context
My daily workflow largely consists of producing, styling, and circulating plots from a dataset to my advisor and collaborators. We use the C++ framework ROOT to generate and store ...
5
votes
1answer
20 views
Extract last delivery for each name on each date
I've been using Java 8 Stream features quite a lot these days and am very happy with it. I've written a code that uses groupingBy and max but was wondering if it can still be optimized or even just be ...