instruction
stringlengths
34
19.9k
I'm working on a project to update our (out of support) middleware stack to a stable but supported version. There are several teams with applications running on the version we currently have in production and understandably nobody wants to carry the risk of being the first to run on the newer version. What strategies ...
The way it was For years, I have organized my software solutions as such: Data Access Layer (DAL) to abstract the business of accessing data Business Logic Layer (BLL) to apply business rules to data sets, handle authentication, etc. Utilities (Util) which is just a library of common utility methods I have built over ...
Our manager wants us to do applicaiton qos which is quite different from the well-known system qos. We have many services of three types, they have priorites, the manager wants to suspend low priority services requests when there are not enough bandwidth for high priority services. But if the high priority services req...
I need some help with regards to implement a pre-designed system that has 4 components and several constraints. I've spent approximately 50 hours trying to determine the best way to build this system; however, I do not think I have a strong enough solution as of right now. ~~~ The Background Information ~~~ The purpose...
I am developing an open-source Java desktop application and I would like to use some icons in the GUI to indicate various settings, external links, etc. I found a set of free icons that are published under the Creative Commons Attribution-NoDerivs 3.0 Unported license that I would like to use. My questions are: Would ...
Is state another name for field or is it something different? For example: private int telNumber; can I say about telNumber that it is a state or it is a field?
How is a syntax checker for a programming language written? I am guessing a grammar has to be written first. How to then proceed? Motivation I'm using a programming language (Apex for Salesforce) that is compiled in the cloud and a list of errors is sent back to the basic Eclipse editor. I'd like to skip the process fo...
The computer scientist Peter Norvig argued in his essay Teach Yourself To Program in 10 Years that you need about 10,000 hours of practice. But Jeff Atwood argued in his post How To Become a Better Programmer by Not Programming that he believes the only way to become a better programmer is by not programming. These ar...
While using Linear probing method to implement hashing, when we delete and element, the position of the deleted element is declared as a tombstone/ mark it as deleted. Why can't we just shift all the elements from the current position until the next empty element is encountered? Won't this save the time when too many t...
I am finishing up a decently sized Python/Shell project, and I'm wondering if there's a 'best practice' list of things to do when finishing up development. So far I've done: pylint pycallgraph grep'ed for :TODO: and :FIXME: find orphan code some more documentation install scripts for client and server make sure comm...
I am a web and software developer involved in the creation of mobile apps. I am currently working on a project with a looming deadline. I am wondering if I should be committing code rapidly and large and testing later, or doing tiny commits and testing each one. Thank you!
We know there are several moving parts to a system like the apple store or google play. At the very least; The device has a unique hardware id or sim card The user has a login/pass The "store" site has some crypto In what order and format (cypher/plaintext) is this data exchanged between the device and store software...
I have developed a web site with a mysql backend, but am not satisfied with how I am getting one set of data and do not know how to get another dataset. The page in question is at: http://whistclub.org/test/ajax.php?vichill/results/1 The results are shown through October so there is some data to use. I am pulling the r...
I have a question regarding uploading an asp.net website to a real web sever. What type of files will be uploaded is it ASP.NET files or is it assemblies? To be more clear if someone got an access to my ftp and downloaded all the files will he be able to edit those files?
I am having a design issue regarding .NET properties. interface IX { Guid Id { get; } bool IsInvalidated { get; } void Invalidate(); } Problem: This interface has two read-only properties, Id and IsInvalidated. The fact that they are read-only, however, is by itself no guarantee that their values will rema...
I'm aware that they both use different programming paradigms, but from a high level perspective apart from differing syntax it seems most basic tasks can be achieved in similar fashion. I only say this because when I've previously touched functional programming languages such as Haskell, writing code for basics tasks ...
I am making a website where in users would rate posts by other users, according to how useful they are. The posts will be about products - mobiles, tablets, and other personal consumer electronics only. I want to make sure no trolling or slandering goes on, so I'll need a system that will make sure the good ratings of ...
I just subscribed to a facebook page which post links to different open source projects or code archives. I'll like to save those links and descriptions to a local db. How can I do that? I heard something about the concept of web spiders and I know some php and java but I don't know how can I solve the problem from ab...
I've become a project manager in my company and here is what I've experienced till now: At first, I was trying to keep in shape technically with other developers of the team (about 15 developers) and read as much as I could so that I would know almost everything going on in the project, from architecture, up to syntax ...
When we did web development in 1996 it was CGI, FCGI and Perl on the backend. Now why is Perl not that popular anymore and instead we use Java, Python, Go, PHP, C# and everything but Perl? To me it seems that Perl should be good since it has had long time to mature. What happened that causes Perl to lose its applicabil...
Explaining the difference between strictness of languages and paradigms to a colleague of mine, I ended up asserting that: Tolerant languages, such as dynamic and interpreted languages, are used best for prototypes and small projects or medium-size web applications. When choosing elegant dynamic languages such as Pyth...
In programming languages, for represent numbers you have (mainly) two types: Int(s) and floats. The us of Int is very easy. However floats cause a lot of unexpected surprises: http://anh.cs.luc.edu/python/hands-on/3.1/handsonHtml/float.html I wonder why is not used a decimal-based type make more sense as the default fo...
I work at a small development company as the lead developer. We have two other developers, as well as my boss who is a developer, but doesn't really do much of the actual coding anymore. The problem I am trying to overcome is multifaceted. We have a tendency all to work on our own projects without much collaboration be...
I have implemented an application protocol stack that moves an incoming stream of data upward through several layers, as follows: copies a TCP segment from an OS buffer to my_buffer. after identifying a record boundary, splits the record in my_buffer into tab-separated strings which are copied into deque<string> my_de...
I'm a developer working on a Wordpress project. I work on this alone and I want to improve the way I use Git but I don't know where to start. Currently, I'm using git to commit all of the work that I've done for the day as long as that specific work is done. Here are some instances where I commit a specific work: A sp...
Conceptually a "pointer" is just something that "points" to something else;Is this definition is sufficient to tell exactly what a pointer is in programing languages? Does it need to have any other features? Programmers who come from specific language may have pre-conceived ideas of what constitutes a 'pointer' based...
Let's say we have some requirements Req1: User name will accept 6-10 character alpha value. Req2: On click of Submit button, application will show error message "Please enter value or character between 6 to 10 including" for invalid boundary value. In this case if we are designing test cases for invalid boundary valu...
Developing a web application which should allow User to schedule appointment based on their TimeZone. And I am storing the User scheduled datetime as server datetime into database field. While showing schedule information retrieved the value from Database and converted into user timzone. processing in Code base I am c...
I am interested in decentralized systems, and am currently considering building one myself. I am considering using JavaScript and HTML5, simply because it makes it very easy to use the system (they just have to go to a website). Some thoughts: I may or may not use another decentralized network for storage, and even if...
I am new to Hibernate so my question could be seen as a very straight forward one, also I will try not to be too generic (as I am always told off because of that), although as with all architectural question it is hard to avoid that... I never know where to ask these questions. I have setup a webapp using Spring + Hibe...
While searching through many javascript libraries/frameworks, I observed that the terms are sometimes used interchangeably. So, conceptually is it important to distinguish between framework and library? Do people seriously make their decisions based on whether it is a library or framework? Would a user like to browse t...
Suppose I have a class C with a method f() which is meant to be used only within C's implementation, but which should be overridden by C's subclasses. Is it reasonable, or "pythonic", to consider it private, i.e. to name it _f() rather than f()? In other words would you distinguish the interface provided to subclasses ...
I am trying to get my head wrapped around OOP after programming in more procedural languages for a number of years. My question: What is the best practice for handling variable values outside of source code? For example, I have file directory values and regex patterns that may need to be manually changed from time to ...
I need to hire a senior software developer. I've switched to a new recruiter and he's asked for about 3 questions to ask each candidate on the phone that he'll send the answers to when I see the CV to help me screen out the obvious bad ones. I quite like the idea of not having to phone screen people who just cannot c...
What are the exact terms to call data types with a logic structure (like C structures, C++ or Java objects) versus fundamental data types (like numeric types, characters, booleans...) independently of any language or paradigm. (I am searching for abstract/academic computer science words).
I forked a project on Github, made a small change and sent a pull request to the original maintainer, who has pulled it in. Now the last commit there is Merged pull request #11 from my_username/master. This is the first time I'm doing this, so I'm not sure what the etiquette now is: I did a git pull upstream master an...
Is there any way I can execute a block of code in a loop, like so: [ some code goes here ] Where the delimiters are "[" and "]", and also allowing for nested blocks, i.e.: [the user can create another loop[]] I am creating a parser for a language that implements such semantics, and it reads the code one byte/characte...
In my experience, being familiar with anti-patterns is as vital as knowing patterns themselves. Despite an abundance of literature on patterns, there is a surprising lack of literature on anti-patterns. Browsing the web usually reveals advises that are either too vague (e.g. "do not use global variables"), too specific...
I'm trying to start unit testing (not using any testing frameworks) for my javascripts. Here's one example of it. var obj = {}; obj.disableBtn = function ($btn, style) { $btn.attr('disabled','disabled').addClass('disabled').removeClass(style); }; The use case is as such: obj.disableBtn($('.submit'), 'btn-blue'); ...
I'm writing a database management software. It has a client-server architecture where the server has the piece of code to store and retrieve. The client has to get the input from the user, connects to the server and queries it. Now I have a parser that can parse SQL like queries. My question is which is the best place ...
Background: I am proponent of functional programming who works at a VB.NET shop where the prevailing mental model is imperative programming. Being that foundation of our system is WinForms I can understand we're not going to get entirely away from imperative programming, but still I try to use FP (primarily via Linq) ...
I'm currently in the process of modelling a generic form of RNA and RNA transcription and I'm having difficulty finding a proper OO modeling of this area. Human RNA has 4 types of Nucleotides (A, G, U, and C). An RNA strand is just a string of these 4 types. eg, AAGACAUUCUA... What I'm trying to model is more generic...
I understand that compiling into Javascript is sometimes necessary and even in some cases results in a faster application. However I'm wondering if compiling into Javascript, for building web applications, from a language like ruby, is considered bad practice. Specifically for the purpose of language preference and for...
My school's CS program avoids any mention of object oriented programming, so I've been doing some reading on my own to supplement it -- specifically, Object Oriented Software Construction by Bertrand Meyer. Meyer makes the point repeatedly that classes should hide as much information about their implementation as possi...
I'm watching a video on C# about Variables. The author declares a variable inside a method and he named it like this: string MyName ="James"; my question is: which convention is recommended by .Net Framework. Is it Pascal casing as in the above example or is it camel case?
I 'm just learning to give project versions. I understand writing details about the changes in my project when committing, but where should I put my version number for my project?
I am writing a web-application in which I am retrieving data's from server through AJAX requests and the generate HTML content dynamically. I have some data to load, generate HTML from it and append into my web page. Now I was thinking on two solutions: 1) Do AJAX call, generate HTML from response, set display: none ...
A recent flurry of comments on a JSHint issue alerted me to the fact that the JSON data-interchange format has a license. The content of this license can be debated elsewhere. What I'm unclear on is what it means for JSON (or any other data-interchance format) to have a license. If an a library simply consumes and pars...
Whenever I write unit tests I have always tried to have a single assert per test to make debugging easier when tests fail. However as I follow this rule I feel like I am constantly copying the same code in each test and by having more tests it becomes harder to go back to read and maintain. So does single-assertion te...
Many people use the term Snake Case to describe variables or other symbols with_the_form_of_underscores. In the past week, I've launched several broad searches. I can't find anything about the origin of this term that is more detailed than what Wikipedia says (above) When did the earliest record of this term enter into...
Currently I'm still learning ASP.NET. My goal is to build dynamic websites. However, I also want to be able to build some windows applications as well. So, is it easy to learn Windows forms or WPF after ASP.NET? or is the reverse easier? meaning to start with WPF then move to ASP.NET?
Was wondering if you could help me on a SQL problem I’m having. I have a set of records of events where each event has a start time and end time. No event has the same start time, and the end time for each event is greater than or equal to the preceding event. What I want to be able to do is pull out the set of rec...
If I talk about openERP its and source (AGPL-3), I have studied it, but can't find some question e.g 1: we have developed a School Management System using openERP Version 7.0, as according to my understanding, we cannot sale it to any customer as it appears to be free like other modules of openERP. So I should charge m...
I've noticed that there are a lot of UIView subclasses in my legacy project. Mostly the only reason of such a subclass is to split bigger view into custom subviews and provide layout for its subviews and delegation of UIButtons actions through the view delegate protocol. So I'm wondering, is it a correct design?
We have a core banking product developed with ASP.NET with C# using Microsoft SQL Server 2008 database. Product is hosted on a centralized server and works well at all locations (bank branches) where connectivity is good and stable. We need to implement this solution at a region where connectivity is always an issue. S...
I'm developing a software package and would like to make it (and the source) available for personal, academic, or educational use, but not for commercial use. Is there such a license? Ideally, it should be reciprocal, so that if someone publishes a modified version, they'll have to grant the same rights. Alternatively,...
I built a prototype ("one to throw away") a while ago, and I'm rebuilding it now as an alpha. My goodness, it's been worth it. I reused some of the prototype code by copy-pasting then modifying it, but I've fallen into a pattern of looking at the prototype for guidance, but writing the new code from scratch. This doe...
I am trying to design a system with the below features, and am currently trying to figure out best way to handle Identity : There will be multiple decoupled parts of the system, with same customers accessing various parts I would like users organized by organizations/companies, i.e. user1 & user2 belong to ORG1 I wo...
How to use unit testing? There are a lot of frameworks for different languages, which provide functionality of unit testing. There is a lot of information on how to use each of them technically. Just like "import to your project this lib, type assert, compile, run and blah-blah-blah". And it all is easy to learn. The p...
There were 3 developers at this GIS tracking company, but now there's 2. Last week my boss was fired. Today, new developers will be coming in for interviews. They'll be coming in from a placement agency. I don't really know how to be on this side of a hiring interview. Any advice or sample questions I can ask? Company ...
My college has a course on Introduction to programming using python and we are using Python 2.7.5. I would like to know if it will be helpful to read Python Cookbook which is for python 2.4? There are no separate cookbooks for python 2.7.x, to my knowledge. But, are there any similar books? There is a later edition t...
I am also using Node - which I am not the most familiar with - if the articles/books/tutorials pertained to this also - that would help even more. I come from a mostly MySQL background - but in this api, all data is going to be served as JSON - so at first glance, using Mongo made a lot of sense (I could be wrong). One...
At my current workplace there is a common pattern in database design: they don't use foreign keys but they list all corresponding ids in a column like this: some_table id name image_ids 1 a 1,2,3 2 b 4,6,7 images id url 1 ... 2 ... ... They store self references in a same manner: some_table id name som...
Searching the web, we can find plentiful examples of various ORMs (nHibernate, EF, LinqToSql, etc.) that implement but don't actually support the full IQueryable<T> interface, throwing NotSupportedExceptions when they encounter something they don't like, such as LinqToSql and SkipWhile. My question is this: why do ORM ...
I'm working on a site where companies can create a profile then add locations for each profile. Those first two tables are simple enough. But any changes to their profiles or locations have to go through an approval process. This is where I'm torn. The end result would be an employee going through a worklist and seein...
I am having some difficulty with MySQL and returning a unique row to a thread. I want it so the thread will search for a row from the table where the bit (see below) is false and only one row is returned. But I don't want the other threads to return the same result should there might be some race condition where the sa...
Simply put: is there a best practice for whether developers should write automated tests to check that data is correct (the contents of config files, databases, etc.)? If so, what is it? Assume that the data is static for a given release, and specified as part of requirements.
I have never written software in Common Lisp, but in Scheme and Clojure as well as C++ and Python. Yet I have had a look at the Common Lisp Object System (CLOS) in Common Lisp and Dylan. Now when comparing it to OOP in the Simula tradition, CLOS and lets say C++ and Python class system have polymorphism as a common tra...
I am looking for help designing the display of available times for appointments (for example a hairdresser's appointment book). Currently I have a query that returns a collection of periods that are unavailable for appointments (whether there is an existing appointment or if the service provider is closed). So lets sa...
I am writing the server backed by a pre-written API. I'm going to get a number of strings representing ports, signals, paths, etc etc etc. I need to look up the object associated with a given label, these objects are all in memory (no sql magic to do this for me). My question is, how best do I associate a given uniqu...
Responsive Web Design shows the user different elements -- or elements arranged in different ways -- by using media queries (if the device is a desktop or laptop, show them this; if a tablet, show them that; if a "phone," show them the other thing) or other methodologies. What about, though (especially if your app/site...
A while back I saw a comment on a Stack Overflow question that surprised me: No one can write an operating system in C. It is not possible. What one can do is write an operating system in a C-based/C-like language that adds/defines a considerable amount of non-standard capabilities on top of C core. Is it usefu...
While looking at the code in C for division/multiplication by 2, it is found that shift operator is used rather than division operator. What is the advantage of using shift over division operator?
I've an HttpHandler, which allows users to login to a system by passing in an encrypted code. Inside the ProcessRequest it performs quite a few steps. Retrieve the encrypted code from request (could be in Form/X-Header/Query) Decrypt it. (Results in an JSON string) Deserialize to a dynamic type Determine the type of r...
I got surprised when I visited some sites with an 'aspx' extension at the end of their URLs and when I looked at their html source I didn't see any view state like the follwing: <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="SNIKalxBOk0/lp+SgXklgi/0/IUoRXTjEjp6NrL2ColFXGht1bTDit5V+wHdkcuM3YVmVNKG1jpM6z...
I'm working on an enterprise project which will be deployed in many SMBs and Enterprises. The support for this project would be struggling and so I want to create a coding pattern for errors (Like HTTP status Codes). This will enable help desk people to refer to documents and troubleshoot the problems as soon as possib...
I have a software (in cloud) with so many registered users. I want to restrict the number of users logged in at a time to certain number (configuration based, let's say 100). If the 101 user tries to login he should be placed in queue with priority 1, subsequently 102 user should be 2 in queue, I know at every time a l...
What I would like to achieve is to use classes (now two, later more) with different interface the same way, so I would like avoid using decisions based on the interface on upper levels for instance, I don't want to see things like this: if ($class instanceof 'ThisInterface') { $thisInterfaceImplementation->doStuff(...
I have an existing language that I need to port to a new platform. I'll probably attempt this by changing the backend of the existing compiler. It is a significant amount of work to re-write the backend. I can't see a way breaking this down into sensible stories without violating INVEST criteria. I can't see how each ...
I am learning php from the internet on codeacademy.com. I have also learned html and css but the problem that i dont know how can i build a complete website then ! I study everything on its side. But how to put all my knowledge together its very hard! like when should i use this php code? When should i use the html cod...
To what extent should one make exceptions redundant or atomic to a method. For instance, suppose I have a method public void authenticate(String username, String password) that calls private void invokeServer(String username, String password). Both methods require those params to be non-zero length, and as such I would...
Most OpenCL Tutorials give a nice introduction to OpenCL, yet I have not found information on the question of interoperability of the compilation targets. It seems that I have to compile OpenCL code for the target GPU. Now when making a binary distribution of an application using OpenCL, does one have to make several b...
The C standard mandates that no C standard library functions shall set errno to zero. Why exactly is this? I could understand it being useful for calling several functions, and only checking errno after the last one - for example: errno = 0; double x = strtod(str1, NULL); long y = strtol(str2, NULL); if (errno) // ...
I come from using ASP.NET MVC/Web API and now I am starting to use Angular but I am not clear on the proper way to mix them. Once I am using Angular does the MVC server side concepts still provide any value? Or should I strictly be using Web API purely to get data for the angular HTTP calls? Is there maybe a more stri...
I'm working with a data import process in C#, which takes a zip file filled with XML files and saves specific data points into a database. This is accomplished by loading the XML data into classes compiled from the schema. The import logic retrieves the data by digging down into the right classes and fields. The XML ...
I have two project A(.EXE) and B(.DLL) in the solution. A references B. If I delay sign both and send them for full signing. Will A be able to load B after ? Or do I have to get B fully signed first, and then add a binary reference to that in Project A, delay sign A and send for full signing ?
I have created an app that works on my 4th generation iPod Touch and my company's 5th generation iPod touch. We were about to release, when we found a crash that occurs after any non-developer device runs the app*. The notion came up that a device registered as a 'developer device' gives your app more resources to use...
Most of my system's class attributes are just text, but in this case it makes more sense to place this particular class's attributes into one single hash (from a "keep the source code pretty" aspect). Basically, a list of attributes is returned, and instead of writing a bunch of static attributes for each one, I just l...
I'm an open source web application for use in my university. Currently professors usually have a website, but do to the fact that they're teaching multiple classes in a given term, they don't care to spend time and make an extensible, functional website. The purpose of this project is to create an OSS website that can...
This question has been bothering me for some time now and today I figured I would Google it. I've read some stuff about it and it seemed very similar to what I've always known as processor cache. Is there a difference between the two or am I right when I think they are the same? Is a register actually required to be ...
We have production code that is not easily deployed in a test area. We also have a new library of code that we would like to "plug in" to the production code. The production code would be making a few calls to the new code. Each of these calls are not mission critical (updating analytic information in a database). If...
I am using google code prettify. After a page renders, I decided to check how <code> and <pre> tags and their contents were manipulated. But in view source, I found no changes were made (in contrast to online syntax highlighters, which generate css style code with code text). So, how/where is info about keywords, varia...
I'm looking at a function that that has several statements like this: n = returnDifferentVersionOf(n); I.e., the value of the same variable n changes progressively several times during the course of a subroutine -- rather than a newly named variable being assigned at each change. What is the generic name of this techn...
I'm coding something for my job to copy directories and then use regex to make all the filenames uniform. I'm an undergrad student programmer for my university and I'm not sure what a professional coder would consider reasonable in this case. My job is mostly to implement mathematical research. The current assignment...
For declarative languages, specifically (but not limited to) in the field of modelling, it's not obvious to me whether code can be considered to be separate from data. This line of reasoning may only apply to non-turing complete languages such as NeuroML. Say for instance I had a very domain specific declarative langua...
[Context - I'm a Java developer, having a discussion with a designer who works in the html/css space] I was having a discussion with a co-worker today about the merits of 'semantic css'. His response was, "Oh we're not interested in semantic css, we use object oriented css" I understand what he means, ie that they're ...
I have a confusion regarding Factory Pattern there are basically two ways You can implement that. Approach 1: public interface IProductFactory { IProduct GetProductA(); IProduct GetProductB(); IProduct GetProductC(); } public class ProductFactory : IProductFactory { public IProduct GetProductA() { ...
I've read an article about Innodb performance optimization an in that post the author was repeatedly mentioning someting named a "battery back up cache". It is not clear for me what he was talking about and google did not help either. My guess is that this is some kind of backup storage in case there is a power outage....
As a developer I like Scala and could tell the management about technical benefits of the language. But even if management understands that a superior technology has business impact, I fear that they don't understand what I'd be talking about. What arguments would you present to managers with technical backgrounds (co...
Coming out of a project using Linq2Sql, I suspect that the next (bigger) one might push me into the arms of Entity Framework. I've done some reading-up on the subject, but what I haven't managed to find is a coherent story about how SQL Server Data Tools and Entity Framework should/could/might be used together. Were t...