6
votes
1answer
95 views

Why can't Pull Requests be seriously implemented in Mercurial?

A week ago, I was at LFNW and as I was talking with Larry Hastings after his talk, he said (paraphrased): There's something in Git that makes the Pull Request workflow possible that isn't there in ...
4
votes
1answer
246 views

Reuse already fetched data for request

I have action that fetches user model from db to check access. Then I have method that in some cases requires same model. function checkAccess(req, res, next) { var data = ...
8
votes
5answers
4k views

GO instead of C/C++ with cgo

Is it possible to replace C and C++ with Go + cgo and interface frameworks such as Qt or DirectX with Go? Any potential pitfalls I should be aware of? UPDATE: I see that my question was not precise ...
0
votes
1answer
72 views

Accessing data from private API (with Basic Auth credentials) using Angular JS

I have been tasked with connecting an existing Angularjs app to a third party service via API using Basic Auth credentials I got from the third party website. I am not as experienced with Angular and ...
5
votes
5answers
254 views

My brute force solution is too slow, needed DP solution [on hold]

Concise problem definition: given n and {a,b,c}; (1 ≤ n, a, b, c ≤ 4000); Constraint -> a*i + b*j + c*k==n (i,j,k>=0); Objective-> maximize(i,j,k) Examples: n=47 and a=7,b=5,c=8 -> ...
23
votes
2answers
192k views

How to describe your skill levels in the CV? [closed]

What are possible/standard words to describe your skill levels in different programming languages in your CV? I currently use these three: expert advanced beginner I do not consider myself an ...
7
votes
3answers
4k views

What can I use instead of Interfaces in Ruby (or any other dynamic language)?

My goal is to define contracts between classes. I like duck typing and all but I'd like also to define an interface between different layers of my application to clearly define which are the method ...
31
votes
7answers
3k views

Is the development of CLI apps considered “backward”? [closed]

I am a DBA fledgling with a lot of experience in programming. I have developed several CLI, non interactive apps that solve some daily repetitive tasks or eliminate the human error from more complex ...
-5
votes
1answer
54 views

Proper use of break; [closed]

I am trying to establish my POINT value when the sum is equal to 4, 5, 6, 8, 9, 10, but terminal continues to execute my code even after the break;. Can someone please explain why this is happening? ...
42
votes
15answers
12k views

How to write correct loops?

Most of time while writing loops I usually write wrong boundary conditions(eg: wrong outcome) or my assumptions about loop terminations are wrong(eg: infinitely running loop). Although I got my ...
-4
votes
1answer
60 views

Where should we put folders on the user's computer? [closed]

This reddit post makes a good point: Why do developers create so many folders directly in "My Documents". My home folder is completely full of this kind of stuff (especially when I show hidden files ...
-4
votes
1answer
197 views

Class library naming conventions [closed]

Typically in a C# program, the entry point is in Program.cs. However, if you are creating a rather generic class library, with no Main() method, such as TCPClient.dll what is the appropriate base ...
-1
votes
0answers
6 views

How to declare parameters in this case [migrated]

If I have a variable that is declared like this char *string[z][z]; And I want to factor out a for loop from a very large function where the above variable is included, how should the call look ...
1
vote
0answers
30 views

How to get verification that you've implemented all your API in a static library?

I just learned that static library building skips the linking stage, which explains why my build process succeeds all the time when it's possible I actually haven't implemented a function in my ...
-1
votes
1answer
38 views

During fork system call which execute first parent or child

As i am executing a one pipe example pgm from libc.pdf,I noticed that the parent process first completed then only child process completed.From my knowledged about os the child process must complete ...
-2
votes
1answer
38 views

Android Apps: How can I view an apps code/files?

I love taking apart applications, software, and websites to see how developers were able to create a feature or how a game handles AI. Something I'd like to be able to do is view an app's files ...
0
votes
1answer
86 views

Using CSS for build tables. Are these tables okay to use for email? [on hold]

I am an newbie in training. Recently I read this an article about building tables with CSS. The code is something like this: <section style="display: table;"> <header style="display: ...
0
votes
2answers
70 views

Creating a Vector (physics) Class in Java

I'm trying to create a vector (like in physics) class in Java. I want to support vector addition, dot product, scalar multiplication, etc. So, my question is, is it possible to do this with generics? ...
0
votes
2answers
99 views

Lock threads or not lock threads?

I have an application (full-stack) that is used millions of times concurrently. Some vital application properties are managed on the client side (at the time it seemed to be the simplest approach to ...
-1
votes
1answer
96 views

Should there be print statements in a library

I have built a library that is being used by a few people. They say that library has a few print statements which is wrong because a library should give freedom to users to use the library the way ...
0
votes
2answers
79 views

Is it a good idea having default static variables for new instances?

OK let's say I have something like this: public class MyObject { public static int DefaultValue = 9 private int _value = DefaultValue; public int Value { get { return _value; } set { ...
1
vote
2answers
68 views

How to guarantee web script execution sequence/order or not parallels queues

This is a very simplified version of the problem: You have an integer saved on a server called "B" and you have an script saved on a server call "A" exposed to the internet. The script pulls the ...
0
votes
1answer
57 views

How can I avoid duplicating information in this scenario?

I have a Data class that can be placed inside a DataCollection class that can be placed inside a DataCollectionCollection class. Kinda like an egg can placed inside a box that can be placed inside a ...
0
votes
1answer
38 views

UI Testing and Code Coverage [on hold]

My company wants me to write UI tests that test the business logic (all of the use cases MUST be independently testable) I decided to do it in selenium. I have managed to create a decent product (as ...
0
votes
0answers
4 views

Why is Octave not recognizing 'randindex' after a few iterations? [migrated]

I'm using SwarmOps in Octave. (I'm new to Octave.) In particular, I'm using PSO. The program seems to be running fine for a few iterations, but after a while I'm getting the error: "`randindex' ...
-1
votes
2answers
51 views

Run C program in debug mode (without debugger)

If I want my program to be able to run in debug mode, is it a good idea to make it accept a flag such as -D=DEBUG when I run the program? I currently have a DEBUG variable in a .h file but that I ...
75
votes
6answers
12k views

Why are floats still part of the Java language when doubles are mostly recommended instead?

In every place I've looked, it says that double is superior to float in almost every way. float has been made obsolete by double in Java, so why is it still used? I program a lot with Libgdx, and ...
2
votes
2answers
59 views

How can I find out network latency in rest service

I have two Java applications deployed on tomcat. For inter application communication I provide jar file of application (Java API) to other application and it becomes a method call which is fast. Now ...
0
votes
0answers
26 views

Which search engine should I use to suport complex search scenerio

Let’ assume that I have a database for storing orders for multiple stores and I have following tables: User – represents user Store – represents store UserStore – many to many between User and ...
-2
votes
0answers
24 views

Update Fork from master problems

I'm currently contributing to an OpenSource Project on GitHub. The problem I currently have, is that every time a PR was merged, when trying to update my fork, it will show for example "this branch is ...
1
vote
1answer
38 views

How to use fields from an object after an exception is thrown and the object can't be fully created

The issue that I have is that I need information from an object that a method returns when it throws an exception. It is a little hard to describe so I have this java pseudo code example. I have a ...
-2
votes
0answers
81 views

Run code once at deployment and never again. Possible? [on hold]

For any web applications, there are 2 stages, 1st, before request processing; 2nd, starting to process the request and further. And there are plenty of cool frameworks out there, viz. laravel, CI etc. ...
-4
votes
0answers
23 views

Registration servlet issue (BLOB and DAO) in mysql [on hold]

I was trying to implement a registration page where I had profile image as a blob in the form. I tried to use a DAO to insert the form inputs to a mysql table 'users'. However this is not inserting ...
-3
votes
0answers
22 views

How to develop animation in Android with the help of given animation by designer? [on hold]

I am trying to develop Android application. I am searching for animation tutorials on Android but they are very basic like fade-in, fade-out. But what if we want to develop advanced animation like ...
4
votes
1answer
92 views

What is the point of calculating these variables this way?

I'm skimming through a very popular game's source code at the moment and I came across these variables inside of this class. public static final BlockPos ORIGIN = new BlockPos(0, 0, 0); private ...
6
votes
2answers
63 views

prevent abuse to rest api endpoint

Question 1 I have a login api endpoint http://127.0.0.1:8080/api/account/login it checks if phone number has been validated. If not it'll call POST http://127.0.0.1:8080/api/account/sendsms ...
-1
votes
4answers
141 views

What algorithm would have the fastest average run time and least memory requirements for sorting a deck of playing cards?

Considering a deck of N playing cards with X different rankings and Y different suits (i.e. there are Y cards with X ranking, thus N=X*Y). What is the fastest algorithm to sort them assuming that X, ...
0
votes
1answer
40 views

What kind of data structure should be used to store components in an electrical schematic program?

Is there a specific data structure, object oriented programming methodology, and/or approach for achieving what programs like LT Spice, Altium Designer, and Cadence Virtuoso use to manage ...
-3
votes
0answers
16 views

How to insert log transformed columns into an existing dataframe using column indices (in pandas, python) [on hold]

How do I insert columns that are log transformed(after doing log transformation of certain variables)of a data frame called 'log_data' back to it's original data frame 'df' using specific column ...
1
vote
1answer
62 views

Why closure declaration syntax in Swift is different from function declaration

let closure = { (args) -> ReturnT in ... } v.s. func function(args) -> ReturnT { ... } Why didn't Apple follow principle of Occam's razor and make closure and function declarations to be ...
5
votes
6answers
386 views

How much commenting is better for coding? [duplicate]

I don't have a formal computer science education, meaning that I did not study computer science topics in a university. However, I work at a programming job and write a reasonable amount of code. ...
-2
votes
0answers
25 views

How would I implement the following formula as a function in java? [on hold]

Where you are trying to find the smallest number for n with inputs p and y. I tried to implement this as: int index = 0; for (int i = 0; index == 0; i++) { if (bFormula(i, perHit, hitsNeeded) ...
1
vote
1answer
44 views

Sync client-side data after service invocation in SPAs

Here's a simple scenario: We have a list of tasks and can mark a task as completed by invoking a web service. Doing so will transition the status of the task to completed as well as initialize a ...
2
votes
1answer
51 views

Which IndexedDB data structure for Chrome app?

I'm on the way to build a Chrome app, dedicated to fulfill shop/marketplace orders. The orders come from marketplace APIs like Amazon MWS. The data is stored only in the app (with backup). The system ...
0
votes
0answers
40 views

Good examples for use of design patterns in Unity [on hold]

My students have learned OOP as well as the strategy design pattern during the first semester (Processing/Java), which lead to understanding Unity's component based architecture (similarity of ...
2
votes
3answers
79 views

How can one think of a relational schema in terms of storing it in a NoSQL database?

Recently I've been wanting to experiment with NoSQL databases, especially document store ones. After reading, I still don't understand how one might model information that is contained in a relational ...
2
votes
1answer
50 views

Observer Design Pattern with complicated objects

I am trying to currently get a good grasp on the Observer design pattern, but I am stuck wondering about one specific issue. In the examples I have been able to find of implementation, they are all ...
1
vote
1answer
28 views

Abstracting end-to-end test cases across multiple pages

I am using Protractor and Jasmine to create end-to-end tests for a webpage. To test this initial page, I have abstracted made some common utility functions to create about 20 test cases for this ...
1
vote
3answers
396 views

What's the best way to track updates when syncing data from MySQL remote server to local SQLite database?

I'm making an iOS App, well, two actually. App A will be able to write TO-DOs to a remote MySQL database, and App B will be able to read what App A has written/modified. App B needs to be always ...
119
votes
16answers
5k views

Does craftsmanship pay off? [duplicate]

Possible Duplicates: Prototyping vs. Clean Code at the early stages Frankly, do you prefer Cowboy coding? After working in a number of companies, I am starting to realize that my ...

15 30 50 per page