All Questions

Filter by
Sorted by
Tagged with
1
vote
1answer
171 views

Computational verification of Collatz conjecture using OpenCL

This code review request follows my previous request Computational verification of Collatz conjecture. Unlike the previous program (which was designed for the CPU), this code should run on modern GPUs....
1
vote
1answer
44 views

Flat file column based parser

I implemented a Column-based FLAT parser and generator, where the information is loaded from a base class, which contains the attributes that tell the column size and type. For each line of the flat ...
-1
votes
1answer
33 views

Prime coins- Segment Tree [on hold]

So this question came up to one of the company interview. I felt it as a straight segment tree question with sieve, and I was able to pass the given sample test cases, but unfortunately not a single ...
4
votes
2answers
63 views

Target Sum leetcode

I am trying to solve this problem You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose one from + ...
1
vote
1answer
37 views

Categorize & sub categorize from contents of one row and more execute even more queries in results

I have a table called sales and it has below columns: 'id' 'product_type' 'soldDate' 'text' ...
3
votes
1answer
32 views

User defined function call on a stack based interpreter for concatenative language

I would like to receive some advice on how to improve a small concatenative stack-based interpreter, executing a joy-like programming language. It is really minimal, and is in fact a subset of a ...
-2
votes
0answers
16 views

SUITCSS Methodology [on hold]

I'am trying to understand SUITCSS methodology for writing front end code. I've written this code and want to know if this is good SUITCSS methodology by using class names: ...
-2
votes
0answers
19 views

Notepad java-swing ( undo redo) [on hold]

anyone helps me please . I create a notepad program , and anything ok except the Undomanager . I can undo and redo in the current file . But when i use new file , the undo and redo still work , it can ...
1
vote
1answer
42 views

Group items by types: replace nested for loops with reduce

I have a working code that groups items by their type values. The types can be one or multiple, however they are always returned as an array. To illustrate: if an item has types with values ...
-6
votes
0answers
36 views

What to hack with Python? [on hold]

I have skill with Python, but what should I use my power for? I have a simple password strength tester, but I want it to be faster. I need ideas for more programs. Here is some code: ...
4
votes
1answer
84 views

Random password generator that ensures diversity of character types and absence of confusing characters

I wrote the following password generator, to generate a password in which each character group appears at least at once. ...
-2
votes
0answers
15 views

My code seems to work fine until i started to input a string on my x coordinate and it just kept on looping [on hold]

The program runs totally fine until i decide to input a letter when the program ask for the x and y coordinate and it just keeps on looping forever and i cant seem to know why. If i do input a number ...
2
votes
1answer
59 views

Verifying Mathematical Expressions

This is a part of my calculator program. I have to check if the input entered by the user is a valid mathematical expression. The first check is performed by another program, where the program checks ...
6
votes
1answer
49 views

Light weight C++ Signals/Slots or Event System

This assumes there is no need to aggregate results from the listeners of a broadcast signal. Technically I guess the slots are whatever your std::function holds, ...
7
votes
2answers
108 views

Iterate only once using LINQ

Funny thing, the following test works: ...
3
votes
1answer
29 views

Sessions class With assoc-array - practicing

I try to dealing with sessions.. including arrays before moving to "database". Sessions class.file ...
2
votes
1answer
30 views

Find a String in an Array

This program is used to get names and numbers of N person, print out the numbers of a person. Please help me improve this code. Additional Question: To avoid a very long name that exceeds char's ...
-2
votes
0answers
20 views

compute the union of intervals Elements of Programming Interviews 13.8 Python [on hold]

My program needs to output a list of interval objects expressed as a set of disjoint intervals. Assume True implies open ended ie:inclusive and False implied the endpoint is not open ended ie: ...
-2
votes
0answers
18 views

Collatz Conjecture meet of two numbers in Java, getting wrong answer [on hold]

I literally with multiple test cases, it is passing, I even fixed TLE by using Long. Could anyone help in figuring out what I am doing wrong? Below is my code : ...
2
votes
2answers
49 views

A function that returns all letters in the Alphabet except the ones in a pre-defined list

This function should return a string that is comprised from all the letters in the Alphabet except the letters in a pre-defined list in alphabetical order. Assuming all letters in the pre-defined ...
-2
votes
0answers
22 views

Translate n-body code from C to C++ using classes [on hold]

I want to translate my old n-body C code to C++ and want to use classes and other features of C++ like arrays or vectors. My problem is that I do not really know how to start. How do I structure a ...
-2
votes
0answers
17 views

Is there a way to reduce the logic of generically handling webfaultexceptions [on hold]

I have to error detail classes: IntegrationErrorDetail and Error Detail, they don't inherit from each other because of data members on the properties in the classes. I wasn't to know if I can reduce ...
4
votes
1answer
48 views

Paginate IEnumerable<T> sequence

I used the following to split sequence into batches: ...
-2
votes
0answers
31 views

Append div in labels as helper text. With in each radio group and its wrapper div [on hold]

fiddle link I want to append a div in labels as helper text. within each radio group and its wrapper div. I have a radio buttons group code generated dynamically, so I can't add static helper text ...
-1
votes
0answers
35 views

Readers-Writers Lock implementation - ThreadSanitizer is unhappy [on hold]

I'm working on a platform which only has (shaky) support for C++11 so I wrote my own implementation of shared_mutex using the Wikipedia description of the readers-writers lock algorithm. ...
-2
votes
0answers
11 views
-2
votes
0answers
18 views

balanced curly brackets check from regex in C# [on hold]

I have the following sentence, "Please check for {input1} and {input2} and {input3}. Thank you." I have the following regex to extract everything in braces. ...
4
votes
2answers
60 views

JavaRPN (Updated)

I have previously worked on this program in this question, and have gotten some very good answers and help! Now, I have done some more work on the program, and would love if you could give me honest ...
4
votes
1answer
56 views

Getting Windows User Info From The Active Directory

I took some boilerplate code that I have been using for determining an active windows user's info to either send emails with their details, or to pass to a error logging class, and encapsulated it in ...
-2
votes
0answers
16 views

What is actually the right way to protect parent scope variables in FORTRAN? [on hold]

So I just picked up a project that is written in fortran90. I am used to coding in python and C. What is really troubling for me is the use of subroutines in fortran90. In fortran people use ...
-2
votes
0answers
35 views

C++ ringbuffer with cas [on hold]

This a sample unlock ringbuffer with cas.But still with bugs in put / get. One known bug is multi readers will make m_rear step over m_front then block or coredump. Can someone help me to fix it? ...
-2
votes
0answers
16 views

From Object to Json String Refactoring [on hold]

I need to refactor the below code because i think that there will be a more easy way to write it down can someone help me ? the code create a json string using the value of the lclrow class. I need ...
0
votes
1answer
16 views

Bidirectional numeric (floating point) sequence iterator

I wanted a neat iterator that will always give me neat sequence of step spaced numbers. This is what I came up with, but I am a bit skeptical that I covered all ...
7
votes
2answers
62 views

Simple VGA driver for a toy kernel

I learn about OS development and follow the tutorial Bare Bones on OSDev. And I did some extra tasks from the Moving Forward section. I would like to get any suggestion about code improvement, ...
6
votes
1answer
74 views

Find overlapping area of octagons

Here is my problem statement: There is a matrix of octagons, for example, 4 octagons in a row and 3 such rows. So 4 columns and 3 rows of octagons. But they are not arranged in a perfect rectangle ...
2
votes
1answer
30 views

Merge adjacent occurrences of identical elements in data collection

There is a small programming exercise to merge adjacent identical elements in a collection. Here are two solutions (passing the tests from the exercise). I am asking for review of the first version ...
9
votes
2answers
1k views

Linux Commands in Python

I've decided to write some Linux commands in Python. Below is a list, along with some constraints (if you're unfamiliar with Linux, the top of the program along has a description about each command ...
11
votes
4answers
1k views

C# Toy Robot Simulator

I did this coding exercise for a potential employer who failed it on the basis of unspecified style and structure issues and would appreciate any thoughts on what flaws this contains, in particular in ...
19
votes
4answers
2k views

Matrix class in C#

I've been learning C# during my free time in the past months; before that, I was mostly writing Java, so the transition hasn't been too hard, but I've never had my code reviewed or read by someone ...
3
votes
1answer
68 views

Caching lookup values in an e-commerce website

I am working on an e-commerce website. I have a CarMake dropdown which contains car make names and their corresponding Id, for example: { 1:Alfa romeo}, { 2:Audi }, ...
8
votes
1answer
791 views

Favorite Game List utilizing vectors and iterators

So in learning c++ I have to make a little program that makes a game list that can add games to the list, remove games, and display the list, and it has to use vectors and iterators, so I made the ...
4
votes
1answer
60 views

a function to partition images into patches

I wrote a function that partitions an image into multiple patches. Here is the function, are there any suggestions to make it better or more production ready in terms of the best software practice? <...
3
votes
1answer
48 views

Simple winform that randomizes images in a picturebox

I wrote this code for a simple app that gives us random images. The code works, but I feel like I'm doing something wrong. And one thing I would love to know is instead of grabbing from a folder ...
1
vote
0answers
47 views

C# KMP algorithm

I tried to implement KMP algorithm on my own and found it kind of hard to follow. Can you please comment how would you make this code easier to read / understand. ...
2
votes
1answer
30 views

Reading a text file, manipulating it and saving it to a mongo database

We have an upcoming project at work which is going to require working with express.js. I have no prior experience with node.js, so I thought I'd try and do something aside from some courses. Are there ...
-3
votes
0answers
31 views

How to understand JSON to PHP like that [on hold]

Hi how to create a php page with this json help me with code can call only Force > max ...
-2
votes
0answers
35 views

how fix bubble sort optimization [on hold]

I need help with bubble sort. Is there any possibility to optimize the following code? How do you put it in one on the 'if' to make it work? I tried it myself but I can't do it ...
3
votes
1answer
46 views

Optimized Longest Collatz Sequence

I'm writing a program to calculate the longest collatz sequence for positive integers below some N. I have optimized it as far as I can - is there anything more I could do to optimize it? Any ...
-2
votes
0answers
19 views

Split a list collection into n length [on hold]

I have a list List which contains 100 records . I would like to split the above list into 3 lists. I tried the below condition ...
-3
votes
0answers
19 views

Bulk Uploads Files From Folder To Tables In Postgresql Database [on hold]

It takes a long time to run. I think the loops are causing it to be inefficient ...

15 30 50 per page