Separating Data and Implementation

I'm working on a project that has frequent changes on the database and the implementation layers. I was releasing both the code and the database under the same release version, but since the database changes are more frequent than the core implementation, I'm thinking of separating their release/plan. Is this the normal way to do it?


I've seen a spate of questions on Stack Overflow and elsewhere about downloading programming tools and where to find them. Sometimes developers can't find a download link or availability in their country. Rather than encouraging them to violate laws, I think general education for these users is of the utmost importance. ## How do I know what tools I can download in my country? ## Why can't I download all tools for software development in my country? Acceptable answers will indicate why users can't download tools in their country. Any links to resources to make tools available in countries where they should not be available will be deleted without haste, and will likely result in a short ban-period for the poster. This is a how and why question.


Career path for software QA / Test engineer

I have been working as a software QA analyst for 6 years. I will be finishing a Masters degree in computer science this year. I’m just not sure how to advance my career after my graduation. I like programming, solving puzzles, but in the meantime, I don’t dislike software testing that much. Actually, sometimes it’s fun to find a bug and to be able to track it down to its root cause. I’m quite good at what I’m doing. Usually, I find 2 or 3 times as many defects as other tests can find in our team. However, sometimes, it’s a bit boring to test the same application over and over again, repetitive and monotonous. Although I did some automation tests in the past which are more interesting, still, the majority of the bugs are found manually. I think I have 2 options here, either continue doing software testing, but doing more automation tests which involve coding and scripting. To do this, I think I have to find a place where most tests are carried out using automated tools, like in Google (from their tester job description). Option 2 is to opt to the dev side to do full time programming which I always like. The downside of option 2 is I have to start from scratch as most of my past experience is in testing side. Anyone have any similar experience or advice?


How to genericize foreign key references in table?

I am trying to design a table to store references to multiple tables as a "target" of the item in each row. An example should clarify what I am trying to do: Imagine you have 4 tables (images, videos, comments, likes) with `likes` being similar to               CREATE TABLE `likes`     `target` int(11),     `user_id` int(11),     `created_at` timestamp      How do you make it so the "target" could be a row of images, videos or comments (eg, you like an image, video or comment) Also how would you go about representing this within your code? (abstract class Like and concrete classes for LikeImage, LikeImage, LikeComment?) or maybe have an interface ILikeable and then the Like object has a ILikeable object on hand? I'm running into this pattern more and more often making things such "like" (like an object) or "subscribing" (subscribe to changes on an object) to various targets and generating "notifications" (notify a user of a change on an object) that are generically able to target objects. Thanks for sharing your knowledge. **Update** :: Is there a nosql way to easily achieve this?


What level of understanding should programmers have about OO?

More specifically, what do you feel Junior, Intermediate, and Senior programmers should know about OO design and programming? I'm hoping that having some appropriate expectations will help us during the recruiting process.


Learning a scripting language

I believe every programmer must learn about a core programming language and a scripting language. Seriously I've no hand in any languages like Python, JavaScript, JScript, CScript etc. I'm native Windows Developer and which scripting language would be the best one to do some automation/web related stuffs.


How is a Java reference different from a C pointer?

C has pointers and Java has what is called references. They have some things in common in the sense that they all point to something. I know that pointers in C store the addresses they point to. Do reference also store the address? How they are different except that pointer is more flexible and error-prone?


Do pointers really exist in Java?

I read quite a few resources on the internet and now I am quite confused about the existence of pointers in Java. Some claim that there are pointers and some claim that there is no such concept. So what is the truth?


Difference between a pointer and a reference?

In Java and other high-level languages, a reference leads to an object. In C++, as far as I know, a pointer can also lead to an object. So what's the difference between a reference leading to an object, and a pointer leading to an object?


Why do C++ and Java both use the notion of "reference" but not in the same sense?

In C++ a reference argument to a function allows the function to make the reference refer to something else:               int replacement = 23;          void changeNumberReference(int& reference) {         reference = replacement;     }          int main() {         int i = 1;         std::cout << "i=" << i << "\n"; // i = 1;         changeNumberReference(i);         std::cout << "i=" << i << "\n"; // i = 23;     }      Analogously, a constant reference argument to a function will throw a compile time error if we try to change the reference:               void changeNumberReference(const int& reference) {         reference = replacement; // compile-time error: assignment of read-only reference 'reference'     }      Now, with Java, the docs say that functions arguments of non-primitive types are references. Example from the official docs:               public void moveCircle(Circle circle, int deltaX, int deltaY) {         // code to move origin of circle to x+deltaX, y+deltaY         circle.setX(circle.getX() + deltaX);         circle.setY(circle.getY() + deltaY);              // code to assign a new reference to circle         circle = new Circle(0, 0);     }      > Then circle is assigned a reference to a new Circle object with x = y = 0. > This reassignment has no permanence, however, because the reference was > passed in by value and cannot change. To me this doesn't look at all like C++ references. It doesn't resemble regular C++ references because you cannot make it refer to something else, and it doesn't resemble C++ const references because in Java, the code that would change (but really doesn't) the reference does not throw a compile-time error. This is more similar in behavior to C++ pointers. You can use it to change the pointed objects values, but you cannot changes the pointer's value itself in a function. Also, as with C++ pointers (but not with C++ references), in Java you can pass "null" as value for such an argument. So my question is: Why does Java use the notion of "reference"? Is it to be understood that they don't resemble C++ references? Or do they indeed really resemble C++ references and I'm missing something?


Which computer science subjects are required to follow introductory course in compilers?

I am non computer science undergraduate and work as a web-developer(java, python, AS3 etc.) as a professional. I take 1 course per semester at my local university. I had taken Artificial Intelligence(comprising logic, context free grammar, CYK parsing, introductory NLP, markov chains, HMM etc.) last semester. I am planning to take an introductory course in compilers in the coming semster which covers the following syllabus: > Lexical Analysis, Syntax Analysis, Semantic Analysis, Run-Time Environment, > Intermediate Representations, Code Generation, Register Allocation, > Instruction Selection and Scheduling, Introduction to Local and Global Code > Optimizations, Data Flow analysis My question is that, are there any computer science subjects which I should know before taking this course? If yes, it would be great if you could please list those courses.


What topics do I need to study for *web* client server programming?

I know about client server programming through _sockets_ in C/C++. **What topics do I need to study for _website_ related client server programming?** The database which we'll be using will be either _MySQL_ or _PostgreSQL_.   The platform will be _Linux_.   I don't know which language should be preferred here? Besides language, what are the **_topics_** that I need to know to get this done?


Tips about how to spread Object Oriented practices

I work for a medium company that has around 250 developers. Unfortunately, lots of them are stuck in a procedural way of thinking and some teams constantly deliver big Transactional Script applications, when in fact the application contains rich logic. They also fail to manage the design dependencies, and end up with services which depend on another large number of services (a clean example of Big Ball of Mud). My question is: Can you suggest how to spread this type of knowledge? I know that the surface of the problem is that these applications have a poor architecture and design. Another issue is that there are some developers who are against writing any kind of test. A few things I'm doing to change this (but I'm either failing or the change is too small are)   * Running presentations about design principles (SOLID, clean code, etc).   * Workshops about TDD and BDD.   * Coaching teams (this includes using sonar, findbugs, jdepend and other tools).   * IDE & Refactoring talks. A few things I'm thinking to do in the future (but I'm concern that they might not be good)   * Form a team of OO evangelists, who disseminate an OO way of thinking in differet teams (these people would need to change teams every few months).   * Running design review sessions, to criticise the design and suggest improvements (even if the improvements are not done because of time constraints, I think this might be useful) . Something I found with the teams I coach, is that as soon as I leave them, they revert back to the old practices. I know I don't spend a lot of time with them, usually just one month. So whatever I'm doing, it doesn't stick. I'm sorry this question is spattered with frustration, but the alterative to write this was to hit my head on the wall until I pass out.


When do domain concepts become application constructs?

I recently posted a question regarding recovering a DDD architecture that became an anemic domain model into a multitier architecture and this question is a follow-on of sorts. My question is when do domain **_concepts_** become application **_constructs_**. My application is a local client C# 4/WPF with the following architecture: **Presentation Layer**   * Views   * ViewModels **Business Layer**   * ??? **Domain Layer**   * Classes that take the POCOs with primitive types and create domain concepts (e.g. image, layer, etc)   * Sanity checks values (e.g. image width > 0)   * Interfaces for DTOs   * Interface for a repository that abstracts the filesystem **Data Access Layer**   * Classes that parse the proprietary binary files into POCOs with primitive types by explicit knowledge of the file format   * Implementation of domain DTOs   * Implementation of domain repository class **Local Filesystem**   * Proprietary binary files When does the MyImageType domain class with Int32 width, height, and Int32[] pixels become a System.Windows.Media.ImageDrawing? If I put it in the domain layer, it seems like implemenation details are being leaked (what if I didn't want to use WPF?). If I put it in the presentation layer, it seems like it's doing too much. If I create a business layer, it seems like it would be doing too little since there are few "rules" given the CRUD nature of the application. I think all of my reading has lead to analysis paralysis, so I thought fresh eyes might lend some perspective. **Update 1:** To clarify that the application is not a strictly CRUD, the domain layer would also contain signal processing functions and image transform settings. The signal processing functions must be applied on the raw pixel values directly from the DAL, while the image transform settings are stored with the domain objects to be applied by WPF as part of the presentation.


Why complex is better than complicated?

In python, when you "import this", you can get The Zen of Python. It says "Complex" is better than "Complicated". Why is that? What's the difference between complex and complicated in programming (or in general)?               Beautiful is better than ugly.     Explicit is better than implicit.     Simple is better than complex.     Complex is better than complicated. <--     Flat is better than nested.     Sparse is better than dense.     ...


Is using a lot of free third party libraries a good thing?

For your proprietary projects at work? Problems I can imagine are: more dlls (can be a problem when for example you have to include a big DLL but you only need few functions in that library), a lot of license statements you have to take care of when releasing your product, the reliability of the library, etc. Any other potential problems? What is your opinion? (info: I'm using .NET at work)


Java Transaction Service without the application server

Is it possible to have a Java standalone application (no application server attached) that exposes some operations that a client can call and be the one to manage the transactions? I was thinking this application to expose JNDI resources and get a hold of a java:comp/UserTransaction from there, get also a bean from there and call methods A, B and C on it and coordinate the transaction from the client? The application I'm writing isn't complex enough so that I need a big application server around it so I'm thinking to have a standalone JTS inside it that the client could interact with from a transactions point of view. I don't have much experience with distributed transactions and don't really know how to tackle the issue. Is it even possible? Am I getting myself into something beyond what a mere mortal (programmer) can handle? How can I approach this?


What writing rules are different for humans and code?

It seems that some rules of writing code are in direct contradiction with the rules of human writing. For example in code it's advisable to define each piece of information in only one place and in writing for humans it's normal to repeat important points (though usually phrased differently). **What rules of writing good code contradict the rules of good writing?**


How do you decide to Queue/Dispatch events Sync or Async? (in Observer Pattern)

Consider the following elements in an event-driven architecture:   1. Observable Object   2. Event Dispatcher   3. Observer(Listener) Now, we have two messages:   1. From Observable Object to Event Dispatcher   2. From Event Dispatcher to Observer(s). How do you decide to pass these messages Sync or Async? Do you use any particular API (in Java) to implement that? For example, in Java JFC/Swing, the first is Async and the second is Sync. The former is the reason that you can still fire more events even if the program is processing another event. The latter is the reason that you should avoid long operations in your listeners since they block the event dispatcher.


Managing Production Issues during a Scrum Sprint

The question of managing bugs in production has been a large feature in my mind of late. Sprint's are not meant to have any items added into them, but for **critical** bugs, this is simply unavoidable. How does one go about managing this break in the sprint? Do you simply give a sprint a percentage "allowance" of time, thus only filling say 80% of the schedule with sprint items "just in case"? Thanks, Kyle


Looking for quality sites built with JavaScript (not jQuery) to learn from their example

I'm new to JavaScript. I've read JavaScript: The Good Parts and half of Professional JavaScript for Web Developers. Now I want to follow this advice - find the best sites and look at their code. As suggested by Crockford in Coders at Work: Reflections on the Craft of Programming I want to find the best sites programmed with only JavaScript not jQuery because I want to look at their code and learn from them.


How can I automatically test a large, complex spreadsheet?

So, I've inherited one of those "Engineer's Special" spreadsheets -- the kind developed by Mort the Engineer, with lots of hairy VBA and WTF, complicated calculations, and no documentation. Fortunately, most of the primary inputs and outputs are on a single page. Maybe not enough for full test coverage, but a start. I'd like to create a quick, poor-man's regression test framework for Excel, but I haven't quite figured out the best method. My gut tells me to create some code that:   1. Has a macro that "saves" a the "main" I/O spreadsheet's values to another workbook, basically creating a user-named, value-only copy of the main input sheet. This "scenario" workbook would have, as its first tab, a list of all of the saved sheets, with metadata.   2. Has a separate macro that "loads" a given set of inputs from said sheets, but does not overwrite the cells used for output, headers, instructions, etc.   3. Has a third macro which is run from the scenario summary table. It would, in turn, load each scenario's inputs into the main workbook, compare each saved output to the current output, and record whether everything matches or not. It would run unattended until it reached a failure to match, then stop so the user can go look at the differences (which would be highlighted). The two caveats: (1) this requires manual synching of the master sheet and scenario sheets when the design of the master changes enough to reposition/add/remove inputs or outputs, and (2) this doesn't scale well if each scenario includes inputs/outputs to test on a multitude of workbooks. Saving/loading named ranges for each I/O cell rather than entire sheets might help with both situations, but has its own drawbacks. Has anyone come up with some other novel way to effectively regression test arbitrary spreadsheets?


Design Pattern: Algorithm varies according to the input arguments

I will give a simple example to help you understand my question. Suppose we have a rectangle and a Utility class with a method that creates a buffer arround a shape. The `.createBuffer` method has required and optional arguments:   * required: radius   * optional: direction (for example "inside" or "outside", default is "outside") ... maybe more arguments ... Every combination of arguments needs a different algorithm. Which design pattern is appropriate for solving similar problems?


What makes Java so suitable for writing NoSQL Databases

Looking at this page that aggregates the current NoSQL landscape, one can see that the majority of these projects are written in Java. Databases are complex systems software dealing with the file system, and so C/C++ would be a better choice than Java for this. (that's my thinking which might be flawed) Secondly, databases deal with transferring large amounts of data from disk to RAM -- which they call a working set. The JVM takes non-trivial amount of RAM for it's own purpose -- so it would be more efficient to use a platform that leaves lots of memory for data instead of hogging it for its own operations. The major relational databases are ALL written in C/C++               MySQL              C, C++     Oracle             Assembler, C, C++     SQL Server         C++     PostgreSQL         C     SQLite             C      So what makes Java so popular in NoSQL world.


How to script the creation & configuration of a portable (vm-based?) Windows 7 dev environment?

I'm getting a new computer and would like to minimize the time spent configuring and maintaining dev environments on my various machines. To that end, I'm thinking that creating a vm with my preferred ide and configuration and using that vm for development on all my machines. I'd like to use Windows 7 as the vm's os. For those who have tried or currently use an approach like this,   1. How can I keep the disk image synchronized without resorting to a thumb drive? What are pros/cons (if any).   2. As I do this first configuration manually, should I record my steps in the interest of scripting them later?   3. If so, what approach would you recommend for scripting? Cygwin + bash? Ant? Something else? Why?   4. Are there potential difficulties I should be aware of re: sharing a filesystem? For instance, in A) accessing vm files from the host machine or B) accessing the vm's HTTP server from the host machine?


Can Clojure's thread-based agents handle c10k performance?

I'm writing a c10k-style service and am trying to evaluate Clojure's performance. Can Clojure agents handle this scale of concurrency with its thread-based agents? Other high performance systems seem to be moving towards async-IO/events/greenlets, albeit at a seemingly higher complexity cost. * * * Suppose there are 10,000 clients connected, sending messages that should be appended to 1,000 local files--the Clojure service is trying to write to as many files in parallel as it can, while not letting any two separate requests mangle the same single file by writing at the same time. Clojure agents are extremely elegant conceptually--they would allow separate files to be written independently and asynchronously, while serializing (in the database sense) multiple requests to write to the same file. My understanding is that agents work by starting a thread for each operation (assume we are IO-bound and using `send-off`)--so in this case is it correct that it would start 1,000+ threads? Can current-day systems handle this number of threads efficiently? Most of them should be IO-bound and sleeping most of the time, but I presume there would still be a context-switching penalty that is theoretically higher than async-IO/event-based systems (e.g. Erlang, Go, node.js). If the Clojure solution can handle the performance, it seems like the most elegant thing to code. However if it can't handle the performance then something like Erlang or Go's lightweight processes might be preferable, since they are designed to have tens of thousands of them spawned at once, and are only moderately more complex to implement. Has anyone approached this problem in Clojure or compared to these other platforms? (Thanks for your thoughts!)


Should we (still) consider a synced XMLHTTPRequest bad practice?

As you may know, `XMLHTTPRequest` can be used synchronously or asynchronously, but synchronized requests have always been considered bad practice, and I've always agreed with that. Not only is the ideology of modern JS development heavily based on an event model, but there were also some more prosaic reasons to avoid synchronized requests. For example, old Internet Explorer versions could just freeze suddenly. Today I saw a synchronized request in Liferay source code and thought "What a shame, how dare they. Don't they know that it is wrong?". But then I asked myself what is actually wrong with this approach in modern times, and I wasn't able to give an accurate, logical answer. For example, on the server side it is common practice to use synchronized HTTP requests. Of course all the data could be fetched asynchronously, and perhaps should be fetched that way, but we often need data that will be used to fetch another chunk of data, so in that case the request must be synchronized. So, should this still be considered bad practice? **PS** : I haven't used the term `AJAX` since the first A stands for asynchronous. :)


Parsing stdout with custom format or standard format?

To integrate with other executables, a executable may launch another executable and capture its output from stdout. But most programs writes the output message to stdout in custom format and usually in human readable format. So it requires the system integrator to write a function to parse the output, which is considered trouble and the parser code may be buggy. Do you think this is old fashioned? Most Unix-style programs do that. Very few programs write to stdout in standard format such as XML or JSON, which is more modern. Example: Veracity (DVCS) writes JSON to stdout. Should we switch to use modern formats? For a console program, human readable or easy parsable: which is more important ?


What tasks should an Architect NOT do or limit to be effective?

There are plenty of questions/answers about what an architect does, but what should someone in an Architect role NOT do? What are the boundaries/limits to maintain to be an effective Architect? I'm thinking here of Architect vs Developer and Architect vs Project Manager For example, I'm finding myself in a role where my title is Architect but I am also the coding/development lead and project manager on multiple small enterprise projects. I'm struggling with all the task switching and now I want to limit task switching. Trying to wear every hat just isn't working. What tasks should an Architect not do at all? What tasks should an Architect limit? I do think an Architect needs to keep coding, but how to define an appropriate limit for coding work?


What are the pros and cons of directly exposing a Table/View entity class to the client?

I'm developing a multi-tier application. We separate our project into three logical layers: client, service and data access. However, almost all methods in the service layer don't do anything except returning table/view from DAL to the client and then the client continues processing data. More than 50% of the returned data is bigger than it really needs to be. For example the client needs a username and an email-address but the service layer returns way more data. This is the coding standard in my team. I tried to change this by shaping classes that return what the client really needs but they wanted me to change it back after I had done it. I'm curious what are the pros and cons of doing things that way?


BizSpark and SQL Server already present. Can and should we move to OSS?

I am starting a new role running engineering in a young startup. The stuff they have is in SQL Server / Windows. I get the feeling we should think about moving to an OSS architecture, main reasons being cost, the ability to test new tools on the fly as they come out, and integrate with leading technologies like RoR and Python easily. Anyone has any suggestions on this? Can it get ugly if we keep our DB backend on SQL Server / Windows and build a Linux / OSS architecture on top of that? Or is the software BizSpark gives you access to enough for anything you need while you stay in the MSFT world? Are tools like LINQ and SSRS good enough? Don't mean to start a fire here, just a real issue our company is struggling with. Thanks for any replies.


Is monkeypatching considered good programming practice?

I've been under impression, that monkeypatching is more in quick and dirty hack category, rather than standard, good programming practice. While I'd used from time to time to fix minor issues with 3rd party libs, I considered it temporary fix and I'd submit proper patch to the 3rd party project. However, I've seen this technique used as "the normal way" in mainstream projects, for example in Gevent's `gevent.monkey` module. Has monkeypatching became mainstream, normal, acceptable programming practice? See also: _"Monkeypatching For Humans"_ by Jeff Atwood


Why is a database represented as a cylinder in architecture drawings?

I'm a young upstart programmer and I've never actually seen a database. But computers in large part come in boxes, not in cylinders so I was wondering why they are always represented as a cylinder when people show their architecture drawings. Is there a reason why or is it just tradition to draw them like that?


Best practices for App Idea ownership and shares

I am developing apps on my sparetime. I am the sole developer, and two non- programmer friends of mine provide vision, content, algorithms and ideas. We always agree happily on all the features, todos and prioritizations. But naturally, coding it is the biggest part. When selling, we agree on **splitting profit equally** , that is 33% each. But version 1.0 naturally does not sell much. And I go on to try to make the app more viral. This includes tons of stuff where the others are of little help. Examples: Adding support for sharing, facebook connect, gameifying, letting users add content, home page, support, maintenance, server services to make it easier for to update content. The list is long. Suddenly I will be doing 100% of a lot of work but only "own" a third of the income. My friends may either "fade out" of the project after 1.0, or they continue to contribute, but with less value and I would rather exchange them for more programmers or graphic designers. The effort they made to version 1.0 is worth a lot to the app and I realize I would have never done it without them. But **I am doing all the work** in the end. It is hard to negotiate about splitting 90, 5, 5 instead of 33% each, because the idea is still theirs. How to solve this? What are the best practices to regard the ownership of the app? What kind of agreements could I make that make it beneficial and motivational for me to continue developing the app?


Which VCS is more applicable for our workflow?

Currently we have code stored on a shared network drive and do not use any kind of VCS. The code stored on our shared network drive is always being backed up. We would like to keep things as close to they are now as possible, while using some kind of VCS software. I am envisioning a centralized workflow with each developer having a local copy of the code on his/her machine. We don't do any branching or working offline. Typically when we spin off a new version we would just copy the current working directory to a new directory. I believe we would continue doing this and just create a repository for the new version. I would rather not get into an argument over which VCS is better, just hoping to get some opinions for which is best suited and most applicable for what we are trying to do.


Does lots of Instance Variables within my class suggest flawed Design?

Ok so I am setting out to consolidate some learning I have been doing. What I am going to do is create a small game relating to a game I enjoy called Persona. For reference a persona you can think of as a pokemon. Basically I want the flow to be user chooses a character, a weapon, and a persona (from a list of predefined personas and people i.e. predefined stats and spells for the persona and predefined weapons, stats and personas for the characters). They will choose and I will use maths/ifs/whiles etc to calculate winners. I currently have a Characters class (with Persona, Stats and Weapon instance variables), a Character Stats class (health, mana etc IVs), a Persona class(with persona stats and name iv), a Persona stats class (agility strength etc IVs) (later I will make the PersonaSpells class) and a Weapons class (attack, hit etc IVs), as well as a Duel class (where all the calculations will be run and methods for player select, enemy selection etc. Additionally with my current implementation all character objects, persona objects and weapon objects etc will be defined in this class and assigned using for example using Character char = new Character(Name, Health, Persona, Weapon, ...), with constructors for persona and weapon defined before this. Finally a main class where I will effectively use an object of the duel class to run the game, and keep the main class and method clearer. My question is, is this design flawed in that, I end up having to declare loads of objects (as IVs) from constructors of my classes. (So I have an object of all 20 weapons, all 10 characters, all 20 Personas, all 10 character stats, all 20 persona stats) All within my Duel class. Code example below:               private Weapon deusXiphos = new Weapon();     (x 20 more like this)          private PersonaStats artemisiaStats = new PersonaStats();     (x 20 more like this)          private Persona artemisia = new Persona();     (* 20 more like this)          private CharacterStats mitsuruStats = new CharacterStats(400, 250);     (* 10 more like this)          private Character mitsuru = new Character("Mitsuru", artemisia, deusXiphos, mitsuruStats);     (* 10 more like this)


When copy/pasting private methods is it necessary to carry along the Javadoc?

So, unfortunately, I'm stuck with code where I'm doing this:               @Override     method A{         //calls private methods 1-8     }          private method 1{         //copy/pasted     }      And so on for all of the private methods. I'd have preferred if the developers of the method I'm overriding had made the private methods protected, but I can't change that now. All of these private methods have javadoc along with them - should I carry this along with the copy/pasted functions in my class and adjust them accordingly, or not waste my time since it is documented in the original file?


Effective Repository in C# - Where to put methods?

I'm trying to build a new application using the Repository pattern for the first time and I'm a little confused about using a Repository. Suppose I have the following classes:               public class Ticket     {          }     public class User     {        public List<Ticket>AssignedTickets { get; set; }     }     public class Group     {        public List<User> GroupMembers { get;set; }        public List<Ticket> GroupAssignedTickets { get;set; }     }      I need methods that can populate these collections by fetching data from the database. I'm confused as to which associated Repository class I should put those methods in. Should I design my repositories so that everything _returning_ type T goes in the repository for type T as such?               public class TicketRepository     {        public List<Ticket> GetTicketsForGroup(Group g) { }        public List<Ticket> GetTicketsForUser(User u) { }     }     public class UserRepository     {       public List<User> GetMembersForGroup(Group g) { }     }      The obvious drawback I see here is that I need to start instantiating a lot of repositories. What if my User also has assigned Widgets, Fidgets, and Lidgets? When I populate a User, I need to instantiate a WidgetRepository, a FidgetRepository, and a LidgetRepository all to populate a single user. Alternatively, do I construct my repository so that everything _requesting_ based on type T is lumped into the repository for type T as listed below?               public class GroupRepository     {         public List<Ticket> GetTickets(Group g) { }         public List<User> GetMembers(Group g) { }     }     public class UserRepository     {        public List<Ticket> GetTickets(User u) { }     }      The advantage I see here is that if I now need my user to have a collection of Widgets, Fidgets, and Lidgets, I just add the necessary methods to the UserRepository pattern and don't need to instantiate a WidgetRepository, FidgetRepository, and LigetRepository class every time I want to create a user, but now I've scattered the concerns for a user across several different repositories. I'm really not sure which way is right, if any. Any suggestions?


How to handle committed and merged code that has no tests?

When developing an application in a team not everyone on this team will be equally good developers. Some will be skilled in some things and some in others and some not at all. As a team working in an agile process you usually have a definition of 'done' to follow. In our DoD it says never to merge code that is not documented and have proper tests. Sometimes though, a feature is so critical to some team member so the code has to be merged without tests. Sometimes a lazy developer might merge and call it a weekend. A merge like this means that when other team members pull the code, they will receive code that may or may not function properly and since there are no tests it is hard to verify. It can be very cumbersome to walk through that code to make sure it works before the team member can work on their task. It has happened on several occasions that the code that was committed without tests has been broken by other team members without them noticing. So my question becomes:   * How would you handle issues like this?    * Does it point to bad planning rather then bad behaviour?   * Who is to "blame" if code that lacks tests is broken?


When did the term "snake case" come into use?

Many people use the term Snake Case to describe variables or other symbols `with_the_form_of_underscores`. When did this term enter into use?


Natural Language Processing (NLP) open source algorithms

I am looking for a way to give an algorithm (service) a sentence, and it will tell me if its positive context or negative or even neutral. Does such a service exist?


Password Validation using regular expressions in html 5

this question may sound stupid, but no one has ever taught me this. I have an HTML input for a password field, and you can only log on with one specific password with JS. Could someone please give me a syntax on assigning a variable to document.getElementById(""); syntax or a different syntax? Thanks.


Practices for navigating and changing "long" code files?

Many a times I have to deal with code files which are quite long - about 5 screen pages at the minimum. Almost always there is something _towards the top/bottom_ that I need to refer when I'm at the bottom/top (respectively). It's a mammoth overhead to constantly scroll back-n-forth between the file parts. It's a cognitive overload to just remember each and everything throughout the file and it's quite necessary to be able to refer to parts of the file. Yes, the _Outline_ view in some editors like Eclipse/NetBeans helps, but sometimes they will work well only for parts recognizable by that parser. Sometimes outline views don't show up e.g. when coding in CoffeeScript or JavaScript using closures/namespaced functions etc. The fallback is then just manual scroll overhead. So as programmers what are some of the techniques/practices that can be employed to reduce this ridiculous overhead? Yes, I can _shorten_ the files, but specifically javascript libraries like Backbone.js etc. are all as one file since you really can't split them into multiple file due to lack of Java-like _packages_. So under the constraints of inability of splitting a file and the outline views not working, what are some of the techniques I can use to navigate through long source files? I work a lot on Eclipse/Netbeans and Aptana and sometimes Vi (but seldom in production environments). It'd be great to be able to split a window into two and see the same file on one side and code in the other. Not doable with Eclipse/NB/Aptana IMO. Vi, yes but can't use it all the time. PS: As of now, I split the file among multiple editors e.g. Eclipse and Aptana. It'd be great to have it at one place, but is that the best that we can do? :) **UPDATE** \- Seems Eclipse _has_ way for doing this and can be found here


My understanding is that Google is not using MapReduce for Google Instant, but I can't find anywhere that states what they're using as the datastore for Google Instant. What is the datastore used by Google for Google Instant?


Saving Passwords To The Local Device

So In my app (iOS), you have to register in order to use the service (a food service). But in order to change details about your account (username, password, and email), you have to reenter your password. Except for if the user logged out, this is the only time you need your password to use the app. So I was wondering, since the user basically never uses their password, and its likely they would forget it the one time they might need it, is it ok if I store their password to their local device (in `NSUserDefaults`)? Since their password would only be on their local device, it doesn't seem like a security risk. If the app was hacked, the only password they could get would be their own. Further, I was planning on just storing it as a string (no encryption). Would it make a difference if I hashed it or encrypted it before saving the password to their defaults? Thanks in Advance.


Why would one bother marking up properly and semantically?

> Note that I (try) to mark up as semantically as possible because I like they > way it looks and feels, but not because I'm aware of any other stunning > advantages. The point of my question is to be able to educate others Well, I've seen a lot of articles and tutorials which often state "Let's mark this up in the most semantic possible way". But a strange thought came to me, **why?** Why would one need (or want) to bother with the specific elements which convey the correct semantic meaning? Specifically, I'm referring to the new HTML5 elements, such as `<time>`, `<output>`, or `<address>`. Especially, if the page "works" (it renders nicely in all browsers). Why would I want to use elements like `<time>` or `<address>`, where nothing at all (or at the worst case, a generic `<span>`) works just as nicely? I'm asking this because I'm seeing a multitude of (very popular) websites (this one included) which does not follow these so-called best practices.


Recovering an anemic domain model into a multitier architecture

I have spent the past several days learning about domain driven design and attempting to apply it to a current project. I decomposed the problem domain into the canonical logical components: domain, infrastrucutre, and presentation. Having completed a first pass, I stepped back and realized that the architecture I created resulted in virtually all of the business logic being contained in the application services, which is the tell-tale sign of the anemic domain model code smell. After further consideration, domain driven design may not be the correct fit for my application, and even if it is, given the small number of business logic rules in my application, the layering overhead may not be worth it. Since I have only written UML and psuedo code I haven't invested too much time and effort, but I would like to leverage what I can if it's possible. My architecture consists of 4 physical components:   1. The "domain" project: abstractions and CRUD methods for the data type I use   2. The "infrastucture" project: the logical representation and methods to be performed on the data   3. The "presentation" project: the user interface (WinForms or WPF)   4. The "services" project: coordiates the domain and infrastucture objects according to business rules If I were to use the components as designed in a multitiered architecture, my presentation layer would only hold references to 3 or 4 services to handle all application functionality. Is this a valid approach?


Should the most recent date be named 'start' or 'end'?

So I have a function that takes two dates. The SQL query gets all the results between the two dates. I currently have my function setup as such:               function myFunc(start, end)      Where start is the most recent date and end is the oldest date. Is this intuitive/correct or is there another naming/ordering convention I should be using?


Formal name for left/right-hand-side of an expression

Given an expression, such as `int x = y + 5`, we'd call `int x` the `left-hand side` (or `LHS`), and `y + 5` the `right-hand side` (or `RHS`). The whole expression is called, of course, an `expression` (or `equation`), but is there a generic term for a "side" of an expression? `LHS` and `RHS` don't quite cut it when it comes to an expression such as `int x = y = 5` (gloss over the fact here that such assignments are generally bad practice!). I'm toying with the term `component` to describe any "side", but was interested to see if there was a formal standard term already in use. Wikipedia only has "Sides of an equation", any better suggestions?


Any tips/tricks/resources on actually TEACHING a class on OOP?

I may slowly be getting into teaching an Object-Orientated Programming class at my school in a year or two. I just graduated and work at my school as an Application Programmer. I'd first start off as a TA/grader and then slowly move into the Professor role. The class would be in Java. I always see resources on this fine site about HOW to program, but does anyone know any tips/tricks/resources on how to TEACH a programming class? It would be full of all different skills levels(but still semi-technical) so it would have to be a little more understandable than if it was just CS kids.


Not okay to take notes at meetings?

I started working at a new job, and have made it a point to take notes at every meeting, of 2 to many people. So far it's worked well for me. It helps me organize and refactoring concepts, a useful exercise for a programmer. I take notes so often and end up rewriting them in e-mails or documentation that I have decided to buy a netbook/notebook/chromebook for this purpose. I recently had a conversation with a colleague about this and note-taking. He said that while he was working as a software consultant in the past, note- taking was frowned upon in some settings. Why would this be? Using the machine as a distraction is one thing, but the benefits to taking notes are so many that I don't see why anyone would be against doing so. **Other considerations** In settings where there's a high value placed upon actual retention and learning from the discussion (e.g. a university lecture, requirements- gathering) taking notes is common and even expected. So is studying those notes later. A lot seem to argue here in favor of pencil-paper vs. machine. There must be some merit to this argument. But by analogy, we could insist programmers develop w/ Notepad (instead of Visual Studio) and without an internet connection. That should remove distractions, but then it's questionable how much productivity is gained through limitations such as this. From reading some of the answers/comments given here, it's interesting that one of the reasons note-taking is discouraged is when they _don't_ want people to walk away with anything after the meeting, e.g. intellectual property that's worth holding a meeting on, but.


Do reactive extensions and ETL go together?

I don't fully understand reactive extensions, but my inital reading caused me think about the ETL code I have. Right now its basically a workflow to to perform various operations in a certain sequence based on conditions it find as it progresses. I can also imagine an event driven way such that only a small amount of imperative logic causes a chain reaction to occur. Of course I don't need a new type of programming model to make an event driven collaboration like that. Just the same I am wondering if ETL is a good fit for potentially exploring Rx further. Is my connection in a valid direction even? If not, could you briefly correct the error in my logic?


How should I start refactoring my mostly-procedural C++ application?

We have a program written in C++ that is mostly procedural, but we do use some C++ containers from the standard library (vector, map, list, etc). We are constantly making changes to this code, so I wouldn't call it a stagnant piece of legacy code that we can just wrap up. There are a lot of issues with this code making it harder and harder for us to make changes, but I see the three biggest issues being:   1. Many of the functions do more (way more) than one thing   2. We violate the DRY principle left and right    3. We have global variables and global state up the wazoo.  I was thinking we should attack areas 1 and 2 first. Along the way, we can "de-globalize" our smaller functions from the bottom up by passing in information that is currently global as parameters to the lower level functions from the higher level functions and then concentrate on figuring out how to removing the need for global variables as much as possible. I just finished reading Code Complete 2 and The Pragmatic Programmer, and I learned a lot, but I am feeling overwhelmed. I would like to implement unit testing, change from a procedural to OO approach, automate testing, use a better logging system, fully validate all input, implement better error handling and many other things, but I know if we start all this at once, we would screw ourselves. I am thinking the three I listed are the most important to start with. Any suggestions are welcome. We are a team of two programmers mostly with experience with in-house scripting. It is going to be hard to justify taking the time to refactor, especially if we can't bill the time to a client. Believe it or not, this project has been successful enough to keep us busy full time and also keep several consultants busy using it for client work.


What are the career options in Delphi

I am a fresher working in an Antivirus company in India. We work in Delphi 7. now i know that delphi is not very widely used. My concern is that I will be something of a pariah in the industry dominated by Java and C etc. Also, my company is not that great. I would like to switch to a bigger company in near future. Can you tell me some companies (mnc) which do their projects in delphi? Thanks


Interview: Review another developer's code

One of my colleagues recently left and I've been asked to review the code of an interviewee coming in to replace him. I have no idea what code he'll bring along with him and moreover have never been given this sort of responsibility before, so am eager to give some useful and fair input. Can anyone provide a succint list of things to look out for?    _I understand this is a very broad question, but this does equally seem like a very appropriate forum for asking it._


How could multiple people work on one website?

Hey guys, I recently watched The Social Network, and this might be a stupid question, but how is it possible for multiple people to work on one website? I mean, if they're working on the same page, how is that possible? And also, is it possible to upload files to an online host without making them live? Thanks in advance.


Distributing my Application inside a Debian Virtual Machine Image-- How to meet GPL obligations?

I have a Linux application I've developed, and I have created a standalone VMWare Image that people can download to try out the application without needing to install and configure a Linux Server. I created this VMWare Image by starting with a base Debian system, installing a bunch of packages and then configuring all the packages and daemons my application depends on. Upon load, the VMWare Image boots right into an X Server running only my application and no Window manager, so its more of a "Virtual Appliance" than a normal Linux Desktop environment. Users generally will never see a command prompt or any application other than my own. (My application itself I have a handle on the licensing issues of) Now I would like to distribute this image, but I'm not sure how to meet my GPL (and other licenses the various Debian components are released under) Obligations. As I understand it, I have two primary obligations to meet.   1. Providing Copyright and License Information for each component I use. As I understand it, all the information I am required to present is located in the /usr/share directory in the Debian, but since my users generally will never touch a console or terminal, they will never see this. Does providing a text file containing a concatenation of all the files inside /usr/share meet this obligation   2. Making source code available for all components I distribute. Since I am not creating the image from source, but from binary packages, I can't provide the actual source code that results in exactly my image being generated. Does providing an ftp mirror and an offer to send that mirror on DVDs of the Debian source debs for all the packages I use meet this obligation?   3. Anything Else I'm required to do to legally distribute this image?


Best way to search through directory structure

I'm working on a python program which organizes a music library. The program will basically help me detect misspelled file or directory names, wrong FLAC tags or unknown/superfluous files. It will also make sure that the FLAC files are named correctly according to their FLAC tags etc. The structure I though of looks as follows (`/` being the root of the music library):               /         [category]             [artist]                 [year] - [release]                     [track number] - [title].flac                     [...]                     [artist] - [release].jpg                     [artist] - [release].cue                     [artist] - [release].log             Various Artists                 [artist_0 [, artist_1 [, ...]]] - [year] - [release]                     [track number] - [title].flac                     [...]                     [artist_0 [, artist_1 [, ...]]] - [release].jpg                     [artist_0 [, artist_1 [, ...]]] - [release].cue                     [artist_0 [, artist_1 [, ...]]] - [release].log             [...]         [...]      I started writing some code but pretty soon I noticed that this is actually not a too easy problem to solve. I wrote 4 functions, `category`, `artist`, `release` and `file`, which are called accordingly while iterating through all the directories. Basically like that (pseudo code):               func category:         do some checks         for each file in this directory:             artist(file)          func artist:         do some checks         for each file in this directory:             release(file)          func release:         do some checks         for each file in this directory:             file(file)          func file:         do some checks (FLAC tags etc)          for each file in the root directory:         category(file)      Now I'm wondering, are there any known algorithms or techniques which could be used to solve this problem in an elegant way?


Why lifting of binary function into the list monads goes over all the element combinations?

Say, if I want to create a cartesian product of two lists, I could do (here in Haskell, but I can do the same e.g. in Scala or any other FP-able language)               cartesianProd = liftM2 (,)      then               >cartesianProd [1,2] [3,4]     >[(1,3),(1,4),(2,3),(2,4)]       Obviously, using (lifting) `+` instead of tuple pairing, will produce list of sums of all combinations. By FP definition, "lifting is a concept which allows you to transform a function into a corresponding function within another (usually more general) setting." The way I understand it, if I have monadic arguments, I can transform my binary function to work with them via liftM2. Where does the cartesian product comes from, though? Intuitively, I would expect `[(1,3), (2,4)]` from the example above.


PHP Interview test. Any advice?

I am going to be doing a short PHP test/project (20-30 mins) at an interview very soon. The job is at a junior to mid-weight salary (although no specific knowledge level is in the job spec) at a media agency. I am looking for any advice on where to concentrate my revision? Should I focus on core concepts (design patterns) or more on method syntax recall? I am not sure if I will have web access during the test, is this normal? any example of a what a small project might mean? Any advice at all would be gratefully received.


How to improve upon Bloch's Builder Pattern, to make it more appropriate for use in classes that may be extended and sub-extended many times over?

I have been greatly influenced by Joshua Bloch's Effective Java book (2nd edition), probably more so than with any programming book I've read. In particular, his Builder Pattern (item 2) has had the greatest effect. Despite Bloch's builder getting me much farther in the couple of months than in my past ten years of programming, I am still finding myself hitting the same wall: Extending classes with self-returning method-chains is at best discouraging, and at worst a nightmare--especially when generics come into play, and _especially_ with **_self-referential generics_** (such as `Comparable<T extends Comparable<T>>`). There are two primary needs that I have, only the second of which I'd like to focus on in this question:   1. The first problem is "how to share self-returning method chains, without having to re-implement them in every...single...class?" For those who may be curious, I've addressed this part at the bottom of this answer-post, but it's not what I want to focus on here.   2. The second problem, which I am asking for comment on, is "how can I implement a builder in classes that are themselves intended to be extended by many other classes?" Extending a class with a builder is naturally more difficult than extending one without. Extending a class that has a builder _that also implements`Needable`, and therefore has significant generics associated to it_, is unwieldy. So that is my question: How can I improve upon (what I call) the Bloch Builder, so I can feel free to attach a builder to _any_ class--even when that class is meant to be a "base class" that may be extended and sub-extended many times over-- _without discouraging my future-self, or users of my library_ , because of the extra baggage the builder (and its potential generics) impose on them? * * * _**Addendum_**   My question focuses on part 2 above, but I wanted to elaborate a bit on problem one, including how I've dealt with it: The first problem is "how to share self-returning method chains, without having to re-implement them in every...single...class?" This is not to prevent _extending classes_ from having to re-implement these chains, which, of course, they must--rather, how to prevent _non-sub-classes_ , that want to take advantage of these method chains, from having to re-implement every self- returning function in order for _their_ users to be able to take advantage of them? For this I've come up with a needer-needable design that I'll print the interface skeletons for here, and leave it at that for now. It has worked well for me (this design was years in the making...the hardest part was avoiding circular dependencies):               public interface Chainable  {           Chainable chainID(boolean b_setStatic, Object o_id);           Object getChainID();           Object getStaticChainID();       }     public interface Needable<O,R extends Needer> extends Chainable  {         boolean isAvailableToNeeder();         Needable<O,R> startConfigReturnNeedable(R n_eeder);         R getActiveNeeder();         boolean isNeededUsable();         R endCfg();     }     public interface Needer  {         void startConfig(Class<?> cls_needed);         boolean isConfigActive();         Class getNeededType();         void neeadableSetsNeeded(Object o_fullyConfigured);     }


Microsoft Certification : 70-511 Is Practice test sufficient to manage an exam?

After reading the Self-Paced Training kit **Microsoft Windows Applications Development with Microsoft .NET Framework 4** , I ran the Microsoft Press Training Kit Exam Prep. I would like to know if it sufficient to pass and manage the 70-511? **EDIT** Ok, I did not pass the Exam this morning. So I Disencourage people which want to pass a certification without a meaningful experience. For your information, here my result : ![enter image description here](http://i.stack.imgur.com/BmVEq.png) As we can see, I've failed in two exam objectives :   * "Building a User Interface by Using Basic Techniques" which covering these chapters :      * Choose the most appropriate control class     * Implement screen layout by using nested control hierarchies.     * Create and apply styles and theming.     * Manage reusable resources.     * Implement an animation in WPF.    * "Enhancing the Functionality and Usability of a Solution"      * Integrate WinForms and WPF within an application.     * Implement asynchronous processes and threading.     * Incorporate globalization and localization features.     * Implement drag and drop operations within and across applications.     * Implement security features of an application.     * Manage user and application settings.     * Implement dependency properties. I really don't understand why I've failed the first objectif. I think to know the fundamentals of WPF. One the other hand, I know why I've failed the second objectif exam : this is an aspect I don't masterize. This exam shows me my weakness. Now I will focus on them.


The Programming Mindset

I'm going to start off by saying that I'm in my second year as a Software Engineering major at R.I.T in New York. I had no experience programming in high school and ever since attending college I have been programming my ass off. I have had some struggles trying to think things through from a logical programming stand point and I was curious, for all of you professionals and people that have been programming from an early age: How do you approach situations? Do you get implementation ideas from past experience or does it just come to you?


Should I be using a JavaScript SPA designed when security is important

I asked something kind of similar on stackoverflow with a particular piece of code however I want to try to ask this in a broader sense. So I have this web application that I have started to write in backbone using a Single Page Architecture (SPA) however I am starting to second guess myself because of security. Now we are not storing and sending credit card information or anything like that through this web application but we are storing sensitive information that people are uploading to us and will have the ability to re-download too. The obviously security concern that I have with JavaScript is that you can't trust anything that comes from JavaScript however in a Backbone SPA application, everything is being sent through JavaScript. There are two security features that I will have to build in JavaScript; permissions and authentication. The authentication piece is just me override the Backbone.Router.prototype.navigate method to check the fragment it is trying to load and if the JavaScript application.session.loggedIn is not set to true (and they are not viewing a none authenticated page), they are redirected to the login page automatically. The user could easily modify application.session.loggedIn to equal true (or modify Backbone.Router.prototype.navigate method) but then they would also have to not so easily dynamically embedded a link into the page (or modify a current one) that has the proper classes, data-* attributes, and href values to then load a page that should only be loaded when they user has logged in (and has the permissions). So I have an acl object that deals with the permissions stuff. All someone would have to do to view pages or parts of pages they should not be able to is to call acl.addPermission(resource, permission) with the proper permissions or modify the acl.hasPermission() to always return true and then navigate away and then back to the page. Now certain things is EMCAScript 5 like Object.seal() or Object.freeze() would help with some of this however we have to support IE 8 which does not support those pieces of functionality. Now the REST API also performs security checks on every request so technically even if they are able to see parts of the interface that they should not be able to, they still should not be able to actually affect any data. The main benefits for me in developing a JavaScript SPA application is that the application is a lot more responsive since it is only transferring the minimum amount of JSON data for the requested action and performing the minimum amount of work too. There are also other things that I think are beneficial like you are going to have to develop an API for the data (which is good if you want expand your application to different platforms/technologies) or their is more of a separation between front-end and back-end however if security is a concern, it is really wise to go down the road of a JavaScript SPA application for the front-end?


How can I send audio input as chunked HTTP?

I am trying to create an interface with an external server, and don't know where to start. I would need to take audio as input to my computer, and send it to the remote server as a chunked HTTP request. The API that I'm trying to connect to is described here p1-5 http://dragonmobile.nuancemobiledeveloper.com/public/Help/HttpInterface/HTTP_Services_for_NDEV_v1.2_Silver_Version.pdf I have never worked with audio programmatically, so don't know what would be the most straightforward way to go about this? Are there solutions that exist out there that already do this? I've come across references to Shoutcast, VLC, Icecast, FFMPeg, Darkice, but I don't know if those are appropriate for what I'm trying to accomplish or not.


Encoding to ASCII where original encoding of string is not known

Given that we do not know the encoding of a string what is the best way to make sure that it is transformed to say ASCII? Also in such situations we are willing to accept potential loss of data.


I believe my solution is better than my boss's, so should I ignore him?

I'm working with php and sql. I think that my method of implementing functions is better than what my boss proposes. Just now he explained me how to do a check on a list of email addresses, and I do not like his idea. I proposed mine which is better and quicker to implement, but he disagreed. Now I think I will go ahead and implement my idea, because his idea was not clear enough to me. Do you think he will be mad?


In an if statement, what are an "if clause" and a "then clause"?

I am a bit confused about the nomenclature for the parts of an _if_ statement. Consider the following example:               1:  if condition then     2:      statement_1;     3:  else     4:      statement_2;     5:  end if;      What is the "if clause" in this statement? Here are a few possibilities:   * Is it lines #1 and #2?    * Is it line #1?    * Is it line #2?    * Is is the _condition_ in line #1? And in the same example, what would be the "then clause"?   * Is it line #2?    * Is it the _then_ keyword, plus line #2?   * Is it just a synonym for "if clause"? My main reference is Code Complete 2nd Ed., but the author seems to use exclusively the term "if clause", with the meaning being lines #1 and #2 in this example.


What is ServletUtilities?

The answer in this question suggests creating a ServletUtilities class to handle text conversion between Java strings and XML text. > Generally when you create a JEE web application you put together a class > that handles general conversions like this in a class named > ServletUtilities. I did a bit of a google for ServletUtilities, but I can't find much about it. Is having a ServletUtilities class a convention? How common is it? When should you have one? When should it be used?


Starting an HTML canvas game with no graphics skills

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 potential, my graphic "stubs" can be replaced with something more sophisticated. I do, however, want my graphics engine to render something approximate to the end goal. The game is tile-based, with each tile being a square. Each tile also has an elevation. My target platform (subject to modification) is JavaScript rendering to the HTML 5 canvas, either with a 2D or WebGL context. My question to those of you with game development experience is whether it's easier to develop an isometric game using a 2D graphics engine and sprites or a 3D game using rudimentary 3D primitives and basic textures? I realize that there are limitations to isometric projection, but if it makes developing my throwaway graphics engine easier, I'm OK with the visual warts that would be introduced. Or is representing a 3D world with an actual 3D engine easier?


database migration: upgrade schema deployed on client machines

I'm working on an application, which when deployed is installed locally on client machines, and uses a local database server. Stupidly, I didn't plan for schema changes -- and now it needs to change. Perusing lots of SO and Programmers questions, and googling, I've found a few strategies:   * **many SQL files.** One for each version. When upgrading, use version number to decide which SQL file(s) to execute   * **one SQL file.** No `drop`-statements, tables created with `create table if not exists -- so when upgrading or installing the first time, simply run this file. Everything already in the db will be fine, all new tables etc. will be created   * **blow away, then rebuild db.**       1. make a copy of all the data     2. drop the entire schema     3. load in the new schema     4. reload the data   * **auto-generated diff file.** Seems to be mistrusted by some; tool for generating such a file costs money (??) I'm looking for advice to help decide between these strategies. An additional note: the data is upwards-compatible (if that's the right term): none of the schema changes involve dropping tables or columns, or changing FK/PK relationships.


Developing assistance tools for games, is it legal against the game creator?

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 multiplayer)?


Javascript frameworks for large development teams

My company is reevaluating what kind of web framework we want to use. We are currently using the Ext 4.0 framework but there are questions being raised that it may not be the right framework to use. I like what Ext has to offer (rich GUIs, data package and class system) are there other frameworks out there that are similar? Are there frameworks out there tailored to medium/large software companies? Info: Potentially 100's of developers converting thick client screens to the web. Data modeling is important and well as rich GUI support. Maintainability and uniformity across multiple products important as well. Any info is greatly appreciated.


Private interfaces within a package

This is basically the same as Coding to interfaces, but played out in the real world of com when there are various engineering complexities such as immutability of published interfaces and implementations, etc. * * * Consider the following situation: A OS-level object-oriented library with a set of published interfaces and an implementation provided by the OS. Some extension points are provided so that third parties can extend specific behaviors by implementing a subset of the published interfaces and registering them with the OS. A programmer looks at the whole set of published interfaces, and says to self, "it seems like I can re-implement most of the functionalities (with better algorithms), including those areas which aren't designated as extensible." And so the programmer worketh. Only when the programmer's own implementation mash up (COM-style) with the OS implementation and fails miserably, did the programmer realize that the **suite of objects** as implemented by the OS rely heavily on communications using non-published interfaces, because the published interface was minimalistic and blocked many opportunities to optimizations(*). (*) In encoding/decoding/trans-coding (of data/image/sound/video compression) tasks, it is well known that certain pipelines stages can cancel each other if they perform the exact opposite operation / inverse, e.g. `G(F(x)) == x`. A typical interaction is like:   1. Consumer asks Producer if it implements a special interface X that only vendor V knows.   2. If yes, Consumer talks to Producer using interface X and see if they are exact opposite (#1).   3. If yes, Consumer asks Producer for its "upper stage" (i.e. bypassing Producer) (#2) so that in effect both are being cancelled out. (#1) and (#2) are capabilities that are missing in the minimalistic published interface. On first glance it seems that the vendor might have a chance to provide them as well, but choose not to. It might also be the case that providing those performance-oriented interfaces would severely pollute the namespace. * * * The end result is that whenever a programmer provides its own implementation of a certain class, it would either (i) fail miserably, or (ii) perform very slowly, because it could not interact with the rest of the _suite_ using the performance-enhanced internal interfaces only known to that _suite_. Is this a more frequent problem with some flavors of Object-Oriented technology? Or is it more common with some flavors of Component-based Engineering? Advocates of OOP will argue that Refactoring and Publishing those interfaces would solve the problem. This assumes that it is possible to distribute a new version of the library along with new set of interface. For some technology this is not possible. * * * The way it matters to com is that its `QueryInterface` method allows run-time query (and run-time response) of additional interfaces implemented by a class. Its Java equivalent would be like a library that makes heavy use of `instanceof` for interfaces internal to the package. _To Reviewers: I'm open to suggestions on trimming down the question to its essence._ The correct term seems to be Mixin, thanks to this question. * * * This answer is partly relevant, but my example focuses on the lost opportunities for optimizations within a single library. Basically, if a third-party implementer didn't do both:   1. Implement both encoder and decoder   2. Implement its own proprietary interface on both the encoder and decoder, in order to detect and bypassing operations that cancel out each other Then the implementation will only get "baseline performance" when inter- operating with different encoders/decoders from other vendors.


Value of maintaining debug outputs

A developer on our team litters his code with debug outputs. He passes many parameters into methods that are only used for debugging. Personally I find this clutters up the code. If I need to debug something I prefer to use breakpoints and the watch window instead of reading through all the debug output. I am making major changes to several classes written by this other developer, should I maintain his debug outputs or can I justify removing them? I have only been in this team for a few months and don't want to upset this developer but also I expect he will rarely be updating this part of the system.


Licensing libraries (which do code generation, etc) and GPL boundaries

I want to really opensource a project that did start as a personal hobby, but I'm an ignorant of licensing details. This project, provides some libraries for a given $language, and some wrapper command line utilities for those libraries. Those libraries, across many things, do generate more code in the same language, code which can be reused by the caller. On my drafts, I always used a MIT style license for the sake of brevity, but it's unreleased copies I'm reviewing right now to merge on a finally released version. I would like to use GPL style policies for usage/contribution of _my code_ (lets call it a framework). But. Could choosing GPLv2 (3?) for my project, limit the things that a given user can do with the code generated or managed by my libraries/utilities? (i.e. commercial profit of such generated code without release her improvements/changes to my code) Is there something to consider (in a plain language) when licensing code that generates code ? **Update:** To try to answer some comments:   1. _What do you wish to accomplish with your license?_   The best goals for the project health (from the view point of a community- based opensource project).   2. _Who do you want to use your code?_   Anybody   3. _What do you want to happen to changes?_   To be back-ported to the project as much as possible.   4. _What do you want to happen to generated code?_   To don't be affected by my licensing choice. It belongs to the user who generated it.   5. _What about money - if the user makes money do you want that to affect the licensing?_   If the user makes money from the generated code, great. If the user makes money _modifying_ my code, I would like to force to publish the changes. I did a group-therapy with those answers. Now, choosing GPL (2? 3?) I could be ok or not? **Update2** > So they have to bundle/compile your library in with theirs when they deploy > it, in order for it to run? yes, the library needs to be installed previously, or bundled with the result (there is an option for this).


How can I monitor the JVM memory in a proper way?

I'm thinking of how we do JVM memory monitor in a low overhead way in production environment even under busy hour. Suppose I have two tomcat app server in production, load balance set up behind them. If I can see the jvm memory statistics I can tell load balance to stop sending the request to the server which will encounter OOM issue. Do this make sense? Jconsole or VisualVM eats more performance resourse is not my choice.


GUI programming - who should be an owner

I know nothing about gui programming. I try to learn. I have simple question... For example, I have small program. I have class that extends JFrame with main Window (MyWindowClass) and my "logic" class (MyClass) that do something (for example calculate something and I want to display it in window). Should I implement this like:               class MyClass {         // ...         // ...         MyWindowClass window;     };      Or like this:               class MyWindowClass extends JFrame {        // ...        MyClass c;     };      I don't know which class should be an owner and which class should be have main method... Please help me... I try to write in Java (Swing) but this is general question I guess.


What copyright date for an update to an open-source project from last year?

In 2011, I released some open-source code that was licensed using the Apache license. As such, all the source files have this boiler plate message at the top:               /*        Copyright 2011 My Name             Licensed under the Apache License... <blah blah>     */      So now it's 2012, and I am readying to release a version 1.1. As such, most all of the source files have been touched in some way. And some new source code files have been added. How do I update the copyright date on the existing files? Is the following the correct update to each source file? (i.e. change 2011 to "2011-2012")               /*        Copyright 2011-2012 My Name             Licensed under the Apache License... <blah blah>     */      Do the new source files get `Copyright 2011-2012` applied equally as well? Or does the new code just get `Copyright 2012`?


Branching strategy for parallel development that won't be in the same release?

My team is working on a product, which for business reasons needs to be released on a regular schedule. An issue has arisen where we want to do development in parallel for the upcoming release, as well as the 'next' release. This is to become standard practice, so it's not as straightforward as cutting a feature branch for the new work. We'll continually have 2+ teams working on different releases of the same product. Is there an SCM best practice for this sort of arrangement?


What are the advantages of using a template language?

I work on a CakePHP app and the views consist of raw html with embedded php echo statements, which over time has gotten rather messy. Before I go in and rewrite the code, I'm wondering if it makes sense to rewrite the views with a template engine, such as Twig or Smarty, but I don't have experience with template engines. What are all the advantages of using a template engine?


Constructing a Finite State Automaton

I have an exam question that I am unsure of the answer. The question is: > In organisation X valid user names have the following structure. The user > name can be either the employee’s name followed by a colon and then the > department name or a string of one or more alphanumeric letters consisting > of lower case, upper case letters and digits from 0 to 9. All user names end > with a period ("."). The employee’s name is expressed as ﬁrst name followed > by an underscore and then the surname. The ﬁrst name and the surname must > begin with an uppercase letter and is followed by an arbitrary number of > lower case letters. All department names are an arbitrary number of lower > case letters. Express the language for valid user names as a regular > expression. The answer I have is, > [A-Z][a-z]+"_"[A-Z][a-z]+":"[a-z]+"." | [A-Za-z0-9]+"." The next question is: > Construct a deterministic ﬁnite state automaton for recognising the user > names as described in Question 1. For which I have this:![finite automata](http://i.stack.imgur.com/4ukWq.jpg) I am under the impression this is wrong because [A-Z] is a subgroup of [A-Za-z0-9] and a DFA cannot have the same symbol going from one state. Does anybody have an idea how to solve this / is it correct? Thanks !


How is an IDE compiled?

I'd like to know the general procedure of how an IDE is built/compiled/created. Additionally, what are some tools/scripts used to create an IDE? I don't mean to say that compiling IDE **needs** an IDE. It was just a general assumption made by me that since IDE is just a piece of software too so it sounds logical to me that they may use the previous version of IDE to build the next one. I want to understand how the IDEs are built.


Anybody use the Team Software Process (TSP) and/or Personal Software Process (PSP)?

More info on it here: http://en.wikipedia.org/wiki/Team_Software_Process What has your experience been?


Concepts: API Level Testing

I'm college grad, soon to be graduating. SO i have started my job search. So my question is for New Grad who is interested in QA (API Level testing in particular). What is level of knowledge in **JAVA** required? I'm not that great in Java but can rate myself 5/10. So do companies expect candidate to have extensive coding knowledge in java or just basic java Again if its just basic java, what concepts should i focus more on ? Thanks


How to update a file in exe

I am converting HTML5 file to .exe using HTML EXECUTABLES converter. After converting to exe, the total size comes around 70 to 80MB. So the problem is when i update a single CSS file I have to convert the whole project again to a exe and give it to my Client and every time i have to upload 80MB file for very small changes. Is there any other alternate option to update a certain file instead of converting again to exe.


Python datetime timedelta attributes

In the python `datetime` module, `timedelta` objects take weeks, days, hours, minutes, seconds, and microseconds as arguments upon instantiation. However, after the `timedelta` is created, the only two attributes it has of the former listed are days, seconds, and microseconds. Why is this?


As a solo developer, how can I use a whiteboard in programming effectively?

I have been programming for a while and I often find myself writing my thoughts down because I've found that it helps me to focus on the solution. It feels like I am wasting a lot of paper. On the other hand, I feel insecure about getting a white board installed in my personal cube because it feels like a whiteboard is more specifically used to discuss solutions with other developers. What is your experience with note taking? Is a whiteboard useful outside of collaborative situations?


How do you track common, but rarely used code?

General OO teaches us to encapsulate and best practices teach us organization. So we end up with re-useable self-documenting code that relieves us of any details regarding implementation. So, if I need to invoke the windows command line I use my command line class.               class CommandLine     {        CommandLine(){}        Invoke(string command) {}        CloseAsync(){}        Close Sync(){}     }      Over time these simple encapsulations turn into libraries. We may even have further classifications via Namespaces. This works very well in the same language. Especially when its a language the developer commonly uses. But, I often run into situations, especially in lesser used languages, where I need to recall a simple common concept that may not actually be a class at all. For example, I don't write a lot of jQuery, but I write enough where I get tired of looking up the proper syntax for `$(document).load`...or is it               $(document).ready()      or...               $(document).read(function(){});...      This kind of boiler plate code, which I understand well the purpose of, but lack the experience and regular usage of the language to remember the syntax is where my problem lies. I have seen some developers write a blog to simply remember the idea. My usual approach is... > Google "document load"   >  GOogle "document load jQuery"   >  ...find some snippet   >  Google "Document Ready jquery"...done   > And this has usually been fine. But, I have also noticed that on SO, some of the top answerers, say Jon Skeet, seem to pull boiler plate answers very quickly...so quickly I wonder if they have built up some sort of reference material to quickly search and slap together this code on the forum, piecemeal or in full. I would like to use this same concept (if it exists...) to store my "document.ready" snippets so that I may use them for my own coding. So, does an effecient storage and lookup exist?   What is the best way to store and organize these irregular, but common useful snippets? Bonus...its even more interesting to note how my coding approach does not lend itself well to white-board interviews (where we have no google, but are expected to write code). How do you handle this issue when facing the "lesser used" languages in your vocubulary?


May I keep my program closed source if I link it against a static library of which the source is GNU GPLv2?

I'm putting much work in my program and after it's done I want to just setup a small website and sell each copy of the program but I don't want any legal issues. Do I have to look for another library or can I "safely" link to it?


Relicense BSD 2/3-clause code to GPL

Suppose I release some source code under the new BSD license. Is it allowed for someone else to take this code, make modifications to it and distribute it under the terms of the GPL? From Wikipedia: > _Many of the most common free software licenses, such as the original MIT/X > license, BSD licenses (in the current 2-clause form), and the LGPL, are > "GPL-compatible". That is, their code can be combined with a program under > the GPL without conflict (the new combination would have the GPL applied to > the whole). However, some free/open source software licenses are not GPL- > compatible._ I'm assuming this implies that one can relicense new-BSD licensed code to GPL?


Proper Use Of HTML Data Attributes

I'm writing several JavaScript plugins that are run automatically when the proper HTML markup is detected on the page. For example, when a `tabs` class is detected, the tabs plugin is loaded dynamically and it automatically applies the tab functionality. Any customization options for the JavaScript plugin are set via HTML5 data attributes, very similar to what Twitter's Bootstrap Framework does. The appeal to the above system is that, once you have it working, you don't have worry about manually instantiating plugins, you just write your HTML markup. This is especially nice if people who don't know JavaScript well (or at all) want to make use of your plugins, which is one of my goals. This setup has been working very well, but for some plugins, I'm finding that I need a more robust set of options. My choices seem to be having an element with many data-attributes or allowing for a single `data-options` attribute with a JSON options object as a value. Having a lot of attributes seems clunky and repetitive, but going the JSON route makes it slightly more complicated for novices and I'd like to avoid full-blown JavaScript in the attributes if I can. I'm not entirely sure which way is best.   1. Is there a third option that I'm not considering?   2. Are there any recommended best practices for this particular use case?


What is the advantage of assigning a function to a var?

Given this Javascript example I found               var sum = function() {       var i, sum = 0;       for(i = 0; i < arguments.length; i += 1) {         sum += arguments[i];       }       return sum;     };      What advantage is there in assigning a function to a var?


What is the best way to diagrammatically represent a system threading architecture?

I am yet to find the perfect way to diagrammatically represent the overall threading architecture for a system (using UML or otherwise). I am after a diagramming technique that would show all the threads in a given system and how they interact with each other. There are a few similar questions - Drawing Thread Interaction, UML Diagrams of Multithreaded Applications and Intuitive UML Approach to Depict Threads but they don't fully answer my question. What are some of the techniques that you've found useful to depict the overall threading architecture for a system?


Where should I put my utility methods?

I am very new to Visual Studio and C# and am wondering how best to create a repository of sorts for utility methods. For instance, we need a method that returns the current fiscal year and other company specific values. Would it be best to create utility class file that is imported into every project? Or, create a new project with the these methods and add it to the current solution? In python, for instance, I created an egg that has all the utility methods that I then install into the site-packages.


What research topics can I tackle with only a year of experience?

I've been looking to get into research, but I'm not sure I can do when I've only taken two quarters of Computer Science. I go to the University of Washington, if it's relevant. This is a page on research. I find that I'm not able to judge what is possible for a first year looking through the website. Most things look intimidating, but I'm sure I could somewhere on some problem if I actually attacked it.


Whats the work flow with 2 people on a project

I come to you as a newbie programmer who's been working on his own project (which is progressing nicely). My co-founder has also been learning how to program and has reached a point where he could probably start fixing some things and making some things happen. He asked a very good question, which was "how will this work". Something I could only theorize about as I've never programmed with someone else. Could you advise me on the best work flow. We use git. Should we own specific parts of the system? Checking code in? Code review? How do you work with >1 dev?


Learning Groovy vs learning Python, Ruby or Perl to get some insight on dynamic languages programming

I would like to explore programming in dynamic languages, and I found that Groovy would be really easy to learn because it is heavily based on Java. won't I miss anything important regarding dynamic languages proggramming if i take Groovy path instead of say Ruby or Python? I don't intend to program in dynamic language too much, it is mostly for learning purposes. thank you for help.


Shelving code in Team Foundation Server (TFS)

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/partially done, you should "shelve" your pending changes The first two make sense but I don't really get the last one. I asked my mgr and he said that its so he knows that you actually did some work for that day, which does kind of makes sense but still, I'm wondering what other teams use the "shelve" function for?


How do you think about and architect programs?

I'm a QA guy and designer and i'm coming to development. How do most developers architect programs? With design I build up with a vague idea of what I have in mind and adapt my design to keep in moving forward and looking good. With coding, I'm trying the same methodology. I'm constantly testing and debugging my code and I make forward moving tweaks to my code. The problem is, I dont think this is how it's done. When I look at good Javascript for example, everything is broken out into evenly distributed functions. I don't architect my code in this way. Do you normally have to sit out and draw out your classes and functions before you start writing?


Best way to handle product and supplier relationship

> **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?


Best practice mapping an external id on my system

I've done some searches for "id mapping" and "external id mapping" and I can't find anything meaningful on the site or google, so, here's my question/scenario. I'm developing an application which will match some records from our internal system with the "same" records from an external (outside the company) system. The data-exchange (receive the data from external system) is irrelevant (could be TXT, CSV, XML, Excel, etc...). At some point I'll have to match our internal customer id with the external customer id. The thing is: I know **my id is immutable** , but **I don't know id the external id is mutable**. And there's no way to know, because the external system is out of my control and can be changed without my knowledge anytime. So I have 2 scenarios:   * Best case: the external ID is immutable;   * Worst case: the external ID is mutable (within the constraints below); So I'm developing a mapping table with the following attributes:   * Internal System Customer ID;   * External System Customer ID; Pretty standard stuff. The real question is: **What should I add on this table in order to prepare for worst-case scenario ?** Constraints:   * If the ID is mutable, it'll be on a daily basis, so there can't be a 1-to-many internal-to-external ID on the same day (this is a business rule that can be enforced);   * The external ID can be anything from an integer to a GUID or a zip-code. But nothing bigger than a GUID;


How should dependencies be managed across a modular application?

Let's say that we have a structure like this:               Application         -- Modules             --Module1                 -- Controller                 -- PublicHelper                   --Module2                -- Controller                -- PublicHelper      Whereby a module's Public Helper can provide helper functions. In nearly every module helper, the helper needs to access another module's public helper methods. Let's say for instance, in a PHP application: Module1 provides functionality to create a sale, and as part of the               class Module1PublicHelper extends AbstractModuleHelper {              public function createSale($customerId, $param, $param)         {              $userPublicHelper = // grab an instance of the user public helper              $currentUser = $userPublicHelper->getCurrentUser();         }     }          class Module2PublicHelper extends AbstractModuleHelper {              public function getCurrentUser()         {              //do something              return $user;         }     }      In this situation, the method needs to obtain an instance, either new or whatever of the user public helper. Given that all of Module Public Helper classes are instantiated with a minimum set of constructor params, e.g. EntityManager, what would be the best way to get a copy of it? Obviously, we can't really inject the user public helper class into the class containing `createSale` One solution would be to use a service locator or registry, however, testing the application isn't exactly easy.


Should a developer always use version control

> **Possible Duplicate:**   >  Version control for independent developers? I've heard statements to the effect of: "Well it's just me working on this project so I don't need to put it under source control" as well as, "There is no need to work version controlled on this project, it's so small". It is my opinion that no matter how small the project is, so long as it's adding value to the client (and they are paying for it too) that we, the developer(s), should version control it; especially since its company policy. Am I insane or does my standpoint make sense. Question: Should development work always be version controlled?


how do you backup your code on your local computer?

> **Possible Duplicate:**   >  Version control for independent developers? I have a folder containing all my code (working code, experiment code). I'd like to back it up to a zip file on an external hard drive or whatever is best. How do you guys backup your code?   Do you setup your own source control server?   Do you use a script to zip all files?


Version control for independent developers?

Do you think it's worth it to use version control if you are an independent developer, and if so, why? Do you keep the repository on your own computer, or elsewhere, where it can serve as a backup?


Team of 1: Do I need Project Management & Versioning Software?

> **Possible Duplicate:**   >  Version control for independent developers? I work as a Junior Programmer in a team of 1. I am looking for suggestions of what open source/free Project Management(I cant remember the correct term?) programs, ie things like Github would be suitable for my & the companies needs. I create websites using just javascript, HTML & CSS, I create cross platform mobile applications using Mosync C++ API & I create Facebook iFrame apps using HTML, javascript, css & their Graph API. The boss is really not willing to purchase a subscription from a "Project Management Program"(BTW whats the correct term?) so I would be looking for a free service. I currently use DropBox because it allows me to work from anywhere & gives a limited ability to go back to an older version of a file but I have found that I have made a change in a project & it broke something else so I needed to go back to the old version of a file & it was not there in dropbox(maybe they only keep the last version before a save). **If you were on a team of one do you think it would be necessary to even use this? And if yes, what service would you use?**