0
votes
0answers
5 views

Shortest path TLE

I'm trying to solve Spoj-s Shortest Path problem. I used Dijkstra with priority_queue and fast IO but it still TLEs. Can anyone give me any advice how to optimize it further? ...
0
votes
0answers
4 views

Average of positive and negative part of numpy matrix

I’ve got a matrix of data and I want to take the average of the positive and negative parts of the values. Is there a more Pythonic way of doing it? ...
0
votes
0answers
4 views

Add chat to an MVC database: Can I condense this code and is it appropriately placed?

I have these relevant tables in an MVC website: Server ServerPlayer ServerPlayerChat Servers have serverPlayers, ServerPlayers have ServerPlayerChats. Simple enough and expectable. I'm using ...
0
votes
0answers
16 views

Show PMD violation report in netbeans editor [on hold]

So, I have a PMD violation report, it was generated by sensiolabs insight, I want netbeans to read this report and color files that contains violation and when I open the file I want netbeans to put a ...
2
votes
0answers
21 views

Get all combinations of a list of numbers [on hold]

This is code I found online HERE, to use in a review HERE. However I noticed the code was very bulky and doesn't take advantage of IList, ICollection or IEnumeral, so I know it can certainly be ...
0
votes
1answer
15 views

JavaScript bookmarklet with a 24 hour cache

I'm working on a bookmarklet that will be cached for 24 hours only, after that time it will be reloaded from the original source. Is there something I could improve? ...
-2
votes
0answers
23 views

How long does this take to learn? [on hold]

I wanted to teach myself a programming language. I wanted to start with learning HTML and Java. Is there any online courses that are free of charge, and give me a step by step directions visually? I'm ...
1
vote
0answers
29 views

Creating a Party Game to learn OOP

I've been developing sites using Dreamweaver for the last 15 years, I do a lot of code editing manually so I have quite a good knowledge of the PHP language. I'm diving into object orientated ...
2
votes
2answers
29 views

Optimization for histogram computation algorithm in C

Next is an algorithm to calculate the histogram for a given YUV420sp image. The YUV data is given by the hardware camera as an unsigned char*. The algorithms ...
3
votes
3answers
71 views

Sum of subset of 5 numbers equals 0

I have a task to print all zero subsets of 5 numbers, input from the console. I have succeeded in implementing a working code, but it seems it is quite complex (it is like inception) and if the count ...
3
votes
1answer
19 views

AutoComplete program using the n-gram model

For my Advanced Data Mining class (undergrad) we were to design a program that would predict the next word a user is likely to type via automatic text classification using the n-gram model. The ...
1
vote
1answer
16 views

jQuery plugin creation and declaration for usage with $(). or $

Simple idea: just have a plugin (more a basic function). That I can use with jQuery in different ways it offers, means: ...
0
votes
1answer
13 views

Registering multiple keypresses simultaneously, very slow

I'm working on a Pong game and right now I'm working on being able to register multiple KeyDown presses simulatenously. I used the Win32 native method ...
1
vote
1answer
18 views

Manage XML file with custom XmlFileHandler class

This post is a follow up question. The purpose of this class should became clear without any further explanation. Raise your hand. If not, then I will have to improve the naming/structure. I would ...
0
votes
0answers
10 views

Print left view of the tree

Left view of a Binary Tree is set of nodes visible when tree is visited from left side. Left view of following tree is 12, 10, 25. ...
0
votes
0answers
4 views

Make logparser faster

I'm learning go. I wrote a simple logparser for SLF4J in Python some time ago and tried to port it to go as an exercise. The algorithm is identical, but the go-solution isn't quite as fast (the Python ...
0
votes
0answers
22 views

moving average implementation

I've created MovingAverage class. But it is not optimized for performance at all. I care about performance a little bit because i'm using this class in trading (i colocate on exchange and so on and so ...
0
votes
0answers
4 views

A middleware with process exception never called [migrated]

I have this middelware which is suppose to catch 500/400 exceptions and deal with them. But it never gets called. I've put it in the beginning and end of the ...
0
votes
0answers
13 views

When to use service pattern? [on hold]

Im confused as to how to decide on where to place logic in a Service Pattern vs Class Object How do we determine when we need to separate logic into it's own Service Separated Section? Why not just ...
7
votes
3answers
270 views

Better way to create a string of random characters

I'm generating domains with random names but I'm pretty new to Python. I used the map function because it packages the results into a list which I can then join() ...
2
votes
1answer
21 views

Speed and ID concerns converting DOM object into JQuery objects

First of all, I am not using JQuery but Cheerio. I have never actually used JQuery in "real life" -- I started with Cheerio, which is a subset and doesn't actually work in a browser environment. ...
1
vote
3answers
74 views

Making a new column and setting default values equal to the COUNT of a certain condition in SQL? [on hold]

I have 2 tables. (table1, table2) Now, I would like to do something along the lines of: ...
2
votes
1answer
14 views

Extracting ids out of arguments of different types

I'm building a Ruby API client. My brief is to extract ids out of various inputs and fetch the relevant data. It's working just fine at the moment but I think it's a little clumsy. My specs (which ...
2
votes
0answers
20 views

Menu Bar Animation Plugin

I'm fairly new to JS/jQuery (a few months), and I think it's time to start getting involved in the community. So I wrote a little plugin. Nothing revolutionary. Really, the project is to write a ...
0
votes
0answers
11 views

Linq multiple Filtering [on hold]

Well, Hi guys. I have 3 Multiple drowpdownlist which means I can select multiple parameter each column in table such as car.Budget >= 20000 && car.Budget <= 34999 and also car.Budget >= ...
1
vote
1answer
22 views

Dynamically loading jQuery when it's not available or version isn't high enough

I'm writing a script for others to use on their websites. I'd like to use jQuery in this script. Because I don't have control over what frameworks people use on their sites, I need to make sure jQuery ...
5
votes
1answer
38 views

Load JSON file into model using Javascript / jQuery (deferred, asynchronous)

As a beginner I am always determined to improve myself. I've got written the following Code using jQuery that is working fine. However, I am sure that there are cleaner ways for achieving the same. ...
0
votes
0answers
23 views

getting rid of proper nouns in a nested list python [on hold]

I'm trying to right a program that takes in a nested list, and returns a new list that takes out proper nouns. Here is an example: ...
0
votes
0answers
20 views

Python lottery game [on hold]

This is one of my first projects done entirely on my own without any tutorial and I am sure it is a little sloppy. Right now, I cannot figure out why my payout is always output as the payout for a ...
0
votes
0answers
21 views

What is this file structure method called? [on hold]

I have been using this file structure for a while now and I'm not sure where I got the idea from (possibly PHPBB? Maybe Wordpress?) Basically, I create a page, like ...
4
votes
1answer
41 views

Increase performance of Boyer Moore

Here is my Boyer Moore code in Python: ...
5
votes
1answer
37 views

A simple web-app code - user registration. Is the layering ok?

So knowing the little pieces is something different and putting them together is something different. Here is the code where I try to follow good oop practices and 3 - layered structure. Any ...
7
votes
2answers
214 views

“Hangman” game follow-on

Last week I asked to review my "Guess a number" game in Java here I learned so much that I decided to try a little harder game and put into practice all the amazing feedback I received there. Would ...
3
votes
0answers
15 views

Controller structure for a browser game module with filters and pagination

To get an idea of what the controller code reflects, here is a screenshot: Basically, the idea is that you print out a list of football players which you can then filter by their name, price, field ...
5
votes
1answer
40 views

Determining the least-accurately known physical constants

So, I thought I'd do this using scipy.constants: ...
5
votes
1answer
56 views

Namespacing jQuery/jQueryUi into markup that I don't control

I have a project that I've been trying to get just right for the past three months and it's still not quite there yet. I'm injecting some jQuery and jQueryUi code into pages that I have no control ...
5
votes
1answer
74 views

Is my C++11 generic container a good design?

After refactors and refactors and the discovery of very common patterns on many of the classes of the software I wrote, I decided that it would be fine to have something like an arbitrary-keyed map, ...
5
votes
1answer
29 views

HTTPCache and MemoryCache cross dependency

After asking a question on StackOverflow about the two .NET caching systems taking dependencies on each other I gave implementing them a go. I posted them as my own answer there but before accepting ...
4
votes
0answers
18 views

PanelScrollable - a reusable class for rendering a changeable number of panels

This class (PanelScrollable) is part of my view package, in an MVP designed Java Swing system. I am not using any MVP ...
0
votes
1answer
43 views

Why is this code giving me a wrong answer? [on hold]

I have solved this problem in C, but I get wrong answer every time, could you maybe tell me what I did wrong? Also, don't laugh at my code, I started learning C 7 days ago :) ...
5
votes
2answers
141 views

Concise nested statements

I really like the ruby ? : syntax for if else statements. However, I'm not sure how to do the following with a nested ...
4
votes
2answers
22 views

Admin CSS sidebar template

Could I get some feedback on my simple start to an admin template: http://jsfiddle.net/spadez/GHKxW/3/ HTML ...
7
votes
2answers
275 views

Codility - Perm-Missing-Elem: 100% functional score, but only 60% performance

I can not figure out why I didn't get 100% success from the Codility's Perm-Missing-Element test even I solve with \$O(n)\$. I will appreciate any advice/answers. You can see the problem, my code, ...
3
votes
0answers
20 views

sql indexing and performance [migrated]

I am using mysql5.1, i have table which has about 15 lakh (1.5 million) records.This table has records for different entities i.e child records for all master entities. There are 8 columns in this ...
9
votes
4answers
843 views

What would be preferred aesthetically and performance wise?

Which one of these two would you prefer writing in your code? This: ...
2
votes
2answers
39 views

Inline PHP IP access log

For a website, I've got some inline PHP, posted below. It's supposed to log traffic to the website, and it does its job fine. But at the end of the day, I'm not even close to a PHP developer, and ...
3
votes
2answers
37 views

Adding time offsets to create future dates

How can I shorten this (working) code to create future dates in ruby for use as params in URLs? I'm doing: ...
3
votes
0answers
20 views

Filtering queries based on the current user state

I have a Symfony2 project. I have an Entity Asset which can have relations with Category. I store a ...
3
votes
0answers
27 views

Tuning a query for performance

I am running this query and it takes several minutes to complete, how can I tune it (unfortunately I don't have the privileges to run an SQL tuning advisor) : ...

15 30 50 per page