0
votes
0answers
8 views
Simple cache dictionary
I decided to write a simple dictionary to use as a cache. Here is the code:
...
1
vote
0answers
11 views
UPenn CIS 194 Homework 3: Code golf
I am working through UPenn CIS 194: Introduction to Haskell (Spring 2013). Since I am not able to take the course for real I am asking for CR (feedback) as it could be from teacher in that course.
...
1
vote
0answers
20 views
Parsing mathmatical functions
I have finally finished a Ruby calculator project, which is not based on eval. Instead it parses input char by char. The project is hosted on GitHub.
However, I find a specific part of the program ...
-1
votes
0answers
13 views
Basic userform with node.js backend and angular frontend [on hold]
I have tried to get myself into Node.js and Angularjs in the past few month, and I thought I was ready to apply on jobs with them. So I did.
I was assigned to do a fullstack single page app form. ...
4
votes
1answer
28 views
Finding prime divisors with wheel factorization
I am just starting to learn C++, and I wrote was the following implementation of the trial division algorithm to find the prime factors of a positive integer. I'm hoping the community here can suggest ...
2
votes
1answer
38 views
Precision sum of doubles
Summing doubles can cause a loss of precision.
Summing integers, however, doesn't. (Assuming no overflow.)
Here's a high precision sum function I wrote:
...
-4
votes
0answers
20 views
Extract data from table and put in submit form [on hold]
please help me how insert data only value in tr "Layanan" and "Tarif" into database mysql.
For note, this table sometimes have 2 row,and sometimes have 4 rows. So,dynamic result.
Please help me to ...
1
vote
0answers
22 views
Binary Bayes network classifier in Java - Part I/II - follow-up
TERMINOLOGY
We are given a directed acyclic graph (dag) \$G = (V, A)\$, where \$V\$ is the set of nodes and \$A \subseteq V \times V\$ is the set of directed arcs, and a weight function \$p \colon V ...
3
votes
4answers
91 views
DFS in Binary Tree
I have written this code for DFS in a binary tree and would like improvements on it.
...
3
votes
1answer
49 views
Palindrome using stack
I recently started learning Java, algorithms, and data structures. I am trying to check if a string is palindrome. I would like a review to see where and how I could improve.
...
1
vote
1answer
22 views
Character class for an RPG game
I have an RPG-like program that uses a Character class to specify and return information about an individual player/character. I was curious about a way to best set ...
4
votes
2answers
78 views
Find palindrome in a string
The purpose of this code is to find the largest palindrome in a string. It works fine when the string is short, but every time I test this code with 1000+ characters in a string, it takes forever to ...
-1
votes
0answers
16 views
Python :SPOJ problem (Prime generator) working on my pc but not on the website [on hold]
I am solving a problem in SPOJ (Prime generator) I made the program it works perfectly fine on my computer but doesn't seem to work on the SPOJ and I absolutely don't know why I even double checked ...
0
votes
1answer
18 views
Checking whether users have a role that allows them to index sheets
Is there any DRYer way to write this method ? or is it better to keep it this way for better reader understanding ...
Each role has a list of authorised activities for a specific resource ( in this ...
2
votes
1answer
27 views
Multiplying over a matrix
The below code is a solution I put together for the Project Euler #11 question which asked to find the largest product of 4 numbers of any direction in a matrix (horiz, vertic, and diag all ...
5
votes
2answers
73 views
Typing training with GUI in Python
This script allows you to practice your typing skills, as soon as you finish typing a new word appears for a non-stop typing experience. The code has in memory the top 100 words as per the Pareto ...
1
vote
0answers
24 views
CSV to JSON conversion in Java
Since I've looked far and wide for a good example of this to no avail, I have created my own using the JSONArray and JSONObject ...
-2
votes
1answer
45 views
Singleton as static instance
In my project I need to have one class as singleton which must be globally accessible:
board.h:
...
3
votes
2answers
34 views
begin and end overloads for istream_iterator
I wrote this pretty straight forward begin and end overloads for istream_iterator.
Is this standards compliant? Any problems with usage?
...
4
votes
0answers
24 views
Grid with images in RecyclerView
I've created a Grid with a RecyclerView similar to the GoogleIO 2014's generic media player one.
GoogleIO generic music player
Mine
The thing is that the ...
1
vote
0answers
32 views
Binary Bayes network classifier in Java - Part II/II
This is the continuation of Binary Bayes network classifier in Java - Part I/II
TERMINOLOGY
We are given a directed acyclic graph (dag) \$G = (V, A)\$, where \$V\$ is the set of nodes and \$A ...
8
votes
1answer
120 views
Binary Bayes network classifier in Java - Part I/II
I was working on the binary Bayesian network classifier I asked about earlier.
See also Part II/II.
See also the next iteration of Part I.
TERMINOLOGY
We are given a directed acyclic graph (dag) ...
-1
votes
0answers
20 views
Logger class for use in other classes [on hold]
This is a simple Logger class I've written to use in any of my classes that need certain logging. It's working as is but I'm not particularly sure about the safety ...
6
votes
4answers
157 views
Finding the floor value in an array
Problem:
Given an sorted array of N distinct integers, find floor value of input 'key'. Say, A = {1, 2, 3, 5, 6, 8, 9, 10} and key = 7, we should return 6 as outcome.
How can I optimize my ...
-4
votes
0answers
20 views
Calculator using while loop in c# [on hold]
here is my code .there is no any error. but i am not getting any output, if i press y or n so please reply me . if u have any suggestion.thank you.
...
1
vote
0answers
15 views
Util method for generating an INSERT sql dynamically
I'm currently building software that:
'talks' to Google Analytics API,
fetches data,
persists the data to a MySql db.
Insertion of data into the db needs to happen automatically - based on the ...
4
votes
0answers
34 views
Typing exercise app
I've been writing a program to improve my Javascript skills.
It's a very simple app for typing practicing.
...
4
votes
0answers
36 views
Attempt at type-safe enums in JavaScript
I wrote this tiny library yesterday. The goal was to implement enums in JavaScript with type-safety. I modeled the implementation similar to enums in Java, since that is what I am most familiar with.
...
2
votes
0answers
16 views
insert and attach tag to the post in same time
I'm beginner in laravel. I created a form with title, body and tag input and there are 3 tables: posts, tags and post_tag.
Now I use this function to add new tags and attach them to the post
...
2
votes
0answers
17 views
Create a Tree Node from JavaScript Array
I'm trying to create a list of subpaths from a flattened array.
Here's the starting point:
...
3
votes
2answers
134 views
Loading Active Directory users by username and by SID
I have many different methods like ones below, but is there way I could improve them and remove duplicate code ?
...
2
votes
0answers
8 views
use QSqlQuery::bindValue() for variable number of placeholders?
I am familiar with the simple use of QSqlQuery::prepare() and QSqlQuery::bindValue() as in:
...
2
votes
0answers
14 views
Cmake module that improves upon CheckLibrariesExists
The following module AssertLibraryFunction improves upon CheckLibrariesExists in two respects:
It honors the optional argument ...
-4
votes
0answers
24 views
how do i inprove upon my recursive binary search in java to prevent any possible user errors [on hold]
how do i prevent the random error that i keep running in to.
im really unsure. also im trying to increment numcalls as a counter to count how manny times the recursive call... is called.
...
2
votes
0answers
41 views
A basic Linux daemon
To help me relearn C++ I'm looking at writing a simple proxy. At the moment I've got a logger, command line argument parse and simple daemon (it does nothing beyond log). Next I'll be looking at ...
4
votes
3answers
46 views
Get multiple minimal number from array
I have script for get three values (minimal numbers) from array :
...
7
votes
1answer
70 views
Generic domain independent Monte Carlo Tree Search methods library
I've written this small generic library for the purpose of my Bachelor’s thesis. It's fully functional and unit tested and I want to get as many opinions as possible regarding overall code quality ...
1
vote
1answer
21 views
Menu visibility toggle method
I've just created a method that toggles menu visibility. At the moment I've gone with an if..else which checks my flag and acts ...
0
votes
0answers
21 views
After Using Youtube Video Close Bootstrap Modal [on hold]
I'm using bootstrap modal and youtube video with iframe code. I've a problem about that.
First of all bootstrap modal should open when browser is loading and It's ok. I did this. But modal should ...
3
votes
3answers
77 views
Project Euler #3 Largest prime factor
Given
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
Solution
...
2
votes
2answers
48 views
Efficient method for loop iteration
I have chosen two options for looping through files in a directory. Let me know which one is more efficient (in speed/memory and GC).
Option 1: (collect the file name in an array and loop through it)
...
3
votes
0answers
26 views
Rewriting to single pipeline by using data flow blocks
I have a number of messages with a payload as a list of items. My goal is to transform the message payload without losing the relation between the message and payloads.
Isn't it possible to rewrite ...
1
vote
0answers
52 views
Red-Black Tree (2-3-4 node tree) map implementation
Here is an implementation of a red black tree that I made. I am pretty sure it's working fine though I may have overlook something. How can I improve it in any way possible?
Interface:
...
4
votes
3answers
63 views
State machine implementation
I have written a simple state machine. Comments and feedback are welcome.
...
4
votes
1answer
77 views
Producer-Consumer in C++
This is my first experimentation with the producer-consumer problem (and thread manipulation in general), so any feedback on taboos and fixes is greatly appreciated!
...
4
votes
3answers
60 views
Setting the smallest number so far from user input
I'm trying to teach myself C++ from Stroustrup's Principles and Practice Using C++ (second edition) and I've gotten to the drill in chapter 4. The problem tells me to make a program that takes in a ...
3
votes
1answer
38 views
Ability System in my game
I'm writing a game in C# Monogame, and I've decided to make my project as modular as possible.
GitHub
At first, I've had a single project with a folder that's separated inside to other folders ...
3
votes
2answers
38 views
Get missing letters - TopCoder challenge
I'm working on a TopCoder problem which seeks to find the letters preventing an input sentence from being a pangram in all caps, alphabetical order.
MissingLetters.h
...
5
votes
1answer
32 views
Fill a container from several threads
I want to generate some random data and store it in a container. I split the container into disjoint intervals using iterators and pass them to a thread function (I hope its body isn't important ...
4
votes
0answers
23 views
Displaying NFC card data in Binary, Hex, String, etc
I am working on an Android application for reading NFC cards. I came to a point when I needed to design an abstract class to streamline the process of creating ...