All Questions

Filter by
Sorted by
Tagged with
-1
votes
1answer
53 views

R Regex : Need only numeric figures [closed]

I'm working on R and using regex to keep only numeric figures in a column (I need to keep digits, negative and decimal sign). Suppose I've a value ...
-1
votes
1answer
82 views

Simplify JavaScript collision detection with offset

I am working on a background project that is a little interactive. Now I am using some collision detection to draw some lines and stuff. The code I have works great but it is very bulky and hard to ...
-1
votes
1answer
51 views

Compare quantity of two lists - with a given tolerance [closed]

-> Already Asked at StackOverFlow, but was adviced to post question here! <- I want to compare two lists, which both can be null, both can contain 0 or more ...
-1
votes
1answer
35 views

comparing between binary search method and linear search [closed]

I am a python beginner and I wrote a program that compares between the binary search method for finding a number and the linear one. However, when I run it It does not function properly and would ...
-1
votes
1answer
78 views

Check if an element exists in a list of dictionaries [closed]

The logic of the code to build was as follows, two logical conditions; If the value of dictionary element matches in the list of dictionaries return the particular dictionary, and if no element ...
-1
votes
1answer
123 views

Decoding a string encoded by Caesar Cipher and some delimiters [closed]

I have the following code which I seek to optimize. The result of the bruteforce I already have but I'm just trying to learn some more python using the same example. The code in the data needs to be ...
-1
votes
1answer
32 views

Extract a box with pixel values from an image, calculate the mean of each possible box [closed]

I have a two-dimensional array with M rows and N columns, with each element having a value between 0 and 255. I have a second two-dimensional array with m rows and n columns, m < M, n < N. ...
-1
votes
1answer
54 views

Simply adding/removing/sorting data

I wrote a simple data handler class. I would like to know if I can make my class more simple and efficient for doing the identical feature. My Code : ...
-1
votes
1answer
80 views

Removing switch statments

I have the following method: ...
-1
votes
1answer
45 views

Making filters based on checkboxes [closed]

I have a scenario where I do filters depending on checkboxes checked. Now I have only 2 checkbox and I need to cover all escenarios into if ...
-1
votes
1answer
1k views

Ado.Net and Async insert of many rows to db

I have implemented repository in Ado.Net which insert data to many tables. I insert all in one transaction and use async/await to improve performances. If you have any suggestions have to improve my ...
-1
votes
1answer
74 views

How to use C to solve Two Sum correctly? [closed]

Two Sum Problem: Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may ...
-1
votes
1answer
1k views

Maximum Difference in an Array

Maintain a minimum and max difference as we scan the input array. ...
-1
votes
1answer
932 views

Javascript RabbitMQ -> Pull Single Message [closed]

I'm trying to pull a single message off of rabbitmq, process it, and acknowledge that single message. I don't want it to continue after acknowledgement pulling messages off the queue. If I don't do ch....
-1
votes
1answer
751 views

Table criteria filter

My tables retrieve entries from the database through a dropdown list so they can have 1 to 500 entries, therefore auto-filter to remove blanks is inevitable. I have tables across many sheets, however ...
-1
votes
1answer
54 views

Is it possible to make easier this code? [closed]

That was a question from interview. This code works, but it is very difficult to maintain. What should be changed in order to make this easier? Thanks for answers! ...
-1
votes
1answer
1k views

Sort multidimensional array based of the difference in the value

Sort multidimensional array based of the difference in the value, if value is same sort on first column. Constrains: No of rows can be any but fixed no of column ie 2. Example: <...
-1
votes
1answer
100 views

Distance on a ring [closed]

I work with objects that are marked by sequential unsigned numbers. When number reaches max value, it becomes 0 again. To detect breaches in the numbering, I calculate distances between them (b is ...
-1
votes
1answer
2k views

SQL connection string builder, initialized in two ways [closed]

For a while now I have been using string builders in my code. The way I currently do this is using the code below: ...
-1
votes
1answer
712 views

Reading bytes from file to compute its SHA256 hash

I need to get text hash (sha 256), so I need to convert file to its type representation. Is this a fast way to get a byte representation of a file? ...
-1
votes
1answer
95 views

Is my code Declarative (RxSwift) ? Please help me to explain why not?

I'm newbie in Swift and Rx programming. Is my below code is declarative ? If not, please rewrite it and explain to help me more understanding about declarative :( (my English is so bad) ...
-1
votes
1answer
243 views

Partition TPL Tasks in ASP.net 4.0 for WCF Service

Want to know if using partition code like this is ok to do to partition tasks in ASP.NET 4.0 inside of a WCF service. My goal with this code is to try to do non-blocking calls without spinning up too ...
-1
votes
1answer
66 views

Some kind of multiple singleton

I need several singleton, I wanted them to be easily accessible via auto-complete, so I made this thing. ...
-1
votes
1answer
109 views

Searching for topic categories using mysqli [closed]

Is this code safe from injection, xss and whole other attacks or no ? The below code is for search box : ...
-1
votes
1answer
2k views

ASP.NET MVC multi language website

What is the best way to make an ASP.NET MVC multi language website? The following code is what I use, but I need to make sure from your real-world experience that my code is the best way for ...
-1
votes
2answers
1k views

Design pattern to implement Database operations [closed]

I am trying to implement design pattern in my project and have been reading material over net. we have a sales application ( in C# ) where in we are storing entities like ...
-1
votes
1answer
56 views

Improving User Class structure/design [closed]

I recently got into OOP, because I'm working on a big project and want to make sure my code is easy to maintain & scalable. My question is - how could I go about properly structuring the ...
-1
votes
1answer
846 views

Cartesian product in Scala

I'm using this code to compute a cartesian product: ...
-1
votes
1answer
668 views

Simple PHP SSH2 Class

I've written a simple PHP SSH2 wrapper class. Please review the code and point out mistakes. ...
-1
votes
2answers
119 views

PHP Dependecy Injection Container

A few weeks ago, I asked for another DIC review, but didn't get any response (but only for one about my error handling). So I tried to rework my DIC without any outside insight on it, and the first ...
-1
votes
1answer
313 views

EF Code First BaseContext-class [closed]

I've seen a tutorial where a dbcontext base class is created like so: ...
-1
votes
1answer
42 views

Class for Managing Office Details [closed]

...
-1
votes
1answer
41 views

Python 3 code for a binary search tree [closed]

I am working on a python3.6.5 question about BST: Binary search tree (BST) is a binary tree where the value of each node is larger or equal to the values in all the nodes in that node's left ...
-1
votes
1answer
53 views

Login to a school system and get account type

I'm new to MySQL database design. My question is this database is correctly built or not. We used the users table to login and get account type and here the code to login ...
-1
votes
1answer
369 views

Marking a rectangular region in a NumPy array as an image mask

I'm currently working on creating a mask for an image. I have initialized a two-dimensional numpy zeros array. I now want to replace the values of the mask corresponding to pixels following some ...
-1
votes
1answer
94 views

Count the maximum weight of an independent tree subset

I got an algorithm counting max weight of independent tree subset: ...
-1
votes
1answer
141 views

Why does this scala code only execute the last future when necessary? [closed]

From https://www.chrisstucchio.com/blog/2013/actors_vs_futures.html: A very nice feature of Futures is that they are highly composable. Consider the following problem. I want to return an HTTP ...
-1
votes
2answers
8k views

Randomize a jQuery object list

Well this was a simplest code competition at my work. I tried a couple things, they accepted but none of them is I wanted. Because both are always giving same result. I tried to randomize like this <...
-1
votes
1answer
1k views

Mysql flexible insert record with bind_param or bind_value

I want to insert rows in a database table with the precaution of SQL-injection. I'm using below flexible MySQL insert function, which enters a record in a given table. Is this the best approach or is ...
-1
votes
1answer
76 views

Open/Close Principle in front GUI element [closed]

I'm working over project for my studies. It's a simple program about brewing coffee. I'm thinking about solution for showing single parameter in GUI. I have a source brew parameter class: ...
-1
votes
1answer
90 views

Reduce repetition in SCSS for panels of various colors

I have the following SCSS and I'm curious as to how I can improve it, and reduce the amount of repetition... I plan on adding more colors, but I don't wish to keep copy/pasting the same block over ...
-2
votes
2answers
1k views

“ChocolatesByNumbers” challenge

Here is a problem I have attempted: Two positive integers \$N\$ and \$M\$ are given. Integer \$N\$ represents the number of chocolates arranged in a circle, numbered from 0 to \$N − 1\$. You ...
-2
votes
2answers
90 views

Using a lot of IF in loop WHILE to print information

I made a code and it is doing what I want. But, I would like to know if I am doing it right or in the best way. Could you please give me your thoughts about it? Thank you. ...
-2
votes
5answers
1k views

Finding dice roll results in a combinable list of numbers

This code takes a selection of numbers between 1 to 9 which could be 1,2,3,4,5,6,7,8,9 or 1,2,4 or ...
-2
votes
2answers
685 views

Pascal's triangle with memoization

Problem: Pascal’s triangle is a useful recursive definition that tells us the coefficients in the expansion of the polynomial (x + a)^n. Each element in the triangle has a coordinate, given by ...
-2
votes
3answers
2k views

An exit condition for a do-while loop using lists [closed]

I have an integer list l and a predefined integer value row (which is never manipulated inside the code). If value of row is 5, then I want the loop to exit if <...
-2
votes
3answers
76 views

Translate a day in year to month and day 2nd method

Take an integer representing a day of the year and translate it to a string consisting of the month followed by day of the month. For example, Day 32 would be February 1. I've already submitted my ...
-2
votes
3answers
160 views

Simple Python script seems to stop when N >> 1

Edit : So I let the code run for 70 hours and it did not return. Thus I stick to my point, it does get stuck on something, fails silently and let the bash hanging. From the time increase compared to ...
-2
votes
2answers
235 views

Euclidean distance between documents

For each function, I am manually adding another case. Can this be somehow shortened? Case and function names are the same. For example, the Euclidean_Distance case ...
-2
votes
3answers
7k views

Comparing 2 ints without using comparative operators

I was looking for questions that might be asked in a technical interview and I found this one: Write a function that determines if two integers are equal without using any comparative operators. I'...

15 30 50 per page