instruction
stringlengths
34
36.1k
I've always read that LISP is well suited for Artificial Intelligence, but I never found out why.
Well these days JavaScript is main player in all web development technologies , on client side for making user interface better, client side logic, on some web servers as server side logic also Add to that the fact of people (at least some of them ) started moving in web game development from flash to javascript and H...
How do you handle yourself in a new team where you are the senior most developer and most others in the team are junior to you by several years. The task ahead of the team is something nobody else including you has accomplished in their career before. Management insists on higher productivity of the whole team, and as...
I believe learning C is one of the most important aspects for any programmer. It's a beautiful combination of a high and low level language. Some universities are moving to stop teaching C in the introductory stages and are using Python instead. Will this move to Python, from C, degrade the quality of CS students? If ...
What would be the best approach at unit testing a model that integrates into an application that is tightly coupled to database? The specific scenario here is a shopping cart - I'd like to be able to test the adding removing and retrieving of items from the cart as well as pricing logic etc. This in my mind all require...
Are there any guidelines for placing methods in API when the placement isn't obvious? Example: I have classes A and B and a method X. The work being carried out can be phrased in two ways: A does X with B B does X to A Given the two ways of phrasing this, it's unclear whether X belongs in A or B. Are there guideline...
In the not-so-distant past our department was touting Silverlight as the de facto standard for corporate intranet applications. A robust framework that allowed us to implement SOA while leveraging our experience in the .NET framework coupled with a rich user interface, all was great, until one day... Today HTML5 and ad...
I'm trying to build a winform so I can play a web based game and have some other little utilities on the side. I do not plan on ever selling this or even distributing it to more than a handful of people. My question is, Would I be infringing on any copyright laws if I use images from the game in my client? I just want...
I want to check that people who registrates in my site and check in country box , for example, Argentina is really living in Argentina. How can I make sure that people is really living in that country and not access to my site via proxy or VPN?
I found this question and accepted answer on StackOverflow. It's related to the slow JSON parser in the standard Scala library. The consensus as it were, is that the build-in JSON library is slow, and, in the words of DMC: "it's like that, and that's the way it is" Maybe I'm just being naive here, but that sounds like...
When I work on some programming project (usually command line application in Python with many switches), I'm usually creating about 30 and more functions. Most of the functions are in one file (except some helpers that I utilize in more projects). Some of the functions are called on particular switch (like -p or --prin...
If developing web applications using ASP.NET MVC or Ruby on Rails make the application use the MVC design pattern, then if I build my application using only HTML5/Javascript + backend webservices (like WCF rest), then which design pattern will my application follow?
I wonder why java defines homogeneous methods in two distinct classes: java.util.regex.Pattern and java.util.regex.Matcher. For example split method defined in Pattern class and replaceAll method defined in Matcher class. I think these two methods are homogeneous, why are they not defined in the same class? Have I und...
In your experiences, what are some effective ways to introduce code kata practice into an organization or company? To be clear, I'm not concerned with the usefulness of code kata. I'm interested in methods to introduce this concept to a development team.
I'm using Eclipse and I will talk about it as an example but I am sure that this is the case in any other IDE. Eclipse has the CTRL-Shift-F command which automatically formats your code. Is it a good practice to use this kind of formatting? I'm asking in the context of a big project in which there may be many programme...
What are the similarities between MFC and WPF? Is it worthy to learn MFC before WPF?
My university has a module for software development with a real client. Some of my team members work in the computer lab all the time, which is an extremely noisy environment with lots of interruptions and distractions. There are about 30 people always talking. People always go on Facebook, YouTube, or tell jokes to ea...
I'm parsing a bespoke XML format into an object graph using .NET 4.0. My parser is using the System.XML namespace internally, I'm then interrogating the relevant properties of XmlNodes to create my object graph. I've got a first cut of the parser working on a basic input file and I want to put some unit tests around t...
I am quite new to source control and would like to know the differences between committing and patching? Also, how/when a patch is use and can it be used on a web application?
This is what I'm thinking about doing on a JEE Glassfish server using Jersey. @GET @Path("/{name}/{date}") public String getMessages(@PathParam("name") String name, @PathParam("date") Date date) I like the idea of being able to tell people consuming this RESTful webservice that "The date here is anything that works wi...
I was writing some code over the weekend and I found myself wanting to write a factory as a static method in a base class. My question is simply to know if this is a c# idomatic approach? My sense that it might not be comes from the fact that the base class has knowledge of the derived class. That said, I'm not sure ...
This title is a little broad but I may need to give a little background before I can ask my question properly. I know that similar questions have been asked here already. But in my case I'm not asking if I should be mentoring someone or if the person is a good fit for being a software developer. That is not my place to...
For example, in functional languages, variables are single assignment and their values are immutable once assigned. So they have two states unbound and bound, once bound they can't be changed. Is there some mathematical term or other computer science term that is most appropriate for such as thing? Something that seman...
I currently know a working knowledge of Python and some related libraries (including the included-with-Python SQLite) for the purpose of making desktop applications. I would now like to start to make "web applications". By this, I mean that whatever is on the desktop application will be done by visiting a website...so...
My coworker is working on a project and decided to have the database subside entirely on the glassfish server with glassfish being the only thing that can directly access the database. He will then create web services and a library in Java to access this data. To me that sounds like a horrible way to structure the arch...
What are some good resources for advanced C++ topics. I know C++, but have little knowledge of threading, advanced meta-programming and inner-workings of meta-programming and I'd like to get better.
Trying to design an API for external applications with foresight for change isn't easy, but a little thought up front can make life easier later on. I'm trying to establish a scheme that will support future changes while remaining backward compatible by leaving prior version handlers in place. The primary concern on th...
Code kata is a concept that proposes to hone programmer's skill by doing small problems many times trying to improve the code at each iteration. The name comes from an analogy to martial art kata where forms (aka kata) are practices done over and over leading to improvements. From the reaction I got to my last quest...
For my thesis, I am doing research into the characteristics of Behavior Driven Development (BDD). One of the BDD claims is that by specifying the requirements in a ubiquitous language together with the customer, the software will score better on the external quality. Another claim of BDD is that it produces clean code ...
Java is known to be portable; "compile once, run anywhere". I know this is often true because I have many times deployed jar or war without any cross-platform troubles. Still, I am left wondering if this is always true. For example, Swing applications look different between different OS platforms. Also, JDK-1.7 is st...
I am contemplating paying a software consulting firm to provide my company with some enhancements to a piece of software that is licensed under the Eclipse Public License (EPL). I'm wondering what rights we will have to what they produce, and whether they can tie us to paying them royalties forever. What rights we wi...
I am cautious of asking this question because it might appear overly fastidious. I just opened up JavaScript: The Definitive Guide, and it states of the first page of chapter 1 "JavaScript is a high-level, dynamic, untyped interpreted programming language” So am I to take it that the interpreted part is a requireme...
This is a question regarding engineers with 20+ years experience, but it is a question for everybody, as it has to do with career development. I'm in a surprisingly long job hunt, and the problem seems to be that employers will not accept me as a coder. Yes, I have done lots of things, had my own company, sold it too...
When writing a compiler, it is useful to include the ability to dump the abstract syntax tree in a human readable format, for debugging purposes. This output might also be useful for other tools like IDEs and code analyzers, so I might as well provide it as a documented feature. Given that, what format would be the mos...
If I'm using a technology like Grails. It's really easy to wind up with inline styling. Are there any downsides to auto-generating code with inline styling? Is this considered bad practice? Why?
In my subscription form I want to use a double opt-in method: First, the visitor subscribes Then a confirmation email is dispatched. If he replies... Then I add him to the system. In the case where the user does not reply, how long can I store their email address? Are there any legal requirements with regard to that...
Why would I want to write a web app with lots of processing server-side? To me, writing the program client-side is a huge advantage because it takes away as much server load as possible because it only has to send data to the client with minimal processing. I see very little on writing web-apps besides writing it serve...
There's one thing I've always wondered when reading about all this "agile development" stuff here on SE and other sites: In "traditional" software engineering, you collect the user's requirements, write a specification based on these requirements, give it to the customer and bill him for the work done so far, do a (ro...
I'm trying to understand if security is a real concern, or if distribution actually does a better job with security. See, the access to the main source repository could be layered and inherently managed by a network of trust, and could still have centralized user management integrating users from an LDAP/Active Directo...
I have a 3 branch setup: Dev, QA, Prod. There is a references folder where we store common 3rd party and internal assemblies. Change mgmnt has been challenging. Sometimes Devs forget to go into the References folder and check in the new version. We tried referencing Projects, which results in a reference to the bin...
I'm working on a Rails app and I've come across a situation where I'm unsure of the cleanest way to proceed. I posted a question on SO with code samples and such - it has received no answers, and the more I think about the problem, the more I think I might be approaching this the wrong way. (See the SO question at http...
basically I am attempting to make a a efficient/smallish C game of Tic-Tac-Toe. I have implemented everything other then the AI for the computer so far. my squares are basically structs in an array with an assigned value based on the square. For example s[1].value = 1; therefore it's a x, and then a value of 3 would ...
I am curious as to what technology is needed to create a service such as stageit.com and livestream.com. What hardware and software is involved, besides a camera and microphone, from the broadcaster's computer to a viewer's computer?
If you are going write a set of program to housekeep the production data, how can you ensure your program will work correctly? We cannot housekeep the data based on their creation time. We would delete the data only if it has a generation date older than 6 months. But the generation date is not equal to the timestamp o...
I used to get PSD files and generate HTML prototypes from them which are supposed to be exact replica of these PSDs. The process I follow is simplest one generate plain HTML pages for each PSD. But I have seen some of the prototypes being generated from server-side includes (like PHP pages). Benefit of using server sid...
I am developing a software system (Patient Administration System) and I have noticed it already had 451 lines of code(in one namespace). Is this bad? Or does the number of lines of code not matter as long as the methods and comments are useful and they doing what they are intended to do? Or there is a number of lines...
Imagine a database that has billions of rows with, say, payments. You need to calculate an average payment sum. That will be SELECT avg(amount) FROM payments; Now, if you need to re-calculate this figure every day, running this formula on the whole dataset is an overkill. Bicycles have speedometers that calculate ever...
I need to move an object based on 100 images rotating. The object needs to move in a path that is forming an ellipse when I'm rotating the image based on my gestures. I have 4 points, 2 pairs of opposite points on X/Y axis, on the ellipse but how do I calculate the rest of the points in code-behind so that I can calcul...
I try to migrate more and more of our IT infrastructure to a Service-Oriented Architecture (SOA), that means separation of independent tasks and implementation of this tasks as decoupled services, simply accesible via HTTP. If you don't like the term SOA, just put in another - the basic idea is to put functionality in ...
I read some articles and it seems that using multiple classes in CSS is encouraged. I am curious to find out if there is a maximum number of classes an element can have before this multiple class solution loses its benefits. (It may become a speed matter of some sort) For example I have a project which uses 4 types of ...
There's a quote from a PyCon 2011 talk that goes: At least in our shop (Argonne National Laboratory) we have three accepted languages for scientific computing. In this order they are C/C++, Fortran in all its dialects, and Python. You’ll notice the absolute and total lack of Ruby, Perl, Java. It was in the more...
I'm a self taught programmer, and although I know many people feel math isn't necessary, I find that in many examples of algorithms I come across talk about (what sounds to be) some pretty complex mathematics. I would love to eventually have a solid understanding of the math that a good, university educated computer s...
My company has a lot of experience in .NET development, and one of our products in an ERP system. Recently, a customer asked us if we could provide a tablet interface to that system, i.e., a software that allows the customer to view product information and create orders on a tablet. Of course, we are not thrilled about...
This question is mostly about the best way to approach this problem. Any input is appreciated. The Problem In my application i need to send some data to a number of different destinations (we will call them receivers from now on) using different protocols (http post, ftp, soap services). Each of the different receivers...
There is this main class and there are several services ( which uses db connection to retrieve data ) These services are initialized in the main class db properties are obtained from the property file and then dbconnection is opened by calling a method dbOpen() written in the main class and the resultant connection ...
Floating point units are standard on CPUs today, and even desktops might use them today (3D effects). However, I wonder which applications have initially driven the development and mass adoption of floating point units in history. Ten years ago, I think most uses of floating point arithmetics constituted in either Eng...
FIRST, THE SCENARIO We have an internal system that is effectively split into 2 very separate parts across 2 sub-domains, our back-end administrative system for internal access only we will call this admin.example.com and our public-facing interface for customers via our website - lets call this www.example.com/custome...
I am considering implementing the following policy and would like to run it by the community before implementing it: All mercurial commits must have a bug id corresponding to our bug reporting database. All commits immediately preceding a push for a new feature must have a bug id (it's a new feature but the id is still...
What would be an optimal way to organize arbitrary data types into a structure that allows for complex (non-index based) lookups into the data without performing full loop-through's? For a little background, I am not looking for an answer on how to architect an Event engine, rather I am looking for methods to improve a...
I have an embedded device running a slimmed down version of a HTTP server. Currently, it can display static HTML pages. Here is an example of how it displays a static HTML page: char *text="HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n" "<html><body>Hello World!</body></html>"; IPWrite(socket, (uint8*)text, (int)s...
As I learned some basic programming languages I came across tens of IDEs, and tens of compilers. Most people you ask will tell you "Go with that IDE or go with the best" etc, however they do not provide a proper statement as to why this is important. I understand a good IDE will provide you with functionalities to save...
On a related question, it has been clarified why C++ is not compatible with C in many aspects. However C++ is still a "hybrid"* language. And unfortunately, many programmers still consider C++ as a "C with streams and built-in strings". That results in really bad written code, that it's neither C++ nor C. IMHO, it woul...
MyDbEntities context = new MyDbEntities(); var result = context.StoredProcedureName(userId); In the situation above, is it considered best practice to use var or ObjectResult<ComplexType>?
GWT is a software stack that translates Java code and a sub-set of the Java Runtime's class library to JavaScript code. In comparison with JavaScript toolkits, GWT can seem alienating, by nature and by usage, and overly complex to do even simple things, taking away much of the fine-grained control you'd have by using J...
Currently our team develops Web Applications and now we are going to Windows Forms applications. I have created the inception phase for our Windows Forms project structure. eg: ApplicationSolution --> Security Project(Login Authentication) a. Users will be registered with different applications in our appl...
I am currently trying to write my own compiler, targeting the JVM. I have completed the parsing step using Java classes generated by ANTLR, and have an AST of the source code to work from (An ANTLR "CommonTree", specifically). I am using ASM to simplify the generating of the bytecode. Could anyone give a broad overvi...
I have been part of the organization I work in for the past year and a half or so. The company basically writes Perl code and they have large amounts of legacy code which originally prevented the company from moving forward with any code changes. My first observation with the existing code was non existence of Modulari...
So the client I am working for right now is really big on load time speed, so we try to shave every micro second possible. We found a file the other day that was pulling some word press blogs and it was adding a solid second to the load time. Now I didn't write that particular script and perhaps I can go optimize it l...
If we have a 4 way tree such as the one shown below, and we do an in order traversal, what would the output of the in-order traversal be for an M-way tree? In which order would the nodes be visited? When would the value in the node be processed (upon first visit or upon second visit)? (As a concrete example, what woul...
I have been writing code for a few years now and I don't believe I can claim to have a complete knowledge in this job yet. My experience primarily rolls around C# related areas with a decent knowledge on Silverlight and Asp .Net MVC as well. I tend to use Sql server and Postgres for normal RDBMS related tasks with Myb...
Why go agile? This is the first question that comes to my mind when I think of going agile. What are the possible financial benefits one can achieve from going agile? Most of us certainly like to think of customers and clients as someone who doesn't know what they wants. So why help them at all? Why not suck their mone...
So we're having an internal debate on whether the time restriction that we have in place for our technical test a good thing. I thought I would open it out to the community. So what are your thoughts on this restriction, do people accept it as standard practice or is it an artificial restriction? A little background, f...
Just ran across this figure, and wondering if there's another well know source than would help confirm these numbers: Based on data I analyzed on successfully finished sprints, I determined that a team should average around 1 to 1-1/2 user stories (product backlog items of any sort, really) per person per sprint. SOU...
We have "priority" and "severity" fields in our bug tracking system. We define severity as "how it impacts the user" and priority as "how it impacts the product". My question is about how to categorize a "code improvement" task in severity and priority. Suppose the improvement does not change any behavior but makes it...
I'm developing a small android app, which is regional independent. I'm curious, which language should I try to support? At the moment I'm only sure to support the languages I speak fluently. This is German and English. But what about French, Spanish or Japanese...? Are there any statistics out there to help determine w...
Assuming a function with a signature of boolean isTransposed(Date date1, Date date2); Example outcomes: date1 date2 Outcome 06/02/2000 02/06/2000 true 02/06/2000 06/02/2000 true 02/06/2000 null false 06/02/2000 02/06/1987 false 11/11/2000 11/11/2000 true 04/04/2001 04/04/2000 false Grant...
At my core, I'm a structural, Computer Science sort of programmer (in college I was required to do a lot of programming using C, C++ and even COBOL(!)) and I'm finding more and more conflict with the core fundamentals I developed in my CS degree as opposed to the modern web development world that I'm currently immersed...
What is the recommended way for a lower level software component/module to communicate with the GUI? I'm using C++. I have a service layer class that if some conditions occur needs to notify the user, but still continue processing. In the case of an unrecoverable error I understand that I can use exceptions to bubble...
From what I understand, the ideal way to prepare builds using Visual Studio is to use a single build machine. That means, while the developers go through development process using their respective machine, the build isn't prepared from any of those machines and a build PC is used instead. Under this condition, is it ne...
If sprints are on average 10 days, why is it often suggested stories be sized to 2-3 days? Related Question: How to handle backlog-items that are longer than one sprint?
In a stackOverflow question I have read that using a GUI designer program can generate lots of messy code and is considered to be a bad practice unless you're making smaller programs. My question is why and how. Is it bad to use a GUI designer program? Why? Additional details: Programming on a Windows platform; Only p...
I have a MMOG server running on C++, using winsockets. My server won't support more than 200 players. I had the idea of redesigning it so it will use multiple servers instead of one, so, maybe, for example, each server could take care of a number of players, and, if it was too laggy, it could transfer the responsabilit...
Somewhat related to this question, say that I have an object category which, depending on which type of object I have, has different restrictions on what it contains. (if you can reword the previous sentence to make more sense I'd appreciate it) For example var SomeSchema = new Schema({ _id: ObjectID, [... large n...
I really want to start working in OS development, particularly kernel development, with the Open Source Darwin Project - building my own Mac-like operating system, however I am simply not experienced enough to work in the black art of kernel development - I'm constantly deterred by comments : "your code has to be close...
I am using the new phonegap 1.5.0 (which is confusingly renamed cordova despite no mention of the rename on the phonegap site), and I'm finding that the white-listing feature on iOS is quite restrictive. I understand that having a whitelist is more secure in that it only allows trusted domains, but what if you want to ...
I am looking for statistics (or estimations) that backup the claim that coding standards help reduce bugs. Hard-numbers would be nice, although I haven't had much look finding any. I've even looked at bug tracking for various open-source projects, but have not been very successful finding what I need. Does anyone ou...
I've written a java program that generates all repetitive permutations based on the characters and the length given. When I execute my code in Eclipse, it generates a file with 1,000,000 permutations in only 15 seconds. Yet if I run the program on the same machine in the command prompt using "java permutation" It takes...
I have code like this (pseudocode) foreach(Box box in boxes) { if(boxFilter.PassesFilter(box)) { // do something useful } else { Log.Log(format("Box %s was rejected", box.BoxId)) } } But now I'm thinking I'd like the log message to have more information such as "Box 1 rejected becau...
I'm thinking of some of the array functions. "key", "each", "pos", "range". These are often very useful as local identifiers! I have also seen code that (ab)uses $return, $list, $array, $string. What are other PHP programmers views on this? Local identifiers only! I wouldn't use them as members or method names of a cla...
I'm currently studying engineering in Telecommunications and Electronics and we have migrated from assembler to C in microprocessor programming. I have doubts that this is a good idea. What are some advantages and disadvantages of C compared to assembly? The advantages/disadvantages I see are: Advantages: I can te...
Say you have an interface IFoo: public interface IFoo { void Bar(string s); int Quux(object o); } In version 2 of your API, you need to add a method Glarg to this interface. How do you do so without breaking your existing API users and maintaining backwards compatibility? This is mainly aimed at .NET, but can ...
I'm a fan of using assertions in the code to check for preconditions. The question is whether is it wise to use assertions in public methods to check the precondition? My personal opinion is, that if my method can not handle the absence of a parameter (or some invalid value of it) and it is part of an API but does not ...
I came across sharding in MongoDB but did not get what exactly is it. What I understood is it's better to have more small servers than a huge one for data storage and when the data exceeds the capacity of one server you can use another machine to store data. Can anyone give some more idea about sharding?
I am working with a web application, using TFS. Every time I build the site it takes an unproductivly long time to start up again. I would like to have a second mapping of the site on my c drive, where I would only get latest and build once a day, so this version would always be fast. This would be like a "readonly"...
We are a small group of 5 people that is about to start a new project. This is the first project where we will go all-in on scrum. We are struggling a bit with how we are going to establish a base for the project (frameworks and the like). Such tasks are not something the user will benifit from directly, so we are havi...
I am trying to show some information from a [TestMethod] method. Usually we use NUnit and a line with Console.WriteLine runs fine and we can see it in 'output' window, but on this project we must to use Testing tools embebed with VS2010 and Console.WriteLine doesn't run because we cannot see anything.
Given a parent entity with a collection of child entities where there must be exactly one primary child of the group? To make the question more concrete, I've seen a number of ways that this pattern might come up -- a group of people where one person is the leader or the contact details for a person where one is primar...
Scenario: Stationary view with sequential timestamped samples in 2D-color where the comparison is only done between one pair of neighboring samples. Background: Have never used OpenCV before, Limited understanding of computer vision, Moderate experience scripting programs. Questions: Given the information provided...
I'm going to start my first real project in Ruby on Rails, and I'm forcing myself to write TDD tests. I don't see real advantages in writing tests, but since it seems very important, I'll try. Is it necessary to test every part of my application, including static pages?
I need to allow the user to create an binary tree. I have a Backbone Model populating properly from the database, the problem I am stuck on is how do I setup the ui elements in a way that is fairly easy to use? The general idea is I want to create a boolean expression that contains logic and tokens. The tokens will be ...