instruction
stringlengths
34
19.9k
I mean everything, not just schema changes. Even a simple SELECT on a primary key can't go into production, even though it has been code-reviewed by other developers (in context), without a DBA review of every statement, extracted from the code and submitted with EXPLAIN output, details of how often it will be called, ...
Background I'm currently designing my own programming language as a research project. I have most of the grammar done and written down as context-free grammar, and it should be working as is. - Now I'm working on the actual compiler that should translate the language into x86 binary assembly code, more specifically, I ...
On a project I'm working on, I'm trying to find a noun to describe the different parts of the application dependent on user interface. There are three parts: super admin, admin and regular users. Each of these parts consist of modules, interfaces with users, interfaces with the other parts. I've tried "sub-system", "mo...
Important: we have no issues whatsoever with source code documentation. This belongs to regular code audit and is kept up to date. Our problem is with developers documentation (or, "external" if you like), little blog-like tips from programmers to programmers which tend to be once written, often left behind. We use wi...
I am thinking about introducing my 12 year old son to hardware programming. I built a robot with the .NET Micro Framework and while he was fascinated with controlling the robot, his eyes glazed over when I attempted to explain how the code worked. And to be fair, it's quite complex for a beginner, requiring knowledge...
I wrote a little app to manage an arbitrary series of tasks (e.g., call a SQL sproc and capture out-vars, run another app, run an SSIS package) with dependencies between tasks. Each task has a status (waiting to start, failed and waiting to retry, failed and abandoned, succeeded, etc.). Internally, each Task object h...
I have written various user stories that describe functionality at a pretty high-level. For example: As an analyst, I want to view the current share price, so that I have quick access to an up-to-date valuation of stock across the Euronext, London and New York stock exchanges. This requirement is based on existing fun...
One of the few things that most software developers agree on is that you shouldn't rely on code to work correctly unless you test it. If you don't test it, it may have hidden bugs that are only going to cause you more work down the road. I understand how to test my normal code, but how should I test my test cod...
I am new to BitBucket. I have my repository. And 2 people working on it me, Admin and another developer with Read only access. So in order for him to do changes he forked repository and made changes, uploaded to his repository and created pull request. Now I merged this pull request with my repository. And made few sma...
I work for a large company which has several non-RESTful APIs. I am tasked with building a web application to interact with these APIs. Each API handles and provides very different business processes and data. I'd like to build RESTful (a) interface(s) fronting the APIs so as to make them reusable by other future web a...
I have a friend who has a slightly greater amount of programming experience as me. We were talking about all the different programming technologies we use and Interface Builder came up in conversation. Being of no programming background except for what I've taught myself, I personally believe that IB and all it's featu...
I'd like to see some valid examples of needing to let a thread enter a locked, non-re entrant mutex, then destroying the mutex (which supposedly terminates the thread). I can't think of any good reason to do this. I can't remember precisely what we were arguing about earlier today, but my colleague insists such techniq...
Have a very large project more than 70k LOC. The project definitely needs some code refactoring in Core Framework and in other parts as well. There was NO time set in the beginning of the project for refactoring. However with time and more than 40 developers joint and left the project. From my perspective is indispensa...
I have my own ideas about how a pointer-sized mutex could be made: The integer is used as a set of flags, counter, index, and a spinlock that guards an entry in a table of pre-allocated kernel objects given to mutexes only when threads are contending, and released afterward (only need at most N table entries for N thre...
I've started reading the design pattern book by the GoF. Some patterns seem very similar with only minor conceptual differences. Do you think out of the many patterns some are unnecessary in a dynamic language like Python (e.g. because they are substituted by a dynamic feature)?
Over at this question in the comments I mentioned that I heard that partial classes are best avoided if possible. What if any is the reason for this sentiment? Or If this is an invalid sentiment, how are the perceived detriments overcome?
What are the best practices to store and maintain serialized objects in C#? Any strategies or patterns that apply? What I have come to believe so far is this: Prefer Json over XML, both for space and for speed, but xml is easier to query/mine data via LINQ to XML for bigger data sets. For every single property, map ex...
When using the command line/terminal svn client, a colleague is getting "svn: OPTIONS of " [repo] "...authorization failed" error message when they attempt to checkout the repo to be their local working copy. They used to be able to do this but have recently had to change their password (periodic routine security polic...
I'm working on, and adding to, a GitHub-hosted project that includes this LICENCE.md (apparently the MIT licence verbatim): Copyright (c) 2012 [Acme Corp] Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the So...
On a project that I am working on we encountered some performance problems. We decided to drop hibernate in favor of plain Jdbc to gain database performance. By converting our code to Jdbc we achieved the performance that we aimed for but the code quality seems to have deteriorated. And it took us three months to imple...
I’ve been working in an eXtreme programming team and doing pair programming for over 7 years in a windows environment. When we first started doing it someone would log in with their windows credentials and therefore all access to domain resources, and more specifically version control, would be accountable to that wind...
I am writing code that uses one library with GPL (not LGPL) license, and one with the 3-clause BSD license. Since I link to GPL-licensed library, my code will need to be GPL as well. How should I, in practice, deal with the original LICENSE.txt from the BSD-library? (A) Can I distribute a project so that the main sourc...
I have read many posts similar to this on the site: however I still am questioning what is best in my situation (also the answers are contradicting from question to question). I have a website (web-application) with a controller per section of domain logic (i.e. ProductsController, NewsController, ContactsController, ...
I am new to StackExchange, but I figured you would be able to help me. We're crating a new Java Enterprise application, replacing an legacy JSP solution. Due to many many changes, the UI and parts of the business logic will completely be rethought and reimplemented. Our first thought was JSF, as it is the standard in J...
I have 5-10 files on one server that all catch XMLRPC-PHP requests. There's about 20 lines of require_once in each one that are all the same. It'd make life simpler for me to create a separate file that only has the requires and require that in my XMLRPC files. Is this best practice, or does it open up issues that I...
I'm releasing an open source project. I want to make it as inclusive as possible for any community that might embrace it. Specifically, I don't want the code copyrighted in my name when an entire community might work on it; that approach seems self-centred and alienating. My immediate thought to avoid this issue is to ...
I'm very new to source control management and one thing puzzles me: is it possible to search through the whole repository for a string? For example I'm tracking one file, which has 100 commits and I would like to see all the version of the file which contain "xyz" inside. Is this possible? I'm using various GUI clients...
I am a junior developer for a small business using scrum / agile development. A long-term goal of ours is to be appraised at CMMI lvl 2. We have a team of 3 senior developers who implement user stories and a handful of junior developers for support. We are moving towards a "three amigos" methodology, especially in re...
I practically never see any web application where server pushes messages to the client. While pushing messages from server to client is hugely used in multiplayer games, why this model is so underused in web apps? Is it wrong? Does it destroy the client-server model?
I just graduated with a degree in CS and I currently have a job as a Junior .NET Developer (C#, ASP.NET, and web forms). Back when I was still in university, the subject of unit testing did get covered but I never really saw the benefits of it. I understand what it's supposed to do, namely, determine whether or not a b...
Is there a difference between stability and reliability (at least in software engineering context) or can they be used interchangeably? If not, what would be some examples of reliable but not necessarily stable systems, and vice versa?
I can write code, resolve dependencies, and get my program to run on my computer; I have no idea where to go from here though. How do I get the software ready for distribution? The school environment has taught me to do a few random tests by hand, make sure nothing is obviously broken, then throw all the source files ...
So, my boss wants to have a complexity measure for a framework developed internally in our company. Is that possible? As far as I know, functions points do not apply to software that doesn't have persistence per se, and also doesn't have GUI's (it's a framework, built in C#, useful for crafting business applications, a...
Consider the following code fragment: int a[8192], b[8192], c[8192]; int i; for(i = 0; i < 8192; i++) c[i] = a[i] + b[i]; For what kind of cache will this program not run well (set associative, direct, associative)? I've been thinking about how to optimize this, but can't really see how it can be done. How can I c...
The Common Lisp Object System (CLOS) supports multiple dispatch (multimethods). When is this a useful feature in practice? I'm not just looking for an example of hypothetical functionality that would be easier to implement with multiple dispatch[1]. I'm looking for examples of where it's useful in real software, for...
From Steve Yegge's "Lisp is Not an Acceptable Lisp": Lisp has a little syntax, and it shows up occasionally as, for instance, '(foo) being expanded as (quote foo), usually when you least expect it. What is he talking about with '(foo) being expanded into (quote foo) in some situations? (As opposed, I would imagine,...
So I design and develop websites myself, mostly in WordPress. Once I'm happy with the site on my local server, I upload it and its database to the web server and let the client make whatever changes to the site. When he/she needs me to make changes to the code or the backend of WP, I usually work on the remote version ...
I've been working on a project for the past six months at a client site, since they require data confidentiality and didn't want us to work at our own office. When I showed up alone to this client site, I was told that I needed to finish the project in two months. Since the client is not a software company, and becaus...
Just a quick question.. I can never get a definitive answer when googling this, either. Some people say you can learn Rails without knowing any Ruby, but at some point you'll run into a brick wall and wish you knew Ruby and will have to go back to learn it..and some say to learn the "basics" of Ruby before learning Rai...
I've done some research on my own and understand the basic concept. But some insights can only be gained through actual experience. What are the advantages of myBatis that would make it worth learning a new framework? In what case would you avoid using it?
We're developing a web app that visualizes financial data. We have our first customer, but hope to get more. The terms are that the customers pay a setup fee, to customize the app for their needs the customers pay a monthly fee to license the app the customers install and host the app on their own servers (Some deta...
I am a developer in PHP technology, I am aware of almost all the basics of OOPS, but still cannot find out the way to apply these concepts over a procedural programming. I do it in very orthodox way, but I don't know why I am coding it in that way. I never have reasoning to justify my OOPS applications, which has infer...
My program allows users to store appointments in a calendar. What has been requested of me is the ability for SMS reminders to be sent to people to remind them of their appointment. The SMS would need to be sent out about 2 days prior to their appointment. I thought the best way to achieve this is to choose a time of...
I'm in a little need of names clarification. First a brief description of my position. I prepare as debutant giving a junior developer job descriptions, which also provided another perspective on how important communication is, and to put it beyond doubt. Simply; I like to understand what he mean with "Context" and I ...
I am facing some issues with a buggy library I currently have and it's used in my current project, I need to finish this project as soon as possible in order to deliver it to our client. However, this library is horrible! Lots of bugs, lots of errors and bad performance, I thought to write my own library to handle wha...
I've been learning Python for about 2 months now (Started with Learn Python The Hard Way, now reading Dive Into Python), and within both books, I still seem to be confused over this one bit of code. Lets just take the default code that Dive Into Python uses as an example: def buildConnectionString(params): """Build...
I have to create an UML class diagram from the following example code (Perl). I don't think that the standard factory pattern match in my case or I don't understand it correctly. I don't have AbstractFactory and ConcreteFactory but a single Factory. What does this example looks like in UML class diagram? Edit: This is ...
I am writing my own PHP framework (...waits for the groans to subside) for the purpose of learning (best practices, design principals etc.) as I'm entirely self-taught and consequently there are gaps in my knowledge. I understand that most mainstream frameworks incorporate some form of caching system, which I'm guessin...
I'm currently writing a compiler for a new language and I'm struggling with the linking aspect of new Types when there exists a circular reference. I've created a dependency tree so that I can compile the Types in the order of their dependencies which seemed to have fixed my problem... that is until I hit circular refe...
In an ordinary application, the same information may be retrieved from the database in several ways. If all those ways implement caching, you need to invalidate all those cache entries when updating an entry in the database. Some pairing between updates and selects is easy to do. Let's take an example of a product 123 ...
I have created some mockup screens for my app in HTML/CSS. I have 4 screens in total. They contain no client-side coding i.e. Javascript or jQuery. The screens themselves are quite bland at the moment, and I realise they require some further work. Some of my plans for the app going forward are:- Introducing client-sid...
After developing a website for a client, I've realized that the load time is too extreme, and some changes need to be made. The extreme load times are attributed to the bloated css/js frameworks that I've been using. Much of the code that was included with these frameworks is not even being used and is slowing the site...
For our REST service I want to send back a unique request ID with every response; useful for debugging internal projects but also for offering support to any third parties who might use the service in the future. I have decided that I need to use a response header, since not all REST requests need to result in a respon...
Is it common and/or acceptable to have Ajax requests every time a button is clicked on a shopping cart page? This is not a high traffic site. It will only have a few users at a time, like 5 max. I'm calling it a shopping cart for lack of a better term. The site is intended to let customers create highly customized o...
Sometimes, there are research and development projects where nothing is known in advance about the technology, concepts, and client. However, the manager still needs time estimates. What can I do to produce useful estimates?
I'm working on a project in which I'm considering using a hybrid of interfaces and composition as a single thing. What I mean by this is having a contain*ee* class be used as a front for functionality implemented in a contain*er* class, where the container exposes the containee as a public property. Example (pseudocode...
Im working on a "what is possible with the latest and greatest" prototype. One major issue that has been a big thorn in the side of myself and my AS/400 admin is when the existing system spins up, there are 35 individual applications, that each connect to 8 databases, and run a connection pool of 5 connections per. f...
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...