title: Right approach to convert a word document that contains forms in a web app

text: I would know if someone can suggest a good approach to convert a word document that contains forms in a web app, specifically in an application built with WaveMaker.(but I'm curious also with a general approach not strictly dependent on the technology that I have mentioned). For example, if I have a page in a word document, that maps the fields of a user entity, what could be my "programmer approach" to convert it without much use of copy-paste, but with a dynamic methodology ?


title: Separating model from UI

text: I have a Swing application with a custom TreeModel that can refer to domain instances. I'm wondering what changes I could make if I consider moving to a web interface later on. Would a pluggable model be considered as good design? What would you do?


title: Where can I start learning to build web applications in C#

text: So far I've written web sites in PHP, except for a pet project of mine written in Python. I'd like to start learning C# for use on the web, but I have no idea where to start. I know nothing of .Net. Are there any good tutorials or online books etc. which give a brief intro to the .Net environment (specifically C#, and specifically for the web)? I'm not even sure what I need to install. Visual Studio I guess, but what else? Anything special, or will VS do the trick?


title: How can I reduce my problem into Max flow problem?

text: I am trying to reduce my problem to a max flow problem so I can run the max flow algorithm on this problem. But there are some things that I am missing while transforming my problem. My problem is:   * there are classes with a maximum capacity   * there are students and their wish-list that includes 5 classes that they want    * students can select at most 5 classes. And the goal is:   * to maximize number of classes that students enroll. ![Image](http://i.stack.imgur.com/sjYPF.jpg) If I put students and classes as vertices (please see image above), then put a source node `s` that has an edge to each student and a sink node `t` that has an edge to each classes, what will be the edge costs?   * edge cost between classes and sink node t or   * edge cost between source node s and and students  Are the following assumptions correct?   I think the edge between students and classes cost should be 1. Because a student can only enroll once to a class in a term. I think edge cost between classes and the sink node `t` will be the maximum capacity of a class. I don't have an idea about edge costs between source node `s` and students nodes. And at the end, after arranging, do we just need to run max flow algorithm?


title: Java devs: why not use Groovy?

text: OK, so there are quite a few people using Java these days. But as the language nears two decades of age, it isn't exactly the coolest option out there. Many of us are excited about dynamic languages with some functional features like Ruby or Python, even though we spend our days using Java. So why is it that the adoption of Groovy has been so slow? It seems that Groovy offers much of the benefits of Ruby and Python, but it is far easier to transition a Java shop to Groovy. Even if performance were the concern, it seems that many would want to use Groovy for testing the production Java code. Or use Groovy/Grails for internal apps in which performance concerns are minimal. Or for writing one-off scripts to generate code. Yet Groovy languishes outside of Tiobe's top 50 languages, for reasons that are unclear to me. I have been using Groovy and Grails professionally for about four months, and it has been an excellent experience, such that I hate to think about going back to the Java/Spring/Hibernate model. Does anyone have any sense on why we are not seeing more significant migration from Java to Groovy? Note that I'm not asking why Java developers are still using Java for new projects. My question is: Why is it that most Java Developers are still not using Groovy _at all._ **Edit:** I am assuming that all good developers see the utility of dynamic typing and higher order functions _for some programming tasks._ (Even if it is deemed inappropriate for production code.)


title: How to speed up PHP powered websites?

text: Many people are talking about somethings like accelerator, opcode, etc to speed up a website's performance. To be honest I do not know how to make any PHP website perform well and when do I need to use such things and what if I use them will that cost me a lot? I generally like websites to perform well with excellent and quick load time for the user (I know the load time has other factors such as the internet speed but what I care about here is the performance of the PHP code itself how to make it perform better). So, could you tell me about all the ways to speed up any PHP website and whether they are possible and easy to implement or not?


title: Many small classes vs. logical (but) intricate inheritance

text: I'm wondering what is better in terms of good OOP desing, clean code, flexibility and avoiding code smells in the future. Image situation, where you have a lot of very similar objects you need to represent as classes. These classes are without any specific functionality, just data classes and are different just by name (and context) Example:               Class A     {       String name;       string description;     }          Class B     {       String name;       String count;       String description;     }          Class C     {       String name;       String count;       String description;       String imageUrl;     }          Class D     {       String name;       String count;     }          Class E     {       String name;       String count;       String imageUrl;       String age;     }      Would it be better to keep them in separate classes, to get "better" readability, but wit many code repetitions, or would it be better to use inheritance to be more DRY? By using inheritance, you will end up with something like this, but class names will lost it contextual meaning (because of the is-a, not has-a):               Class A     {       String name;       String description;     }          Class B : A     {       String count;     }          Class C : B     {       String imageUrl;     }          Class D : C     {       String age;     }      I know inheritance is not and should not be used for code reuse, but I don't see any other possible way how to reduce code repetition in such case.


title: Naming of types, classes and exceptions sometimes go wrong

text: Just started working as System Developer and dislikes the labeling of a home made exception: `HumanErrorException`. In my view, there is no such thing as a human error in a computer based system - just users who don't do as developer expected. So the real label for the exception would be `DeveloperNotTakingUserBehaviourSeriouslyException`, but I thing there will be a fight when i relabel :) Have you ever seen a wrong labeled exception (type, class or method) around? If you did, what did you do with it?


title: What is the use-case to use C++ friend class?

text: I am trying to understand C++ friend. When is the good use case to use friend? I suppose if we want to let another class have access to another classes attributes, why don't we just make it as public or inherit from that class instead? Thank you for your help.


title: About the book "Peopleware - Productive Projects and Teams"

text: I've read Peopleware in 2009. It was one of the best book I ever read. But this book is a little old. I'd like to know, in your opinion, what is and what is not relevant in this book?


title: Separate Pages Separate Loads?

text: Working on two formats throughout our website - PC and mobile. Each request will have a check who the client is. Then, two methods seem optional:   1. Render the page accordingly.   2. Redirect to a parallel site Is there a difference in server load (i.e. maybe 2 has less load because requests are actually pointed at different pages)? Whereas, it seems having a single page would be easier to maintain.


title: How often do you refactor or restructure your code in long term projects?

text: As developers we are always eager to learn new things and better ourselves at what we do. You've all had moments when you look at your old code and get that feeling: > " _WTH, I can't believe I used to write code like this_ " Well, when it comes to long term projects that you're working on, what do you do when you look at your old code? You probably have learnt new techniques that you didn't use when you started the project. So you probably are very eager to refactor or restructure, or swap out modules in your project. But when is the right time to do this, and how often do you do this? Also, there are risks involved if you do some major refactoring. There's also budget constraints so you may have the urge to make changes but your project manager won't give you the time to do so. How do people approach such situations?


title: What pitfalls are inherent in using partial classes?

text: Over at this question in the comments I mentioned that I heard that partial classes are best avoided if possible. What if any is the reason for this sentiment? Or If this is an invalid sentiment, how are the perceived detriments overcome?


title: Subversion Tools To Help With Branching and Merging

text: Our shop is about to release a major rewrite of our application. And, we are going to need to do bug fixes on versions out in the field while developing new features for the next version. Frankly, I'm a bit overwhelmed by the thought of trying to manage it all with the command line. Are there any really good Subversion clients that help manage branching and merging? We have Windows and Linux computers available to us; so either platform is fine. If there aren't any good tools that help idiot-proof branching and merging, what are the best tips you have for managing multiple branches?


title: Is there a personalizable programming language you can use to convert to others?

text: Is there a programming language in which you can set your own syntax configurations and it would convert the code to a language you choose? For instance, you would choose specific configurations like "Python's indexed blocks", `[a,b,c]` initializes arrays, `^` for exponentiation and others. A script would convert it to your choice language's equivalent.


title: Dual licensing with GPL library

text: I have a question concerning derivative works of GPL'ed software. Imagine the following situation: A company writes a software (A) using a library (B) which is released under the terms of the GPL. Now of course, software (A) has to be released under a compatible license to the GPL. But what about dual-licensing? If software (A) is released under two licenses, GPL and a commercial one, is this in violation with the terms of library (B)? To rephrase the question, does the GPL force exclusivity for derivative works?


title: Creating an interface of interfaces

text: **Background:** We have a class that both listens on a socket and sets values on itself based on what it reads off the socket. I believe that adheres to SRP. To adhere to ISP we created one interface for socket stuff (eg. `StartListening`, `StopListening`) and another interface which contains read only fields for the values read off the socket and modified our class to implement both. The idea was that we pass `ISocketStuff` (not its real name) to code that needs to start/stop listening and we pass `ISocketValues` to places that need to know the values. **The Question:** I was reviewing a co-worker's code and he had something like: `public interface ISocketStuffAndValues : ISocketStuff, ISocketValues {};` And he was passing it to a constructor. This felt wrong, but I couldn't think of any reason not to do this. It was to work around a thorny design issue, he could have just passed in `ISocketValues`, but he wanted to do it that and I couldn't tell him why it was a poor choice. So, is it a poor choice? What reasons could I have given for just passing in `ISocketValues` and not creating `ISocketStuffAndValues`?


title: best (web) architecture for my project

text: So I'm not sure if this is really the right place to ask or even the right question but I want to give it a try. Requirements: We should have a database & webservice (or something similar) which runs in OUR office, clients cann access the application via the internet ("wohooo"). Clients must be able to create orders in a simple mask. There is a basic mask (which all clients have), but the mask can also have some client-specific stuff. When they created the order, a label with a barcode (which contains the order number) is printed locally (and automatically) at their office on a label-printer. They take the label and put it on a sample, which they then send us (on the real post-way). We get the sample, scan the barcode on the label and the order appears in our "administration-screen". We then have every information we need about the order (and the sample). Surely we also need a backend where our staffmembers can edit the client-specific mask and add some fields (for specific-clients) and other master-data. * * * All in all this doesn't sound too complex. The only thing which stands out a little, may be the automatic print of labels at their place I guess. Because of this reason it may not be possible to use a "server-side only" architecture (like jsf or spring with jsp and so on), because you have to have access directly on their local printers. So I thought a good way is maybe to use spring (with Hybernate, JavaBeans (JEE)) together with JavaFX which would allow to access local printers and so on. I thought we could just make a webinstaller/webstart for the application, which installs the JavaFX clients for the clients. The JavaFX client could then communicate with the webserver (spring) and insert the order there, get all required information like the order-number for printing the label and so on. For the backend in our office I could also imagine to use JavaFX... So where's my question? Well its simple: Is this a good way to do it? Are these fitting technologies for doing it? Or is it already to complicated and this could be accomplished in a much easier way? If so what do you suggest? Naturally I also want to lay a big focus on easy extensibility and maintainibility.


title: Making Simple IF Statements Shorter

text: If we assume we have this little snippet of code:               string str = "checked";     bool test1;          if (str == "checked")     {         test1 = true;     }     else     {         test1 = false;     }      Is it bad practice to change a simple statement like this to the following?:               bool test2 = (str == "checked");      Because they work exactly the same, and work as required, so I can't imagine how it would be. However, as a young, inexperienced programmer I am not aware of whether such a thing is frowned upon or not. Can anyone tell me, if this is NOT ok, why not? The following test program:               using System;          public class Test     {              public static void Main()         {             string str = "checked";                  bool test1;                  if (str == "checked")             {                 test1 = true;             }             else             {                 test1 = false;             }                  bool test2 = (str == "checked");                  bool test3 = (str != "checked");                  Console.WriteLine(test1.ToString());             Console.WriteLine(test2.ToString());             Console.WriteLine(test3.ToString());         }     }      Outputs:               True     True     False      Any insight etc is appreciated.


title: As a programmer, what paths should I take concerning education?

text: After a burst of ranting about homework, the applicability of the classes I'm taking, and my computer science teacher, I have some questions concerning education for my career path as a developer. I taught myself everything I know about programming. I've been thinking lately about the advantages of teaching myself vs. learning from a teacher. I feel I might miss some things I would normally learn. I might learn some concepts wrong, or something. After all, computer science eduction has been around longer than I have. The problem is, I'm not learning anything new about computer science in my programming class. I put the computer programming 2 course on my schedule (it was labeled as Computer Science when I signed up for it). It turns out that it's just learning C++ and of course OOP. In fact, the CP2 students are in the same classroom at the same time as the CP2 students, except the CP1 course is a half-year class instead of full year. I thought we'd do something like data structures (other than arrays), or something I'm less experienced in. The teacher had me change my schedule to CP1, but he "lets me loose" to work on projects with the CP2 students while he teaches the CP1 students. I usually end up helping the CP2 students with build errors and things like that after I'm done. I certainly don't mind helping them, but I'm not learning anything new, and I likely won't, seeing that AFAIK linked lists will be the most advanced concept taught (for the CP2 students; The class ends this semester for CP1, including me). Frankly, I'm not interested in copying source code from paper to screen, which is 90% of what the CP2 students do. I want to be learning something computer science related. I'd hate to sit around waiting for my options to catch up. I want to take classes not offered by my high school, like discrete mathematics, algorithms and data structures, or something like that. So my question is, where can I take classes which aren't offered by my high school? Can I take college classes? (keep in mind there isn't any concurrent, AP, or distance-ed classes concerning computer science offered by my high school besides the CP1/CP2 class I'm in). Do you know any online classes I could take? Thanks, Danny Shields P.S: I talk about my programming experience on my StackExchange profile if it helps.


title: Is it acceptable to work around Apache's .htaccess nonsense in another language?

text: I'm getting sick of all of Apache's quirks, and I'm considering starting to avoid `.htaccess` as much as I can in favor of writing actual, predictable code. It would be easy and straightforward to emulate things like file security and rewrites, and control precisely what is and isn't inherited between directories without having to use strange, obtuse directives. Would there be any downsides to this? I'm talking about replacing, for example, this:               # .htaccess     RewriteCond %{HTTP_USER_AGENT} blah     RewriteRule ^(.*)$        /test$1 [R=301,L]      with something like this:               # PHP, in a header file     if(strpos($_SERVER['HTTP_USER_AGENT'], 'blah') !== false)         redirect(301, '/test' . $_SERVER['REQUEST_URI']);      To repeat the question, **what would be the downsides of implementing functionality in PHP which is traditionally handled by`.htaccess`?**


title: Modify then sell another person's code

text: I am working, with a co-author, on a data modeling toolbox that will someday be sold. Part of the functionality is the extremely common PCA, which we are doing in a more robust way. Thus, we need a PCA function that has the usual algorithm with some modifications. For non-commercial peer-review academic research, I could easily find PCA code that is already written, modify it to suit my needs and use it, citing the author in my research. My co-author insists that in this commercial venture, it is entirely appropriate to do the same thing. We can take another author's copyrighted code (ex "Copyright (c) 1997 by blah blah blah", not necessarily a GNU license), modify it to suit our needs, and distribute it with the toolbox we are selling. He says that as long as we cite the original author, it's entirely acceptable. I'm just as strenuously insisting this is not legal, but have been unable to find straightforward documentation. Can someone point me to unambiguous documentation of this?


title: What is a good measure of testing/tester efficiency?

text: I am about to participate in a discussion with management regarding measuring our testing efficiency as a QA organization. The main reason behind this is that half of our team is contracted out and our business would like to provide some metrics of how effective/efficient we are, so that we have basis data on which to negotiate contract parameters with the service agreement of our contractors. I have poked around a little and most of the opinion I have found on this subject revolves around developer efficiency: lines of code, story points delivered, defects introduced, etc. But what about testers? Our testing is mostly requirements based, and a mix of manual, semi-automated, and automated testing (not because we haven't gotten around to automating everything, but because some things are not automatable in our test system).


title: MongoDB: Is this a good schema design?

text: I'm working on a Meteor app which lets users create events and assign them crew members. I've played around with MongoDB before and made some experiences along the way, where for instance my first attempt went overboard with embedded objects and quickly became sluggish and hard to maintain. Several people therefore suggested to try a more traditional design approach and that's what I've done this time. I've split my collections up with manual refs in mind, **Events**               _id : ObjectID,     propA: "Some prop",     propB: "Some other prop",     employees: [         {employee_id: ObjectID, crew_id: ObjectID},         {employee_id: ObjectID, crew_id: ObjectID},     ]      **Employees**               _id : ObjectID,     propA: "Some prop",     crew_id: ObjectID      **Crews**               _id : ObjectID,     propA: "Some prop"      The reasoning is that the events collection will become quite substantial during the applications life cycle and thus I consider duplication to be a bad thing. Another noteworthy feature is that an employee must belong to a certain crew, but on an actual event can work in any crew. Intially I was quite happy with this design, but I have however found some problems which has lead me here. 1) When listing an event I have to manually join refs in order to show the actual properties of the employees and crews (such as name), it's a bit tedious but what worries me most is performance: Rather then running one query I have to run three (first get the event, then loop trough the employee array and then join employee with the Employee collection and finally join the crew with the Crew collection). 2) My biggest problem so far though is what I believe is known as deep querying. Before adding an employee to an event I have to know if he/she is already assigned, thus requiring to query the Events collection for an Event with a given ID and also find check if the given Employee ID exists in the employee array. So far I've been unable to do this in a single query. So my question boils down to this. Is my design fine as it is or should I change it given my use cases? Or alternatively, if I keep my current design how should I tackle problem 1 and 2 (that is, manual joins and refs are fine. But is performance a real possible showstopper down the line?).


title: Pointers for transitioning from SOAP to REST based services

text: We currently have a SOAP based web service which is being used by various teams as the primary data source. We eventually want to transition to REST based services. We are reluctant to do this now as the clients would have to do changes. What can we do to make this transition smooth?


title: Is it possible to protect json api scraping using random tokens?

text: I have built a restful json api for an online store using Laravel. I now wish to create an AngularJS app to run the front-end web application. Product prices for my store need to update every second, so Angular needs to get the product json from the server once per second to update the html. I wish to somehow do something to protect this publicly accessible json data from being stolen by scrapers / bots repetitively hitting my api to steal my product and pricing data. My thoughts: Each json api response contains a random use-once token (i am aware about doing stuff to stop collisions). This random token is injected via AngularJS into a hidden field within the html page. Angularjs reads the hidden token prior to re-requesting the api and uses this in the header of the next get request. A json response is only provided with the correct token in the header. Once the token is used, it expires, and any attempt to re-use the expired token, results in that IP address being locked out for a period of time or flagged to administrator to investigate. Is there a better way of doing the above? Are there any kind of actual available solutions to my problem? Considering that I am paying for the product pricing feed in the first place, I really don't want some schmuck getting it from me for free just because I exposed an api! Whilst I understand that there is probably no way of being 99% certain that somebody could find a way of scraping my json, there must be something relatively simple I can do to protect my json feed from dumb bots / scrapers simply using curl to steal data.


title: What skills to master to become a better ASP.net developer?

text: I've been an ASP.net web developer for about 2.5 years now. I would describe my technical training before that as being "classical" C++. It seemed like it took an eternity to get up to speed with ASP.net. I kept wanting to think of programming in VB.net and C#.net as if it were C++ programming, which of course, it isn't. Even my supervisor admitted that at the beginning he had doubts about "keeping me on board", but I made it. I've now been working on a project of my own for about a year. Here are some concepts and technologies I've picked up some skill with along the way.   * class inheritance   * separation of concerns   * LINQ   * SQL   * Session State   * JavaScript   * jQuery   * AJAX   * CSS The first two that I mentioned are essential for keeping the code organized. LINQ is very nice to have to avoid having to write `for` loops over and over. JavaScript seems to have become the backbone of web programming in spite of its shortcomings and jQuery seems to couple it very tightly with CSS. I've been making a big effort to learn to write better JavaScript; mainly by reading on Douglas Crockford's web site. I would like to know, from more experienced web developers, besides what I mentioned here, what are the most important tools to have in your toolbox to write great web applications?


title: Which design pattern is more suitable for logging?

text: I should log some events in a program but as far as I know it would be better to keep the logging code outside the program because it is not about the real functionality of the program. So may you tell me if I should keep it completely out of code and only use Observers and Listeners to log the events? Or I can add a line of code like the following wherever I need to log something:               MyGloriousLogger.getXXXLogger().Log(LogPlace, new LogObject(z1, z2, z3, z4, ..., z99));      Do I make a mistake to use Observer design pattern? I need another design pattern? Or I should stop thinking about design patterns? PS1. If I want to log using only listeners and observers I will certainly need to add and improve the observers and listeners of the program. PS2. I certainly know that there are different libraries for logging in Java and I'm using java.utils.logging but I need to have a wrapper for it to log my special objects.


title: Would a language which doesn't allow comments yield more readable code?

text: Just out of curiosity, I started wondering whether a language which doesn't allow comments would yield more readable code as you would have be forced to write self-commenting code. Then again, you could write just as bad code as before because you just don't care. But what's your opinion?


title: How can I automate production deployments without experiencing extreme anxiety?

text: At our shop we use SVN for source control and CruiseControl for CI on handling automatic builds and deployments to our development, test, and integration environments. This all works smoothly however due to hardware and resource constraints our integration environment is not a 2 server load balanced environment like our production environment. While everything else is equal that would be the only difference between our integration and production environments (although a big one!) Theoretically the difference is a slightly different configuration of our app servers and the deploy script merely would have to drop the build artifacts into two servers instead of just the one, but why am I so nervous to automate our production deployments?! I am generally not a control freak but I always feel the insatiable need to deploy production to production manually. I have heard from colleagues that this is generally a **Really BAD Thing™** but they failed to make a case against it. I know that when I do it manually I can SEE that I am physically copying the correct files, I am physically shutting down the app servers and ensuring they closed successfully, I am physically starting the servers back up and then physically inspecting the logs to make sure it started up okay and the deployment was successful. It gives me a peace of mind. What are arguments against this OR arguments for automatic scripted production deployment?


title: What is the point of the string.Empty property

text: Why was the property `string foo = string.Empty` included in the BCL? It seems more verbose and no clearer than just using an empty string (`string foo = ""`)


title: Is Programming generally an overtime exempt field?

text: My manager told me that the industry doesn't pay overtime for programmers. Is this true?


title: Developing Salesforce apps in Ruby on Rails

text: I want to build a web app that uses Salesforce.com data, and I want to build it fast. I'm a .NET developer (WPF, C#, ASP.NET MVC). I understand Ruby and RoR fairly well, but I haven't delivered any Rails apps. I'm wondering, is Ruby on Rails a suitable tool for rapidly building Salesforce apps, or is it better for the "traditional" web2.0 stuff like Groupon and Twitter? In other words, would using RoR help me achieve my fast (e.g., three months) goal over using .NET, which I already know?


title: Query something and return the reason if nothing has been found

text: Assume I have a Query - as in CQS that is supposed to return a single value. Let's assume that the case that no value is found is not exceptional, so no exception will be thrown in this case. Instead, `null` is returned. However, if no value has been found, I need to act according to the _reason_ why no value has been found. Assuming that the Query knows the reason, **how would I communicate it to the caller of the Query?** A simple solution would be not return the value directly but a container object that contains the value and the reason:               public class QueryResult     {         public TValue Value { get; private set; }         public TReason ReasonForNoValue { get; private set; }     }      But that feels clumsy, because if a value is found, `ReasonForNoValue` makes no sense and if no value has been found, `Value` makes no sense. What other options do I have to communicate the reason? What do you think of one event per reason? For reference: This is going to be implemented in C#.


title: Could Ruby on Rails have been created in another language?

text: Could Ruby on Rails have been created in another language like PHP, or are there some functions in the Ruby language that make the difference?


title: Organizing uncommented, dirty code?

text: I would like to ask you some questions about dirty code. There are some beginners who coded on a medium project. The code is a very huge ball of mud. They are not advanced programmers. They just know how to use keyboard an a little about java. They just wrote code with 12 000 lines in their main class, though, 6 000 lines belongs to NetBeans itself. My job is to analyze the code and suggest a good way to maintain the code. My idea is to scrap the project and start a new one with OOP methodology. Recently I collected some notes and ideas about the problem, from this site and some others. Now, I have the followings questions:   1. Should we repair the code, and change it to a OOP? We are now debugging it.   2. The code has no comments, no documentation, no particular style of programming, and so forth. Changing it is really expensive and time consuming. What do we can do about this?   3. How can I teach them to follow all the rules (commenting, OOP, good code quality, etc.)?   4. The code is erroneous and error prone. What can we do? Testing? We almost write two or three A4 papers for correction, but it seems endless. I should have to say that I am new with them. I think I have broken the rules about adding people too late to the project, as well. Do you think I have to leave them?


title: Looking to build a 2 java applications. should it be web-based application or standalone application?

text: The first application (web-based) will be located at site1 and once the information is processed, it will be sent to the second application(web-based) located at site2. Application2 needs to be able to do the same thing as application1. Because of this, there has to be a way to share the database to keep data in sync. I wanted to go web-based for these two applications, but the issue arises, what if the internet is down? If application1 goes down due to a blackout or lost of internet, application2 should still be able to do what it needs to. I was thinking the database/server will be on Amazon EC2. Even if I go with a standalone application for site1 and site2, it still needs some sort of internet connection to talk to a shared database/server right, possiblity through tcp connection? Because of this, I dont see why it shouldn't just be a web-based applicatin then. This the disagreement I'm having with my team. I want to know the pros and cons of making these two application either being a stand-alone or web-based.


title: python random with a skew

text: I am trying to create a very simple evolution algorithm for a creature simulator, what I would like to have is, both creatures have a trait and a dominance level, both noted by ints. their child's trait will be a random number between creature A's trait and creature B's trait then skewed to the more dominant. So if A has a trait of 5 and dominance of 2 and B has a trait of 10 and a dominance of 7, the skew will be -5 so it skews more towards B. Their child is more likely to have a trait of 8 than 6. Is there a good way to do this? I visualise it ending up like this: A5-6--7---8----9-----10B I can't figure out how much the skew should be until I am able to test the results, so for the time being it's kind of arbitrary. Thank you everyone for taking the time to help me.


title: LGPL 2.1 vs LGPL 3.0 Advantages and Disadvantages

text: From what I've read, LGPL 3.0 allows you to use the license together with other licenses, more permissive about that(Not even sure about that).   From https://www.gnu.org/licenses/gpl-faq.html#AllCompatibility it says that it is not compatible with GPLv2, while LGPL 2.1 is compatible with it. That's a bit contrary to the thing I've read... So, do you know what the real advantages and disadvantages of LGPL 3.0 over LGPL 2.1 are?   One disadvantage would be that it is not compatible with GPLv2.


title: Is it normal to write all logs into a single file?

text: Our teamlead said that many files much worse than a single, despite of we are working on a big project. He argued that our customers could more easily send logs to us if there will be just a single file. To understand our log-file he wants to develope our own log-analyzer which will analyze a single log-file separating it to many


title: Why do I find it so hard to share my work?

text: I've done some application out there, coding is not the problem. But when it comes to deploying / communicating / sharing with buds and friends, I'm like stuck. I feel I'm gonna be humiliated because there are bugs, people will not use it ... I'm sure I'm not the only one in this situation. I can't describe it well but ... Here's an example. You made a todo list manager web application, you use it for some time now. You think it's nice, it does the work - for you. But you just don't got the strenght to email your friend or your work buddies, because they will look at you differently, like "he's the guy with ambition that did a not so good application" ...


title: How fast can Go go?

text: Go is one of the few languages that are supposed to run 'close to the metal', i. e. it's compiled, statically typed and executes code natively, without a VM. This should give it a speed advantage over Java, C# and the like. It seems, however, that it's behind Java (see the Programming Language Shootout) I'm assuming that less mature compilers are hugely responsible for this, but are there any other reasons? Is there anything inherent in Go's design that would prevent it from running faster than, say, Java? I have a very unsophisticated view of runtime models, but it seems that at least in principle it should be able to run faster than Java, thanks to native code execution.


title: How do you compress ASCII strings into smaller bytes?

text: I'm working with an embedded device with a unique protocol that sends messages to other devices and I'm making an application that parses the sent packets. Each packet carries 8 bytes. The protocol is defined as where first byte is header and remaining 7 bytes is the data. They are trying to pass a particular ID string but the ID string is 8 characters long (ASCII) so it won't fit in 7 bytes. What my colleague told me is that they're going to turn the 8 ascii bytes of original string into integer (decimal) and send me 4 bytes of it. They told me I should be able to get the original string from the 4 bytes. I'm having a hard time wrapping my head around on this. So if you have an ID string like "IO123456", that's 0x49 0x4f 0x31 0x32 0x33 0x34 0x35 0x36 in ASCII.. How on earth can you compress that in 4 bytes by turning it into an integer and I can get the original string from it? Am I missing something or is my colleague mistaken? I understand this is a really bizzare question but this seriously does not make any sense to me.


title: How to abstract transition between Views?

text: Our team is developing an application using WPF with MVVM. We want to make ViewModels reusable. With this intention we want to abstract the transition logic between Views (ViewModels, we use ViewModel-first approach with Caliburn.Micro) so the other application can override it. For instance, we have App1 and App2. Firstly, we developed App1 and it has FooViewModel which creates FunViewModel when user clicks a Next button. But, developing App2 we want to get to NotFunViewModel instead of FunViewModel when user makes a click on a Next button. How to accomplish such a task? The solution has to be universal and safe in accordance to types (in compile-time).


title: Should one bind data with Eval on aspx or override ItemDataBound in code-behind?

text: For data bound controls (Repeater, ListView, GridView, etc.), what's the preferred way of binding data? I've seen it where people use Eval() directly on the aspx/ascx inside the data bound control to pull the data field, but to me, it just seems so...inelegant. It seems particularly inelegant when the data needs to be manipulated so you wind up with shim methods like `<%# FormatMyData(DataBinder.Eval(Container.DataItem, "DataField")) %>` inside your control. Personally, I prefer to put in Literal controls (or other appropriate controls) and attach to the OnItemDataBound event for the control and populate all the data to their appropriate fields in the code-behind. Are there any advantages of doing one over the other? I prefer the latter, because to me it makes sense to compartmentalize the data binding logic and the presentation layer. But maybe that's just me.


title: Can being funny hurt your promotion opportunities?

text: I have always been an outgoing guy, who likes to make jokes and be funny. Although this is apparent to everyone I meet, whether it be at a party or just participating in a conversation. It's just who I am. Now when I was in ninth grade in a new school, where nobody knew who I was. I was trying to make friends like any other freshman would in a new school - high school no less. So in class I would joke around talk to people trying to make friends; I used the skills I had cracking jokes making people laugh etc. Now when the end of the first semester rolled around our school was in the habit of highlighting the students that made it to the honor roll in front of the entire school in the gym. No they had two levels of of recognition honor roll and high honor roll. Now the usual suspects go up and claim their two minutes of fame. Then high honor roll came around, my name was called out utter silience hit my friends' faces wondering how I managed to achieve this when i am always joking around and just didn't see me as intellectual person at all. Regardless of whether or not my report card read like someone screaming for dear life (AAAAAAAAAAAAAAAAAAAA). I was always well liked and enjoyed surprising people, when they would underestimate me; I relished it in. I always enjoyed shocking people, and making them eat their words. Something I always lived with. Now after graduating I have title which designates me some respect depending on which social circles you hang in (heres looking at you designers). I am afraid that my outgoing nature is going to cost me a promotion, or management not seeing the entire person I am. It has burnt me in the past while in university working for people who only saw the light hearted joking I put forward, and putting other people in positions that I was better qualified for. As a programmer, I know my work will speak for itself but they might see the joking as irresponsible or ignorant. He lack responsibility, all the things associated with people who make jokes. Should I stifle myself so people see how I truly am? Or continue to wait for the opportunity to shock them, that don't always present themselves, since there is no honor roll at the end of the semester. Please and thank you, xoxo Gossip Girl (just kidding)


title: Does it make sense to license source code snippets by CC-BY(-SA)

text: If I want to put random source code snippets in a publicly accessible git repository, does it make sense to license by CC-BY(-SA) given that CC-BY licenses are generally not recommended for software? To me there is a difference between a full software project where CC-BY clearly isn't appropriate and small random source code files. CC-BY seems like a simple license where GPL is over the top. The main reason that I ask is that I may take code from StackOverflow (modified or not) which I believe is licensed as CC-BY-SA. Sometimes it would be convenient for me to put it all in one place so I can easily access and find it in the future. While I may be being overly-paranoid, I would like to adhere to the StackExchange CC-BY-SA license. Licensing everything I put there as CC-BY-SA is simple and seems appropriate for snippets (of course code taken from other sources, say with GPL/BSD or whatever will retain their original license if required). Finally can I combine CC-BY-SA with GPL?


title: Does this Relational Database Model make sense?

text: Here is a flat version of my datamodel. It is sensor readings for various data acquisition equipment. ![0](http://i1295.photobucket.com/albums/b628/colnewman26/Work%20Screen%20Shots/RobinDataModel_zpsdfc40151.png~original) http://i1295.photobucket.com/albums/b628/colnewman26/Work%20Screen%20Shots/RobinDataModel_zpsdfc40151.png~original Here is my Relational Database model. Does this make sense. ![1](http://i1295.photobucket.com/albums/b628/colnewman26/RobinDataModel_zps847d94b5.png~original) http://i1295.photobucket.com/albums/b628/colnewman26/RobinDataModel_zps847d94b5.png~original If not what you suggest?


title: Is it mandatory to obtain a licence for distributing software uses bundled Mono runtime?

text: My software composed of an EXE and dependent class library dlls, built on Windows using visual studio C# Compiler. I've been able to run it directly on Mac OS X using _mono myApp.exe_ without rebuilding. Now, for the deployment, I've successfully made mono bundle using **mkbundle** with _\--deps_ option for all dependent class library assemblies. But I did **NOT** use _\--static_ option. So my application dynamically links to mono and glib. Wrapped it inside mac APP bundle, then copied the needed libmono- _[XYZ]_.dylib , and all other dependent native libs from _Library/Frameworks/Mono.framework_ into that bundle, changing each dylib id and install name to be the copy insde the bundle rather than original in Mono.framework directory. Tested the _M_ bundle in a mono free machine. the bundle worked perfectly. **My question** is, do I still need to obtain a license from Xamarin to distribute my application to end users under my proprietary license, provided that all mono native runtime libraries are in the App bundle and the user can update/replace them as per LGPL license of mono runtime? Thanks!


title: Automating release management and CI on python projects under mercurial VCS

text: I have a set of Python projects which are under the mercurial VCS. I would like to automate the following tasks:   * Run the test suite for every commit (CI).   * Make a source distribution for every commit, which has a tag in mercurial. This is regarded as a new release.   * Copy the distribution to a special repository. There is _Jenkins_ as a proposal for similar questions, but I'm not sure if it can handle the release management like intended.


title: Error handling, creating time line, need help defining what aspects of the environment need tracking

text: For my final year project, I'm working on a script that will run your python program and provide a time line of events(so far working on assignments) and create a story of what happened(the changes in the variables). Based on what Exception is thrown, you can choose to use the library made available by me to help figure out what happened and how it happened. (Hopefully I explained this much better than I did on stack overflow) My question to you, besides the variables, when an error occurs/exception you cant handle occurs, what would you look through in order to try and fix the problem? Many thanks.


title: What Do I Need To Know About Servers In a Web Development Role?

text: I know that may sound a little vague, so I'll try and explain a little further... After being self employed developer for many years I'm now in search of a commercial web developer role. My only experience with servers and hosting is uploading through FTP and playing around with CPanel/WHM a little. The role's I'm going for are web development PHP, MySQL, HTML, CSS type roles, but in recent interviews I've been asked questions about setting up things on the server, that I had no idea what was being said... which wasn't ideal! Without knowing more than I do, it's hard to explain what exactly I'm looking to learn, but it's basically just the server elements I should know as a web developer? If you're a web developer, do you have any dealing with the server apart from uploading files, and if so, what? Are things like Subversion(SVN) and version control systems often set up by the web development team, could that be what they were talking about?


title: How much to "automatically" do?

text: I'm reading Code Complete 2, and I'm at the chapter where it says to (paraphrasing) "avoid programming through the interface." Why is it bad to program "through" the interface? A more concrete example: if I have a method of a class that submits a funny picture, what's wrong with it logging me in also? Should I simply provide more "helper" methods that do it automatically? Would it be preferred to break it up into:   * set_login(username, password)   * login()   * submit_picture(funny_picture)   * easy_submit(funny_picture) # where it will log in (if not already) and submit


title: What to do when time estimation goes wrong?

text: Let’s say you estimated time for a case to be 3 days. In day two you notice that the case is growing and new scenarios are popping up which were not counted when the time estimation where done. The new finding leads to 2 days extra (total 5 days). This is a typical problem that you will face sooner or later as developer.   * Which strategy can be used when you are going to notify project leader the new time of delivery?   * Often you get the question why? How do you motivate the new time of delivery? The fact is that many projects don’t put much time on analysis & design during SDLC. **EDIT:** In very complex projects no matter how much reasonable time you put on Analysis & Design there are always surprises since the business rules are too complex. However in such cases I believe the project leader must be aware of the complexity and have right attitude when unexpected surprises comes up. The question is how to tackle project leaders who don’t understand the complexity.


title: What is the difference between "Syntax" and "Syntactic Sugar"

text: ## Background The Wikipedia page on Syntactic Sugar states: > In computer science, syntactic sugar is syntax within a programming language > that is designed to make things easier to read or to express. It makes the > language "sweeter" for humans to use: things can be expressed more clearly, > more concisely, or in an alternative style that some may prefer. I don't really understand what the difference is between Syntactic Sugar and Syntax. I appreciate the point that the sugary version can be clearer, more concise, perhaps boil off some boilerplate. But I feel at some level, all the syntax is essentially doing that to form an abstraction over what the code gets compiled down to. From the same Wikipedia page: > Language processors, including compilers, static analyzers, and the like, > often expand sugared constructs into more fundamental constructs before > processing, a process sometimes called "desugaring". As a thought exercise, if I take "often" in this statement to mean "always": If the difference were just whether the compiler "desugars" the syntax before moving to a next stage, how might a coder who does not know the innards of the compiler know (or care) what is Sugar'd Syntax or not? A very much related question on this site "Rigorous Definition of Syntactic Sugar?" has an answer which commences: > IMHO I don't think you can have a definition for syntactic sugar, because > the phrase is BS and is likely to be used by people that talk about "real > programmers" using "real tools" on "real operating systems" Which might indicate to me that perhaps there isn't a huge difference to the coder using the language? Perhaps the difference is only perceptible to the compiler writer? Though there may be instances in which it's helpful for the coder using the language to know what's under the hood of the Syntactic Sugar? (But perhaps in reality any discourse on the subject tends to use the term as flame bait?) ## The heart of the question So... the short version of the question:   * Is there a real difference between Syntax and Syntactic Sugar?   * Who does it matter to? ## Extra Food for Thought Bonus on topic contradiction: On the Wikipedia page an example is given: > For instance, in the C language the `a[i]` notation is syntactic sugar for > `*(a + i)` Whereas another answer on the above linked question talks about the same example: > Now consider `a[i] == *(a + i)`. Think about any C program that uses arrays > in any substantive way. And summarizes that: > The `[]` notation facilitates this abstraction. It's not syntactic sugar. The opposite conclusion for the same example!


title: Google Chrome Extension Development for Dummies?

text: I want to get started writing extensions for Google Chrome. I am a long time C, C++, Delphi, etc. developer for many years with some Java skills. I believe Chrome extensions are written in C++ but perhaps some people have figured out how to do development in other languages via alternate methods. [UPDATE: NPAPI plug-ins are written in C++. Generic Chrome extensions use HTML, CSS, and JS as pointed out in the comments and replies below.] Is there a book that covers developing Google Chrome extensions for those new to the field but are experienced programmers? Any other resources? I'd be most grateful for resources that cut out most of the ambient learning material and go straight to the heart of the matter with good samples along the way. Some tips on developing using development tools that run on the MS-Windows platform would be great too. \-- roschler


title: Naming conventions: camelCase versus underscore_case ? what are your thoughts about it?

text: I've been using underscore_case for about 2 years and I recently switched to camelCase because of the new job (been using the later one for about 2 months and I still think underscore_case is better suited for large projects where there are alot of programmers involved, mainly because the code is easier to read). Now everybody at work uses camelCase because (so they say) the code looks more elegant . What are you're thoughts about camelCase or underscore_case p.s. please excuse my bad english **Edit** Some update first:   * platform used is PHP (but I'm not expecting strict PHP platform related answers , anybody can share their thoughts on which would be the best to use , that's why I came here in the first place)   * I use camelCase just as everibody else in the team (just as most of you recomend)   * we use Zend Framework which also recommends camelCase Some examples (related to PHP) :   * Codeigniter framework recommends underscore_case , and honestly the code is easier to read .   * ZF recomends camelCase and I'm not the only one who thinks ZF code is a tad harder to follow through. So my question would be rephrased: > Let's take a case where you have the platform Foo which doesn't recommend > any naming conventions and it's the team leader's choice to pick one. You > are that team leader, why would you pick camelCase or why underscore_case? p.s. thanks everybody for the prompt answers so far


title: Why are some saying that Java will be the new COBOL?

text: I heard the news about Java and the JCP/Apache. What I don't understand is, why does this have to affect the Java market ? Sure, the license has changed and maybe it's moving to a be a bit more closed source but why would people think /it's/will be/ the new COBOL?


title: Terms for different types of development

text: I'm trying to figure out the right terminology for the different types of software development Right now, the only development term I know is "web development", but I've also done a lot of Java and C# development for desktop applications. Obviously this isn't web development, but I'd like to be able to group these under a single term that is widely known and accepted within the industry. Would the term for applications on the desktop be "desktop development"?


title: How to encapsulate method parameters in Java?

text: An HTTP query can be parametrized to a list of pairs like `name=value` that can be encapsulated in general as `Map<String, String>` since an HTTP GET query is string pairs. I could need something for any combination of objects and primitives. A varargs method for example `update(String s1...)` could be written in general as `update(Map<String, String>)` where the key is the name and the value is the data. Therefore I wonder if it could be good to use a definition as `Map<K, V>` instead of writing a custom object in this case wrapping the specific 3 parameters to a class in their specific types which can't be reused whereas a `Map<K, V>` can be used to encapsulate any 2-tuples when we must write a pair like `Integer i` or `int i` or `int i=0`. But I think it will only work for classes and not for primitive types, so the primitive types must be boxed in their objects so I must also box an `int` to an `Integer` for this to also work with primitive types. Is there a better way than `Map<K, V>`to encapsulate method parameters when we must select a list of unknown length and unknown types where the types could be primitives or objects? So instead of being specific about types and their values in the method, can I use a `Map<K, V>` instead of a list of named pairs such as `String s, int i, Object o...`


title: Phenotropic Program Design

text: I recently ran across an idea put forth by Jaron Lanier called "phenotropic programming." The idea is to use 'surface' interfaces instead of single point interfaces in computer programs utilizing statistics to winnow out minor errors that would typically cause a "classical" program to catastrophically crash. The two-line description is here: > According to Jaron, the 'real difference between the current idea of > software, which is protocol adherence, and the idea [he is] discussing, > pattern recognition, has to do with the kinds of errors we're creating' and > if 'we don't find a different way of thinking about and creating software, > we will not be writing programs bigger than about 10 million lines of code > no matter how fast our processors become.' The slightly longer explanation is here. And the even longer explanation is here. So, the question, looking past the obvious robot-overlord connotations that people tend to pick out, how would one actually design and write a "phenotropic program?"


title: What software development model has worked best for software teams with heavy dependancy on hardware teams?

text: There are a number of competing best practices for software development. From what I have found, many teams have benefited from **Agile** practices in some cases. However, in some other cases, using the **Unified Process** has been championed by large companies like IBM. The common themes that I find seemed to work well for teams that mainly develop software. I am interested to know what has worked best for people who have worked in shops where there is a team on the other side that produce the hardware that your software is running on. For example, one team puts together a crate with several custom hardware on it; while you need to develop the software that would run on those crates. I can't find a development model (agile, spiral ...) that works best in this case. Any wisdom is this area will be well appreciated.


title: Can the overuse of custom taglibs disrupt the outsourcing of html designers?

text: Yesterday me and a friend were talking about the overuse of custom taglibs. We create taglibs for everything. We create taglibs in order to wrap jQuery UI elements (tabs, button, etc), and other plugins elements as well. We often wrap them together in a single component. We use taglibs in a point that we almost have no pure html within the body tag. Our question is: **is this a healthy habit?** Imagine two situations: 1) We hire an html designer and have the cost of a month for him to learn all this stuff. 2) We want to outsource the html development but no company would get our taglib library to learn, OR it become more expensive. We love taglibs as its been a lovely shortcut for javascipt development as we write it only once. What would be the best practices in this sense, and what would you suggest? We are looking for a future-proof solution (or an argument that agrees with ours).


title: What parts of Code Complete haven't stood the test of time?

text: I was looking at Code Complete on the shelf, thinking, "Outside of the Mythical Man Month, this may be one of the few mass market Software Engineering books to stand the test of time." For this reason, I'm thinking of jumping in to reread it. I'm curious - has anyone else given it a second look recently? I so, did you see anything he got very wrong? This isn't an attack, and not a request for a book review - I am more interested in which ideas have changed over the years. And please - no comment about, "Demarco/Spewak/Zachman stood the test of time..." I am specifically interested in Code Complete because of the breadth of ground it covers, and breadth of impact it had in the field.


title: Where can I find simple, but well-written programs to learn from?

text: I've tried a few times to look at the source code for various things from github or other sites, in javascript, C#, PHP, etc. I'm never able to understand the programs as a whole though. I can sort of piece together what a specific snippet of code does, but I quickly lose the context of what I'm looking at and how it fits in. I want to be able to improve, but everything I've tried learning from so far has been too big. Where can I find well-written, but not very complex source code to look at? edit: Sorry, to be more specific, I'm hoping for javascript/php/C#.


title: Testing multi-threaded race conditions

text: Reading the comments to this answer, specifically: > Just because you can't write a test doesn't mean it's not broken. Undefined > behaviour which usually happens to work as expected (C and C++ are full of > that), race conditions, potential reordering due to a weak memory model... – > **_CodesInChaos** 7 hours ago_ > @CodesInChaos if it cant be reproduced then the code written to 'fix' cant > be tested either. And putting untested code into live is a worse crime in my > opinion – **_RhysW** 5 hours ago_ ...has me wondering if there are any good general ways to consistently trigger very infrequently occurring in production problems caused by race conditions in test case.


title: Establish/meet deadlines when I am constantly working with unfamiliar platforms and frameworks

text: I work for a product development organization that is in online advertising. The assignments I receive are almost always on platforms or tools that I have never worked on before. At first it was android. Then node.js, then windows phone, then debian packaging, then python, hadoop, ganglia, reverse engineering, geo PostgreSQL, and the list goes on. I am happy to be able to learn so much while on the job. The problem I keep running into is meeting deadlines. Often times it is not clear what is needed to be done to accomplish a certain task. I would need to set up the relevant SDK, run intobeginning issues, read online, pore through documentation, research online for every single item of work in that platform. Sometimes I am given deadlines, sometimes I create those deadlines. I find it very hard to meet deadlines a lot of times. One becomes faster at doing something the second time around but I never work on some language or framework for longer than a week or two. And this is very stressful and painful to deal with. I get all the flak and public shaming that comes with missing deadlines. I suspect this cannot be normal. It cannot be possible to deliver 7 windows aphone apps not knowing a single thing about c# in a week. But I managed to do it one-day after the deadline. All I have a lot of times is google search to guide me. Often there is little to no documentation on the tool I am customizing. I sometimes get stuck on something sometimes for hours or even days. This takes a toll on my health and I am no longer able to burn the midnight oil for every task. This causes a lot of mental anguish and depression. In this situation, Am I correct in thinking any deadline I provide is a shot in the dark? Is this normal? Does every single work item for you involve learning something completely new every time? I am not sure if it is fair to say I am a poor performer for not being able to meet deadlines on tasks involving a tool I don't know anything about. How do I handle this?


title: From where is a DES key generated?

text: GOing over a lecture on DES   I got most of it except WHERE DOES DES KEY COME FROM?   Does an authority give you the key or what?   Simple language please


title: Parsing Razor-style Templates

text: I want to build a template engine (ITT not another template engine...) based on Razor. I've been at it for quite a long time not getting anywhere and quite frankly I'm at my limit. I've tried rolling my own, I've tried generating using ANTLR and I reckon I just need someone to tell me if I have to bite the bullet and do this the hard way. To be honest I've been trying to do this as simple as possible. '@' denotes the start of a special statement. A statement could be:   * an identifier of a variable   * an identifier of a function call. Parens must be balanced, and handle strings.   * the start of one of Java's logic constructs (if, for, while/do)   * a single line statement that yields a output value @( )   * a multi line block of statements @{ } The part which is killing me: everything within {} is treated as code UNLESS:   * it is escaped with @:. The line is treated as text   * a html tag is found . Everything from that point on is treated as text So, now we have issues as the '<' token now has context. It could either LT or the start of a HTML tag. It does not help either that a tag could also have attributes, and each attribute could also have special statements in them. Then, I also need to balance brackets and string quotes as well. There is also the added complexity of the lack of terminating sentinels (unlike say, php, which has tags). It seems impossible to parse these as alternating CODE - RAW - CODE - RAW tokens, so that the end result is simply me combining pieces of tokens into a Java class and let the Java compiler handle syntax. I'm just about to double down and reimplement the Java grammar and parse everything. Something which I am not keen on doing... :( Anyway, let me know if there's any easier ways to approach this, or how you would attempt this exercise. Regards, Daryl


title: Are there any surveys on to what degree developers like or hate scrum?

text: Background: During a conference an analyst pointed out in a tweet that developers hate scrum. Myself and another person responded that this was not the case, and started discussing different scenarios on why developers would dislike scrum. One of the scenarios where that lazy developers are not able to hide in a scrum project. They are constantly challenged by the team to contribute. This discussion resulted in a blog post and video http://elsewhat.com/2010/05/20/lazy-developers-hate-agile-and%C2%A0scrum/ I've gotten three comments which I've tried to answer in a neutral way, but they comments do point out that there are some people who loathe scrum (and I am always 100% certain they are not lazy developers). **Question** **Have there ever been a survey among developers on to what degree developers like or hate scrum ?**


title: iOS chat application design, sending/relaying the message over to the end user

text: I have a design question. Let us say you were tasked with building a chat application, specifically for iOS (iOS Chat Application). For simplicity let us say you can only chat with one person at a time (no group chat functionality). How then can you achieve sending a message directly to an end user from phone A to phone B? Obviously there is a web service layer with some API calls. One of the API calls available will be `startChat()`. After starting a chat, when you send a message, you make another async call, let us call it `sendMessage()` and pass in a string with your message. Once it goes to the web service layer, the message gets stored in a database. Here is where I am currently stuck. After the message gets sent to the web service layer, how do we then achieve sending/relaying the message over to the end user? Should the web server send out a message to the end user and notify them, or should each client call a `receiveMessage()` method periodically, and if the server side has some info for them it can then respond with that info? Finally, how can we handle the case in which the user you are trying to send a message to is offline? How can we make sure the end user gets the packet when he moves back to an area with signal?


title: When is a Use Case layer needed?

text: In his blog post The Clean Architecture Uncle Bob suggests a 4-layer architecture. I understand the separation between business rules, interfaces and infrastructure, but I wonder if/when it's necessary to have separate layers for domain objects and use cases. What added value will it bring, compared to just having the uses cases as "domain services" in the domain layer? The only useful info I've found on the web about a use case layer is an article by Martin Fowler, who seems to contradict Uncle Bob about its necessity: > At some point I may run into the problems, and then I'll make a Use Case > Controller - but only then. And even when I do that I rarely consider the > Use Case Controllers to occupy a separate layer in the system architecture. Edit: I stumbled upon a video of Uncle Bob's Architecture: The Lost Years keynote, in which he explains this architecture in depth. Very informative.


title: Why is there no Git client for Android?

text: Since there is a pure Java implementation of basic Git features called JGit, which also has a couple of heavy-duty users (Gerrit), I can't help to wonder: why hasn't someone implemented a basic Git client for Android yet? Anyone know any reason which would make this impossible (apart from time)?


title: Should we adopt an agile methodology when rewriting an existing application from scratch?

text: I work for a small product based company. We are about to re-write our existing product from scratch. We are planing to adopt Agile methodology for our development. Now my question is as we have all the requirements even before start of project (as we are re-writing the existing product), is it worth to dive into Agile world? Isn't agile more useful when you don't have all the requirement upfront and you get your requirement in phases? Secondly, let's say if we jump into Agile, whats the best practice to design database? Let's say in our first iteration we just create a login system (user can login, logout etc). Do we just need to create Users table without worrying about other tables? And other tables would be evolved as our product would progress?


title: How do I find a qualified web designer in my area?

text: I just sent out emails to five local web design companies to my area asking to take drawings to HTML/CSS/jQuery. None of the ones who accepted the deal seem suitable to myself. Others rejected the offer because they wanted to 'provide an end-to-end solution' or are 'booked till June'. The local companies did not seem suitable to myself because my review process is this: goto their website, do a view-source. I'll see really weird things (contact us forms that go nowhere), really old things (mm_menu.js), and portfolios that are non-existent (aren't on the site, don't link anywhere, or otherwise). The company would like to hire as locally as they can rather than out-source to another country. **Answers I'm looking for**   * Processes you use when searching for someone   * How you qualify their aptitude for the project   * Anything that you think I'm doing wrong, or should be doing also. **Answers I'm not looking for:**   1. "Hello sir please contact me we do everything for 10 dolla."   2. My bud's great at this stuff, call him.   3. example.com is the best for this.


title: Is mootools alternative of jquery + backbone / spine / sprouteCore

text: I was a full time java developer, now I'm also working with JavaScript and Android. A couple of years back when I started learning JavaScript, the first library I tried was jQuery. But it made my life harder, and after sometime I started writing fairly large a JavaScript app. It wasn't coming together for me using jQuery. I had huge a code base without much of a structure. Method blocks updating HTML blocks using selectors. Then I tried MooTools and obviously as a Java developer it appealed to me a lot. And I was able to write managable web apps having huge code base. As per my understanding MooTools is not considered a preferred way to write JavaScript because it mimics conventional OO over default prototype-based OO language. So now to really understand Javascript and desire of walking with the world, I decided to try other approaches, so again I turned back to jQuery, and realise that only jQueryis not enough. So started looking at current trending frameworks like backbone, spine, ember.js, sprouteCore. Strangely I found that these frameworks mimic conventional OO like MooTools only by having constructors and creating a object of class and reusing this class object to create instance objects. So   * Am I missing something?    * Is MooTools really wrong?    * MooTools project is very alive and releases new versions/features, but I don't see many people talking about it on internet, also there are no comparisons vs backbone/spine etc.


title: Preparing for an interview slightly outside my skillset

text: I have 4 years of experience in web development, so: PHP, javascript, Mysql, HTML, CSS, the usuals. I have an interview soon for a position involving c#, wpf and other desktop programming languages. Its a junior position, which I perceive as: someone willing to learn, junior to no knowledge and fast learner. I have very limited experience in c# and wpf but no knowledge of some other requirements. In the initial round of interviews which were conducted via video, so not face to face, I was honest, I told them I am keen to learn, but have limited and no experience in what they offer but I do have transferable skills. Surprisingly to me they offered a face to face interview considering how honest I was about I didn't atm meet much of the desired requirements. What would have lead them to offer me a face to face interview? How should I approach this interview without sounding to repetitive and begging whilst being honest but confident?


title: Is a development environment required for small projects?

text: I won a bid on Elance and was had a request to fix some css and html issues with a WordPress site. How do I make changes to the document without working on the live site? Do you set up a development environment for every job you get? This would be time consuming on a job that pays very little. I was offered access to the wp-admin and the cpanel but any changes would affect the live site immediately. What is the best practice for changing and updating sites for clients? Any advice on how to develop on a site that you do not have the full install on is helpful.


title: Recruiting programmers- going beyong the code

text: I'm recruiting coders. The first step is to carry out a test to cut out the "chafe", but do I just make a decision based on the fact that the shortlisted candidates are the best in the world at coding? What should I look out for that would guarantee that the persons i finally hire are not only the best coders but also are the best fit for my company. What should the tests exactly measure?


title: Technical reasons to prefer coding business logic to support Unicode (when not required)

text: I have a legacy application in which the UI and business logic are already reasonably well-separated. There is a proposal to separate them even further, turning the core application into a "service" (without UI) and writing a kind of "UI Server" as part of it to which various UIs (potentially in various languages, and for various different devices and operators) can connect to get/set the data to drive the application via those UIs. On the surface, this seems to make a nice separation between the business logic, which is currently completely ignorant of the possibility of Unicode, and the UI, which is going to need to get very familiar with Unicode to support multiple languages in the UI(s). Now this application essentially monitors a production process, and has very little (if any) traffic directly from UI to database via the business layer. It strikes me that the "natural language" of this process might as well be Chemistry or Mathematics, and so internally I should stick to the language that best describes it, so long as I can translate from that language into anything any UI requires (which I believe should be possible). This leads me to prefer (the simplicity and familiarity and least work path of) retaining old-fashioned 8-bit chars over moving to Unicode. Are there any technical reasons to reject keeping the business logic part of an application ignorant of Unicode like this? And even if the "natural language" of the system were "English-without-too-many-strings-or-dates" rather than Chemistry, would that make a difference?


title: How common is prototyping as the first stage of development?

text: I've been taking some software design courses in the past few semesters, and while I see the benefit in a lot of the formalism, I feel like it doesn't tell me anything about the program itself:   * You can't tell how the program is going to operate from the Use Case spec, even though it discusses what the program can do.   * You can't tell anything about the user experience from the requirements document, even though it can include quality requirements.   * Sequence diagrams are a good description of how the software works as the call stack, but are very limited, and give a highly partial view of the overall system.   * Class diagrams are great for describing how the system is built, but are utterly useless in helping you figure out what the software needs to be.  Where in all this formalism is the bottom line: how the program looks, operates, and what experience it gives? Doesn't it make more sense to design off of that? Isn't it better to figure out how the program should work via a prototype and strive to implement it for real? I know that I'm probably suffering from being taught engineering by theoreticians, but I need to ask, do they do this in the industry? How do people figure out what the program actually is, not what it should conform to? Do people prototype a lot, or do they mostly use the formal tools like UML and I just didn't get the hang of using them yet?


title: Is there a way to write this fold neater in Haskell?

text: I have the following small function that uses foldr to find the largest second number of a 2-tuple:               listMax :: [(Int,Int)] -> Int     listMax = snd . foldr (\(_,freq1) (_,freq2) -> (0,max freq1 freq2)) (0,0)      My question pertains to the body of the lambda:               (0,max freq1 freq2)      I had to make it into a tuple with a dummy head so that it matches it's own input for the fold. To me though, it looks ugly and makes it harder to read. Is this the standard way of dealing with this situation, or is there a idiomatic way around this?


title: Is it legitimate to ask co-workers to use specific browser in an intranet website?

text: I developed an intranet (local network) `ASP.NET` web project for my co- workers. In the development process I used `Chrome` and `Firefox` and didn't test much with `Internet Explorer`. The website works well with `Firefox` and `Chrome` and with `IE` it had major bugs. **Is it legitimate to ask the users to use`Chrome` or `Firefox`?** They are all co-workers (around 15 users). I don't want to spend time fixing the bugs for `IE`, some might be related to stuff I can't fix myself (`jQuery` things), if I wanted to be compatible with all browsers, I would have to make a major re-design,


title: When should I care about performance?

text: For the longest time in places like Java's IRC channel, SO, and other places I've been told something along the lines of "Worry about how the code looks and its readability/understandability now, and performance later if absolutely necessary". So for the longest time, I haven't really been OCD about performance for my small desktop or web apps, just removing the obviously inefficient. Most responses are "What about scalability?". Thats a legitimate point, but if my app was only built to parse, say, files 10,000 lines long, should I make my code a mess for the small percentage of people that are going to shove in a 1,000,000 line file? My main question is when should I trade the easy but somewhat inefficient ways of doing tasks for big giant complicated beasts that do things extremely quickly but destroy any possible ways of upgrading and make the code excessively difficult and prone to rewriting anyway by the next developer?


title: Changing method signature for implementing classes in PHP

text: Is there any decent work around to PHP's lack of Generics that allow static code inspection to detect type consistency? I have an abstract class, that I want to sub-class and also enforce that one of the methods changes from taking a parameter of one type, to taking a parameter which is a sub-class of that parameter.               abstract class AbstractProcessor {         abstract function processItem(Item $item);     }          class WoodProcessor extends AbstractProcessor {         function processItem(WoodItem $item){}     }      This is not allowed in PHP because it's changing the methods signature which is not allowed. With Java style generics you could do something like:               abstract class AbstractProcessor<T> {         abstract function processItem(T $item);     }          class WoodProcessor extends AbstractProcessor<WoodItem> {         function processItem(WoodItem $item);     }      But obviously PHP doesn't support those. Google for this problem, people suggest using instanceof to check errors at run-time e.g.               class WoodProcessor extends AbstractProcessor {         function processItem(Item $item){             if (!($item instanceof WoodItem)) {                 throw new \InvalidArgumentException("item of class ".get_class($item)." is not a WoodItem");             }          }     }      But that only works at runtime, it doesn't allow you to inspect your code for errors using static analysis - so is there any sensible way of handling this in PHP? A more complete example of the problem is:               class StoneItem extends Item{}     class WoodItem extends Item{}          class WoodProcessedItem extends ProcessedItem {         function __construct(WoodItem $woodItem){}     }          class StoneProcessedItem extends ProcessedItem{         function __construct(StoneItem $stoneItem){}     }          abstract class AbstractProcessor {              /**          * @return ProcessedItem          */         abstract function processItem(Item $item);              function processAndBoxItem(Box $box, Item $item) {            $processedItem = $this->processItem($item);            $box->insertItem($item);         }              //Lots of other functions that can call processItem     }               class WoodProcessor extends AbstractProcessor {         function processItem(Item $item) {             return new ProcessedWoodItem($item); //This has an inspection error         }     }          class StoneProcessor extends AbstractProcessor {         function processItem(Item $item) {             return new ProcessedStoneItem($item);//This has an inspection error         }     }      Because I'm passing in just an `Item` to `new ProcessedWoodItem($item)` and it expects a WoodItem as the parameter, the code inspection suggests there is an error.


title: Am I slow or is this normal?

text: I am currently in high school and I discovered programming 3 years ago but I am still not "good" and it is difficult for me some times to understand, especially about data structures, bytes etc... Moreover, when I program I waste most of my time not creating but searching my syntax error, commas and all those things. I am very slow. I would love to be an expert is programming but I feel like I am too "dumb" to go threw those difficulties. At the same time, I feel passionated about Technology, Computers and Coding... So, is it normal to be slow as I am even 3 years after discovering development or Am I just not made for this? Does anybody experienced the same feelings? Would it become better with college?


title: How to work on my personal ideas during the weekend?

text: I'm working full time 5 days a week, mostly between 10 and 14 hours a day. In the end of the day I'm very tired and just wanna take a shower, hang out and go to sleep. I have a lot of ideas that I want to implement and someday sell maybe through an online software business. I have my weekends free. However, when I get to the weekend I can't even imagine myself turn on the computer. But I really want to make my ideas happen, and I can't leave my job right now to devote myself only to my ideas. What do you say? Do you find some method helpful? Do you use some technique? Thanks


title: Prevalence of "back end" programmer roles in ASP.NET (MVC) projects?

text: First, unless anyone has better definitions, let's define "back end" and "front end" according to their usage here: Is it common to separate back-end and front-end into two positions on web development projects?. How common is it to find programmers exclusively assigned to back end or front end roles on a team? What's the scope of their responsibilities?


title: We are spending more time implementing functional test than implementing the system itself, is this normal?

text: Basically, we have three main projects, two of them are web services, and the other is a web application. While I'm satisfied with covering as much as we can of our web services with functional test (all three projects have their proper unit tests), functional tests for the web application are taking a lot of developer time to get implemented (and by a lot I mean two times, or some times more, the time that takes to implement the functionality being tested with unit test included) The manager policy is to test every single functionality we add, even if is not business critical (i.e a new C.R.U.D). I do agree with testing all of the web services functionality, because is hard to manually test them, and also, this tests run fast and doesn't take to much to implement. So, what's the value in spending more time writing functional test, than writing system code, unit test and fixing QA tikets? Is this normal? shouldn't we be writing functional test only for critical functionality and let QA to do regression tests over no critical functionality? Note: we are not developing medical software or NASA software or nothing that critical. Note2: sorry my bad English!


title: Apache License and patents

text: I am trying to understand how Apache License affects patents. In regards to the Apache website http://www.apache.org/licenses/LICENSE-2.0 section 3, am I right to say for the first part that it is saying the licensee is allowed to do pretty much anything with the patent? In the latter part, is it saying that if a licensor decides to sue someone who is infringing over their patent they will lose all their patents or is it talking about the licensee? I'm not a lawyer and this is all very confusing =(


title: Reasons for removal of function types in Java 8

text: I have been trying to understand why the JDK 8 Lambda Expert Group (EG) decided not to include a new function type into the Java programming language. Going over the mailing list I found a thread with the discussion about removal of function types. Many of the statements are ambiguous to me, maybe because of the lack of context and in some cases because of my limited knowledge on the implementation of type systems. However, there are a couple of questions that I believe I can safely formulate in this site to help me understand better what they meant. I know I could ask the questions in the mailing list, but the thread is old and all decisions are already made, so chances are that I will be ignored, above all seeing that these guys are already getting delayed with their plans. In his answer to support the removal of function types and endorse the use of SAM types, Brian Goetz says: > No reification. There was a long thread about how useful it would be for > function types to be reified. Without reification, function types are > hobbled. I couldn't find the thread he mentions. Now, I can understand that the introduction of a structural function type may imply certain complications in the Java mostly nominal type system, what I cannot understand is how parametrized SAM types are different in terms of reification. Aren't they both subject to the same reification problems? Does anyone understands how function types are different than parametrized SAM types in terms of reification? In another comment Goetz says: > There are two basic approaches to typing: nominal and structural. The > identity of a nominal is based on its name; the identity of a structural > type is based on what it is composed of (such as "tuple of int, int" or > "function from int to float".) Most languages pick mostly nominal or mostly > structural; there are not a lot of languages that successfully mix nominal > and structural typing except "around the edges." Java is almost entirely > nominal (with a few exceptions: arrays are a structural type, but at the > bottom there is always a nominal element type; generics have a mix of > nominal and structural too, and this is in fact part of the source of many > of people's complaints about generics.) Grafting a structural type system > (function types) onto Java's nominal type system means new complexity and > edge cases. Is the benefit of function types worth this? Those of you with experience in the implementation of type systems. Do you know any examples of these complexities or edge cases that he mentions here? Honestly I get confused by these allegations when I consider that a programming language like Scala, which is entirely based on the JVM, has support for structural types like functions and tuples, even with the reification problems of the underlying platform. Don't get me wrong, I am not saying that a function type should be better than the SAM types. I just want to understand why they took this decision.


title: Using xml datatype to store a "shopping cart"

text: For my final project in school we have to develop an online shop. This shop should have a cart where items can be placed whether or not you are logged in. If you log out the cart shouldn't empty and should still be shown. So my question is would it make sense to store the cart as xml in the database(ms sql server)? There is potentially a (relatively)fair amount of data that should be kept, is it possible that this could deliver any performance benefits or am I way off base?


title: The MsC gray zone: How to deal with the "too unexperienced on engineering/too under-qualified for research" situation?

text: Last year I've got a MsC degree on CS. On the beginning of the MsC course, I was keen on moving on with research and go for a PhD. However, as the months passed, I started to feel the urge to write software that people would, well, _actually use_. The programming bug had bitten me, again. So, I decided that before deciding on getting a PhD degree, I would spend some time on the "real world", working as a software developer. Sadly, most companies here in Brazil are "services" companies that seem to be stuck on the 80s when it comes to software development. I have to fend off pushy managers, less-than-competent coworkers and outrageous software requirements (why does everyone seem to need a 50k Oracle license and a behemoth Websphere AS for their CRUD applications?) on a daily basis, and even though I still love software development, the situation is starting to touch a nerve. And, mind you, I'm already lucky for getting a job at a place that isn't a plain software sweatshop. Sure, there are better places around here or I could always try my luck abroad, but then I hit the proverbial brick wall: > Sorry, you're too unexperienced as a developer and too under-qualified as a > researcher I've already heard this, and variations of, multiple times. Research position recruiters look for die-hard, publication-ridden, rockstar PhDs, while development position recruiters look for die-hard, experience-ridden, rockstar programmers. To most, my MsC degree seems like a minor bump on my CV (and an outright waste of time for some). Applying for abroad positions is even harder, since the employer would have to deal of the hassle of a VISA process, which I understand that, sometimes, is too much. Now I'm feeling I've reached a dead-end. I'm certain that development (and not research) is my thing, so should I just dismiss my MsC (or play it as a "trump card") and play the "big fish on a small pond" role while I gather some experience and contribute on some open-source projects as a plus? Is there a better way to handle this?


title: How important is understanding the coding behind sorts?

text: First off, if this is in the wrong place I apologise. I wasn't too sure on which of the Stack Exchange sites to ask it. I am studying Software Development at university, on a one year conversion course. My main programming language is Java. We have just finished studying searches and sorts. Focussing on the latter in particular, I had a hard time working through the intricacy of the code. Some, like an insertion sort, were obvious enough. Others, like the merge sort, I found extremely tricky to get my head around. I understand totally _how_ they work, I just wouldn't want to _implement_ my own. I've been told most programmers don't create their own sorts/searches as the built in methods in Java are more reliable and generally faster. However, it's considered good practice to know these sorts. When I look at a sort like the merge sort, or binary sort, I think to myself that I could never have come up with such solutions. They are too intricate and complicated. This brings me to my question. Do most programmers use sorts like people use simple Maths formulae, e.g. the area of a triangle or circle, where you apply it almost mesmerically? As a programmer would you put any real effort into trying to develop new, or more efficient sorts? Or if you knew a sort was needed would you simply know which was better through the bigOh notation and then just copy and paste the same thing in, without ever really thinking about the coding behind it? Note: if this question is not fit for Q&A (I did look at the FAQ and I think it is), please advise me where I could post. Thank you.


title: spotting graph cycles - simple explanation

text: could some please help me understand how to find cycles in graphs in laymans terms? I have read other questions, such as This one and also some of the wikipedia pages, but they seem to descend rather quickly into mathematical jargon. I have a model of the graph in java, modelling nodes, and 'in' and 'out' edges - and the model knows nodes only connected in one direction, this allows me to find the leaf nodes as a starting point, my plan was to walk back up the graph from each of these leaf nodes, for each "walk", keeping a list of all the other nodes I've found on my route. If I see something already in the list at any point, I'll know I've found a cycle in the graph. This however feels a little simplistic. I'm sure this is a solved problem, it would just be nice if it could be explained in simple terms. -ace


title: Does this kind of programming language exist?

text: I'm thinking about creating my own pet programming language, and I have been wondering if similar language already exists. The basic idea is that the language itself would be dynamically typed with strong metaprogramming capabilities (think Ruby). But instead of running it directly, it would be interpreted/expanded into another language, that would be statically typed, with static data structure and minimal dynamic dispatch (think C). This would then be compiled to machine code. The expansion could happen before running the program or during it's deployment, and all necessary libraries would be part of it, instead of each library being expanded separately. Before I start working on it, I would like to know if anything like that already exists. So I can either inspire myself or drop it, because it would be useless work.


title: How specific should be an interface about its implementation details?

text: Perhaps I should have picked a better title, but anyway... Basically what to do with two or more implementations that have the same public interface, but they are meant for slightly different purposes having a slightly different behavior? For example let's say a proxy class that uses the same public interface of the original class but with important changes in its behavior.               interface MyTest     {         getSomething() : MySomething;     }          interface MyTestImmutable (extends MyTest ?)     {         // same interface, but in this case the following method         // is supposed to return a clone of the stored MySomething instance         getSomething() : MySomething;     }      Thanks


title: Astronomy and Cosmology Computing?

text: I'm wondering if there is any course in University or anywhere else or probably company that has a department for Astronomy and Cosmology related computer science (I know NASA will need one). I would like to know how much demand or popularity of this field of programming. Where else will this field being used?


title: How do you avoid being a "blowhard"?

text: When I'm passionate about something (particularly programming) I find it really easy come off like the guy Peter G. was talking about in Dealing with the “programming blowhard”. So what techniques do you use to 1) Identify when you are indeed a blowhard? 2) Communicate something "important" without seeming self important? Specific example help like When giving criticism ask "have you considered what happens when XXX changes" instead of "never take dependencies on implementation details" When giving advice "showing with code is better than talking" or use a reference.