language-agnostic

How to prioritize bugs?

天涯浪子 提交于 2019-12-20 10:28:46
问题 In my current company there isn't clear understanding between the test and development teams as to how severe a bug should be? There are arguments which go back and forth to reduce or to increase the severity. We are not as of now aware of any documents which lays the rules. The tester raises the bug and assigns priority based on his intuition. The developer would request a change based on his load or some other factor. How are severity/priority of bugs classified? Are there any standards

Where does input validation belong in an MVC application?

非 Y 不嫁゛ 提交于 2019-12-20 10:24:32
问题 I have a MVC application that receives an input from a form. This is a login form so the only validation that is necessary is to check whether the input is non-empty. Right now before I pass it to the model I validate it in the controller. Is this a best practice or not? Does it belong to the model? 回答1: I don't think there's an official best practice limiting validation to any single part of the MVC pattern. For example, your view can (and should) do some up-front validation using Javascript

Minimum area quadrilateral algorithm

梦想的初衷 提交于 2019-12-20 10:24:25
问题 There are a few algorithms around for finding the minimal bounding rectangle containing a given (convex) polygon. Does anybody know about an algorithm for finding the minimal-area bounding quadrilateral (any quadrilateral, not just rectangles)? I've searched the internet for several hours now, but while I found a few theoretical papers on the matter, I did not find a single implementation... EDIT: People at Mathoverflow pointed me to an article with a mathematical solution (my post there),

Get note data from MIDI file

走远了吗. 提交于 2019-12-20 10:10:54
问题 Is there a way to get the note data from a MIDI file? That is, I want to break down the MIDI file into its constituent parts so they are in the form of a unique word (or any other data type). What I want to do in the end is take in a MIDI file and find patterns in the notes. Get in each note, find it's frequency (of being played) and note how likely other notes are to be played after it. It would be nice to do this in C/C++, but any language would be fine. 回答1: Nik Reisman - sorry, but I don

Methods for automated synonym detection

和自甴很熟 提交于 2019-12-20 10:09:45
问题 I am currently working on a neural network based approach to short document classification, and since the corpuses I am working with are usually around ten words, the standard statistical document classification methods are of limited use. Due to this fact I am attempting to implement some form of automated synonym detection for the matches provided in the training. My question more specifically is about resolving a situation as follows: Say I have classifications of "Involving Food", and one

Unit Testing: Logging and Dependency Injection

好久不见. 提交于 2019-12-20 09:56:01
问题 So regards logging from SO and other sites on the Internet the best response seems to be: void DoSomething() { Logger.Log("Doing something!"); // Code... } Now generally you'd avoid static methods but in the case of logging (a special case) this is the easiest and cleaniest route. Within the static class you can easily inject an instance via a config file/framework to give you the same effect as DI. My problem comes from a unit testing perspective. In the example code above imagine the point

Is it a good idea to let your users change their usernames? [closed]

故事扮演 提交于 2019-12-20 09:49:11
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 4 years ago . I'm back and forth on the idea of letting the users on my site change their usernames, which would be displayed through out the site. On one side I want to give the users flexibility. But on the other, I don't want them to use this feature as a way to hide if they do

How to evalute an exponential tower modulo a prime

梦想的初衷 提交于 2019-12-20 09:38:17
问题 I want to find a fast algorithm to evaluate an expression like the following, where P is prime. A ^ B ^ C ^ D ^ E mod P Example: (9 ^ (3 ^ (15 ^ (3 ^ 15)))) mod 65537 = 16134 The problem is the intermediate results can grow much too large to handle. 回答1: Basically the problem reduces to computing a^T mod m for given a , m and a term T that is ridiulously huge. However, we are able to evaluate T mod n with a given modulus n much faster than T . So we ask: "Is there an integer n , such that a^

Matching text between delimiters: greedy or lazy regular expression?

会有一股神秘感。 提交于 2019-12-20 09:37:26
问题 For the common problem of matching text between delimiters (e.g. < and > ), there's two common patterns: using the greedy * or + quantifier in the form START [^END]* END , e.g. <[^>]*> , or using the lazy *? or +? quantifier in the form START .*? END , e.g. <.*?> . Is there a particular reason to favour one over the other? 回答1: Some advantages: [^>]* : More expressive. Captures newlines regardless of /s flag. Considered quicker, because the engine doesn't have to backtracks to find a

What would we do without NULL?

陌路散爱 提交于 2019-12-20 09:22:37
问题 I once read that having nullable types is an absolute evil. I believe it was in an article written by the very person who created them(in Ada?) I believe this is the article Anyway, so what if by default a language like C# used non-nullable types? How would you replace some of the common idioms in C# or Ruby or any other common language where null is an acceptable value? 回答1: Instead of outright declaring that nullable types are evil, I would posit: most languages graft nullability onto