0
votes
0answers
1 view

self alias in closures

I use closures in java code a lot and because of the requirement of the project to include 'this' alias to all instance fields and methods, I used to use 'self' alias to reference the outer scope ...
0
votes
0answers
5 views

Regex for finding After Effects files in scene code format

I haven't used regex a lot (or is it regexes?) and I needed to set up a script that can gather a list of file paths that should adhere to a strict formatting convention, so I thought that sounded like ...
3
votes
1answer
9 views
-2
votes
0answers
20 views

Exposing IObservable through property or interface [on hold]

I want to have a class that will expose an IObservable<ushort> stream of values for a specific "Tag". I have identified two alternative implementations. Are ...
-3
votes
0answers
12 views

JAVA run time error(NZEC) [on hold]

I've been given the following task: Devu got hold of a 1-indexed array A consisting of N integers while Churu has an empty array B. Devu in his turn will choose a contiguous segment from his ...
-4
votes
0answers
11 views

Is this method is right to add ActionListener for JTree [on hold]

everyone.Here I want to extend DefaultTreeCellRenderer and create my TreeCellRender by rewritting getTreeCellRenderer,and I create a ...
-1
votes
0answers
17 views

Django application - code improvements and best practices [on hold]

I have just finished a Django application, and I would like to get from you some code reviews related to my code. Application flow: Basically, my application is accessing a specific URL (always the ...
3
votes
1answer
16 views

MVC partial views and AngularJS modules

I am using MVC+Angular. In MVC, I created partial views for search, listing, etc. I show them using: ...
2
votes
0answers
8 views

Binary tree implementation in Scala

This is my implementation of a binary tree in Scala. How can this be made better? ...
2
votes
1answer
17 views

Analyze very large sets of engineering data from Excel files

I am an electrical power engineer with some programing skills. My boss asked me to make a program which could analyze very large data, make some calculations and give the result. The task lookes like ...
0
votes
1answer
21 views

Calculate trapped “rain water” in structure

Supposed my input is [1, 4, 2, 5, 1, 2, 3] . Then we can create a structure like this: ...
0
votes
0answers
10 views

Hide/un-hide directory and open directory based on argument [on hold]

I have been working on a bash script that hide a directory by moving it to a .directory and un-hiding it by moving from .directory to directory. I have it working and it was working fine during the ...
2
votes
2answers
20 views

Advanced CSV-to-SQLite converter

I just wrote an advanced CSV parser that translates CSV to SQL(SQLite Compatible) statements, which are then inserted into the database. It translates variable names in the CSV to values defined in ...
3
votes
0answers
16 views

Pomodoro Timer via setInterval

I'm hoping for some input on if my code is DRY or how I could have made it more efficient. I am pretty new in terms of jQ/JavaScript and this took me far longer than I care to admit. I will post the ...
5
votes
2answers
195 views

Reversing a number

I was working through a programming challenge I found on Reddit and it seemed easy enough: Find all numbers less than \$10^n\$ where the number and its reverse (the reverse of \$123\$ is \$321\$) ...
2
votes
0answers
26 views

Extremely redundant HTML templating

This is horrendous. I'm using lodash's templating engine for this table. Here's the template for an individual record's row. I've got 5 different table and ...
15
votes
3answers
1k views

Oh my goodness: How many selfies have I taken?

The title is a joke on how some people take a lot of selfies pictures Recently, in The 2nd Monitor, there was a brief discussion on selfie answers, starting with this post. At one point, a user said ...
5
votes
1answer
33 views

Multi-threaded bitcoin vanity address generator written in Java

The application leverages the bitcoinj library to generate a vanity bitcoin address. A vanity address is simply a bitcoin address that contains a personalized string. I would like some critical ...
3
votes
2answers
30 views

Modeling rainwater collection and cost

The following is a function that takes an area as an input and outputs some resulting calculations. I thought an object was useful for creating multiple instances with different custom properties ...
1
vote
0answers
20 views

Override values for overlapping objects between two scala lists

Let's say I have a bunch of Widget, where a Widget is class Widget (sku: Int, label: String, name: String, description: String) And I have 2 sources of Widgets: ...
-4
votes
0answers
24 views
10
votes
3answers
416 views

Simple number theory game

I just started JavaScript about a week ago. For my first project, my goal was to use my knowledge of basic JavaScript to create somewhat of a "thinking computer brain," so to speak. I wasn't focused ...
3
votes
1answer
20 views

Defining array contents using multiple statements on one line

I'm writing a sub which is going to determine which type of business is being detailed on a particular line of data. It's going to use column positions to check if the data exists, and then output the ...
3
votes
2answers
40 views

MVC and Services

I'm writing and app in AngularJS and am learning about writing RESTful services. I also want to make sure that I'm understanding the MVC pattern correctly. In my code, this is my take on how I'm ...
1
vote
0answers
10 views

Segment tree with lazy propagation

This is the implementation of segment tree with lazy propagation. Could you please review this code so that I can improve my ...
8
votes
2answers
320 views

Chances to gain yards (text simulation game)

I'm making a text simulation game in C# and I've made the calculations and all. But I know there's a better, faster and more efficient way in doing this. Basically, the first calc is that there's a ...
2
votes
1answer
40 views

A tool to help you memorize text

I wrote a snippet of code to help me memorize text out of files and was hoping to get some feedback on the code, since Python isn't my strongest language. You can see the code on GitHub, but I've ...
3
votes
0answers
41 views

Base-2 representation using C++

I'm preparing for a test and came across this exercise. If possible, dissect this and point out any flaws in it, keeping in mind time complexity. In base -2, Integers are represented by sequences ...
3
votes
1answer
20 views

Webscraping Bing wallpapers

I wanted to scrape all the wallpapers from the Bing wallpaper gallery. This was for personal use and to learn about webscraping. The gallery progressively gets images using javascript as the user ...
-2
votes
3answers
43 views

Will this regular expression match all binary strings with even number of ones and zeros? [on hold]

POSIX version: ^((00)*|(11)*|((10|01)(\2|\3)*(10|01))*)+$ Emacs version: ...
-3
votes
0answers
20 views

explain matrix creation code [on hold]

Here is the original question where the user asks how to create an empty matrix. One of the answers is the following ...
6
votes
3answers
547 views

C++ Stack using template

I'm learning C++, so I wrote a stack with the help of templates. I'm wondering if there is anything I can improve or if I did something vastly wrong. Stack.h ...
1
vote
1answer
26 views

One hash with params populate two objects

I have a JSON API where a user can update a post and related details to that post. To simplify the process the user just fills in one hash and we don't expose our architecture. What I did here works ...
6
votes
4answers
127 views

Nested object to hierarchical object list

I have a C# type to generate Layer SubLayer: ...
6
votes
2answers
33 views

Re-worked Workbook_Open, Creating DateStrings

So, I had a go at re-writing my Workbook_Open event based on The advice from my previous question. Thoughts? ...
3
votes
3answers
301 views

Convert a date string to a DateTime object in C#

I was just wondering if my code contains defects or if there was a more efficient or general way to convert string to DateTime object. In the input, I have a string ...
6
votes
1answer
111 views

Boost.Spirit UTF-8 string literal parser with escape support

I wrote (as part of a greater work) a Boost.Spirit grammar that would parse string literals, including support for the various escape sequences known from C/C++ (...
-4
votes
0answers
39 views

A basic Tic-Tac-Toe game programmed in Java

I have programmed a Tic Tac Toe game in Java using JavaFX for the UI. I have improved my previous version of the game after it got reviewed here. I will be highly satisfied if you can point out how to ...
-4
votes
0answers
29 views

wpf ugly event dictionary [on hold]

I have wpf application that gets data from webserver. Implementation of Application. It contains two Views (LeftView, ...
-1
votes
0answers
40 views

Inverting a binary tree [on hold]

So I came across some code which is used to invert a binary tree, and it looks like this: ...
3
votes
1answer
41 views

Ordered map for C using AVL tree

I was in the mood for some data structures and I decided to code up an ordered map using AVL tree. I will post only map.h and ...
7
votes
3answers
132 views

Finding the shortest excerpt that contains all search terms

Write a function called answer(document, searchTerms) which returns the shortest snippet of the document, containing all of the given search terms. The ...
-2
votes
0answers
15 views

How to refactor, clean, and/or merge a massive code base efficiently [on hold]

We have a massive code base of over 8,000 Java, JavaScript, CSS, Java Server Page, and Spring-specific files. I have occasionally inquired about the ability to refactor certain files for readability ...
5
votes
2answers
42 views

Background execution in iOS

The following class BackgroundExecutable is to be used to take a function f and return a function ...
3
votes
3answers
52 views

Shell script to detect router slider status

I have openwrt router (TP-Link MR3040) and on boot I have it check the slider (AP,WISP,3G/4G mode) the goal was to have it execute the current "slider status" vs the old one, or do nothing if its the ...
10
votes
3answers
442 views

Fastest possible text template for repeated use?

While reviewing Sending templatized e-mail to a million contacts, I wrote this implementation to illustrate an alternate approach. It is designed to be the fastest possible way to generate templated ...
-4
votes
0answers
11 views

About PokerHand Rule [on hold]

I never played PokerHand before and I do not understand the given test. Can anyone tell me why it shows two result(assertTrue(a.compareTo(b) < 0); AND assertTrue(b.compareTo(a) > 0);)? ...
4
votes
3answers
46 views

Converting Pandoc Markdown images from captioned to inline

After writing a rather long document in Markdown and using pandoc to convert it to a PDF, I found, to my dismay, that many of the images were out of place, and that they all had their alternate text ...
8
votes
2answers
73 views

Financial Data From Webqueries in Excel

I'm new (to CR and to programming in general). I wrote my first VBA on Monday. This is my first working project. It Takes a bunch of financial data from a company called Financial Analytics and a ...
0
votes
1answer
40 views

Binding data in a TemplateField

This is my current RowDataBound function. I think this functionality is a bit horrrendous really and it winds up with an extreme amount of LINQ SQL queries being ...

15 30 50 per page