instruction
stringlengths
34
19.9k
I am googling this issue now for weeks, but cannot find a good discussion. It boils down to this: As POCO entities used in a dbContext are in fact a definition of the database, shouldn't they be constrained to the Data Access Layer and not be visible outside it? On the other hand: it is convenient to hide some POCO ent...
Can you determine if this Open Source Winforms UI Library licence allows companies to use this code in a commercial software application? The MIT License (MIT) Copyright (c) 2011 Sven Walter, http://github.com/viperneo Permission is hereby granted, free of charge, to any person obtaining a copy of this software and ...
We have a reoccurring conflict with one of our larger and strategically important customers. The company (let's call them "C" for now) sells and distributes technical articles, everything from hardware components to hairdryers, and has more than 400000 products in their catalog. The product owner, who is also the head...
I am a big fan of DI/IOC. It is great for handling/abstracting away hard dependencies, and makes life a little easier. However I have a small gripe with it, which I am not sure how to solve. The basic idea in DI/IOC is that when an object is instantiated, all of its dependencies are pre-filled within the constructor. H...
We are part of a SOA implementation. We publish events via the enterprise bus for certain changes in our system. The architects here have advised, however, that some bulk changes to data should go via a flat file (generated by our system) and handled (moved between servers) by middleware, because they want to avoid ove...
So I have a function in C like this: void crunch(const char *in, char *out, size_t inLen, size_t outLen) { //... } If the two buffers overlap, the function may mess up the input buffer as well, while generating output. What's the general practice? Should I always consider overlapping buffers when implementing fu...
Preamble: Let's say I aim to cover all my classes with test coverage. Despite the common opinion (expecially in Java community) to "not pay too much attention to Cyclomatic Complexity (CC) and code coverage", I really think that these information are extremely useful: When you have a very high CC, or an uncovered zone ...
Some team members just wait until the stories they are most likely to work on will be discussed and only then they participate. Otherwise they just play with their phone and don't listen. In some way I understand this position. Why listen to a discussion about a feature you are unlikely to help develop in the Sprint or...
A suggestion has been made by a team member to leave all debug code intact in our web pages... and then to create a variable that can be turned on / off to enable / disable debugging. This is a technique we use in some of our low level, non web code. Just wondering if anyone had any comments on how they've implement...
Many a times I need to log into a website that I used months ago and have forgotten my password. So clicking the reset password link and the site sends me an email with a single use link which allows me to enter a new password and logs me in. Happy days. This got me thinking; how about we skip the whole password thing ...
So I've started a project to generate reports for our system. These are reports that we deliver to our end customers and they are so specialized that no existing system can generate them. This is not the problem however, the generator is working just fine. For simpleness I've based it on an ASP.NET-solution that genera...
Just a quick question on Web Application attribute, if responsive (which mainly stems from web design) means website that adapts to different screen size, then the closest term I can find for Web Application which is highly 'responsive' to the user input (click, touch, etc.) is interactive? One might call it 'native-li...
I have an array of objects. Instead of me when performing a task asking every object If they have anything to say about that, I would rather like the following: Perform Task Object #4 Hey, I have something to say about that! And If object #4 says something about that, maybe Object #17 has anything to add up with, be...
I had created a extension method which extended the string type in C#. // actually checks if the string is empty or null and then looks up the default // promotion code which is set in the backend admin system. promocode.HasPromode(); I thought that was fine and dandy, but another colleague thought I should inject ...
My android app needs different sized versions of images for different purpose and bandwidth preservation. Approach one: when the user uploads their avatar or another image, my php script creates 4 versions of that image: mini_200, medium_300, big_400 and original. those paths are then taken and stored in the database...
Part of code review feedback is suggesting better names for methods and classes. How can I address feedback about class and method names which does not suggest an alternative? For example, I might create the class public class FooBar { } My reviewer would then say, "Try to think of a better name than this." or "This n...
Is that a common practice to have a single product owner for more than one Scrum team, or usually you have a product owner for each team (even if multiple teams work on the same product). Thanks
The Code I have high-business-value daily-used-by-customer software that is written in PHP and spans approximately 600K lines of code. Customer for a long time needs, wants, and demands new features and functionality. The time to have it done is yesterday. So, just write the new features and implement new functionali...
I have been working through a high-performance application where I have identified a bottleneck. The bottleneck is actually when the application must insert messages from a socket, it will record them in a database. The trouble is the speed at which the messages come through are so fast that the application cannot catc...
I'd like to include some data from a GPLv2 licensed project in my MIT licensed project. More specifically, I want to use the data from the other project as the training data for my machine learning algorithm and I'd also like to include the trained model in my project. I don't want to include the whole project source ...
My team is developing a multi-tier API with scalability and modularity in mind. The public access point of the API is fully REST. However, we are splitting the data access layer as another tier in our architecture and this layer will be on another physical server. We decided that RPC would be a good communication proto...
What are the best practices for designing a workflow for inviting users to a beta website? This is not for any specific programming language. 2 main requirements are An interested user can request for an invite using her email A signed up user can invite others via email (or social media maybe?). My thoughts: In ca...
I need to do some performance measurements inside my application. I want to measure, change some parameters, measure again. There are different algorithms I want to test, and there are various parameters which interact with each other in that the total performance depends on all of the parameters (but the parameters th...
I've been trying to find what I'm supposed to do when I want to use code I find on GitHub. I think this post had some good information but I'm still somewhat confused. I want to use code found in this repository https://github.com/wcdolphin/python-bcrypt So according to the answer given the post, I'm to take the conten...
I have around 800,000 rows of data stored in the boost shared memory from the database. The data are in the form: Id Color Length Size 1 1 2 4 2 3 4 5 3 2 2 0 4 1 2 ...
In my organization Scrum teams almost never finish all of their stories 100%. I suggested that we commit to fewer stories each Sprint, but the R&D manager says if we do that people will still not complete the work, but will just do less of it thus slowing down development. He says there is a Student Syndrome at work he...
I'm programming an app (php) which requires a very long list of similar yet different functions, which are being called by a set of keys: $functions = [ "do this" => function() { // does this }, "do that" => function() { // does that } ] etc. I've chosen to place the similar functions ...
Should we avoid using logging in business model classes and try to move logging to service/controller classes? In for example java context, logging in model classes will hard couple the code with dependencies on slf4j or commons-logging etc.
HSQLDB is great. It (also) has an embedded mode (no dedicated server needed), which allows for quick prototyping of stuff like Proof of Concepts, and it can also be great in production-ready applications, as a quick and simple storage of various data. However, at least 90% of the projects I've worked on in the past yea...
In a server -> client scenario, wouldn't it be simpler and faster to grant a public user access to a Stored Procedure rather than using web services (XML, REST, SOAP, etc) and other interoperable solutions? That way you could connect directly to a database and get relevant content and do what you will with it in the sa...
Imagine you have some exchange of data between two endpoints (webservices or let's call URL). Data can travel in any way (Xml, Json, GET, POST) it doesn't matter. I've got the source code of the first endpoint (I drawed it on the left). The second one is from a third party and will call back my infrastructure on a thi...
I know that the ScrumMaster should be a leader, but it's a good practice to have a technical leader as a ScrumMaster. For example: a coordinator.
From my understanding I though the data layer should isolate the Data Technology from the rest of the application, for me this also include the schema in this case the data entity. Recently I've been looking at the Silk project from Patterns & Practices http://silk.codeplex.com/, and noticed that data entities are tran...
I've been thinking of using a Hyper-V Machine as instead of physical computer for installing my .NET / Azure / Xamarin / ASP.NET / Windows Phone development tools. That way I could easily move from my desktop to my laptop when I need to develop something on the go. Are there any limitations in this scenario that I sho...
I have tried a lot but could not find a way by which I will find if an email id exists or not. My problem is that I do not want to make visitor to email me with fake email Id. Is there any solution for this? I do not want to use smpt service as it send mail to solve this.
I am writing a matchmaking script for a game through a web portal. For the past few days I have been looking into the different options and I believe the following approach would be the most optimal but I would like the opinion of others. Get players match requirements through a web form (Method GET) and place the pla...
I've started working as a developer fairly recently, having worked as a systems administrator before. My understanding of how a software development team using Agile functions is that the "what we need to implement" communication happens mostly in one direction, from the product owner to the developers. Developers can ...
In Hadoop, objects passed to reducers are reused. This is extremely surprising and hard to track down if you're not expecting it. Furthermore, the original tracker for this "feature" doesn't offer any evidence that this change actually improved performance (unless I missed it). It would speed up the system substantia...
I was reading this question and the accepted answer says that BigDecimal is the best type for representing currency values. I've also seen several other questions support the use of big decimal. Why is BigDecimal the best type? I don't understand the relevance of arguments such as precise calculations or people with l...
I was bitten by using the is operator when i should have been using ==. Am aware that the former tests for equality of the objects' identities and that the latter tests for equality of the objects' contents. Using is, i thought, also implicitly tests for the equality of the contents. For example if a is b is true, t...
I've noticed that with remote support services, a technician usually sends you a download link to an executable. When you click on that link, it installs a software which automatically connects with the remote technician and allows him/her to access your computer. Basically, what's happening is that somehow the install...
Suppose there's a GPLv3 app that has a GUI and a CLI. Can I legally expand its CLI (to give me access to functionality hitherto only available via the app's API), release the result under GPL and then create a non-GPL (perhaps proprietary) app that depends on this modified GPL app (via the expanded CLI)?
I need to choose one of three values of an integer using the value of a column on a nullable column of a table. There are at least two approaches: 1) use SQL to do all the work: test null values, and choose between the other values, or 2) read the value and use code -in this case Java- to choose. Which one is "better"...
Lets say you have a button objects on a form with a click event (c#/.Net). How is the event handler normally named throughout the industry? fooButton_Click fooButtonClick (or if you like Hungarian) btnFoo_Click btnFooClick When visual studio creates the event handler it defaults to underscore + EventName. This seem...
Ok, I know that using singletons is generally a bad practice, but if I do it (for db connection, logging et al.) am I allowed to go (in respect of clean design) with a module defined variable that is initialized during the startup. eg.: if __name__ == '__main__': datasources.database.db = DB(dbpath) where db is ...
I have to write software project documentation for an application which will support both iOS and Android. Each platform has its specific features and the mobile app design and requirements are almost the same. At first, I thought to include all the requirements in one document by separating the platforms side-by-side....
I'm designing a set of APIs for some applications I'm working on. I want to keep the code style consistent in all the classes I write but I've found that there are a few inconsistencies that I'm introducing and I don't know what the best way to resolve them is. My example here is specific to C# but this would apply to...
I just had a Release Retrospective for my scrum team. We talked a lot about our release process. I pointed out that because our company is not able to tolerate bugs in our production environment we are not be able to adhere to the traditional scrum mantra of releasing often. In short, we are a medical company. Bugs...
How far in advance should you estimate stories in your backlog? My concern is that estimates that are 6 months out will become out of date as you develop features in the current sprint. I thought that with agile you re-estimate your current sprint.
I am a member of a small team who developed software to control the hardware of a robotic device. Now the customer demands to see our commercial code. Our promise was just to develop the software and make his machine work. (He failed to program the robot himself, that is why he hired us). But the project did not start ...
I have designed the interface of a mag app which would deliver digitized magazine in the size of A3 paper to the mobile phone. My choice of fileformat is jpg of each of the pages, but is there any better way to do this that using jpeg format. The file for one sample magazine was 16MB, and I'm stuck weather to deliver...
I have watched the active record classes in our project grow into large, do-it-all classes. When you need anything about a user, for example, you should go to the Person class. While this makes perfect sense when you consider the domain, in reality, the Person class is a mishmash of lots and lots of functionality, whic...
Obviously if the product owner judges solely based on whether the committed stories were done, it wouldn't be good, because then the team will just commit to fewer stories next Sprint. On the other hand if the team made a tremendous job and overcame huge technical problems, but the commitments were not met, its also no...
I have some JSON data in this format (5,000 instances for now): {"id":"123456","icon":"icon.png","caseName":"name of case"} I am allowing the user to search for the name of the case and then return the id and icon to them, and in some situations, use the case id to run other functions, based on the search. How should ...
I work on a lot of projects for fun, so I have the freedom to choose when I want to finish the project and am not constrained by deadlines. Therefore, if I wanted to, I could follow this philosophy: Whenever you hit a bug, don't debug. Instead, spend time learning about topics related to the bug from textbooks and wor...
I sit with a project that I need to quote, and until the job is awarded, I can only use "View source" to check, and ask a few questions about the system. That makes quoting outright impossible for me to do. My question is: how do one go about quoting for such a project? What kind of questions should I ask? Do I decline...
I'm strugging to know when to use a base class with Polymorphism or an interface. Providing my object exposes DoThis() then I can't see why it matters if it's an interface of a base class. Please consider the following public void MyMethod() { var myObject = new MyObject(); myObject.DoThis(); } In regards to ...
I'm studying Types and Programming Languages, and have some trouble getting my head around the concepts of the 5th chapter, The Untyped Lambda Calculus. Specifically, redex, reduction and the various evaluation strategies are doing my head in. The following is what I understand put into my own words, in an attempt to e...
Almost 2 years ago I had need for a monitoring system, that monitored servers ping times, databases and various other metrics, but also things things like my email inboxes (for unread email), my game servers, webservers, and lots various other stuff. Nagios was the only system I'd used seriously, I liked it's architect...
Turned out, this question is not easy to formulate for me, but let's try. In Android, pretty much any UI object depends on a Context, and has defined lifetime. Android can also destroy and recreate UI objects and even whole application process at any time, and so on. This makes coding asynchronous operations correctly ...
This is a C specific question. I am trying to keep everything possible inside the translation unit boundaries, exposing only a few functions through the .h file. That is, I am giving static linkage to file-level objects. Now, a couple of functions need to be called by other modules, but not directly. My module/file/tra...
I am thinking of using non-recursive locks; I have found them to be having performance superiority over the standard recursive locks (e.g. SimpleRWSync). I have mainly been using critical sections but in highly threaded environments, locking was producing significant delays. What are the benefits and/or pitfalls? Do t...
I've about seven modules arranged like so: Service Processing Common Account Email Scheduling I try to make it my policy to restrict code to the module that actually uses it. Code that is shared by multiple projects (3+) is sent to common. However, there are a few classes that are only used by two projects. In my mos...
I have a C# application (Desktop based application for Windows OS), which I wanted to use from Web browser. The application is a kind of analyzing tool, which takes some input values and performs set of calculations over it then displays an animation of the results. Since the application can't be coded again in a new l...
We are using some utility methods in our company to simplify programming. So we have following string extension: public static bool IsNoE(this string s) { return string.IsNullOrEmpty(s); } This is just for convenience and the intention of this question is not to discuss the sense or senseless of such methods (main...
Short version My boss wants me to store user passwords for an ASP.NET Web Forms web app we're developing in clear text, so that a user with admin rights can click a button and get back the current passwords for the accounts she controls. I don't want to do that, because I deeply care about the security and privacy of u...
I'm refactoring an expense tracker system using Object Calisthenics. I'm able to bring my Class down to five attributes. How do I go forward from here? This is my class right now. public class Expense { private Identifiers ids; private AmountInCurrency amountInCurrency; private Remarks remarks; private ...
You can do it this way: [Route("api/DeliveryItems/{ID:int}/{CountToFetch:int}")] ...calling it like so: http://localhost:28642/api/deliveryitems/N/N ...which has the benefit of the routing attribute documenting exactly which args the methods needs. Or you can do it this way: [Route("api/DeliveryItems")] ...calling i...
I'm making a web app for a client who is probably going to use it for commercial use. I'm not affialited with me, nor we are commercial partners. However, although I'm making this project for this client, I want to be sure I can reuse the same code on future projects. I know there are many licenses (GPL etc.) but it's ...
Two enterprise integration patterns are the command message and the event message. I am working on a system in which we use messaging not only for integration with other systems, but for internal communication between services. It's supposed to be an eventually consistent system, and services are supposed to be ignoran...
I'm developing a new extension for an ecommerce platform, that basically builds Customer Equity and Lifetime Value. Already got that. But I'm having some problems trying to figure out a formula to rate an ecommerce customer. I'm not looking for code, but rather for a formula. I'm pretty sure I already have all vars nee...
I suppose you could adapt distributed mutual exclusion algorithms (Ricart/Agrawala, etc), but aside from these more exotic approaches, are you required to use primitives provided by the OS in order to achieve mutual exclusion? For example, in C# you would use something like lock: lock (myobject) { // Do something }...
I'm implementing the Chessboard class to represent the chessboard. I've to implement the transformations (reflections and rotations) on the chess board possible. The possible transformations includes the combination of: 1. Vertical Reflection 2. Horizontal Reflection 3. Diagonal Reflection Thus, we've 8 possible tr...
As an assignment question, I am asked to answer the following: How are cycles handled? Where does the term graph come from? In the examples given, there does not appear to be any clear trick that was done to serialize a cyclic linked list, so I can't discern if anything special is being done on the part of the progr...
I'm developing a language which I intend to replace both Javascript and PHP. (I can't see any problem with this. It's not like either of these languages have a large install base.) One of the things I wanted to change was to turn the assignment operator into an assignment command, removing the ability to make use of th...
I have some code: /// <summary> /// Represents Record Locator class /// </summary> public class RecordLocator : IRecordLocator { /// <summary> /// The Record Locator string, for example: ZT8C4O /// </summary> public string Name { get; private set; } /// <summary> /// Initializes a new instance ...
I've recently stepped in to a managing position which of course involves overseeing other people's work, and guiding juniors. There's this guy who won't stop asking questions, and many times it's really basic stuff - which eats a lot of my time and breaks my in-the-zone mode. I tried the easy-going approach of sending ...
I am nowhere near good at coming up with what type of license to use and I don't want to be sued or have my work stolen so I am going to ask. Here is my situation: I am creating a software for my boss and the YMCA which helps keep track of our employees, their students, and the amount of lessons they have remaining (In...
So we're trying to re-imagine our web solution in an MVC fashion. Going from an old webforms based solution to working with ASP.NET MVC with a bootstrap main menu and adding functionality in the forms of widgets using HTML.Action() that calls a controller and action to fill in the information on that part of the page. ...
I've been thinking about the consequences of using programmatic JavaScript components versus HTML markup. For example I looked into the Enyo Framework, which has its power in composition. One can build components composed of simpler components, and at the end they may be built from tags, but one doesn't write HTML Mark...
I understand open recursion as the process of a method on a class calling another method on a class using a keyword such as this, but whereby the method call may actually be bound to a sub class at run time. Is this a fair demonstration of open recursion? class Sup { go() { alert('sup'); } callGo()...
This is the problem I'm working with: given a phone number from anywhere in the world and some location information (state, province, possibly country name if I'm lucky, etc.), return the ISO country code for that number. For the purposes of this question, I will not focus on the location information, as that provides ...
We currently have 1 domain and 4 subdomains using 5 different applications. We are programming in asp.net and we have 6 different solution project. 5 applications and 1 solution for shared back-end. Each application is deployed with its own dll + shared dll. Since we are looking to start using asp.net MVC, we are now...
Fixed-point object locations allow for worlds which are much more scale-able. Using a 64-bit integer (per dimension), and 0.1 millimeter precision, a world can be created which is 100% numerically stable, and 12,000 astronomical units across. I have been looking all over the internet, and I can't seem to find a physics...
Say, if I want to create a cartesian product of two lists, I could do (here in Haskell, but I can do the same e.g. in Scala or any other FP-able language) cartesianProd = liftM2 (,) then >cartesianProd [1,2] [3,4] >[(1,3),(1,4),(2,3),(2,4)] Obviously, using (lifting) + instead of tuple pairing, will produce list of...
I have been greatly influenced by Joshua Bloch's Effective Java book (2nd edition), probably more so than with any programming book I've read. In particular, his Builder Pattern (item 2) has had the greatest effect. Despite Bloch's builder getting me much farther in the couple of months than in my past ten years of pro...
I heard a couple of times that putting business logic in database models is bad down the road. I just read this in blog of a Rackspace employee: The Django ORM also tended to have us accumulate large amounts of business logic on the model objects, which made building strong service contracts even harder. But it seems l...
I can't google this question, because I can't come up with a good query, so let me describe what I want and maybe someone will be able to suggest a way forward for me. I need to solve the following problem: there is an list of jpg images. There is also one "source" jpg image. I need to find if this image is a cropped i...
I am currently making a simple list tool. You can click a checkbox to mark it as done and if you navigate away from the page/close the browser and reload, it will still be saved. So it's pretty much just a visual difference. For this, I'm wondering, should I use PHP or Javascript to set a cookie to save the data on whe...
I worked in a group in Microsoft that developed the upgrade to the Microsoft Security Essentials antivirus. For a year we worked on the next version of the product. We had 6 milestones (milestone each two months). Most of the features were developed in the first few milestones, and for the second part of the year these...
For the past year I have been working in a Classic ASP \ ASP.net hybrid. The website has 1M+ hits daily. The code, as you can imagine, is very hard to navigate. There are 200+ files. Dozens of includes... <!--#INCLUDE virtual="sub/head.aspx"--> I need to make a function that would be used throughout the website and I ...
Many webapp frameworks, e.g. Spring,call themselves MVC frameworks, but how is the distinction done between MVC and three-tier? It seems that some frameworks call themselves MVC frameworks but they are really three-tier frameworks, or how do we properly label which is which?
To always have a potentially shippable product at the end of each 2-week Sprint, we need to rerun a lot of regression tests at the end of each Sprint. This is very repetitive and time consuming, so eventually it will probably be cost-effective to automate these tests. However if we don't require a potentially shippable...
I need to compare a picture and decide whether or not it is similar to another one. In this case, I would like to use a simple perceptron that compares pixelmaps of both pictures. But I have only very basic understanding of neural networks and I am not sure whether this approach will work if there is only one source pi...
Me and some of my friends would want to start a side project which we will work at our spare time. Here is our criteria 1) A challenging project which will teach us skills which has business value in the future. 2) A potential to make money from the project itself. Quite obvious targets. We are looking into the possibi...
We are redesigning our corporate website with the following functions: we want to give the marketing users flexibility and freedom to add new static pages, change the static pages or contents of static pages without the developer(s)/deployment team getting involved. we want developers to work on the dynamic portion of...
I have a heuristic in mind that should allow me to "score" data based on "novelty" that I would like to work in real-ish time. In this case, I mean novelty in the sense that the data source is something like a video and I want to know when there is a statistically significant change in the stream. For example, consider...
I am a Test/QA manager in an organization that gradually moves to Scrum. I don't appear in daily Scrum meetings because I don't want to interfere with the self-organization of the team. The problem with this is that I am becoming too disconnected with what the 5 testers who report to me do in the day to day. How can I ...
I do not understand how BTP differs from BP? Yes I understand BP evaluates whether a conditional is true/false, but surely implicitly this also determines the "target" instruction? If I predict the first branch of an IF to be true, then surely I have just determined the branch target too (the code within the predicted...
At the moment, I create a Java-Wrapper for Apples *.pkpass-Files (Passbook). Since I need to parse a JSon-File, I planned to add java doc to every field, so one know what exactly this field is in the pkpass and how it should be displayed. (There are some other meta data which are interesting). At https://developer.appl...