instruction
stringlengths
34
19.9k
I'm using asp.net (c#). I have a factory that uses a dictionary of keys that are mapped to objects types. I originally used a static variable to track the dictionary but realized it would be shared among all sessions. Then I'm left with the idea of passing the object map around everywhere, which seems messy. Should ob...
Disillusionment with the Portal Space I'm seeing a disturbing number of large, enterprise clients who have become disillusioned with their enterprise Portal experience, especially those in the WebSphere Portal Server (WPS) space. Millions have been invested, yet the promise of personalized content with aggregation and ...
I recall back from my days of programming in C that when two strings are joined, the OS must allocate memory for the joined string, then the program can copy all the string text over to the new area in memory, then the old memory must manually be released. So if this is done multiple times as in the case of joining a l...
Is there a language that is capable of developing apps to cross platform OSs (win,*nix) and mobile apps (IOS, android) .. I'm a pro web developer but want to explore more environment to deploy my code into... Python ? Ruby ?
I'm working on a webapp (python/javascript) to modify a game's save file. The file has certain bytes representing player information, such as the gun, the equipment, etc. The idea is to show an interface representing the information in the file, allow the user to make changes, send the data back to the server, which mo...
According to canonical agile development, what is the appropriate amount of learning that an engineer should engage in before implementing a solution to a problem? If an engineer knows she is too ignorant of a given topic (say, compression) to start implementing, she goes and learns what she thinks she needs to know, a...
I'm refreshing my CS Theory, and I want to know how to identify that an algorithm O (log n) complexity. Specifically, is there an easy way to identify it? I know with O(n), you usually have a single loop; O(n^2) is a double loop; O(n^3) is a triple loop, etc. How about O (log n)?
For this question, I'll give an example module to facilitate the discussion, Let's say the module is a calculation engine, It currently servers its purpose for its current audience. The requirement is to clone the same engine but with some tweaking for an entirely new audience. Given that, these are Considerations/Fact...
I have an API that is EJB based (i.e. there are remote interfaces defined) that most of the clients use. As the client base grows there are issues with updates to the API and forcing clients to have to update to the latest version and interface definition. I would like to possibly look at having a couple versions of t...
If data is simple and objects are complex, I'm curious if there are any existing statically typed languages that would be able to augment(?) a map type into a type with guaranteed fields. I realize that at runtime, in any language this type of check is pretty doable. But in theory I also believe this should be possible...
There are some types of bugs which are very hard to reproduce, happen very rarely and seemingly by random. It can happen, that I find a possible cause, fix it, test the program, and can't reproduce the bug. However, as it was impossible to reliably reproduce the bug and it happened so rarely, how can I indicate this in...
It is always stated that it is hard to store applications objects in relational databases - the object-relational impedance mismatch - and that is why Document databases are better. However, is there really an impedance mismatch? And object has a key (albeit it may be hidden away by the runtime as a pointer to memory),...
I'm going to start a side project to build a "single page" web application. The application needs to be real-time, sending updates to the clients as changes happen. Are there any good resources for best-practice approaches wrt the architecture for these kinds of applications. The best resource I've found so far is the ...
I'm trying to build a very small, niche search engine, using Nutch to crawl specific sites. Some of the sites are news/blog sites. If I crawl, say, techcrunch.com, and store and index their frontpage, then within hours my index for that page will be out of date. Does a large search engine such as Google have an algori...
We use TortoiseSVN, but we have no bug tracking system. I know, lame, but beyond my control. There were times when svn wasn't in daily use. Now I've had succeeded in pressing for using it regularly, with proper merging, branching, tagging etc. As you could expect, the number of revisions increased in result, which mak...
The challenge proposed to me as to create a widget to apply in other sites that makes a website compliant with the cookie law[1]. Can I do this without changing server code? I mean, if there's code on server-side that writes an affiliate cookie to the response and my JavaScript widget deletes it after on window.load ev...
Say you have a traditional dev > test > production process say on a monthly release cycle. What are some of the steps you need to take and put into place to move towards a model of continuous delivery with frequent releases per day. Please make one suggestion per response. I would be interested in using voting to indi...
I realised the other day that I don't know how to talk about anonymous methods. It's easy enough to talk about named methods (The X method takes a Y1, Y2 and Y3) and classes (The X class has A, B and C methods), but it's harder with anonymous methods. How does one go about talking (and writing) about them? From the num...
...for project-based work. So far I didn't, and always got paid when work was complete and didn't ran into any problems. Does this make me look unprofessional? :) Should I ask like 25% - 50% advance before I start working? The work I usually do also includes graphic design to some extent (user inteface for my app)
Many of the custom projects I take include things that could be useful to the open source community. I'd like them to open Github repos with them :) Most of them are jQuery plugins. I'm almost always ending up creating my own jQuery plugins for features I need to implement in the project, for example autocomplete, edit...
In the first line of a git commit message I have a habit of mentioning the file that modified if a change doesn't span multiple files, for example: Add [somefunc] to [somefile] Is this a good thing to do or is it unnecessary?
I want to design a software for my musical instrument which is a rhythmic one (there is no melody). All I want these software to do is : make the user able to compose music play what user has composed for that purpose I need to record diffrent sounds of that instrument and match each sign with the appropriate soun...
I have two classes that I want related to each other in an JEE application using JPA2. In an OO world, I would say that a Chatroom has an attribute List messages. In the relational world composition doesn't exist like this. If I weren't involving a database at all, I would definitely code these two things as a composit...
After reading this interesting question, I felt like I had a good idea of which insecure hashing algorithm I'd use if I needed one, but no idea why I might use a secure algorithm instead. So what is the distinction? Isn't the output just a random number representing the hashed thing? What makes some hashing algorithm...
IF a 3 dot vector and a 3x3 matrix can rotate, scale and transform things in a virtual 3D space, could you use a 3x3x3 matrix and a 3.3.3 vector to do something to the games sense of time?
I'm a website owner and I develop in Yii so in short, I think I'm working with more or less the "best" PHP has to offer (e.g. PDO, OOP...etc). My primary website (which is not built in any framework just native PHP) of 2.5 years is finally making enough money I can hire my first employee who I want to be a developer to...
First let me say that I think that an agile process can work because of the following underlying principles: It brings focus Limits the noise which really brings focus Secondly I am wondering what are the initial conditions needed so that an Agile process can succeed? For example do we need to have: No existing bug...
Possible Duplicate: My Dad is impatient with the pace of my learning to program. What do I do? I am 14 and have been studying programming for 4 months now (3 months Python, 1 Month of Ruby). I haven't been pushed by my parents to do it, I took it up on my own. Whenever I try to show something I made to my dad, he sa...
I wrote this code: #include <iostream> int main() { int a; std::cin >> a; if(a*a== 3){ std::cout << a; } return 0; } On MSVC I turned ON all optimization flags. I expected that since a*a can never be 3, so compiler should not generate code for the section: if(a*a== 3){ std::cout << a; }...
I have implemented merge sort and quick sort using C (GCC 4.4.3 on Ubuntu 10.04 running on a 4 GB RAM laptop with an Intel DUO CPU at 2GHz) and I wanted to compare the performance of the two algorithms. The prototypes of the sorting functions are: void merge_sort(const char **lines, int start, int end); void quick_sor...
I have a project where my files have gotten out of hand because of the volume of them. I have started to combine classes of similar types in single header files because you can, and it still is good practice, now can i do the them same for those classes functions, that are declared in the source files. Is it a good id...
I have read somewhere that the cost of resolving bugs increases if it is not resolved at the initial stage. Which approach should I take while creating programs? Divide program development in modules. Complete coding one module. Fix ALL bugs of that module before starting coding other modules. Divide program developme...
Is there currently a way of developing android apps on an android phone? In other words, write, compile, install and run regular android java on the phone without using a pc? If not, what would make it possible, if at all? (would rooting be necessary? Or an android emulator compiled for android?)
I would like to know the ideas that are being used for explaining to the client the limitations of the language used for enhancement of the existing project. Given a scenario was that the project existed in VC++ 6.0 and the client had asked for enhancement that could include transparency (alpha) component in the colo...
General text editors don't change greatly. Syntax highlighting and code collapsing are not big changes really. If an editor is structure or domain aware, this usually comes with a different layouts - treeviews, context-menus, drag-and-drops and so on. So are there good example to add more domain control when editing wi...
We are in a small company with around 10 developers. I am the team leader and responsible for the development process. Supervisors and salesmen are close to us since we are a small team, but have no clue on how software is developed. When they ask me how much time I want for a change (bugfixes/features) in a product, m...
I would like to learn something more about NoSQL databases, so I've chosen to create a new project from scratch to handle football results. In my traditional relational database, I have tournaments, teams, results and class tables. All are obviously related. What might be a good approach for designing a project like th...
Possible Duplicate: What should be the maximum length of function In Java (and I think in other OOP languages too) it is recommended to keep class methods as short as possible. While I understand this recommendation I do not understand what is a "short-sized" method and "large-sized" method. What is a particular cri...
There is an analysis and design phase of the software development life cycle. Should software developers be skilled enough for carrying out the work performed during this phase, such as drawing workflow diagrams, data flow diagrams, ERDs, UML, and other models? I have seen some cases where developers can code very we...
I want to model a file system which contains both files and directories, and directories can contain either files or other directories. This is what I have reached so far: In OOSE book, however, a similar model is presented: Now I have two questions: I wonder why the author did not use an Interface to represent the...
So I'm hiring for a senior developer/team lead role for an ASP.NET MVC3 project. This is a big deal position for our team as this person will lead one of our two main products--a product that hasn't seen much developer love in a while. So I need to ensure that my candidates do smart things with controllers, views, vie...
I posted a c# feature request here; however, I do not get a lot of attention there. Therefore I am asking you here, what you think of it. The in and out keywords in generic type declarations are useful; however, due to their nature, their application is limited to a small number of types. What I am suggesting here, is...
I'm looking at developing some commercial product (sell for money, only binaries, no sourcecodes). I have read up on open source licensing, but I just could not understand if what I want to achieve is possible. Will need some bros to walk me through. Like I mentioned, I looking forward to create a simple commercial pro...
I'm integrating EASTL into my game programming framework. I did some changes to it since I have my own memory management sub-system and now I'm wondering what I need to do to not break the license under which EASTL was released. The source code files include the following notice: Copyright (C) 2005,2009-2010 Electronic...
I have an API library for C# that provides flexible multithreaded task management of objects on task bases. The library was developed extensively for a project that was later cancelled by the client. I received the legal rights to the library, and the client doesn't care what I do with it now. I don't know what to do w...
During times of heavy development, the database schema changes both rapidly and continuously, and by the time our weekly push to the beta build comes around, the schema has changed so much that the only sensible option is to nuke all of the tables I can and copy the new versions from my dev database. Obviously, this is...
I have the task to implement the state pattern in one of my classes. The assignment referenced a suggested implementation, and upon reviewing that implementation I was confused since I believed it to be nonsensical for most applications and frankly simply bad from a design point of view, since it completely dismisses s...
I am planning learning Model-View-Controller (MVC) development using Java. While reading I came across a post which mentions java.util.Observer and java.util.Observable for MVC development. As I never heard of it before, upon more googling I came across this SO post, which discusses some design flaw with the above-ment...
I think the discussion for programmatic service oriented usage vs human interaction is clear. But if I were to create an application that makes use of both a programmatic API and a website that makes use of the data connected by the same API, does it lean the favour towards using only ASP.NET? How easy is it to integra...
Maintainability is a major stake of professional software development. Indeed, maintenance is nearly always the longest part of a software life cycle, as it lasts from the project release until basically the end of times. Moreover, projects being in maintenance represent a large majority of the overall number of projec...
As part of writing an Iterator, I found myself writing the following piece of code (stripping error handling) public T next() { try { return next; } finally { next = fetcher.fetchNext(next); } } finding it slightly easier to read than public T next() { T tmp = next; next = fetcher.fetchNext(next); ...
I'm a developer in large IT company that is centered around providing services to clients (by that I mean development department is <20 people and not a major part of organisation). I'm solving different tasks relevant to current problems, and everything is fine so far, but management somehow came up with idea to imple...
Can somebody explain me in what use-cases I should consider using AMQP like e.g. RabbitMQ? What are the pros and cons?
I've been a programmer for the past six years. Throughout my career, I have worked on many web applications. Most of the time, when a database was needed, it was given to us (the programmers) or we had some legacy database to work on. If not that, we had to create and design the database on our own which was not that ...
I was asked to create for a freelance project a Monopoly game in Java. After finishing it the same guy asked me to create four UML diagrams from which he could understand how the game works. Everything went well this far but his third request presented me with some problems. He now wants me to write for him in about 20...
I have a Java application that I am implementing following the MVC pattern. I want to have a window (view) that contains a form which allows the user to add several text fields. There will also be a button that will allow the user to add more text-fields to the form. I have several questions about this. Will the code ...
I'm upgrading a desktop application that currently displays the currency symbol anytime money values are displayed or printed. A friend of my from the UK told me "Whenever British people see software with the American Dollar Sign ($) it automatically turns them off." Given the fact that we (developers) only have one sh...
I have a reservation system that I have coded and my final task is to allow the user to enter a set of dates and then show them all available options. The reservation table is set up with unit_id, check_in and check_out. There are twelve different unit numbers. So I have to somehow iterate through them and find the uni...
I was reading an old Coding Horror article about indentation, when I read this: Or, maybe you're using a next-next-generation editor that treats code as "data" and the layout (including whitespace) as a "view", making all these concerns largely irrelevant. Exactly what next-next-generation editors was Jeff Atwood ref...
What is the correct usage of UML sequence diagrams? Should they contain objects of View classes or DB classes? Or should they modeled in a more generalized fashion? Or is this completely arbitrary?
I've done some searching and quite haven't come across the answer I am looking for. I do not think this is a duplicate of this question. I believe Windows could be a suitable development environment based on the mix of answers in that question. I have been developing in Ruby (mostly Rails but not entirely) for about a...
i'm designing a client-server system via web broswser and i have this problem: I send the data to the client via JSON, then the javascript view shows the stuff. Then the user takes actions and commands are sent back to the server. Usual stuff, the problem is what if the view's data is corrupted or old? One solution i t...
The question that bothers me is whether it is possible/feasible/reasonable to expect for an open-source app to sell well on the mobile market? Should I believe that my users will use my app, rather than build the checked-out version, and, more important, how can I deal with the competition if I make my app available ...
What's the difference? In my opinion, I can replace the term "Schema" with "Scheme". Can I?
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...