2
votes
0answers
13 views

Factoring a number

Here's my program for factoring a number. It works, but it's quite slow. I'm looking for suggestions for optimizing. The lines are indented just for readability. ...
0
votes
0answers
9 views

How Do You: Only Total Similar Items Between 2 infiles [on hold]

I have a program that I want to only total similar items. That will only total them if they are equal. The infiles looks like this, but can also be altered since it should work NO MATTER what is ...
4
votes
1answer
14 views

Java (Android) abstract class correct implementation

I am looking for some comments on my code and whether or not this is the best way to create an abstract class. In addition, some of the abstract methods are rarely called so I use the base variables ...
1
vote
1answer
14 views

Reserving seats in a movie theater

I'm writing a C program to reserve seats in a movie theater. I am validating the selection of seats: ...
1
vote
0answers
11 views

Comparison of sprite movement implementations

I've come up with two ways to do sprite movement with CreateJS, and I'm wondering if one is better than the other as far as performance and maintainability. The player data is saved in a json file ...
1
vote
0answers
16 views

Interfacing with instruments using pyvisa

I'm new to Python, and after running through some introductory exercises I wrote a class definition for working with some hardware, specifically a Signal Recovery model 7230 lockin amplifier. In the ...
9
votes
5answers
197 views

Monty Hall Paradox in Java

I was wondering if this code look neat, and if I should change anything. I was planning to implement Frames (Or JFrame) tomorrow on it. Would it be a good idea to use functions? ...
3
votes
4answers
75 views

Custom Sum implementation

There is a custom summary function needed as to receive an integer input (e.g. 32456) and returns 3+2+4+5+6. Can you think of ...
2
votes
1answer
23 views

Kernel development

I'm trying to learn more about kernels, so naturally I started to program one. I'm using tutorials from here. Right now I have modified the printf() that was ...
1
vote
1answer
7 views

Regex substitution using a variable replacement string containing backreferences in Perl

I have written a program where the user inputs a regular expression and a replacement string, and the program will search through a set of files and do the replacements. The user is allowed to use ...
1
vote
0answers
18 views

PHP looped concatenation

This code takes the results of a database query and uses them to populate the options in a combobox on a form. Would it be better to start with an empty htmlCode ...
1
vote
1answer
30 views

LINQ grouping and sum

I have 4 properties which values I generate using LINQ: ...
5
votes
1answer
64 views

Formatting an ID string

I'm working with an API which gives me 19-digit ID numbers, formatted in blocks of four except for the last 3 digits. While I tried a for loop, I thought it would be most efficient to simply use a ...
0
votes
0answers
9 views

Controlling a Windows Service from a WPF app

I have a WPF Control Panel app, where I'm trying to stay close to an MVVM architecture. The control panel (the "the CP") is for a WCF service ("the Scheduler"), hosted in a Windows Service ("the ...
4
votes
0answers
42 views

Python program that scrapes my CS teacher's website

I am new to programming, and I'm looking forward to seeing what I can do to improve my code. I've been working on creating an individual final project for my python CS class that checks my teacher's ...
6
votes
0answers
26 views

Simple Java Wizard

Working on a project, I encountered a need to create a wizard and when I ran into the need for a second, slightly different wizard, I generalized into the following: Top-level Wizard class: ...
3
votes
1answer
27 views

RPG game using XNA

I know this code needs some organization like classes, enums, methods, arrays or something but I just want to know if I could have created a character movement script, thereby shortening the code ...
6
votes
2answers
344 views

Checking if a number is prime

Is there a better way to check if a number is a prime? ...
8
votes
3answers
216 views

Checking if a string is a pangram

This checker works perfectly but I have a strong feeling that I could make this script much more compliant with the "Zen of Python", especially having read a book about it recently. There is no doubt ...
2
votes
1answer
11 views

1-D intersection of lines given begin and end points

I have a fairly basic question here: I want to find if two lines on a 1-D plane intersect. I know of two simple ways to solve this, but I wanted to know if Python has a more elegant way to solve this. ...
1
vote
0answers
11 views

jquery .load() div content from URL with hash-sign for id [on hold]

I have my page so far: einserpasch.com The crucial markup is this: ...
-4
votes
0answers
14 views

Translate sql query to linq c# [on hold]

please help me to convert this query to linq c# ...
5
votes
1answer
46 views

Having sync and async methods by implementing future interface

I need to make a library in which I will have synchronous and asynchronous methods in it and this library will be used by our customer in our company. Some customer will call the ...
4
votes
0answers
37 views

Event Listener and Publisher

This is my first attempt at creating an event system. My plan is that upon publishing, the listener receives both a reference to the model and to the publisher. This allows the publisher class to ...
7
votes
1answer
82 views

Custom Serialization of Game World

I'm working with libGDX for a game, and over the last few days I have tried a few different types of serialization before settling on a custom serialization implementation. XML had huge file sizes, ...
1
vote
1answer
16 views

Logging errors with the same exception type

I wrote some code which simply retrieves the HTTP status code of the passed in URL. There are multiple potential causes of the same error. I am hoping to get some all around feedback on this code, ...
1
vote
2answers
48 views

loadSmartConfig function

I am writing a conditional that checks two values, for several different scenarios. What I am modifying is a series of objects, some of these objects are in arrays, and some are just arrays. I need ...
3
votes
0answers
22 views

Implementing common random numbers in a simulation

I originally posted this on stackoverflow, but the came across this site which I think the question is better suited for. I am building a small simulation in Python and I would like to use Common ...
1
vote
0answers
26 views

Advice on modelling with generics in Java

Use Case The third party library that I am working with implements its data model in this fashion. ...
0
votes
1answer
34 views

Timers to use various Task(s)

I am developing a C# program, which performs various tasks in parallel threads. I created a Base task and let all tasks derived from this class execute. I just want to know if this a viable approach ...
1
vote
1answer
32 views

Deleting node from LinkedList

I have this function to remove nodes that matches a certain criteria in the list. Initially when I wrote it, head node was not deleted if ...
5
votes
1answer
92 views

Awesome INI Loader

I wrote a simple to use C++ INI file parser. The only thing it requires is the STD libs (of course that come with most major C++ compilers) So far it works very well, and the only thing that needs ...
1
vote
1answer
67 views

Project Euler 25 - 1000-digit Fibonacci Number

I have recently completed problem 25 from the project Euler site. The Fibonacci sequence is defined by the recurrence relation: Fn = Fn−1 + Fn−2, where F1 = 1 and F2 = 1. Hence the first 12 ...
1
vote
0answers
18 views

Local branch update script using Git and PHP

I'm using Git and PHP to create an update script which is sync local branch and the master. It checks about new updates, and if yes, it proceeds to the Git pull request and any response got from the ...
5
votes
1answer
48 views

Basic cryptography algorithm

I wrote 2 classes in order to implement some basic cryptography algorithm. I tried to use some object-oriented concepts of C++. I'm a beginner, so any comment or suggestion is welcome. First class: ...
4
votes
0answers
31 views

filter function implementations using copy_if Algorithm vs. For Loop

I have the following method of some class, which also defines the method isAllowed: ...
0
votes
0answers
23 views

Build a collection of CLR object using linq Dictionary<string,List<string,string>> [on hold]

I'm building a WCF service to retrieve a list of "AttributeName,AttributeGroup,AttributeValue" For example, ...
1
vote
0answers
8 views

Android: accessing global data through replaceable instance

I have to access global data shared between activities in Android application. I have simplified DataProvider class to contain only one field - ...
-2
votes
1answer
33 views

Simplify python conditional

This is a follow up to Log probe requests of WiFi devices focussing on a specific element of the code. Can I simplify this code and make it more readable? ...
-1
votes
1answer
35 views

Formatting a long filesystem path in Python

This is a follow up to Log probe requests of WiFi devices focussing on a specific element of the code. I have this line of code: ...
4
votes
0answers
25 views

Is there a better SQLite update / insert pattern than this?

I've got a function which updates an existing record or inserts a new one, but it looks very clunky to me. ...
1
vote
1answer
28 views

Argparse implementation

This is a follow up to Log probe requests of WiFi devices focussing on a specific element of the code. How can I indent this code to make it look great and be well formatted? ...
-1
votes
0answers
36 views

Algorithm analysis for prime factorization of a number [on hold]

This program is supposed to give the prime factorization of a number. Although its working fine, I would like to increase the efficiency of my program by modifying my current algorithm or to use a ...
2
votes
0answers
30 views

Trial Multiplication for Factorization

I am trying a trial multiplication for factorization. This is a general example, but each sequence can be specified to pairs of sequences \${p,q}\$ for a given \$n\$. For example, if \$n\$ ended in 3, ...
2
votes
1answer
36 views

Converting a string to a corresponding type in JavaScript

I need to convert a string value to its primitive type in JavaScript. Other values that are not of type String should just be returned. Example: String '...
0
votes
1answer
36 views

Creating and sending a Fixed-Width file

This function will run every x seconds. PAN: The name we are calling our fixed width file we are transmitting. ...
0
votes
4answers
170 views

Returning an amount

In this code snippet, I want to be able to return the Amount as it is, unless the CashFlowTypeID is 12, 13, 14 or 15, in which ...
0
votes
0answers
15 views

twiiter max_id and since_id [on hold]

i am using twitter user_timeline api to get all tweets of a user . it returns 200 in single request but problem is that i want to get all tweets if tweets are like 400 or 500 below is my code that ...
0
votes
0answers
13 views

Trying to print entire Kendo grid(with paging) at once. Trigger Print function(print only div) only after previous function has executed [on hold]

This is my First method which sets the page Size dynamically and takes data from a server. So takes a bit of time. ...

15 30 50 per page