3
votes
0answers
105 views

Why 'x += y' is not always the same as 'x = x + y' in Python (2.7)? [migrated]

I always assumed that x += y was just a shortcut for x = x + y But it seems that's not the case for lists: x = [] x2 = x print x is x2 True x += [2] print x is x2 True x = x + [2] print ...
0
votes
1answer
55 views

How do I write tests against an eventually consistent service?

I'm building a service on top of Google App Engine Datastore, which is an eventually consistent data store. For my application, this is fine. However, I'm developing tests that do things like PUT ...
2
votes
2answers
169 views

matching usernames with their password

We are working on a simple login/registration form. Our login script checks to see if the username and password exist in the same row of the database. If it does exist, we bring the user to a welcome ...
2
votes
1answer
58 views

For DI, where to create dependencies (new objects) specifically within framework code?

Basic requirement I'm making a framework for learning purposes (and likely usage on personal sites). I'm using dependency injection in classes and I'm trying to design where would be a good place ...
0
votes
0answers
47 views

Approach to process data and store json into mongodb - creating a website functioning on java servlet backend [closed]

I'm not asking anyone to write code for me. I'm starting a project and I am looking for some advice. There are some practices regarding web development and databases that I'm not familiar with yet. ...
0
votes
0answers
60 views

Where does DTOS as InputModel / ViewModel Fit in Layered Archicture [closed]

I'm trying to understand where does InputModel and ViewModels fit at the 4 Layer Architecture. Presentation | Application | Domain | Infrastructure Given that the Application Layer takes care about ...
3
votes
2answers
115 views

Should I use nhibernate for a one row settings table

I am using nhibernate in a quite big project. The system has a settings table which has 10 columns and one row, there is always a row and it should not be deleted only modified. Concurrency can be a ...
4
votes
2answers
89 views

Mutable AST vs. different immutable ASTs

I am writing a toy compiler. During the semantic passes, I want to add information to the AST. Which of the following is the best approach? Define 1 mutable AST type whose fields are updated with ...
3
votes
1answer
42 views

Merging from unfinished feature branches and code review

We are using the git flow workflow, and it sometimes happens that we have long-lived feature branches. Of course we can merge from the develop branch into our feature branch, when another feature ...
0
votes
0answers
3 views

Beginner in C needing help with strings and memory [migrated]

So this course I'm doing wants us to play around with memory management and pointers. I'm not really fully understanding them. I keep getting a "Segmentation fault (Core dumped)" error. Apparently I ...
3
votes
2answers
184 views

Unit Testing without DI

I am starting a small ASP.NET MVC project, each task on the board must come with unit tests. The project is small, just a few pages with not that much processing, so I decided not to implement DI. My ...
2
votes
1answer
95 views

How to best model an application's settings?

My application has a configuration file and a "Settings" window. When the user confirms the changes in this window they are applied and written to the config file. These settings are often changed ...
3
votes
7answers
461 views

Is it okay to return the “wrong” HTTP status code in order to show a more user-friendly error page?

Located here, RFC 7231 is all about the HTTP protocol (status codes) I'm developing an in-house web application for my university's department and I'm at a (probably unimportant) impasse. I'm ...
1
vote
0answers
42 views

Gradle Flavors vs. App Projects

I've inherited a pretty big and old project with a tiny bit of technical debt which is still under active development. A couple of months ago we made the jump from Eclipse+Ant to Android ...
1
vote
0answers
57 views

Why was Go list iteration designed with the index before the element? [closed]

When iterating over an array or slice in Go you can use the range keyword. for idx, e := range someSlice { } Here, the idx represents the current index and the e the current element in the array. ...
0
votes
1answer
49 views

Relational Model to NoSQL model

I'm trying to switch my brain in to a NoSQL mode (document oriented database). I created a JSON datastructure that looks a little bit like this { "listInstances" : [ { "listClassId" : 1, ...
1
vote
2answers
245 views

How do you sync changes to the data in your database? [closed]

I am new to a team developing a very large web application. Prior to my start, the team had 0 automation in place and just did everything by hand. This was possible because they were only a team of 2. ...
0
votes
0answers
20 views

What dependencies can I add in an open source Objective-C iOS SDK? [closed]

I have a public REST API and I want to build an open source Objective-C iOS SDK that will wrap this API. There are dozens of libraries that wrap HTTP layers (AFNetworking) or even REST clients ...
1
vote
0answers
38 views

REST API Authorisation of HTML5 hybrid/single page applications

I am looking for some guidance on application level authorisation to a REST API. I am building the API (in Laravel 5) to serve an Angular.js single page application (and probably a HTML5 hybrid mobile ...
2
votes
0answers
27 views

Multiple Oauth2 access tokens

I have an API that uses oAuth2 and my own mobile apps that use this API as their backend. Since users can be logged on via multiple devices (i.e iphone, ipad, android tablet or android phone) at the ...
1
vote
1answer
53 views

Eclipse unit test - one project per file/class?

My new company has never had unit testing, but have finally been persuaded to introduce it. They have chosen Google test and, for some reason, want to run the unit tests from within Eclipse (where I, ...
-4
votes
1answer
148 views

Comparing the Java language to non-Java JVM languages [closed]

I was contemplating on the necessity of different non-Java languages coming up on the JVM. Apart from syntactic sugar and built-ins, does any of them actually exploit some corner of the JVM, which has ...
-3
votes
1answer
126 views

Any Deterministic Compression Algorithms out There? [closed]

The title says it all, basically. Are there any deterministic compression algorithms - that is, an algorithm which, given identical input, will always produce identical output? As far as I know, ...
1
vote
0answers
62 views

Using a distributed system as an alternative to disk storage

So, one of the differences between "main memory" and disk storage is durability -- the data on hard disks will stay accessible and unaffected even if the host machine crashes or loses power. One can ...
1
vote
1answer
80 views

Is Python's calendar.month_name implementation of an empty string in the first index good practice or poor design?

The documentation states: An array that represents the months of the year in the current locale. This follows normal convention of January being month number 1, so it has a length of 13 and ...
33
votes
7answers
4k views

Is there a need to keep tests for simple (self-contained) functions?

Consider this: public function polynominal($a, $b, $c, $d) { return $a * pow($x, 3) + $b * pow($x, 2) + $c * $x + $d; } Suppose you write various tests for the above function and prove to ...
1
vote
0answers
24 views

the right way to generate my Django model/db_table

I went through the Django tutorial with in mind to go through it again using it to set up my small app. So now I am making a simple app where users can search a large set of strings and get a subset ...
14
votes
2answers
435 views

Is it good practice to store software version numbers in VCS?

A product version, such as v1.0.0.100, represents not only a unique production release of software, but helps identify feature sets and hotfix stages for said product. Right now I see two ways to ...
-1
votes
1answer
117 views

Looking to calculate break even price (minus fees) on an individual level without brute forcing

I am trying to calculate the break-even price on an individual product given a percent of the price I sold it for and the price I bought it for. For example: I buy an item for $200 and the fees on the ...
4
votes
1answer
66 views

Readiness vs. Completion Async IO Memory usage?

I was watching this talk about implementing Async IO in Rust and Carl mentions two potential models. Readiness and Completion. Readiness Model: you tell the kernel you want to read from a socket do ...
5
votes
2answers
162 views

Persisting Large/Complex Entities with the Command Pattern — Am I doing it right?

I am in the process of designing and building a large-scale inventory management software-as-a-service that will, hopefully, live a long and fruitful life. Therefore I am exerting a lot of effort ...
2
votes
2answers
417 views

Why doing everything with one software project is wrong? [closed]

I am newly employed by a company. After a couple of weeks, I have heard lots of time that there is a huge project which most of the programmers are working on it. They call it something like Managing ...
-1
votes
2answers
129 views

Modelling a parcel management application

Scenario/Context: I am working on an application which would find out the highest volume of parcel delivery based on the pin code of a particular area by reading a text file which has the list of ...
0
votes
4answers
167 views

What is the difference between business and application logic? [closed]

Please note that I asked the same question on stackoverflow but they directed me to ask here. While I am trying to discerne the difference between the application logic and business logic I have ...
1
vote
1answer
28 views

How to have TFS automatically add certain tasks to new work items?

We use TFS at my workplace to manage our source code and track development. Whenever we have a bug or work to do, we always have to do the following two tasks as a minimum: Test the work, or decide ...
1
vote
0answers
23 views

Xcode rolling video architecture

I am going to writing an App that records video but to save on memory space I want to allow the user to continually record and then, when something happens, they can save that period of time (post the ...
1
vote
3answers
122 views

Pre-calculate values or not on Raspberry Pi

Say that you want to rotate something 360 steps 100 times. You now have a choise to pre-calculate 360 sin and cos values once and then use the stored values 100 times, or you can calculate sin and cos ...
55
votes
4answers
6k views

Is it better to call a function that doesn't have an effect at that point, IF it improves code clarity?

I have three views in my program (iOS app). Only one of them is ever active at the same time so I set the visibility off for two of them and switch visibility as the user presses buttons. The views ...
3
votes
2answers
157 views

How does Functional Programming's immutability feature work with CQS?

Given immutability (which is often encouraged and said to be one of building blocks of functional programming) and CQS (which says that commands should not return a value other than void/unit), how do ...
1
vote
2answers
167 views

Purpose of encrypted product ID/key in shopping carts

I'm a newbie for PHP ecommerce applications. For my academic activities, I need to complete a shopping cart system with basic shopping cart functions. I have studied several apps which are already ...
0
votes
0answers
81 views

Running a C++ code written for Windows on Amazon Web Service [closed]

I am new to this website and this is a general question that I know many similar people want to know: I am a C++ Windows software developer, my customers are supposed to buy my software and install ...
1
vote
2answers
58 views

Many AJAX requests to check domain availabilities [closed]

I've recently developed a website that randomly generates unique names, then checks for their .com availability. In order to do this, I call 3 AJAX requests to a php page where it randomly generates ...
23
votes
5answers
2k views

What is it about functional programming that makes it inherently adapted to parallel execution? [duplicate]

I've been reading over and over that functional languages are ideal (or at least very often useful) for parallelism. Why is this? What core concepts and paradigms are typically employed and which ...
-1
votes
2answers
174 views

Feeling like all my code is very poor quality and slowly built [closed]

I suppose you could consider me a "recent grad". Though I actually graduated 5 years ago, as life has gone, I am looking for an entry level programming position now. I truly enjoy programming and ...
1
vote
1answer
97 views

Porting security from Java/.NET to PHP

This probably a rather naive question given my limited knowledge in the code I've been looking at, but I want to get my head around it before I start diving into writing actual code myself. I'm ...
-1
votes
2answers
122 views

What is an anonymous function? [closed]

I am new in programming and it's kind of difficult for me to understand what the context of an anonymous function is. this is my code: toevoegButton.addEventListener('click', function() { ...
0
votes
1answer
167 views

How does Luhn algorithm relate to cryptograpic hash functions?

What I am interested is the similarities and differences between the two. It is my understanding to present time that Luhn algorithm is a type of checksum function same as some cryptographic hash ...
3
votes
1answer
77 views

Implementing a requirement with a decorator and ensuring it's usage

In a shared library I have a function that is widely used. I'm implementing a requirement for the function to override it's behavior when the entities are in a specific state. I have decided on ...
3
votes
2answers
95 views

Open Source License that prohibits verbatim resale?

I was taking a look at this question here: Open Source License that prevents re-selling And it makes some good points on how open source is defined by its ability for resale... However, I still ...
2
votes
1answer
128 views

Usage - Factory Pattern vs Dependency Injection [closed]

Okay, this question is not on which is better. It is more about when to use Dependency Injection vs Factory. I have done a bit of research and it goes like this. DIP: Provides loose coupling, ...

15 30 50 per page