title: Deployment Tools that Integrate with TFS?

text: So I have this issue. The Operations team where I work has taken over TFS because they are using MS Build to build and deploy code to production servers. As a result developers have lost A LOT of functionality from TFS (see earlier question.) Essentially the operations team has taken owner ship of Trunk in order to manage their deployments. The development cycle thus goes something like this:   1. Request Operations Team to create a Branch from Main for development work.   2. Perform Development work on development branch.   3. Merge from Trunk to development branch prior to release (basically make sure that the development branch has all of the latest changes)   4. Request Operations Team merge to Trunk from development branch (Developers do not have permissions to do this) -> this request will cause Operations to not only to merge to Trunk but also to deploy to the development environment.   5. Perform integration Testing, fix defects found in development branch.   6. Repeat steps 3 - 6 as necessary.   7. Request Operations Team merge from Trunk to a QA branch (there is only ONE on-going QA branch per project) -> this request will cause a deployment into the QA environment (An MS Build template is used to compile the code from QA branch and then deploy to QA servers)   8. QA tests, fix defects found in development branch.   9. Repeat steps 3 - 8 as necessary.   10. Request Operations Team merge from QA branch into PROD branch (there is only ONE on-going PROD branch per project) -> this request will caus a deployment into the PROD environment (Again an MS Build template is used to **re-compile** the code from PROD branch and then deploy to PROD servers) As a result of the Ops team using an MS Build template to deploy to Production servers, the Development team has now lost the "Builders" role. We cannot create our own MS Build templates, we cannot create or edit a Build definition, and we cannot queue a build -- Even in the Development Environment -- because the Build process runs under a service account which has access to Production servers (since it is use to deploy to production servers). Besides the removal of TFS permissions, I have some issues with this process:   1. The assemblies which were compiled and tested in the QA environment are not the assemblies being deployed into the Production environment. Because the MS Build process is being used to deploy to production, code is recompiled and deployed from the Production branch. In theory, the resulting assemblies should be the same, however this is depenent upon a) the operations team (who are not developers) properly merging the code from the QA branch to the PROD branch (human error potential) b) the build environment not changing in such a way as to affect the way assemblies are compiled (since this is primarily .Net improbable but not impossible)   2. Since there is only ONE QA branch, if I have a production issue which needs a "hot fix" after other work has been merged to QA, I have to wait for Ops to rollback changes to the QA branch, merge my changes in and perform the build and then HOPE that operations correctly performed the rollback and merge operations on the QA branch in order to get my "hot fix" into the QA environment.   3. Many of my projects have multiple outputs (e.g. a web-application and a windows service). Often I may want to only deploy one or the other. But if I upgrade one to a new version, I no longer have a PROD branch which represents the one I didn't upgrade.   4. Operations team has already demonstrated that merge operations are not being performed correctly: Following a recent merge from Development to Trunk I performed a compare on the two branches and they were different.   5. Because code is recompiled for each environment we cannot use automated versioning, or make use of the "build quality" features of TFS. Essentially what it comes down to is the Operations Team has attached themselves to using MS Build for deployments and as such have adopted a rediculous Source Control branching and merging strategy to support using MS Build for managing deployments. (I see no benefit in having a QA and PROD branch other than to support MS Build based deployments). What I am trying to do is convince the powers that be and the operations team that what we're doing is a bad practice, and also give them an alternative deployment strategy. What I need for this is a Deployment tool that integrates with TFS (e.g. it will show a list of Builds that have a specified "build quality" level (depending upon the environment being deployed into) as a "deployment source" and allow then to maintain a list of "deployment targets" so that at deployment time, they simply pick the build (source) and the target and click the "GO!" button. A proper deployment tool will hopefully eliminate their dependence upon MS Build, allow them to remove access to QA and Production servers from the MS Build process, follow a more sane approach to branching and merging (e.g adopt a "branch per release" best practices strategy) and restore to the developers the TFS permissions which were revoked to support this rediculous process.


title: Why did Google develop a cross-compiler from Java to JavaScript?

text: Google developed a cross-compiler from Java to JavaScript. Why did they do this? Does this mean that JavaScript is not good enought for developing advanced web apps?


title: Micro finance in the programming industry

text: I've read quite a bit about the positive effects of micro finance in developing countries. Organizations exist that solicit capital from donations and then make micro loans to people for the purpose of setting up some kind of business. The loans are usually quite small, with little to no interest and are well under ten thousand US Dollars, typically reaching only hundreds of dollars. The pay back rate is also excellent. The programs that exist seem to focus on retail and agricultural endeavours, I have yet to see an organization with a focus on technology sectors like software development. Do you know of any established / credible micro finance organizations that supply micro loans to individuals in order to set up software related businesses? Have the loans been paid back as well as other sectors, such as agriculture and retail? I'm looking globally, so organizations in any country would be appreciated.


title: Why do companies want you to register with their program?

text: I've always wondered why some companies want you to register when you install their programs. Personally, I just find it annoying and decline, but what do companies have to gain by having their users get registred? They claim that you get "the latest updates" and stuff, but often you get that anyway without having to register. So what's the deal with this registering? I just don't see that point.


title: How to queue work orders by date and priority?

text: In my organization I work on orders based on date, so earliest work orders first. We also have an option for order to be marked "priority" in which case those orders are done first but not always. I've asked my boss some questions and I couldn't get answer that made sense...   1. If one order has today's date, and another order has tomorrows date but is marked priority, which order should I work on first? He said the order marked "priority".   2. If one order has today's date, and another order is dated 14 days from today and is marked priority, which order should I work on first? He said the one that has today's date. So the problem is properly placing the order in queue, but it's not something they have an exact formula for. If I was to make a class that only has two properties...               public class WorkOrder     {         public DateTime dueDate;         public bool isPriority;     }      What would be the most straightforward way to put them in queue?


title: Is it acceptable to use C11 generic macros in Objective-C to box numbers?

text: I was getting tired of repeating types when writing things like this:               NSDictionary* d = @{@"so": [NSNumber numberWithInt:index]),                         @"much": [NSNumber numberWithBool:accepted]),                         @"repeat": [NSNumber numberWithDouble:height]};      So I defined a generic macro (a new feature in C11):               #define box(X) _Generic((X), \     char: boxChar, \     unsigned char: boxUnsignedChar, \     short: boxShort, \     unsigned short: boxUnsignedShort, \     int: boxInt, \     unsigned int: boxUnsignedInt, \     long: boxLong, \     unsigned long: boxUnsignedLong, \     long long: boxLongLong, \     unsigned long long: boxUnsignedLongLong, \     float: boxFloat, \     double: boxDouble, \     BOOL: boxBool \     )(X)          ... implement type-specific box methods as well ...      So that I could write things like this:               NSDictionary* d = @{@"so": box(index),                         @"much": box(accepted),                         @"shorter": box(height)};      Is this a good idea? Can I expect others to be able to build the code? Will they hate it for not being standard?


title: I made improvements to free code I found online and notified the author. Was this the right thing to do?

text: I recently used a library from http://www.braemoor.co.uk/software/index.shtml (the EU VAT No validation library at http://www.braemoor.co.uk/software/vat.shtml) in a project at work. It mentions as the license (or something that looks like one): > All software is provided as freeware for personal or commercial use without > obligation by either party. The author will not accept responsibility for > any problems that may be incurred by use of this software, although any > errors reported will be corrected as soon as possible. Re-distribution of > this software is NOT permitted without explicit permission. I checked the code and found (and applied) a few ways to improve the code so it's more easily maintainable and more readable (you can find one of them on CodeReview.SE). After applying these changes, I considered that others might benefit from them as well and sent them as feedback to the author on his contact address. A few hours later, the author sent a reply thanking me for my suggestions, and that he would go over my changes and keep me informed. My main concern is that while the website mentioned that it was freeware, I'm not sure how far I am allowed to go in altering his software without knowing the license. I assume it's license-free, but it's not specifically mentioned as open source, and I'm slightly worried that I might have overstepped my bounds and took too much liberty with the whole thing. Did I do the right thing?


title: Shoud I directly return a string message or rather a i18n key when dealing with JSON api?

text: Suppose a rest api returning this json:               {         "status" : "fail",         "data" : { "title" : "A title is required" }     }      Since the client application would always adapt the error message, would it be better to return an explicit i18n key that the client would have mapped rather than "A title is required"? :               {         "status" : "fail",         "data" : { "title" : "error.creation.title.required" }     }      Indeed, the point is to expect the request consumer (web application for instance) to easily translate the message regarding its localization.


title: Approach to develop an inline editor for enumerated lists

text: # Background Looking to develop a WYSIWYG editor for ordered lists so that people can directly edit lists of instructions on a web page. # Problem The `contentEditable` attribute is woefully immature for editing ordered lists (e.g., `<ol contentEditable="true">...</ol>`). I discovered four bugs in Firefox 25.0.1 within seconds of editing; Chromium was acceptable; IE8+ will likely border on nightmarish. A number of inline editors exist, and I've gone through almost all of them. Even the lightest-weight editors are far too heavy, or have too many bugs, for accomplishing such a seemingly simple task. # Question What approach would you take to developing a browser-based WYSIWYG inline editor for enumerated lists? Some of my ideas have included:   * Take the most robust inline editor and trim back all needless functionality.   * Build up an inline editor that meets my needs. Both approaches will be time-consuming. What other approaches are worth considering?


title: How do I transition from software support to software development?

text: I am at a crossroad - I've been working for whole 4 years as a support person fixing countless bugs, developing (minimal) changes and improvements to our software, working together with our clients and users. I started as a complete noob, without a good understanding of .NET, C#, SQL Server, etc. I had to work late nights and weekends just to catch up to my co- workers and to prove to myself that I am capable to do the work and do it good. I don't consider myself an expert in those fields, but I feel pretty comfortable working with them. I think I have had enough of it and I want changes - I want to move away from support and start working as a developer. Is there anyone who has gone this road before? Could you, please, share an advice or two?


title: Does C# give you "less rope to hang yourself" than C++?

text: Joel Spolsky characterized C++ as "enough rope to hang yourself". Actually, he was summarizing "Effective C++" by Scott Meyers: > It's a book that basically says, C++ is enough rope to hang yourself, and > then a couple of extra miles of rope, and then a couple of suicide pills > that are disguised as M&Ms... I don't have a copy of the book, but there are indications that much of the book relates to pitfalls of managing memory which seem like would be rendered moot in C# because the runtime manages those issues for you. Here are my questions:   1. Does C# avoid pitfalls that are avoided in C++ only by careful programming? If so, to what degree and how are they avoided?   2. Are there new, different pitfalls in C# that a new C# programmer should be aware of? If so, why couldn't they be avoided by the design of C#?


title: PHP/MySQL Database application development tool

text: I am an amateur PHP coder, and have built a couple of dozen projects from scratch (including fairly simple e-commerce systems with user authentication, PayPal integration etc - all coded by hand from a clean page. Have also done a price comparison engine that takes data from multiple sites etc.). But I am no expert with OO and other such advanced techniques - I just have a fairly decent grasp of the basics of data processing, logic, functions and trying to optimize code as much as possible. I just want to make this clear so you have some idea of where I'm coming from. I have a couple of fairly large new projects on my plate for corporate clients - both require bespoke database-driven applications with complex relationships, many tables and lots of different front-end functions to manipulate that data for the internal staff in these companies. I figured building these systems from scratch would probably be a huge waste of time. Instead, there must be tools out there that will allow me to construct MySQL databases and build the pages with things like pagination, action buttons, table construction etc. Some kind of database abstraction layer, or system generator, if you will. What tool do you recommend for such a purpose for someone at my level? Open source would be great, but I don't mind paying for something decent as well. Thanks for any advice.


title: Is there an "ask for only what you need" interface principle?

text: I have grown into using a principle for designing and consuming interfaces that says basically, "ask for only what you need." For instance, if I have a bunch of types that can be deleted, I'll make a `Deletable` interface:               interface Deletable {        void delete();     }      Then I can write a generic class:               class Deleter<T extends Deletable> {        void delete(T t) {           t.delete();        }     }      Elsewhere in code I will always ask for the smallest possible responsibility to fulfill the needs of the client code. So if I only need to delete a `File`, I'll still ask for a `Deletable`, not a `File`. Is this principle that is common knowledge and already has an accepted name? Is it controversial? Is it discussed in textbooks?


title: I'm a CS student, and honestly, I don't understand Knuth's books

text: I stumbled upon this quote from Bill Gates: "You should definitely send me a resume if you can read the whole thing." He was talking about _The Art of Programming_ books. So I was pretty curious and want to read it all. But honestly, I don't understand it. I'm really not that intellectual. So this should be the reason why I can't understand it, but I am eager to learn. I'm currently reading Volume 1 about fundamental algorithms. Are there any books out there that are friendly for novices/slow people like me, which would help to build up my knowledge so that I can read Knuth's book with ease in the future?


title: Storing a C# dictionary of type <datetime,enum>

text: As title says it, i'm looking for a way to store many dictionaries (one per user) of type `Dictionary<DateTime,enum>` in a database (sql server 2012). Each dictionary has 366 items inside and it represents a calendar where each day has a certain "status", and preferably i don't want to store each item as a separate record in the DB. Ideas? **update** : With the suggestion @AndyBursh & @Konrad Morawski made, i've also come up with another optimisation. Rather than by default creating a new calendar (represented as `Dictionary`) for each item the user adds, let them pick a predefined one from a drop down, and if that doesn't work for them, then create a separate calendar. With the ability to reuse a calendar and **not** storing default values, i would have to deal with a lot less data in the long term.


title: Are there any actual drawbacks to self-referential method chaining?

text: I recently suggested a method of chaining be implemented for a certain class in a certain project so readability of the code could be improved. I got a "fluent interfaces should not be implemented just for convenience, but for semantics" answer and had my suggestion shot down. I answered that I was not suggesting a fluent interface but method chaining itself (both **can be confused** with each other, read at bottom) to improve readability and coding comfort, suggestion was shot down again. Anyhow, this got me thinking that maybe I could be incurring in a bad practice by always returning "this" in methods that are not supposed to return anything (e.g. setters). My question is: can applying the previous convention be regarded as bad practice or abuse?, why?. I don't think there are any performance drawbacks, or are there?.


title: Is ABET accreditation important for a bachelors degree in Software Engineering?

text: Is ABET accreditation important for a bachelors degree in software engineering in the US? Does a person with a non-accredited degree in software engineering have a disadvantage when applying for graduate school?


title: What is Delegation and why is it important in iOS programming?

text: At the moment I am teaching myself iOS programming, and one concept I find really hard to wrap my head around is delegation. What is it? Why and how is it used? What is the advantage? The technical writing from the book I'm reading makes it hard to understand.


title: Is there an equivalent to gnu parallel for windows?

text: gnu parallel is a small utility that allows you to execute bash commands in parallel. I was wondering if there's something similar for windows.


title: What are the problems which I will face if all the classes I use are loosely coupled

text: Loosely coupled classes gives flexibility. If I understand it right, Event flow, Observer Pattern and Design Patterns like MVC focus on loose coupling. So in this context I am aiming towards making a project where all the classes are loosely coupled. So, for example I have a class A that uses B: then instead of `a.b.doThis() ;` I will be going like this :               b.addEventListener( B.OnEventHappens, doThisInA ) ;       So, my question is. If this sort of loosely coupled relationship throughout a project is a good thing to do? Would it make a robust project? Or is it not advisable to use it on the "Extreme" side?


title: Taking an open source project to closed source

text: How is it legally possible to take a project initially released as open source back to closed source? Especially one licensed with the GPL any version.


title: How to automatically have Tortoise svn copy last log to clipboard on commit?

text: After each commit I bring up the Log Messages dialog and copy the log entry to the clipboard so I can include it in the issue tracking system. Eventually I hope to get SVN integrated with the system so this isn't necessary, but for now this is a great way to keep the two attached. Is there a way to automatically copy the last log entry to the clipboard or even a text file on commit without needing to manually bring up the Log Messages dialog?


title: Is it possible to speed-read code well?

text: Sometimes we have _huge_ code listings to deal with, and I'm curious as to how the advanced, highly skilled programmers read code. And I'll say with an emphasis on debugging and finding issues.


title: Value of MVVM in a Line of Business Application (and a Rant of Current Development Practices)

text: After 2 years, I'm still struggling with MVVM as a practical method of producing working software. In some cases it's great. I did a multithreaded application that controlled a small assembly line that would have been a nightmere without MVVM concepts. An abstraction from the physical assembly line was almost a no brainer. However, my career mostly revolves around internal line of business applications - formalizing and optimizing the operations of a business. In such apps, there is generally a business teir revolving around CRUD and compound operations. In LOBs, my view models end up being a very simple collections of one line wrapper functions of the business class methods and in the end only end up complicating the simplest of tasks like showing a message box or opening a window. Doesn't anybody else find it odd when people go into long discriptions of "dependency injection" and "messaging providers" for a Window.ShowDialog call that has been around for decades? How many other questions are there on stack overflow asking for advice for tasks that were extremely simple in winforms? Don't get me wrong - I get MVVM and how it could be invaluable to large teams doing horizontal development of a shrink-wrapped and marketed software package. Unit testing the view models could save millions by avoiding a bad RTM bug and dedicated UI developers could give a rich experience. But when the cost of redeployment is minimal and all the business cares to pay for is simple working software, why should i spend time unit testing a simple "wrapper" vm when my business logic is already unit tested? How much time is the business really going to allow me to spend on cute animations and color schemes? Is there anything left for a junior developer to do (tracking down a bug in a save functionality used to be looking at "Save_Click", but now you have to understand the patterns and the project as a whole especially if you're relying on templating to marry up the VM with the view). Admittedly, I really like the databinding of WPF. To take advantage of it, I set the data context to the window itself, where it has access to the business class as well as any other observable properties. Yes I break nearly every MVVM "rule" by doing so. But at least I have simple event driven code that's easy to read AND I get to take advantage of the new databinding and validation. The problem is in the designers - which I don't use all that much but hope to now that it's better integrated in 2012 - the designer shows the hundreds of properties that a window and its base classes have. For those that can relate can you point me to resources, books, or even just changes in perspective that made this easier to swallow. I'll give MVVM another shot, but the last time I felt pretty stupid for worrying about dependency injection just to show a message box from a VM I had no intention of unit testing. Even if I did unit test are we really getting more quality by trading run time testing for compile time errors of those dreaded "tightly- coupled" applications? I realize one answer is to just stay in winforms. But as one of the last supporters of WebForms (I have much of the same critique of the trend of web developement), i felt a little like a dinosaur as it is when I descovered there's no more WebForms left in the Microsoft certification tracks. Moving forward is the only option, even if I don't like it.


title: Dependent on CVS tagging for automated builds

text: My current work relies on using tags in CVS for an automated build process (ANT currently) to build for respective environments (development, QA, production). From our research, neither Git or Subversion support tagging in the same manner. If we use Subversion or Git, they don't support tags (in the same manner - please correct me?). So how would ANT or Maven know what to pick up for the respective build? ## Example: For a webapp, when viewing our repository say for the web.xml file -- the history would look like:               web.xml  v1     ...     web.xml  v1.2.3  Tag: Prod     web.xml  v1.2.4      web.xml  v1.2.5  Tag: QA     web.xml  v1.2.6     web.xml  v1.2.7  Head      The ANT build scripts are run as CRON jobs, at different times & intervals for different environments. The environment build is based on the repository checkout, based on the tag. Development continues, and eventually the respective tags are moved:               web.xml  v1     ...     web.xml  v1.2.3       web.xml  v1.2.4      web.xml  v1.2.5       web.xml  v1.2.6  Tag: Prod     web.xml  v1.2.7  Tag: QA     web.xml  v1.2.8  Head


title: Storing and accessing settings from database query

text: I am trying to figure out the best way to accomplish this so feel free to criticize my thought process. My tool has different locales and each locale can have different settings for the tool. For example, Arizona could have the top 5 stats turned on where as California does not. I pull all of the settings based on the locale and have an array of the data:                   SimpleXMLElement Object     (         [settings] => Array             (                 [0] => SimpleXMLElement Object                     (                         [settingName] => Home Page Stats                         [settingDescription] => Show the Top 5 Teammate / Teamleader stats?                         [requireValue] => 0                         [localeID] => 14                         [status] => 1                         [value] => SimpleXMLElement Object                             (                             )                              [settingID] => 3                     )                      [1] => SimpleXMLElement Object                     (                         [settingName] => Test                         [settingDescription] => Testing                         [requireValue] => 1                         [localeID] => 14                         [status] => 1                         [value] => 66                         [settingID] => 5                     )                  )          )      What I need to be able to do though is get information based on a current setting. They will never be in the same order so I can't do it by location in the array. I need to be able to access the data based on the setting name. I have tried a few things with iterating over the array and getting the value I need at that time but it seems like its not a great way to do it. Is there a better way to store / access this data? I just need to be able to say `If setting name "Home page stats` has a status of `1` then then get me its value. I feel like I may be making this more complicating than it should be.


title: Are Business Majors considered for Programming Jobs?

text: Are business majors like Marketing relevant for programming jobs. Do employers even consider business degree holders as potential candidates? Let's say, if all I had was a business degree, should I be spending time applying for programming jobs, or should I be doing something else? [Update] I should clarify that I already got the Business degree, and more than half way through the CS one.


title: Algorithm to Find the Aggregate Mass of "Granola Bar"-Like Structures?

text: I'm a planetary science researcher and one project I'm working on is _N_ -body simulations of Saturn's rings. The goal of this particular study is to watch as particles clump together under their own self-gravity and measure the aggregate mass of the clumps versus the mean velocity of all particles in the cell. We're trying to figure out if this can explain some observations made by the _Cassini_ spacecraft during the Saturnian summer solstice when large structures were seen casting shadows on the nearly edge-on rings. Below is a screenshot of what any given timestep looks like. (Each particle is 2 m in diameter and the simulation cell itself is around 700 m across.) ![_N_-body cell of a simulation of Saturn's rings with particles shown as tiny shaded spheres against a black background.](http://i.stack.imgur.com/XUsR7.png) The code I'm using already spits out the mean velocity at every timestep. What I need to do is figure out a way to determine the mass of particles in the clumps and NOT the stray particles between them. I know every particle's position, mass, size, etc., but I don't know easily that, say, particles 30,000-40,000 along with 102,000-105,000 make up one strand that to the human eye is obvious. So, the algorithm I need to write would need to be a code with as few user- entered parameters as possible (for replicability and objectivity) that would go through all the particle positions, figure out what particles belong to clumps, and then calculate the mass. It would be great if it could do it for "each" clump/strand as opposed to everything over the cell, but I don't think I actually _need_ it to separate them out. The only thing I was thinking of was doing some sort of _N_ 2 distance calculation where I'd calculate the distance between every particle and if, say, the closest 100 particles were within a certain distance, then that particle would be considered part of a cluster. But that seems pretty sloppy and I was hoping that you CS folks and programmers might know of a more elegant solution? * * * **Edited with My Solution:** What I did was to take a sort of nearest-neighbor / cluster approach and do the quick-n-dirty _N_ 2 implementation first. So, take every particle, calculate distance to all other particles, and the threshold for in a cluster or not was whether there were _N_ particles within _d_ distance (two parameters that have to be set _a priori_ , unfortunately, but as was said by some responses/comments, I wasn't going to get away with not having some of those). I then sped it up by not sorting distances but simply doing an order _N_ search and increment a counter for the particles within _d_ , and that sped stuff up by a factor of 6. Then I added a "stupid programmer's tree" (because I know next to nothing about tree codes). I divide up the simulation cell into a set number of grids (best results when grid size ≈7 _d_ ) where the main grid lines up with the cell, one grid is offset by half in _x_ and _y_ , and the other two are offset by 1/4 in ± _x_ and ± _y_. The code then divides particles into the grids, then each particle _N_ only has to have distances calculated to the other particles in that cell. Theoretically, if this were a real tree, I should get order _N_ *log( _N_ ) as opposed to _N_ 2 speeds. I got somewhere between the two, where for a 50,000-particle sub-set I got a 17x increase in speed, and for a 150,000-particle cell, I got a 38x increase in speed. 12 seconds for the first, 53 seconds for the second, 460 seconds for a 500,000-particle cell. Those are comparable speeds to how long the code takes to run the simulation 1 timestep forward, so that's reasonable at this point. Oh -- and it's fully threaded, so it'll take as many processors as I can throw at it.


title: When to write an explicit return statement in Groovy?

text: At the moment I am working on a Groovy/Grails project (which I'm quite new in) and I wonder whether it is good practice to omit the `return` keyword in Groovy methods. As far as I know you have to explicitly insert the keyword i.e. for guard clauses, so should one use it also everywhere else? In my opinion the additional `return` keyword increases readability. Or is it something you just have to get used to? What is your experience with that topic? Some examples:               def foo(boolean bar) {         // Not consistent         if (bar) {             return positiveBar()         }         negativeBar()     }          def foo2() {         // Special Grails example         def entitiy = new Entity(foo: 'Foo', bar: 'Bar')         entity.save flush: true         // Looks strange to me this way         entity     }


title: Why special characters are deemed risky in URL and query strings?

text: From a security perspective, the special characters like '&' or `<b>` are a big no no in URLs and query strings. I could find the articles that explained the ways to bypass this restriction, but could find something that explained with example how can this be a security risk. Please explain the risks of these special characters. The question is simpler and I could google a bit more to find the answer. But the reason I am asking it here is that it will help someone in the future. Besides the level of detailing and specification one gets here, cannot be learned anywhere else.


title: How can I make feasible the deployment of my application on the servers

text: I am a Java Web Application Developer. I have an idea for a web application project that I am working on. I personally believe that the app has potential to become a popular website. Currently I am working on it as a developer with two others in the project. The development costs has been almost null uptil now since we are doing in- house development with open source technologies. But the costs are now going to appear as we'll have to host our application online on the servers. Right now I see this as the major expense as we go live. Are there any ways by which we can smartly deal with this hurdle ?   We want to minimize the costs as much as possible, or even better, if we can make this null, perhaps, through some partnership agreement with the hosting solutions provider!? Your opinions are highly solicited!! Please enlighten with your experiences and knowledge. Thanks so much, for your time !


title: What is the most effective/efficient way to develop an application with multiple people without source control?

text: ## Introduction to my situation I work for a small web development company. We have a team of four ASP.NET developers, including me. Almost all of our projects (> 98%) are one-person projects that take about 1-4 weeks to complete. We don't use source or version control. The only thing we have is a shared folder on a local server that contains the latest source (== the source of the live application) of all projects. On the rare occasions that we do need to work on the same project with more than one person, we use... Beyond Compare. One or two times a day the developers ask each other if they have a version that compiles and then they synchronize their code using Beyond Compare. When only two people are working on a project, this works "rather well", but as soon as a third developers enters the process, it becomes an unmanageable piece of rubbish. Especially when everyone starts making changes to the database. I (and one or two of my fellow developers) have already told my boss several times that we should start using some form of source and version control like Git, Mercurial or TFS (our boss is very Microsoft minded). Unfortunately, my boss doesn't see the advantage of switching to a source and version control system, because in his eyes everything works just fine now and he doesn't want to invest time and money in setting up a new system and making sure everyone knows how to use it. Even after I explained the advantages (like simplified collaboration, different versions of an application, safer way to change code, ...) to him, he still doesn't think it is something we need. Of the four developers, only two (including me) have experience with source control (Git). And that experience is _very_ limited. I know how to clone a Github repository to my computer, make some changes, commit them and push them back to Github. That's it. ## Explanation of my problem/concern In a few weeks we are going to start working on a rather big project for our standards. It will probably take 2-3 developers a few months to complete it. I will be the project lead (project manager and lead developer) and I will be responsible for everything. I've had my share of problems with our Beyond Compare approach and I don't want to take this road with this big project that will be my responsibility. Since I doubt that we will be able to   * set up our own Git server,   * teach everyone to work with Git and   * employ Git successfully in this big project, I am interested if any of you know some good ways to allow multiple people to collaborate on the same project without using source or version control. ## Update I would to thank everyone for their answers and comments. Here is the plan:   1. Have a meeting with the developers to make sure all the technical people feel the same way about implementing source control. We'll make a stronger point when everyone is behind it.   2. Present the idea to the boss and tell him that we really _need_ source control.   3. Implement it as soon as possible.


title: Proper use of classes

text: I'm writing a class that draws a very complex image, with multiple parts. I also plan on adding to the class to add more functionality. Would it be right to make a function for each part, even if that function will only EVER be called in the render function? I see an upside to this since it will be easier to read the code, and easier to add parts. A downside however, would be that it would increase complexity and quite possibly make it harder to maintain. Should I keep all the code in the render function, or break apart the different steps?


title: How does the "Fourth Dimension" work with arrays?

text: **_Abstract:_** So, as I understand it (although I have a very limited understanding), there are three dimensions that we (usually) work with physically: The 1st would be represented by a line.   The 2nd would be represented by a square.   The 3rd would be represented by a cube. Simple enough until we get to the 4th -- It is kinda hard to draw in a 3D space, if you know what I mean... Some people say that it has something to do with time. **_The Question:_** Now, though that doesn't all make much sense, that is all great with me. My question isn't about this, or I'd be asking it on MathSO or PhysicsSO. My question is: **How does the computer handle this with arrays?** I know that you can create 4D, 5D, 6D, etc... arrays in many different programming languages, but I want to know how that works.


title: What's the best way to manage error logging for exceptions?

text: **Introduction** If an error occurs on a website or system, it is of course useful to log it, and show the user a polite message with a reference code for the error. And if you have lots of systems, you don't want this information dotted around - it is good to have a single centralised place for it. At the simplest level, all that's needed is an incrementing id and a serialized dump of the error details. (And possibly the "centralised place" being an email inbox.) At the other end of the spectrum is perhaps a fully normalised database that also allows you to press a button and see a graph of errors per day, or identifying what the most common type of error on system X is, whether server A has more database connection errors than server B, and so on. What I'm referring to here is logging code-level errors/exceptions by a remote system - _not_ "human-based" issue tracking, such as done with Jira,Trac,etc.    **Questions** I'm looking for thoughts from developers who have used this type of system, specifically with regards to:   * What are essential features you couldn't do without?   * What are good to have features that really save you time?   * What features might seem a good idea, but aren't actually that useful? For example, I'd say a "show duplicates" function that identifies multiple occurrence of an error (without worrying about 'unimportant' details that might differ) is pretty essential.   A button to "create an issue in [Jira/etc] for this error" sounds like a good time-saver. Just to re-iterate, what I'm after is practical experiences from people that have used such systems, preferably backed-up with _why_ a feature is awesome/terrible.   (If you're going to theorise anyway, at the very least mark your answer as such.)


title: Seeking Mongoose schema design advice

text: I'm having some trouble deciding on a proper way to layout some of my schemas in Mongoose. I have a User schema currently as:               {       name: { type: String, default: "" },       phoneNumber: {type: String, required: true, unique: true },       contacts: { type: [ObjectID], ref: 'User', index: true },       ...     }      But I am curious if removing contacts from the user schema and having another collection (Contacts) like the following isn't a better idea:               {       user: { type: ObjectID, ref: 'User', index: true },       contact: { type: ObjectID, ref: 'User', index: true }     }      Where each entry would compose a composite key. Two questions pop to mind when I would need to query the data.   1. Who are user `x`'s contacts?   2. Which users have user `x` as a contact? (My reason for this post) I've tested my current setup, option 1, with about 1 million users with 100 contacts each and the index created on the contacts field is about 3GB with fast search results for question 2 (< 80ms). However, I'm not certain if it's the right approach or if that index size is acceptable. I want to lean towards option two and normalize the data, but am I right to do so in this case?


title: In terms of Software, what constitutes a quality control plan for ISO 9001 compliance?

text: I am bidding on a government contract (my first) and there is a section requesting that I provide a high-level outline of a quality control plan that would ensure that the end product is ISO-9001 compliant. I don't know much about ISO 9001 so I am certainly doing my own homework and research on this, but thought I would ask the question here in case there happens to be someone very knowledgeable in the area who could provide 5-10 broad bullet points on which I should focus.


title: PHP Drupal alternatives

text: Based off answers to this question: Will I pick bad coding habits from PHP books? and many others it is a general consensus that PHP is not the most well suited language for web development anymore (if you are not completely knowledgeable about the language). I use Drupal and write custom modules in PHP, does this viewpoint of PHP being an ill fitted web coding language also apply to Drupal based PHP sites? I generally build community sites and intra-company sites, are there better means of building these than with PHP and drupal frameworks?


title: How signing out a CLA prevents legal issues in open-source projects?

text: For example: yeoman. It's licensed under a BSD license. The CLA form (Contributor License Agreement) isn't project specific, and it can be signed electronically.   * How and what issues can signing out this agreement prevent?    * Does it matter how big or minor contribution I made?   * Why some projects require signed CLA to accept patches, while others don't? (eg. node.js vs rails)


title: Achieving decoupling in Model classes

text: I am trying to test-drive (or at least write unit tests) my Model classes but I noticed that my classes end up being too coupled. Since I can't break this coupling, writing unit tests is becoming harder and harder. To be more specific: **Model Classes:** These are the classes that hold the data in my application. They resemble pretty much the POJO (plain old Java objects), but they also have some methods. The application is not too big so I have around 15 model classes. **Coupling** : Just to give an example, think of a simple case of Order Header -> Order Item. The header knows the item and the item knows the header (needs some information from the header for performing certain operations). Then, let's say there is the relationship between Order Item -> Item Report. The item report needs the item as well. At this point, imagine writing tests for Item Report; you need have a Order Header to carry out the tests. This is a simple case with 3 classes; things get more complicated with more classes. I can come up with decoupled classes when I design algorithms, persistence layers, UI interactions, etc... but with model classes, I can't think of a way to separate them. They currently sit as one big chunk of classes that depend on each other. Here are some workarounds that I can think of:   1. **Data Generators** : I have a package that generates sample data for my model classes. For example, the OrderHeaderGenerator class creates OrderHeaders with some basic data in it. I use the OrderHeaderGenerator from my ItemReport unit-tests so that I get an instance to OrderHeader class. The problem is these generators get complicated pretty fast and then I also need to test these generators; defeating the purpose a little bit.   2. **Interfaces instead of dependencies** : I can come up with interfaces to get rid of the hard dependencies. For example, the OrderItem class would depend on the IOrderHeader interface. So, in my unit tests, I can easily mock the behaviour of an OrderHeader with a FakeOrderHeader class that implements the IOrderHeader interface. The problem with this approach is the complexity that the Model classes would end up having. Would you have other ideas on how to break this coupling in the model classes? Or, how to make it easier to unit-test the model classes? * * * **Update after going through the answers:**   * I have done a little more thinking on this problem and noticed that some of these dependencies were not really necessary (as most answers pointed out). The reason why they existed is because my UI layer needed it. Basically, I have inserted these dependencies so that UI layer can easily navigate from child to the header and display some header fields at the child level views. Looking at it now, it looks so simple; however it took some time for me to figure out why these dependencies existed in the first place. Now, the UI will basically keep the header in its context when navigating to the child level views.   * On the other hand, I have removed some of the dependencies via interfaces. These dependencies were mostly one-to-one; for example between Header and HeaderReport. Previously, HeaderReport depended on Header for retrieving information (items, date, etc...) and this made HeaderReport very hard to test. Now, the HeaderReport depends on the HeaderDataProvider interface and I am able to achieve complete isolation. HeaderReport is very easy to test with stub classes for the HeaderDataProvider interface.   * It looks easy to create these abstractions (UI Layer - Model Layer - Backend Layer), however in reality, it really takes a lot of practice!


title: What does the arrow mean in a Class Diagram?

text: I need help trying to understand what the meaning of the arrow in a UML Class Diagram is, more specifically in this Composite Diagram. What's the difference between the simple line (from a class to another one) and the arrow (not the inheritance arrow, I refer to the black one)? ![UML Class Diagram](http://i.stack.imgur.com/nip2w.jpg)


title: How to structure a set of RESTful URLs

text: Kind of a REST lightweight here... Wondering which url scheme is more appropriate for a stock market data app (BTW, all queries will be GETs as the client doesn't modify data): Scheme 1 examples:               /stocks/ABC/news     /indexes/XYZ/news     /stocks/ABC/time_series/daily     /stocks/ABC/time_series/weekly     /groups/ABC/time_series/daily     /groups/ABC/time_series/weekly      Scheme 2 examples:               /news/stock/ABC     /news/index/XYZ     /time_series/stock/ABC/daily     /time_series/stock/ABC/weekly     /time_series/index/XYZ/daily     /time_series/index/XYZ/weekly      Scheme 3 examples:               /news/stock/ABC     /news/index/XYZ     /time_series/daily/stock/ABC     /time_series/weekly/stock/ABC     /time_series/daily/index/XYZ     /time_series/weekly/index/XYZ      Scheme 4: Something else??? The point is that for any data being requested, the url needs to encapsulate whether an item is a Stock or an Index. And, with all the RESTful talk about **resources** I'm confused about whether my primary **resource** is the **stock & index** or the **time_series & news**. Sorry if this is a silly question :/ Thanks!


title: How to test generated file without hardcoding name generation logic?

text: I have a unit I'm testing which generates a file name and saves something there. I will need to pull the file out of that location to test it was stored right. I know how the file name is generated, however, hardcoding the logic for file name generation throughout my tests feels like a 'Magic Number' to me. Is there a better approch? I thought of pulling the logic that generates the path name out into it's own helper method in the unit I'm testing, and testing that method once, then using that method when I need a path name. Then I only 'hardcode' the path generation logic in one test where it seems reasonable. However, if I did pull that method out it would usually be a private method, which brings up the whole question as to how to test it, rather it's fair to make it public just for testing, and is it a code-smell to be testing helper functions at all. What is the most elegant way of testing something like this? just hardcode it?


title: Why did GCC switch from Bison to a recursive descent parser for C++ and C?

text: Was there a language change that required it or some practical reason why Bison was no longer appropriate or optimal? I saw on wikipedia that they switched, referring to the GCC 3.4 and GCC 4.1 release notes. These release notes state: > A hand-written recursive-descent C++ parser has replaced the YACC-derived > C++ parser from previous GCC releases. The new parser contains much improved > infrastructure needed for better parsing of C++ source codes, handling of > extensions, and clean separation (where possible) between proper semantics > analysis and parsing. The new parser fixes many bugs that were found in the > old parser. And: > The old Bison-based C and Objective-C parser has been replaced by a new, > faster hand-written recursive-descent parser What I would like to know is what actual problems were they having and why it was impossible / impractical to solve using Bison


title: Is there a programming language with not a tree but tags idea behind OOP?

text: I'm thinking about tree structures, and I feel that I don't like them. It's like when you have a shop, then you try to put all products to tree-like catalog, and then you need to place one product to multiple categories, now you have multiple routing, bla-bla. I don't feel like everything in the world could be put to a tree. Instead, I like idea of tags. I would like to store everything with tags. With tags I could do much more. I can even simulate trees if I want. I want to have tag-based filesystem! But hey - modern OOP paradigm with inheritance is based on tree. I want to see how it is when you don't have such basement. Closest thing I found is mixins in some languages. Do you know what else is also about this ideas?


title: From a technical point of view, could JavaScript be compiled instead of interpreted?

text: The question title speaks for itself. I'm specifically thinking in terms of a Node.js server. Additionally, this question is assuming that you don't need `eval()`. Also, if this is not possible, why not?


title: Do you know any resources to learn design for a programmer?

text: Meanwhile I'm waiting for Design for Hackers do you know any good design resources, as many I love designs by 37signals and I'd like to start making my websites look like that.


title: How can i print multiple jasper report in single page of PDF

text: I can print multiple report in single PDF file . using :               JasperReport jreport1 = JasperCompileManager.compileReport("D:\\FTP\\JRXML\\PatientConsultantReport\\"+checkedReport+".jrxml");     JasperPrint jprint1 = JasperFillManager.fillReport(jreport1, new HashMap(), new JRResultSetDataSource(rs));     jprintlist.add(jprint1);               .              So ON               .               .     jprintlist.add(jprint5);              JRExporter exporter = new JRPdfExporter();                     exporter.setParameter(JRPdfExporterParameter.JASPER_PRINT_LIST, jprintlist);                     OutputStream output = new FileOutputStream(new File("D:\\FTP\\PDF\\VisitsSummaryReport.pdf"));                     exporter.setParameter(JRPdfExporterParameter.OUTPUT_STREAM, output);                     exporter.exportReport();      So Question is : (here for each report it going to add new page in my pdf.) How can I print all data of this all report on single page of PDF .


title: How do I avoid duplicating utility functions across modules?

text: I've seen this question but it doesn't help me because I'm writing functional code (Standard ML) and the answers there are heavily focused towards OOP (the OP is advised to use the Facade pattern, to use inheritance, etc -- answers that are not relevant to an SML programmer). In two separate, largely unrelated modules, `Foo` and `Bar`, I need to accomplish the same task: given functions `equal` and `equals` with the signatures:               val equal: t * t -> bool     val equals: t list * t list -> bool      make two new functions with the following signatures:               val equal': t * t -> t option     val equals': t list * t list -> t list option      Here, `t` stands for either `Foo.t` or `Bar.t`. The natural solution is to use a higher order function:               local       fun boolToOpt (comparison: ('a * 'a) -> bool) (left, right) =         if comparison (left, right) then           SOME left         else           NONE     in       val equal' = boolToOpt equal       val equals' = boolToOpt equals     end      I need to repeat exactly this code snippet in both modules. Now, this is a tiny, minor implementation detail, and it would be a bad idea to let it be publicly visible from either `Foo` or `Bar`. At the same time, it seems too small -- and too tightly coupled to the two `equal(s)` functions -- to be factored out in to a module of its own. Maybe in another language, the `equals'` functionality would merit its own class, say, `ComparisonDecorator`, that overrides `equal(s)` to give me functions with the return type `t option`, but that's not an option here. I run in to situations like these at least once per day. Is there a sane way to avoid just copy+pasting here?


title: Why isn't software as reliable as a car?

text: I had a user ask me this question. We know that cars break down, but **that's because of something physical** (unless software is involved!). I tried to answer that software is a much younger industry, but the user countered with "didn't the automobile industry become much more stable than and reliable with less people?". I also tried to answer that software is more complex, but the user countered that there are many thousands of parts that make up a car. People that design and build cars generally just know their component(s) very well, but they still all end up working together as an end result. So, **why isn't software as reliable as a car?**


title: File Uploading Speed Difference Between Eclipse environment and Deploy to tomcat webapps folder

text: Hello I have used `File Upload` in `struts2` with `commons-fileuplod` . Edit : When i run my demo from `eclipse with right click and run on server` so time taken to upload File is very small               **Run From ECLIPSE :**         File Size : 247 MB         Time TAken By upload using Run On server From eclipse  :--> 2989 MS      On other side when i `deploy same demo war file to Tomcat in webapps folder` and run . So it take more time to upload file compare to previous case . (Why this big time difference ?)               **Run Using Deploy Demo In Tomcat :**     File Size : 247 MB     Time TAken By upload By deploed war file to tomcat web apps folder  :--> 14162 MS      I have change `java.io.tmpdir` in `MonitoredMultiPartRequest.java`:                       System.setProperty("java.io.tmpdir", "D:\\ankit");             System.out.println("java.io.tmpdir :--> " + System.getProperty("java.io.tmpdir"));                  UploadListener listener = new UploadListener(servletRequest);             // Create a factory for disk-based file items             FileItemFactory factory = new MonitoredDiskFileItemFactory(listener);             // Create a new file upload handler             ServletFileUpload upload = new ServletFileUpload(factory);                  try{                 long start = System.currentTimeMillis();                 List items = upload.parseRequest(servletRequest);                 long end = System.currentTimeMillis();                 System.out.println("Time TAken By upload 3.2.1 :--> " + (end - start));                 getsystemDetail();           } catch (Exception e){             errors.add(e.getMessage());         }      Here I mention My Log: **Run From ECLIPSE :**               ==== System Property =========     java.io.tmpdir :--> D:\ankit     ================================     Time TAken By upload File :--> 2989     ==================================     ##### Heap utilization statistics [MB] #####     Used Memory:46     Free Memory:85     Total Memory:132     Max Memory:675     File system root: C:\     Total space (mb): 79899     Free space (mb): 31833     Usable space (mb): 31833     File system root: D:\     Total space (mb): 158472     Free space (mb): 117366     Usable space (mb): 117366     This is ServletContext RealPath path ::--> D:\eclipseWorkSpace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\FILEUPLOAD_DEMO_OldLIB\     File Uploaded Succ. TO ::-> D:\ankit\eclipse.zip      **Run Using Deploy Demo In Tomcat :**               ==== System Property =========     java.io.tmpdir :--> D:\ankit     ================================     Time TAken By upload File :--> 14162     ==================================     ##### Heap utilization statistics [MB] #####     Used Memory:100     Free Memory:31     Total Memory:132     Max Memory:1820     File system root: C:\     Total space (mb): 79899     Free space (mb): 31830     Usable space (mb): 31830     File system root: D:\     Total space (mb): 158472     Free space (mb): 117358     Usable space (mb): 117358     This is ServletContext RealPath path ::--> D:\tools\tomcat7-6\webapps\FILEUPLOAD_DEMO_OldLIB\     File Uploaded Succ. TO ::-> D:\ankit\eclipse.zip


title: Floating point number to binary

text: Which Algorithm does java uses to convert floating point number (Ex:0.15625) into binary(0.00101). Whether java uses normalized form or denormalized format ? If i type "float ab=0.15625" in java source file, which program will convert that floating point number into a format that could be stored in memory ?


title: XNA Buffer Best Practice

text: I am currently converting a 2D game to 3D, never having worked with 3D before I am trying to learn as I go. I am wondering what the best way to use vertex/index buffers is. Currently I am looping through a grid and creating a set of buffers for each tile type, these are then used in the draw method. Im presuming I shouldnt use multiple sets of vertex buffers but dont know of another way to do this, as each tile is a different texture. Grid loop               for (int i = Convert.ToInt32(xPos / 2) - 30; i < Convert.ToInt32(xPos / 2) + 30; i++)             {                 for (int a = Convert.ToInt32(yPos / 2); a < Convert.ToInt32(yPos / 2) + 50; a++)                 {                     if (mapXtile > 0 && mapYtile > 0 && mapXtile < Globals.mapsizex && mapYtile < Globals.mapsizey)                     {                         int currentTile = Globals.levelArray[level, mapXtile, mapYtile].TyleType;                              if (currentTile == tyleType.grass)                         {                             createCubeVertices(i * 2, a * 2, 1, 0f, count, grassVertices);                             SetUpBufferIndices(count, grassIndices);                             count++;                         }                              if (currentTile == tyleType.water)                         {                             createCubeVertices(i * 2, a * 2, 1, 0f, count, waterVertices);                             SetUpBufferIndices(count, waterIndices);                             waterCount++;                         }                     }                     mapYtile = mapYtile + 1;                     //mapYtile++;                 }                 mapXtile = mapXtile + 1;                 mapYtile = Convert.ToInt32(yPos / 2);             }     CopyToBuffers(grassVertices, grassIndices);     CopyToWaterBuffers(waterVertices, waterIndices);      Draw code                  foreach (EffectPass pass in grassEffect.CurrentTechnique.Passes)             {                 pass.Apply();                      device.Indices = myIndexBuffer;                 device.SetVertexBuffer(myVertexBuffer);                 device.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, grassVertices.Length, 0, grassIndices.Length/3);               }                  foreach (EffectPass pass in mouseEffect.CurrentTechnique.Passes)             {                 pass.Apply();                      device.Indices = myWaterIndexBuffer;                 device.SetVertexBuffer(myWaterVertexBuffer);                 device.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 10000, 0, 10000);             }      Any advice is greatly appreciated.


title: Simple unicode application?

text: I want to create simple language learning applications to help friends in learning languages. A simple Java console application would do the trick, but the Windows console does not seem to handle Unicode (and I need my software to work with all kinds of special letters at once). Googling it, I get the idea there might be ways to actually make Unicode work in the Windows console, but it seems a bit overly complex, plus that it requires some effort from anyone running the program. I want to write programs that anyone without computer experience can run easily. I wanted to try doing this in Python instead, as the IDLE console at least seemed to work with Unicode. But it has its own set of problems (I can't enter certain letters, like the é, without writing it elsewhere and pasting it in) Now I'm considering building this as a web application or Swing application, to actually be able to make my program work with Unicode. But I feel I'm maybe overlooking something. Is there no easy way to make a Unicode console application that'd work on Windows?


title: How can a programmer keep up with the hardware world?

text: I think that it's safe for me to assume that many, if not most, programmers are quite enthusiastic about computers, and even electronics in general. Now, I realize that a programmer should first and foremost keep up with the **programming** world, which is a difficult task in and of itself: with new languages and methodologies making their way into the fray every year, there is never a shortage of interesting things to learn about and try out. Yet, the hardware world is also advancing very quickly, and is also highly interesting, I'd argue. I recall days when I would study the newest chipsets, CPUs, compare the popular (and not so popular) manufacturers, and read up on specs for my favorite graphics cards. However, since that time, I've stopped keeping up with the hardware that is being developed, and have instead focused my studies and attention on, well, programming. I still intend to focus myself on programming, by and large. But, my question is, are there efficient / effective methods or learning resources that would make it easier for a programmer to keep up with the latest hardware, if only in a minimal way?


title: Factory Design pattern in languages with class types

text: I was reading in Peter Norvig's Design Patterns presentation. From slide 13: > Dynamic version needs only the Window classes. > > The classes themselves serve as factories > > This works because classes are first-class values We can say `make(c)` Does it mean that Java and C# don't need the factory design pattern since they can pass around class type as a variable.


title: Should I use acronyms when listing technical jargon on my résumé?

text: I'm wondering if I should use acronyms or initialisms when I list technical qualifications or mention specific technologies on my résumé or CV. For example:   * _Entity Framework_ vs. _EF_ vs. _EF (Entity Framework)_   * _Graphical User Interface_ vs. _GUI_ vs. _GUI (Graphical User Interface)_ Is there a reason to prefer one version over another? Is it better to be as clear as possible, companies view not using the correct acronym a sign of lack of knowledge about the subject?


title: What kinds of visual content, tables or diagrams might I want to include in my Project Architecture Document?

text: Besides logical and physical architecture diagrams, comps / mockups and tables for expected network load between components and various data schemas, what kinds of visual content, tables or diagrams might I want to include in my Project Architecture Document? The specific project is an integration of 3rd party social networking features into a fashion site. Please post example graphics. Thanks.


title: Mobile Apps developement for Web Developer

text: I have been working in asp.net from past 5 years. I have so far liked it. But I am seeing a new boom in the market. And its not all about money. People are going towards iphone developement and android developement. since I have not done developments in both. so was wondering if it is better to stay where and what I am doing or take a risk and should try to learn these technologies and jump with new job. Would my web development background anyhow support this new learning?


title: Product Configuration with conditional options

text: Suppose you need to create a website where you can choose a Widget, and then configure all of the various options to go with that widget. The options have many interactions. For example, if you choose to add Wheels to your Widget, this should enable the selection of which Rims you would like. However, if the user selects an Orange colored Widget, the Alloy Rims are not available. I'm am struggling with the best way to design my tables and code to enforce these restrictions and conditions governing these options while remaining flexible for future Widgets. New widgets are going to come along every year where these options and their restrictions / conditions need to be added for the new products, so I'm trying to avoid hard-coding these types of things. At the same time, it is difficult to picture a data model in a database for governing these conditions / interactions. Some of them may be simple (Option A enables Option D and E), and some of them may be very complex (Option A plus Option B plus a quantity of 10 widgets disables Option Z, but enables Option X). I get the feeling that this sort of option-interaction logic belongs in a "Business Rules" type of layer. Is this a scenario that any of you have tackled before, and if so did you find a quality / flexible method of handling these types of things?


title: How can we deal with experiental gaps in learning of programmers or any technology field?

text: This problem is a re-occuring one in my experiences. That of the ability to learn from other people's experiences, and being able to share what I have learned. Part of the problem of this learning process, is the dependence on experience. If for example, you've never had many jobs cleaning up other people's code for ease of readability, better written queries, and better logic, and validation practices, you might not have had developed the same practices and behaviors I have, in how I write my code. This is what I call the "Experiental Gap". It is very hard for people who haven't had the exact same experiences I have had to understand the reasoning why I have adopted the techniques and methods I have had. Take as an example, source control, which is on the famous "Joel Test" as just one of the 12 items there. Let's say you have worked with a wide variety of source control software/applications, not married to any of them, just want to use one that works. And have experienced a lot of the painful errors and problems that occur from not having source control. Then how can you explain to someone who has never experienced those same problems, why source control is important and why they need to adapt it immediately. This question is not about source control, that is just an example I am using to help illustrate the problem of communicating best practices or methods of any kind, when the reason we adopted them is mostly because of our personal work experiences. Then when we meet someone that we see needs to adopt some of what we think is core, must have practices, and they have not had our experiences, it becomes nearly impossible to persuade or educate those people. It's not because they are dumb or uneducated or stupid. It is because of the "Experiential Gap" So now brings to the point of this question, because I want to be able to discuss and learn from other people how they have overcome this gap? How do you teach or learn when you may not understand why you need to learn things or teach things. Another example, I for years, have been anti-oo, anti-cfc's, (Used In ColdFusion). And then got into many flame wars because those people who have had the painful experiences could not persuade me of the importance of that. And since i wasn't in a situation where I could experience what they had, this made for a very frustrating experience for both of us. I didn't understand the need for the best practice. And they couldn't understand why I didn't get it. So how can we overcome this gap which is a key part of our learning process. Most of us, or a huge chunk of us, learn by self-teaching, reading, practicing. This can be good and bad, but doesn't help us learn how to learn, or what to learn. Because then each of us have had different jobs with different skills and different experiences, then we each learn from those experiences, and can't really relate very well to people who haven't been what we've been through. This is a very big but subtle problem, I think it needs to be addressed, if not by me, by someone more educated or experienced than I am. I only want to help, us all learn more and learn from each other more easily.. Thanks...I hope this re-write is better. Thank You.


title: Are there theoretical reasons why arrays in C take less RAM than Java?

text: My experience is that Java requires about twice as much RAM compared to C (comparing char arrays or other comparisons). I also read in a hardware book that Java takes about twice RAM than C. Is is based solely on empirical evidence or also has a theoretical explanation? Is there a theoretical limit that limits Java from minimizing its memory usage?


title: Innovation on CS

text: its been some time that i've been thinking about creating something that could help the web community and leave some mark, but the problem that there are no ideas poping out of my head. So 2 questions comes to my mind: First, how did projects like Twitter, Google or any other big project that had changed our way of living in the internet get started? Secondly, do we have to force it or just keep doing what we do best and wait to that idea that could change things? While writting this question, one quote come to mind: > Imagination is more important than knowledge > > **Albert Einstein**


title: How are you using the Managed Extensibility Framework?

text: I have been working with MEF for about 2 weeks. I started thinking about what MEF is for, researching to find out how to use MEF, and finally implementing a Host with 3 modules. The contracts are proving to be easy to grasp and the modules are easily managed. Although MEF has a very practical use, I am wondering to what extent? I mean, _is everyone going to be rewriting existing applications for extensibility?_ Yes, that sounds, and is insanely impractical. Rhetorically speaking:   * how is MEF affecting the current trends in programming?   * have you begun looking for opportunities to use MEF?   * have you begun planning a major re-write of an existing app that may benefit from extensibility? That said, my questions are:   **_how do I know when I should plan a new project with extensibility?_**   **_how will I know if an existing project needs to be re-written for extensibility?_** _**Is anyone using MEF?_**


title: Correct process for creating builds reliant on 3rd party packages

text: I work on a Symfony 2 codebase. We use a number of third-party packages (most are in the Symfony Standard Edition). We use composer for dependencies. We current have all of our third-party code committed in our repository (after changing .gitignore files) to ensure stability. According to Proper Programming Practices™, we are not supposed to have any third-party packages in our repo. We are supposed to pull them down and include them at build time. How are we to do proper QA and debugging when at any given time our dependencies could push an update that breaks functionality?


title: Multidimensional multiple-choice knapsack problem: find a feasible solution

text: My assignment is to use local search heuristics to solve the Multidimensional multiple-choice knapsack problem, but to do so I first need to find a feasible solution to start with. Here is an example problem with what I tried so far. ## Problem                          L1  L2  L3          RESOUCES : 8   8   8          GROUPS:              G1:                      11.0    3    2    2                 12.0    1    1    3              G2:                      20.0    1    1    3                 5.0     2    3    2              G3:                      10.0    2    2    3                 30.0    1    1    3      * * * ## Sorting strategies To find a starting feasible solution for my local search I decided to ignore maximization of gains and just try to fit the resources requirements. I decided to sort the choices (strategies) in each group by comparing their "distance" from the multidimensional space origin, thus calculating `SQRT(R1^2 + R2^2 + ... + RN^2)`. I felt like this was a keen solution as it somehow privileged those choices with resouce usages closer to each other (e.g. R1:2 R2:2 R3:2 < R1:1 R2:2 R3:3) even if the total sum is the same. Doing so and selecting the best choice from each group proved sufficent to find a feasible solution for many[30] different benchmark problems, but of course I knew it was just luck. So I came up with the problem presented above which sorts like this:                          L1  L2  L3          RESOUCES : 8   8   8          GROUPS:              G1:                      12.0    1    1    3 < select this                 11.0    3    2    2              G2:                      20.0    1    1    3 < select this                 5.0     2    3    2              G3:                      30.0    1    1    3 < select this                 10.0    2    2    3      And it is not feasible because the resources consmption is R1:3, R2:3, **R3:9**. The easy solution is to pick one of the second best choices in group 1 or 2, so I'll need some kind of iteration (local search[?]) to find the starting feasible solution for my local search solution. Here are the options I came up with **Option 1: iterate choices** I tried to find a way to iterate all the choices with a specific order, something like               G1   G2   G3     1    1    1     2    1    1     1    2    1     1    1    2     2    2    1     ...      believeng that feasible solutions won't be that far away from the unfeasible one I start with and thus the number of iterations will keep quite low. Does this make any sense? If yes, how can I iterate the choices (grouped combinations) of each group keeping "as near as possibile" to the previous iteration? **Option 2: Change the comparation term** I tried to think how to find a better variable to sort the choices on. I thought at a measure of how "precious" a resource is based on supply and demand, so that an higer demand of a more precious resource will push you down the list, but this didn't help at all. Also I thought there probably isn't gonna be such a comparsion variable which assures me a feasible solution at first strike. I there such a variable? If not, is there a better sorting criteria anyways? **Option 3: implement any known sub-optimal fast solving algorithm** Unfortunately I could not find any of such algorithms online. Any suggestion? * * * ## EDIT **NOTE: I updated the previous description using labels L1 L2 L3 for the problem resource limits in place of R1 R2 R3 which now indicate the resource requirements of each strategy (choice)** Fallowing the input by @J Trana, I decided to go and try a genetic algorithm for the problem setup. This seemed quite fitting to the problem structure as each Group is a Gene, each Solution is a Chromosome and each Strategy is an Allele. I also modified the distance expression to fit better with heterogeneous resource limits, so now the distance is : `SUM(Rn/Ln)` which should give a lower distance (i.e. higher priority) to those strategies with lower resource requirement portions. Since this part is intended only for solving initialization, I chose the fallowing genetic functions: ## Fitness               // if solution is feasible, that's just enough, it has the greatest fitness possible     if(solution.isFeasibleInProblem()) return Integer.MAX_VALUE;          ArrayList<Integer> consumptions = new ArrayList<Integer>();          for(Integer limit : problem.resourceLimits){         consumptions.add(0);     }          // add the resources consumptions from each group     for(Group g : genes){         for(int i = 0; i < g.currentSelectedSolution.resourceRequirements.size(); i++){             consumptions.set(i, consumptions.get(i) + g.currentSelectedSolution.resourceRequirements.get(i));         }     }          ArrayList<Double> subFitnesses = new ArrayList<Double>();          // each subFitness is the ratio between the total limit and the actual consumption     // this way if the consumption is < limit subFitness is greater than 1 (rises the fitness), else it is less than 1 and lowers the fitness     for(int j = 0; j < consumptions.size(); j++){         double subFitness = problem.limits.get(j) / consumptions.get(j);         subFitnesses.add(subFitness);     }          double fitness = 1;          for(Double sF : subFitnesses){         fitness *= sF;     }          return fitness;      So resource requirements lesser than the limit rise the fitness, where requirements greater than the limit lower the fitness. ## Mutation For the mutation function I found that feasible solutions contain strategies with smaller distance and considering solutions far down in the ordered distance list slows the evolution because most of the time those mutations have negative effects.               public void mutate(int strategyIndex, double mutationIntensity){              // if there's no choice, don't mutate         if(this.strategies.size() <= 1) return;              ... here I'd need something that keeps in the first positions of the list         but eventually, with higher mutation intensities, goes to greater indexes...              selectStrategy(newStrategyIndex);          }      * * * The above solution works very well for most of the benchmarks, but there are 2 of them, having a lot of choices per group and a lot of resources per choice, that simply won't find a feasible solution. How could I implement the mutation algorithm so that those 2 benchmarks convert to a feasible solution? Is there any improvement I can put in my fitness function or in the strategy ordering to speed up the solving path?


title: What is the benefit of the 'free-to-deobfuscate' model over open-source?

text: Some applications (for example Minecraft) have the 'free-to- deobfuscate'-model. It means that you are free to make and distribute changes to the applications code, but you must decompile and deobsuscate the application first. This makes less than zero sense to me. Isn't the whole point of obfuscation the prevention of people messing with your code? Why not just use the open- source model?


title: Have you worked with a well designed application?

text: Inspired by this question, I started wondering - is there or has there ever been such a thing as a "well designed application"? One where the architecture would be perfect and no refactoring would ever be needed; code would be easy to read and understand even for someone new to the project; changes could be done with a 100% certainty that they won't break anything; etc? I must admit that whatever codebases I've worked with, they've all been more or less a mess. Even code that I start myself only stays organized at the start, and then slowly deteriorates as the time passes. I'm even starting to accept this as part of life and can't figure out whether I should be worried about that or not. So... is there such a thing as a "well designed application"? Or is all our code so shitty that there isn't even a point in trying to make it better, because it will never be good anyway?


title: GPL in the workplace?

text: I once interviewed at a consulting company where it came up in the conversation that they use open source products (which is great, I've used Hibernate, JBoss, etc. extensively.) One thing that did surprise me is that when I asked if they used GPL licensed OSS when writing applications for clients, they said "Sure, all the time! As long as the client gets what they want and are happy." Now, I'm no lawyer or big license buff, but I was under the impression that using GPL code (let's say some library that you include), then you are required to release the entire application under the same license. When I pointed this out, I was given a quick response of, "Well, we give the clients all the source code when we're done, so that's really not an issue." Not wanting to press the issue further (interviews aren't the place for arguments like that), I let it slide. However, that still concerns me about that particular practice of the business. What is the official word on GPL licensed code and how "open" does it need to be? Do you have to publish it and say "My company used this library so here is the site where you can download our shopping and order fulfillment system application that we spend millions of dollars to build."? In this situation, is the company right for using GPL code without the client's knowledge? Is it enough to just "give them the source"?


title: unseen/unknown function definition in linux source

text: Can any one please explain this piece of code I found in the linux kernel source. I see a lots of code like this in linux and minix kernel but dont seem to find what it does (even if C compilers support that kind of function definition)               /* IRQs are disabled and uidhash_lock is held upon function entry.      * IRQ state (as stored in flags) is restored and uidhash_lock released      * upon function exit.      */     static void free_user(struct user_struct *up, unsigned long flags)     __releases(&uidhash_lock)     {     uid_hash_remove(up);     spin_unlock_irqrestore(&uidhash_lock, flags);     key_put(up->uid_keyring);     key_put(up->session_keyring);     kmem_cache_free(uid_cachep, up);     }      I cannot find out if this reference `__releases(&uidhash_lock)` before the parenthesis starts is allowed OR supported. (It sure is supported as it is in the linux kernel)


title: reference datatype javascript

text: In javascript, what is the difference in applying a toString() method to the primitive datatype, number like this               var myString = myNumber.toString();      and applying the same toString() method by creating a reference datatype equivalent, the Number class like this               var numberObject = new Number(myNumber);     var myString = numberObject.toString();


title: ISO 12207: Verification of integration and Unit test validation

text: I have received comments from the supervisor reviewing my thesis. He asked two questions I cannot answer right now:   1. If ISO 12207 says under "Integration verification" that it "checks that components are correctly and completely integrated into a system", how this can be verified without testing, if all testing is validation? How without testing can I know that system is integrated correctly and fully?   2. If unit testing is validation, how does it match the ISO definiton of validation "that requirements for intended use were fulfilled" if its so low level?


title: projective geometry: how do I turn a projection of a rectangle in 3D into a 2D view

text: So the problem is that I have a 3D projection of a rectangle that I want to turn into 2D. That is I have a photo of a sheet of paper laying on a table which I want to transform into a 2D view of that sheet. Thus, what I need is to get an un-distorted 2D image by reverting all the 3D/projection transformations and getting a plain view of the sheet from the top. I happened to find some directions on the subject but they don't suggest an immediate instruction on how this can be achieved. It would be really helpful to get a step-by-step instruction of what needs to be done. Or, alternatively, a link on a resource that breaks it down to little details.


title: Are there any conceptual drawbacks to building a web app with C++ and MySQL?

text: I've inherited a pretty interesting project where there is a good opportunity to take an existing piece of software and turn it into a SaaS web app. As the project is inherited, the code base/ framework is already defined as C++ and MySQL. The app itself is compiled and run as an EXE on Windows Server. The UI is web based and the app works as a kind of server. From what I do know of modern web apps, this is perhaps an unusual choice. These days, most people seem to opt for a PHP framework or Ruby on Rails. Certainly that is the impression I get from reading blogs on the subject. So, I'm very interested to know if a C++ EXE backed by MySQL is a solid foundation for a web app, or whether we should be looking to build in another way?


title: CppUnit for unit-testing executable files?

text: I am not sure if anyone has done it. I am trying to do something that is in general, uncommon i.e. unit-testing executable (Windows) or ELFs (Linux). I know that CppUnit provides a good unit testing facility, but I have never used it for unit-testing (used UnitTest++). I hear rumours that you can unit-test executables too. Does anyone have the experience in this? _A relevant post regarding the philosophy of it washere_


title: Programming C++ using Qt4

text: Hey guys I am really new to the C++ programing I have a little knowledge in C and a bit more in C++, but I do not know them enough to call myself a programmer. I am working as a PHP Web Developer I like being a crafts man and creating things so that is the reason to combine the programming with web development. I think that I could really benefit from both of them and so... My question is:   * Is it a good Idea to learn C++ with Qt or not?   * Can you give me pros and cons of both? **Note** : _I do not want to become a programmer and give up the web development I want to combine them both._


title: How should I track approval workflow when users at every security level can create a request?

text: I am writing a new application that allows users to enter requests. Once a request is entered, it must follow an approval workflow to be finally approved by a user the highest security level. So, let's say a user at Security Level 1 enters a request. This request must be approved by his superior - a user at Security Level 2. Once the Security Level 2 user approves it, it must be approved by a user at Security Level 3. Once the Security Level 3 user approves it, it is considered fully approved. However, users at any of the three Security Levels can enter requests. So, if a Security Level 3 user enters a request, it is automatically considered "fully approved". And, if a Security Level 2 user enters a request, it must only be approved by a Security Level 3 user. I'm currently storing each approval status in a Database Log Table, like so:               STATUS_ID (PK) REQUEST_ID    STATUS           STATUS_DATE     -------------- ------------- ---------------- -----------------------     1              1             USER_SUBMIT      2012-09-01 00:00:00.000     2              1             APPROVED_LEVEL2  2012-09-01 01:00:00.000     3              1             APPROVED_LEVEL3  2012-09-01 02:00:00.000     4              2             USER_SUBMIT      2012-09-01 02:30:00.000     5              2             APPROVED_LEVEL2  2012-09-01 02:45:00.000      My question is, which is a better design:   1. Record all three statuses for every request ...or...   2. Record only the statuses needed according to the Security Level of the user submitting the request In Case 2, the data might look like this for two requests - one submitted by Security Level 2 User and another submitted by Security Level 3 user:               STATUS_ID (PK) REQUEST_ID    STATUS           STATUS_DATE     -------------- ------------- ---------------- -----------------------     1              3             APPROVED_LEVEL2  2012-09-01 01:00:00.000     2              3             APPROVED_LEVEL3  2012-09-01 02:00:00.000     3              4             APPROVED_LEVEL3  2012-09-01 02:00:00.000


title: Version Control with SQL Server

text: I'm starting a new project and using SVN (with Tortoise) as my Version Control System. I was wondering if it was possible to also maintain a SQL Server Database using the same system. I'd want to version my tables/functions/views/procs/triggers/etc. but not my data as it's all going to be test data anyway. I'm not really sure how to set this up. I've come across a few options but I would like to know if there were any I was missing, and if there's maybe a guide or something out there to help me get running with it. I've seen and heard of Red Gate, but I'm looking for something free (or at least very low cost). I know I could always write something myself, but I'm not really trying to spend time on that. One thing I did come across was an open source package put together called ScriptDB4Svn. Has anyone used this before? Is it good? Can it do the things I need it to do and is it pretty simple to get setup?


title: Migrating web app from php to Java

text: Hi I had today my first interview for a position of android developer.In my portfolio I had a php e-commerce application that has a catalog , ajax powered shopping cart , and administrator functionality. Because my Android knowledge is prety limited , I only started learning about 3 weeks ago , I was asked to migrate my current PHP web appplication to Java Web until April 19th when the second stage of the interview will take place , so they can asses how fast I can learn a new technology. I have no experience with Java working on the web so I do no know where to start. After a bit of research I found that for developing website with Java usually you use JSP, Spring or Struts. I would like a recommendation on witch one should I learn to quickly get started on migrating the web application to Java and some resources that do not get into to mutch details just enought to get started.


title: What do you call a pair of function that are complements of each other?

text: I am looking for the right word to describe a function and its complement. Here I am looking for the proper word to describe a couple of functions when applied in sequence the system reverts to its original state.   * Marshalling and Unmarshalling would be a subset of this   * Add and Remove Idempotence comes to mind though I am not sure if it can apply to more than one operation. Reversible could also do, but it seems a tad bit too general. Is there a right word that would describe this "systemic idempotence".


title: The case for code obfuscation?

text: What are the top reasons to write obfuscated code, in terms of a real benefit to the people developing the code, and the business that runs that code (if the code in question is in fact commericial code)? **Are there documented cases (available online in some location) which describe when obfuscation did more good than bad? Are there well-known examples where, for example, obfuscation was proven to meaningfully delay a malicious 3rd party from getting at the code?** It seems that, just like rolling up your car windows won't stop people from breaking them and stealing your stereo, obfuscating your code just keeps honest people honest. ========= Background: This is an attempt to purposely challenge my assumptions on this topic. I'm big-time against using code obfuscation in general, but I'm curious if I'm missing something. I get why, in cases like JavaScript, minification helps things load faster and all (there's a real, functional benefit there), but I can't seem to come up with a single reason why code obfuscation, **for the purpose of being an obstacle to discovering what an section of code/algorithm does** , is actually effective for any purpose whatsoever. With open source being crazy popular, the question seems to be "share the code, or keep it proprietary?" When it comes to commercial code, I can understand why you can't share everything, and you've got the law in your side to fight theft. BTW, if the reason someone is writing obfuscated code is "job security" then I would fire any programmer found to be consistently, and purposely using obfuscation **with the sole purpose of helping to keep their jobs,** unless they could reasonably show that it had some business benefit. It's so completely anti-team that it's ridiculous, and points to someone that's more concerned with keeping their job through misguided practices, then keeping it because they write awesome software. I only mention this specific case because, while I realize people are usually joking, I'd like to deter any answers whose basic thrust is that obfuscation for job security alone is a good idea.


title: Setter Validation can affect performance?

text: In a scenario where you use an ORM to map your entities to the DB and you have setter validations (nullable, date lower than today validation, etc), every time the ORM gets a result, it will pass into the setter to instance the object. If I have a grid that usually returns 500 records, I assume that for each record it passes on all validations. If my entity has 5 setter validations, than I have passed in 2.500 validations.   * Does those 2.500 validations will affect the performance?   * If was 15.000 validation, it will be different? In my opinion, and according to this answer, setter validation is useful than constructors validation.   * Is there a way to avoid unnecessary validation, since I am safe to say that the values I send to the DB when saving the entity won't change until I edit it on my system?


title: How to debug weak references?

text: How can I test (what tools do I use) if my reference graph is correct and if objects are released at appropriate times (and there are no memory leaks)? In my case I'm using Java, but answers related to another languages are welcome too...


title: Helping someone who is not and never will be a professional programmer write code that is more legible and usable to use and interpret

text: I am Elvis, trying very hard to learn to be Einstein. I work for Mort. What the hell is this crazy idiot talking about!?!? (You only need to read the first few paragraphs) If you don't feel like reading that link, basically, I am a professional programmer, and my boss is (this is scarily accurate): > the professional line-of-business programmer who lacks a degree in computer > science but has a great deal of familiarity with Office and VBA, and who > typically writes productivity applications shared amongst his coworkers All that said, a large portion of my job is taking his cobbled together code and making it production ready. However, the very poor style and cargo-cultism makes this difficult. This is compounded by the fact that he is unwilling to read programming books or allow me to help him refactor his code. Are there some other strategies for helping someone who is not a professional programmer, never will be a professional programmer write code going forward that is more legible and usable for me to use and interpret?


title: Is $.proxy a code smell?

text: I've been writing most of my javascript applications in an OO style close to what I would use for most other languages. However, this means that most callbacks need to have a reference to an object, and I generally handle that by using $.proxy (or dojo.hitch, or whatever the framework's tool for this is) to be sure that the callbacks are operating in the context of my object, rather than the tag they were attached to. Very quickly, this seems to lead to using proxied calls for almost everything, and can look like I'm fighting against the tool, particularly if the tool is jQuery. Do you have a policy on how to handle javascript function binding in your work? Do you try fit your design to how the tool binds it's functions, or do you force the bindings to work according to your design?