title: Is Object Oriented Design necessary when building Symfony web apps?

text: I am primarily a software developer, and as such, I do a lot of reading on the subject of Object Oriented Design; the 5 SOLID principles, design patterns, composition over inheritance etc. I currently work as a PHP developer building web applications in Symfony 2. Along with learning to use an Agile/BDD/TDD approach to building web applications, I try to incorporate some OOD by searching out the abstractions and jotting down some interfaces for classes to communicate with (dependency inversion). I was recently tasked with building a small, in-house CMS for a small, static website. This seemed a great opportunity to create, for example, an abstract "content" class and derive different types of content from it, or an interface for persisting content to the database. As it turned out, I didn't need any of the OOD knowledge that I have spent hours amassing. I just created Entities for each content type (albeit they derived from a base Entity), and I used the Symfony Form API to render forms for User input. Symfony functionality, when combined with Doctrine, handled all of the persisting to the DB. All that was left was to retrieve from the DB, process it, and pass it to the Twig template. So in consideration of this, I imagine that even had the application been much larger, it seems that the nature of most web applications is to take user input, process it, perhaps persist it, and render a view. None of this seems to require any OOD knowledge or design pattern knowledge. My question is whether my time is wasted learning OOD, or if I shouldn't place such importance on it, as perhaps modern web application development doesn't really fit that realm of "software" development. NB: I am aware that if I was to build a framework such as Symfony 2, then the OOD principles would apply, as that is truely building software from the ground up. My question is more related to when we use the Symfony (or any other) framework. **Edit** A better way to rephrase my question: do the majority of web application developers, whilst being rich in the knowledge of OOD, find that they needn't apply a vast majority of this knowledge when building web applications, because today's frameworks shelter you from such low level design. Does anyone have any examples of modules they have built that required Object Oriented methodology?


title: How you prepared for your .NET interview?

text: I gave many interviews in the last few years and each time I found the interviewers are not satisfied with what I know. My first company only developed desktop Windows applications using .NET. They had nothing to do with features like: _Remoting_ etc. We also had limited use of _Generics_ , _Reflection_ and _Multi-threading_. When I appeared for the interviews, I was asked questions on above features even when I told them that I don't have real-life experience. Now the .NET interviews are even more complex. Seeing my experience, the interviewers target the latest framework. I have no real-life exposure to the new features and technologies like WPF, WCF etc. Please suggest me how to effectively prepare for the .NET interview. I have 3 years experience in .NET but I only developed Windows based applications. At present I work on .NET Framework 3.5. I never worked on ASP.NET, as in my present company I work on PHP for web-applications.


title: High-Level Application Architecture Question

text: So I'm really wanting to improve how I architect the software I code. I want to focus on maintainability and clean code. As you might guess, I've been reading a lot of resources on this topic and all it's doing is making it harder for me to settle on an architecture because I can never tell if my design is the one that the _more experienced programmer_ would've chosen. So I have these requirements:   * I should connect to one vendor and download form submissions from their API. We'll call them the `CompanyA`.   * I should then map those submissions to a schema fit for submitting to another vendor for integration with the email service provider. We'll call them the `CompanyB`.   * I should then submit those responses to the ESP (`CompanyB`) and then instruct the ESP to send that submitter an email. So basically, I'm copying data from one web service to another and then performing an action at the latter web service. I've identified a couple high-level services:   * The service that downloads data from `CompanyA`. I called this the `CompanyAIntegrator`.   * The service that submits the data to `CompanyB`. I called this `CompanyBIntegrator`. So my questions are these:   1. Is this a good design? I've tried to separate the concerns and am planning to use the facade pattern to make the integrators interchangeable if the vendors change in the future.   2. Are my naming conventions accurate and meaningful to you (who knows nothing specific of the project)?   3. Now that I have these services, where should I do the work of taking output from the `CompanyAIntegrator` and getting it in the format for input to the `CompanyBIntegrator`? Is this OK to be done in `main()`?   4. Do you have any general pointers on how you'd code something like this? I imagine this scenario is common to us engineers---especially those working in agencies. Thanks for any help you can give. Learning how to architect well is really mind-cluttering.


title: C++ or C#: Which language is Microsoft going to use in development of future Windows versions?

text: I heard almost all parts of Windows are written in C and C++ with some assembly. Why did Microsoft skip C#? Is there any scope for C# in the development of future Windows versions?


title: using pre-commit / post-merge hook script to replace configuration values

text: I'm having some problem developing a web application with various developers, each one has an specific configuration to work. and i would like to use the less resource cosuming approach to avoid that any personal configuration goes to the repository. **the basic idea is:** to have a config file with all the pairs of key/values to store the configuration and substitute specific constants inserted in the code with the correpondent value in the code. I'm pretending to replace the values in the code with the key text using this syntax `{@KEY_TEXT}` in pre-commit and executing the opposite operation in the post-merge hook i'm doing this right? there's a more efficent way to do this? **EDIT:** Why i don't have all debug configuration in a single file, because all this values are inserted accross various files / and involves lot of different programming languages and differente context. i'm Using **PHP/javascript/Shell/Batch** file Language (Windows). in a cross plataform enviroment


title: How much to charge for project support after one year?

text: We did a project and the cost includes one year bug fixes and supporting.   How much should we charge for supporting the website for another one year? is there a formula or standard way to calculate this?


title: What's the reason for C standard to consider const-ness recursively?

text: The C99 standard says in 6.5.16:2: > An assignment operator shall have a modifiable lvalue as its left operand. and in 6.3.2.1:1: > A modifiable lvalue is an lvalue that does not have array type, does not > have an incomplete type, does not have a const-qualified type, and if it is > a structure or union, does not have any member (including, recursively, any > member or element of all contained aggregates or unions) with a const- > qualified type. Now, let's consider a non-`const` `struct` with a `const` field.               typedef struct S_s {         const int _a;     } S_t;      By standard, the following code is undefined behavior (UB):               S_t s1;     S_t s2 = { ._a = 2 };     s1 = s2;      The semantic problem with this is that the enclosing entity (`struct`) should be considered writable (non-read-only), judging by the declared type of the entity (`S_t s1`), but should not be considered writable by the wording of standard (the 2 clauses on the top) because of `const` field `_a`. The Standard makes it unclear for a programmer reading the code that the assignment is actually a UB, because it's impossible to tell that w/o the definition of `struct S_s ... S_t` type. Moreover, the read-only access to the field is only enforced syntactically anyway. There's no way some `const` fields of non-`const` `struct` are going really be placed to read-only storage. But such wording of standard outlaws the code which deliberately casts away the `const` qualifier of fields in accessor procedures of these fields, like so (Is it a good idea to const- qualify the fields of structure in C?): **(*)**               #include <stdlib.h>     #include <stdio.h>          typedef struct S_s {         const int _a;     } S_t;          S_t *     create_S(void) {         return calloc(sizeof(S_t), 1);     }          void     destroy_S(S_t *s) {         free(s);     }          const int     get_S_a(const S_t *s) {         return s->_a;     }          void     set_S_a(S_t *s, const int a) {         int *a_p = (int *)&s->_a;         *a_p = a;     }          int     main(void) {         S_t s1;         // s1._a = 5; // Error         set_S_a(&s1, 5); // OK         S_t *s2 = create_S();         // s2->_a = 8; // Error         set_S_a(s2, 8); // OK              printf("s1.a == %d\n", get_S_a(&s1));         printf("s2->a == %d\n", get_S_a(s2));              destroy_S(s2);     }      So, for some reason, for an entire `struct` to be read-only it's enough to declare it `const`               const S_t s3;      But for an entire `struct` to be non-read-only it's not enough to declare it w/o `const`. What I think would be better, is either:   1. To constrain the creation of non-`const` structures with `const` fields, and issue a diagnostic in such a case. That would make it clear that the `struct` containing read-only fields is read-only itself.   2. To define the behavior in case of write to a `const` field belonging to a non-`const` struct as to make the code above **(*)** compliant to the Standard. Otherwise the behavior is not consistent and hard to understand. So, what's the reason for C Standard to consider `const`-ness recursively, as it puts it?


title: How do I find a good middle way to make this library safe for concurrent operations

text: I've made a little library called SignalR.EventAggregatorProxy Before I push it into 1.0 state I need to fix so it works safely with concurrent operations. Easiest way is lock all operations but thats a huge performance impact. The library queues event subscriptions and when a event comes in it checks the subscriptions and updates the clients using SignalR This is the class that holds the subscriptions There are 3 methods that write/read to the subscription collection(s) (I aggregate the subscription both on a client level and event level, so its two collections)   * Subscribe    * UnsubscribeConnection   * Unsubscribe And one that that reads   * Handle I realize since this is a library I can't make it optimum for all users of the library, but how do I find a good middle way that does not use locks? I think the Handle method is the most important method and should be prioritized for performance over the other 3. I made this little Unittest to test for Concurrency fail **update:** I choose to have locked writes and unlocked reads. The writes didnt mutate existing state but overwrite the collection completely.


title: Best way to use source control for a project (1-3 people)

text: So my partner and I are working on a practice management system and at first we didn't use any version control, then I persuaded him to use git. At the moment our system is that we have three branches: develop, master and release. Our git repo is on an external server, which has Apache, MySQL, etc. We do our daily coding on the develop branch (commits) and then we we have done some testing to make sure it's (semi) bug-free we merge it into the master branch. If we want to do something radical we just make a branch of master, mess around and if it works, good, we merge it back in, if not, we delete the branch. Finally when we go for our weekly release we merge to the release branch to make sure we have a copy of the project as it was when we released. Unfortunately we don't track all files in git as it slows down git too much (e.g. images, especially since this is on an old server with a single-core 1.4 GHz AMD Sempron), as a `git status` usually changes from around 3s to about 1 minute; or because we can't (mysql databases). For us the slowdown is not workable so we just leave them out, and this has never seemed to be a problem because we haven't deleted any images, but we may start to soon as we start to optimize. So when we checkout previous commits sometimes the files aren't there and so it is broken (a big problem is we can't use version control on the database (because we don't know how), so because the schema has changed it is also broken if we go back). And that's pretty much our workflow. So after my background, my question is: **Do you think that there are any improvements we could make to the above?** And on a side note: Does any know a reliable and easy-medium difficulty (i.e. not _too_ hard) way to track mysql databases in git?


title: How to deal with hard configurations at the component level?

text: I distinguish three organisation levels while programming: the library level, the component level and the application level. A library defines functions to solve a range of related problems or preform related operations in _tools and no policies_ manner. An application lets several libraries interact and defines policies for diagnostic, error handling, internationalisation,… A component sits between the library and the application, it handles low-level errors and produce diagnostics, it might old global state and is aware of other components. Now I have a library implemented as a functor parametrised by a module holding a constant _n_ and values associated to different values of _n_ have incompatible types—which is the purpose of implementing the library as a functor. I call such a configuration a _hard_ configuration, because it must somehow be hard-coded in the program. Now I am facing the following problem: In this setting, I want to allow the user of the program to choose the value of _n_ for the duration of the program. Since the library is a functor, one feels forced to write the component interfacing the library to the program as a functor. But I want the choosed value of _n_ to be a property of the component, not of the application, and I want component to be regular modules (no functor allowed). How can I wrap a parametric library (implemented as a functor) in a non- parametric component, so that parameters can be chosen when the application starts? I insist on being able to express the application logic at the highest level in terms of non parametric modules, and want to avoid russian-dolls- alike parametrised modules at this level.


title: Implementation of chess endgame engine without Endgame Tablebases

text: I'm interested in creating an chess endgame solving engine. The endgames in chess are usually solved using the endgame table-bases generated by `retrograde algorithm`. I have found that Artificial Intelligence and Genetic Algorithms have been applied to the chess programming. However, before starting the implementation I wanted to find out whether the chess endgames can be played without the endgame tablebases? If yes, then what are the pros and cons of these alternatives to endgame tables? Are there any other algorithms known for this problem?


title: Website inheritance of ownership question

text: I paid for a web site for my motel business, then due to my landlord actions I was placed in a position to file for bankrupcy. I asked my IT manager and web developer to close down the web site for the business. He has since then sold my web site to the new owners. I took all the photos myself and I am in at least 4 of the photos on the site. There are no changes to the site as I left it and it now states that it is under the copyright on the new owners? I am not sure what I should do as this happen 10 months ago and I have just found this out. Thank you for your help, I am in Australia.


title: Keeping application backend and UI synchronised

text: I have an app that works with a list of objects so has one central keyed list. The main window has a tree containing these object with some information, which is easy enough to populate as a one off event after loading. Now, the complicated part, any part of the application can add, remove, and more importantly change the details of those objects at any time (all in the same process) and I'd like the tree to update to suit. I have a few options including passing events back down from the object to the list to the form which seems to be the most flexible way. I can also do it lazily and repopulate the tree each time or periodically (very hackish). Does anyone have any better thoughts on how to structure this? This is being done in C# 2.0 but the concepts apply to any environment. Thanks


title: Pricing personalized software?

text: Currently i'm working on a Purchased Order System Application Project for a small scale company. The Software that i am working on is personalized based on the on their business requirement. **The company told me to create proposal include the price how much is the application is so they can process the check for me.** The person who give me this project is the company supervisor and also a former supply chain supervisor in my employer before which i work also in some of their applications back then.So i want to be fair. This is my first time to create an application as a sideline so i really never experienced pricing a software even though i am working as full time web developer in a big company. Any tips and help ?


title: Will Authentication over HTTPS Slow My Application?

text: I am building a web application and RESTful web service. I have been reading various articles about the best way to authenticate the requests to the web service. The best option for me seems to be to use HTTP basic authentication. Pretty much every article ive read says that authentication should be encrypted over SSL or equivalent. Im not totally sure what this involves. Does this mean that my whole web service will have to be on a secure server? Will this slow things down?


title: What is the best way to work with large databases in Java depending on context?

text: We are trying to figure out the best practice for working with very large DBs in Java. What we do is a kind of BI (business Intelligence), i.e analyzing very large DBs, and using them to create intermediate DBs that represent intelligent knowledge of the DBs. We are currently using JDBC, and just preforming queries using a ResultSet. As more and more data is being created, we are wondering whether more appropriate ways exist for parsing and manipulating these large DBs:   1. We need to support 'chunk' manipulation and not an entire DB at once(e.g. limit in JDBC, very poor performance)   2. We do not need to be constantly connected since we are just pulling results and creating new tables of our own.   3. We want to understand JDBC alternatives, with respect to advantages and disadvantages.   4. Whether you think JDBC is the way to go or not, what are the best practices to go by depending on context (e.g. for large DBs queried in chunks)?


title: Is it possible to modify a video codec + distribute it?

text: this is my first question on this particular stackexchange node, not sure if it's the most appropriate place for this question (if not, guidance to the appropriate node would be appreciated). **the abstract:** I'm interested in modifying existing video codecs and distributing my modded codecs in such a way as to make them easily added to a users codec library... for example to be added to their mpeg streamclip, ffmpeg etc. **some details:** I've had some experience modifying codecs by hacking ffmpeg source files and compiling my hacked code (so that for ex: my version of ffmpeg has a very different h.263 than yours). I'm interested now in taking these modified codecs and somehow making them easily distributable, so others could "add them" to their "libraries." Also, I realize there are some tricky rights/patent issues here, this is in part my motivation. I'm interested in the patent quagmires, and welcome any thoughts on this as well. **ctx link:** if it helps (to gauge where I'm coming from) here's a link to a previous codec-hacking project of mine http://nickbriz.com/glitchcodectutorial/


title: What is the fitness landscape for minimal + viable solutions?

text: Let's say I'm trying to find a number from 1 .. 100. All numbers in this range are "valid", in that they could be interpreted as potential solutions. Let's say the ideal number is 50. And all numbers >= 50 are "feasible" in that they actual solve the problem. And all numbers < 50 are "not feasible" (but still valid). How would you code a scenario like this with a fitness function (assuming that the landscape is similar to but more complex than this contrived example)? Do you give "bonuses" to valid solutions? Do you measure how far an unfeasible solution has left to go before becoming optimal? And do you penalize excessive solutions?               if (solution < 50) {       maximalFitness = solution     } else if (solution >= 50) {       maximalFitness = 1_000 - solution     }      The curve wouldn't be continuous if all feasible solutions are strictly better than all unfeasible solutions, despite having a similar distance from optimal.


title: Why is trailing whitespace a big deal?

text: Trailing whitespace is enough of a problem for programmers that editors like Emacs have special functions that highlight it or get rid of it automatically, and many coding standards require you to eliminate all instances of it. I'm not entirely sure why though. I can think of one practical reason of avoiding unnecessary whitespace, and it is that if people are not careful about avoiding it, then they might change it in between commits, and then we get diffs polluted with seemingly unchanged lines, just because someone removed or added a space. This already sounds like a pretty good reason to avoid it, but I do want to see if there's more to it than that. So, why is trailing whitespace such a big deal?


title: As a beginning programmer, should I favor building my own libraries over using 3rd-party libraries?

text: As a beginning Python programmer, is it a good idea to build and understand my own libraries before jumping to advanced 3rd-party libraries that contains the functionality I need? Some projects (e.g. web frameworks like Django) are probably too large for this approach. But other projects (e.g. Web Crawlers, graph libraries, HTML parser) seem to be feasible. I worry that early reliance on 3rd-party libraries would stunt my growth. Note: this question and this question seem to focus more an experienced programmers, who are probably more focused on the efficiency of reuse than the learning benefit. My question, I think, is focused on beginners.


title: Evolution in coding standards, how do you deal with them?

text: How do you deal with evolution in the coding standards / style guide in a project for the existing code base? Let's say someone on your team discovered a better way of object instantiation in the programming language. It's not that the old way is bad or buggy, it's just that the new way is less verbose and feels much more elegant. And all team members really like it. Would you change all exisiting code? Let's say your codebase is about 500.000+ lines of code. Would you still want to change all existing code? Or would you only let new code adhere to the new standard? Basically lose consistency? How do you deal with an evolution in the coding standards on your project?


title: Any tips for designing the invoicing/payment system of a SaaS?

text: The SaaS is for real estate companies, and they can pay a monthly fee that will offer them 1000 publications but they can also consume additional publications or other services that will appear on their bill as extras. On registration the user can choose one of the 5 available plans that the only difference will be the quantity of publications their plan allows them to make. But they can pass that limit if they wish, and additional payment will be required on the next bill. A publication means: Publishing a property during one day, for 1 whole month would be: 30 publications. And 5 properties during one day would be 5 publications. ## So basically the user can:   * Make publications (already paid in the monthly fee, extra payment only if it passes the limit)   * Highlight that publication (extra payment)   * Publish on other websites or printed catalogues (extra payment) ## Doubts:   * How to handle modifications in pricing plans? Let's say quantities change, or you want to offer some free stuff.   * How to handle unpaid invoices? I mean, freeze the service until the payment has been done and then resume it.   * When to make the invoices? The idea is to make one invoice for the monthly fee and a second invoice for the extra services that were consumed.   * What payment methods to use? The choosen now is by bank account, and mobile phone validation with a SMS. If user doesn't pay we call that phone and ask for payment. Any examples on billing online services will be welcome! Thanks!


title: What are the barriers to adopting best practice? How can they be overcome?

text: We've all seen (and most of us have written) plenty of poorly written code. Why? What makes us adopt poor practices rather than good ones? The most obvious answer (to me) is "ignorance", but I'm sure that isn't the only reason. What others are there? What can we do to overcome the temptation to write bad code?


title: Web app outgrowing current framework

text: I have quite a bit of experience with using Django for websites and so when I started a new project I naturally chose to use Django for it. Everything went well for a time but now the application is really starting to rub up against what Django can comfortably cope with and I fighting all the time to ensure that things work as intended. I've been considering moving the site over to Java EE 7 now that it has been released. It certainly seems to provide the features I require as well as also being less forceful in the way that a project is laid out and maintained. I guess now that I have a good idea of how the application should be structured, development should be much faster. Have you felt the need to change the web framework you are using simply because it doesn't lend itself well to the type of project you are trying to produce?


title: What to test when building websites using CMS?

text: My job is mainly building websites using CMS such as Drupal, eZPublish or Magento. Most of the work is templating, CRUD and adhering to the specs with this. Occasionally, there is some business-specific logic, but it's usually 20 lines or so. Most of the logic is a bunch of `if` in the templates. In this context, I find it hard to argue over unit testing. What should I test? Only integration tests? They usually can only be done at a very high level, such as using Selenium IDE. And Selenium is a pain to handle in project-mode products, because the requirements often change in 6 months and then the project is over. There are also other difficulties such as URLs being dynamic. (CMS don't always respect a RESTful architecture, especially for contents.) I am in favor of unit testing. For libraries or framework-based projects, I easily write them and sets up a Jenkins server for them. But for CMS-based projects, I just don't know how and where to get started.


title: Talking about Front End Web Development frameworks from a designer's perspective

text: I am a Web Developer working at a company where the fronted framework we have selected is Angular JS. I am now in the position where I am the 'resident expert' whatever that may mean. I have been tasked with teaching/explaining everything that our Designers need to know about Angular JS. Unfortunately my knowledge/understanding of design begins and ends with the color wheel. Therefore I have the following question: What, if anything would a designer need to know about a front end javascript framework in general/Angular JS in particular in order to streamline their productivity? What kind of things are irrelevant? What kind of things are important?


title: Confusion in definitions of a method and a methodology in the book "OOAD with Applicatons" (Booch et al)

text: I am reading the book Object-Oriented Analysis and Design written by Grady Booch and others. In the Section : I Concepts in a subsection Bringing Order to Chaos authors suggest to separate between a _Method_ and a _Methodology_ : According to the book: **A method** is a disciplined procedure for generating a set of models that describe various aspects of a software system under development, using some well-defined notation. **A methodology** is a collection of methods applied across the software development lifecycle and unified by process, practices, and some general, philosophical approach. I understood that a _Method_ is used to built system models and a _Methodology_ is a set of such methods that are applied across software development lifecycle. To my knowledge, a software development lifecycle includes but is not limited to analysis, design, implementation and testing phases. How it can be that a _Method_ that is used to built system models is also applied in implementation or testing phase?


title: Can too much abstraction be bad?

text: As programmers I feel that our goal is to provide good abstractions on the given domain model and business logic. But where should this abstraction stop? How to make the **trade-off between abstraction** and all it's benefits (flexibility, ease of changing etc.) **and ease of understanding the code** and all it's benefits. I believe I tend to write code overly abstracted and I don't know how good is it; I often tend to write it like it is some kind of a micro-framework, which consists of two parts:   1. Micro-Modules which are hooked up in the micro-framework: these modules are easy to be understood, developed and maintained as single units. This code basically represents the code that actually does the functional stuff, described in requirements.   2. Connecting code; now here I believe stands the problem. This code tends to be complicated because it is sometimes very abstracted and is hard to be understood at the beginning; this arises due to the fact that it is only pure abstraction, the base in reality and business logic being performed in the code presented 1; from this reason this code is not expected to be changed once tested.  Is this a good approach at programming? That it, having changing code very fragmented in many modules and very easy to be understood and non-changing code very complex from the abstraction POV? Should all the code be uniformly complex (that is code 1 more complex and interlinked and code 2 more simple) so that anybody looking through it can understand it in a reasonable amount of time but change is expensive or the solution presented above is good, where "changing code" is very easy to be understood, debugged, changed and "linking code" is kind of difficult. Note: this is not about code readability! Both code at 1 and 2 is readable, but code at 2 comes with more complex abstractions while code 1 comes with simple abstractions.


title: Is there a difference between casting and converting types in imperative programming languages?

text: The question came up in a discussion at StackOverflow. Is there a clean distinction between the two concepts **cast** and **convert** (concerning the type of an object), or are these two words describing exactly the same? How about languages other than C++, Python and Java? **EDIT** : What if the types in question are primitive types, like `int` to `float`?


title: Involuntarily becoming a programmer: how to do it right?

text: My background is electrical engineering, DSP to be more precise. The company I currently work for does a lot of diverse projects, mostly building analog hardware. Being somewhat closer to computers than everybody else around here I'm often the one writing code for both embedded devices (which I'm perfectly fine with) and Windows or Linux OS. It is the latter that is foreign territory to me. I can code, and I know a few languages (C/C++, Java, some VB.NET), but I only used them for algorithm simulations in signal and image processing, neural networks, and other similar applications. For me programming has been a computational tool more than anything else. However, I get more and more projects where I have to write proper full-fledged software, and I don't really know how to do it, because I never had to do it, and I was never really interested enough. I have myself seen quite a few engineers who got converted into coders to a certain degree because of job demands, and most of them weren't that great at what they did. I'm sure many people have encountered the same. If I were to learn writing proper software with good user interface, good internal architecture and so on, how do I do it? We don't have anyone at work who could tell me what's good practice and what isn't. Given that I can write _code_ in the rawest sense of the word, what else is there to know about writing good software and how I do I get there on my own?


title: Is it legal to put `FSharp.Core.dll` from FSharp redistributable package?

text: Is it legal to put `FSharp.Core.dll` from FSharp Redist Package into my application package and redistribute it with my application? I couldn't find any information about this.


title: Making it work V/S Making it work right

text: I am somehow a bit good at coding algorithms for small projects, but when it comes to make an attempt for some biggies, I make a total hodge-podge and marshmallows of my project's structure. I have studied a lot of books on software engineering and SDLCs where they say that becoming a developer is what every nook and crook can do, but the actual developer is the one who follows a systematic approach to the problem and solve it the way its meant to be. My code works fine for such jumbled up projects, but it gets too difficult for maintenance and further upgrades. So, **I would like suggestions so as what should be the proper approach to planning the big moves**


title: Problem : Certificate for multi Clients of WCF

text: * If My WCF service have big number of clients through the Internet,then whether should all of them share the same Client Certificate(X509)?   * And if their certificates should be unique , what should I do on the WCF to identify all the certificates?   * Last question: Must I import the server-side certificate into TrustedPeople location on every Client ? (Which seems to be troublesome and any way convenient? )


title: Windows Phone 7 app development - Is it worth it?

text: I've written a Windows Phone 7 application to display the Ordnance Survey maps that are loved so much in the UK (I am amazed that no-one else has done this yet). However I was about to shell out the £65 to pay for the app hub and get my app to the marketplace when I started investigating how you actually get paid for the apps that people buy. Apparently if you are not a US developer then you have to start sending over forms e.g. W8BEN form? and even after this the IRS takes another 30% (after MS have taken their 30% share). It also mentions VAT so maybe there is more money taken off after this as well??? Has anyone from outside the US actually got all the paperwork sorted so they got paid? Did you get tax taken off as well? What percentage of the sales do you actually end up with? Is it all worth it? I don't expect to make much from the app but I would like to think I could recoup my £65 and have enough to buy a couple of beers as well.


title: What does backslash "\" escape character really escape?

text: What does backslash really escape? It's used as escaping character. But I always wonder what's escaping? I know "\n" is a new line character. But what in it is escaping? Why is it called like that?


title: Is CodeIgniter PHP Framework suitable for large ERP or Business Application?

text: Is CodeIgniter is recommended for a large web based ERP or Business Application? I want to use CodeIgniter for my future Project and I'm so confused whether to use it or not. Im so worried about in the long term process or lifetime of the application that it may crashed or produce a bug or error. I also worried about the performance of the framework when the data becomes larger and containing millions of records. I searched on the internet the answer but there is no exactly answer that will satisfy me. I think this question is important for the programmers like me who wanted to use PHP Framework for their large business application. I need an advice from you guys in order to decide whether to use it or not. thank you very much!


title: What to charge for a ready-built piece of software?

text: Recently I was contacted by someone interested buying a piece of software that I wrote to automate a process. The 'client' knows little about the program, except what it outputs and how easy it is to use. They are now interested in purchasing it, and I need to give a reasonable price. I've never done anything like this before, so as you might be able to guess, I do not know where to start with a price. I spent a good 12 hours+ working on the program itself. The client will probably want some changes also. **My question: How can I work out what to charge for a piece of software that I built in my own time?**


title: Adoption of Lean methods

text: Are there any studies on the adoption of agile methods based on Lean principles? Some of the stats I'm looking for:   1. How widely is Lean used?   2. In terms of Agile methods, how does the adoption of Lean compare with other Agile methodologies like Scrum, XP, etc?


title: Should companies require developers to credit code they didn't write?

text: In academia, it's considered cheating if a student copies code/work from someone/somewhere else without giving credit, and tries to pass it off as his/her own. Should companies make it a requirement for developers to properly credit all _non-trivial_ code and work that they did not produce themselves? Is it useful to do so, or is it simply overkill? I understand there are various free licenses out there, but if I find stuff I like and actually use, I really feel compelled to give credit via comment in code even if it's not required by the license (or lack thereof one).


title: Good resource for getting up to speed on windows forms development

text: I'm a .NET developer comfortable with C# and web application development. I need to improve my knowledge of Winforms. What is a good book or online resource that particularly covers the Winforms life cycle. Which events to use for what? How does OnLoad compare to Form_load etc.


title: How to recognize a bad client before you start to work for him?

text: I'm sure that many of you have encountered a bad client. I'm also sure you took some measures to prevent such encounters in the future. What is the most influential characteristic of a client that warns you to walk away?


title: How do you read this line of code?

text: Forgive me for my poor English, me and my friend were doing school homework, suddenly he asked me to read this line of code `ptr = &array[1][1][1]` (ptr is a pointer to an integer). He said > ptr is pointing to the address of the second element of the second column of > the second row of an array. I think he will be right if it was an array of char. As far as it's an integer 3D array I have no idea how to read that line of code in plain English. How would you read it?


title: What would a good work flow for a programming mentor look like?

text: I have read a junior mentoring topic which answered most of my doubts. However this topic gives general (though very good) advice on mentoring, while I am mainly interested in what a mentor's week looks like. This is my case. I have a junior (1 year of experience) who got a new project and I am mentoring him. While I am sure that he will use google and will not ask me silly questions, I want to make sure he's on the right path and not to create structures which are hard to maintain or slow in execution. Now, should I:   1. Check out the code each day and examine it?     * Pro: detect errors in its root     * Con: time consuming, may overlook something as there is a work day behind me as well.   2. When he needs to implement let's say singleton, do I tell him to find it on google and come back to me with a solution? Or I let him implement it and later review it?     * Pro: he does not wait for me to reply to him.     * Con: he may implement it wrongly and lose precious time.   3. Are there any situations when I can just check the result? Just like I am a QA. Or I must always stick to the code review?   4. At what point should I stop being a mentor? After how many projects or after how much time?   5. Anything else I have missed?


title: MCPD: Webdeveloper 4 Visual Studio 2010 Training Stuff

text: I think about doing the 4 exams required to become a MCPD Webdeveloper 4 Visual Studio 2010. The examns can be found here: http://www.microsoft.com/learning/en/us/certification/mcpd.aspx#tab2 I found only one book at amazon, having a rather bad rating. Can somebody recommend any training material for those examns?


title: How should I introduce a new programmer to a complex project?

text: We have a pretty complex project with 100 or so classes, multiple custom elements, etc. We have a new senior programmer who will work on this project. How should we approach the task of introducing the senior programmer to the project? How can we make sure the programmer does not break some other feature while fixing the current one? I have seen too many similar situation.s Sometimes, new bugs are not noticed immediately -- but pop up months later. Shall I direct the programmer by first giving them smaller tasks and waiting for them to finish them? Or there is a better solution? I am asking this because I don't want to become micromanager but I also don't want to have nasty bugs created because of my bad approach to the new programmer.


title: A programmer as project manager or non-programmer?

text: We are a team of programmers and are employing a new person who will be a project manager only. Our project are only programming ones and we are not sure how to decide who will be the best for project manager. Shall we find a senior programmer from our programming field? Or we must find a regular guy (economics or management studies) who never coded in his life? **EDIT** A project manager will_   * Create tasks for developers   * Monitor that our ticket workflow is respected   * Warn developers is they cross estimated work time    * Manage weekly finance timesheets   * Help client and reply to his questions   * Set meetings between client and developers (internet meetings) And similar things. Now, when I wrote this I see that there are no IT tasks in here. But what about simple questions the clients ask and which an educated It person will be able to reply? we obviously cannot bother programmers for this all the time. this is the main reason whay we are in doubt.


title: C# books for the experienced programmer

text: > **Possible Duplicate:**   >  Is there a canonical source for learning C# and .NET internals? So I've been programming in C# for 3 years now (been programming in various languages for 3 years before that as well) and most of the stuff I learned I pieced together on the internet. The thing is, I want to understand C# more formally and in depth and so would like to get some books on the subjects. Any books you'd recommend? Also, I've heard good things about "C# 4.0 in a Nutshell", "Pro C# 2010 and the .NET 4 Platform" and "CLR via C#". What do you think of these? (The people at stackoverflow told me to take it here. Please, Please tell me I'm in the right place this time)


title: What does it mean when data is scalar?

text: I don't know what scalar means exactly, but I'm trying to see if I'm thinking about it correctly. Does scalar relate to arbitrariness where the type of data could be any type, or a system is not able to know what the data is in advance.


title: Where should I put bindings for dependency injection?

text: I'm new to dependency injection and though I've really liked it so far, I'm not sure where bindings should go. I'm using Guice in Java, so some of what I say might be specific to just Guice. As I see it, there's two options: **Accompanying the class(s) its needed for.** Then, just write `install(OtherClassModule.class)` in whatever other modules want to be able to use said class. As I see it, the advantage of this is that classes that want to use it (or manage classes that want to use it) don't need to know any of the implementation detail. The issue I see is that what if two classes want to use two different versions of the same class? There's a lot of customization possible because of DI and this seems to restrict it a lot. **Implemented in the module of the class(s) its needed for.** It's the flip of what I said above. Now you have customization, but not encapsulation. Is there a third option? Am I misunderstanding something obvious? What's the best practice?


title: Why std::allocators are not that popular?

text: With the latest trends about C and C++ applications, and with latest I mean the latest years, I was expecting to see `std::allocator`s to be used way more frequently than what it really is. Modern applications are usually multithreaded or with form of concurrency in them, and they manage a significant amount of memory, especially in some fields like games and multimedia applications; so the usual high cost of the allocation/deallocations rises and impacts the performances even more than in old applications. But for what I can see this kind of memory management through `std::allocator`s is not popular, I can't even count 1 library that I know of, that is using any rationale about a standardize way of managing memory. There is a real reason why `std::allocator` is not popular ? Technical reasons ?


title: What can I do in order to inform users of potential errors in my software in order to minimize liability?

text: I'm an independent software developer that's spent the last few months creating software for viewing and searching map data. The software has some navigation functionality as well (mapping, directions,etc). The eventual goal is to sell it in mobile app markets. I use OpenStreetMap as my data source. I'm concerned about liability for erroneous map data / routing instructions, etc that might result when someone uses the application. There are a lot of stories on the internet where someone gets into an accident or gets stuck or gets lost because of their GPS unit/Google Maps/mapping app... I myself have come across incorrect map data as well in a GPS unit I have in my car. While I try to make my own software as bug free as possible, no software is truly bug free. And moving beyond what I can control, OpenStreetMap data (and street map data in general) is prone to errors as well. What steps can I take to clearly inform the user that results from the software aren't always perfect, and to minimize my liability?


title: Greater than or identical to?

text: While browsing my code in a weakly-typed language I was seeing that I've trained myself to use identity (`===`) where logical. Then I came across a greater (or less) than or equal to (`>=`), and it made me wonder... why is there no "greater than or identical to"? I suppose it would be `>==`. For example...               5 == 5    // true     5 === 5   // true     5.5 >= 5  // true     5.5 >== 5 // false     6 >= 5    // true     6 >== 5   // true      Basically, I would throw a false if it was of a different type. For example, if I want to check if $x is greater than $y, but I want them both to be integers (or floats, but no mixing), then wouldn't it make sense to have a single call that can do all that, rather than having to check separately to see if they were the same type? A quick google indicated that this may not exist in any language; why not? Is it just not as useful as I might think it is? :)


title: Should data models know where / how they're stored?

text: I have some classes that represent, for the most part, data that's deserialized from XML. They also have some behavior in them, because I don't want to suffer from an anemic domain model. These domain objects don't have any XML specific code in them, but they do have properties that correspond exactly to the tags and attributes in the XML. Many of these classes' behaviors rely on resources loaded from disk, like images. For that, some properties / xml attributes are relative file paths to these resources. Now my problems begin. The absolute path to be constructed for these resources is based on a separate dependency - the root of the "project". Here's what I'm struggling with:   1. Should my domain objects store the full absolute path to their resources? Or just the relative paths? If they held the absolute path, then the classes that load them - my XML readers - will have to take a dependency on the project root in order to build the full path for them. If not, I'll have to make yet another layer of classes to handle that. I already have 3 layers, I don't know if I can handle any more!   2. Should my domain objects store _their own paths_ for where they are on disk? It makes sense for them to know where their dependencies are in relation to them, but to know their own location just feels wrong to me intuitively. This is sort of unrelated to the other part of the question, but I think if I go the wrong way on this it could bite me later.


title: Examples of operator overloading, which make sense

text: While I learning C#, I found that, the C# supports operator overloading. I have problem with good example which:   1. Make sense (ex. adding class named sheep and cow)   2. Is not an example of concatenation of two strings Examples from Base Class Library are welcome.


title: Optional dependencies in npm?

text: I have a similar question to this, but not quite the same. I would like for the user of my app to install it with whatever dependencies are needed for the way he would want to use it. So, for example, if they want to persist to MongoDB, then only Mongo-related libraries will be installed, but if they want to persist to Redis, then only Redis-related libraries will be installed. I don't want to make them download and install libraries they won't be using. I know I can do that for development purposes with `devDependencies`, but this goes farther than that. As the answer in the question above says, this is more closely related to Python's `setuptools` `extras_require` and Clojure's `leiningen` profiles. Anything like that in npm? I really feel like `devDependencies` should be a `dev` profile of a more versatile way of specifying dependencies.


title: Validation and authorization in layered architecture

text: I know you are thinking (or maybe yelling), "not another question asking where validation belongs in a layered architecture?!?" Well, yes, but hopefully this will be a little bit of a different take on the subject. I am a firm believer that validation takes many forms, is context-based and varies at each level of the architecture. That is the basis for the post - helping to identify what type of validation should be performed in each layer. In addition, a question that often comes up is where authorization checks belong. The example scenario comes from an application for a catering business. Periodically during the day, a driver may turn in to the office any excess cash they've accumulated while taking the truck from site to site. The application allows a user to record the 'cash drop' by collecting the driver's ID, and the amount. Here's some skeleton code to illustrate the layers involved:               public class CashDropApi  // This is in the Service Facade Layer     {         [WebInvoke(Method = "POST")]         public void AddCashDrop(NewCashDropContract contract)         {             // 1             Service.AddCashDrop(contract.Amount, contract.DriverId);         }     }          public class CashDropService  // This is the Application Service in the Domain Layer     {         public void AddCashDrop(Decimal amount, Int32 driverId)         {             // 2             CommandBus.Send(new AddCashDropCommand(amount, driverId));         }     }          internal class AddCashDropCommand  // This is a command object in Domain Layer     {         public AddCashDropCommand(Decimal amount, Int32 driverId)         {             // 3             Amount = amount;             DriverId = driverId;         }              public Decimal Amount { get; private set; }         public Int32 DriverId { get; private set; }     }          internal class AddCashDropCommandHandler : IHandle<AddCashDropCommand>     {         internal ICashDropFactory Factory { get; set; }       // Set by IoC container         internal ICashDropRepository CashDrops { get; set; }  // Set by IoC container         internal IEmployeeRepository Employees { get; set; }  // Set by IoC container              public void Handle(AddCashDropCommand command)         {             // 4             var driver = Employees.GetById(command.DriverId);             // 5             var authorizedBy = CurrentUser as Employee;             // 6             var cashDrop = Factory.CreateCashDrop(command.Amount, driver, authorizedBy);             // 7             CashDrops.Add(cashDrop);         }     }          public class CashDropFactory     {         public CashDrop CreateCashDrop(Decimal amount, Employee driver, Employee authorizedBy)         {             // 8             return new CashDrop(amount, driver, authorizedBy, DateTime.Now);         }     }          public class CashDrop  // The domain object (entity)     {         public CashDrop(Decimal amount, Employee driver, Employee authorizedBy, DateTime at)         {             // 9             ...         }     }          public class CashDropRepository // The implementation is in the Data Access Layer     {         public void Add(CashDrop item)         {             // 10             ...         }     }      I've indicated 10 locations where I've seen validation checks placed in code. My question is what checks you would, if any, be performing at each given the following business rules (along with standard checks for length, range, format, type, etc):   1. The amount of the cash drop must be greater than zero.   2. The cash drop must have a valid Driver.   3. The current user must be authorized to add cash drops (current user is not the driver). Please share your thoughts, how you have or would approach this scenario and the reasons for your choices.


title: How is the publish-subscribe pattern different from gotos?

text: My understanding is that Goto statements are generally frowned up. But the publish-subscribe pattern seems to be conceptually similar in that when a piece of code publishes a message, it performs a one-way transfer of control. The programmer may have no idea what parts of the program are subscribing to this message. I have see something similar in a lot of JavaScript programs in which events are used to conveniently "hop" across modules. Am I missing something about the publish-subscribe or event-driven patterns?


title: Should I wait until Mango's release?

text: I was deciding whether to start a Windows Phone application, but it seems like it might be better to wait until Mango is released. Is Mango a new platform, or is it an upgrade to Windows Phone 7 (i.e. Windows Phone 8)? Is it expected to arrive in the near future? That is, should a project starting today worry about it?


title: Best practise is not to poll...but isn't polling happening internally anyway when a thread calls wait()?

text: Say we have some thread that wants to check when another thread is finished its task. I have read that we should call a wait() type function that will make this thread wait until it receives a notification that the other thread is finished. And that this is good because it means we aren't performing expensive polling. But isn't polling happening internally at a lower level anyway? I.e. if we make the thread wait() isn't the kernal performing polling anyway to check when the other thread is finished so that it can then notify the first thread? I presume I a missing out on something here, can someone enlighten me?


title: Design: Object method vs separate class's method which takes Object as parameter?

text: For example, is it better to do:               Pdf pdf = new Pdf();     pdf.Print();      or:               Pdf pdf = new Pdf();     PdfPrinter printer = new PdfPrinter();     printer.Print(pdf);      Another example:               Country m = new Country("Mexico");     double ratio = m.GetDebtToGDPRatio();      or:               Country m = new Country("Mexico");     Country us = new Country("US");     DebtStatistics ds = new DebtStatistics();     double usRatio = ds.GetDebtToGDPRatio(us);     double mRatio = ds.GetDebtToGDPRatio(m);          My concern in the last example is there are potentially endless statistics (but let's say even just 10) you might want to know about a country; do they all belong on the country object? e.g.               Country m = new Country("Mexico");     double ratio = m.GetGDPToMedianIncomeRatio();      These are simple ratios but lets assume the statistics are complicated enough to warrant a method. Where is that line between operations that are intrinsic to an object vs operations that can be performed on an object but are not part of it?


title: The deference between Computer science and Computer information system?

text: I'm Asking you that question because you are an experts in programming , and maybe you could help me . Unfortunately in my country you can't get a job if you don't have a university certification, even if you are a great programmer , so this year i went to college and majored in Computer Science , But I'm so Confused between CS and CIS , and in what major should I spent my money on it ,, There is more than 25 subjects are mutual between us but there is some subjects are special for Computer science , also another subjects for Computer information system too , **Computer science specialization** :   1. Discrete Mathematics   2. Linear algebra And Numerical Analyses    3. Computation theory    4. Compiler Design    5. Wireless Networks security    6. Artificial Intelligence    7. Computer Organization & Architecture    8. Expert Systems  =========================================== **Computer information system specialization :** 1.Information retrieval systems   1. Management for network    2. Wireless network    3. Data base management systems    4. Information security    5. Data warehousing    6. Data mining    7. Intelligent systems


title: Does C++ compiler remove/optimize useless parentheses?

text: Will the code               int a = ((1 + 2) + 3); // Easy to read      run slower than               int a = 1 + 2 + 3; // (Barely) Not quite so easy to read      or are modern compilers clever enough to remove/optimize "useless" parentheses. It might seems like a very tiny optimization concern, but choosing C++ over C#/Java/... is all about optimizations (IMHO).


title: Best practices for managing and maintaining large Rails app?

text: What are best practices for managing and maintaining large Rails app?


title: JavaScript strict mode compatibility

text: While reading about strict mode on MDN I really was surprised to read the following near the end of the page, quote: > Browsers don't reliably implement strict mode yet, so don't blindly depend > on it. Strict mode changes semantics. Relying on those changes will cause > mistakes and errors in browsers which don't implement strict mode. Exercise > caution in using strict mode, and back up reliance on strict mode with > feature tests that check whether relevant parts of strict mode are > implemented. Finally, make sure to test your code in browsers that do and > don't support strict mode. If you test only in browsers that don't support > strict mode, you're very likely to have problems in browsers that do, and > vice versa. As far as I understand it, strict mode is a redused set of "nonstict" mode, thus I can't imagine situation where strict code can't run correctly in a nonstrict browser. So, the question is this statement really makes sense? Is the any situation where strict to "nonstrict" switch will make code invalid?


title: C# Design Issue

text: I am building a small application and I am trying to understand the best way to approach the design. I am looking for some guidance/advice how best to approach the following issue. What I have is that I receive a set of data, real time. I then analyze the data for patterns. The patterns are classes that derive from an abstract class which implements an interface. The number of patterns will change over time as patterns are added/removed. In addition, depending on the access level of the user, the data is analyzed with different pattern options. For example, if I have five patterns, A, B, C, D and E, level 100 access may only analyze the data with pattern A whereas access level 300 will analyze with patterns B, D and E, and access level 500 will analyze with all the patterns. The access levels are linked to the user, and a user can have different access levels on different data streams. My thought is to create a hash table or dictionary for the patterns and a db for the users and their various access levels. Is this the best way to go or is there a better approach that will work in real time?


title: How do I account for changed or forgotten tasks in an estimate?

text: To handle task-level estimates and time reporting, I have been using (roughly) the technique that Steve McConnell describes in Chapter 10 of _Software Estimation_. Specifically, when the time comes for me to create task-level estimates (right before coding begins on a project), I determine the tasks at a fairly granular level so that, whenever possible, I have no tasks with a single-point, 50%-confidence estimate greater than four hours. That way, the task estimation process helps with constructing the software while helping me not to forget tasks during estimation. I come up with a range of hours possible for each task also, and using the statistical calculations that McConnell describes along with my historical accuracy data, I can generate estimates at other confidence levels when desired. I feel like this method has been working fairly well for me. We are required to put tasks and their estimates into TFS for tracking, so I use the estimates at the percentage of confidence I am told to use. I am unsure, however, what to do when I do forget a task, or I end up needing to do work that does not neatly fall within one of the tasks I estimated. Of course, trying to avoid this situation is best, but how do I account for forgotten/changed tasks? I want to have the best historical data I can to help me with future estimates, but right now, I basically am just calculating whether I made the 50%-confidence estimate and whether I made it inside the ranged estimate. I'll be happy to clarify what I'm asking if needed -- let me know what is unclear.


title: Is it acceptable to deploy web app to production directly from SVN

text: **Question** Is there a legitimate reason **NOT** to use SVN for production deploys, or is this merely a case of personal preference and there is no real case against SVN? **Background** My workplace has a culture of tagging release in SVN and then deploying those releases directly to the various web servers using `svn co` or `svn switch` including directly to production. I personally have a problem with this as I believe that without using a build and deploy script or some form or automated deploy you lose integration environment settings as they're undocumented. However more than that I have a gut feeling that there may be a hidden danger to doing that which has been overlooked, something which has yet to rear its ugly head. I've brought up my concerns with the operations staff who are responsible for deploying code to our various environments (staging, pre-prod, production) etc. Their arguments were pretty much that it's worked pretty well so far, no reason to change. **Edit:** _What I mean about build and deploy:_ For example, if a developer requires a web.config setting added for a particular environment. Web.config is generally not kept in svn and so these files are updated manually without any form of automated build script. So if they're lost or OPS forget to add a field to the web.config for a release then you have issues. A build script that say uses XMLPoke to automatically generate a web.config appropriate for a particular environment is ideal in that you have a versionable script which documents all changes necessary for each of your environments. _Current Build and Deploy Method_ For the project in question a developer builds a release manually, other projects have the build step automated either with NANT, or MSBuild which is OK. Database migrations for most projects are via DB scripts, or migration scripts (Migrator.NET), or CMS Packages. CI is usually done by Team City on a per checkin basis, we have a code review process that all tickets are done in branches and then peer reviewed for validation and correctness/quality prior to checking into trunk (works well). However actual code deploy is pretty much always via SVN, either via a checkout of a tagged release or more generally an SVN Switch. This is something that sticks odd with me that we're using our repository as part of the deploy process. Configuration doesn't generally change very often, the only things that will be in config files are environment specific information. Everything else is in the db. Don't get me wrong this works, it works well. However I want to try and push for an automated build and deploy. I've used this with Rails and Capistrano, and for personal projects using Cygwin, Nant and SSH. More importantly I would need very specific valid arguments to get my colleagues to change to using an Automated build and deploy. Or are there NO real valid arguments against using SVN specifically to deploy to production?


title: Why the decline in search traffic for popular programming languages?

text: Is there any solid evidence behind the reasons for decline in search volume for popular programming languages? Could this possibly be due to improvements in finding necessary information (no need to search 10 times to find something) and quality of information? ![enter image description here](http://i.stack.imgur.com/Wfc7T.jpg)


title: What kind of webservice can be called with just a browser url?

text: Can a webservice be written in such a way that it can be called via just a browser url? For eg. if the webservice is called GetStockQuote, then it should be callable by the following url on the browser               http://myserver.com/WebServices/GetStockQuote?sym=MSFT      Likewise, if there are more params, they can be passed via the URL. Unlike this one - http://www.webservicex.net/stockquote.asmx \- where it doesn't look like the param can be passed via a URL. It seems to require either a program or a human to type in the param & click on invoke. Or does it always require a client program? Is there a way from the wsdl to figure out whether it can be called from a browser or not. How can I program a webservice which fulfils the above criteria?


title: Is it okay to define a [] method in ruby's NilClass?

text: Ruby by default does not include the method `[]` for `NilClass` For example, to check if `foo["bar"]` exists when `foo` may be nil, I have to do:               foo = something_that_may_or_may_not_return_nil     if foo && foo["bar"]       # do something with foo["bar"] here     end      If I define this method:               class NilClass       def [](arg)         nil       end     end      Something like that would make this possible, even if `foo` is nil:               if foo["bar"]       # do something with foo["bar"]     end      Or even:               if foo["bar"]["baz"]       # do something with foo["bar"]["baz"] here     end      **Question:** Is this a good idea or is there some reason ruby doesn't include this functionality by default?


title: Pros and cons of hosted scripts

text: I have seen some developers use hosted scripts to link their libraries. `cdn.jquerytools.org` is one example. I have also seen people complain that a hosted script link has been hijacked. How safe is using hosted scripts in reality? Are the scripts automatically updated? For example, if jQuery 5 goes to 6 do I automatically get version 6 or do I need to update my link? I also see that Google has a large set of these scripts setup for hosting. What are the pros and cons?


title: Avoiding duplicate bug reports

text: I use Linux and other open source software in my home. As I'm not a professional coder, I usually report bugs to developers as my skills are not enough to solve problems on my own. What kind of things you want me to check before I send a bug report? I mean, once I thought I found a bug in Gedit and I couldn't find similar bug in Bugzilla. But after I sent the report, some developer said that the bug is already in Bugzilla as the bug was in GTK+, not in Gedit. Sometimes it might be hard for an amateur to guess whether some previously known bug would solve the issue I found.


title: What do you consider to be a high-level language and for what reason?

text: Traditionally, C was called a high-level language, but these days it is often referred to as a low-level language (it is high-level compared to Assembly, but it is **very** low-level compared to, for instance, Python, these days). Generally, everyone calls languages of the sort of Python and Java high-level languages nowadays. How would you judge whether a programming language _really_ is a high-level language (or a low-level one)? Must you give direct instructions to the CPU while programming in a language to call it low-level (e.g. Assembly), or is C, which provides some abstraction from the hardware, a low-level language too? Has the meaning of "high-level" and "low-level" changed over the years?


title: Why do some programmers categorize C, Python, C++ differently? - regarding level

text: I am taking an introductory course on python and the instructor says that python is a high level language and C and C++ are low level languages. It's just damn confusing. I thought that C, C++, Python, Java, etc were all high level languages. I was reading questions at stackoverflow on C, C++, etc and they all seem to refer to those languages as high level. it seems to me that some programmers use those terms interchangably. Please clarify this for me.


title: Model Driven Design with Bean Validation

text: If I have a rich domain library that gets included into a Java web application, but I want to achieve a level of dependency isolation with that domain library such that it is possible to build and test it totally independently(of larger libraries like Spring), how can I realistically use JSR-303 bean validation? The domain library itself can use the hibernate validation annotations, like @NotNull on fields and getters just fine, and this is still independent and testable. However, if I want to use newer features, such as method parameter validation, which requires AOP, how do I maintain minimal dependencies while maintaining testability (via JUnit)? Is this a simple matter of configuring the unit test to exercise the domain objects through an AOP proxy? The design philosophy of JSR-303 seems, on the face of it, to be at odds with rich domain design, favouring more of a dumb-bean, business layer service design.


title: Tomcat 7 vs. ehCache Standalone Server (Glassfish) Configuration with RESTful Web Services

text: My requirements consist of using ehCache to send and store data via RESTful web service calls. The data can be stored in-memory or via the filesystem... Never used ehCache before so I am having some issues deciding on which bundle to use. Have downloaded the following bundles: ehcache-2.6.2 ehcache-standalone-server-1.0.0 (1) What is the difference between the two? It seems the ehcache-2.6.2 contains src and binaries, which essentially enables one to bundle it with their webapps (by putting the compiled jar or binaries inside the webapp's WEB-INF/lib folder). But it doesn't seem that it has support for Restful web services. Whereas, ehcache-standalone-server-1.0.0 (comes with an embedded Glassfish server and has support for REST & SOAP) can be used to run as a standalone server. If I my answers to my own question are correct, then that means, I should just use the standalone server? (2) My requirements are to setup ehCache (with REST support) on Tomcat 7. So, how could I setup ehCache on Tomcat 7 as a separate app with REST & SOAP support? Thank you for taking the time to read this...


title: Should I make a seperate unit test for a method, if it only modifies the parent state?

text: Should classes, that modify the state of the parent class, but not itself, be unit tested separately? And by separately, I mean putting the test in the corresponding unit test class, that tests that specific class. I'm developing a library based on chained methods, that return a new instance of a new type in most cases, where a chained method is called. The returned instances only modify the root parent state, but not itself. Overly simplified example, to get the point across:                   public class BoxedRabbits         {             private readonly Box _box;             public BoxedRabbits(Box box)             {                 _box = box;             }                  public void SetCount(int count)             {                 _box.Items += count;             }         }              public class Box         {             public int Items { get; set; }             public BoxedRabbits AddRabbits()             {                 return new BoxedRabbits(this);             }         }          var box = new Box();     box.AddRabbits().SetCount(14);      Say, if I write a unit test under the `Box` class unit tests:               box.AddRabbits().SetCount(14)      I could effectively say, that I've already tested the `BoxedRabbits` class as well. Is this the wrong way of approaching this, even though it's far simpler to first write a test for the above call, then to first write a unit test for the `BoxedRabbits` separately?


title: OO design for a Windows application that communicates with an external machine via RS232

text: I'm after a bit of OO design advice... I'm about to start developing a Windows application that communicates with an external machine via RS232. The machine has an onboard "system controller" consisting of registers (addresses). You can write a value to a register (e.g. to turn a pump on), or read a value from a register (e.g. to see if the pump is running). The app will have a config file detailing each register's settings, e.g. its address, whether it's 16- or 32-bit, a friendly "alias" (so other code can deal with "Pump XYZ" rather than address "50B3D124"), and a few other things. My first thought was to have a `Register` class reflecting these properties, plus `Read()` and `Write()` methods. But this raises the first question - should the `Read()` method have a return value, or should it populate a `Value` property on the class? Similarly, should the `Write()` method include a "valueToWrite" parameter, or should it write whatever value is currently held in the `Value` property? I could take this one step further (possibly even answering the above question) - instead of Read/Write methods, put the functionality into the `Value` property's getter and setter? Using a property for this purpose doesn't feel right though. I then started wondering if a `Register` class was even necessary, as its read/write functionality would be doing little more than calling Read/Write methods on a `SystemController` class, e.g.               long ReadRegister(string registerAlias);     void WriteRegister(string registerAlias, long value);      Why not just let the rest of the application read/write registers via the `SystemController` class? (I suspect I would still need some concept of a `Register` class, even if it's just to represent a register's config settings).


title: algorithm for project euler problem no 18

text: Problem number 18 from Project Euler's site is as follows:               By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23.          3     7 4     2 4 6     8 5 9 3          That is, 3 + 7 + 4 + 9 = 23.          Find the maximum total from top to bottom of the triangle below:          75     95 64     17 47 82     18 35 87 10     20 04 82 47 65     19 01 23 75 03 34     88 02 77 73 07 63 67     99 65 04 28 06 16 70 92     41 41 26 56 83 40 80 70 33     41 48 72 33 47 32 37 16 94 29     53 71 44 65 25 43 91 52 97 51 14     70 11 33 28 77 73 17 78 39 68 17 57     91 71 52 38 17 14 91 43 58 50 27 29 48     63 66 04 68 89 53 67 30 73 16 69 87 40 31     04 62 98 27 23 09 70 98 73 93 38 53 60 04 23          NOTE: As there are only 16384 routes, it is possible to solve this problem by trying every route. However, Problem 67, is the same challenge with a triangle containing one-hundred rows; it cannot be solved by brute force, and requires a clever method! ;o)      The formulation of this problems does not make clear if   * the "Traversor" is greedy, meaning that he always choosed the child with be higher value   * the maximum of every single walkthrough is asked The `NOTE` says, that `it is possible to solve this problem by trying every route`. This means to me, that is is also possible **without**! This leads to my actual question: Assumed that not the greedy one is the max, is there any algorithm that finds the max walkthrough value without trying every route and that doesn't act like the greedy algorithm? I implemented an algorithm in Java, putting the values first in a node structure, then applying the greedy algorithm. The result, however, is cosidered as wrong by Project Euler.               sum = 0;          void findWay(Node node){         sum += node.value;         if(node.nodeLeft != null && node.nodeRight != null){                 if(node.nodeLeft.value > node.nodeRight.value){                     findWay(node.nodeLeft);                 }else{                     findWay(node.nodeRight);                 }             }     }


title: Usage of __ while declaring any variables or class member in python

text: Is it good practice to use `__` convention while declaring the member variable? This also imparts private kind of feature of that data member. There have been cases when I found that its good to have hidden members of a class. This is certainly exposes only that feature that will help the the object to behave in more protected manner.


title: Design principles : classifying different types of class

text: I'm trying to clarify the design of a C++ application, and would like to define a clear classification among classes to aid clarity. However I'm struggling to find any literature to help me, probably because I don't really know what I'm searching for. To help, here is what I've got so far. Classes can be one of a number of types:   * Value object. Here I mean things like std::string, std::vector. These are concrete classes that are typically instantiated on the stack, can be copied etc.    * Service objects. Clients will interact with these through a pure virtual interface, and these will typically be injected, DI style. A persistence service might be a good example here. There would typically be once instance of a service, either injected or accessed through a ServiceLocator (yeah, I know).   * (Domain object?). Clients interact with these through a pure virtual interface, but these represent abstract domain objects and are constructed using an abstract factory, which itself will be a service. These would typically have identity, but you want to interact with them in an abstract way. So a database connection might be a good example (note that this is different from a persistence service -- the concrete implementation of persistence service may use a database connection, but the database connection would represent one actual connection, and there would be subclasses for Mysql, SqlServer etc). There will be many instances of such objects, they have identity.   * Other things that don't fit into the above, but which I've failed to come up with any clear classification.  Now someone must have documented this kind of taxonomy, but so far I can't find anything. Does anyone have any good references? Thanks.


title: UnitTests, will cleaning up your act-statement make your test more or less clear?

text: Lets say that we are testing `FooClass` with the following method:                   public void Foo(string stringParameter, int intParameter, Action<Bar> successCallback, Action<Exception> errorCallback);      If the call to `Foo` succeeds, the `successCallback` will be called with the result of `Foo` in the form of a `Bar` object. If it fails, the `errorCallback` will be called with an `Exception`. So the tests will look something like this:               [TestMethod]     public void Foo_UnderGivenConditions_WeExpectAGivenResult()     {         //Arrange         var fooObject = CreateFooObjectWithGivenConditions( ... );              //Act         fooObject.Foo(String.Empty, 0, (bar) => { ... }, (error) => { ... });              //Assert         Assert.AreEqual(..., ...);     }      Now, there are a lot of tests on this `Foo`-method, all of them containing a call to `Foo`, but not every test will care for all the parameters. Some may provide different string values, but doesn't care about the int param, and some will need to provide an error callback to assert that the right exception is thrown and so on. Now, since all the parameters are mandatory, we have to pass a string value to the `Foo` method, even though the value has no meaning for the test. There will be a lot of `"I don't care"` or `"some text"`. When some one else comes and read the test, they have to consider if the given value actually has a meaning for the test result or not. The same goes for the callbacks. Sometimes we need the callbacks to get to the result value or the exception, but most of the time we do not. So lets implement an extension method, `PerformFoo`, that defaults every parameter:               public static Bar PerformBar(this FooClass fooObject, string stringParameter = "some text", int intParameter = 0, Action<Bar> successCallback = null, Action<Exception> errorCallback = null);     {        Bar result = null;             var ourCallback = (bar) =>            {                result = bar;                if (successCallback != null)                    sucessCallback.invoke();           }             fooObject.Foo(stringParameter, intParameter, ourCallback, errorCallback);             return result;     }      The extension method will call `Foo` with default parameters, and even return the result if the successCallback is called. This lets us change the Act part of the test to something like:               //Act, all we care about is the string parameter:     fooObject.PerformFoo("A string that we care about");          //Act, we need the resulting bar when the int parameter is 10:     var bar = fooObject.PerformFoo(intParameter: 10);          //Act, we still needs to provide a callback to get the exception      fooObject.PerformFoo("SomeInvalidValueCausingAnException", errorCallback: (error) => { exceptionThrown = error; });       So the questions would be:   * Does this make the tests more readable?   * Is it easier to get what the test really tests?   * The fact that we call `PerformFoo`, which doesn't really exist on the class under test make the test less worth as an documentation?   * Would dropping the extension method for a regular method taking the fooObject as the first parameter be less of a 'lie'? (e.g. `PerformFoo(fooObject, intParameter: 10)` ) How far would you go to make your tests clean and clear?


title: Least Change Problem with Thousands of Denominations

text: In a hypothetical economy there are currency units that can represent thousands of different values. So, for example there might be coins worth 1c, 3c, 5c, 7c, 7.5c, 80c, 8001.5c etc. Given a list of all of the possible denominations and an arbitrary value how would one return a list of coins representing the smallest number of coins needed to match that value. For bonus points, imagine that you have arbitrary finite quantities of each currency. So you may have only two 3c coins but thirty 18c coins. Sounds like a nightmare compsci class problem but it's something I ran into recently on a personal project of mine. The economy is a barter economy (tf2) in which every type of item has a distinct value relative to other items. I have an Item class where items have a Value attribute and this attribute is a double that represents the value of the item relative to a base item which has a value of 1. I'm trying to come up with a way so that if someone makes an offer of a value of 30 I can then look through a list of around 1200 item objects and find the smallest set of objects which combine in value to match 30. I cannot think of a remotely efficient way to do this, but I figured the problem was interesting enough that someone would like to ponder over it with me. My program is in c# but even a psuedocode brainstorm would be helpful.


title: MVC Pattern, ViewModels, Location of conversion

text: I've been working with ASP.Net MVC for around a year now and have created my applications in the following way. > X.Web - MVC Application Contains Controller and Views > > X.Lib - Contains Data Access, Repositories and Services. This allows us to drop the .Lib into any application that requires it. At the moment we are using Entity Framework, the conversion from EntityO to a more specific model is done in the controller. This set-up means if a service method returns an EntityO and then the Controller will do a conversion before the data is passed to a view. I'm interested to know if I should move the conversion to the Service so that the app doesn't have Entity Objects being passed around.


title: Migrating legacy procedural code to MVC without rewriting

text: I recently started working on a PHP application that was built many years ago before the advent of objects and namespaces in PHP. The code is procedural, does not separate presentation logic from business logic, lacks a front end point (front controller), and has files everywhere with a seemingly random folder heirarchy. However, it works great for customers and despite the code mess it's actually pretty fast. I'd like to slowly move the codebase into something more maintainable and organized. I put MVC in this title, but truthfully all I really mean is an organized and maintainable. Key objectives of this effort are:   * Not degrade the customer experience in any sort of way while this overhaul takes place (a rewrite is not an option)   * Fully separate views from logic    * At least have a "best practice" or method for implementing new application end points (routes)   * Have a consistent method or layer for persisting data   * Begin encapsulating as much code as possible in objects so that unit testing is feasible at some point in time.


title: How can a web site be set up using the MVC Pattern? (Without MS ASP.NET MVC)

text: We used a contractor to create the initial version of our site; they used their own MVC-pattern code-generator to create the (ASP.NET / C#) site and customized from there. That was turned over to us two years ago, and we've been working on it since. That's the environment I'm coming into, with little practical MVC experience. Thus I need to grok MVC in general but it seems that every article/tutorial/book I find is either extremely general in nature or very specific to MS ASP.NET MVC. Can someone here help with examples, a tutorial or walk-through of setting up a basic site using the MVC Pattern _without using Microsoft ASP.NET MVC_ so that I can better understand the concepts and see how they can be applied in real life?


title: How to incorporate existing open source software from a licensing perspective?

text: I'm working on software that uses the following libraries:   * Biopython   * SciPy   * NumPy All of the above have licenses similar to `MIT` or `BSD`. Three scenarios:   1. First, if I don't redistribute those dependencies, and only my code, then all I need is my own copyright and license (planing on using the `MIT License`) for my code. Correct?    2. What if I use py2exe or py2app to create a binary executable to distribute so as to make it easy for people to run the application without needing to install python and all the dependencies. Of course this also means that my binary file(s) contains python itself (along with any other packages I might have performed a `pip install xyz`).   3. What if I bundle Biopython, SciPy, and NumPy binaries in my package? In the latter two cases, what do I need to do to comply with copyright laws.


title: IDEs for dynamic languages - how far can you get?

text: I find it frustrating how the speed of development that dynamic languages should offer gets significantly compromised by the lack of completions and other assets that IDEs would give you in their static counterparts. It's not just about typing less - it's the productivity boost and plain fun you get by browsing APIs without constantly having to refer to a documentation that is not integrated with the editor. To date all IDE + dynamic language combinations -which to be fair aren't that much- I've tried were:   * buggy   * slow   * clueless/overenthusiastic (as in showing all completions ever possible)   * or simply not as complete as, say, Eclipse + Java. I'm aware that dynamic code analysis is not a trivial task. But one can't help wondering - _is this piece of code really so hard to figure out_? So my question is: **Have any particular IDEs (or less all-in-one setups) achieved a totally outstanding support for a dynamic language, or is this still an 'unsolved' problem?**


title: Implenting ActiveRecord with inheritance?

text: I recently converted an old application that was using XML files as the data store to use SQL instead. To avoid a lot of changes I basically created ActiveRecord style classes that inherited from the original business objects. For example               SomeClassRecord :SomeClass     //ID Property     //Save method      I then used this new class in place of the other one, because of polymorphism I didn't need to change any methods that took SomeClass as a parameter. Would this be considered 'Bad'? What would be a better alternative?


title: Questions about the issue of getting stuck in a problem, and making snail's pace progress

text: Let me describe my background. I am currently a software developer co-op working at an architecture firm that has a large focus on research and development, mainly in mathematical modeling and physics simulations in better aid architecture design. I am one of the three main software developers. Realistically, we're all people that specialize in different topics, for example, one developer is an architect that's been programming and doing mathematical models since he was in high school (he's like 30 years old), and the other architect also has a Masters in data analytics. We all specialize in different things, making us part of a very multi-disciplinary group of nine people in total. Currently I am working on a project that handles Grasshopper 3D and Rhino 3D programming, making use of the Grasshopper SDK. I really enjoy what I am doing and appreciate the learning opportunity, however, with that said, the nature of Grasshopper programming has been difficult for me. I don't think I am that poor programming-wise, however, since most of my projects involve extending functionality beyond what the default Grasshopper SDK does, there are often times I have to spend a good couple hours or even days to understand a problem and then apply code to it. The very nature of this "functionality beyond what the default Grasshopper SDK provides" means that finding a solution to a problem isn't as simple as Googling, because of the relatively rare resources available, whether it's documentation or help threads online. The nature of getting stuck on an issue and the only remedy to said problem has been slowly chipping away at my confidence, and I evidently see that I am slowing down in shipping out components (that's what Grasshopper 3D "tools" are called). I've already made a good impression in the first couple months of my co-op in being known as efficient, quick, and comprehensive, however, in my three month review, once I began this task of working on Grasshopper programming, my advisors have noticed that my progress has not been as quick, and they mentioned that they are wondering what/where better to put me to work on that will bring out my full potential. I like the idea of working on another project, but I do not wish to do so until I've finished the current one I am on, which day by day I feel like I am making snail's pace progress because of some issues I am stuck with where finding help is a problem in itself. I dislike making a bad impression on my colleagues (and on my school as well, since I am a co-op employee), as I really believe I have the potential to do great. However, this issue of getting stuck on something, making small progresses, then getting stuck again, is simply chipping away my confidence. What are some things I can do? I feel like once I am stuck on a problem, I find myself closing up, unable to voice it, as if asking for help is a sign of incompetency.


title: What features should a programming language have to say it has good reusability?

text: What should a programming language have so that it can be said to promote good reusability? Only generics and functions come to my mind when I hear the word reusability. What else make a programming language good for writing easily reusable code?


title: Is it possible to call a Javascript function from C?

text: I'd like to find a way to call Javascript functions from C. Are there any language bindings available for this purpose? I'm trying to make a library of Javascript functions accessible from C. (Something like a C -> Javascript foreign function interface would be suitable for this purpose, but I haven't been able to find one so far.)


title: Switching domains in one's career?

text: I have been a C++,Qt programmer for the last 3.5 years and have hit a plateau in terms of doing something new. Work has been repetitive and routine. I personally believe it is time to move on but off late I am getting more offers in mobile development like Android,Iphone etc. The latest offer I have is for objective-C based profile. I do not have the slightest idea about objective-C apart from that it is Object oriented C resembling C++ but not exactly a clone. Questions in my mind are   * what are the pros/cons of this careers switch or for any such switch?    * Is it good for one's career to change domains after sometime?   * How difficult it is to get back to one's previous area of proficiency? Thanks


title: Should we ever delete data in a database?

text: I am new to databases and trying to understand the basic concepts. I have learned how to delete data in a database. But one of my friends told me that you should never delete data in a database. Rather, when its no longer needed, it's better to simply mark it or flag it as 'not in use'. Is that true? If so, how would a big company like IBM handle their data for a hundred or more years?


title: Mutable and Immutable version of Collection implementations or both stuffed into one via .makeImmutable()

text: I am currently working on a collection implementation in JavaScript. I need a mutable and an immutable version of that. So what I thought of first was something like:   * _Collection_   * _MutableCollection_ extends _Collection_   * _ImmutableCollection_ extends _Collection_. My main issue with this is that if I want to implement more specific collections like _List_ or _Set_ , they could still inherit from _Collection_ while their Mutable/Immutable implementations could not inherit from _MutableCollection_ / _ImmutableCollection_. So this made me think whether having all three, _Collection_ , _MutableCollection_ and _ImmutableCollection_ would actually bring any significant benefit. An alternative approach which came to me would be to only have _Collection_ and then have a _Collection.prototype.makeImmutable_ or _freeze_ there. I would then also introduce a _Collection.requireMutableInstance( collectionInstance )_ which can be used in functions explicitly requiring a mutable collection. Here are my main concerns about putting everything into just _Collection_ :   * The prototype definition is getting much bigger compared to defineing a _MutableCollection_ prototype as well which would then hold the code of all the operations for alteration. I guess I could solve this by just defining a second file anyhow which would then just extend the basic _Collection_ definition with those additional operations and the _makeImmutable_ operation.   * Documentation of those function signatures that actually care about mutable vs. immutable and not just require the basic collection would look less pretty. Take:               /**      * @param {MutableCollection} collection     /*     function messAroundWithSomeCollection( collection ) { /* ... */ }      vs.               /**      * @param {Collection} collection A collection not yet made immutable.     /*     function messAroundWithSomeCollection( collection ) { /* ... */ }      What would be the more _natural_ way of doing this in JavaScript? Especially without having interfaces I can check against and considering the flatter chains of inheritance if I would also implement a _Set_ and _Map_ collection, the everything-in-one approach seems more intuitive to me.