instruction
stringlengths
34
19.9k
The company I work for requires all code to be reviewed by other developers before it is committed. The members of my team are often frustrated because the other developers are too busy coding to do a review, especially if it is very long. How do you incentivize other developers to do timely code reviews? (We use git...
I'm in the design process for a Java web app that I will probably end up deploying to Google App Engine (GAE). The nice thing about GAE is that I really don't have to worry about fortifying my app from the dreaded DDoS attack - I just specify a "billing ceiling", and if my traffic peaks up to this ceiling (DDoS or othe...
I wanted to use the base64 Python library to encode a sequence of binary digits into base 64. Would it be possible to do it without converting to a string? If not, what is the best way to do it, assuming that my string of 1/0 digits may not be an integer multiple of 8, it may even be an odd number. In addition, I ha...
After our product backlog is created and prioritized, are we meant to briefly estimate all the stories in the product backlog? I assume they have to be in order to create a product burndown chart, however if you have a lot of stories this could take a long time initially. Additionally, should a user story have accepta...
I am developing an Android application for Gujarat's farmers. So this app should be in Gujarati also. Is there any way so that I can store my data in Gujarati in SQLite?
I want to know are there any design patterns for web besides MVC? I know there are design patterns as: Registry, Observer, Factory, ActiveRecord ,... and MVC a set of other design patterns and folder structure. Is there design pattern like MVC is a set of other design patterns? Edit : my programming language is PHP.
I am using scons to build a large project containing a mix of C++ and Python. I would like scons to run Python unit tests either using nose or not. Currently, we have a long list of tests files and run a test builder on each one. This causes each test file to be run as a separate script which feel inelegant and inef...
I am just learning python, and I am currently playing with Tornado framework. I see this class: class AuthHandler(BaseHandler, tornado.auth.GoogleMixin): @tornado.web.asynchronous def get(self): if self.get_argument("openid.mode", None): self.get_authenticated_user(self.async_callback(self._...
I am writing a program to scrap some data from the web. The pages are sequential ( 1,2,3 ... ), but I have no idea when will it stops. I combine a prefix and a integer to make a link for the python urllib to parse on it. For example : 'http://some.domain.com/page' + '1' + '.htm'. So the request would fail if the link i...
I am sure there is a term for the following bit of refactoring, but I can't remember it and my Google-fu is failing me! The refactor moves if statements to where they are going to have most impact, for example changing this $test = someFunctionThatReturnsABool(); for($x = 0; $x < 10000; $x++) { if ($test) { ...
I got this error in my program which grab data from different website and write them to a file: 'charmap' codec can't encode characters in position 151618-151624: character maps to <undefined> I am not familiar with all the encoding decoding thing and I have been okay with what python 2 did. Although the python offici...
I wanted to implement real time push notification to one of the apps written in RoR. I don't have any experience with nodejs, nowjs, express or socketio. What would be the easiest way to implement the realtime push notification system?
I am working on an algorithm which calculates intervals for variables in some given constraints. For example there is a function called propagateValues and its description is Propagate value ranges for the given constraints What exactly is meant by value propagation ? The algorithm I am working is basically trying t...
For an area of an application that has been developed, the request has come in to remove an item from a menu. I know this is a small thing, but how do you treat it in Scrum? I'm used to using User Stories for adding functionality, not removing. So my question is: Should I create a user story for this, somehow phrased ...
We use mock to ensure that a unit test only runs against the code that should be tested. This prevents that a bug in a module A causes tests of a dependent module B to fail. However, now we also have to test the interaction explicitly. It is not enough that A and B are green on their own, A has to work as B expects it,...
All I can find online is stuff about search result rankings, which I'm not concerned with at the moment. We're going to have a cloud-based online database and we want Google search results for something relevant to our site to display our website's search results for the same query. For example, if someone types in "lu...
Basically I ran Intellij Idea 's plug in called FindBugs-Idea to analyze my code . I corrected whatever errror was caught and then ran the tool again but it was still complaining about the same error even though it was fixed in the source file . It only stopped complaining after I recompiled my classses . Why does it r...
If I've got code similar to this (although perhaps not as constrained as warning levels): switch(item.StatusCode) { case StatusCode.SUCCESS: CallSuccess(item); break; case StatusCode.WARNING: CallWarning(item); break; case StatusCode.ERROR: CallError(item); br...
I found a website saying that calculus and linear algebra are necessary for System Programming. System Programming, as far as I know, is about osdev, drivers, utilities and so on. I just can't figure out how calculus and linear algebra can be helpful on that. I know that calculus has several applications in science, bu...
I need to write a PhoneGap application with JavaScript and I'm thinking of the code design patterns. I've read some books of JavaScript design patterns but can't really see the advantages/disadvantages on them and I think I don't understand the implementation and usage right. I would like to have some opinions of whic...
Almost every cloud instance I can find defaults one CPU. Why is this only one CPU now, and should I expect this to increase in the future? Does this design impact my code design so that I exclude technologies like Task Parallel Library? This is on topic to Programmers.SE because it impacts the long-term scalability of...
When I started learning about Web Pages I followed several of the Microsoft tutorials, all of which utilized WebMatrix. I did this until I realized that WebMatrix offered no debugging. Wait? What?? No way. And I quickly moved my Web Pages development to Visual Studio. While there were some things that I thought were ni...
I'm developing an iOS app for a museum as a freelancer. It's a very simple video player, to be installed on a single iPad that will be part of a permanent exhibition, basically acting as a kiosk. It turns out the iPad is the ideal device for that if you're looking for a small and affordable touchscreen. The problem is:...
I have a particular method called TranslateValues() (Cyclomatic-Complexity of 5) which I would like to test. The test requires a substantial number of mock objects which take up most of the method; The method being tested is fairly straightforward with this exceptional requirement. I am suspicious of this. For me, I m...
For the longest time I've just done small app development. Building and debugging took a matter of seconds (or should I say - second?). I got fairly used to just debugging to test literally everything (and it's nice to see my stuff working - like a programming high almost). The problem is that as of late I've been w...
We started (just me and my friend) working on a website. As a part design phase we have finished the drawing a Site Map, decided on the content in each of the web page and the navigation. As we want to use the Spring MVC and Hibernate we want to start on Classes design (domain classes) first so that the database part i...
I'm not sure how to start to explain my question, but here goes. We have just finished an MVC application that hits 2 WCF services. But there has been a bit of a disagreement between those who worked on the project and some who haven't over the design used. What we have is two WCF services, one on each site (site speci...
I am trying to begin planning of a system that would be both client management, and document management, with tools built in to do analysis on all of the transactions, etc. I'm wondering what are the considerations I need to be mindful of at the beginning stages so that when I need to scale up I haven't shot myself in ...
What does "toolkit design" mean and what are the basic steps to design a toolkit for a specific task/project? It appears in a task description which says: "This task deals with the design of detailed specification of the various tools that are employed in order to implement [insert some development task here]" So what...
I don't know whether this should be on programmers - I've been looking at the above three apps over the past few weeks just for myself and I'm in two minds. All three look good, are easy to use, and I came to this conclusion; Asana is the easiest to use ActiveCollab is the feature rich and easiest flow BaseCamp is th...
OK so I'm not so sure that "project" is the right term, but for my purposes, I define "project" as similar to what Visual Studio uses, or Microsoft word - files that the user can open and work on and then save, and when the user runs the application again the program is aware of the files that were worked on last time ...
The secure attention key is designed to make login spoofing impossible, as the kernel will suspend any program, including those masquerading as the computer's login process, before starting a trustable login operation. Why cannot other programs simulate control+alt+del? What is the reason behind this?
Both here on stack overflow and on Java Effective it is suggested that strategy design patterns should be stateless. In fact in the book it is also suggested to make each strategy object a singleton. The problem I have is that some strategies I envision for my program need states/fields. Either because they are path-de...
I am working on a testing tool that provides image comparisons. For test data insertions, I am using excel and csv files that supply the tests with text that is used by the tool to mock actual user interactions - in filling up of forms/screens in the tests. After the insertion, there is a need for verification to ascer...
Following is a table creating script created by Entity Framework using the model shown in https://codereview.stackexchange.com/questions/14077/is-it-proper-tpt-inheritance. In this script, there are two alter statements. What is the need for the second ALTER statement? SCRIPT CREATE TABLE [dbo].[SellingItems_Book]( [Ti...
I have experienced with two kinds of team. After a feature is assigned to me, one kind of dev lead tell me the exact file or class to add my code, another kind of team just say the story or requirement to me. The latter job is hard, if the software I am working on is too big to grasp the structure. Should senior guys t...
So I have been a bit lost in the terms, so first of all I present you what I have learned so far: System requirements specification - what users want, what the system should do Functional requirement - how the things, which users want, will actually work in the application Also I would say that the latter is a design d...
I hope this is the appropriate forum to ask this question. A group of colleagues and I just starting learning C# a few weeks ago and we are planning on having a discussion about language interoperability. So, I am looking for known/classical examples of .Net language interoperability issues. Like this one, where the c...
What is the best way to handle changes to product requirements or scope during or after User Acceptance Testing (UAT)? How dangerous is it to make those changes, and how can the danger be mitigated?
I've asked a question here before about multiple writers on a FIFO, and I know now that the write is thread safe as long as I write less than the PIPE_BIF, here is the link for that limit. What about read? what if have two(or more) readers in multiple threads for reading from the same fifo, do I need locks here? or all...
I'm a Rails newbie, so bear with me. I have a few places, some pages, some partials that use: <%= link_to "delete", post, method: :delete, data: { confirm: "You sure?" }, title: post.content %> Would it make sense to make this a partial since it is used...
What's a commonly accepted way of implementing SSO using a third party OAuth provider? I have a server with user resources associated with server's user ID, the user ID also has a Facebook user ID associated. Would it be a good approach to authenticate a client to the server if the login was redirected to, say, Faceboo...
In some organization I worked for web applications are developed basing all the business logic in Database stored procedures. For example, use html for view and servlet as controllers to divert the client request to appropriate Database stored procedures. What are the advantages and disadvantages of this kind of design...
I'm working at a company that would score 11 on Joel Test - at least on paper. In practice, however, nothing works quite as well as expected, and the project has been on DEFCON 1 for half a year. Now, most of my peers are happy if they can go back home at 6pm - on Sunday. One of the apparently good practices that struc...
Is there evidence that some software development best practices depend on programming skill level? I mean, these methods are good, but maybe the way the are used or the extent might vary? This question arose after I read Paul Graham's commentary about OOP, and the last bullet point of this accepted answer. It proposes ...
Let's say I have a linear function f(n)= an+b, what is the best way to prove that this function belongs to O(n2) and Θ(n)? I do not need mathematical rigor here. I need a programmers answer. Some logical way of explaining. This is precisely why I didn't post the question in mathematics Q&A and instead in the Programmer...
I wanted to ask if there is a typical structure for a team developing a computer game and, if so, what are the specific roles of the team members. Also, what is the size of such a team (in terms of order of magnitude, 5-10? 10-100? more?). Is there any literature on this topic?
I have spent a lot of time examining the various (major) software licenses and ultimately have decided upon using the MIT Licenses for my open source projects, and the Microsoft Reference License (MS-RSL) for my proprietary projects. Not knowing much about IP law, I have three simple questions that I haven't been able ...
For the first time I have been coding for an open-source software where all my work gets reviewed before being commited. I understand reviewing work isn't an easy task, so I don't like to waste reviewers' time and effort. But many times I make silly typo errors and errors of other kind while making a change in the code...
I'm primarily an ASP.NET developer but this question really applies regardless of language. So obviously it is a good idea to prevent external attacks that arise from session hijacking and csrf attacks as well. But what about internal attacks when the data involved is temporary, needed for the entire session but also...
I was going through the source code of an open source framework, where I saw a variable "payload" mentioned many times. Any ideas what "payload" stands for?
I've been studying the three and I'm stating my inferences from them below. Could someone tell me if I have understood them accurately enough or not? Thank you. Dijkstra's algorithm is used only when you have a single source and you want to know the smallest path from one node to another, but fails in cases like this ...
code found at: https://softwareengineering.stackexchange.com/q/158606/44933 Presuming that the problem indicated above is due to the test app and not due specifically to method generateRandomDigits(). When NUMBER_OF_DIGITS_TO_ORDER is <= 9, I do get a naturally ordered sets (just trying to prove that it is possible), b...
I am interesting in the pros and cons of serialization: intrusive and non-intrusive. On the one hand it seems non-intrusive is easy to use - class to be serialized should not be updated. It seems convenient for simple cases. E.g. XStream.Net implements such approach. But the issues can appear if this class is connected...
I'm curious about this, let's say I have: 00000000001 90 nop 00000000002 90 nop 00000000003 90 nop Is it executed exactly the same as this? 00000000001 0F1F00 nop dword [ds:rax] What...
If assembly language is only a readable way to represent machine code, then why are HLLs converted to assembly first and then to machine code? Shouldn't HLLs be directly converted to machine code?
Possible Duplicate: When are Getters and Setters Justified Why do we use get and set method in C#? And why do we use public and private method property? For example: public class Date { private int month = 7; public int Month { get { return month; } set ...
I am on my way to create an application with 4 bounded context using CQRS & event sourcing. In order to make these bounded context talk to each other I was planning on using Rabbit MQ. My requisites are the following : The bounded context must not know about each other The bounded context must not be hindered if the...
An application has the following logic: client => created *.cpp => sent to the server => cl.exe + *.cpp = *.exe client => created *.cs => sent to the server => csc.exe + *.cs = *.exe client => created *.pas => sent to the server => PascalCompiler + *.pas = *.exe etc. The language - C#. I hear that MSBUILD can help me...
I have been reading a bit about Common Lisp and I am considering trying to learn it (I only know very basic concepts) or even using it for some project. Question: how stable is Common Lisp as a language? What I mean is, regardless of new libraries, are new language features (involving new syntax and semantics) being ad...
Well I have been THE junior developer in a small team for several years. Now, there is a new fresh graduate so I have become the not-so-junior-developer and have been asked to mentor him. But I have no idea what to do since I have always been kind of a "figure-things-out-on-my-own" person and didn't receive much mento...
After watching National Geographic's MegaStructures series, I was surprised how fast large projects are completed. Once the preliminary work (design, specifications, etc.) is done on paper, the realization itself of huge projects takes just a few years or sometimes a few months. For example, Airbus A380 "formally launc...
I need to develop a Java solution for mutual authentication between Tomcat 6 (server) and SmartCard "IDGo 300" (client). In order to do this I thought of the following scheme: 1.Tomcat (server) send to SmartCard (client) the request of his digital certificate (signed by CA). 2.Client enters PIN and selects an available...
I'd like to know what are the main difference between the Foundational Subset for Executable UML models and the Executable UML profile (which followed the Schlaer-Mellor methodology). Thank you
Consider a UML Action contained in a UML Activity defining the behavior of a classifier. Such Action has three input pins connected to other output pins of different action by means of object flow edges. It also has an incoming control flow. My question is: does the action start when all the tokens _ those coming from...
I'd like to make a graphical user interface for my script, instead of running it from the console. I'm aware there's a wealth of UI libraries for Ruby, but I'm quite familiar with HTML and CSS and I'd like to use them for building an interface. So the question is: Is it possible to use a HTML rendering library to make ...
Ever since I heard about programming, I was told that any password (especially the one used on login) should be stored in database using any kind of one-way hashing algorithm, and never ever as plain string. So, it can't be read directly from database, using any method. Today I noticed that my bank (country department ...
What shall be the relationship between the receptions of a class (was classifier before Aadaam correction) and the AcceptEventActions in the activity describing the behavior of its instances? I understand the former is related to signals reception of the type while the latter is related to runtime ReceiveSignalEvent e...
I am fresh to Visual C++. While moving forward in the book "Programming Windows with MFC", I came across GDI (Graphics Device Interface) and use of paint brush. The book says a brush cannot be created if your GDI is low on memory. I want to know when and how does GDI get low on memory? And more important, what is the ...
Case: I'm working at a company, writing an application in Python that is handling a lot of data in arrays. I'm the only developer of this program at the moment, but it will probably be used/modified/extended in the future (1-3 years) by some other programmer, at this moment unknown to me. I will probably not be there d...
Do I understand correctly that Liskov Substitution Principle cannot be observed in languages where objects can inspect themselves, like what is usual in duck typed languages? For example, in Ruby, if a class B inherits from a class A, then for every object x of A, x.class is going to return A, but if x is an object of ...
Postel's law: Be conservative in what you do, be liberal in what you accept from others. "Lazy" code (per The Pragmatic Programmer): Be strict in what you will accept before you begin, and promise as little as possible in return. I'm developing a finance (asset pricing, etc.) framework for Python. Question: when de...
I was thinking about different server-side languages and this question immediately cropped up in my mind. What was the first server-side programming language using which websites were being created? Was it java or some other language? Note: I think some languages became prime server-side because they provided or rather...
I was going over this video lecture on master theorem from Introduction to Algorithm and while explaining case A of the master theorem professor says that some function f(n) is polynomially smaller than some other function at point 53:08 seconds: What does it mean for a function to be polynomially smaller than this...
I am the manager of a team of 11 software developers who look after my company's web sites / web applications, running up to 4 concurrent projects plus day-to-day support at any time. Within the 11 developers there is a mixture of technical skills, job titles and experience, although the team structure is flat with all...
Our website currently restricts a cookie-based session to the IP address that was originally sent the Set-Cookie HTTP header. In the past a user's IP would rarely change, so this didn't present much inconvenience. However, some of our clients accessing via 3G devices are experiencing session failures due to this IP res...
Do you know a good way to design (i.e. write down) software with a method based on pseudocode? I'm new to software design and read some information about UML. My humble class hierarchies are good so far, however, after it gets complex I notice that with "seeing the whole" picture I could have used a different structure...
The thing is, eager loading some object with all of it's associations reduces the queries made to the database, but the query time is greatly increased. The question is: This increased query time in the end pays off the database not being hitted so often? It seems to me that you are avoiding one problem and falling i...
We are often told that the hardware doesn't care what language a program is written in as it only sees the compiled binary code, however this is not the whole truth. For example, consider the humble Z80; its extensions to the 8080 instruction set include instructions like CPIR which is useful for scanning C-style (NULL...
When reading about web servers, frameworks, etc most of the time I notice that the goal is to have a technology that has the next features: Able to handle as many connections as possible. Fit an I/O model (connections to DBs and other web services). Those features fit the actual web model but I am interested in knowi...
Okay, before everyone goes shouting about duplicate questions, yes, I've already seen several questions like this here. But none answer the question. If I link against a GPL-ed library without modifying that library, do I need to release my source code? According to this question, the answer is yes! But this answer ...
I have just started using a NoSQL document based database (MongoDB) and i'm curious about the best practices for designing databases. I presume the architecture should be different from relational databases? Should I still aim for a normalized database? For example I have a particular use case; I have a user with a ...
My question involves setting up a Software Development process. If you came in to an existing project that had no formal methodology or process set up, and then were asked to set one up yourself, how would you handle it? I have looked into various methodologies like Agile, or subsets thereof like XP, but these are prim...
My company has decided to purchase a multitude of devices for browser testing our stages e.g. iPhones, Android, Windows and assorted tablets. They've tasked me with finding specific devices that cover largest common denominator of users and scenarios. We recently had a client that had us testing 10-20 different devices...
I have code that represents the interface for a library that is used by a variety of internal clients. How should that interface code be exposed to these internal clients that live in different source control repositories? The interface should be relatively stable, but is in development (as is most of the internal clie...
I have been reading Java Concurrency in Practice by Brian Goetz and inside the section Stack Confinement it is mentioned that each thread gets its own stack and so local variables are intrinsically confined to the executing thread; they exist on the executing threads stack, which is not accessible to other threads. Wh...
I am well aware of best practices for storing user passwords: Never store passwords in plaintext Never store encrypted passwords; always store password hashes Always salt your password hash to deter brute force attacks Always use unique salts to deter attacks using rainbow tables. However, I have recently came upon o...
Simply what are the practical techniques people use to check if a class violates the single responsibility principle? I know that a class should have only one reason to change, but that sentence is somewhat lacking a practical way to really implement that. The only way I found is to use the sentence "The ......... sho...
I work in a small team of developers who all collaborate on several Zend PHP projects. We are using Mercurial with a collection of upstream repositories, as well as Jenkins for centralized testing and health reports. We want to implement a shared library of common classes, but are struggling with finding a workflow t...
If there's something that would kill Go language, then it's name. I find it very hard to find anything in web related just by using "Go" in the query. The word is on of the most frequent in English. So I see everything in the result except Go-related stuff. Even Google, who sponsors the language and famous for tracking...
I'm working on a project which uses GIT as the main version control system for trunk, the official branches and most sub-projects/unofficial branches. As such, I want to make my own branch use GIT to allow the rest of the community to access my branch using the system they know. However, I'm working on a part of the pr...
I was reading about Assemblies (modules, which Microsoft CLR works with). The Assembly contains so called Manifest, which by definition describes a set of files in the Assembly. I know that Android applications also contain a file called Manifest, which also describes a set of files contained in the application. Is thi...
I have been recently asked in an interview if I know about any garbage collection algorithms. I knew what garbage collection is but I never really thought about learning about garbage collection algorithms since as a developer I never had to worry about it and the Garbage collector does all the hard work for me. Do you...
I'm interacting with Git through GitHub for Windows, which is funny since I'll never push my repository to GitHub. I'm working on it alone and it's intended to be used only by me. I noticed that my commits are listed under "unsynced commits" and under "history" it says "no commits". Which brings me to the question, wha...
In Java: int count = (Integer) null; throws a java.lang.NullPointerException. Why doesn't this throw a Class Cast Exception for ease in programmer understanding? Why was this exception chosen over any other exception?
I'm working in a WPF application that both imports and exports delimited text files. At both ends, there is a UserControl which encapsulates some logic about delimiter configuration. It has some controls for individually selecting delimiters, and a 'Presets' dropdown for quickly selecting certain common combinations ...
I have written a bash script I would like to put under GPL v3. I've read the GNU documentation on How to Apply These Terms to Your New Programs and How to use GNU licenses for your own software. Still, I'm not quite sure what to put there and which artifacts are needed. So far, I did the following: Put a file called C...
I'm in a situation where part of my system has a dependency on another module in the same system, but the modules themselves need to remain independently deployable, where the parts they depend on would be filled in with another implementation. A module in this instance is the concept of a bunch of components that all ...
Possible Duplicate: Resources for improving your comprehension of recursion? I am a programmer with 2 years experience, and sometimes think I could solve a specific problem with recursion, but in most cases I fail miserably. I am asking your advice about resources for learning, refreshing and deepening one's knowled...
I recently saw a question on SE about how to do such and such when creating an IRC bot. The only use of IRC bots I was familiar with was message flooding and spamming. I did a Google search for the string I used as my title and was led to an article that was an eye opener as to what all an evil IRC bot could do, but I ...