All Questions

0
votes
0answers
11 views

Brainfuck interpreter in Haskell

Okay, so I just started learning Haskell around a week ago and this is my first real program that I worked on all of yesterday with a lot of help from IRC. I know that using indicies and arrays is not ...
1
vote
0answers
13 views

Optimal string literal tokenizing algorithm

I have a tokenizer, where one of the token types happens to be a C# string type. It takes a TextReader as its input, which is created from a StringReader, and it needs to support the basic stuff C# ...
1
vote
0answers
15 views

Loading the JDBC driver jar dynamically from external location

I have a small project in which I get the URL, username, password, and driver from a text file and I have to fire a query on the database by dynamically reading the jar file in a predefined directory, ...
1
vote
0answers
13 views

JOIN and sprintf rather than two queries and echo

It works fine, however it's a little messy. I understand it would be better for performance to use JOIN and have been advised before to use sprintf. However, it's ...
3
votes
1answer
20 views

toBase64 encoder

My code convert text to Base64. I used the algorithm without bit operations. What do you think about my code? ...
-1
votes
0answers
17 views

how to perform calculations using stacks Java [on hold]

Hello everyone I have to do a java calculator using stacks and when i try to do the calculations it does not work. Example if my stack contains 5 and the user enters -2 stack should change to 3. Here ...
-1
votes
1answer
27 views
-1
votes
0answers
20 views
3
votes
1answer
29 views

Tic-Tac-Toe in C++11 - follow-up

This is based on my first Tic-Tac-Toe game: Tic-Tac-Toe game in C++111 i have come up with different game logic for my game. I would like to know which one is more reliable and effective and how to ...
0
votes
1answer
10 views

Including references in onResume Lifecycle

Whats a more concise way to do this? It's way too verbose for my taste. ...
1
vote
0answers
32 views

Fastest way of calculating mean values for each indices

I have two 2d arrays of equal shapes: given_array and reference_array. I have to write a file for each unique value of the reference_array computing mean values where the unique value are in the given ...
-3
votes
0answers
35 views

C# in Visual Studio [on hold]

C# Program Determining if a number is either a multiple of ten or within a particular set of ranges I have a few loops that I need in my program. I can also write out the c# code but I'm not entirely ...
0
votes
0answers
16 views

Merge Sort Variant: Using array link [on hold]

I was looking for the variants of Merge Sort. So my textbook says, A variant of function Merge in which No records need to be moved at all, can be implemented by use of an auxiliary array links. ...
4
votes
1answer
26 views

Simple One Way IPC Implementation for pcntl_fork

It is a common task for me to need to run many nearly identical child processes. Not often but sometimes I need those child processes to communicate their results back to the parent process. I have ...
4
votes
2answers
20 views

PHP Usersystem basic class

I've recently picked up OOP in Java and I'm trying to use it for my PHP usersystem. I've come up with the following generic.class. On my main site, I'll simply put ...
1
vote
2answers
19 views

Lua program to clean up phone numbers

How idiomatic is my code? Since Lua does not have classical inheritance such as in OO languages. Feedback on the test and implementation are both appreciated/welcomed. The rules are: If the phone ...
2
votes
1answer
16 views

PHP application configuration

I've started looking at Heroku for application hosting and deployment and it appears that my configuration constants need to be stored in environment variables. I can do this in Heroku, but my ...
5
votes
1answer
38 views

Custom Memory Allocator in C

I made this because I need to make a program that creates and destroys huge trees in gigabytes for hours or time. The default malloc/free in MinGW/GCC is too slow. ...
3
votes
1answer
32 views

School which registers students by preferred courses

The point of the application is to create a school, create courses for that school, create students and register them to the school, assigning them courses based off the courses the prefer. There are ...
-1
votes
0answers
8 views

Ruby return last element of list [on hold]

I was doing of one of codewars.com exercises and was asked to return the last element of the list. Here is my answer ...
-1
votes
0answers
14 views

Creating a fixed calculator in Python 3 [on hold]

I am new to Python and I am trying to create a calculator to do a complex calculation. I need it to take input from a user and do deductions and multiplication based on that input. The scenario ...
0
votes
0answers
14 views

Inheritance after instantiation? [on hold]

Problem When writing context-aware class wrappers, I found that regular inheritance wasn't usable. Leaving me with the task of writing very light wrappers over the "parent" class wrapper: ...
5
votes
3answers
136 views

Small command-line helper tool

I've coded a small command line helper tool for this library I'm working on. The library provides tools for the use of Virtual Texturing on iOS devices (mainly games). This little command line helper ...
3
votes
1answer
34 views

Removing duplicates from unsorted LinkedList

Removing Duplicates: ...
1
vote
2answers
22 views

Substituting Hebrew letter variants — should I make a function?

I have two functions that replace letters. In one function, I'm replacing a regular Hebrew letter with its final form, and the other function undoes this operation. (Consider it like ...
0
votes
2answers
47 views

2048 game implementation

I do not use JavaScript often, so I will be thankful if you could improve my code. It is my implementation of the game 2048. Here is a part of the Angular controller: ...
1
vote
2answers
58 views

Simple deck of cards

I had recently completed one programming challenge where I've had to design a deck of cards. The time was limited but I tried my best. I designed the basic operations and am wondering if I can improve ...
5
votes
4answers
243 views

Using std::unique_ptr and std::move

I'm trying out new things (on class Inproc), specifically using std::unique_ptr and ...
2
votes
2answers
25 views

Swift complexities with Dictionary

I have been trying to learn the various aspects of the languages I know so far to do the Daily Challenges in reddit (/r/DailyProgrammer). The one which I am working on just now asks for an ...
2
votes
2answers
82 views

PHP secure random number generator

I just wrote this function and I was curious if anyone could find any flaws in it? It look pretty secure to me but I just want to make sure since I'm no cryptography expert. ...
-1
votes
0answers
13 views

Ruby: using .send within a method behaves differently than calling it outside [migrated]

I'm trying to write a little snippet for my Rails app that checks if any tags are present for an object. I have the following code: ...
5
votes
3answers
222 views

Tic-Tac-Toe game in C++11

I have found Tic-Tac-Toe source code: Tic Tac Toe in C++ I have rewritten the source code in C++11 as shown below. How can I minimize hardcoding in the game logic? ...
4
votes
1answer
46 views

String split and tables

I have a table structured like this: ...
1
vote
2answers
34 views

Keeping attribute names simple when using getters and setters

Is the use of _pn in __init__ pythonic? It seems that most examples change the actual attribute to ...
4
votes
1answer
45 views

Finding Magic Comments to Create a Custom Task List

I've been working on a COM Add-in for the VBA IDE with a friend. The idea is to search the active VBA Project for "magic" comments and create a task list much like any sane IDE would have. This is ...
0
votes
0answers
12 views

Passing data from domain to UI in Java [on hold]

How do you pass data to paintComponent(Graphcs g) without using a direct reference to your domain in your view logic? ...
2
votes
1answer
36 views

Score Validation

Was just wondering if I was using nested if statements to much. I've been looking around and it seems that people try to not use them. Also does the code look messy in any way? Anyways here it is: ...
-2
votes
0answers
11 views

Tic Tac Toe CMD [on hold]

Im making a command line version of Tick tack Toe for my class yet I keep running into the same problem it keeps stoping after player one take his first turn no player 2 no call back to player one ...
0
votes
2answers
23 views

Determining coefficient in geometric progression

For an assignment at Uni we had to code a program that takes numbers as input and determines the coefficient if they form a geometric progression once you declare EOF (ctrl+z). If the user inputs a ...
0
votes
1answer
34 views

File input and sorting averages with movies

So far I have Java code that will: take in two .csv files store each line as a string in a string array split it into a 2D string array where a comma would act as the separator sum the number found ...
0
votes
1answer
49 views

Octree code performance

I'm using a simple Octree in my program, wanted to know if my implementation could be faster. It is part of this program: https://github.com/Mortis69/rendera Octree.H: ...
0
votes
0answers
28 views

Is there a better way to make a conditional second call than using deferreds like this? [on hold]

I need to make one ajax call, then based upon what's received possibly make another. Is there a better way to user jQuery deferreds than what I have here? ...
-2
votes
2answers
47 views

Feeder for returning an array of items rated by users

Feeder is in charge of returning an array of items rated by users (feed). If there is a watching user (...
-1
votes
0answers
16 views

C++ code problem. Input needed [on hold]

There are several problems with my code: I am trying to create a menu but it goes to infinite loop when a letter or character is put in. It is the same if I used the function ...
0
votes
0answers
5 views

TextFile into a dictionary [on hold]

I need help with reading my TextFile into a dictionary. My textfile is the following: loan 2 debt 3 rate 2 help 1 cousin 1 lawyer 1 Now I need to convert this into a dictionary. I have experimented, ...
2
votes
1answer
40 views

Using TAGS with <script> on your websites

This function creates a series of links at a desired destination by the usage of a premade tag system. Usage: createMyTAGS_DATA passes in a single line of all ...
2
votes
1answer
20 views

Improvement on a triggered movement script

I am trying to more or less perfect a movement script that activates when "triggered" by another object. Below I have the code for both the triggering object as well as the object being triggered. I ...
5
votes
1answer
37 views

Get all points on a uniform discrete grid inside a circle's radius

I have a 2-dimensional grid defined by a known point gridCenter and distance between points gridStep and need to find all points ...
2
votes
0answers
9 views

Parsing URLs in Pandas DataFrame

I'm working on a project, and the client needs their Google AdWords destination URL query parsed, and the values spell checked to eliminate any typos (use instead of us, etc). So what I'm doing is ...
3
votes
2answers
58 views

Remove, Append, and Resize Using jQuery

I'm trying to essentially replace an element and make it transition smoothly to the new size... I started off trying to work with the appended element itself, but the padding and margins made that ...

15 30 50 per page