All Questions
0
votes
0answers
2 views
Concurrent non-blocking update of cached list of on-line users
I have following problem: My server (ASP.MVC WebAPI) is tracking, when client application ("Agent") is on-line. It's storing this inf on following table:
...
0
votes
0answers
3 views
PDF Script Tool - Adds Javascripts to PDF Files
This is a Windows Forms application that adds Javascripts to PDF files. It supports multiple files at the same time. Right now, the only supported script is a "time-stamp on print" script, but any ...
0
votes
0answers
6 views
jQuery menu state is-active
I have this menu in jQuery that works perfectly, but I think it would be better if, instead of using class="btn-accordion" for each ...
0
votes
0answers
28 views
Storing a version number in a Python project
If I have this simple structure:
$ tree
.
└── project
├── __init__.py
└── my_script.py
where I want to define ...
-1
votes
0answers
11 views
Josephus problem in C using linked list [on hold]
// why is temp2 not getting updated? It points to a[0].
...
0
votes
0answers
12 views
My Website Script loading takes a long time [on hold]
StackExchange Code Review community. I'm currently building a Forum out of Pure AngularJS. What I'm asking is why is my website loading so slow for some reason. I'm Guessing there are multiple ...
1
vote
0answers
28 views
The rusty Sieve of Eratosthenes
To get familiar with the Rust language I've decided to implement the method of Sieve of Eratosthenes to find primes up to a number N.
I have created the following code that both prints the prime ...
-2
votes
0answers
9 views
How can I change my code using SIMD/AVX to calculate ranks in my page rank algorithm? [on hold]
I am writing a page rank program. I am writing a method for updating the rankings. I have successful got it working with nested for loops and also a threaded version. However I would like to instead ...
-4
votes
0answers
24 views
Python rock, paper, scissors code [on hold]
First post here so excuse any formatting mistakes. So I had to create a game in Python for school so decided to make a text-based rock, paper, scissors game. The code seems to look correct but the ...
0
votes
0answers
8 views
Is this a good solution for selecting multiple thumbnail images using jQuery?
I have written something in jQuery but I'm not sure whether it is an elegant solution. Every click needs to check the DOM for classes/and add and remove classes. Any feedback or suggestions would be ...
3
votes
2answers
56 views
Simple Tokenizer + Parser
Requirements
A function is needed, that is able to parse a list of symbols with the following rules:
Symbols may be associated with numbers or not.
Numbers are defined by a comma separed list ...
1
vote
2answers
44 views
0
votes
0answers
23 views
In PHP how to change a list from “Country code - Country name” to “CountryName - CountryCode” and sorts the list by CountryName?
A couple of weeks ago a company sent me the coding challenge below:
Please write a PHP web application and send it back to me as zip file.
which waits for a user action, like clicking buttons. ...
0
votes
1answer
51 views
Skeleton of a Multi-threaded web crawler in Java
I am trying to prototype a simple structure for a Web crawler in Java. Until now the prototype is just trying to do the below:
Initialize a Queue with list of starting URLs
Take out a URL from Queue ...
9
votes
0answers
111 views
Match Three game for a job interview using Cocos2d-x
The problem is that I had an interview for a gaming company and I had to write a prototype of a Match Three style game. The time line was 3 days. I made the code in about 2 days and sent it to them.
...
2
votes
2answers
25 views
Bash script to perform LUHN check
The following Bash script takes a single parameter (the PAN) and exits with 1 if the PAN does not satisfy a LUHN check.
...
4
votes
3answers
282 views
Take from top, evaluate, put on bottom
In this example, I am only looking for the first duplicate - curious if this logic in for loop (take from the top, evaluate, put on the bottom) pattern has a standard form
...
2
votes
2answers
60 views
Assembling edges of a graph
I'm making a neural network that comprises five populations of feature-selective neurons and one population of non-selective neurons. Each neuron in this network receives connections from
c * f * ...
2
votes
0answers
14 views
IsImageUrl extension method written in F#
I'm a newbie to F# and so I've written a small extension method library to practice the language. The extension method attempts to determine if a url string is for an image. I wrote the code as an ...
-3
votes
0answers
39 views
Facing problem in Nested Async call [on hold]
PROBLEM : When I try to call _cacheManager.GetObject in controller of API then it calls most of the related methods and when the call reaches ...
1
vote
2answers
50 views
Merge array of hashes, keeping duplicate values as arrays
I am working on a Ruby gem to pull data from the Wikidata API. The data is deeply nested, as it contains a lot of repetition.
I have written a piece of Ruby (sans Rails) code that enables an array ...
3
votes
0answers
15 views
Electron Application with JavaScript Backdoor and Ruby Command-Line Listener
I have created an Electron Application with a JavaScript/NodeJS Backdoor and a Ruby command-line listener.
I created this program for remote administration of my home computer securely using a new ...
0
votes
0answers
14 views
Infrequently updated object caching [migrated]
Based on the comments received I have moved this question to stackoverflow.
I'm working on a project where I need to cache objects from the database that are infrequently updated.
How is this as ...
6
votes
3answers
601 views
Calculating the amount of cubes needed to form a sum
Since I've never done any performance programming (Aside from the better choices such as array vs list etc. The real basics.), I should probably read up on it. But I had to start somewhere, so, ...
4
votes
0answers
29 views
Purely functional Sieve of Eratosthenes
Many implementations of Sieve of Eratosthenes (used to find prime numbers up to a given n) use a temporary mutable array to keep track of which numbers are composites. I'm looking to write a purely ...
5
votes
1answer
92 views
Palindrome evaluator in C++
I started learning C++ a few days ago, and this is my first full program. It takes in words until an end-of-file character prompt is given, and then outputs which of those words are palindromes and ...
8
votes
0answers
24 views
-2
votes
0answers
12 views
Auto forward mails and change body (vba, Outlook) [on hold]
I want to forward every mail with a specific subject to an e-mail. To the content of the original mail, a specific content ("geprüft") should be added.
I have the code now, but it doesn't work ...
3
votes
2answers
51 views
Beginner code for a Rock, Paper, Scissors game in Python
I am a beginner in Python and I wanted to see if I could get some feedback on my simple Rock, Paper, Scissors game. I do have previous experience in programming, as I started learning a few years ago ...
0
votes
0answers
16 views
Directory listing in Node.JS
This solution works, and I like having all the logic after the return.
The main purpose of this function was for use with other functions to return a file list:
...
0
votes
1answer
17 views
Composing IO and Async in haskell
Whether based on MVar or TVar, async implementation are always based on operation on some underlying monad IO and STM.
Making Async a monad on its own, as in F# async computation builder, if done in ...
2
votes
1answer
66 views
1
vote
1answer
27 views
Show and hide views
I have some buttons in my class that show or hide two views (by setting their alpha property to either 0 or 1) when the user taps on them. I have written a function that uses the ...
-2
votes
0answers
19 views
skip list insertion in java [on hold]
I'm trying to insert an element into a skip list. While I think that my search function does what it's supposed to, I don't seem to be able to wrap my mind around how I'd go about inserting an ...
0
votes
1answer
22 views
Once-only macro
I have been learning common lisp and am a newbie, using the great book Practical Common Lisp. There is a once-only macro in the book that I spent a lot of time figuring out how it works. Even after I ...
5
votes
2answers
57 views
Thread synchronization with mutex
This program prints odd numbers by thread1 and even numbers by thread2 sequentially. Can this code be optimized or made more ...
7
votes
2answers
262 views
Chocolate Distribution in a school
Problem Statement
In a School, Chocolate bars have to be distributed to children waiting in a queue. Each Chocolate bar is rectangular in shape. Consider its side lengths are integer values.
The ...
1
vote
0answers
25 views
Finding shortest paths in a Wikipedia article graph using Java
I have this sort of a web crawler that asks for two (English) Wikipedia article titles (the source and the target), and proceeds to compute the shortest path between the two. My code is as follows:
...
-5
votes
0answers
24 views
2
votes
1answer
15 views
Random walker using Processing.JS on Khan Academy, with new walkers generated on mouse click
I've created a project on Khan Academy as part of the Natural Simulations course on random walks.
This project is in JavaScript, using the Processing.JS library, slightly modified by Khan Academy.
...
3
votes
2answers
172 views
C# helper class - mailto
I'm looking for input, advice, criticism. This is my first helper class. While use of mailto URLs should most often be trivial, I have a real world need to send to multiple recipients and with a body ...
2
votes
0answers
14 views
Emmental interpreter written in Go
Emmental is an interesting esoteric programming language based almost entirely on rewriting its interpreter. The language provides a very basic set of standard computing operators, and an ...
2
votes
1answer
33 views
Player projectile shooting
I am wondering if my code is needlessly redundant. I noticed, when looking over my code, that I had a unnecessary variable and if statement. Both ...
0
votes
0answers
26 views
Reverse integers divisible by 3 [on hold]
I was asked a pretty basic question in a recent interview. Given a integer string , reverse the integers that are divisible by 3. Here is an example.
"1234567890" becomes "1204597863"
I was rejected ...
2
votes
1answer
49 views
Check binary tree symmetry by reversing, checking equality, coverage tested, makefile
A few weeks ago I recall a HackerNews story (found it again: "I Don't Want to Hire You If You Can't Reverse a Binary Tree") about reversing a binary tree (with, as I remember it, the end goal being to ...
-1
votes
0answers
13 views
Trying to conduct Python machine learning on data that is tuple [on hold]
I'm a newbie to Python. I'm trying to conduct machine learning on a csv dataset, using sklearns. My problem is that I cant read my data, since opening my csv file and reading it with pandas renders it ...
3
votes
0answers
16 views
Count words in string and tally up the repetitive words
I'm an elixir beginner. I'm doing the word count exercise of exercism website. The word count exercise returns a map with the word as the key and the number of instances as value. The exercise ...
-1
votes
0answers
29 views
Spaceship Arcade Battles V0.1
I am trying to implement something like this spaceship shooting game using SFML and Box2D.
I don't know how my code is. Please, look and criticize. Well, I've put here most important classes. The ...
0
votes
0answers
13 views
Knight's Tour - all Solutions and Optimizing - Java [on hold]
I wrote a Code for the Knight's Tour Problem. I googled alot to try to make it as efficiant as possible. I got the Buffer. I also thought about using the Heuristics Algorithm. I don't know where I ...
0
votes
5answers
61 views
Calculations to reposition a logo
I have this block of code which clearly looks like duplicate, but I don't know how to refactor.
...