instruction stringlengths 34 19.9k |
|---|
Possible Duplicate:
What is the most effective way to add functionality to unfamiliar, structurally unsound code?
Till now, all I have worked on is with Java projects that I build from scratch (mostly course projects and some hobby stuff). But now, I have come across a huge code base of about 46000 lines spread acro... |
In this particular website, when you hover your mouse over a particular region, it displays something that is clickable. I know of tool tips, but in my experience, I have only used tool tips to show static text, not click able html text.
http://www.cry.org/projects/projects.html
What technology do you think is being us... |
Some programming languages are modeled on machine code, like assembly languages. Other languages are modeled on a natural language, the English language. Others are not modeled on either machine code or natural language. Languages such as PROLOG, for example, don't follow either model.
I came across this Perl module Li... |
Suppose you develop a system that has multiple services (implemented by different teams, in different countries, using different technologies including java, php, c#, c++ and more). Let's assume that despite using different technologies, somehow you have agreed to integrate using RESTful APIs.
Does such a system need ... |
I'm implementing a hashtable structure for a dictionary. Dictionary is in a text file. There are 2 words on each line. I'm generating the hashtable by using the first word as a key. I'm holding the hashtable on a list. I want to save the hashtable to a text file to use it every time. What kind of structure should I use... |
In a project, I've found a code like this:
class SomeClass
{
private SomeType _someField;
public SomeType SomeField
{
get { return _someField; }
set { _someField = value; }
}
protected virtual void SomeMethod(/*...., */SomeType someVar)
{
}
private void SomeAnotherMeth... |
From SVN 1.5, it supports reintegrate feature. I wonder when I should reintegrate. Should it be done before release or after release?
If I do it
Before release
Pro: It is not forgettable to merge with trunk.
Con: Merged version can be different from QAed version.
After release
Pro: Releasing version is same with QAe... |
As noted in this question, I ran into an issue with git add /**.... I can't actually find any documentation on the "/**" form of path specifications - possibly because it's hard to google.
How is it meant to work, exactly? I'm particularly curious that git add /\*\*.py can work but git add /path/foo.py won't - why is t... |
I am writing unit tests for a web frontend implemented in Django.
I have written unit tests that check that all views return the correct status code (200, 302 etc) so that template errors (which give 500) are found. I also do HTML validation with tidylib.
What else is there I should (or can) do?
Models are unit tested... |
I'm working on a new framework for PHP that utilises an architectural pattern called RMR, instead of the more common (pseudo)-MVC that most PHP frameworks currently implement. So far it feels like a better fit for web-apps than MVC was.
I'm currently separating the various concerns involved with managing a page reque... |
Can Agile be employed in a field like Healthcare IT, where so much of patient care depends on the quality and timely delivery of systems?
|
My responsibilities at a small company are mostly programming-related, but I also perform a number of other roles that definitely require access to PHI1. In larger organizations with clearer delineation of responsibilities, is it prudent to provide programmers with only dummy data and never actual PHI?
1 Protected Heal... |
I am building an online game much like Mafia Wars. I was thinking of displaying the number of registered users on the home page, but then I thought:
"What if a new user sees that the total number of registered users
is 5?!" :D
That would be too embarrassing to my still growing game. Then another thought came by:
"... |
My question is coming from an somewhat uneducated perspective.
What are the relative merits of a "message passing" system vs an "event based" system.
Why would one choose one over the other? What are their strengths and weaknesses?
I would like to know not just "in theory", but also "in practice".
EDIT:
Specific proble... |
I'm developing a RESTful service. Here is a map of the current feature set:
POST /api/document/file.jpg (creates the resource)
GET /api/document/file.jpg (retrieves the resource)
DELETE /api/document/file.jpg (removes the resource)
So far, it does everything you might expect. I have a particular use case whe... |
I'm writing a school administration software package, but it strikes me that many developers will face this same issue: when communicating with users, should you use email or SMS or both, and should you treat them as fundamentally equivalent channels such that any message can get sent using any media, (with long and sh... |
I want to store an encrypted string (specifically, email addresses) in a database. I'm currently using Python and MySQL. I was initially going to use MySQL's AES_ENCRYPT/DECRYPT to handle it, but then got to wondering if one was was better than another.
It seems that if I tie it to a database function, that could poten... |
On my projects where the repository is shared between me and other programmers, I always write commit messages even if I'm the primary developer.
But on those projects where I'm the solo developer working on a project, and the repository is hosted on my personal laptop, and is not even hosted by the client, hence no on... |
I'm writing a program to handle the xbox 360's STFS files. I'm encountering all sorts of problems about how to keep track of used vs unused blocks, reading non-sequential files, etc. These aren't so much problems with the structure of STFS - it's just another file structure - but I don't know how I should do certain th... |
I've strong interests in Functional and Logic programming and Mercury seems like a good blend of the two. Is it used in industry at all? I'm one to learn a language just for the fun of it but it would nice to have practical, employable avenues for it. I could not find much in the way of examples of use in industry on t... |
I'm learning programming in school and I have this question that's bugging me about data structures and transferring the information stored inside them to databases. We're doing just small systems - registration for an event, point of sale for a local restaurant, sales and inventory, etc
Let's say someone registers hi... |
Is it considered bad practice to pass items in a PHP array by reference instead of by value?
Relevant documentation: http://php.net/manual/en/control-structures.foreach.php
|
I want to work with a variety of data structures (arrays, singly/doubly linked lists, sorted structures, etc.) on a plug-and-play basis. For example, I want to be able to easily swap in and out the sorted list and the array (which is re-sorted after every insertion/deletion), to test which one has better performance.
I... |
Our task is to build a software frontend to control a hardware device that does not yet exist. We should start development about half a year before the first prototype is available, the project is timeboxed to one year. It is yet unclear what the hardware and the embedded software will be capable of. There're no specif... |
A stack is something that piles bottom-up.
Hence a call stack adds new items on the stack when functions are called with items being removed from the stack as each function ends until the stack is empty and then the program ends.
If the above is correct, why do people refer to control moving "up" the call stack? Surel... |
As web developers, we all learn that sessions help overcome the problems related to the stateless nature of HTTP. We create a unique session id, and send it to the browser -- and when the browser sends the same id back to us, we identify the user easily.
All this sounds pretty straightforward, and NOT so complicated to... |
I was sure that I would find this question, but I couldn't. How to create an isolated development environment? It other words, a sandbox, where I can install different combinations of web servers, databases, other software packages and play with them, without cluttering my system packages and without manually downloadi... |
When designing a novel system in a hospital or other clinical setting, I think it would be important to gather information from doctors, nurses, pharmacists, technicians, et al on use cases for the system.
Aside from the fact that all of these are also busy professionals, what is a good way to get them to share infor... |
I do not know too many things about databases, so a lot of questions concerning architecture came up lately. Two of these things are:
If I have a table with a lot of entries(millions probably), how can I make the select queries faster? I thought about sorting the table alphabetically and then splitting it in two, but ... |
I am new to event driven development, and I feel lost when I try to implement events that should pass the core/UI boundary.
In my program I have the following (example in c#):
UI.RuleForm Core.RuleList UI.ResultForm
Cell 1 Rule 1
Cell 2 Rule 2
Cell 3 Rule 3
What I want is:
when a RuleForm ce... |
I am educating myself on algorithms and data structures. For that, I am doing a simple program that would read lines like this:
bdhj 168.24
dahf 42.88
dhfa 128.92
First column represents an account name (and it needn't have to be 4 characters), and second represents value to add (or remove if value is negative) to tha... |
What should be the attitude towards getting stories done that are assigned to a sprint? Obviously you want to prioritize getting them done in the sprint, but to me the whole point of agile is to be dynamic: You don't want to deliberately procrastinate or make it "ok" to miss finishing user stories in a sprint, but at t... |
Most of the time when I'm writing some code that handles the response for a certain function call I get the following code structure:
example: This is a function that will handle the authentication for a login system
class Authentication{
function login(){ //This function is called from my Controller
$result=$this->au... |
Your domain model contains a set of objects. I'm here presenting a side project, but I have a much more complicated work project falling to its knees because I didn't do a good separation of the database and the domain.
In this case, the object is called a CyclingRecord.
Following Onion Architecture, the domain objects... |
The Strategy pattern works well to avoid huge if...else constructs and make it easier to add or replace functionality. However, it still leaves one flaw in my opinion. It seems like in every implementation there still needs to be a branching construct. It might be a factory or a data file. As an example take an orderin... |
I work for a small company. The software development arm of the company before I was hired consisted of one self-taught overworked guy. Now that I've been writing software for the company for a few years, I have been tasked with establishing formal company-wide software development practices. We currently have no guide... |
Consider a method m of a class A in an object-oriented language like Java or C++.
In the body of the method m it is possible to reference the member variables of the object on which the method is invoked. These variables are not defined in the method itself but are bound in the moment in which the method is invoked.
Is... |
I'm using jQuery, jQueryUi and qTip in my web application alongside custom JavaScript I've written. All three of the JavaScript libraries I mentioned above are licensed under the MIT license. From what I've read, I just need to include a copy of the MIT license for each of those libraries in my web application.
Is ... |
I am practicing algorithm and data structures. Therefore, I keep profiling my programs. Here is an example output from gprof:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls ns/call ns/call name
29.76 2.58 2.58 ... |
I have some basic knowledge of iOS development and I want to now start connecting my apps to databases hosted on the internet, so that users will have access to remote / public data that pertains to my app.
My problem is that after searching the internet for some advice, I realised I don't even know what this type of p... |
I am working on a Drupal theme. I am going to be using "intermediary" languages to develop it, ie Stylus for styles, and CoffeeScript for some of the front-end scripts.
I am going to be using a git hosting service to be able to share the code among colleges. I am also going to be using it to update the code locally and... |
I have an application that needs to run in SCTP environment, I have a question in sharing the connection among multiple threads for packet receiving only, I've tried with the sctp_sendmsg and it worked without even locking the threads (is that been taking care of by the OS, in other words, is it thread safe to do that)... |
I saw many issue numbers from comments of jQuery code. (Actually, there were 69 issue numbers in jQuery code.) I think it would be good practice, but I've never seen any guidelines.
If it is a good practice, what are the guidelines for this practice?
|
I've been using Python for a while now, both in the context of personal and professional projects.
One thing that occured to me recently is that I had never thought about a good way to deploy Python programs. Basically, since it's mostly a bunch of scripts, I usually just copy them to the machine where I want it deploy... |
In an ideal Agile world, you quickly build a small, but useful subset of the desired end system, and give it to users. They're excited, because it's useful, they start using it and give feedback. You then work out what to add on to it, build that, and repeat until you run out of time.
I've had a couple of projects rece... |
I have to run certain number of statements (which are executing .exe) in a loop.
ForEach(object obj in ListOfVersions)
{
Step 1: call Exe1 Args=obj.somevalues
Log Step 1 completed for obj
Step 2: call Exe2 Args=obj.somevalues
Log Step 2 completed for obj
Step 3: call Exe3 Args=obj.... |
I'm trying to modify a serial program that reads from a database, and writes results to a file, this is done in a blocking way and I think we can get performance boost of there is a memory buffer and have the file being written in the "background" asynchronously
I can think of the "job interview" solution, using Thread... |
What would be a real world usage of DelayQueue, what common problem it was designed to solve?
|
I have read some code and here are two ways to check and log the error in cpp code that repeats in my project many times. Which way is better?
1.
bool AClass::myMethod()
{
if (!SomeCondition())
{
Warning("AClass::myMethod: your description");
return false;
}
doSomthing();
return... |
According to the essay "The Object Calisthenics" by Jeff Bay in the book ThoughtWorks Anthology,
Use of Getters and Setters should be avoided as they break encapsulation and we should instead ask the object to do something for us instead of digging in to the object and getting its fields.
how about comparison of object... |
I am tasked to conduct a training for an upcoming team of 20 Java developers for a new project. The project owner wants us to use state of the art development techniques like TDD and CI. The developers are skilled Java developers but have minor to no experience with unit testing, and most likely only superficial experi... |
I have about 8 web applications (all of them ASP.NET based), and I want to implement multiple language support for all of them and have an architecture that I can leverage on new web applications down the road. I would also like to try to centralize the admin piece (where all the text translations and other language sp... |
I understand that when any software under the GPL is given to another the recipient has the same rights over the software that I do. I also understand that this applies to "a work based on the Program".
Questions:
1) I noticed several companies sell wordpress plugins and require that you buy a new plugin for each web... |
I am a Java developer, but I was asked to learn about applying Six Sigma with the goal of increasing our organization's profits. I have read that Six Sigma can be applied in all environments, but I'm interested in the nuances of applying it to software development.
Which concepts of Six Sigma can be applied to a softwa... |
Often I see a class where a value is injected into a method or even a constructor. That value is then used by several methods within that class and a reference is simply passed through to each method that requires it. To me this seems like a code smell, although I could very well just be a pedant.
Unless a variable i... |
I've been working on some code recently that interfaces with a CMS we use and it's presented me with a question on class design that I think is applicable in a number of situations. Essentially, what I am doing is extracting information from the CMS and transforming this information into objects that I can use program... |
I want to output an analog signal from my Windows 7 computer. The wave will be a combination of about 5 frequencies, with a maximum of 28 MHz. It won't be a problem to generate the wave data with C++, but I am not sure how to output the wave dynamically (as it is being generated). I am sure an audio port is not set up ... |
I'm working through our bug list today and I'm trying to clear up/fix issues that we commonly receive exception emails for. Although all the exceptions (so far) are handled, some don't actually represent an error in the code. For instance, if a third party service goes down temporarily, our code fails, handles the ex... |
I have one class called "Institution" which represents a public institution (with properties like id_inst, name_inst, tel_inst, fax_inst...). The institution can have affiliated institutions, for example a university is composed of different faculties (which are also institutions with the same properties and methods). ... |
For example consider:
int index = 3;
int array[4] = {0, 1, 2, 3};
then both index[array] and array[index] are valid expressions, much like *(index + array) and *(array + index).
In C arrays why is this true? array[5] == 5[array] explains how it works. My question is: Why did the language designers choose to allow this... |
Meaning that OOP allows me to have data-trees, of arbitrary depth and breadth, with some leafs being functions (and those leafs would be called methods) ?
Because everything else that people often put near "OOP" mark, just don't seem to have anything to do with it. (Inheritance, subtype polymorphism and encapsulation... |
We have a SaaS business (we host everything) where people, using our software, pay for various services offered by a few "vendors." We collect this money and every week we deposit the balance into the vendor's account. Our cut is a small piece from each of these service payments; so if nobody buys anything the vendor d... |
Here is the question I'm having trouble with:
Give the resource graph and determine whether a deadlock state results. Assume that when a thread requests an available or unallocated resource, the OS immediately allocates that resource to the thread.
There are three threads: T1, T2, T3
There are three resources: R1... |
I've read through some very good resources on the internet trying to find out if my initial proposed testing process is a valid option. So please any advice or recommendations are appreciated.
Currently we have a Dev and Test environment which has served our needs fairly well so far. We are having QA and UAT test off t... |
I am planning to read some design patterns and I took the book on "design patterns in C++' by gang of four. However, I am not really some one who reads book and prefers reading slides/watching course lectures and then apply and read the book. I cannot find any course lecture videos on net(yeah, its not that important a... |
We've been put in a bit of a difficult situation and I'm trying to figure out the best way to deal with it and how to charge for it.
We've built a custom web app for a customer and I've been maintaining it for the last 1.5 years. They sent email an email a couple weeks ago saying they've hired a developer and would lik... |
Google released Caja around 2008(Capability JavaScript). It is still mainly a laboratory language. But XSS and other attacks would be prevented if there was widespread integration of Caja.
|
After seeing http://www.kickstarter.com/projects/ibdknox/light-table
I'm wondering if anyone has come across other alternative methods of developing.
When working on embedded things Notepad++ was ample, which isn't necessarily an IDE but it is a different way of handling things from using Xcode, Visual Studio, or Eclip... |
It so happens that you are given a project specs and your knowledge about the language is very basic. There are features in the project that you have never worked with. But you have some ideas and logic on how this can be implemented.
Later on as the development continues you discover that the required features cannot... |
After asking this question, I got to realize that parallelism may not always be good.
So far I can see that parallelism (under c#) is
A little complicated code-wise
Will probably insert some concurrency complications
Will not always be faster
I am looking inside parallelism because I want to make existing and new ap... |
Kind of a yes / no question and why?
Is it the responsibility of the software developer to understand what the customer meant with his/her request or is it the responsibility of the customer to properly explain his/her request to the developer?
The situation at work is currently "the customer already explained us, wha... |
It seems to be generally assumed (on Stack Overflow at least) that there should always be unit tests, and they should be kept up to date. But I suspect the programmers making these assertions work on different kinds of projects from me - they work on high quality, long-lasting, shipped software where bugs are A Really ... |
I've been pondering this problem for a while now and find myself continually finding caveats and contradictions, so I'm hoping someone can produce a conclusion to the following:
Favour exceptions over error codes
As far as I'm aware, from working in the industry for four years, reading books and blogs, etc. the current... |
I (am just a developer) am tasked with training my team on a technique or technology. I zeroed upon System Interfaces, IComparable and IEquatable to be specific. How does one go about teaching (even if it is 1 hour), what an IComparable is and where we can use it by giving them an example.
However, I am not entirely s... |
I have many times seen various benchmarks that show how a bunch of languages perform on a given task.
These benchmarks always reveal that Python is slower than Java, and faster than PHP, and I wonder why that's the case.
Java, Python, and PHP run inside a virtual machine
All three languages convert their programs into... |
I've never written a unit test.
I'm reading The art of Unit Testing by Osherove, and he explains a way to choose where to start when you're writing tests for legacy code. Basically you end up with two kinds of tests to write: easy (on components with few dependencies) and hard (on components with many dependencies).
Th... |
Someone wrote a .NET library to use the Google Maps API (link to the project). I downloaded the entire repository and there are only source files, no LICENSE.txt, readme, etc. However, I guess Google makes you pick a license when creating a new project so the author specified "New BSD License".
What I would like to d... |
Here's a simple question (kind of), but I'm having a hard time taking a decision. First, a history on how I came to have this problem. In my new job, we need to use a third party API to communicate with their proprietary database (this is manufacturing technologies). This API only comes with very simple c example (not ... |
I'm trying to use Jini, in a "Masters/Workers" arrangement, but the Worker jobs may be long running. In addition, each worker needs to have exclusive access to a singleton resource on that machine.
As it stands, if a Worker receives another request while a previous request is running, then the new request is accepted a... |
I have often heard that I should not use the Unlicense because of issues regarding putting things into the public domain. However, I do not understand why this would be an issue for the Unlicense. The Unlicense attempts to put whatever is being unlicensed into the public domain, and if that works, awesome! However, the... |
I'm currently a second year undergraduate Computer Science student. I'm having a hard time deciding to either apply for an internship or spend the summer back home, working on some fields I feel I haven't yet got a good grasp of (OOP, algorithms) + working on one or two open source projects I found really attractive.
I... |
If I'm using a switch statement to handle values from an enum (which is owned by my class) and I have a case for each possible value - is it worth adding code to handle the "default" case?
enum MyEnum
{
MyFoo,
MyBar,
MyBat
}
MyEnum myEnum = GetMyEnum();
switch (myEnum)
{
case MyFoo:
DoFoo();
... |
Consider a method to randomly shuffle elements in an array. How would you write a simple yet robust unit test to make sure that this is working?
I've come up with two ideas, both of which have noticeable flaws:
Shuffle the array, then make sure its order differs from before. This sounds good, but fails if the shuffle ... |
The Java Authentication and Authorization Service (JAAS) defines that if a login module has the flag "REQUIRED", the authentication should proceed down the login module list on success or failure, and that the module is required to succeed for the overall authentication process to succeed.
The question is: What could ... |
I am recently building a basic ray tracer in C# from scratch, as a learning/teaching project. A previous release of the project (let's call it A) does reflections and diffuse shading. The program renders the scene at around 900ms. Now I've just made a release B which adds specular highlights. Naturally, I assumed rende... |
Possible Duplicate:
Do people in non-English-speaking countries code in English?
Do developers who don't natively speak English still code using english property and tag names? Like, would a Japanese front end web developer still need to know what border-radius means in English to use it, or would Japanese sites use... |
I'm a .NET developer comfortable with C# and web application development. I need to improve my knowledge of Winforms. What is a good book or online resource that particularly covers the Winforms life cycle. Which events to use for what? How does OnLoad compare to Form_load etc.
|
Recently I was contacted by someone interested buying a piece of software that I wrote to automate a process. The 'client' knows little about the program, except what it outputs and how easy it is to use. They are now interested in purchasing it, and I need to give a reasonable price.
I've never done anything like this... |
Every time my team begins to explore the scenarios that are possible with mobile device location data, location data that is part of user data, or even location data that may be retrieved or inferred from IP address or browser cookies, we are stopped dead in our tracks by the risk of violating a user's privacy. It's fr... |
I'm working on some embedded code using C. Various pieces of functionality need non-blocking stateful functions, which are mostly implemented using a switch on various states. For example, a modem connection manager (pseudo-code):
void manage_connection(void) {
static states state = IDLE;
switch (state) {
... |
I have read a lot about the importance of unit testing, and testing in general. In particular I have read about TDD which, in theory, seems like a good way to ensure effective test coverage for a project.
However, when I look at open source projects, or code that is available as open source, I am having difficulty fin... |
This probably isnt' a Django specific question, but I'm wondering how those "Server over capacity" messages are displayed.
Some examples:
Twitter's fail whale
Tumblr's Over capacity slash page
Drawception's over capacity message when new games are created.
|
Reading about the Google v Oracle case, I came across these questions (apparently from the presiding Judge)
...
Is it agreed that the following is true, at least as of 1996?
The following were the core Java Application Programming Interface: java.lang, java.util and java.io.
Does the Java programming language refer ... |
I am currently developing an IRCX AJAX Chat Based system and have a few questions regarding the Server and Client implementation. Any suggestions are welcome:
Server:
Should this be implemented as a Web Service or a Windows Form application? I have experience in developing Windows forms based servers however I am wonde... |
I was reading this article and was wondering, do we get rid of all switch statements by replacing them with a Dictionary or a Factory so that there are no switch statements at all in my projects.
Something did not quite add up.
The question is, do switch statements have any real use or do we go ahead and replace them... |
I am working on a company's project alone at the moment, but the company is getting soon a junior developer whom I will be mentoring. Considering he will be learning a lot in first few days I am planning on using pair programming for first couple of weeks. I believe that doing pair programming would make daily standup ... |
With a recent project our .Net based dev team has been tasked with integrating with a whole host of java based web services around the world, and we really have had a surprisingly (well, we are certainly not surprised any more) large amount of issues because the XML generated by WCF is not accepted by the java services... |
Possible Duplicate:
Functional Programming in Commercial Software
Which problems domains are more suited to functional programming solutions
I just wonder where do functional programming languages are used? Might be some good examples? Like rocket science or telecommunications?
|
Often when the syntax of the language requires me to name a variable that is never used, I'll name it _.
In my mind, this reduces clutter and lets me focus on the meaningful variables in the code. I find it to be unobtrusive so that it produces an "out of sight, out of mind" effect.
A common example of where I do this ... |
The team I work with handles large amounts of consumer survey, and internal company metric data. Primarily the data is stored in a database, and we utilize various platforms and to work with that data, including MS Excel.
My peer has developed a suite of Excel/VBA files to take the raw data we get and upload it into a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.