title: Why is there no WSDL type support for Web Api?

text: So I am just getting started with .Net WebApi and one thing that I am noticing straight away is that there is no Contract defining how the Api looks and should be consumed (Request/Responses from each Action), this is usually in the form of a WSDL for WCF/Soap. It seems to me like this is something that would be very valuable and make life a lot easier for consumers of your Api. Is there a reason there isn't one? Is there a programming paradime or principle that I am unaware of? Is there a way I could create one?


title: Should all programmers learn at least one very-high-level language?

text: One mandatory course I took in uni was about functional and logical programming languages (Haskell and Prolog). It was mildly interesting, and most I talked to showed even less interest to the course (or even to learning any very-high-level languages, for that matter). The general consensus was that it is enough to know the common languages such as C, C++, Java, Python, etc. But are these kinds of languages underestimated? Should all programmers learn at least one very-high-level language, even though he or she may never have any practical use of it?


title: Can increased usage of higher and higher programming languages lead to a deficit of programmers with computer architecture knowledge?

text: Quote from Wikipedia of the article "High-level programming language": > A high-level programming language is a programming language with strong > abstraction from the details of the computer. In comparison to low-level > programming languages, it may use natural language elements, be easier to > use, or be more portable across platforms. Such languages hide the details > of CPU operations such as memory access models and management of scope. I.e., as the level of programming language increases, the further away the programmer goes from the hardware on which the program runs. Now I do not know the statistics of language usages across levels, but I would suspect that the higher level languages more and more are replacing the lower level languages. If so, can this lead to a deficit of programmers with computer architecture knowledge? Would this be a problem for the industry?


title: Version Control Workflow (Subversion)

text: I've been learning how to use subversion and would just like someone to clarify whether or not my understanding is correct?   1. Create a master repository at a given location (be it on a webserver or local).   2. Add/import files into said repository   3. Checkout a copy of the repository to work on (or specific files) to a working directory.   4. Change/work/add certain files.   5. Commit changes back to the master repository (With a note explaining changes, though changed files are noted, right?)   6. Happy days... Assuming this is correct, I have a few questions. **When working in a team, what happens when several people are working on one project and change the same files in different ways in one day?** **Surely when these changes are commit, they will overwrite each other?** **How should one go about testing their changes before commiting back to the master repo?** **Using PHP for my example, should the 'working' directory be in my xampp folder so I can test before commiting. Or should there be two "master repo's" on a webserver - one for testing and one for production?** Apologies for the novice questions - there don't seem to be many tutorials or documentation that cover the basics - I understand the concept of source control for the sake of reverting, tracking changes and what not, but maybe need some clarification on how teams can use it effectively. If the idea is that one person should only ever be working on a single file at a time that just seems a bit... odd. If you're working with an MVC architecture, I can see the need for common views and controllers to be needed to work on by several people.


title: How much control can I expect to have over my work environment?

text: Currently I'm a student, but I'm about to go look for a job next semester, and I'm a bit worried that the jobs I'll get will have me stuck with a table that is too high, screen that is too low, and a chair that barely supports my back. This is pretty important to me since I already experienced various computer use pains due to a bad setting, and I really don't want this to be an issue when I apply to jobs. So I was wondering, how much control can I expect to have in the work place over the furniture/equipment I use? I assume that it's not a big deal to plug in your own mouse/keyboard, but what about bringing your own chair, and maybe screen(s)? I'm guessing that the desk is usually hard/impossible to modify, but is it completely unheard of? And would the work environment ever be a deal breaker for you?


title: OnClickListener good practice

text: Which one of the ways has better performance, or is a good programming practice, making the holder activity extend `OnClickListener` and make a `Switch()` clause for `getItemId()` or making one `OnClickListener` for each one of the buttons or widgets that need it or making separated classes in the same (or another) package that implements `OnClickListener` and instance them in the activity?


title: Can an object oriented program be seen as a Finite State Machine?

text: This might be a philosophical/fundamental question, but I just want to clarify it. In my understanding a Finite State Machine is a way of modeling a system in which the system's output will not only depend on the current inputs, but also the current state of the system. Additionally, as the name suggests it, a finite state machine can be segmented in a finite N number of states with its respective state and behavior. If this is correct, shouldn't every single object with data and function members be a state in our object oriented model, making any object oriented design a finite state machine? If that is not the interpretation of a FSM in object design, what exactly people mean when they implement a FSM in software? am I missing something? Thanks


title: Interviewing consultants

text: I've interviewed a number of candidates for salaried positions. I was recently informed that we are hiring a consultant for a few months to help us develop a native iPhone application. We are a .NET shop and none of us have any experience with iPhone development. I've also heard rumors that we are planning to hire more consultants in the future to help develop on other various platforms. How should I interview these consultants, considering that I have no experience with this type of development? Without regards to platform specific questions, what are the things I need to keep in mind when interviewing consultants? Normally when I interview candidates, I'll ask questions that I know the answer to. I would never ask a candidate something that I don't know how to answer. Since this is a different situation, what do I need to ask in order to make sure they are subject matter experts in their respective fields? Is it appropriate to ask specific questions that we'll need to eventually solve during the interview?


title: generic programming- where did it originate?

text: Im trying to work out if generic programming was a functional programming feature which was then introduced into Java, C++ and C# or did the latter copy it from the functional programming languages like Haskell, Lisp, OCaml etc? Google is giving me lots on what generic programming is, but not where it originated. All I can see is that Ada implemented it early on. Would you class it as a functional programming technique?


title: Algorithm for searching the neighbors neighbor of a directed graph

text: Is there an algorithm to search a directed graph (tree) for its neighbors neighbor? My current brute-force solution works as follows:               for each node n:        for each child c of n           for each parent p of c              if (p != n)                insert edge (p,n)      I am dealing with ca. 700.000 nodes each having between 1 to 1000 edges and currently I am facing too long running times: which is mainly due to the reason I am executing this algorithm on a graph database, since it would require too much memory.


title: Client/server model where the server rejects connections from *newer* clients

text: I'm using a piece of commercial software where the server will reject any attempt to connect to it from a _newer_ client. In other words, you can use version 8 of the client to connect to a v10.0 server, but not version 10.1 of the client. Obviously, this software is what it is. But why would it be designed that way? Why would clients not be backwards compatible? What benefits (if any) does this arrangement have? This setup just seems very counter-intuitive to me, and I want to try and understand it. (The software happens to be a database, but I don't think it matters to the question.)


title: Designing javascript chart library

text: I started coding a chart library on top of d3js: My chart library. I read Javascript API reusability and Towards reusable charts. However, I am NOT really following the suggestions because I am not really convinced about them. This is how my library can be used to create a bubble chart:                   var chart = new XYBubbleChart();         chart.data = [{"xValue":200,"yValue":300},{"xValue":400,"yValue":200},{"xValue":100,"yValue":310}];  //set data         chart.dataKey.x = "xValue";         chart.dataKey.y = "yValue";         chart.elementId = "#chart";         chart.createChart();      Here are my questions:   1. It does not use chaining. Is it a big issue?   2. Every property and function is exposed publicly. (Example: width, height are exposed in Chart.js). OOP is all about abstraction and hiding, but I don't really see the point right now. I think exposing everything gives flexibility to change property and functionality inside subclasses and objects without writing a lot of code. What could be pitfalls of such exposure?   3. I have implemented functions like: zooming, "showing info boxes when data point is clicked" as "abilities". (example: XYZoomingAbility.js). Basically, such "abilities" accept "chart" object, play around with public variables of "chart" to add functionality. What this allows me to do is to add an ability by writing:              activateZoomAbility(chartObject);      My goal is to separate "visualization" from "interactivity". I want "interactivity" like: zooming to be plugged into the chart rather than built inside the chart. Like, I don't want my bubble chart to know anything about "zooming". However, I do want zoomable bubble chart. What is the best way to do this?   4. How to test and what to test? I have written mixed tests: jasmine and actual html files so that I can test manually on browser.


title: Recommended order for learning design patterns?

text: I can't help but notice the amount of design patterns that are out there. Does anyone have suggestions on an order I should learn them in? Or should I pick and choose them at random? The only one I know, so far, is singleton.


title: Strategy for designing a plugin API

text: I am working on an application for which a rich plugin API is crucial. What is the best process for creating an API that is intuitive and easy to learn?


title: How much WinDbg I should know?

text: I have started learning WinDbg, and it seems to be big world. I wonder how much WinDbg I should know to be able to use in practical world. Secondly, please suggest good material to understand WinDbg.


title: QlineEdit: No such file or directory

text: I have a problem. I have QT 5.3.1 and Ubuntu 14.04. For example:               #include <QWidget>     #include <QHBoxLayout>     #include <QVBoxLayout>     #include <QPushButton>     #include <QLabel>     #include <QPixmap>     #include <QImage>     #include <QComboBox>     #include <QFileDialog>     #include <QlineEdit>     #include <QLabel>     #include <QFile>     #include <QIODevice>     #include <QSlider>     #include <QMessageBox>      Works well. The problem is the following line:               #include <QlineEdit>      Compilator return error: QlineEdit: No such file or directory. How do I fix this?


title: Processor architectures for testing C/C++ portability

text: Currently I'm working on a C/C++ code-base which is fairly portable, it can compile on most Unix like systems as well as MS-Windows (MSVC), using various popular compilers. Previously I've found testing on different OS's and architectures can help find obscure bugs or bad assumptions. I worry with the dominance of x86/amd64 our code-base may unknowingly become less portable. Besides testing on a big-endian system (to find obvious errors with big/little endian), are there some architectures which have characteristics making them better for stress-testing software portability? Examples of possible differences.   * different endian.   * different behavior when threading.   * behavior of stack memory.   * size of primitive types (char, short, int, long, float... etc).   * alignment/padding of structs (which might hide errors).   * difference in optimizations made by the compiler. Are there some architectures which have more significant differences to x86/amd64, making them better candidates for exposing code portability issues? (and have C/C++ compilers and libraries - libc, libstdc++). Asking because its a sizable time-investment to setup a new system, even if its emulated. * * * _in case its not clear what I mean by processor-architectures, eg (x86, amd64, ia64, mips, risc, arm, m68k, ppc, itanium)_ * * * _Note, I'm not proposing this as a primary way to discover bugs, we run multiple static analysis tools and tests, but in the past we have found errors in code because of differences in less common platforms (SGI, SPARC, Solaris, BSD's etc. However some of these systems are fading out of use)_


title: In an enterprise setting, does one apply BDD principles alongside of, or instead of, "traditional" unit testing?

text: I have a problem visualising how the gap is closed between coarse-grained, n-tier boundary, high level, automated acceptance testing and lower level, task/sub-task scope Unit Testing. My motivation is to be able to take any unit test in my system and be able to follow backwards, through coverage, which scenario(s) make use of that unit test. I am familiar with the ideas of `BDD`: An extension of `TDD` and writing scenarios at the high level solution design level in the `Gerkin` format, and driving these scenarios using tools such as `JBehave` and `Cucumber`. Equally, I am familiar with the humble unit test at the utility or task level, and using `xUnit` to test through the various paths of the function. Where I begin to come unstuck, then, is when I try to imagine these two disciplines applied together in an enterprise setting. Perhaps I am going wrong because you tend to use one approach or the other? In an attempt to articulate my thoughts so far, let's assert that I am right to believe that both are used. In an `agile` world, `user stories` are broken down into `tasks` and `sub- tasks`, and in an enterprise setting, where the problems are large and the number of developers per `story` are many, those tasks and sub-tasks are distributed amongst a team of people with specialist problem solving skills. Some developers, for example, may specialise in mid-tier Development, develop a `controller` layer and continue to work downwards. Others may specialise in UI development and work from a `controller` layer upwards. Developers may therefore share implementation of a single string of tasks which, when glued back together again, will implement the `story`. In this case, it seems to me that cycles of `TDD` at the task and sub-task level is still necessary, to ensure that the efforts of these developers collaborate correctly within one layer and from one layer to the next (mocking collaborators). Working in this way implies a certain amount of high level solution design up- front, so contracts between layers are agreed and respected. Perhaps this is articulated as a `sequence diagram` and perhaps this emerges during the `task` breakdown session for the `story`. Yet, on the other hand, we have the value of defining the `BDD` acceptance tests at a higher level to configure that all of the blocks work together as expected - a form of super Integration Test, I suppose. I suppose the answer I am looking for here, aside of the simpler yes/no to the question of "both", is an explanation/worked example of how I and a team of developers start out with a single n-tier scenario and end up with an implementation in an enterprise setting, where we've been able to break the tasks up into layers and share them amongst ourselves and work in parallel to turn the `BDD` scenario test from red to green, all the while ensuring that the the code we write is only written because the scenario calls for it, and at a fine grained level the code we have written is appropriately unit tested following cycles of `TDD` at the task and sub-task level as we go. If, of course that is _correct_?


title: Transitioning from Java & C to C++

text: I learned Java and I'm pretty competent programming in it. I also learned C recently. I looked at a comparison between Java and C++ and I like C++'s features like operator overloading and its speed. So, C++ is an OOP language, but it also has all the things java doesn't have and C does, like pointers and memory allocation. Do I need to change something in my OOP design to consider pointers and memory allocation? If so, what do I need to change? If not, why not?


title: Licensing code from my personal project to my company via an open-source license

text: I'm currently working on a certain problem for my company (i.e. where I work for hire and don't own the code I produce in any way). It appears, that in one of my past (or, who knows, maybe still present) personal projects there are a few useful source code files that should help with the problem I'm working on. Neither that personal project nor the company project are open source, and they are not going to become so in foreseeable future. I would like to import that (small) part of my personal project into the company's source tree. But since I'm not yet calling my project RIP, I'd like to give them the code in the way that I retain my copyright over the code. And, of course, they would need to have the copyright over the code as well - luring them into a trap is definitely not my intention. In that regard I would like to give them any right I can - to modify, run, distribute, use in other projects etc., but not to deprive me of the same rights. And I don't care if that (again, small) part of my project becomes publicly available eventually. The solution I currently have for this is:   1. Put the copyright information along with the license into every source code file I'm about to import.   2. Commit this to my Git repository (hosted privately).   3. Import the specific files and commit them their repository (hosted as GitHub private repository). The licensing text I'm using is based on MIT license, but slightly modified (I added the third paragraph), here it is:               # Copyright (c) 2013 Real Developer Name     #     # Permission is hereby granted, free of charge, to any person obtaining a copy     # of this software and associated documentation files (the "Software"), to deal     # in the Software without restriction, including without limitation the rights     # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell     # copies of the Software, and to permit persons to whom the Software is     # furnished to do so, subject to the following conditions:     #      # The above copyright notice and this permission notice shall be included in     # all copies or substantial portions of the Software.     #     # The above exclusively applies to files containing this copyright notice, and     # does not apply for the rest of the software package containing these files.     #     # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR     # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,     # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE     # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER     # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,     # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN     # THE SOFTWARE.      So, the questions are:   1. Most importantly, will this measure protect both parties from the possible legal issues?   2. Is the fragment I added (the third paragraph) necessary and/or useful? Can it be improved?   3. Is it a generally good idea to give your own code to your company to speed up development (assuming that my and their projects will never ever compete)?


title: Can I test effectively javascript functions with a PHP unit-testing framework?

text: If I want to unit-test some of my javascript functions, would it be more efficient (and doable) to use the already installed PHP unit-testing framework, or should I use a javascript unit-testing framework? **EDIT:** It seems I have to clarify things a bit. I'm using javascript for form validation. It seems that some logic doesn't work as I want it to be, and I thought to myself that would be a good point to begin to use unit-testing (something that came to my scope only recently). I already began to use SimpleTest on a little project of mine, but never to test logic that is generated client-side. Now I know that SimpleTest have the possibility to emulate a browser for example. But I was wondering what other method would they be to unit-test my form validation. While I was searching for idea, I realized that there is also unit-testing framework for javascript, but after a bit of searching on some of the SE sites, I didn't find anything about use of PHP and Javascript Framework together, so I wondered how common such a situation it was, and how do other people manage in such an environment.


title: initial Class design: access modifiers and no-arg constructors

text: Context: Student working through Class design in personal/side project for Summer. I've never written anything implemented by others or had to maintain code. Trying to maximize encapsulation and imagining what would make code easy to maintain. Concept: Tight/Loose Class design where Tight and Loose refer to access modifiers and constructors. Tight: initially, everything, including setters, is private and a no-arg constructor is not provided (only a full constructor). Loose: not Tight Exceptions: the obvious like toString Reasoning: If code, at the very beginning, is tight, then it should be guaranteed that changes, with respect to access/creation, should never damage existing implementations. The loosening of code happens incrementally and must be thought through, justified, and safe (validated). Benefit: Existing implementing code should not break if changes are made later. Cost: Takes more time to create. Since this is my own thinking, I hope to get feedback as to whether I should push to work this way. Good idea or bad idea?


Is it possible to build a custom email client for Gmail using Java APIs? Or only Google can do that?


title: Efficient Bus Loading

text: This is something I did for a bus travel company a long time ago, and I was never happy with the results. I was thinking about that old project recently and thought I'd revisit that problem. ## Problem: Bus travel company has several buses with different passenger capacities (e.g. 15 50-passenger buses, 25 30-passenger buses ... etc). They specialized in offering transportation to very large groups (300+ passengers per group). Since each group needs to travel together they needed to manage their fleet efficiently to reduce waste. For instance, 88 passengers are better served by three 30-passenger buses (2 empty seats) than by two 50-passenger buses (12 empty seats). Another example, 75 passengers would be better served by one 50-passenger bus and one 30-passenger bus, a mix of types. What's a good algorithm to do this?


title: How to start a high school Java/Android development club for 13-17 year olds

text: My wife is a high school maths teacher, and is considering starting a programming club for 13-17 years olds who show an interest. Their interest seems to be around Apps and Android which I have little experience of. The kids would be (presumably) interested in programming, and have a fairly high level of computing knowledge. We would provide them with resources and some knowledge, but hopefully a lot would be self guided. I'm hoping stack overflow'ers can provide some tips or starting points. Specific things I think I'll need are;   * A development Environment; Currently I'm looking towards Java and Android, developed in Eclipse, probably installed on donated older hardware   * Some initial direction; There seem to be a plethora or 'start android' tutorials, so some recommendations for good ones are valuable, as are recommended paper books    * A Target; Some final project they should be shooting for   * A Route; This is where I'm most stuck, how to lead them through the required Java concepts and learning they would need Some related questions already out there   Language+IDE for teaching high school students?   Teaching "web design/development" to high-school home-school group. Good sources?   How can I bootstrap a software development community at my school?


title: Optimizing hash lookup & memory performance in Go

text: As an exercise, I'm implementing HashLife in Go. In brief, HashLife works by memoizing nodes in a quadtree so that once a given node's value in the future has been calculated, it can just be looked up instead of being re-calculated. So eg. if you have a node at the 8x8 level, you remember it by its four children (each at the 2x2 level). So next time you see an 8x8 node, when you calculate the next generation, you first check if you've already seen a node with those same four children. This is extended up through all levels of the quadtree, which gives you some pretty amazing optimizations if eg. you're 10 levels above the leaves. Unsurprisingly, it looks like the perfmance crux of this is the lookup of nodes by child-node values. Currently I have a hashmap of               {&upper_left_node,&upper_right_node,&lower_left_node,&lower_right_node} -> node      So my lookup function is this:               func FindNode(ul, ur, ll, lr *Node) *Node {             var node *Node             var ok bool             nc := NodeChildren{ul, ur, ll, lr}             node, ok = NodeMap[nc]             if ok {                     return node             }             node = &Node{ul, ur, ll, lr, 0, ul.Level + 1, nil}             NodeMap[nc] = node             return node     }      What I'm trying to figure out is if the "nc := NodeChildren..." line causes a memory allocation each time the function is called. If it does, can I/should I move the declaration to the global scope and just modify the values each time this function is called? Or is there a more efficient way to do this? Any advice/feedback would be welcome. (even coding style nits; this is literally the first thing I've written in Go so I'd love any feedback)


title: How should I deal with problems with completed stories in agile

text: I am new to Agile and scrum and want to ask few things. Suppose I havetwo user stories `1, 2` Suppose I finished `story 1` in sprint 1 but while doing `sprint 2` I did something which breaks something so that my things in `user story 1` broken and I need to spend more time on that again. What do I need to do for that case?


title: How to define the seams between the domain layer and a database full of stored procedures?

text: We have a legacy database full of stored procedures. These stored procedures are somewhat CRUD-categorized but upon inspection of some procedures, they are not "simple" as they might update, delete, whatever other records in other tables. So to my mind (correct me if I'm wrong) it would seem that using an ORM would be pretty difficult since   1. I can't access the tables directly: I must use a stored procedure   2. The stored procedures would not map to CRUD I'm leaning toward defining repositories to isolate the domain layer from the database but I fear that I would need to define a lot of infrastructure (caching, unit of work and the like) that I get for "free" in a ORM. Any insights?


title: Which Resource Would Be Best for Learning C# / .Net?

text: I'm a PHP / Java / Objective-C programmer, looking to finally learn some MS technologies, to increase my marketability, etc. I am looking at these two books, can anyone experienced in the field suggest one over the other, or another book that'd be good for learning C# / .Net, etc? What impressed me about "Pro C# 2010 and the .NET 4 Platform" thumbing through it at the bookstore, was that they explained a whole lot of the inner workings and paradigms of MS, not just the language. I haven't had a chance to look through the other one, and probably won't get a chance. Here are the two I'm considering: http://www.amazon.com/2010-NET-Platform-Andrew-Troelsen/dp/1430225491/ http://www.amazon.com/Professional-4-0-NET-Wrox-Programmer/dp/0470502258/ I know this is a very specific question, but I feel it can greatly benefit others like me, trying to get into some MS tech.


title: Does a GPL Bison grammar infect my application?

text: I am thinking about using a GPL Bison grammar for my own compiler. Will the grammar "infect" my parser such that it needs to be open source? The grammar - in terms of - the input of bison is GPL.


title: Can I use new BSD licensed library/code in commercial closed source project?

text: I've found freetype-gl library I want to use. It has new BSD license and I'd like to use it in my closed source commercial project. Can I do it?


title: On concatenating adjacent string literals

text: C and C++ compiles adjacent string literals as a single string literal. For example this:               "Some text..." "and more text"      is equivalent to:               "Some text...and more text"      In other languages like C# or Java this is a syntax error (which is perfectly fine BTW). What is the rationale/historical reason for C and C++ to do this?


title: Class of problems solvable by sed or stream editors

text: I've came across a question transform this text with sed [sed only] and it got me wondering what class of problems is solvable by stream editors or programs/computational models with similar constraints. For E.g Regular expressions can solve problems that require fixed/const amount of memory (Can solve all problems that have a Deterministic Finite state automa) My question is what are the computational limits/constraints of sed in particular and any stream editor in general and what class/classes of problems can be solved by it? (after mapping it some text alphabet set if need be)


title: Analyzing a programming language

text: In SICP, the authors state (Section 1.1) that there are three basic "mechanisms" of programming languages: >   * **primitive expressions** , which represent the simplest entities the > language is concerned with > >   * **means of combination** , by which compound elements are built from > simpler ones > >   * **means of abstraction** , by which compound elements can be named and > manipulated as units > > How can I analyze a mainstream programming language (Java, for example) in terms of these elements or mechanisms?


title: Justification for bidirectional relationship

text: I typically try and avoid bidirectional relationships at all costs. Recently I've been trying to follow a more domain centric design philosophy and I'm looking for advice in the best way to solve a specific problem. I am implementing a basic 2d grid. There are 3 basic classes, Item, Tile (has a list of Items), and World (has a 2d array of Tiles). I am struggling with where to put the move() method which moves an item from one tile to a neighboring tile. My initial inclination would be to place the move method in the Item class since it is the item that is actually moving. However, that would create a circular dependency. In the past I always worked with dumb objects in which case the move() method was in a higher layer (some kind of WorldManager or MoveManager) which knows about both tiles and items. I'm interested in what proposals others might have that can avoid the circular dependency while maintaining the domain-centric philosophy.


title: Website File and Folder Structure

text: I am having a problem learning how proper website structure should be. And by that I mean how to code the pages and how folder structure should be. Currently I am navigating around my website using GET variables in PHP when you want go to another page, so I am always loading the index.php file. And I would load the page I wanted like so:               $page = "error";          if(isset($_GET["page"]) AND file_exists("pages/".$_GET["page"].".php")) {              $page = $_GET["page"];          } elseif(!isset($_GET["page"])) {              $page = "home";          }      And this:               <div id="page">         <?php              include("pages/".$page.".php");         ?>     </div>      The reason I am doing this is because it makes making new pages a lot easier as I don't have to link style sheets and javascript in every file like so:               <head>         <title>             Website Name         </title>              <link href='http://fonts.googleapis.com/css?family=Lato:300,400' rel='stylesheet' type='text/css'>         <link rel="stylesheet" href="css/style.css" type="text/css">         <link rel="shortcut icon" href="favicon.png"/>              <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js" type="text/javascript"></script>         <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js" type="text/javascript"></script>          </head>      There is a lot of problems doing it this way as URLs don't look normal ("?page=apanel/app") if I am trying to access a page from inside a folder inside the pages folder to prevent clutter. Obviously this is not the only way to go about it and I can't find the proper way to do it because I'm sure websites don't link style sheets in every file as that would be very bad if you changed a file name or needed to add another file you would have to change it in every file. If anyone could tell me how it is actually done or point me towards a tutorial that would be great. Thanks for your time :)


title: Automated web tests depending on developer code

text: When QAs write automated selenium tests to test a multi-layered website (e.g. testing a web app which is on mvs design, spring and database) should the tests make use of existing classes and frameworks written by developers or should we write simplified classes to serve the test? The downside of relying of frameworks developed by devs, is if there is a logical error in the framework it will be present in the tests. a typical example is a class that fetches some links form a database and some framework printing them on the webpage. If the tests rely on the framework to define the expected results and then verify them against the output on the webpage, then if the logic in the framework is incorrect, then the defined expected results will also be incorrect and there is a risk that the tests will pass even though the results are wrong. In my opinion, the automated system tests written by QA should be independet on the underlying framework where as the automated unit tests should rely on the underlying framework. What are your thoughts?


title: Methods to secure user log-in's

text: I guess this question has been asked before, but I wish to have fresh answers/ideas - Problem details: Let's say there's a system which allows users to participate in a survey. Users will sign on to it using SSO (single sign on), or another way like user/password. AND, Let's assume this system is REALLY GOOD, everybody love it and there are tons of scammers who would like to cheat by logging in more than once, stealing identities.. etc. The big question: What would be the best method to use authenticating the users? Possible answers, I have brought so far:   1. Using social security id (or any other "government" official ID number)   2. Phone number (less intimidating.. but also less secure)   3. Email + one of the above. And here's a question about emails: If I am using SSO (login with email/facebook), can I determine that the accounts entered are being actively used?   4. Cookies/flash/storage/... can be used in combination with another, stronger identification method, but, since log-in's are not anonymous, browser storage/cookies are not the right method anyway. Any idea will be appreciated ! :)


For the bugs or issues, there are now many good issues trackers available which allows status and tracking issues and also allows you to organize it to manage specific releases. I am looking for test case tools should be able to support listing of functionality and test cases with possible linkage to them, allows test suits or test plans (as group/ hierarchies) to organize them. Some of the potential usage could be to identify list of key test cases that must be executed if particular functionality or modules are affected. Also Additional parameters to support related to system of execution. It would be best if result of execution of tests can be recorded with necessary comments. Web interface and possible email notifications could be essential. Please note that i am _NOT_ looking at test automation systems like cruise control etc. but more as a system for testing management. I am more keen to see a system that allows visualization of Traceability matrix. Open source projects are most appreciated, though please also suggest if there is commercial software. Are there any tools that allow you to track and manage test cases and test execution?


title: Is a predefined key enough security when performing HTTP requests between two secure servers?

text: I have an AdWords script that regularly transfers sensitive data to my server using a POST HTTP request. For security I have a predefined 32 character randomized string that is verified by my server before it accepts the data. **Is this secure?** I don't know too much about the HTTP protocol, but I know that the data is being sent unencrypted. Is it probable/possible for somebody to access the data during the request? From what I've understood, the HTTPS protocol is most useful when on an untrusted network where it's easy for anybody to spy on your packets. In my case, data is being sent from Google's servers to my host's servers (DreamHost in this case). Would it be prudent of me to upgrade to HTTPS, or would this be pointless? Are there any other security pitfalls I should be aware of? I will accept the first answer that clears up my situation.


title: CAPTCHA blocking for my scraping script?

text: I am working on a scraping project which involves getting web data and parsing them for further use. I have been working using PHP and CURL to make scraping scripts which crawls web data and I make use of either PHP Dom or Simple HTML DOM Parser library for these kinds of projects. On a recent project I encountered some challenges; initially I found the target website blocked my server IP such that the server could not make any successful requests to the site. Understanding these issues as common I bought a set of private proxies and tried to make request calls using them. Though this could get successful response, I noticed the script is getting some kind of blocks after 2-3 continuous requests. On printing and checking the response I could see a pop-up asking for CAPTCHA validation. I could not see any captcha characters to be entered and it also shows an error “input error: invalid referrer”. On examining the source I could see some Google recaptcha scripts within. I’m stuck at this point and I m not able to execute my script. My script is used for gathering data and it needs to go through a large number of pages periodically over the site. But in the current scenario I am not able to proceed with my script. I could see there are some options to overcome these captcha issues and scraping these kinds of sites too are common. I have been checking my script performance and responses over last two months. I could see during first month I was able to execute very large number of requests from a single IP and I was able to get results. Later I get an IP block and used private proxies which could get me some results. Later I am facing now with the captcha trouble. I would appreciate any help or suggestions in this regard. (Often in this kind of questions I used to get a first comment as, ‘Have you asked for prior permission from the target?’ .I haven’t ,but I know there are many sites doing so to get the details out of sites and target sites may not often give access to them. I respect the legality and scraping etiquettes but I would like to know at what point I stuck and how could I overcome that! ) I could provide any supporting information if needed.


title: What can a web developer learn from working in IT support?

text: I'm a senior studying CS and slated to graduate in about a year. I'm planning to become a web developer, but I have an opportunity to spend more time working in an IT support role. That seems like a detour from my chosen career path as a web/application developer. Is this true, or are there valuable skills I could pick up from a few years in IT?


title: Open source code with no license... can I fork it?

text: A few years ago somebody created a bunch of really awesome and quite popular shell scripts. They don't work in the latest version of Mac OS X, because a filepath has changed. All you need to do is edit the file path (in four different places) to make them work again. The code is posted on a private website without any source control, the author hasn't updated them in almost a year, and this bug is fairly long standing now. It is clearly open source, and intended to be used/modified/whatever, but he hasn't released it under any license. I want to fix the bug, and post it on GitHub, preferably under a public-domain style OSS license. I wonder what the legal ramifications might be? The code is fairly simple (under 300 lines), but I couldn't rewrite it without reading every line of his code first. At the very least it needs to be moved to a website that will not vanish at any time (there is a tilde in the URL... university account?), and the bug needs to be fixed since many of the target users don't know how to go in and fix it. I have sent an email to the author, but my experience is when simple bugfixes aren't being applied to popular project, emails will never receive any response. For the purpose of this question, lets assume he will not reply to my email.


title: Why does everybody write to-do comments in capital letters?

text: I'm doing the same. When there is something "to-do" in my code, I write `//TODO ...`. But I'm curious to know when this started and if there is a reason for writing "to-dos" in all capital letters?


title: Does business logic really belong on the server?

text: A typical stack for a web application is a database, a server with server-side code, and a user with a browser with HTML/CSS/JavaScript. Before extensive AJAX, MVC in which the controller was the server-side code rulled. A server had to route answer requests for Dynamic web pages (i.e. templated html solutions like JSP and ASP). The server to coordinate the calls to the database and decide which dynamic page to use to answer the page request. The result of all of this is that server ended up containing the business logic, even though business logic isn't strongly tied to the idea of serving pages. Now that we are moving to "Web 2.0" a server servers static pages that use JavaScript to fill themselves and change what they are presenting. The can be in the JavaScript. The JavaScript often implements a RESTful service meaning that it is specifying database query. So the server is left to the roles of serving actual files and answering AJAX calls. And answering AJAX calls is merely session management and providing security. And really, what a user should even be able to see is data that should be specified in the database. So from there, should the server be relegated to the role of a dumb intermediary that only occasionally does something like send out an email or fire off a webservice? Could business logic all live in JavaScript (when it is not secret) or live in stored procedures when it is? Will it make sense to maybe even combine servers and databases or make ERP solutions like SAP function as servers?


title: strcpy memcpy reason for parameter order

text: Answering a question about order of parameters it struck me that strcpy (and family) are the wrong way round. Copy should be src -> destination. Is there a historical or architectural reason for the dest,src order in these 'C' functions? Something to do with optimization of the stack on the PDP-8 or something?


title: How should I implement code review in this situation?

text: My question is about how to put code review into practice in a workplace where nobody else has asked for it, I've never done it before, and I'm not entirely sure if it's worthwhile for this type of programming. I'm a contractor on an assignment that mostly involves tools engineering, data analysis, fixing code when someone's Excel template changes break a macro, etc. It's total cowboy coding: Requests are more "do what you need to do to hack together something that works ASAP, we need it in production tomorrow morning and we're only going to need it for a couple months" than "make a well-structured application that will be easy to maintain and develop under all foreseeable circumstances." The software engineering team is me and one other guy whom I supervise. We don't currently follow any kind of software development methodology beyond "make something that fulfills the functional requirements", and neither of us have ever worked anywhere that had any code review or design principles. Everything we make is either VBA or C# desktop apps, and each of us is usually working on a separate assignment rather than collaboratively building the same program. There is no version control system in place and we don't have server access to install any such system. What I'm trying to figure out is, given that the work is very ad hoc, what kind of code review, if any, should I put in place? Or is it even necessary for the kind of work we're doing?


title: What does "context-free" mean in the term "context-free grammar"?

text: Given the amount of material that tries to explain what a context-free grammar (CFG) is, I found it surprising that very few (in my sample, less than 1 in 20) give an explanation on why such grammars are called "context-free". And, to my mind, none succeeds in doing so. My question is, why are context-free grammars called context-free? What is "the context"? I had an intuition that the context could be other language constructs surrounding the currently analyzed construct, but that seems not to be the case. Could anyone provide a precise explanation?


title: Why is a click event triggered only after mouse click and release?

text: Every click event on the web works on mouse click and release. Is there a way to do a action on a click event before mouse release??


title: Good guidelines and practices for mandatory code review

text: We are trying out mandatory code review on each commit -- nothing gets into master that hasn't been validated by at least 1 person not the author -- for a couple of sprints. We have buy in from both developers and management (which is an amazing situation to be in) and we want to get some of the benefits that it is known for:   * obvious bug reduction   * more awareness of changes happening around the project   * the "I know someone is going to look at this so I won't be lazy"/anti-cowboy effect   * increased consistency within/across projects But we're introducing something that is _known_ to reduce velocity, and if done wrong could create a stupid bureaucratic step in the commit pipeline that doesn't do anything but take up time. Things that I'm concerned about:   * reviews devolving into just nit picking   * (hyperbolically) people opening up huge architectural issues as part of a two line commit review.   * I don't want to bias answers with other things. While we're all reasonable people and we'll be doing a lot of self analysis, we could definitely use some battle-won insight into what kinds of things we should be trying to accomplish in a review session to really make reviews work for us. What are some guidelines and policies that you have found to work?


title: Returning multiple values in Javascript

text: Often I am writing a function that returns multiple values, such as a pair of coordinates:               function get_coords() {       return ???;     }      If I was using a language like Python, I would use a tuple:               return (x, y)      Or, in an OOP language like Java, I would create a custom coordinate class:               class Coordinates {       public int x;       public int y;            public Coordinates(x, y) {         this.x = x;         this.y = y;       }     }      Then return like this:               return new Coordinates(x, y);      **On to JavaScript.** In JavaScript, we have the option of returning a simple object:               return {x: x, y: y}      or a Java-like approach, with a custom object:               return new coordinates(x, y)      Are there any reasons to use one above the other?


title: Why was ASCII needed?

text: With an encoding such as EBCDIC being in existence already (and being 8 bit to boot), what was the need to invent yet another encoding and a 7 bit one at that? Why was ASCII invented and what problems with EBCDIC did supposed to solve?


title: How to keep motivation in hobbyist programming projects?

text: There is already a couple of questions here about motivation, but they are related to programming as a job, teamwork and so on. I have been noticing, that in the past few years my motivation to code hobby projects is decreasing. It was already decreasing about something like 8 years ago, then it got better about 4 years ago, now it is starting to get bad again. Since I do not work, lack of motivation in a job isn't a problem. The projects I am interested in developing are a couple of computer games, and a ORM library for php. I want to program those things, but I feel like I lost the energy to do them. The symptoms are stuff like: unable to concentrate, coding for about 30 minutes then leave the project to do other stuff, loss of pleasure in doing the whole thing, among others. This thing bothers me, because it is (or used to be) something that make me feel happy and I don't wanna lose the good feeling of doing something that I like.


title: Responsibility for delegation of stories in agile

text: I've recently worked on a project where the Team lead was commenting he needed to figure out which stories we are going to be working on in a scrum. It was my understanding that stories are prioritized and perhaps a number of stories are added to a sprint from that list. At this stage during our scrum the developers each pick a story they are going to implement and off they go. I suppose if a number of stories have dependencies them the team lead might help facilitate the story priority within the sprint itself but not actually dictate which developer does which? None of us are juniors in the team and we all have equal knowledge about the domain. Our experience of particular facets of the layers i.e. UI, database, infrastructure vary but not dramatically so. So my main question is as to the role of a Team lead (and other developers I guess) within a sprint itself and delegation of stories. If it helps, the project was a MVC .NET application with some database backing. Our team consisted of 4 developers, 1 tester and a Project manager.


title: From Programmer to System Admin?

text: I know this sounds like a weird question, but do you think it's possible to go from a Programmer Job to a System Admin job? I mean the pros:   * You're a programmer, so you know scripting pretty well (for Cron Jobs/Bash Scripts)   * You usually know your way around a Unix System   * You could prolly debug stuff that isn't working.   * Most programmers are familiar with Computer Hardware   * You have a Degree which you worked hard for, and your familiar with setting up different software systems So do you think it's possible to go from a Programmer Job to a System Admin job? or probably not.


title: what is a proper way to register eventHandler

text: I was showing some of my code to a junior programer, and he asked me why am I registering functions for event handling like this:               button1.Click += new RoutedEventHandler(button1_Click);      and not like this:               button1.Click += button1_Click;      The only thing I could say was: because you just write `+=` and press tab two times... What is the difference between those two metods (if there is a difference)?


title: Can REST, Ajax and jQuery work well together?

text: I'm trying to use REST (usign spring MVC) as my Ajax backend but got some problems when using it with jQuery. REST best pratices recommend using HTTP status code, e.g. 200, 403, 401, etc, and I have no problem with a 200 status code, jQuery's ajax method have a done(data) callback that let me read the reponse in json format. But when I need to return some error in json format along with the status code, I got stucked. The fail(jqXHR, textStatus) callback doesn't seem to support json in the response. So if I return JSON from the serverside, it will be put in jqXHR.reponseText and treated as plaintext instead. So my question is, is REST good for Ajax? Why does jQuery treat the data differently in case of non-200 status code?


title: Patent in Europe

text: I'd like to build and sell/or free a software based on ffmpeg and some other mp3 library lgpl, So I know in U.s.a. there's a patent and royalty problem, But if I live in Europe I'd like to know if I can create software with mp3 encoder/decoder and mpeg decoder/encoder should I pay royalty? Or can someone (mp3/mpeg creator) put me in front a Court?


title: displaying multi-section html documents - best practices

text: I work at a research organization and we publish a lot of large-ish documents, usually organized in sections. What I want to know is how best to present these multi-section documents on our website. Presently, what I do is load the entire document as a single page, with each section as its own div. Then I show and hide divs as needed via a table of contents and "next" and "prev" buttons. The advantages to this are mainly: 1) that you can move between sections very quickly, 2) it produces consistent analytics (when a page is loaded, I know a report is being read). The disadvantages, however, are real:   * Readers can't take advantage of browser back/forward buttons to move between sections.   * It's complicated to create direct links to individual sections (I can do it with javascript but it's not easy for other people to grab and share).    * For long reports, you have to wait for the full report to load before you can move around (and that can include hordes of images and charts). Do other people have thoughts on better ways to organize this? Here's an example of the current system: http://massbudget.org/825


title: Is Microsoft Prism alive and active?

text: I've been doing a lot of reading these last two days on Microsoft Prism, but the thing I'm still not very sure of is what does the future look like for it? I know that version 4.1 was just released a few months ago, but besides Microsoft's own documentation, I haven't found many blog posts written in the last year on the subject, most of what I find is 2009-2010. It definitely looks interesting but the learning curve seems to be a bit steep and I wouldn't want to embark if it's going to become obsolete in the near future. Anyone has any insight on this?


title: Suggestions for a CMS markup language for PHP

text: As a learning experience, and as project, I am attempting to write a CMS module for ZF2. One of the functionality I would like to have is the possibility of adding dynamic contents in the pages by calling PHP functions in the view scripts. However, I do not want to give the users freedom in writing PHP code directly inside the page content, but rather implement custom view helpers (or widgets) to handle logic. For example: calling `partial`, `partialLoop`, `url`, etc. specifying arguments and all. I liked the idea of extending Markdown but this would get complicated when trying to add custom CSS class to elements, etc. Then I had the idea of simply doing a `preg_replace` on some patterns. For example, the string :               ### partialLoop:['partials/display.phtml',[{id:'p1',price:4.99},{id:'p2',price:12.34}]] ###      would be replaced by               <?php echo $this->partialLoop('partials/display.phtml', array(array('id'=>'p1','price'=>4.99),array('id'=>'p2','price'=>12.34))) ?>      Obviously, there would be some caching done so the page content is not rendered everytime. Does this sound good? If not, what would be a good way of doing this? Or is there a project already being developed for doing this? (I'd like to avoid heavy third party libs and something fairly or fully compatible with ZF2 would be nice.) Thanks.


title: dvcs - is "clone to branch" a common workflow?

text: I was recently discussing dvcs with a coworker, because our office is beginning to consider switching from TFS (we're a MS shop). In the process, I got very confused because he said that although he uses Mercurial, he hadn't heard of a "branch" or "checkout" command, and these terms were unfamiliar to him. After wondering how it was possible that he didn't know about them and explaining how dvcs branches work "in place" on your local files, he was quite confused. He explained that, similar to how TFS works, when he wants to create a "branch" he does it by cloning, so he has an entire copy of his repo. This seemed really strange to me, but the benefit, which I have to concede, is that you can look at or work on two branches simultaneously because the files are separate. In searching this site to see if this has been asked before I saw a comment that many online resources promote this "clone to branch" methodology, to the poster's dismay. Is this actually common in the dvcs community? And what are some of the pros and cons of going this way? I would never do it since I have no need to see multiple branches at once, switching is fast, and I don't need all the clones filling up my disk.


title: Storing and presenting custom table data

text: I have a web site upon which I want to provide users the ability to create tables of data. These tables will come from a predefined list of table definitions of which I will be adding to myself. This list will likely grown into the hundreds. The table definitions will be created as Java classes. They will define how many columns there are and their data types (string, numerical, boolean, pick from list). It will also predefine some columns as automatically calculated form other columns. The number of rows will be limited but this could range from 10 to 10000. Additionally I will give users an option to create a custom table type where they set the number of rows and columns and the column types (string, numerical, boolean, pick from list - no formulas). The tables must be sortable on certain columns (with secondary sort columns depending on the first). The data sorting will (probably) be done by the application rather than the database as it will include different logic in different table definitions. I might include a simple text search but not a filter. The table data may be updated but I expect this to be infrequent (days apart, mostly never). What I can't decide on is the best way to store this information. I am using a relation db (postgres). Since each row will be made up of various different column types I can't store the data in separate database rows with relevant field types for each column. On the web side I want the users to be able to view paged data. Users that don't have JavaScript enabled can put up with a basic table of paged data without sort options. Users with JavaScript enabled should have options to sort data. _Storage_ **Option 1** Create an XML doc containing all the data and store in one row of the database. This will be easy to read and write but means the entire web table must be loaded into memory even if only delivering a few rows to the browser. **Option 2** Create XML fragment for each row and store in separate database rows. Since data will be sorted by the application the order must either be calculated when the first page is displayed and then for further pages only the required rows returned, or when data is updated a predefined index is created for each sort option. The predefined index seems like the better option as it won't change often but will be read numerous times. _Delivery of data to the browser_ **Option 1** For JS enabled browsers get all the data using AJAX/JSON. The response would be cached on the browser and using JS populate a table with data. Further trips to the server shouldn't be required unless the data is updated (only detected when page is refresh using a last updated time embedded in the page). Subsequent visits to the page should use the cached copy of the data. **Option 2** Embed paged data in html. If JS is enabled then further updates using AJAX. I don't want to use HTML 5 offline storage to support older browsers. I think I have to go for both Option 2s to accommodate non JS browsers and to minimize the memory usage. Are there any other possible solutions?


title: Can symbolic AI 'learn' a data model?

text: Perceptrons, a simple form of supervised machine learning, must be trained with a set of known good inputs before they can "learn" by adjusting internal weights assigned to inputs, based on the accuracy of its results. Similarly, we know that reinforcement learning and unsupervised neural networks are able to learn without any known model of the problem; they can be designed to collect information about an environment only by interacting with it. Can symbolic AI be used to design a system that can achieve this "naive learning," or is this a property exclusive to certain soft computing techniques?


title: How to become a super user (programming)?

text: You try a new tool and it does not work. You google the problem and if you are lucky a random answer says you need to edit some weird configuration file and place it in a specific directory you don't know. You try but during the process things go wrong. Either because you don't understand the steps listed in the answer or because the solution is not exactly the same situation as yours. I can't be the only who is puzzled/annoyed when I am in these kind of situations. I find these problems a lot more scarier than when I don't understand a particularly algorithm. Often I can end up using 10 hours trying to get something to work without getting anything done. After that I just give up. I like programming but I really hate these moments when you need to integrate with a tool and you end up in situations as described. Often I don't even want to try new tools because I am afraid of this happening. My question is: Is there a way to get better at this? Is there a faster way to learn all this without just practicing? I have thought about getting books about unix and begin using the shell for every day use but I am not sure it is worth it.


title: How should I go about developing some basic C/C++ knowledge so that I can grok the concepts written in some Classic software programming books?

text: I know Java and JavaScript pretty well. I have never really worked on C/C++. But at this stage of my career I feel that the fact that I do not have adequate knowledge on C/C++ syntax(especially pointers *), I am missing out vital parts on reading some classic books in the field of software programming. Here are some of the books that I would like to read and understand thoroughly but unable to comprehend the example code as I do not know the C/C++ syntax:   1. Advanced Programming in the Unix environment where C is used.   2. GoF book where examples are in C++/Smalltalk .    3. Algorithm Design Manual by Steven Skienna where again C is used. I do not intend to work on C/C++ projects. So I do not want to spend a whole lot of time learning the intricacies of these languages but I would like to at least have some working knowledge so that I can understand at least 80% of the examples in those books. I do not want to miss out on the essence of these classic books. What should I do about this?


title: Best way for a technical manager to stay up to date on technology

text: My manager asked for a list of technical blogs he should follow to stay current on technology. His problem is he keeps hearing terms that he hasn't heard of (i.e. NoSql, sharding, agure, sevice bus, etc.) and he would prefer to at least have a fighting chance of knowing something about them without having to be reactive and looking them up. Also I think he wants to have a big picture of all the emerging technologies and where they fit in together instead of just learning about each thing in isolation. He asked about blogs but I'm thinking print magazines may also help. What should I answer him?


title: Do you use your personal laptop for work?

text: We're trying to get our company to let us use our own personal laptops for client work. We've agreed that any code/data will be encrypted using something like TrueCrypt, in case a laptop is stolen or lost. However, the company is still skeptical and not sure they want to allow us to use our personal machines for development. They would rather buy us laptops... but we want to use MacBook Pros and they don't want to pay for them. Even if they did buy us laptops, we would stil have the issue of needing to encrypt the code/data in case of theft/loss. Do you use your own laptop for work? What are the arguments for/against this? * * * **UPDATE:** Thanks for all the responses, its given us a lot to think about. This was originally brought up because we were asking for a "personal loan" to buy new laptops for ourselves, and then we threw in there that we would use these laptops for work too - since right now we use our personal laptops occasionally, e.g. at client site or weekend support.


title: Is agile about development or management?

text: On a debate over what Scrum is all about, I found that perhaps I totally misunderstood the agile thing. It appears to me that Scrum (which is certainly considered an Agile process) is all about managing features and sprints and roles and stuff with nothing to do with TDD, pair programming, CI, refactoring and other developer centric techniques and practices that I though (until now) are the heart of agile. Now I am facing a difficulty ! 1) Is Scrum agnostic to whether developers do agile practices? 2) Can you implement Scrum in a team that does not utilize automated tests? does not perform refactoring or does not adhere to the agile programming practices?


title: Agile MVP (Most Valuable Player/Programmer)

text: Recently I've been involved in an agile project (using scrum) where management came up with the idea that the team would nominate a developer 'MVP' as well as a QA 'MVP' at the end of each sprint, voted on by the team. The MVP then gets a small monetary reward and free lunch as well as a trophy to display on his desk. We've had two sprints so far with this reward system in place. The good I see from this is the following:   * More bugs have been fixed (which is what upper management wants to see, a number change in the direction they want)   * The MVP from each 'team' gets recognized and gets a self esteem boost (or is it an ego boost?) I've noticed a few what I would consider bad sides to doing such a thing (at least from a developer standpoint):   * There are a few developers who are so concerned with the number that the quality of bug fixes has gone down. Fixes in one area are causing regressions in another.   * There are a few developers who are cherry picking 'easier/quicker' bugs to boost their bug count. Could be good of bad here I guess.   * Higher priority (which a lot of the time correlates to 'harder/longer to fix') defects actually become lower priority.   * Blocking defects are not addressed in a timely manner, as usually they take longer and require more coordination with QA.   * The team aspect within the Dev team has been lost. The team aspect of Dev and QA working together as one hasn't improved either, but hasn't really changed too much from before.   * Work beyond bug fixes, or working towards THAT number, isn't easily recognizable/tracked. I do believe that each of the 'bad' above can be addressed to some degree, depending on how the team handles each. My question is, then, has anyone successfully pulled anything like this off, where you recognize an MVP per sprint? If so, what do you think contributed to that success?


title: On contract work, obligations to said contract, and looking out for yourself…

text: Without boring you all with details, my last two contract assignments were cut short; I was given 3 days notice on one, and 4 weeks notice on the other. Neither of these were due to performance – they both basically came down budget issues. On my second contract, I got the feeling that I may not have been a great place to stay for the duration of my contract. Because of money/time spent getting me in the door, and the possible negative effect of my employer/recruiter, I decided to stay at least for a few months (and start looking several weeks before the end of my supposedly “extendable” contract). These experiences have left me a little wary of contract work. It seems that if I land a bad contract, that my recruiter would take a hit (reputation or otherwise) if I quickly found another job. But on the other hand, the client company won’t think twice of ending the contract early for any reason. I know that the counter argument to this is “maybe your recruiter shouldn’t have put you into a crappy assignment”… either way, it seems that since I am relying on him to provide me with work, that I should try to not damage his reputation with client companies. I’m basically brand new to contracting (these were my first two contracts) so these concerns are new to me. **TLDR:** Is contract work, by its very nature, largely unstable? Am I worried too much about my recruiter? Should I be quicker to start looking for a new job even after just weeks at a new company (when the environment seems unstable)? If so, do I look through my recruiter or just find another position by any means necessary?


title: Choosing between Qt/C++ and .NET/C#

text: I have a desktop project I've been working on for a couple months that I want to run on Windows and Mac. When I started the project, I started writing it in Qt 4.8 in C++. Development has gone fine and the application runs fairly well on both Windows and Mac like I hoped. I would say it's about 40% complete at this point. For a little background information, the application is a variation of an email client. But I am thinking about abandoning what I've done so far in C++/Qt and purchasing a license for Xamarin Studio and writing the application in C#. There are a few reasons I am strongly considering this:   * I want to release mobile versions of this application too, and with C# a lot of the backend code could be reused on all platforms.   * I want to publish this app on the Apple **and** Windows stores. I know that you publish Qt Apps on the Apple Store but I have not read or been able to find anything about anyone publishing Qt Apps to the Windows Store. Not to mention, Qt 4.8 has no built in support for Metro UI (I would have to use Qt 5.0, which would mean rewriting a large part of the code anyway).   * Having worked in both C# and C++ for many years, overall I am "happier" developing in C#. However, I have a few reasons the stay the course:   * As I mentioned above, I am about 40% complete in the first incarnation of this project.   * A large portion of my program rests upon Lua, for which I'm able to use the native Lua libraries quite easily in C++, and I'm not sure how well the Lua implementations I've seen for Mono/C# work.   * Maintaining two separate UI code for the desktop app (hence, in Qt I can `#include <QtCore>` on Windows and Mac, but in C# I'd have to `using System.Windows.Forms` on Windows and 'using MonoMac.' on Mac) Honestly, at this point I'm inclined to start over in C#, using what I have in C++ as a guide and delay my release for about a month (about how long it'll take me to catch up considering other responsibilities in my life). I was looking for some input from people who have been in a similar situation. And I'm particularly interested in hearing from anyone who has used C# to publish apps on the Windows and Mac stores. What do you think?


title: Sense of unit tests without TDD

text: We have new (quite big) project starting, that we planned to develop using TDD. The idea of TDD failed (many business and non-business reasons), but right now we have a conversation - should we write unit tests anyway, or not. My friend says that there is no (or close to zero) sense in writing unit tests without TDD, we should focus only on integration tests. I believe the opposite, that there is still some sense in writing plain unit tests, just to make code more futureproof. What do you think? Added: I think that this is not a duplicate of >>this question<< \- I understand difference between UT and TDD. My question is **not about differences** , but **about sense** of writing Unit Tests without TDD.


title: Why are nested loops considered bad practice?

text: My lecturer mentioned today that it was possible to "label" loops in Java so that you could refer to them when dealing with nested loops. So I went home and looked up the feature as I didn't know about it and many places where this feature was explained it was followed by a warning, discouraging nested loops. I don't really understand why? Is it because it affects the readability of the code? Or is it something more "technical"?


title: Should I commit my generated parser to source control?

text: I'm using a parser generator to build a compiler. Should I commit the source files produced by the parser generator? I want to commit them to avoid a dependency on the parser generator during the build process and tests. However, if I commit them, it is tempting never to update the parser generator for fear of backwards-incompatible changes. Are there other advantages or disadvantages that I have not thought of? References:   * Do I check generated code in to source control or not?   * What Part of Your Project Should be in Source Code Control?


title: Beautiful user interface vs. more and more technical features?

text: I will understand if you find this is more a discussion than a technical question and if you close the topic (then, where would be an appropriate place to discuss about that? thank you in advance). The question : how do you decide between improving the user interface with a great design or adding more and more technical features? I would like to meet people interested in Windows coding beautiful user interfaces in order to improve an existing (very powerful but not good- looking) open-source project, which has a lot of potentiality! I know this is probably not the appropriate place for such a question, but maybe you would know a better place?


title: Why is it so hard to find anything on MS site?

text: I have always had this question in my mind and I would really be happy to get an explanation for this. Is it only me or do you also feel the same way that it's hard to find anything on MS site. For example, every time I need to download .NET framework I have to Google it. You never know what you can download, no category for downloads. You are simply left to a search field. You never know if you downloaded the latest version of the file. The tragically true is that you have to rely on their competitor Google to find anything on their site. I know that they are a big company.   * **But is it really that hard to have an organized way to publish information?**


title: Why is there no generic implementation of OrderedDictionary in .net?

text: Why did Microsoft not provide generic implementation of OrderedDictionary? There are a few custom implementations I've seen, including: http://www.codeproject.com/KB/recipes/GenericOrderedDictionary.aspx But why did Microsoft not include it in the base .net library? Surely they had a reason for not building a generic.... but what is it? Prior to posting this message, I did see: http://stackoverflow.com/questions/2629027/no-generic-implementation-of- ordereddictionary But that just confirms that it does not exist. Not **why** it does not exist. Thanks


title: How is coding on a 13" MacBook Pro?

text: I've been working on a 15" machine for years, but recently I was tempted by the 13" MacBook Pro. Because I'm often on the road, I was looking mostly for a lightweight machine, considering I've external screens almost in every place where I work. Is there anybody who's working on a 13" MacBook Pro that would give me a tip? Is it your best friend or you're gonna throw it out the window? Outside my world made of code and IDEs, I really don't care about apple rumors: should I wait because a new version of the MacBook Pro is gonna be released? Your help is appreciated, thanks.


title: Can AspectJ or AOP in general be used to test exception handling?

text: I'm reading a book's chapter ("Controlled Exception Test" in "Testing Object- Oriented Testing") about testing exception handling in a running system (not at unit level). The conclusion is that it is hard to automatically trigger an exception at a given layer in the system other then simulate a cause for an exception. Wouldn't usage of AspectJ or any other AOP approach solve the problem? With AOP I can create an aspect that will throw an expected exception and attach it to the method called before exception handling.


title: Should the commit history be used to convey critical information to developers?

text: Recently a conversation came up during a meeting regarding the rollback of a third-party SDK from the latest version and it was noted that the fact it shouldn't be used was already in the commit history. Other developers argued that this was a bad practice and there should have been something either in the source file (i.e. `// Don't upgrade SDK Version x.y.z, see ticket 1234`) or in a project level `README` file. The others argued that since the commit history is part of the project documentation that it is an acceptable location for such information since we should all be reading it anyway. As such, should the commit history be used to convey critical information to other developers or should such information be duplicated to another location such as a project `README` or comments in the relevant source file?


title: Avoiding Double POST

text: We are implementing a RESTful webservice that will allow client applications to POST documents to it and it will store the document returning a unique identifier in the response. The clients will mostly be Spring MVC applications, but do not have to be. The two client applications that we are currently working on have various JSPs which contains HTML forms that will contain file elements and other attributes. So a user will submit a form via POST to a Spring Controller in the client application. The Controller will read the bytes from the file and then POST them to the RESTful service, receive the unique identifier back, and store the unique identifier along with the other information from the form in the database. As each client can have multiple JSPs with widely varying attributes in the forms, we don't see a way to just POST directly to the RESTful web service. Is there a clean way to avoid the double POST? I could see the possibility of having a reusable pop-up window that takes care of POSTing the document to the RESTful web service and then holding the unique document id either in the session or a hidden field on the parent form. I can see two downsides to this: 1) the user may not like having the extra step of going to the pop-up and 2) the document could be orphaned if the user does not submit the parent page. EDIT / CLARIFICATION: the issue is not that a POST is being sent twice to the same resource, but rather avoiding have both a POST from JSP to Controller within the client application and then a second POST of the same data from the client application to the REST resource.


title: Haskell syntax for type definitions: why the equality sign?

text: I am a bit confused by the choice of Haskell syntax for type definitions, like in               data Foo = Bar      Namely: does the equality sign here really mean an equality in some subtle sense, or is it just a random notation choice? For example, in               foo x y = bar y x      the equality is really an equality: if this line is present, `foo a b` and `bar b a` can be used more or less interchangeably in the program. However, `data Foo` and `Bar` probably cannot be used interchangeably after `data Foo = Bar`. Whenever i resume my attempts to learn Haskell, i am a bit confused by this IMO counter-intuitive syntax and need to look up the documentation to recall the formats of the LHS and the RHS. Are there any alternative syntaxes for type definitions by any chance?


title: Means for (legit) cross-site scripting

text: Are there good means for allowing scripts from two or more domains to collaborate in the same browser page? I want to create an extensible platform, where I provide the model and some views, but also allowing third parties to create their own views as well. The idea is that all model manipulation will be done through its API, and only the model will communicate to the (main) server, but users will be allowed to include scripts from other domains that also use that API (those scripts might "call home" if they want to though). I know many sites already do that, for instance when they use a CDN to provide libraries like jQuery. However, I also recall reading that those libraries had to be "tweaked" somehow so they won't be mistaken by XSS attacks, though I couldn't find more info on the subject. I have only superficial knowledge of how browsers isolate contents for different domains, and to what extent that isolation occurs, so some pointers in that direction would be very welcome. I'm also aware of the method of using iframes to load "less-than-trusted" contents, and it seems that communication between the main page and its iframes is quite straightforward. I'd rather not use that method, but will do if there are good security benefits of doing so. However, I'm unsure if that's the case, since the iframe can call arbitrary methods on the parent page... ( _Edit_ : from what I understood of Florian Margaine's comment, the method in the linked question only works for same-origin iframes, is that correct? In that case, I can see the security benefits now) Can anyone with experience on the subject tell me how it works? These are the only options I know of, other suggestions are welcome too. I'd also like to note that, while there must be some level of trust between the user and the third party providing the script (since its very purpose is manipulating the model owned by that user), each user will be free to choose extensions at his leisure (i.e. the available scripts won't be restricted to ones I previously evaluated and endorsed), so any means to mitigate security problems to the users are also welcome. **Edit:** Let me clarify the question a bit. The goal here is not to make HTTP requests to other domains, merely to have a better control of what the different scripts do to the same page. From what I understood so far of the same origin policy, **different pages** can not communicate to each other unless they come from the same domain, but scripts **in the same page but coming from different domains** can do whatever they want. Is that correct? (if it is, then I guess my question is moot...)


title: Development platform for .NET development?

text: I'm currently in discussions with my boss about getting a new pc since my old one is getting ... old... I am the only "real" developer in the company (it's not a software company) and as such they haven't really bought any pc's with these kind of specs before. So, I made a list, because building my own, is cheaper than buying finished. http://www.prisjakt.no/product_list.php?do=lista&k=10529 And he thought it was kind of overkill. And I can admit, I may have gone a bit far on some choices (the raided SSD's for example), but I though it was better to go out high, then come down a bit during discussions. But what would you say is a comfortable platform to do .NET development on? I currently use Visual studio 2010, local SQL Server 2008 R2 (Developer Edition), 1-3 local VM's for doing testing, and I use Windows 7 Enterprise x64 as OS. I myself don't feel that this list is very overkill, not to mention that it's very future proof. I put on 240Gb of system-disk, and 4Tb of storage, so I won't run out of space anytime soon. It's a i7 quadcore, 16Gb memory... It's not the bare minimum, but it's not very exaggerated? 10000 NOK is about $1900 USD.


title: What is the acceptable error margin when estimating a project duration?

text: The company where I work is aiming to have a 10% maximum error margin.They expect analysts to not miss the estimate by more or less than 10%. I don't know what to think about it, since I got nothing to compare it to. What could be a good baseline to measure if we are estimating too wrong, for more or less? How much (in %) do you think is _okay_ to to miss?


title: How you would name a .NET port of a Java project?

text: Assuming that a Java project is called "bar" or "jBar". How would you name a .NET port (in C#):   * NBar    * dotBar   * BarNet    * Bar-sharp


title: How can I fetch data from more than one web services simultaneously in PHP?

text: I have 3 web services that are providing me data for my hotel booking engine. It is taking too long if I run them sequentially. Therefore I wanted to run them using threads, but I am not sure if php threading will support this and if it is safe, since all 3 processes that will handle the web service will read and write into shared tables. Can anyone advise me on how should I proceed?


title: Outsourcing functionality from Django view to C/C++

text: I'm developing a Django project that basically boils down to:   1. A user submits a form.   2. The Django view parses the form and compiles a representation of that form which is readable by some other 'function'. By 'function', I mean some kind of executable/callable where the Django view may be agnostic about what language that 'function' was written in, or even what hardware it runs on.   3. The Django view passes the compiled form into the 'function'.   4. The 'function' performs its business on the input, then outputs some data in a format readable by the Django view.   5. The Django view reads the output of the 'function' and renders the data to a format that is consumable by the user. In my specific case, the 'function' is a large numerical computation not suitable for plain-vanilla Python. Furthermore, this 'function' has already been developed in C++11 and Python can talk to the compiled binary via os.system and file IO. **My question then is:** _why should I not just use os.system orsubprocess from the Django view_ rather than a) redevelop the 'function' using one of ctypes | swig | Boost.Python | pyrex | cython; b) learn how to write Python extensions and re-write the 'function' accordingly? I have also considered turning the 'function' into a daemon, but I am not experienced enough with daemons to be able to gauge what the consequences of such a design would be. **Are there undesirable/undefined behaviours that would arise from using os.system/subprocess as described above for a Django project that was operating under load?** Is there something else I am missing that is super obvious to everyone else? There is also this related question. But with the scarcity of details in both the OP's use case and in the answers, I am cautious not to fall for my own fallacious confirmation bias.


title: Is it common to separate back-end and front-end into two positions on web development projects?

text: At a web startup, is it more common to have an engineer working the front-end AND back-end of the feature (basically in charge of the whole feature)? Or have engineers separated between the back-end and front-end? Which ones are more beneficial and for what situations? The downside, I've noticed, regarding having one engineer in charge of the whole feature is that the person might only be particularly strong in either frontend or backend development but not both, thus sometimes having a decrease in speed and quality. Having frontend and backend developers on one feature increase the speed of the feature and the quality AND it encourages collaboration. But I am concerned about having 2 engineers working on one feature which may be a poor use of resources since the 1 engineer can be placed on another feature to work on. What is the common/best practice for allocation backend/frontend engineering resources at a small early-stage startup? And then how will it change as it grows?


title: What does Scrum say about tech demos?

text: I'm sometimes suppsed to demo work and I wonder if the Scrum methods have specified something about how demos should be done? I've done quick demos and I've been asked to demo on-the fly while it's not realistic to expect that programming always moves only forward. SO I'd like to know if you can tell me since I follow Scrum, if there is anything there that can improve my technical demos? For instance how often and when a demo should be done?


title: Is it true that what you learn as a CS undergrad will be out of date by the time you graduate?

text: I've heard this statement thrown around a few time by technology/science pundits on the web. Does it have any merit? What exactly do they mean?


title: Teaching C++ to first time high school students: Where to draw the line?

text: I will be mentoring a team of high school students for the FIRST Robotics Competition, most teams here develop[ their robot software using C++. For many of the students on the team this will be their first introduction to programming. I wouldn't have chosen C++ for teaching programming to high schoolers (e.g. Python or Javascript would have been easier I think) but the choice is set. I want to teach them proper C++ (i.e. avoid a mixed C/C++ dialect, i.e. C+) but I don't want to scare them either with needless complexity. For that matter:   * Should I start using STL from day one, esp. `vector` or just stick with standard arrays? Arrays are easier to introduce but the pointer errors may be harder to catch.   * For I/O, should I stick to `cout`, etc. or do you think `printf` would be easier to learn?   * Are there any online resources for C++ that are suitable to use for such young learners? Thanks! **EDIT** : Thanks for so many excellent answers. In addition to _Accelerated C++_ , which is suggested by many people, I have found that _C++ For Everyone_ is an excellent text.


title: What are the benefits of being proficient in multiple programming languages?

text: I have a friend who refuses to learn any other language than Perl. How do I convince him that he can not go through his entire life with only 1 language? What are some arguments to open his mind up to new languages? What are the benefits of learning multiple programming languages?


Are there any standards for preparing a user manual of electronic device? I am trying to prepare a manual for a device. However, I could not find any format. If I find, I will take this as guide for me. If there is no standard, what should be in the manual or what should not be in?


title: Should a software developer get a yearly equipment budget?

text: I am looking at a new position with a new company. I have talked to some people in the past (in general, not at this company) that they had been given a yearly budget to buy new computer stuff to keep up to date. Now why I feel this question is worth asking here is that Joel comes right out and says an employer should pay for the best equipment money can buy... within reason of course. From The Joel Test: 12 Steps to Better Code > ### 9\. Do you use the best tools money can buy? > > Writing code in a compiled language is one of the last things that still > can't be done instantly on a garden variety home computer... > > **Top notch development teams don't torture their programmers.** Even minor > frustrations caused by using underpowered tools add up, making programmers > grumpy and unhappy. And a grumpy programmer is an unproductive programmer... Does anyone know if the industry has such a standard to offer an allowance or budget? I have never worked for a company like this, but I am thinking I should toss this in the ring for negotiations. Seems reasonable. How do bigger companies like MS, Google, and Apple handle this? If you say yes, give a range... I have been told numbers from $5k to $10k. Seems high to me, but hey I would gladly take it.


title: Starting again on desktop development

text: Years back I did a lot of programming in Delphi (mostly scientific). For the last few years I have been doing development work based on web technologies. I need to turn a couple of applications quickly for the desktop. I have looked at Qt and the learning curve seems a bit steep. Is going back to Delphi (say with Delphi XE) recommended? What are the advantages and disadvantages? Cost is not an issue.


title: Do large mercurial repositories suffer from a "push race"?

text: Reading a few "Why a DVCS is better" answers to several question on Programmers.SE they all seem to say that in general, DVCS is better since you don't have a commit race in large projects, IE commit, out of date so update, commit, out of date again, commit, still out of date, etc. DVCS limit this with the concept of the push. However in very large projects wouldn't there be a "push race", especially at the end of the day? I know in Git this is somewhat remedied by the constant branching for everything, but in Mercurial you don't branch, you create a new head. Problem I see   1. User attempts to push   2. Out of date (mercurial won't let you push if your local repo is out of date), so you pull and merge your local changes   3. User attempts to push again but while they were merging someone else pushed, so they are out of date again   4. Pull and merge again   5. Still out of date   6. Repeat Sound familiar? Is this an actual problem with very large and popular mercurial repos? What about inside a company when everyone does their final push of the day?


title: Do some programmers know some secrets that we others don't?

text: I will not bother you with details of my discussion so I will present it in the form of a short instance. A java guy has been following articles and publications of a famous programmer (a kind of Martin Fowler of my country). He says that he is sharing some secrets which other famous programmers don't share. I never believe that there are some secrets like wizards in the programming area. But some programmers who are not good yet in this area think that other famous programmers are success because they know some secrets that we don't. I totally disagree with this and I discussed it with someone and finally he said to me you are 2 years in this area and he (java guy) is 20 years professional programmer so he knows better than you. I wanted to be sure that I am not wrong. That's why I wanted to know this.


title: How to properly document functionality in an agile project?

text: So recently, we've just finished the first phase of our project. We used agile with fortnightly sprints. And whilst the application turned out well, we're now turning our eyes on some of the maintenance tasks. One maintenance task is that all of our documentation appears in the form of specs. These specs describe 1 or more stories and generally are a body of work which a few devs could knock over in a week. For development, that works really well - every two weeks, the devs get handed a spec and it's a nice discrete chunk of work that they can just do. From a documentation point of view, this has become a mess. The problem with writing specs that are focused on delivering just-in-time requirements to developers is we haven't placed much emphasis on the big picture. Specs come from all different angles - it could be describing a standard function, it could describing parts of a workflow, it could be describing a particular screen... And now, we have business rules about our application scattered across 120 documents. Looking for any document for a particular business rule or function in particular is quite hard because you don't know which document has this information, and making a change request is equally hard because once again, we are unsure about which spec to make the change. So we have maybe a couple of weeks of lull before it's back to specing out functionality for the next phase but in this time, I'd like to re-visit our processes. I think the way we have worked so far in terms of delivering fortnightly specs works well. But we also need a way to manage our documentation so that our business rules for a given function / workflow are easy to locate / change. I have two ideas. One is we compile all of our specs into a series of master specs broken by a few broad functional areas. The specs describe the sprint, the master spec describe the system. The only problem I can see is 1) Our existing 120 specs are not all neatly defined into broad functional areas. Some will require breaking up, merging etc. which will take a lot of time. 2) We'll be writing specs and updating master specs in each new sprint. Seems like double the work, and then do the devs look at the spec or the master spec? My other suggestion is to concede that our documentation is too big of a mess, and manage that mess going forward. So we go through each spec, assign like keywords to it, and then when we want to search for a function, we search for that keyword. Problems I can see 1) Still the problem of business rules scattered everywhere, keywords just make it easier to find it. anyway, if anyone has any decent ideas or any experience to share about how best to manage documentation, would really appreciate it.