instruction
stringlengths
34
19.9k
I know this is probably a bad way to ask this question. I was unable to find another question that addressed this. The full question is this: We're producing a wrapper for a database and have two different viewpoints on managing data with the wrapper. The first is that all changes made to a data object in code must be ...
Yesterday me and a friend were talking about the overuse of custom taglibs. We create taglibs for everything. We create taglibs in order to wrap jQuery UI elements (tabs, button, etc), and other plugins elements as well. We often wrap them together in a single component. We use taglibs in a point that we almost have no...
There are a number of competing best practices for software development. From what I have found, many teams have benefited from Agile practices in some cases. However, in some other cases, using the Unified Process has been championed by large companies like IBM. The common themes that I find seemed to work well for t...
I'm trying to figure out the right terminology for the different types of software development Right now, the only development term I know is "web development", but I've also done a lot of Java and C# development for desktop applications. Obviously this isn't web development, but I'd like to be able to group these unde...
I'm trying to understand better how Hadoop works, and I'm reading The NameNode is a Single Point of Failure for the HDFS Cluster. HDFS is not currently a High Availability system. When the NameNode goes down, the file system goes offline. There is an optional SecondaryNameNode that can be hosted on a separate machine....
So I'm about to submit a game to a competition, but as I looked through the rules a chunk grabbed my attention: All Entries become the sole and exclusive property of Sponsor and will not be acknowledged or returned. Sponsor shall own all right, title and interest in and to each Entry, including without limitation all ...
I'm composing communication lyrics for client-server and what am I thinking about: "authme username passord" (maybe encrytped) "accept" "get archive of H2O from 03.02.2005 to 20.12.2064" transferring binary structure or "error descrtiption" why I always need to do something like 0x0FA52FD + CRC 0x0D34423 + CRC ... ...
I'm confused. I've seen two different terms: Javabean and Java Beans. Is there a significant difference between them?
Taking the following simple method, how would you suggest I write a unit test for it (I am using MSTest however concepts are similar in other tools). public void MyMethod(MyObject myObj, bool validInput) { if(!validInput) { // Do nothing } else { // Update the object myObj.CurrentDateTime = DateTime.Now;...
Whenever I'm writing a typical if-else-construct in any language I wonder what would be the best way (in terms of readability and overview) to add comments to it. Especially when commenting the else clause the comments always feel out-of-place for me. Say we have a construct like this (examples are written down in PHP)...
In my experience, trying to ensure that new versions of an application retain compatibility with data storage from previous versions can often be a painful process. What I currently do is to save a version number for each 'unit' of data (be it a file, database row/table, or whatever) and ensure that the version number ...
I've always validated my user input based on a list of valid/allowed characters, rather than a list of invalid/disallowed characters (or simply no validation). It's just a habit I picked up, probably on this site and I've never really questioned it until now. It makes sense if you wish to, say, validate a phone number,...
I don't work every day with big-endian and little-endian problems and thus I find very difficult to remember which one is what. Recently I got an interview asking the difference between the two; since I didn't remember I decided to "guess" (50% chance, after all) but I failed. So, is there any wide known pratical tric...
We are trying to introduce some agile concepts to the business folks but one of our biggest hurdles is their expectations for documentation - the quantity, the authorship/ownership of the documents, the lifecycle of the documents, the timing of the authorship, and the material that should be documented. The business fo...
I'm trying to understand the DataMapper pattern by implementing it myself for one of my domain objects. So far, I have: class MyDomainObject <attributes> <business logic methods> class MyDomainObjectMapper save update delete get Now, I need get many MyDomainObjects. These could possibly be held cached in...
I have an application with a configuration file that is stored in the application bundle. This config file stores the names of images on a remote server. Whenever the application is started, I download the configuration file from the server and see if there are any changes or updates. If there are changes, I iterate ov...
I'm using CMake to generate my projects IDE/makefiles, but I still need to call custom "scripts" to manipulate my compiled files or even generate code. In previous projects I've been using Python and it was OK, but now I'm having serious trouble managing a lot of dependencies in two very big projects I'm working on so ...
I have find this article Turning Your Code Inside Out and I want to know how this approach described in article is for OO programmers/languages. Is this style of design used in OO programmers/languages? What's downsides and goodsides of this approach in a OO language? Update: OO objects have state and behavior, the des...
To summarize: I can buy a book, people say "Just read the developer site", I like to be spoon-fed the early learning piece for a technology, what path through the developer site will give me that spoonfeeding I need (that is, examples tied directly to the section being discussed, a clear path, etc.). I keep seeing that...
In our environment we have multiple ERP servers plus data that are coming from multiple sources. I need to create a development roadmap for the coming years as it is obvious that side applications will be needed for many things. The choice is that the development will occur with Microsoft technologies. This means that ...
I am re-writing a section of my site and am trying to decide how much of a rewrite this will be. At the moment I have a web service feed that generates an xml once per day. I then use this xml file on my website to generate the general structure. I am trying to decide if this information should be located in the databa...
So, the title is a little awkward. I'll give some background, and then ask my question. Background: I work as a web GIS application developer, but in my spare time I've been playing with map rendering and improving data interchange formats. I work only in 2D space. One interesting issue I've encountered is that whe...
Possible Duplicate: best way to handle a many to many relationship? The relationship between product and supplier is many to many with a new class to be created? Or is it many to 1?
I am drawing a class diagram and I want to know what's the proper notation for many to many relationship between supplier and product? Should I show the table created supplier_product or leave it out and have the relationship many to many between supplier and product? I have seen various representations online.
I'm pretty new at using TFS and I'd like to know how you or your team use the "shelve" function of tfs. We have the following guidelines in using TFS: - perform a "Get Latest" before you check in and try to build/compile - do not check in code that does not compile - at the end of the day, if your work is not complete/...
I'm looking to implement the command pattern in a web application (asp.net c#)... Since the commands come in text format from the client, what is the best way to translate the string to a command object? Should I use reflection? Currently I just assume the command that comes in matches the file name of a user control. ...
Let's say we have a winform application with a buttonclick event. The buttonclick handles everything from the UI configuration to the database call and data manipulation. So you end up with a method that is 100's of lines of code long. Outside the fact that this code can't be considered test-able for various reasons...
re: algorithm and data structure concepts When accountants talk about Ledgers they have something very specific in mind. As a programmer I'm very used to thinking about tables of information, but clearly there are specific things that make a ledger a ledger. So, given a simple list of transactions (date, money in, mone...
Granted, every profession has it's technicalities. If you are an MD, you better know the anatomy of the human body, and if you are astronomer, you better know your calculus. Yet, you don't have to know these more advance topics to know that smoking might give you lung cancer because of carcinogens or the moon revolve...
In JavaScript, there is no such thing as a "private" variable. In order to achieve encapsulation and information hiding in JavaScript, I can wrap a variable inside a function closure, like so: var counter = (function() { var i = 0; var fn = {}; fn.increment = function() { i++; }; fn.get = function(...
The following is all purely hypothetical and any particular portion of it may or may not accurately describe real persons or situations, whether living, dead or just pretending. Let's say I'm a senior dev or architect in charge of a dev team working on a project. This project includes a security library for user authen...
My time as a developer (~8 yrs) has been spent creating tooling/automation of one sort or another. The tools I develop usually interface with one or more API's. These API's could be win32, WMI, VMWare, a help-desk application, LDAP, you get the picture. The apps I develop could be just to pull back data and store/repor...
I have an idea for a SaaS product I want to create, however, this product will store extremely sensitive data that needs to be encrypted at rest. The trouble is not so much the encryption, but the problem of securely storing the keys so that in the event the server was somehow compromised, the keys couldn't just be rec...
As a freelancer, I am often asked by my customers what they must choose between similar elements, neither of which being better than another. Examples: “Do I need my e-commerce website be in PHP or ASP.NET?” “Do I need to host this ordinary web service in Cloud or use an ordinary hosting service?” “Which one is better...
I have a Swing application with a custom TreeModel that can refer to domain instances. I'm wondering what changes I could make if I consider moving to a web interface later on. Would a pluggable model be considered as good design? What would you do?
Small shop, few production servers, no test or development servers, all Win2k3 WEB based. There is a need to keep versioned files on one of the machines. Is TortoiseSVN safe against exploitability, does it need extra hardening? Any known license problems, incompatibilities?
Problem I have X, a positive integer, of some resource, R. There are N potential targets. I want to distribute all of R to the N targets in some "interesting" way. "Interesting" means: Some targets may not get any R. It should rarely be near even (with a majority of target getting near X/N of the resource). There shou...
In Joel's blog on evidence based scheduling he suggests making estimates based on the smallest unit of work and logging extra work back to the original task. The problem I'm now experiencing is that I'll have create object A with subtask method A which creates object B and test all of the above. I create tasks for each...
It seems to me that, for everyday use, more primitive data structures like arrays get the job done just as well as a binary tree would. My question is how common is to use these structures when writing code for projects at work or projects that you pursue in your free time? I understand the better insertion time/delet...
I'm trying to do the following: take a single IA32 instruction in the Intel syntax (such as ADD EAX, EBX) and produce the corresponding machine code for this instruction. Is there some small library, preferably open source, that can do this for me?
My application is building a hierarchical structure like this: root = { 'id': 'root', 'children': [ { 'name': 'root_foo', 'children': [] }, { 'id': 'root_foo2', 'children': [ { 'id': 'root_foo2_bar', 'children': [] } ] } ] } in other words, it's a tree of nodes, where each no...
I just found the following code in our code base: public String identifyArchitectureName(String platformName, String input) ... In my opinion input is one of the most meaningless names for a variable that can be. Is it just me? I can just quietly change it, but should I address the fellow programmer that has done it?
Possible Duplicate: Is Model-View-Presenter (MVP) scheme useful for Android? I've started coding for Android and I'm having difficulty trying to properly partition my code. I always end up with a very tight coupling between my UI logic and the actual controls I use to represent them. I have background in both WPF MV...
I am reading PHP Objects, Patterns, and Practice. The author is trying to model a lesson in a college. The goal is to output the lesson type (lecture or seminar), and the charges for the lesson depending on whether it is an hourly or fixed price lesson. So the output should be Lesson charge 20. Charge type: hourly rate...
My question may seems very scientific but I think it's a common problem and seasoned developers and programmers hopefully will have some advice to avoid the problem I mention in title. Btw., what I describe bellow is a real problem I am trying to proactively solve in my iOS project, I want to avoid it at all cost. By ...
I've been doing some work in Parsec recently, and for my toy language I wanted multi-based fractional numbers to be expressible. After digging around in Parsec's source a bit, I found their implementation of a floating-point number parser, and copied it to make the needed modifications. So I understand what this cod...
I have developed a few quantitative libraries in C# where it is important to understand not only the classic information that goes with the XMLDoc comments (which contains basic information with the method signature) but also the mathematical formulas being use within the methods. Hence I would like to be able to inclu...
I've recently started work with an organisation that is rapidly expanding and is recruiting or growing several development teams (including two web-based products and a data warehouse/BI team). They are basically working to agile methodologies but haven't formalised a standard way of working yet. Despite the fact that ...
I have a very difficult time focusing on what I'm doing (programming-wise) when something (compilation, startup time, etc.) takes more than just a few seconds. Anecdotally it seems that threshold is about 10 seconds (and I recall reading about study that said the same thing, though I can't find it now). So what typic...
In the C++ project I am working on, we have an application consisting of several processes deployed on different machines. This network of processes is dynamic since processes (clients or background services) can be started and terminated during the application's lifetime. We have already a module that allows to transp...
I am a newbie to OOP, and I learn best by example. You could say this question is similar to Which Scala open source projects should I study to learn best coding practices - but in PHP. I have heard-tell that Symfony has the best 'architecture' (I will not pretend I know what that exactly means), as well as Doctrine OR...
I've seen this in a lot of IDEs (even in the most popular and heavily used ones, like Visual Studio): if you want to watch a variable's value, you have to manually type its name in the Watches section of the debugger. Why can't there just be a list of all of them with checkboxes next to them ? The developer can then j...
I have my first real job as programmer, but I can't solve any problems because of the coding style used. The code here: Does not have comments Does not have functions (50, 100, 200, 300 or more lines executed in sequence) Uses a lot of if statements with a lot of paths Has variables that make no sense (eg.: cf_cfop, C...
I am developing a web app and I have currently written the entire website in html/js/css and on the backend I have servlets that host some RESTFUL services. All the presentation logic is done through getting json objects and modifying the view through javascript. The application is essentially a search engine, but it w...
I've been talking to some people at work who believe some versions of a database store their data in discrete tables. That is to say you might open up a folder and see one file for each table in the database then several other supporting files. They do not have a lot of experience with databases but I have only been wo...
I work at a large healthcare organization as a mid-level software developer. I have over 10 years experience in the IT industry using Microsoft technologies (ASP.NET & SQL Server). When I go to conferences, code camps, .net user group meetings, I hear of all kinds of new tools and technologies: MVC, LINQ, Entity Framew...
I've noticed when dealing with Expressions or Expression Trees I'm using reflection a lot to set and get values in properties and what have you. It has occurred to me that the use of reflection seems to be getting more and more common. Things like DataAnotations for validation, Attribute heavy ORMs, etc. Have me wonder...
I am not seeking or in need of legal advice, but an interesting though experiment came to my mind. Imagine the following situtation (I cannot really think about a concrete example and I am unsure if a real manifestation even exists): there is a free (libre) api A licensed under some permissive license or even LGPL. Non...
I have heard such thing as Script Binding - binding Javascript or lua with API's from C++ or Objective-C. I want to know more about it- however Google has strangely proven unuseful for this. How is it done? - it OK if I get pointed to other sources, but, just how? I never knew a Scripts jitter could interact with co...
For instance if I had a program with a bunch of methods. public class Dog{ public boolean ishappy{..} public int weight{...} public static void main{ Dog Max = new Dog Max.ishappy}} Is it best to use the main portion of the code to test, or write a completel...
I'm presenting on Concurrency in ColdFusion at CFObjective this year, and I'd like to hear how you're using CFThread in your ColdFusion applications. In addition, what problems have you had while using it, and how (if at all) have you solved them? What do you dislike about CFThread? Have you run into significant weakne...
The term "Lisp" (or "Lisp-like") is an umbrella for lots of different languages, such as Common Lisp, Scheme, and Arc. There is similar fragmentation in other language communities, like in ML. However, Ruby and Python have both managed to avoid this fate, where innovation occurred more on the implementation (like PyPy ...
There has been much debate over whether or not merely linking to a piece of code makes it a derivative work. I know FSF says "yes", so according to them I can't dynamically link a non-GPL compatible program to a GPL library and distribute the whole. But I could do that for private use, as long as no code is released to...
So a situation I run into reasonably often is one where my models start to either: Grow into monsters with tons and tons of methods OR Allow you to pass pieces of SQL to them, so that they are flexible enough to not require a million different methods For example, say we have a "widget" model. We start with some ba...
I intend to sell a software solution. I have already registered a domain but I don't have a registered company. Can I use my website/domain name (eg:myproduct.com) for the licensor field in the EULA rather than using my name? I will renew my domain yearly if there is a problem with this. Do you know any software compan...
After reading http://clojure.org/rationale and other performance comparisons between Clojure and many languages, I started to think that, apart from ease of use, I shouldn't be coding in Python anymore, but in Clojure instead. Actually, I began to feel irresponsible for not learning Clojure, seeing it's benefits. Does ...
I was wondering if there were any resources that explain concepts/theory behind GUI development. I don't mean a resource that explains how to use a GUI library, but rather how to create your own widgets. For example a resource that explains different methods on how to implement scrollable listboxes. I ask because I hav...
My nice employer allowed me to visit a software conference in June (International PHP Conference, for those who care). Wanting to make the most of it, I would ask the more experienced conference goers in here to give me some tips on what I could do to maximize my learning experience on the conference, and to reduce be...
I am in need of some advice/references. I am currently trying to develop a legal document interface. There are certain fields in which I need to query out of my sql db and have those fields output into a document that can be printed. I am trying to develop a user interface where people can enter fields that will output...
I've been reading some literature on security, specifically password security/encryption, and there's been one thing that I've been wondering: is the 3-strike rule a perfect solution to password security? That is, if the number of password attempts is limited to some small number, after which all authentication request...
My work is mostly in embedded systems programming in C, and the proper class structure to pull this off eludes me. Currently we communicate via C# and Visual Basic with a large collection of servos, pumps, and sensors via a USB-to-CAN hid device. Right now, it is quite cumbersome to communicate with the devices. To rea...
So, there's this idea, which you already know: Define the layout of your UI by creating a tree of panels. The leaf nodes on the tree are what we used to call 'controls' way back in the day-- the things that the user interacts with, radio buttons and listboxes and such. The internal nodes are mostly concerned with layou...
Simple example: (def ticks 0) (defn run-iteration [] (def ticks (inc ticks))) Though the usual case involves things that don't change more than once every several hundred ms. How to do this idiomatically? Edit: and why is the idiomatic way idiomatic, and why is it good?
I want to do some hobby game development, but I have some unfortunate handicaps that have me stuck in indecision; I have no artistic talent, and I also have no experience with 3D graphics. But this is just a hobby project that might not go anywhere, so I want to develop the stuff I care about; if the game shows good p...
Imagine if for a realtime strategy game, for reaserch and some fun a tool has been made which monitors the minimap of the game and warns the user if the enemy movement is being detected. Does selling and/or distributing such stuff have legal issues, against the game creators ToS or such (Considering its usage in multi...
also: defs, java fields, agents The clojure website has documentation for these concepts: Vars Atoms Refs Agents I understand the words, but I don't conceptually get the purpose / meaning of these. When should I / how can I know when to use them?
I know CGI spawns a new process for every HTTP request that it serves, while servlets use one Java process to serve many requests. What do other technologies (rails, WSGI/django, mod_php, asp.net etc.) do so that web servers do not have to spawn a new process new HTTP request?
Does C++ have an "official" language specification document, similar to the Sun/Oracle: http://docs.oracle.com/javase/specs/#6.6.1
I am new in C# programming and in OOP. I need to dive into web applications for my company, and I need to do it fast and correct. So even that I know ASP.NET MVC is the way to go, I want to start with some simple applications with ASP.NET Webforms and then advance to MVC logic. Also regarding my db classes: I plan to c...
I have lots of code like this in my constructors:- function __construct($params) { $this->property = isset($params['property']) ? $params['property'] : default_val; } Is it better to do this rather than specify the default value in the property definition? i.e. public $property = default_val? Sometimes there is ...
Possible Duplicate: Best books on the theory and practice of software architecture? In life it doesnt matter if you do one thing for 15 years. You will end up waking one day and asking stuff that are equal to "how do i walk?" :) My specific question is that as a new entrant to C# and OOP i am stepping into many lit...
I have another one of those "is it done in XML" questions (my last one about xml comments hasn't been answered if anyone has a good explanation) I was just wondering if anyone, anywhere would: Use multiple root elements in an XML document Put text content outside of a root element W3C discourages these practices, Jav...
I always wanted to use randomly generated strings for my resources' IDs, so I could have shorter URLs like this: /user/4jz0k1 But I never did, because I was worried about the random string generation creating actual words, eg: /user/f*cker. This brings two problems: it might be confusing or even offensive for users, an...
I'm starting symfony and interested in learning where symfony is coming from. In terms of it's architectural challenges. What are the architectural or philosophical differences between symfony 2 and 1? What changes make it so different from the other point version?
Here is my situation: a company has x number of employees and x number of machines. When someone is sick, the program have to give the best possible solution of people on the machines. But the employees can't work on every machine. I need a code for making little groups of possible solutions. this is a static example...
I'm writing a data gathering and reporting application that takes XML files as input, which will then be read, processed, and stored in a strongly-typed database. For example, an XML file for a "Job" might look like this: <Data type="Job"> <ID>12345</ID> <JobName>MyJob</JobName> <StartDate>04/07/2012 10:45:...
I have services on 10 machines that stores data in database on these machines. And I have main server that needs to pull that data from these ten machines. What is better for this. Implement some rpc or use replication?
Let me give you an example of how I name my classes alphabetically: Car CarHonda (subclass of Car) CarHondaAccord (subclass of CarHonda) There are two reasons why I put the type of the class earlier in its name: When browsing your files alphabetically in a file explorer, related items appear grouped together and par...
I'm beginning Javascript development and as a beginner in JavaScript I make a lot of mistakes. The way I'm developing is very counter-productive because every mistake I fix I have to shutdown Glassfish, re-build the app and re-deploy it. My app is a Java back-end with REST services and the Html, JavaScript, CSS for the...
I've never attempted anything like this before but what I want to do is code a browser for Windows. I know that I can use the web-browser control that Microsoft has released, but I'm interested in seeing how the problem is solved from a lower level. So I want to know what layout engine I should be looking at? Or is a ...
Most of simple "group chat" systems are based on local file storage logs (e.g. log.txt ). I'm developing a simple group chat (under 20 users simultaneity ) with jQuery/AJAX. So basically, client-side code loads log from server every second. It needs to be fast. In database system (PHP/MySQL) that would mean MySQL query...
I have a free software web application that using other free software scripts for appearance. I have trouble to decide whether should I copy source code of used scripts to my project main repository or list them as dependencies and ask user (who installs application to his server) to install them himself? Since some of...
I am joining a software company very soon as a fresher. But I am afraid that no one knows me and also every one there will be professional. So I want to know, what precautions should be taken in communication, behavior and other things?
I have a shape that will be defined by: char s_type; char color; double height; double width; These variables are scanned in from a request string sent to my server and passed into my printing function, which then prints out the shape. Currently they are just local variables sitting in my main(); however, I was wonder...
I've been reading a bit about OOP in relation to Composition, Components and Composites. I believe I understand the fundamental principle (not sure). Can someone please provide a code example of a person or car (both have many properties) using Composition, Components and Composites? I think seeing it in code would cl...
What does 'automating a use case 'means and how does the tools that automate helps with that? whats makes automation good to do and does it holds any significance for web developement.
I keep reading this sentence: Linux is a Unix-like system, but it is not Unix. I don't know what's the real difference between the two. I know Linux got a lot of ideas from Unix and the licenses of the two are different. Apart from that, as I am not an expert in either one of them, I want to know whether there are ba...
Language like Haskell have concept of purity. In pure function, I can't mutate any state globally. Anyway Haskell fully abstracts memory management, so memory allocation is not a problem here. But if languages can handle memory directly like C++, it's very ambiguous to me. In these languages, memory allocation makes vi...
I am Localizing my php application. I have a dilemma on choosing best method to accomplish the same. Method 1: Currently am storing words to be localized in an array in a php file <?php $values = array ( 'welcome' => 'bienvenida' ); ?> I am using a function to extract and ret...
Usually I achieve low coupling by creating classes that exchange lists, sets, and maps between them. Now I am developing a Java batch application and I can't put all the data inside a data structure because there isn't enough memory. I have to read and process one chunk of data and then going to the next one. So havin...