instruction
stringlengths
34
19.9k
My team are developing Umbraco websites and looking to improve the automation of our database deployment. Currently we have automated builds and deployments of our source code using Kiln and Team City, but cannot work out how to handle the database deployment. The challenge is applying changes made in the development ...
I have an interface to communicate with a DB (actually it is not a database, but this is to give a concrete example): interface DbInterface{ Result sendQuery(Query q); } And I am trying to improve reusability by separating specific components into individual projects: App1, an application that requires access to ...
Should unit tests test passing all cases as well as all failing cases? For example, imagine I have a test Widget_CannotActiveWidgetIfStateIsCancelled. And let's say there are 25 possible states. Can I get away with testing only that I cannot activate my widget when State == Cancelled, or do I have to also test that I ...
So I wanted to inherit from a sealed class in csharp and got burned. There is just no way to unseal it unless you have access to the source. Then it got me thinking "why sealed even exists?". 4 months ago. I couldn't figure it out, despite reading many things about it, such as: Jon Skeet's wishes "classes were sealed ...
I'm about to write a lot of test for my application. While some of the tests check whether everything works if the user enters the right data, most of them deal with wrong/missing data. In these cases nothing should be updated and an exception should be thrown. At the moment, this leads to a lot of duplicated code, bec...
I am using the MIT LICENSE in all of my github projects. The second line says 2013 at the top. For having the copyright to hold in future(i.e. after 2013) does it need to be changed each year or is it good as it is? Do I add to it, modify it or leave it as it is? The MIT License (MIT) Copyright (c) 2013 Aseem Bansal <...
I want to create a simple game. Every so often, a power up should appear. Right now the different kinds of power ups are stored in an array. However, not every power up should appear equally often: For instance, a score multiplier should appear much more often than an extra life. What is the best/fastest way to pick an...
I'm developing a WPF application whose core functionality involves creating a large object graph (often tens of thousands of entities) which the user can modify certain parts of, then save to a database. A graph can also be subsequently retrieved, modified and saved again. It's feasible that a user can create dozens of...
My current team operates under the Scrum approach to agile development. We do it properly, adhering to the guidelines and roles of a Scrum team, with a sprint length of 9 days and a team of 7. We go through the backlog in the grooming and planning meetings, estimating what we need to, negotiating with the product owner...
A colleague and I were developing an ASP.NET MVC project and during this we created a new action method to handle one of our views. I initially started created the action like so: public ActionResult Index(int id, int numberOfAssessments, int age) { // do stuff } However when I started writing we had a little dis...
As a member of our company's QA team, I frequently get entirely unenthusiastic feedback from developers in their responses to test results in our agile, web-based software-as-a-service shop. Most of our testing is manual, since automated testing doesn't really make sense for us right now, and developers are usually rel...
The bulk of my programming experience has been with C++ and (shudder) FORTRAN (I'm a scientist not a programmer as such, but I do my best). I've recently started using python extensively and find it great. However, I just spent a frustrating few hours tracking down a bug that turned out to be caused by me creating a ne...
Question: There is an infinite line. You are standing at a particular point you can either move 1 step forward or 1 step backward. You have to search for an object in that infinite line. Your object can be in any direction. Give an optimal solution My approach: Go 1 step forward, 2 step back ward Go 2 s...
We have a huge C, and C++ code base. There is a plan to add a new feature into the existing system, but, this should happen only after 3 to 4 months. So, we are looking for best possible options. Branching off is one option, but, this involves porting the bug fixes to the feature branch from the trunk. Staying on the...
I am developing a windows application and I want to store all the texts for labels, radio buttons, buttons, check boxes, column headers of grid at one place. I have tried class file, xml file, database table and resource file. I found that class file is the best way to store all these texts, but, I want to know is thei...
I saw these question in our school's past paper, and I'm wondering if this is a valid question. How big is bool in C and C++? A) 1 bit B) 4 bit C) 8 bit D) 1 byte What is the smallest unit of memory C or C++ use? A) 1 bit B) 4 bit C) 8 bit D) 1 byte The answer to both are D, but I am thinking if this is inappropriat...
How do programming languages define and save functions/methods? I am creating an interpreted programming language in Ruby, and I am trying to figure out how to implement function declaration. My first idea is to save the content of the declaration in a map. For example, if I did something like def a() { callSomethi...
How do you deal with a senior developer who does not think that the company standard way of developing software applies to them ? For instance: Will ask other developers to do work by email, rather than assign bugs to them. Will keep copies of documentation and code in their own local area, rather than keeping them i...
I have been tasked with organizing all of the company's internal content currently spread around sharepoint, a markdown reference manual and confluence into a single cohesive and usable portal in confluence. I want the home page to be the "dev center" and for it to be where we point new devs and where everyone goes for...
It seems really simple, but who invented the commonly-used otpauth:// scheme (used by Google Authenticator and other TOTP soft tokens by scanning QR codes)? When?
Suppose I have two unrelated interfaces with the same method: interface Table { /** * @param width (0 < width <= 100) */ void setWidth(int width); } interface Square { /** * @param width (50 <= width <= 10000) */ void setWidth(int width); } Then I create a class which implements bo...
This question has been haunting me because I'm now reading Kernighan & Ritchie's: The C Programming Language (K&R) but I meet a lot, and I mean A LOT, of C programmers that have never read it. So, my question is: Is there an advantage to reading K&R? Should be a necessity?
I have a schema that allows for multiple post types in my Django project (kinda like Tumblr). Users can make Posts of different types. One of those types is a photo, which I'll want the EXIF data for. If I have a super generalized table, does it make sense to create additional columns for the exif data? This would res...
I already read some post about the why use embedded script language but I want to ask when to use it. I have implemented an Objective-C / Javascript binding framework which allow me to write Javascript to use any Objective-C classes and methods. I found it very useful for debugging purpose because I can check / modify ...
I am trying to figure out once and for all how the GPLv3 interacts with web applications, specifically SaaS applications. I haven't been able to find a concrete answer about this. Let's say I have a SaaS web app that users can purchase a monthly subscription to and access. The source code is not distributed or made a...
We have a big and complex application composed by at least 700 DLL. The number is growing month after month. The code is not well structured because every DLL is a stand alone solutions. As you can imagine, when have some problem when we have to test a new feature on a DLL because we do not know exactly where it is use...
I have a question regarding the design of my software. The question has already been posted by me at https://stackoverflow.com/questions/18638697/program-design-with-multiple-data-sets-algorithms-and-results, but there I got the hint that this might be a better place to ask. There are four different data sets and three...
I have to advise a training on unit testing in my company. I would like to show a striking, real-life example of an unexpected regression not caught by compilation (of course) but detectable with unit testing. Something more like a seemingly valid change that in fact cause a regression in another part of the program. W...
I have a question regarding the design of my software. There are four different data sets and three consecutive algorithms operating on the data sets and on the results from the previous algorithm runs. Let D1 - D4 be the set of data sets, A1 - A3 the set of algorithms and R1 - R3 the set of results from the respective...
While using Apache Kafka, is it possible to get the offset of the message that has been produced? From the Kafka documentation page it says: each message in the partition are assigned a unique sequential id/number called Offset Now suppose when I am producing any message I want to retrieve the offset that has been as...
Working in a field called "revenue assurance" I basically build systems to validate other systems. After a while in this market it seems to me that all these "validations" are verifying either a process from my customer's environment or the data used by these processes. With this in mind I am considering using such def...
I once was on a project where a non-tech manager had the team spending half of every hour documenting what they just did so that someone with zero understanding of the tech would be able to understand the tech. Personally, I thought this was a huge waste, but there was no way to validate this was or was not waste. Is t...
Suppose in some ORM based project (say Hibernate) I am trying to fetch only few columns rather then the whole Object with may be more than 20 attributes. I am writing HQL like "select attr1, attr2 from Entity ". I know I am not taking advantage of using Hibernate because I will get the result in Object form only and th...
I'm working on a small team that will begin working on a large new project with another small team. The other team is currently working on a legacy system that they have been working on for years. The manager has decided that the developers from my team will be rotating every few months to replace developers working o...
When modeling a chat, should a chat object receive messages or a message be sent to a chat object? I'm not sure whether there is a definitive answer but maybe someone can point out benefits of one over the other. message.send(chat); VS. chat.sendMessage(message);
I have 3 classes: Meeting, Project and Agenda. A Project contains all sort of information + a list of meetings. The Agenda contains a list of upcoming Meetings. A Meeting contains some data + a list of Projects that were discussed there. The Agenda checks for upcoming meetings. When it finds one, it calls its Meeting...
I am trying to simulate SQL joins using java and very large text files (INNER, RIGHT OUTER and LEFT OUTER). The files have already been sorted using an external sort routine. The issue I have is I am trying to find the most efficient way to deal with the INNER join part of the algorithm. Right now I am using two Lists ...
I'm trying to rebuild a simple c# time tool that displays certain statistics about time worked for the web, however, I don't have access to a server so I can't use server code like PHP which I would do if I could and this task would be a doddle. The employee's work information is stored on an intranet site that the C# ...
I've been using C# for a while now, and for the sake of furthering my career and extending my knowledge of programming, I want to get into C++. C# is very useful, and fast to work with, but since my team and I will be making large scale projects I need to consider working at a lower level language for several reasons. ...
Our small team has made the curious observation that diagnosing and fixing broken automated tests is a useful activity; in particular, if the CI build indicates that developer A's last check-in broke some tests, developer B can learn about (and possibly improve on) what developer A was doing by understanding why the te...
Background Developing a system for creating eBooks. The data is highly normalized. The eBook designs are packaged as "themes." The themes can be configured with options for: fonts, colours, some layout, and thematic elements (such as squares for bullet lists could become circles, hexagons, or arrows). The options are t...
Ive just started working with Git (Github) in anticipation for an up coming project I'm project managing and designing and developing the front end of. One thing I couldn't work out is, is it preferable to publish each individual change as you make them, ie. updated sidebar js, designed new FAQ page (each as individua...
Over the years I have assigned values to classes and html elements in all sorts of ways: myClass MyClass my_class my-class . . .and so on. As I am always trying to hone my craft and make my code more readable for others, I am going to discipline myself to stick to one convention moving forward. I am leaning towards...
What specific conditions or requirements should you create your own array over using std::array? Here is my background: I'm developing a small simple library that a small group of people will use and hopefully build upon. The current structure allows for both std::vector and std::array using iterators, however, a lot o...
Android source code and many Android open-source apps and libs use m prefix for member fields and s prefix for static member fields: private static boolean sStarted; private long mTimestamp; I personally dislike this, because it looks ugly and it's redundant – my IDE already uses different color and formatting for loc...
So, as Microsoft has created many forks and branches off of .NET, there have been a few different product names come up: Silverlight .NETCore/WinRT/.Net for Windows Store Apps .NET for Windows Phone/CoreCLR .NET Micro Framework .NET Compact Edition However, what do you call the traditional .NET we all know and love? ...
I am a front-end developer who barely even see a file with .h or .c extension. I know basic C syntax, I've learned it in Unreality but never was interested in such low level programming because it was simply too much setup for simple things. I am very interested in learning all aspects of Computer Science but I want ...
The theoretical situation is this: Let's say that we have a digital dictionary (by which I mean a traditional list of words and definitions, not an associative array). For the sake of simplicity, let's also say that each word can be replaced by its exact definition, and still make sense in a sentence; for example, if ...
I have done a huge ton of reading up on Simplex Noise now, and after a lot of confusion and headaches I think I am able to form an idea of how Simplex Noise works now. Am I right, that simplex noise (2D) is just a grid build of Simplexes, in this case triangles, where at every corner of a triangle there is a value bet...
I thought I was doing breadth-first graph search correctly, but my instructor's grading script is telling me that my answer is incorrect. From the instructions: Consider a breadth-first graph search on the graph below, where S is the start and G is the goal state. Assume that ties are broken alphabetically (so a parti...
My background is back-end server development. Very back-end. Now I work in a position where I need to also take care of front-end. Nothing fancy but I need to be able to code for front-end as well. As I said no fancy stuff as I am not a designer. I know some very basic stuff about html/css/js but most of the time I...
I understand it is better to automate BDD specifications below the user interface whenever possible. For example and quoting from Gojko Adzic's book: Specification by Example: Don't check business logic through the user interface My question is then: What are the specific use cases when using the UI layer does make s...
I was in a conversation with someone who codes for me. He was frustrated with my approach to a particular problem. I am entirely self taught and very pragmatic - I am not a professional developer instead I sometimes write code to get something done and then pass it on to him to clean it up - make it robust etc. We ...
I have been working on a system alone for about two years. I inherited the system from a contractor who spent about two years working on it before me (alone). The system is not particularly well designed because there is business logic, presentation logic and data logic mingled together. It is a very complex system, ...
I'm working on a system that allows Administrators to define Forms that contain Fields. The defined Forms are then used to enter data to the system. Sometimes the Forms are filled by a human via a GUI, sometimes the Form is filled based on values reported by another system. For each Field, the Administrator can define...
Naming a variable or class, for example, must adhere to certain rules (such as not allowing keywords or reserved words as identifiers) I really don't want to code my own method to do such a thing. Does java have something already built in? My goal is that I am building an expression builder / code generator. It will re...
It was funny for me, and I'm interesting the reaction for this question of the community. It was interview for C++/Qt developer, and question was asked "What is virtual function". Not something like "how polymorphism in C++ works" or "how virtual functions works" but what is. My first thought was to answer "Virtual fun...
I learnt some about pipelining but those were 4-stage and 5-stage and I think that modern pipelining typical is much longer and more complicated in practice. How long are typical pipelines and how much can we expect them to increase and where is the point of reaching diminshing returns in performance gains for longer p...
A word processor is a complicated creature of many layers and pieces, but it represents a relatively simple concept: a piece of paper with writing on it. This leads to the problem of having many abstractions without enough intuitive names to describe those abstractions. Not everything can be a document. The solution to...
I'm rather new to the broad world of Git. I have read the manual and have been practicing but I am confused about few aspects of it, which I couldn't figure out after searching for. I'm wondering: In a project (post first commit), when is the right moment to stage source files? Right before committing? Right after add...
First of all, pardon the title, as it's not very clear. I have an application I am writing that is GPLv3, and is in Java, which means that classfiles are generated and linked to for general operation. I am also using a scripting engine which, for performance, links any scripts it runs to my program's scripting librarie...
I have an app for creating simple graphs (the kind with vertices and edges) and then using different algorithms on them (BFS, DFS, topsort, Prim's etc) for demonstrating how they work. I'm now working on porting it into a Rails app and deploying so it can be used by my university (hopefully). Currently the graphs are ...
I used to work in a waterfall methodology and now I am in a team that is following an agile methodology. It seems they are doing it wrong. For example, we have stand-ups that last 25+ minutes daily, which is really annoying. Additionally, I feel more like I am justifying my salary to management than anything else. Am I...
I have a few sites which are all hosted on the same web hosting service under shared hosting. My web host supports Git and I have SSH access to it, and I also have Git setup on my laptop as well. I want to make it so that when I do a "git push origin master", it will automatically update the files on my web server, an...
I am familiar with Agile and Pair Programming (http://en.wikipedia.org/wiki/Pair_programming). I thought Pair Programming was used if there was a complex requirement i.e. two sets of eyes is better than one. Is Pair Programming also used to train less experienced developers and bring them up to speed? Also, how often ...
Most of my client side code ends up as a long script in one file the mostly looks like this: <script> function someFunction1(){/*...*/} function someFunction2(){/*...*/} ... var globalVariable1; var globalVariable2; ... $(function(){ $('selector1').click(function(){ //get relevant data from various DOM elements ...
What techniques are there for debugging remote client side errors in a web application, especially when they only affect a small subset of users? In my case we have an app that is working well for hundreds of users, internally and externally, but a handful (12) have a specific problem with a JavaScript that prevents th...
Even though I've programmed on a professional level for some years I still do not fully understand error handling. Although my applications work fine, the error handling isn't implemented at a professional level and is a mix and match of a number of techniques. There is no structure behind my error handling. I'd like t...
what is the simplest and fastest way to support simple scripting in a .Net application? I search a lot but only find many things with practical no documentation or outdated since years. I only need to transfer a simple .Net Object to the script and get a bool result from it.
This is the link: https://gist.github.com/jgarber/2302238 I am new to github and web development.So please bear with my questions. I would like to use the responsive video code on the link mentioned above, for a commercial website I am building. I see that the code is posted under the 'public' section but there is a c...
I am trying my hand in python, Django, JQuery.. etc to make a clone of imdb site. Currently I'm in web-development from past 10 months on same technologies. In my spare time I want to develop a side-project which may look good on resume. I came up with an idea, to make a clone of imdb.com. But after 2 weeks of developm...
My main problem when trying to form a program is that while I have the tools at my disposal, I am too disorganized to properly use them to solve my problems. Often my process is simply trial and error until the program works. I am looking to see what others use to organize the process of writing programs.
A little bit of background, we've made an electronic POS system for registered vendors of items of a well known brand. The vendors are required to login to use the system. Recently, IE has been giving us lots of painful maintenance problems than before. Our boss is getting worried about running into further maintenance...
I am new to web programming and just started learning XML and AJAX. I am creating a social gaming website for my college project. I am confused at the point of using XML for AJAX in HTML5. As XHTML is replaced by HTML5 so is it ok to use XML or i should choose JSON (i know nothing about JSON but it is what I found in a...
I have a question about CA1819 msdn performance warning. The rule is: Arrays returned by properties are not write-protected, even if the property is read-only. To keep the array tamper-proof, the property must return a copy of the array. Typically, users will not understand the adverse performance implications of calli...
The big question I have in my mind: how many developers are brownfield ("enterprise") compared to greenfield (all new code, from the ground up). I'm constantly reading breathless articles about the latest technology, only to find out that It Just Won't Work On Our Enterprise Software codebase. People aren't ready for ...
I know Lisp and Haskell are logic and functional programming languages respectively, but what exactly does this mean? How do they differ from other languages? I've heard that learning these will make you a better programmer and improve your logic. Is this true, and if I go learning Lisp or Haskell to a competent level ...
I have several algorithms that I would like to test against the same data sets to compare their results. I don't know how to design it so there is maximum readability and maximum efficiency. I have considered creating a class for each algorithm, and giving it a copy of the data to work with, but it doesn't seem that th...
Which is the preferred test package structure for packages containing subpackages: Tests in Subpackages? a/ __init__.py b.py c/ __init__.py cc.py test/ __init__.py test_cc.py d.py test/ __init__.py test_b.py test_d.py This structure suggests that each subpackage is a cohes...
My team is wanting to migrate away from compiled code to dynamic code. We have a wide variety of customers and each has different business rules. Instead of having a single compiled code base, we are considering having different templated script files for each customer. However we have a lot of compiled code, so for no...
When building an application one considers the appropriate technology of choice for best long term impact and scalability. If building a media streaming application for mobile and desktop should one still use flash or silverlight, or html5 and javascript? How does one select the right technology?
I'm working on a Python project that is executed on a terminal (or console) for which I am planning to implement a GUI. I did not major in CS so I really have no idea how to effectively design a terminal GUI such that: the user interface looks good in GUI, it is directed to a certain widget, let's say, a text label, o...
Is there any time CType() is the proper option over other methods? I did plenty of thinking on this myself, but wanted to put the question in hopes there would be answer to my question so I can put the question to rest in my workplace. My idea is that CType() should never be used. But others seem to think it's still a...
Hello I have been using C++ and Java for years. For better or for worse, I have always looked at JavaScript as not as powerful as these languages and therefore probably not worth my time and effort to learn. However, I have recently been more interested in web development. I have researched Rails, MySQL databases, Htm...
I built a web application using PHP. Now, I want to sell this web application online for customers but I want to guarantee that only one customer (only one website) use this. Is there a way to make the script under a license (which I provide)?
Backstory: As the single developer with experience in the chosen technology, a month ago I drafted a component that for all extents and purposes worked within acceptable levels according to the demos that were had. Four weeks and assorted developers later (that´d be more or less last Thursday), the feature entered Q...
If I'm a senior project manager, should I still keep learning new technology? For example, every month every year, most language updates themselves, and a lot of new programming concepts become popular. Many new frameworks and patterns are created and make things easily. But you have to spend a lot of time to keep up w...
I have an assignment to convert various language descriptions into NFAs and DFAs. Having graduated with my CompSci B.S. years ago and not touching the topic until my M.S. program, I am racking my brain on one of the questions. I can easily construct a DFA, but the answer must be an NFA that is not also a DFA. I am not ...
I have been considering this approach for a project I am about to embark upon and would like to hear from other programmers about their experience in contributing code for equity. Has anyone been truly successful in such an endeavour.
I lead a development team and I want to release our product as often as possible (Continuous Delivery). In many cases, we have to implement a feature that takes longer to implement than the time between releases. I still want people to commit their code on a daily basis (Continuous Integration). Many times implementing...
I'm wondering what the best data structure (for storing data on disk) is for storing immutable time-series data (99% of the data is truly immutable, the 1% is metadata that is separate from the immutable data). I've been looking at log-structured merge-trees in particular because of it's heavy use by Cassandra and the...
AFAIK, Scala and Clojure are implemented in Java and Java is implemented in C. I suppose that many or most languages are implemented in C, for instance Perl, Python and SQL. I don't know much about language implementation but maybe you can tell me the rationale to favor one implementation language Java over another C? ...
So I was wondering today, where would you put utility classes in an ASP.NET MVC app? By utility classes I mean classes that can be static and are just used to perform a function. Like a class to send an email that takes email address , subject, and body as arguments. I would assume maybe creating a separate folder and ...
I've been heavily using a pattern for years now, but I don't know what it's called. It looks like this.... class xzy { public function getFoo() { if ( undefined(this.foo) ) { this.foo = new Foo; } return this.foo } public function setFoo(foo) { this.foo = foo; return this; }...
When you have a function that wraps another one in Scala. What do you call the nested function? I found this : def factorial(i: Int): Int = { def fact(i: Int, accumulator: Int): Int = { if (i <= 1) accumulator else fact(i - 1, i * accumulator) } fact(i, 1) } I usually use just do bec...
Here's what am trying to do (and searching for similar hasn't shown any results anywhere): On my website - provide an input box which will search google for results. I want to display those results on my page and customize the URL of those search results. So whenever a user clicks on the displayed result, my applicatio...
I had a look at XSLT for transforming one XML file into another one (HTML, etc.). Now while I see that there are benefits to XSLT (being a standardized and used tool) I am reluctant for a couple of reasons XSLT processors seem to be quite huge / resource hungry XML is a bad notation for programming and thats what XSLT...
Our team is currently facing a situation where we are changing a feature that is in the product today. This feature has Selenium automation tests associated with it. We are performing a fairly major overhaul of the system, including its UI. We expect this work to take quite a few sprints. During this time, other teams...
In the code I am working on, there are a lot of really small objects like: class HasFieldLameSetter { public: HasFieldLameSetter(field& p_):m(_p){} void set(bool p2) { m.hasLame = p2; } field& m; }; Having lots of small classes creates a hard-to-re...
Haskell often provides two versions of a given function f, i.e: f :: Int ... genericF :: Integral i => i ... There exist many standard library functions with those two versions: length, take, drop, etc. Quoting the description of genericLength: The genericLength function is an overloaded version of length. In particu...