instruction
stringlengths
34
19.9k
My goal is to include modules sources files into War file. I read this explanation on the maven official site: http://maven.apache.org/plugins/maven-assembly-plugin/examples/multimodule/module-source-inclusion-simple.html I wonder if it's the only way to include all sources files contained within all modules. Can't the...
I am aware of the C++ Virtual Table which allows dynamic dispatch for doing things at runtime (although if I am honest I am not completely sure of the full list of things it achieves). I am wondering what other "low level" aspects of C++ are there, which one doesnt usually come across when learning the C++ language? Th...
Ive been building a website with 2 pages and 1 master page. The master master page works as a "Menu". The two pages inherits from the master page and have some content on them. On Page1 I have a link to Page2. Once I click on the link Page2 (and master page) loads. Pretty straight forward I guess. But my question is no...
I've got a senior developer with eight years of .NET experience starting tomorrow to work on a 11,000-lines-of-code application. In the team there's myself and another programmer. We've both got about three years experience each. It's my first project as a manager (I'm also a developer on the project) and this is the f...
When programmers talk about "data structures", are they only talking about abstract data types like lists, trees, hashes, graphs, etc.? Or does that term include any structure that holds data, such as composite types (class objects, structs, enums, etc.) and primitive types (boolean, int, char, etc.)? I've only ever h...
A few months ago we found a library licensed under GPL that fit the bill for what we were looking to do at that time. We included it in our codebase and all was fine. Now, a few frantic months of coding later, we've refactored the hell out of the library: it's more feature complete, more stable, fully unit tested, PSR-...
I need to process 2 million messages per second (perhaps in a scale out configuration) and route each message to a N delegates or multicast delegates. Question How should I structure my application in C# so that I can achieve the best performance when receiving the message, and routing it to the correct delegate? Addit...
Does the structured programming definition only consider imperative programming? By this I mean does the definition of structured programming automatically exclude functional programming (in the most common usage, by which I mean not necessarily pure-functional programming, but something like Clojure). Structured prog...
The biggest drawback of agile development I have experienced is that people not involved in development focus on the mantra that a user story (3-10 ideal person days) should not contain more than 1-3 sentences like: As a customer, I can use free-text search so that I can find the products I'm looking for. Giving this...
I used to write C++ extensively between 8 and 10 years ago. I have since moved on to C# for professional reasons. However, from time to time I see statements like "If you're still manually tracking pointer references, you're doing it wrong" or "C++ is perfectly safe as long as you're using modern concepts like R...
My boss wants to introduce new guidelines for the computers in our company. This means that the software environments will be completely standardized with a predefined set of tools. The goal is that all machines are completely reproducable and exchangable. I'm wondering what the guidelines for developer's computers are...
The small website I built a long time ago is starting to pick up a little and I'm starting to run into problems with making changes. Originally, all the pages were .html and I would edit and test them offline to make sure everything worked. Then I realized how helpful php includes were, so I changed everything to .php ...
I'm coming back to C++ after a month. I still didn't start practicing but seeing my old code gives me nauseous feeling like I'm seeing something new even with simple small code. Is this normal? Will I retain everything as I'll start writing code back?
I went through a line somewhat like this "PHP has no native support for Unicode". Also i read that Python has native support for Unicode. Now you can call a function utf8_encode() in PHP to encode a string into Unicode and you can use a function unicode() in Python to convert a string to unicode. So what does it mean t...
I have seen a practice from time to time that "feels" wrong, but I can't quite articulate what is wrong about it. Or maybe it's just my prejudice. Here goes: A developer defines a method with a boolean as one of its parameters, and that method calls another, and so on, and eventually that boolean is used, solely to det...
This may very well be nothing new and probably exists, but I've never learned about it and would like to. The simplest way to be more specific is just to give an example. I was on the bus and downloaded a Text to Speech appliation onto my Android phone. I know that the speech synthesizer might run on my phone but pro...
I've asked this question before and I got a few answers/idea, but I'm not sure how to implement them. I'm building a telecom messaging solution. Currently, I'm using a database to save my transaction/messages for the network stack I've built, and as you know it's slower than using a data structure (hash, linkedlist, et...
Note: I asked a very similar question on StackOverflow but did not get much attention, so was directed to http://programmers.stackexchange.com as licensing issues seem to have more interest here... I am not an expert in Google Maps policies although I am aware that downloading / caching map tiles is not encouraged at a...
I am not sure if this would be the right forum to ask the question (Please let me know and I will move the question to appropriate forum). I would like to know what can be the best way for elders (in my case, my parents) to learn how to program. I was looking at Qimo 4 kids as a possible platform so that my parents ca...
I'm new to the social coding community and don't know how to proceed properly in this situation: I've created a GitHub Repository a couple weeks ago. Someone forked the project and has made some small changes that have been on my to-do. I'm thrilled someone forked my project and took the time to add to it. I'd like to ...
Over the past year or two, I've been playing with newer technologies in my side projects. As a web developer, I've gone from the following (and still the following, at work): The 'classic' technology stack Web browser POSTs forms to... a C#-coded web application server-side, communicating to... external services via X...
I have objects which implement the interface BroadcastInterface, which represents a message that is to be broadcast to all users of a particular group. It has a setter and getter method for the Subject and Body properties, and an addRecipientRole() method, which takes a given role and finds the contact token (e.g., an ...
Is there an algorithm which I can use in order to generate synonyms for some term (word) in respect of a spam. I am writing a simple spam filter. For example, I set that the app must omit a word "viagra" and press a button which saves this term into a filter database. A script automatically creates synonyms of this wor...
I am asked to provide performance statistics for a program, one of them being memory consumption. I noticed that in perfmon or in .NET API there is apparently many variable related to memory usage, such as private bit, working set, page file, etc. What are the difference, and which one should we use for measuring perf...
I'll try to keep this question as specific as possible.. I'm about to start building an API for an upcoming project. I'm currently thinking PHP/Symfony2. It will be a farily simple HTTP-based api for CRUD on the site's models (and relationships between them). There will also need to be a CMS for users. Traditionally w...
I'm referring to *nix command line applications primarily, where you want to permanently modify the behavior from defaults. Environmental variables are easily understood and implemented, usually requiring the user to modify their ~/.bashrc for a permanent change. However, namespace collision might be a problem (but unl...
I'd like to prototype a computer algebra system. An equation would be represented by a tree and rules would be defined - similarly to mathematical axioms - by specifying a pattern (in the tree) and a restructuring rule for the matched part of the tree. Can you suggest a programming language I could experiment with to t...
We are trying to design our system to be testable and in most parts developed using TDD. Currently we are trying to solve the following problem: In various places it is necessary for us to use static helper methods like ImageIO and URLEncoder (both standard Java API) and various other libraries that consist mostly of s...
For the purposes of discussion let's consider a FourSquare scenario. Scenario Entities: Users Places Relationships: Checkins: users <-> places, many to many Friends: users <-> users, many to many Database Design These will most likely have errors, please point them out. RDBMS Tables: Users Places Checkins (junctio...
Assume I have a stream of records that need to have some computation. Records will have a combination of these functions run Sum, Aggregate, Sum over the last 90 seconds, or ignore. A data record looks like this: Date;Data;ID Question Assuming that ID is an int of some kind, and that int corresponds to a matrix of ...
I'm evaluating some NoSQL solutions for a project of mine and JCR popped up during my searches as a document store. But it seems somehow of an obscure niche which didn't have the impact its designers hoped for. I'm interested in the technology, but so far there does not seem to be a lot of resources out there to show i...
I'm trying out Visio for the first time today, creating ERD's. Is it possible to specify alternate keys in addition to PK's in Visio ERD diagrams. I can't see any way to define more than one key on a table. Any ideas? Cheers.
Team is starting on their first capital-A Agile project, and the project seems like it will fall in line nicely with the methodology (i.e. we can probably just grab an agile book and follow it like a recipe), with one bit of confusion: The project involves three things that nobody on the team has any experience with: I...
When correcting bugs, it is encouraged where I work to first write a test that fails with the given bug, and then to fix the code until the test passes. This follows TDD practices, and is supposed to be good practice, but I noticed it tends to produce cryptic tests that come really close to the implementation. For inst...
I've been programming C++ for almost a year, and I've written complex programs however there are a couple of programming features of C++ which I didn't cover up (Classes & pointers), however I felt ready to develop a desktop application. I didn't get any books nor did I find any REAL documentation. I said to myself "Pr...
Context: Student working through Class design in personal/side project for Summer. I've never written anything implemented by others or had to maintain code. Trying to maximize encapsulation and imagining what would make code easy to maintain. Concept: Tight/Loose Class design where Tight and Loose refer to access modi...
Before we start this, let me say I'm well aware of the concepts of Abstraction and Dependency Injection. I don't need my eyes opened here. Well, most of us say, (too) many times without really understanding, "Don't use global variables", or "Singletons are evil because they are global". But what really is so bad about ...
Let's say I have two object types, A and B. The relationship between them is many-to-many, but neither of them is the owner of the other. Both A and B instances need to be aware of the connection; it's not just one way. So, we can do this: class A { ... private: std::vector<B *> Bs; } class B { private: s...
I need to transliterate a Hebrew text. So wrote a little Python script, which reads-in the Hebrew text from a text file, globally replaces the Hebrew letters with Latin ones. Now I need to do some fine tuning (replace certain things in some position but not in other, so a global replace won't do). The trouble is the fo...
In my project (and I am sure many others), I need to copy a subset (R2) of one bitmap image (R1), into a region (R3) in another, where the destination region can be any size (stretching and scaling where necessary). I am sure this is a solved problem but I cannot find any examples; what is the most straightforward alg...
I am reading about a start-up company that works with online surveys: Fulcrum is the world’s first complete project management suite to give clients the power to seamlessly integrate multiple suppliers, increase productivity and reduce costs. Ranging from vertically integrated research firms to sample suppliers...
Every so often I run into a situation where I need to map a set of properties from one object to another object of a different, unrelated class. The set of properties is large enough to make typing out the code by hand tedious. Anti-DRY principle code like this is the result: if (objectOfType1.getPropertyA() != null){o...
Years ago somebody created a bunch of really awesome and popular scripts. But they were not updated for a long, now they no-longer work (target platform were updated, and some changes are needed). He hasn't released it under any license. I want to fix the bug (currently, many of the target users can't use it), and pos...
This is my first question here so I hope it is not off topic. Although I am using the Linux inotify library to listen for changes to files, and I compare use of that against the Subversion program, I am specifically looking for the algorithm used. To a human it is very easy to tell if a file has been created or modifie...
I am developing a Java application. While using the application, data would be generated that needs to be stored on disk. I am looking for an embedded database appropriate for a average use-case of the application. Initially I planned to use XML for storing information. But, then after some articles, I found a general ...
Some of us can say a Distributed Version Control System (e.g. Mercurial, git) will have a positive impact on developers only out of the experience of using one (under the right conditions: higher productivity, higher code-base stability, etc.), but, in what situations could a customer (i.e. the observer of the outcome ...
Sometimes I'm such a nerd that not even nerds understand me, or rather, sometimes I cannot put stuff in understandable and simple-enough terms... and sometimes I can but cannot really tell until after. I like the details on technical stuff, I enjoy writing about them, but sometimes I cannot stop or tell when it is too ...
I've recently been working on a web development project on a team of less-than-five people. Things are going good but now we are decided to go with test-driven development. So far what I've learned is that one of the ultimate goal is that when you are testing your software, everything should be passed. However our cur...
I would like to ask something about project management. I got a project that has some requirements, it can be done from scratch with the use of a big framework. Maybe some tools are necessary for some of the functions. But using a framework seems very cool, it seems that reduces the amount of work, but need to study a ...
I am trying to determine some good interview questions to assess the ability of people coming in for a Html/CSS job, however that topic is extremely broad, and I'm not sure what sort of questions I can ask to properly evaluate someone's HTML/CSS knowledge. What sort of questions can I ask to evaluate a candidate's Html...
I am a web developer. I'm doing all kinds of web-sites and web applications. It's very strange for me that a lot of customers do not know the difference between a web developer and a slicer. They just want to "give you the PSD" and expect you to give them a web site with a DB back-end and so on... I'm just asking here:...
In this blog posting by Uncle Bob http://blog.8thlight.com/uncle-bob/2012/04/20/Why-Is-Estimating-So-Hard.html Author states a possible solution to the problem at hand. He writes "Try this. Break some long string of text up into columns that are 10 characters long. Each time you break a line, record the position of the...
I asked myself why we didn't import a package while we use String functions such as toUpperCase()? How they get in there without importing packages?
I'm not actually sure that "maze" is the correct term. Basically users start in a single Room that has 4 doors (N, S, E, and W). They can go in any direction, and each subsequent room is contains another room with anywhere from 1 to 4 doorways that go to other rooms. The "maze" is supposed to be unlimited in size, and ...
I have a 4 years old project which is written in Swing + SwingX. Currently, it is still alive and still kicking. However, as more GUI related feature requests coming in (For instance, a sortable tree table), I start to feel the difficulty in fulling the requests. This is true especially since there isn't any active dev...
Goal: I'm trying to figure out the best way to model/design and then implement a "user" feature in a system. Background: I am designing an on-line access request system, so our company can use a web-based method for users to request access to various software systems. Since the system is all about the "user", the user ...
Is there a pattern or standard way to handle Ajax race conditions? Take the following example. You have two tables. Clicking a row on table 1 removes the data from DB and then updates table 2 (which would now be showing all the rows of table 1 less the row that was clicked). If someone where to click a bunch of rows i...
I noticed to my glee that C++11 has a std::sto@ family of functions for easily unpacking ints/floats/longs whatever from strings. I'm surprised however, that the opposite isn't implemented. Why didn't the standards committee include a std::itos family of functions for going from ints/floats/whatever (back) to strings?
What are the pros/cons to using the auto keyword, especially in for loops? for(std::vector<T>::iterator it = x.begin(); it != x.end(); it++ ) { it->something(); } for(std::map<T>::iterator it = x.begin(); it != x.end(); it++ ) { it->second->something(); } for(auto it = x.begin(); it != x.end(); it++ ) { it->...
We're trying to decide what architecture to use for an upcoming web application that will eventually have a mobile portion as well. The core of the project is a social networking web application, and the mobile portion will most likely have a limited subset of the web functionality. The two options we are looking at is...
I typically implement graphs as doubly linked lists but this is fairly space inefficient in my experience as I need k pointers/references for k neighbors so for an undirected graph I'd have ~2k neighbor links within the lists if my math is right. Is there a better way of saving space? I know that some of the links can ...
I volunteer for a website, and well, basically, we don't have version control. We're working to change that, but because of several things, including the fact that I haven't worked with source control before, that's not happening for some time. In the meantime, I'd like to move my working files into source control (pro...
In the project, I found a file, math.c, with a big GPL header and ... //------------------------------------------------------------------------------ /// Returns the minimum value between two integers. /// \param a First integer to compare. /// \param b Second integer to compare. //----------------------------------...
I am not new to coding. I have been coding (seriously) for over 15 years now. I have always had some testing for my code. However, over the last few months I have been learning test driven design/development (TDD) using Ruby on Rails. So far, I'm not seeing the benefit. I see some benefit to writing tests for some thin...
What is a good way of implementing "next-word prediction"? For example, the user types "I am" and the system suggests "a" and "not" (or possibly others) as the next word. I am aware of a method that uses Markov Chains and some training text(obviously) to more or less achieve this. But I read somewhere that this method ...
I'm designing a language with Pythonesque syntax, including casual creation of variables by assignment. I'm wondering at the moment exactly how to deal with assignment to global variables (and object/class variables, since I'm implementing classes as scopes). In Python itself, by default the attempt will create a local...
One of my clients demanded to append screen shots of UI in the SOW. Also, I was asked to give a workflow diagram for the same. The project I am about to take is relatively small and my question is, Should we always provide UI snap shots before project begins? (at least basic). Personally I feel this is not possible a...
I've got an app which uses MVC, but I'm struggling a little as to how the controller should be architected. For example, the View is only viewing some subset of the model's data at once. However, I'm unsure as to exactly how this should be arranged. Is it normal for the View or Model to directly call functions on the C...
I've seen this now in a number of places and a number of contexts, for example in SQL. I cannot define the meaning of a "Hint" which it seems clear has some application as or part of a larger design pattern/technique. What exactly is a Hint when used in software engineering?
I recently became interested in agile practices in software development and I since have seen a lot of articles point out that these practices allow for reduced overall costs. The logic behind that usually goes like this: if your requirements change, you can reflect this change in the next sprint backlog and this will ...
I recently started learning Android development and I decided to follow the following development processes: Preinstall Scala in emulator Edit source files in IntelliJ IDEA 11 Compile the project with sbt in command line Dex generated classes without Scala libraries Build APK and test in emulator In the above steps, ...
Our clients need to authorize our partners to release data to us. We can collect this data via a push/pull mechanism. Since our partners have never shared data before, they don't have OAuth implemented. What is the best way for clients to tell their service providers (our partners) to release data to us without having...
I'm getting used in working with git at the moment. And I'm touching an issue that is unclear to me. I feel compelled, if I think of commiting after a change and making a documenting description. I don't know exactly when I should commit, because that's very relative and there's always something under construction. I t...
Main advantage with Hibernate annotations is the fact that a simple POJO (also called a Business Object the most of time) can become persistent through Hibernate annotations (or actually JPA) . In the scenario where our conceptual domain model (business objects used by clients) does not exactly reflect the physical mod...
I've read on several discussions here and on SO that DVCS repositories use about the same or less space than their centralised counter-parts. I may have missed it, but I haven't found a good explanation of why that is. Anyone know?
I have found a small oss project (one file) in someone's blog a few months ago. The license is "Attribution-ShareAlike 2.5 Generic". I sent a mail to the author if I can put this in github but got no response back. Meanwhile his blog has been shut down. I am not a lawyer, but this seems legal to republish the code (wit...
I am trying to find out which is the best practice when organising the PreparedStatement strings in a application which uses JDBC to connect to the database. Usually this is the way I retrieve the data from the database: PreparedStatement select = null; String prepQuery = "SELECT * FROM user JOIN details ON user.id = d...
I have recently started to learn PHP and while reading through a bunch of different articles and questions posted on Stack Exchange I noticed everyone recommends learning a framework. While I am up for the task and already selected Zend as the framework I will start learning at some point, I have only just scratched t...
I work at a newly-minted startup of five people. We have a Ph. D in machine learning, a former member of the RSpec core team, and the guy who compiles the Git binary for OS X. That's just the employees; the founder has a Ph. D and was CTO for a multi-billion-dollar corporation before leaving to start a (successful) s...
I am new to SSL/HTTPS so uncertain on the basics. PROBLEM: A Java applet must communicate with a socket server listening on a port on the web server. Also communication must be secure. Without SSL, the Java applet can make a direct socket communication to the server port (running on the web server). But if communica...
When I am writing small scripts for myself, I stack my code high with comments (sometimes I comment more than I code). A lot of people I talk to say that I should be documenting these scripts, even though they are personal, so that if I ever do sell them, I would be ready. But aren't comments a form of documentation? W...
If I have a piece of code that is mathematically or structurally quite complex and irreducibly so, how would I go about documenting this piece of code? In particular, how can I ensure that someone who may not have the mathematical or architectural skills that I do can understand it from the documentation? Should I docu...
I am trying to learn java servlet/jsp with the MVC concept and built the simplest MVC application. Now I want give more detail to it to enhance my understanding. If I would need to register a new row in a table in the database, how should we pass the various value of column into the system? For example, the user might ...
We are looking at revamping documentation across our product line. Part of that includes reference manuals for a programming language used as part of the system. When writing a reference manual for a programming language, what is the best way to structure it for maximum usability to those new to the language? What are ...
I am learning Django and new to web development. Please excuse me if you find this question too dumb. So, I am creating a Facebook application using Django which I would like to host in Google App Engine. The project would be focusing on reading RSS/ Atom feeds of any website (That's all I can say now). I am sure enou...
I'm looking for a tool that can do semantic search in a body of C code. Example query: "give me all references to field y in struct x defined in file z.h". I would prefer an open source, command line driven tool. C++ support is an advantage. Is there such a tool other than cscope? cscope doesn't preserve the type of ...
I'm in a new job where the project needs to meet strict quality standards, be heavily documented, managed in great detail, UML diagrams, and all those things that are opposite of "cowboy coding" where most of my past work experience has been. Think of the way large-scale aerospace or medical device software is develop...
What VARCHAR sizes should be used for first and last names, phone numbers (preferably international), email adresses, urls, dictionary words and file names? Edit: Zapped the introductory phrase to form a concrete question.
Since programmers learn more by implementing the real world scenarios rather then by gaining theoretical knowledge and concepts about programming, I wanted to know that is there any website that tells about real world scenarios for OOP learners so that they can practice their designing skills and implement these scenar...
According to http://dictionary.reference.com push verb (used with object) to press upon or against (a thing) with force in order to move it away. to move (something) in a specified way by exerting force; shove; drive: to push something aside; to push the door open. to effect or accomplish by thrusting obstacles aside...
I'm creating a game on wp7 and it will be an online game played between a max of 4 players. The game will be a turn based game. My question really is what is the best way to do this server wise? is WCF the way to go? The following is information transferred to and from the server from each player. Player Chat message...
While browsing the MSDN documentation for the .NET Framework Class Library (FCL) I've always been amazed by how consistent and fully documented it is. It's a constant companion when developing .NET applications. Most doubts that arise when using the APIs are covered. The contrast with e.g. the older Win32 documentation...
I am planning on purchasing this book to learn more about C++ programming with regards to fast code. However, the book was published in 1999 and I am worried most of it may be irrelevant now due to optimizations that compilers perform. Could anyone please advise? http://www.amazon.com/Efficient-C-Performance-Programmin...
Are there any common strategies or design patterns for designing applications that have either the ability to add custom fields to data objects, or for creating your own custom definition of objects. For example, I am thinking of products such as SalesForce, where you can have your own types of information,frameworks s...
I am starting to write a webservice, and I've built with nodeJS and a RESTfulish approach. From what I gather: The advantage is that you don't have to duplicate code. The disadvantages are that you: will update the public API frequently, but should be solved with versioning can't really make service specific caching ...
Generators are being introduced in the new version of the ECMA standards. Could any one suggest the importance and the usage of generators in the present Javascript world? Examples of generators in real world problems will be helpful.
In the following question, field and table names have been changed to protect their identities. If I have two database columns: MONKEY_DATE DATETIME NULL (with data e.g. 2012-05-14 00:00:00.000) MONKEY_TIME DATETIME NULL (with data e.g. 1753-01-01 16:30:53.025) The date component of the time field is mostly set to 1st...
For my first large-ish endevor in Open-GL I'm making a simulator of sorts. I've got much of the basic functionality working, but recently ran into a problem. As I've since realized, I originally designed the program so that each object in the simulator had its own class which stored its position, texture, draw code, ...
To me, boilerplate code is obviously bad. However I've met a developer who displays resistance in any attempt to reduce boilerplate. I realized I didn't have a readily formed, well thought out argument past the abhorrence I have developed for it over time. So that I can form a convincing argument for favoring less bo...
Is there any software that will allow me to generate trouble tickets (for Trac, Team Foundation Server, etc.) from TODO or otherwise annotated comments in the source code?