0
votes
0answers
5 views

My first LL grammar

I've decided to use ANTLR4 for my toy project, however i'm not sure if i got the whole idea right, for example i'm confused with collectIdentifiers() method because ...
1
vote
0answers
6 views

Crank-Nicolson. Advection - Diffusion. Perfomance

I am writing an advection-diffusion solver in Python. I am quite experienced in MATLAB and, therefore, the code implementation looks very close to possible implementation in MATLAB. I implemented the ...
-5
votes
0answers
17 views

Functions are illegal [on hold]

What does it mean when all my functions are illegal? ...
1
vote
1answer
16 views

Python Battleship Game

I have a 2-player game of Battleship written in Python, but I've reused a lot of code for the second player's decisions (particularly in the play_game function). I'...
0
votes
0answers
20 views

Convert class to another class and vice versa [on hold]

I've a domain class named Campaign. ...
0
votes
2answers
21 views

Java class for sorting arrays based upon QuickSort algorithm

Hint: This question is a follow-up to my Code Review question from 09.01.2017: Class sort with BubbleSort algorithm After been showed Mergesort and QuickSort as pseudo-code this week in lecture ...
2
votes
0answers
6 views

JS Data Fetcher and Stripper for Statistics App

This is pretty much the first actual (not "hello world") program I'm writing. It's a rewrite of this app and my aim was to increase the fetch speed, and increase the cache storage efficency. I've more ...
-1
votes
0answers
11 views

stack Push& pop [on hold]

import java.util.Scanner; import java.util.Stack; public class Stack_Ex2 { ...
3
votes
0answers
23 views

Multiple doubts about Repository pattern

I have implemented the Repository pattern in my Web APi 2 + Entity Framework 6.1 + Angular 1.4 SPA site. The application allows management of a martial arts club. One of its functionalities is to ...
4
votes
4answers
48 views

Insertion sort C++14 implementation

I have implemented insertion sort using C++. Is there any way to improve my code and is it CppCoreGuideline compliant? As I passed the vector as const in print ...
-4
votes
0answers
20 views

Calculate the squares and cubes of the even numbers 0-20 in C# [on hold]

I'm new to C#. So far I've done Java only. Still consider myself a beginner in Java. Calculate the squares and cubes of the even numbers 0-20 in C#. So far I have... ...
-5
votes
2answers
42 views

Finding the largest prime factor of a 12 digit number [on hold]

I created this using C++ and this gives the largest prime factor of a number.But my problem is if I try to find the largest prime factor of a very large number (12 digit number) it gives an error or ...
5
votes
1answer
37 views

C program for whitespace normalization

I have made a beginner program using C that uses file handling and formats the given file. Formatting includes removing trailing blank spaces, replacing one or more blanks by a single blank and also ...
4
votes
0answers
19 views

CtCi 2.6: Implement a function to check if a linked list is a palindrome

I would appreciate feedback on the linked list implementation and usage below for question 2.6 from Cracking the coding interview book. ...
-5
votes
0answers
18 views

Outputs week day of a given date [on hold]

Here the blog of the code, just visit the URL: http://terminal-geeks.blogspot.in/?m=1
5
votes
0answers
25 views

Simple Tic-Tac-Toe game in React.js

I'm relatively new to react and attempted to create a simple Tic-Tac-Toe game. Would be great if i could get some feedback on this. Again, at this point using only React (no Redux). main.js - main ...
5
votes
0answers
29 views

Minesweeper JavaScript Prototype

I am looking for some review of a Minesweeper game that I made as my first JavaScript program. What I have here is simply the prototype for the minesweeper game while I handle the actual grid in a ...
5
votes
1answer
29 views

Get IP info from a FreeBSD machine

I'm try to get the public IP address from my FreeBSD machine and use it for the rest of my code. Is this implementation good? Can it be optimized more? Can you see some gaps here? Something that ...
4
votes
1answer
37 views

Simple Affine cipher

The affine cipher is a simple mathematical substitution cipher. If you're interested in the details behind how it works, this page goes further into detail. After writing a program to encrypt and ...
2
votes
3answers
26 views

Get the difference between two dates, in the most convenient unit

I use the following code in Javascript to get the difference between two Date objects. I want the result to return the difference in: seconds if the result is less than 60 secs minutes if the result ...
5
votes
2answers
42 views

Creating a script to automate implicit remoting

Goal: I am attempting to create a script that would automatically establish a PSSession to a Windows server for implicit remoting. Problem: ...
0
votes
1answer
40 views

Finding Wilson Primes

Here's an explanation of what Wilson primes are. The first three Wilson Primes are 5, 13 and 563 and the fourth is larger than \$2×10^{13}\$. I was curious as to how much memory/processing power it ...
2
votes
1answer
51 views

Java Swing Calculator

I've been learning java for over a year and I'm looking for better ways to learn and I'm trying to get a better idea of where I am as a programmer. I honestly have no clue if my code is good or bad. I'...
3
votes
2answers
71 views

Update/Insert/Delete on a particular database table

I'm updating a solution that I wrote a while ago. I've got a WinForm that does Update/Insert/Delete on a particular database table. I've got all of the database access code in the form. Is this bad ...
-2
votes
1answer
43 views

Linq query combining three tables [on hold]

I have a linq query that combines three tables: Users, Products, and User_Has_Products I ...
7
votes
0answers
43 views

A vanilla JavaScript library for typesetting pseudocode in HTML documents

I have this plain JavaScript library for typesetting pseudocode in HTML documents. (See the documentation for details.) (See the GitHub repository - broken as of now.) Source code algotype.js <...
6
votes
0answers
33 views

Piano, output all the keys and give a scale

I've two snippets below, the first one output all the keys of a piano and the second one give me a scale when given a starting note. For those who don't know how a piano is structured here is an image ...
-1
votes
0answers
22 views

Delegating raise of exception to client code [on hold]

Suppose I want client code to override exception behaviour. What is the most appropriate way of doing this? It is understood that the callback must not return to its caller: It should either abort, or ...
2
votes
1answer
29 views

Extract rotation values from a CSS string in JavaScript

I have the following function that takes out the rotation values from a CSS string and returns them as an array. ...
3
votes
4answers
267 views

Find element that has been removed from a shuffled array

For a function to determine which element has been removed from a shuffled array, I came up with: ...
-3
votes
0answers
24 views

API for subtitle conversion in PHP [on hold]

I have made a converter for subtitles in PHP. Can something be improved in this API? Would you do something differently? GitHub ...
1
vote
1answer
23 views

Show weather data at client's location

I am beginner and I want some tips on this code i have written. How can i make it better, shorter cleaner. And the isMobile() Function is borrowed from the internet. It's a Weather App That gets Data ...
3
votes
2answers
57 views

Prime number generator in Python

I have made a Python program that can perform some prime number functions. For example, it can produce an endless output of sequential primes. I am looking for ways to make it faster and cleaner. When ...
2
votes
0answers
18 views

Speed up real time plotting

I am using the Arduino to acquire real time data via EMG sensors. The data read from the port are stored in a buffer. Every 37 bytes (with the right header) are considered as a new sample. To speed up ...
3
votes
1answer
23 views

Noughts and crosses command line game in Python 3.5

Based on this Code Review answer, I have created a noughts and crosses game in Python, which asks for an index (1 to 9) and updates the grid, and displays it on the screen. I have done some very ...
-1
votes
0answers
15 views

Redis protocol implementation by Kotlin

I have created my first project on the github. It is Redis client protocol implementation (request-responce part only). I would like to make my sources more Kotlin style. Please, check my sources and ...
2
votes
1answer
39 views

Haskell REST API + PostgreSQL

I'm making some small REST API, which I have never done before. I've got some basic stuff working. Now my job is to add new entities to this, but all my work is reduced to copy-pasting code I have ...
6
votes
3answers
473 views

Car generation algorithm

I have an algorithm which generates some cars (quote unquote) and displays them using Graphics. I would like to know if my code is using Random correctly, and if it has any memory leaks. Or if there ...
-4
votes
0answers
67 views

Do I understand the Y combinator? [on hold]

This is a question about how to make the lambda calculus understandable. I love the paper of Raul Rojas or the slides of Shlomi Fish, much better than several others beginning with these Wikipedia ...
-6
votes
0answers
28 views

Can we reduce the Complexity using segment tree in this code? [on hold]

Can we reduce the complexity using segment tree here or any other means? if yes, How? it's a code for the finding longest chain like the example below: if ...
-2
votes
0answers
20 views

Student Data Base [on hold]

Write C program that helps a Professor to manage student records. Each student’s record contains information like Student ID, Name, Course Major & CGPA, and are then stored in a text file. The ...
5
votes
3answers
79 views

Simply print the string backwards

This code is very, very simple, but I was wondering how it could be improved: ...
-3
votes
0answers
17 views

Modify the given sequence such that after several operations all elements are zero [on hold]

The is the given problem on HackerEarth: Suppose we have a sequence of non-negative integers, Namely a_1, a_2, ... ,a_n. At each time we can choose one term a_i with 0 < i < n and we subtract 1 ...
7
votes
2answers
73 views

Neural Networks in C

This block of code is one of my first C header files I have made; it's ported from a Python program I made a few months ago for a project. I was just looking for advice on how to increase the ...
-3
votes
0answers
14 views

How do you use Structures and Pointers to create a linked list [on hold]

This is an assignment that I have to do for class, and I am not sure exactly what is being asked. I tried to do the things that I understood. However, I am unsure about how to write the structures and ...
2
votes
0answers
22 views

2D Game - Ray-cast collision handling

This code is an excerpt from an infinite platformer I'm working on for fun. It belongs to the class GameObject from which every object i.e platforms, player, ...
4
votes
0answers
22 views

A humble converter between “calendars”

For a special writing and/or worldbuilding project I have, I created a special program. In the story, different factions have different ideas on what should be considered the first year of their ...
-1
votes
1answer
8 views
2
votes
0answers
11 views

Firebase many to many relationship structure

I'm trying to create a logical and scalable many to many relationship data structure in Firebase. A user can authenticate with Facebook/Google, upload 3 photos, and a video. Users can also "star" ...
-2
votes
0answers
19 views

15 30 50 per page