1
vote
0answers
7 views

PHP DOM XML Creation

I am currently working on Shopify webhooks which post xml to colarado timber line api. But due to the order protocol of colarado timber line API, it is required to modify the xml posted by shopify ...
0
votes
0answers
6 views

Simple alphabet scrambler — usage of vectors

I am currently learning C++, using this book: C++ Primer, 5th Edition I made this program to help me understand the usage of vectors in C++. I have prior programming experience(mainly Python), and ...
0
votes
1answer
8 views

Refactorings on a Win32 Screenshot saving program

Earlier this academic year I had an assignment to take a project I had written outside the context of University and apply a number of refactorings to it. I chose a program I had written a while ago ...
0
votes
0answers
14 views

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

Previous question: Tic-Tac-Toe in C++11 - follow-up 3 I've been told to use <random>. However, it seems a bit more complicated than it looks to generate ...
3
votes
3answers
47 views

Sieve of Sundaram for Project Euler 7: Python implementation slower than C++ and R

A friend of mine recently started learning R, and she complained to me that R is very slow. She was working on Project Euler Problem 7, which asks for the value of the 10001st prime number. For ...
5
votes
2answers
87 views

Printing the contents of a string array using pointers

I'm currently studying C and I'm trying to just print the contents of a string array. I'm using pNames to point to the first char pointer and iterating from there. ...
1
vote
1answer
27 views

Finding average word length in a given year

I have written a function which takes the year in question and words as a data which is a dictionary that maps words to the list of year/count. Now I am wondering how I can improve the code that I ...
4
votes
0answers
17 views

Virtual Texturing - Page Indirection Table

I'm working on a Virtual Texturing library for mobile devices based on OpenGL-ES. This is the PageIndirectionTable, one of the library components I would like to ...
1
vote
0answers
21 views

Parsing PHP-style nested query string parameters

I searched all over for a query string parser that could handle nested parameter names ala parse_str in PHP. I was unable to find anything, so this is what I've ...
-3
votes
0answers
16 views

Route to orders page [on hold]

I use Laravel as a PHP framework. I have a route to orders page. Depending on the user role I need to include different views and I have different logic for each role. It looks like this: ...
1
vote
0answers
12 views

XML processing, hopefully avoiding explicit arguments

I'm stuck trying to refactor code below into one that would be reusable in different contexts. I would like to print another triple, for "parent" sub-tree but without explicitly passing lens to each ...
5
votes
1answer
26 views

Automatic report generation from BibTeX

I wrote the following code for the question I asked here. Are there any catastrophic mistakes? (actually it did not really work with perltex and I am in doubt about having syntax mistake(s)) Also, I ...
3
votes
1answer
49 views

Typetokens in C++11

I have written a typetoken library in C++11 and I want to know if it is indeed typesafe, threadsafe and complete. The purpose of this library is to give an unique ID to every requested typename ...
-1
votes
1answer
28 views

Breadth-first search - and enumeration [on hold]

This is my try of an implementation of breadth-first expansion. ...
0
votes
0answers
14 views

CSV File Parser in Ruby - Attempt No. 2

The following is my second attempt at a basic CSV parser in Ruby. I've addressed suggestions that I've got for my previous version here. I have omitted all test cases - the code listing would be too ...
2
votes
1answer
26 views

Counter increment for search volume

I have written a jQuery function which accepts an elementId and an integer. The function then generates a counter which ...
1
vote
1answer
66 views

Using a Java queue

I am developing a plugin for a system, the plugin catches some events in that system, wraps them and pushes out to another system for analysis. The overhead generated by the plugin must be as low as ...
-3
votes
0answers
13 views

To make a code which allows user to enter data on monthly basis which gets stored in pandas data frame in respective months [on hold]

I have below pandas data-frame object. My objective is to use this as a data base to enter data in to each month using command prompt so that the new data entered via command prompt get saved to the ...
1
vote
1answer
23 views
1
vote
1answer
37 views

Saving a collection of WPF user control layout into an XPS document

I am making an application to save a layout of user control into an .xps document. But, the export doesn't seem completed if the data is too many. I've tried to encapsulate each part with ...
0
votes
1answer
39 views

Using method which return a String or creating wrapper for String

Which approach is better and why? First (inner class for wrapping): ...
1
vote
3answers
29 views

AudioMetaTagger: recursively read files and gather metadata

So the idea is to read metadata recursively in a chosen directory, load their metadata and display it into a table. Here is the simplified example of what I am doing. ...
3
votes
1answer
21 views

zipWith function in Scala

My implementation works, but it looks very ugly. Curious to see how it's better implemented. The zipWith function takes a list of lists (...
3
votes
1answer
38 views

Reading and writing files and resources

Doing IO in Java is a big pain. It got better with Guava and Java 7 and now about everything is there, but I never know exactly where. Most of the time I need to slurp a file. Nearly as often I need ...
0
votes
1answer
16 views

Java background server class that might be called from ui thread

I have a server communicating over network interface. This server should run on a background thread, so that it does not block the ui thread. The ui thread starts and stops the server. Even starting ...
1
vote
0answers
21 views

Reduce memory use for a property geolocator

So, I have to run a script against 40 million objects in my database: I wrote the script and I want 10 instance of it so I process my objects faster. The goal is to find all the neighborhood for each ...
2
votes
1answer
56 views

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

Previous question: Tic-Tac-Toe in C++11 - follow-up 2 Here, AI is being implemented. ...
5
votes
3answers
152 views

Join strings from a List<string> while also formating them

The code I have wrote works fine, this inquiry being purely for educational purposes. I want to know how others would do this better and cleaner. I especially hate the way I add the list items to ...
3
votes
5answers
338 views

Opening files using fopen only if user enters correct password

I wrote this program to just get some practice in C, but I have a question: Do you see anything that I am doing that will create bad habits in my future programming? ...
0
votes
1answer
18 views

Generation of all numbers of arbitrary length and base

quux (['0'..9'] ++ ['A'..F']) 2 generates hexademical numbers of length 2 (with leading zeros), but it's obviously possible to generate any base and any length. ...
3
votes
1answer
23 views

Improving names in a Bem list

I am having some trouble naming lists and list items using the Bem methodology. I want to emit a list of tags for a given blog post and I came up with the following names : ...
1
vote
1answer
11 views

Efficient Django model for blog post

I'm currently trying to create a travel blog using Django whereby users will be able to create a travel plan with the following features: Each user can create a travel event based on the start date ...
1
vote
0answers
42 views

Optimizing insertion sort for small amounts of data

I'm building a hybrid sort, and for that I need a fast and adaptive sort ideal for small sizes (< 65 elements). Insertion sort immediately comes to mind, and I've been tinkering with different ...
7
votes
4answers
423 views

Strategy pattern - design hash table

My programming skill has gotten rusty, so I would like to elicit constructive criticism that can make me write code better. I know the standard design is to use templates, and even obtain the hash ...
5
votes
3answers
37 views

Some simple Perl and Regex

Reads from a flat file of three columns, delimited by at least one tab character. Filters the three columns based on input; returns list of corresponding emails. Arguments passed like ...
2
votes
1answer
24 views

Determine all prime, palindrome string integers within a range

I have written a program in Python 3x to determine all the prime, palindrome string integers in the range of two given numbers. ...
2
votes
0answers
21 views

Removing nested blocks from a string

I wrote this function in scala that uses tail recursion to remove nested blocks from a text. Usage examples: ...
1
vote
0answers
15 views

Toggle dropdown menus for different menu items with Jquery

In a bigger project of mine I'm using angular to create a dropdown menu dynamically and then toggling a dropdown menu for some of the menu items. This is why I got a function that toggles the dropdown ...
5
votes
3answers
377 views

Try/catch in a Tic-Tac-Toe game

I'm looking at my code and it doesn't look very efficient. I'm simply trying to catch exceptions or prevent them from being thrown in the first place. Can you please take a look and tell me if there ...
6
votes
2answers
321 views

The Bucketizer Script

This code is written in a SSIS Script Component that basically accomplishes what I previously had as a T-SQL script, that was reviewed here. I need to split a 80 character string that contains 20 ...
1
vote
3answers
68 views

Coding on interfaces/superclasses not implementations

From pretty much any book I've read it always said to code on interfaces/superclasses and rarely on implementations, today though that advice made a bit confused about how I should format my code. ...
3
votes
1answer
29 views

Messenger supporting notifications and requests

I've written a lightweight (I think) class that acts as a messenger service between classes for both notifications (fire and forget updates to other classes) and requests (a notification sent out that ...
1
vote
0answers
27 views

Using the Template Design Pattern to reduce code duplication between two algorithms

I have made a Skyline query solver which for now can solve the query with two different algorithms. The first is Block-nested loop (BNL) and the second is Sort filter skyline (SFS). The two are ...
3
votes
2answers
222 views

“Ella” Java chatbot

I recently developed an interest in AI and thought I would develop this little chat bot. Are there any recommendations/modifications? ...
0
votes
0answers
28 views

Appropriate design pattern for DB side-effect [on hold]

I have a data access layer method to cancel an order. This operation should have an associated "operation history" entry. My first (naïve) implementation looks like this (c#): ...
3
votes
2answers
69 views

Twin Prime Algorithm Optimization

I have wrote the following algorithm to print out the Nth twin prime numbers: ...
1
vote
0answers
30 views

Usage of MVVM in iOS [on hold]

I'm an iOS developer and I'm guilty of having Massive View Controllers in my projects so I've been searching for a better way to structure my projects and came across the MVVM (Model-View-ViewModel) ...
4
votes
1answer
58 views

Speeding up Parallel.ForEach iterating through datatable and rendering report

I am attempting to speed up the processing of 5000 rows received from the database, which I then render as a crystal report, export to a byte stream and save in a database table. Currently I am using ...
5
votes
2answers
311 views

Counting Fermat witnesses and liars

We were asked to implement a program that calculates the number of Fermat witnesses and liars for odd numbers greater 1. This involves Fermat’s little theorem. Fermat’s little is used to identify ...
-2
votes
0answers
16 views

REST routes for API with multiple entry points [on hold]

I am writing a REST API for a pretty complex legacy system, with multiple applications and systems accessing it. The problem is that the different systems all know different things about the data. ...

15 30 50 per page