title: Preventing a parser from turning into a (seemingly) god-sized object

text: So I have a program whose purpose is to take text files and parse them into a binary format that an embedded system understands. However, the text format I've inherited that I need to parse is sufficiently complex enough that after refactoring the main `parse` routine I'm left with a class with more than 50 methods that almost all look something like `parseChannel`, `parseWCommand`, `parseVCommand`, `parsePCommand`, `parseLoop`, `parseHex`, `parseInt`, etc. etc. etc. Needless to say, the class, from its declaration, looks huge and daunting. However, the methods to interface with the class are extremely simple, just `parse` (compile the text, figure out its compiled size) and `link` (fix the pointers once the location in memory is known, return the finalized raw binary data). Really, to the user the class has virtually no other reason for existence besides those two functions, but there's so much seemingly useless fluff in the class declaration that it's hard to even see what it's supposed to do. There's a similar situation going on with the rather massive number of data members that, again, are useless to everything but the class's internal methods that need them to talk to each other, though I don't know if that's as much of an issue. I've considered making a separate class solely for parsing that's used within the `parse` method, but it seems strange to me to build an entirely separate class that's only used in a single method in a single class. It seems a bit...superfluous, I guess? And I don't even know if that's attacking the right problem.    I guess in the end, here's what I'm asking:   1. Is this seemingly-huge class actually a problem? I don't think it's strictly a "god object", but it superficially looks like one.   2. If it is a problem, what are the best method(s) to fix it?


title: How do I limit the resources available to a program?

text: I'm delving into multi-threaded programming with Java, but I'm finding it hard to test my program for bugs. My computer simply has too many resources and cores, making it hard to see how my program acts under stress. Is there any way to limit the resources available to my program? It seems ridiculous that my only option right now is to open another application and render HD video in order to starve out the application I'm debugging.


title: What's expected of a web-developer?

text: I've been getting into more web development later and talking to people often I'll get "Can you make me a website [for my book]?" types. "Yes. But.... Well, what do you want from it?" "I want it to look nice and attract people and people will want to buy my book." "..." **What all does making a website for somebody really entail from the designer/developer end?**   * How responsible are we for graphics? Are we expected to make them a nice header with their name/logo and pretty like?    * Color scheme? Overall feel of the site? (I mean, do we decide by ourselves or have some back and forth with the client?)   * Specific wording of content (such as homepage flavor text. Obviously we wouldn't be expected to write the About the Author section.)?   * Additional functionality that we think the user may appreciate?   Ideally you'd talk to the client and figure out what they want, but really--do clients ever _really_ know what they want? **What is expected of the client in order to be able to make a website for them?** **Are web-designer and web-developer essentially interchangeable in casual speak, or...?** * * * I guess this question really stems because I'm learning I don't like doing most of this. I don't program to be a designer. My artistic skills are probably better than the average programmer, but that isn't the point. I would actually prefer it if a client came to me and said "I want it to look like this" and handed me a paper copy, which I could then duplicate. What _does_ interest me is more of the behind the scenes functionality of websites. Is it smooth, functional, does the user have to navigate all over or rely on 'search' to find what he's looking for? Please shed some light on this perceived division of tasks for me.


title: Must strong developers carry the weight of the world on their shoulders?

text: As developers we constantly strive to solve problems of the masses. We also constantly look for new methodologies, languages and possibly organizations to help us further our ability to solve problems. I feel as if I've always been one of the top members on my team. I also feel that I look for ways to improve my work in ways others often do not care to. I'm starting to feel a little burnout from ~6 years of supporting technology. I blame the fact that I do work so hard and hold myself to high expectations. Some of the greatest devs on the planet do not even write code for a living any longer. Often, its burnout. Some have said they grow tired of "the game", but I wonder if the problem is a bit simpler. One of "carrying the weight of the world on our shoulders". If you feel you are a strong developer and also feel that this is not a problem for you, please enlighten me with your approach. How do you stay up to date with tech, help others and solve problems quickly/accurately without getting all wound up?


title: Where is the golden mean between language monoculture and polyculture?

text: My company has been using Java (as a language and a platform) for many years. We have lots of products varying greatly in size, purpose and complexity. Whatever the requirements, the answer is always the same - Java. This stance obviously has advantages and disadvantages. On a plus side, there is no context switching between work assignments on different projects, every developer in the company can be relatively productive on many projects; on a minus side, a small tool might end up being "crushed" by Hibernate. On one hand, packaging, deployment and execution environments could be standardized; on the other hand, we might loose agility of the mind and miss out on optimal solutions by always "thinking in Java". I could go on and on and on. Polyglot programming has become quite common in the recent past, as much as I can observe. Sayings like "right tool for the job" always ring loud in my ears as well. A desire to open up and expose ourselves to more "right tools" is quite strong, but where is a catch? Better yet, where is the golden mean? It's always dangerous to go from one extreme to another. I dread a day of waking up into an incomprehensible mess of a giant pile of Java, Groovy, Python, Ruby, PHP, Scala, etc. with all their corresponding tools, frameworks, servers and philosophies. Do you have a practical experience working in language and platform polyculture for at least two years? What are your main observations? What are you still excited about and what do you dread?


title: Software engineer, already in late thirties, would I have trouble finding a new position?

text: > **Possible Duplicate:**   >  Is ageism in software development based on anything other than bias? I have been a software engineer in the U.S for about 10 years now and I am already in my late thirties. I still have the passion and dedication for this industry and I am still trying to improve myself every day at work. For family reasons, I have to relocate to another state where I need to find a new job. Since I am a pure technical guy I would still like to find a software engineer job. However I am a bit worried about my age since I am already in my late thirties. I am confident about my past experience and my technical strength however the age factor is something beyond my control. My question is: Will I be discriminated because of my age when looking for a software engineer position? If I am really as good as I think, would the employers be interested in hiring me anyways? Any comments/suggestions for improving my chances of being hired are also welcomed! No suggestions like “try to become a manager” please, since I am not interested in any management related jobs. Thank you!


title: When to take that leap and program

text: I've been studying a beginners guide to ASP.NET 4 for the past month and a half, and I'm at the end of the books. The next book will be one up (Professional guide). As yet I've only programmed exercise that are in the books, not my own code. When should I start developing my own code? After reading both books? Also I'm still confused over Object-Oriented and how it works with ASP.NET 4.


title: Is there any practical use for the empty type in Common Lisp?

text: The Common Lisp spec states that `nil` is the name of the _empty type_ , but I've never found any situation in Common Lisp where I felt like the _empty type_ was useful/necessary. Is it there just for completeness sake (and removing it wouldn't cause any harm to anyone)? Or is there really some practical use for the _empty type_ in Common Lisp? If yes, then I would prefer an answer with code example. For example, in Haskell the _empty type_ can be used when binding foreign data structures, to make sure that no one tries to create values of that type without using the data structure's foreign interface (although in this case, the type is not really empty).


title: What are some good ways to get familiar with .Net's IL?

text: I recently accepted a job where I will be working with the IL a lot(on the team of a certain obfuscator that's included with Visual Studio). They know I have little knowlegde of it, so I'll have some time to learn it on the job. But, I want to get a bit of a jump start on it in the interim. For my background, I've never wrote any IL and read very little of it. I do understand what it is though and such. I know x86 assembly and such as well, so I'm not dumb as far as assembly-type code goes. But anyway, what are some good ways of getting familiar with IL and learning the usual opcodes and such and also how it's garbage collection and such magically works at an assembly level?


title: Where do you put scenarios on a scrum board?

text: So traditional scrum board looks something like this               Backlog       |       Story    notStarted   inprogress    Done     story 1               Story1   tasks            Story 2               Story2   tasks     Story ..     Story n     Epic  x     Epic  x+1      However in general a story has many scenarios and when working with BDD you want to write each scenario for a story as Given, when and then. Also the scenarios don't belong in the notstarted column, inprogess or Done as a scenario is not a task. So you realize that a scenario/s should have their own column between "story" and "notstarted", as a scenario can have many task to be considered done. If you are going to build your task from scenarios then why would you need the story on the scrum board in the first place, maybe they should be left in the backlog. Some people put scenarios on the back of each story. This is a on going debate in my team and I wanted to see if anyone has solved this differently. Cheers!


title: Website or any material to practice algorithms that explains the solution

text: I know some projects and web pages for practicing algorithms like TopCoder and Project Euler. However, they just dictate the solution of a particular problem. I wonder if there is a resource, website or any material, that doesn't only give away the code, but also explains the solution thoroughly ?


title: What's the copyright status of boilerplate code?

text: I check Open Source Compliance for commercial code. I have recently found a few examples where the commercial source is matched against quite a few OSS projects. The matches are very similar, but not exact, say about 30 lines of code with about 4 methods, a few variables names differ, some extra lines in the commercial code, ... but substantially the same. I don't think this is auto-generated code, nor copy-pasta, because things like comments will differ. Rather it just looks like boilerplate - the developers say that Grails (and these examples always seem to come up in Grails, but it could be any framework) requires a specific script format for CRUD operations (and these examples are also predominantly CRUD operations). If one adds in a standard source-code style, then it amounts to boilerplate - even if it is original it's going to end up as very similar looking across a number of codebases. Which leaves me with 2 questions:   1. Is this a reasonable defence against accusations of copyright infringement?    2. How would one form a judgement that codeX is such boilerplate, but codeY is not (as a non-expert in the language+framework)?


title: Why do we have postfix increment?

text: _Disclaimer_ : I know perfectly well the semantics of prefix and postfix increment. So please don't explain to me how they work. Reading questions on stack overflow, I cannot help but notice that programmers get confused by the postfix increment operator over and over and over again. From this the following question arises: is there any use case where postfix increment provides a real benefit in terms of code quality? Let me clarify my question with an example. Here is a super-terse implementation of `strcpy`:               while (*dst++ = *src++);      But that's not exactly the most self-documenting code in my book (and it produces two annoying warnings on sane compilers). So what's wrong with the following alternative?               while (*dst = *src)     {         ++src;         ++dst;     }      We can then get rid of the confusing assignment in the condition and get completely warning-free code:               while (*src != '\0')     {         *dst = *src;         ++src;         ++dst;     }     *dst = '\0';      (Yes I know, `src` and `dst` will have different ending values in these alternative solutions, but since `strcpy` immediately returns after the loop, it does not matter in this case.) It seems the purpose of postfix increment is to make code as terse as possible. I simply fail to see how this is something we should strive for. If this was originally about performance, is it still relevant today?


title: automated acceptance testing / BDD & workflow for designing a system

text: Recently, I started reading the book Specification by Example, which relates to automated functional testing and BDD (from what I've understood till now). I've tried using Concordion (.Net), and seems very interesting. I've been having issues with keeping any form of useful documentation for any designed system, and this might help My issue is, how would one suggest that the workflow in designing a complete system is? Some questions that arise are:   * Is it ideal to try to design the entire whole system in the beginning?    * Should you design a very high level overview of the system, and then create specifications one main feature at a time, i.e create detailed specifications -> develop -> test -> move to next main feature?   * Should you create BDD-style specifications for **each and every** method in the system, even trivial ones like some `GetProductByReferenceCode`? The issue is that most of the times when you actually start developing, you start to realise something's that need to be done differently than originally thought, or omissions not noticed during the initial design. I find that sometimes the initial design stage takes a lot of time, only for the actual design of the system to be very different once the product is launched. My current workflow for designing a system is:   1. First start with the user-interface, creating mockups of each and every screen the users will be dealing with. I find this to be the most visual method that the business users can understand.    2. Define logic that is directly related to the user-interface   3. Define any logic that happens _in the background_ , for example notifications, etc.  Does this make sense? Any ways this could be improved?


title: How should I organize programming files into directories?

text: Sometimes, one creates a exploratory prototype and forgets about structure in the directories... What are good tips on dividing the programming files over (several levels of) directories?


title: URI Representing a Single Resource with Two Possible Identifiers

text: I have a resource that can be represented in one of two ways:   1. Big Serial Number, or   2. Small Serial Number Is it closer adherence to REST principles to:   * A: have a query string specify the type (https://acme.org/api/widget/aaa-111-aaa?type=big vs https://acme.org/api/widget/aaa?type=small), or   * B: have query strings specify the type as search parameters (https://acme.org/api/widget?serial=aaa-111-aaa?type=big vs https://acme.org/api/widget?serial=aaa?type=small), or   * C: in the URI (https://acme.org/api/widget/big/aaa-111-aaa vs https://acme.org/api/widget/small/aaa), or   * D: something else (ex: headers)? To me, it seems like having it in the URI (option C) specifies an entirely different resource, and in this case, they should represent the exact same resource. Is option A the best way to represent this?


title: Conditional construct for a kleenean data type

text: I was thinking of an hypothetical programming language with a `kleenean` data type which would implement Kleene's three-valued logic. To sum up, it's an extension of the boolean data type with the three constants `true`, `false` and `unknown` where `unknown` means that the value is either `true` or `false`, but we don't know which. The truth tables for a kleenean type are well-known and the logic is quite easy to understand. However, I was wondering how one would design a conditional construct to take in account this `unknown` value. A basic `if-then-else` conditional construct is almost always as follows:               if (boolean condition) then         condition is true, do something     else         condition is false, do some other thing     end      However, I have troubles seeing what a kleenean `if` construct would look like. How could we interpret the `unknown` constant? Technically speaking, it could satisfy the `true` condition as well as the `false` condition since it is one of these two. However, we can't have it match any of those since it could be the other, it is not really `true` nor `false`. Is there a well-known way to implement such a construct? **EDIT:** To specify a little bit, I would prefere something different than the way `boost::tribool` works, or from a simple `switch` as if was an enum. Answers about quantum superposition and semantics are welcome.


title: When is a script no longer a script?

text: I write many a PowerShell script for the organization I currently work for. Most recently I have been co-writing a tool that, in the end, will have a lot of functionality (beyond a single purpose), will be configurable, and will have both a CLI and GUI, all in PowerShell. So when does a script stop being a script and when can you call it an application or a program. Is this just kind of in the eye of the beholder?


title: How assertive should I be in handling exceptions in objects?

text: I have been writing in C# 4.0 a lot lately and trying to write as lean as possible. As such, I have not been using the classic `try/catch` blocks and `using` statements as often. I understand the general function of .Net's garbage collection and exception handling - _I want to bulletproof my code and be efficient with objects, but I am trying to achieve this with the minimum amount of 'extra code'_ (since 'bloat' pissed people off). And to be clear, I understand `using()` is fundamental for relinquishing resources to handles and other code and its relationship to the `IDisposable` interface. But I am trying to get a better grip about how assertive a programmer should be in exception handling objects. Are there key places in code you'd say `try/catch` blocks and/or `using` statements are inarguably necessary? Within the contexts of garbage collection and exception handling, what common-use objects/scenarios would you recommend explicit attention? Should you simply make a catch block for every possible exception an object might through? How deep should they be nested? Are there steps I can take to proactively collect garbage (for example, to combat the example in comments of waiting for `Dispose()` to be called)?


title: What are good keyboards for programming?

text: Programmers tend to type a lot of code, bashing a lot of shortcuts and a lot of other things. What keyboards are good for programming?


title: How do you respond to "Tell me a little bit about yourself." question in interviews?

text: I've been asked this in a few interviews. And it always catches me off guard.My professional and academic background are already in the resumé, which the interviewer has obviously looked at. What more to tell him/her? Should I start with my hobbies? I like gardening, or looking at NSFW pictures on reddit in my free time? What and how do you answer to this specific question? Do you have a prepared answer for it? Am I wrong if I think this question is a bit silly? **UPDATE** There have been a lot of great answers to this question. I'm in pickle which to choose as the 'correct' answer, because most of them are very insightful. I found a great writing on this subject matter. It's a bit crazy for my taste, but it's interesting: How To Introduce Yourself… I Mean Practically


title: Licensing a JavaScript library

text: I am developing a free, open-source (duh) JavaScript library, and wondering how to license it. I was considering the GNU GPL, but I heard that I must distribute the license with the software, and I'm not sure anymore. I would like the library to be available much like jQuery: In a free, downloadable script, preferably in either original or minified form. Am I mistaken about the GNU GPL license terms? jQuery is dual licensed under GNU GPL or MIT licenses. How does the GPL apply to single script files like that? Can I license my library with nothing more than a few sentences in the script file? Is there another license that better suits my needs? What would be nice is a license that allows you to put the URL in the source, for people to read if they want. I don't know that many do, unless I am mistaken. I am generally looking to release the library as free software like the GPL specifies, **but don't want to have to force licensees to download the full license unless they wish to read it.**


title: Which is more valuable in product development: an action-oriented or visionary bent?

text: As a software development professional in a fairly conservative large-firm, I always had a much more action-oriented bent, as my job was fairly stable and all that mattered was doing as I was told and completing tasks that were germane to the career of a benevolent dictator (i.e., my boss' boss). Now that I'm no longer working for "the Man", I find it just as important to use the left side of my brain and wrap my head around this whole "vision thing". Which do you think is more important for software product development in a small, yet feisty start-up: Knowing the path or walking (or running) it?


title: How to host a site in another site - with little or no coding

text: **SUMMARY:** All of these happens on Site A   * User visits site A   * User enter username and password   * User click on Login Button   * User authenticated on Site B behind the scene   * User is shown a page on Site A that contains his/her profile from Site B as layout/styled from Site B   * User can click links in the Profile page that links to other area in Site B Meaning: Session has to be maintained somehow I have web application where I store users' password and username. If you logon to this site, you can login with the password and username to have access to your profile. There is another option that requires you to login to my site from your site and have your profile displayed within your site. This is because you might already have a site that your clients know you with. This link is close to what I want to do: http://aspmessageboard.com/showthread.php?t=235069 _A user on Site A login to Site B and have the information on site B showing in site A. He should not know whether Site B exists. It should be as if everything is happening in Site A_ This latter part is what I don't know to implement. I have these ideas: Have a **fixed IFrame** within your site to contain my site: but I am concerned about size/layout since different clients have different layout/size for their content section. I am thinking of how to maintain session too **A webservice** : I don't know how feasible this is since the Password and ID are on my server. You may have to send them back and forth. It means client would have to code with my API. _But I am not just returning data, I have to show them a page that contains the profile details_ **OpenID, Single-SignOn** : Just guessing - but the authentication and data resides on my server. there is nothing to access on your side in this case Examples: like login into facebook within my site and still be able to do post updates, receive notifications Facebook implement some of these with IFrame e.g. the Like button *NOTE: * I have tested the IFrame option. It worked but I still have to remove my site specific content like my page Banner, Side Navigation etc. I was able to login normally as if I was actually on the site. This show my GUI but - style sheet was missing - content not styled with CSS - Any relative url won't work. It would look for that resource relative to the current server. Unless I change links to absolute - Clicking on the LogIn button produces this error: _The state information is invalid for this page and might be corrupted._ **UPDATE:** I was reading about REST webservice few days ago and I got this idea: What about the idea of **returning an XML from a webservice [REST or SOAP] and providing an XSLT (that I can provide) to display it**. Thus they won't have to do much coding?


title: Where can I find articles on why interruptions are bad for programmers?

text: I've read/heard that interruptions are bad for programmers. I've also read/heard that getting into 'the zone' is good. I don't doubt these assertions, but I'd like to educate colleagues (managers, mainly) and family members (for when I work from home) about the perils of interruptions and the productivity gains to be had from 'the zone'. So could anyone point me to articles and/or books that make the arguments well? Feel free to make those arguments here in an answer if you like. It would be helpful if there were some in there that were aimed at managers and non-programming colleagues.


title: How do you explain the complexity of bulk emailing to a manager?

text: I think we've all been there, you've been asked to write something to send bulk emails for whatever reason. It's a solved problem, theres a multitude of companies out there to handle this for you, and theres no point in catching up on their many years of single minded focus on making sure your email reaches its destination without being waylaid by spam filters. Now, I could go into a point by point talk about DKIM, SPF, ISP rate limits, content inspection, bounces, getting blacklisted, getting unblacklisted etc, but the eyes will glaze over. How do you convince a non technical manager of the issues around bulk email like this?


title: Who owns modifications to open-source software?

text: Suppose a piece of software is distributed under some permissive license, e.g. BSD. Now, I modify this software and want to distribute my derivative work. My questions:   * Who is the owner of the derivative? Is it the original author, the new author or there is joint ownership?   * Is a copyright notice (say under the original copyright) sufficient to establish the new ownership?


title: Generic name for types and values

text: In computer science, what is the abstract common name of types and values (I mean an abstract "something" that can be a type or a value) ? To be more specific:   If we have `template <typename X>` or `template <int X>` what is the abstract name of `X`?


title: C# Delegates are immutable - but why does that matter?

text: This is a followup question to this other question. **Background** Working from the MSDN Delegates Tutorial (C#), I see the following: > Note that once a delegate is created, the method it is associated with never > changes — delegate objects are immutable. And then, in the code sample, I see this (Spread out a little througout the code):               public delegate void ProcessBookDelegate(Book book);          bookDB.ProcessPaperbackBooks(new ProcessBookDelegate(PrintTitle));     bookDB.ProcessPaperbackBooks(new ProcessBookDelegate(totaller.AddBookToTotal));      **The Question** Now obviously, the way the code is written here a new delegate is created for each process. I am _guessing_ the immutability is relevant if you try to do stuff like               ProcessBookDelegate thisIsATest = new ProcessBookDelegate(PrintTitle);     ProcessBookDelegate thisIsATest = new ProcessBookDelegate(totaller.AddBookToTotal);      which should... still compile when `thisIsATest` is immutable? So what problem has Microsoft solved by making it immutable? What problems would we run into if C# 6 made delegates mutable? **EDIT** I believe the immutability will prevent this:               ProcessBookDelegate thisIsATest = new ProcessBookDelegate(PrintTitle);          thisIsATest.ChangeTheDelegateInABadFashion();          someFunction(thisIsATest); //This function works as normal                                //because the delegate is unchanged                                //due to immutability      but the immutability will NOT prevent this:               ProcessBookDelegate thisIsATest = new ProcessBookDelegate(PrintTitle);          thisIsATest = new ProcessBookDelegate(ChangeTheDelegateInABadFashion());          someFunction(thisIsATest); //This function works weird now because                                //it expected the unchanged delegate      Am I correct in this understanding?


title: How to test a random feature in MS Excel/WORD/PPT

text: Interviewers often ask questions about testing a random feature in Excel, Word, Notepad etc.. I am someone who will be interviewing for a SDET position and has a SDE background not specifically SDET background. I am extremely interested in testing though so applied for a SDET position. So how should one go about testing a random feature in a software, especially word/excel/notepad kind of software? Exploratory testing? What about a feature like File-> open dialog in word/Excel/ How to tackle such interview questions? What is an interviewer specifically looking for in an experienced candidate when he/she asks such questions?


title: Is there a way to help streamline your typical developers discussions?

text: Often, my colleagues and I run into specific problems, for example what's the best way to deploy this, or would this or that technique be a good one to use, or just "hey, have you seen that new thing". However at the moment this communication goes via mail, or skype, or twitter, and a lot of information becomes hard to find very quickly. Is there a service or methodology to keep this kind of information ordered and traceable?


title: Best method in PHP for the Error Handling ? Convert all PHP errors (warnings notices etc) to exceptions?

text: What is the best method in PHP for the Error Handling ? is there a way in PHP to Convert all PHP errors (warnings notices etc) to exceptions ? what the best way/practise to error handling ? again: if we overuse exceptions (i.e. try/catch) in many situations, i think application will be halted unnecessary. for a simple error checking we can use return false; but it may be cluttering the coding with many if else conditions. what do you guys suggest ?


title: How can I view github tasks which are not assigned to a person?

text: On the main Issues page, you can click `Everyone's Issues`, or `Assigned to me`. If you want to view the tasks assigned to a particular person, you can click the `search` icon, and on the left choose the `assigned to anyone` drop-down, then choose from a list of assignees. But how to I list all the items which are not assigned to anyone?


title: Is there a canonical book for CMS design patterns and concepts?

text: I've been trying to understand the fundamentals of content management systems: I've looked into APress's _Pro ASP.NET 4 CMS_ , but it dives into implementation, dedicating a lot of time to technologies and not core principles. Is there a book out there that's the de-facto standard for describing best practices, design methodologies, and other helpful information about content management systems? What about that book makes it special?


title: Appropriate uses of fall-through switch statements

text: When is it appropriate to use a fall-through (classic) switch statement? Is such usage recommended and encouraged or should it be avoided at all costs?


title: Why are pointers not recommended when coding with C++

text: I read from somewhere that when using C++ it is recommended not to use pointers. Why is pointers such a bad idea when you are using C++. For C programmers that are used to using pointers, what is the better alternative and approach in C++?


title: How to learn Java web application development?

text: I’m planning on making a Java web application using Amazon Web Services Elastic Beanstalk. AWS Elastic Beanstalk basically provides PaaS on top of AWS’s cloud computing resources. The problem I’m having is trying to learn how to make a Java web application. I’m familiar with making basic programs with Java (1st year computer science stuff) and have read the Head First java book, however I’m totally clueless when it comes to a large project like this. I’ve tried to find a suitable tutorial in the AWS docs, but as far as I can tell it assumes you know how to make Java applications. I tried the Oracle Java docs, and I’ve been searching the internet for something useful.    The problem is that all the resources I find assume familiarity with what I’m trying to learn. Ideally I would like an article or tutorial that describes the process and how to make a Java web app that assumes only basic knowledge of the Java programming language. So if anyone can offer any advice, or docs that could help me achieve that goal, I would greatly appreciate your help :-)    Thanks in advance, and I apologize if it seems that Googling could answer this question, but I have honestly looked quite hard to find some way of learning this and have come up with nothing. So I’ve come to you guys - the experts ;) - who presumably knew as little as I did at the start.       Basic details of the app:   It will have a web based interface as well as Android and iOS apps to connect to it. It will be of medium complexity and will involve user interaction. For the browser based part it will involve taking payments from users if they wish to buy a premium part of the service.


title: How do you track your progress in a project?

text: Here's the type of situation that I've been struggling with, and I'm certainly not the first:   * Project has a budget based on the estimated time to develop the solution   * Deadline to turn project over to the PM for QA is one some date   * I am working on multiple projects at once, and each has a budgeted number of hours and deadline Tracking my progress against a budget and deadline would be pretty straightforward if I knew exactly how I was going to implement it, and only had one or two projects to focus on at a time. However, I'm building websites with Drupal, and every project includes some functionality that might be available as module - or the available module won't work at all, and it will require significant effort to build that functionality. What strategy have you found most helpful to keep track of where you are in a project so that you can accurately report to the PM how far along you are, and identify early on if the project is in danger of running late or going over budget, especially in cases where the time required for some parts is unknown?


title: Make a monolithic architecture in something modular

text: Currently my architecture is a monolithic block that handles a really specific duty. Now it needs to be generalized. Right now it handles a request and all processes (1 or many) associated to it. There's a class `Request` and a class `Process` and since it serves one specific duty this model was OK. Right now I need to split both classes to achieve modularity. For instance, the `Request` class should be split. So I'll still have a `Request` class, which holds general request information, and many `RequestDetailsForServiceOne`, `RequestDetailsForServiceTwo` and so on, that hold detailed information relatively to a specific type of request. Equally for `Process`. _The question right now is: how to bind together`Request` class with `RequestDetailsForServiceOne` (at run time)?_ I had thought about Dependency Injection, but `RequestDetailsForServiceOne` and `RequestDetailsForServiceTwo` doesn't share any common behaviour, (that classes only store some properties), this way will drive me to code an `IRequestDetailsForService` completely empty. That sounds as a code-smell to me. Would be a better idea in this case use, (inside `Request`/`Process` class) a Dictionary of properties and completely avoid `RequestDetailsForService*` classes? I don't really like the loss of type-checking that this way get me back. What would be an ideal solution?


title: Does WinRt have support for .Net Framework and Wpf?

text: I want to find out if   1. WinRt does or not support .Net Framework?   2. WinRt does or not support WPF? Our company has developed applications using WinForms and they want to have them also running on WinRt. So is it possible to use classes developed under .Net Framework 4.5 in WinRt?


title: What type of projects should each of these projects be given their particular purposes?

text: I'm working in a creation of a new system that should be able to change the presentation layer without trouble, also be able to comport web-services, shop areas, internal control of data, creation of reports, multiple web portals, etc. Following this post about the "benefits of multiple Projects and One Solution" on Stackoverflow also in some self-experience I came with the idea of the following structure.   * TestProject.BLL (Business)   * TestProject.DAL (Persistence (Mappings, Conventions etc))   * TestProject.WEB (Presentation Layer)   * TestProject.BASE (Framework) But, after some search on the web, I found that those project are **not** always the type of " **ASP.NET Web Application** ". * * * My question is, what are the types that I should create each project? Should I build them as " **Windows Forms Application** " or what?


title: Solving which bugs will give greatest cost benefit

text: I wanted to get an idea of categorizing bugs based on how easy is it to solve and how much benefit it will give me. for e.g., if there is a bug which will take say an hour (double file close etc.) to solve vs another which takes a day (segmentation fault). But if solving the first bug is not very important, then I'll probably work on the second one. Are there any research papers which categorize bugs based on cost-benefit or similar metric? [EDIT] Let's say it is possible to categorize bugs based on bug characteristics e.g. security vulnerability, memory error, logic error etc. On the other dimension there could be parameters like difficulty (easy, medium, hard). Are there other dimensions I should be looking for. To simplify things, I can assume two things:   1. Every programmer in the team is equally capable of solving any bug   2. There is no deadline


title: EF vs. NHibernate

text: In the past 2 years since I started writing business applications (before I did either high level front end or very low level systems programming), learned datasets, linq to sql, and now entity framework. The logical thing to look at next seems to be NHibernate. Reasons I eventually ended up at EF are: (1) it has the best designer support and (2) it is the most supported by Microsoft. Reasons (these have elements of assumption) I am interested in NHibernate are: (1) it might not get superceded by a totally different thing as quickly as MS churns data access technologies (2) It seems like its either the front running or second to front running tool for what it does and (3) It appears to be stable and tracable back through time quite a bit. Has anyone published a comparioson of the two? Is one better than the other for certain types of architectures? Or is it just a matter of style and preference?


title: c# Web Content Filter

text: Can anyone point me to any GOOD open source .NET parental web content filters? I would like to gain an understanding of how I can filter/block web traffic based on Url and/or keyword. I've looked on google but can't seem to find any developed c#


title: Should a stack trace be in the error message presented to the user?

text: I've got a bit of an argument at my workplace and I'm trying to figure out who is right, and what is the right thing to do. Context: an intranet web application that our customers use for accounting and other ERP stuff. I'm of the opinion that an error message presented to the user (when things crash) should include as much information as possible, including the stack trace. Of course, it has to start with a nice "An Error has occurred, please submit the below information to the developers" in large, friendly letters. My reasoning is that a screenshot of the crashed application will often be the only easily available source of information. Sure, you can try to get a hold of the client's systems administrator(s), attempt to explain where your log files are, etc, but that will probably be slow and painful (talking to the client representatives mostly is). Also, having an immediate and full information is extremely useful in development, where you don't have to go hunting through the log files to find what you need on every exception. (But that could be solved with a configuration switch.) Unfortunately there has been some kind of "Security audit" (no idea how they did that without the sources... but whatever), and they complained about the full exception messages citing them as a security threat. Naturally, the clients (at least one that I know of) has taken this at face value and now demands that the messages be cleaned. I fail to see how a potential attacker could use a stack trace to figure anything out he couldn't have figured out before. Are there any examples, any documented proof of anyone ever doing that? I think that we should fight this foolish idea, but perhaps I'm the fool here, so... Who's right?


title: Picking a card from a shuffled deck

text: I'm pretty new to Haskell although I did some ML many moons ago. I'm trying to set up a deck of playing cards, shuffle them and then deal them. I have the deck and shuffle sorted (of a fashion) but I'm not sure what I'm doing after that. This is what I have so far:               import System.Random     import Data.Array.IO     import Control.Monad          -- | Randomly shuffle a list     --   /O(N)/     shuffle :: [a] -> IO [a]     shuffle xs = do             ar <- newArray n xs             forM [1..n] $ \i -> do                 j <- randomRIO (i,n)                 vi <- readArray ar i                 vj <- readArray ar j                 writeArray ar j vi                 return vj       where         n = length xs         newArray :: Int -> [a] -> IO (IOArray Int a)         newArray n xs =  newListArray (1,n) xs          ranks=[2..14]          suits=[1,2,3,4]          cards=[(r,s) | r <- ranks, s<- suits]          deck=shuffle cards               myAction :: IO [(Integer, Integer)]     myAction = shuffle cards          main :: IO ()     main = do         xs <- myAction         print xs      There was no particular reason I chose that list shuffler other than the reason I could interrogate (or at least display) the resulting list. I'd like to be able to pull items off the returned **IO [(Integer, Integer)]** but I'm not entirely sure how to proceed. I understand that I can't simply convert it to a vanilla list (this is covered sufficiently elsewhere) so presumably I either need to:   * extend the IO (monad?) somehow   * write a custom list of tuples shuffler   * write my own monad   * use some other method I haven't learnt yet Anecdotally, I believe this can be done "uncleanly" but I don't want to go to programmer hell until I understand how hot the fires are... Any idea how best to proceed?


title: Technologie Roadmap: Portlet JSR286 vs Widget/Gadget

text: IBM got me confused (again). For many years IBM have been pushing for Portlet Containers with the JSR 168 and later the JSR 286 Specification. 2008-2009, IBM the Lotus division introduced the iWidget Specification. Based on my reading, it is a more dynamic and lightweight version of the Portlets, close to Google Gadget. It uses a different paradigm than Porlet while providing the same features. A major differentiator with this kind of client side technologies is that you don’t need a big and costly Portal infrastructure. To not fall in the ‘It depends on needs’ discussions, let consider the following:               * New company, no legacy portlet, no portal in place.      What are your thoughts on this?


title: Learning to Program in Assembly - Useful Resources

text: Following on from a previous thread, it has got me interested in learning a little about Assembly programming. Not so much for wanting to program useful apps in, just to get a feel for low level programming to better understand what is happening. Can anybody recommend any books or online resources for beginners? Thanks.


title: What do you do when you have to work on a project using a language that you hate?

text: I've recently been assigned to work on a project written in PHP. I can't change that, and have no intention of really trying. However, this can't be an uncommon scenario. How do you motivate yourself to work on the project when the code you're looking at and producing constantly makes you want to cry? EDIT: It should be noted that this is pretty much the only on-campus job doing anything software related available at the moment, so "just change jobs" isn't really an option :(


title: How to explain a project for a potential employer

text: I went to an interview last week for a junior programmer and mentioned that I have been working on a project with a buddy of mine. Tomorrow they would like to see this project in order to decide if they should hire me or not. So I was wondering:   * What parts of a project are of interest to someone who has not seen the project before?   * What could I show that would change their perspective of me as a programmer and what I know? The project is in C# and have been a hobby project for 6 months now. Without going into to much details:   * it's a networked program   * it's server / client based where clients end up connecting to each others   * there is synchronization of data between clients   * we are using files to store information about the different clients, which is also being synchronized   * the program in whole is divided into some different projects (some which go into .dll's)   * the project will later handle multiple layers of displaying the data to the user (meaning cmd, a window etc..) I have green lighted this with my buddy as well and it is ok to show. My idea was to show the shell (cmd) that we have which is working and the top layers of the hierarchy, the ones that the shell communicates directly with. These are three classes in particular, one that connects and communicates with the server, one that handles the synchronization and one that handles the objects that are being synchronized. I'll try to go into some details about how we store the objects and how this is communicated to the synchronizer class. Then discuss on a higher level of how we synchronize the data, ending with going into some detail about how this is done.   Basically, **start from an abstract layer and go into detail where the magic happends.** But I wonder how this will be understandable for someone who has never seen our project before. How will this show that I am a better or worse programmer than my next? They are programmers so I guess they will understand the basics and be able to follow the functions and what the code do. But I know that _I_ have trouble with understanding the overall picture of a project, much less in 1-2 hours. Also, I wouldn't know how to decide if it was a good programmer or bad unless I saw some bad code. So my question is:   1. Is the above idea something to work on? (top > bottom)    2. Should I concentrate more on algorithms?   3. Should I try to build a UML diagram or some other visual representation of the project?  Any other ideas?


title: What should I ask interviewer during the interview?

text: I have an SDET interview upcoming in a week. I have been preparing for a long time. It is a good company. I am working as SDET for two years. I wonder what questions I should ask my interviewer regarding testing and other things. I would appreciate your help if you give me some sample questions that I should ask my interviewer during the interview. Some of them I thought are:   1. What type of testing methodologies do you use?    2. Do you have triage meeting everyday?    3. What percentage of code coverage is done by unit tests? I do not find these questions to be more effective. I would appreciate if somebody could help me out in coming out with better questions.


title: What does "Released under MIT and GPL license" mean?

text: There are lots of projects released under more than one license. One example is Mozilla's tri-license, which states that the Software is released under the MPL, but the user can also choose GPL or LGPL instead of MPL (I think this is because the MPL license is incompatible with the GPL license). However, I came across projects released under both the GPL license and the MIT license. What conditions must be met in this case? For the MPL/GPL/LGPL case, things are clear because you can choose MPL or GPL or LGPL. But from GPL & MIT I understand that the conditions from both licenses must be met at the same time in order to use it, and this doesn't make much sense because they have different purposes. In this case, should the MIT license be interpreted as an exception, similar to, for example, the QT's LGPL exception or as an additional set of conditions on top of the GPL license?


title: HTML in docblock comments?

text: In the PEAR standards there is no reference to HTML, if its allowed or not. http://pear.php.net/manual/en/standards.sample.php But I see some people use HTML tags like `<kbd>` and stuff.. So is HTML allowed? Will it break some doc parsers?


title: How to become a Kernel/Systems/Device driver programmer?

text: I currently work in a professional capacity as a software engineer working with the Android OS. We work at integrating our platform as a native daemon among other facets of the project. I primarily work in Java developing the SDK and Android applications, but get to help with the platform in C/C++. Anywho, I have a great interest to work professionally developing low level for linux. I am not unhappy in my current position and will hang around as long as the company lets me (as a matter of fact I quite enjoy working there!), but I would like to work my way that direction. I've been working through Linux Kernel Development (Robert Love) and The Linux Programming Interface (Michael Kerrisk) (In addition to strengthening my C skills at every chance I get) and casually browsing Monster and similar sites. The problem I see is, _there are no entry level positions._ How does one break into this field? Anytime I see "Linux Systems Programmer" or "Linux Device Driver Programmer" they all require _at the minimum_ 5-7 years of relevant experience. They want someone who knows the ropes, not a junior level programmer (I've been working for 7 months now...). So, I'm assuming, that some of you on stackoverflow work in a professional capacity doing just what I would like to do. How did you get there? What platforms did you use to work your way there? Am I going to have a more difficult time because I have my bachelors in CSC as opposed to a computer engineer (where they would experience a bit more embedded, asm, etc)? _EDIT FOR CLARIFICATION!_ I am aware of the opensource nature of the linux kernel/drivers etc. I plan on contributing regardless of where my day job is. I'm more curious of what kinds of entry level positions will allow me to do relevant work and get paid doing it! Thanks for all the replies so far!


title: Time allocated to code reviews

text: If you are doing code reviews   * How much time do you spend on code reviews, compared to implementation?   * How much of the changes undergo code review?   * you think it's to much / should be more? Are there any studies about effectiveness? [edit] thank you all for the answers, it's hard to pick a "winner" for such a question, there is lots of valuable info in the other replies, too.


title: Mathematical Knowledge Required prior to entering Computer Science

text: I am currently a College Student in a Systems Analysis (3 year course). I am about to finish my course and would like to enroll in Computer Science at a University near me. I have a deep interest in learning sorting algorithms, measuring time complexity, cryptography, systems programming and security research. I am bored by the typical, high-level knowledge; java and general algorithm knowledge. I have absolutely no problem learning and utilizing new programming languages, mentalities and syntaxes. My only worry with regards to entering this course is what Mathematical knowledge is required prior to entering. I have done linear algebra but not quadratic equations; I have not done Calculus, nor have I done any Big-O notation. I plan on enrolling in 1 (one) year, so this gives me one year to prepare. I would like to know what I should be studying and reading to prepare. Books, worksheets, videos and any sort of advice or opinion(s) would be greatly appreciated. I have a great passion for efficient computing/programming and solving problems in the most efficient manner. I'm just trying to figure out if I would be in over my head entering Computer Science. Some people have said that I am to old, 22 this year, I would love to hear the opinions and advice of the Stack community. Thanks To All In Advance,


title: What is design pattern/paradigm for ASP.NET web-apps?

text: I don't actually know if my question is correct, but working on a webapp porting from ASP.NET world to Java + Spring platform I came up with this question in mind. Using Spring MVC, the new version of the the application, I'm obviously applying MVC pattern, but which was the ASP.NET design/paradigm. I know that ASP.NET uses event-oriented paradigm, but is this a design pattern? Hope to be clear...


title: And at what point of modification to the original does source code with no license become owned by me?

text: I've recently come across a publicly viewable project on Github that has no license associated with it. In this repo, there is a file with the logic and most of the code needed to work as a piece of a project I am working on. Not verbatim, but about 60% of it I'd like to use with various modifications. Once my code base is a little bit more stable, I plan to release what I've done under the WTFPL License. I've emailed the repo owner, and so far have not gotten a reply. I know I have the rights to fork the repo, but if I release a stripped down and modified version of the other project's file with mine, under the WTFPL, am I infringing on copyrights? Per Github's Terms of Service, by submitted a project on Github and making it viewable to the public, you are allowing other users to see and fork your project. Doesn't say anything about modifying, distributing, or using the fork. And at what point of modification to the original does it become owned by me?


title: Performing a Depth First Search iteratively using async/parallel processing?

text: Here is a method that does a DFS search and returns a list of all items given a top level item id. How could I modify this to take advantage of parallel processing? Currently, the call to get the sub items is made one by one for each item in the stack. It would be nice if I could get the sub items for multiple items in the stack at the same time, and populate my return list faster. How could I do this (either using async/await or TPL, or anything else) in a thread safe manner?               private async Task<IList<Item>> GetItemsAsync(string topItemId)     {         var items = new List<Item>();            var topItem = await GetItemAsync(topItemId);              Stack<Item> stack = new Stack<Item>();                    stack.Push(topItem);         while (stack.Count > 0)         {             var item = stack.Pop();             items.Add(item);                                     var subItems = await GetSubItemsAsync(item.SubId);                  foreach (var subItem in subItems)             {                 stack.Push(subItem);             }         }              return items;        }      I was thinking of something along these lines, but it's not coming together:               var tasks = stack.Select(async item =>     {         items.Add(item);                    var subItems = await GetSubItemsAsync(item.SubId);              foreach (var subItem in subItems)         {             stack.Push(subItem);         }        }).ToList();          if (tasks.Any())         await Task.WhenAll(tasks);      The language I'm using is C#.


title: Displaying and processing objects in a list?

text: I currently have code like this to display some objects that meet some criteria in a grid:               // simplified     void MyDialog::OnTimer()     {         UpdateDisplay();     }          void MyDialog::UpdateDisplay()     {         std::list<MyClass *> objects;         someService_->GetObjectsMeetingCriteria(objects, sortField, sortDirection);              for(std::list<MyClass *>::iterator it = objects.begin();             it != objects.end() ; it ++)         {             AddObjectToGrid(*it);         }          }         This works fine. Now the requirement has come in to process these objects when they meet some criteria. The information on the objects can change quickly so it would be most desirable to check if an object meets criteria and then process it immediately and continue on in this fashion. My question is how to best architect this to handle the display and processing. I could simply add a method to process the object such as:               for(std::list<MyClass *>::iterator it = objects.begin();         it != objects.end() ; it ++)     {         ProcessObject(*it);         AddObjectToGrid(*it);     }      However ideally I'd check if an object meets the criteria immediately before processing it to ensure its acting on the most recent info. In this example, all the objects are checked to see if they match the criteria and then afterwards each one is processed. Also I'm concerned this is coupling the processing code with the display code although I'm not sure how to separate them or if it's even necessary. I could solve that like this:               void MyDialog::OnTimer()     {         ProcessObjects();         UpdateDisplay();     }      But then I'm iterating over the list of objects twice, once to process and once to display. Finally I could do something like:               // simplified     void MyDialog::OnTimer()     {         ProcessAndDisplayObjects();     }          void MyDialog::ProcessAndDisplayObjects()     {         std::list<MyClass *> objects;         someService_->GetAll(objects, sortField, sortDirection);              for(std::list<MyClass *>::iterator it = objects.begin();             it != objects.end() ; it ++)         {             if(someService->MeetsCriteria(*it))             {               ProcessObject(*it);               AddObjectToGrid(*it);             }         }     }         Overall what's holding me up is I'm worried about coupling the display and processing code together and the code running efficiently because timely processing is critical. How can I best structure this code?


title: What to look out for in employment contracts

text: I thought of this today after a co-worker looked through the contract they had signed several years ago and was quite alarmed. What should one look out for before signing a contract, as most employers _will_ get you to sign one. Please post ideas separately so they can be voted individually.


title: Should a website use its own public API?

text: I am starting to write a webservice, and I've built with nodeJS and a RESTfulish approach. From what I gather:   * The advantage is that you don't have to duplicate code.   * The disadvantages are that you:      * will update the public API frequently, but should be solved with versioning     * can't really make service specific caching and optimizations What is considered best practice? Do sites such as Stack Exchange, Github, Twitter, etc use their own APIs for their clients?


title: Design Patterns / Strategies For Custom Fields & Data Types

text: Are there any common strategies or design patterns for designing applications that have either the ability to add custom fields to data objects, or for creating your own custom definition of objects. For example, I am thinking of products such as SalesForce, where you can have your own types of information,frameworks such as Expression Engine and the way it handles channels and channel field groups (Example), or How CMSes Like wordpress have the ability to add fields to custom post types.


title: Understanding bitmap logic

text: I was going though this blog and it says > You can represent a list of distinct integers no larger than N using exactly > N bits: if the integer i appears in your list, you set the i th bit to true. > Bits for which there is no corresponding integers are set to false. For > example, the integers 3, 4, 7 can be represented as 00011001. As another > example, the integers 1, 2, 7 can be represented as 01100001. Can someone please explain me how [3, 4, 7] = 00011001 and [1, 2, 7] = 01100001 and also why 8 bits are taken?


title: Is there a difference between property and attribute?

text: These two words are completely synonymous for me, but I wonder if there's actually a useful semantic difference that I can incorporate into coding/naming conventions/process.


title: Why are we still using the DOM in the browser rather than a desktop paradigm

text: From my understanding, the web interface was developed to use HTML because at the time it wasn't possible to simulate a desktop style application in the browser such as how Silverlight and Flash work, because of bandwidth limitations, and possibly processing power. Why hasn't there in the past, and the present been a larger acceptance and push for technologies like Flash/Silverlight? From my experience they are more pleasing to develop with (of course my opinion), and you don't have to deal with cross browser compliance, and older browsers (for the most part). Handling postbacks, AJAX, etc seems like extra unnecessary effort compared to the development paradigm of desktop applications. Do the DOM and it's complimenting technologies continue to thrive mainly on the fact that Silverlight/Flash requires a plugin install, and some mobile devices don't support the plugin?


title: The practical size limits of an AngularJS based application

text: We have been tasked with replacing a series of 25 year old mainframe applications with web applications. There are 4 applications in the series and we are trying to come up with a stack that will work on all 4. Now these applications are big. Not huge, but big. Based on the work that our sister company did to replace similar pieces of their systems, the small one is expected to come in at about 150k lines of rest service code and about 80k of UI code. For the big one, a million of service code and 200k of UI code isn't out of the question. The small application, so far we have about 150 different views, The big one has about 500 we know about. Now I understand that line numbers are a bad metric to use, but at the moment, its the best i got, so lets just go with that. So in the world I typically work in, this is one medium size application and three large ones. The next issue we have. Across the board, all systems. No user action is to take more than one second. Meaning, if you come into an application, the app has to be loaded and ready to login within one second. If you click on a search button, the response has to be displayed within one second. We have people that use the mainframe systems that process paperwork and in order for them to hit their daily quota, they have to average a start to finish processing time of 15 seconds for each case. The green screens they use right now just barely hit that mark. Dont get me going on eliminating the paper. State and Federal law requires it. So we already know that we have to build the app in such a way that a user can use it without touching the mouse. No way are they going to hit their quotas if they have to be mousing all over the place. Thats not such a big deal, we can define hot keys to do that. But the big issue is the speed. The typical internal framework is JSF. The standard is RichFaces, but many years of horrible performance out of Rich has finally convinced them to move to Prime. We would be about the 2nd or 3rd to use Prime. But since our performance requirements are the highest they have ever encountered, they asked my team to evaluate different frameworks. For internal applications, the current acceptable response time is between 5 and 7 seconds. Pretty typical in an enterprise, usually pretty easy target to hit with JSF. So we spent the past 5 weeks evaluating various options and by leaps and bounds the highest performing framework was GWT. In our benchmarks it blew Vaadin and JSF/Prime completely out of the ball park. Also, aside from JSF, its pretty much the only thing we could find designed to handle applications of this size with surprising ease. (Struts and SpringMVC are strictly forbidden in our enterprise) Then the problems started. Our Enterprise group said no, we can't use it. They acknowledge the fact that there is very little chance of JSF pulling off our performance requirements and the only practical way of hitting our goal is a thick browser front end, but, instead of GWT, they want us to use Angularjs. For the purpose of this post, lets not get into why they said no, lets just stick to the fact the answer was no. So, the past 2 days, I started digging into Angular. So far, I'm not impressed. It looks ok for very small applications (compared to what I normally deal with) but I can't find anything anywhere that shows an experience in trying to build an application of the size that I need to build. The closest I found was a guy talking about his "Enterprise" application he built with Angular that was about 9k lines. He said it was a bitch to pull off, mostly from inexperience, but once he found the tool Lineman, it became tolerable and he was able to pull it off. In the applications I need to build, 9k lines won't cover the logic I need to build into my search UI (so far we have identified about a dozen different ways to search for various data, and counting). To say nothing about actually doing anything with the results. So I called up two of our really, really good developers and asked their opinion. After we got past the initial "Your out of your mind, that's what GWT was built for" phase of the conversation, it was settled that to try to pull off apps of this size as single page javascript apps, like you can in GWT very easily, would be complete suicide. Angular just simply wasn't designed to go that big, it was designed for tiny stuff. Mobile apps, small web apps, etc. Nothing of this scale. The idea is we have to break the app into smaller modules. But, this brings the problem of how to transfer application state from one module to the other. This problem has been tackled at this company before with very poor results. But, they had an idea. Since we can't switch out our Websphere servers for Node.js, Their suggestion was to try a hybrid approach. The idea is to create a JEE6 Conversation bean. Then create a JSF file for each module of the application. That JSF would be linked to the conversation bean. This way, each module can run Angular to handle the MC side and the V side can be basic HTML with Twitter Bootstrap to make it pretty. When the user switches from one module to another, the JS application state is posted to the conversation bean. The conversation bean then redirects you to the new JSF module page, then the JSF can grab the object that represents the current application state from the conversation and pass that to Angular, loads it and they are off to the races. Then of course Angular would talk to the REST services directly. We are using the slow ass JEE stack as little as possible, but still able to sorta easily move app state from one module to another. The stack sounds ok to me. We have the ability to break the app into modules, if the module gets too big, we can break them into sub modules, use the conversation to move the state from module to module, and we can use Angular. My problem with this stack is 2 fold. One, thats a lot of plumbing. Lots of things to go horribly wrong. Two, I can't find anyone that has tried something like this. Questions: What is the practical size limit of an application based on Angular that does not have the benefit of Node.js sitting behind it? I have been told by my UI programmers that when an application gets to the point of about 10k HTML elements within a single page JS module, the performance starts to degrade. When you hit about 25k elements, the performance drops off a cliff, and about 40k elements the app usually doesn't load. Are these numbers consistent with medium to large applications that you have written? For comparison sake, lets say Stack Exchange is a medium sized application, Google Drive is large. Does a design pattern exist for this scenario. Meaning does a pattern exist where you can break a large JS based front end app apart into modules that can be handled easier by the JS frameworks by using JSF or some other system to transfer the application state from one module to another. The failed attempt made in the past was to post the app state object to a web service and that service store it in an application scoped EJB to be retrieved by the next module. That technique failed miserably when the app came under any kind of meaningful load. Are there any other frameworks out there to consider that can give us the performance, scalability, flexibility, and ease of developing large applications like this that doesn't have Google in its name? BTW, I was told about Angular Modules about 15 minutes before I walked out the door today. All I really know about it is its name. If you think it could help me, please let me know. Thanks guys/gals. I'm really stumped here.


title: starting off with non trivial programs -- publish or not?

text: I've just started making some simple but non trivial(i think) programs in Ubuntu -- as of now have made a small xkcd scraper, which i plan to develop into a multi webcomic downloader+viewer At this point, would it be a good idea to start publishing the code on a site like Github or launchpad? (currently I'm not really worried about people copying my code/licensing) Or is it better to publish the code only after the program is completed? Also, can you suggest some such sites where I can post such codes and get suggestions for improvements/discuss the code with others?


title: Lisp: Benefits of lists as code over arrays as code?

text: Question for lisp programmers: Lisp code is lisp data, usually lists. Is there an advantage to code being lists over code being arrays? Would macros be easier to write/faster to run? You can assume that, in such a language (you could call it "arrap"), elements can be deleted from or inserted into arrays and that the arrays would grow and shrink as needed.


title: When initially releasing an app, do you hold some of the features back for future releases?

text: New to the site so sorry if this is the wrong section. I'm starting app development and wondering what is the best practice when initially releasing my app. Do developers tend to keep some of the features for future updates to keep users active, or do they try to release the most complete app possible? Basically, is it advised to release an app as soon as possible, and then periodically update it to the complete app you have in mind, or wait until you have it fully developed and release it with fewer update prospects? EDIT: Thanks for the answers. I am currently just designing the app and writing down all the features I can think of and trying to prioritize which to include to the initial launch. Based on the answers given, I think I will get a MVP (thanks for the term) out as soon as it is ready, and then update with new features as soon as they are built. I am not holding back built features, was just torn between if I should build them all before launch or just the necessary ones, release, and then build the others. As far as I am aware this isn't a clone. It is my first app though and I will be using it as a learning experience


title: Using continuous build results as part of performance review metrics?

text: My boss is planning to use the metrics from our continuous build (builds and runs tests on every commit) as part of our performance reviews (in our 'quality' metric). This seems like a REALLY bad idea to me, but I'd like to know if anyone has studied this or seen this tried before. My thought is that it's going to have our developers not put in as many tests as they otherwise would, for fear that the tests are going to fail. I feel that he's turning a valuable developer tool into a stick to beat the developers with. The obvious counter argument is that it will promote people being more careful before they commit, and therefore leading to higher quality. Am I off base here? Please leave aside the question of whether we should be doing performance reviews at all or not - that's been answered elsewhere.


title: Implicit optimization versus explicit optimization

text: To explain what I mean, let me start with an example. Consider a `deque` that supports `O(logn)` concatenation with another deque and `O(n)` addition of `n` elements at one end. This dequeimplements a general `seq` interface (or type-class, or what have you) that allows iterating over a collection. An explicit optimization approach would be, having a `concat` method (or function) for deque objects and a separate `pushSeq` method for seq objects. Each method would be documented with the appropriate complexity. An implicit optimization approach would be to have a single `concat` method that accepts a seq. An internal dynamic type test checks whether the supplied argument is actually a deque, and if so, calls an implementation method for concating deques. This is documented in the API. Obviously you could have both of these. The point of implicit optimization is that you don't give the user explicit control over optimization. It just "happens", unless the user deliberately looks for it. Right now I'm writing a library and I'm facing a very similar choice. I very much like the idea of a compact interface where things just "work". An implicit approach also gives me a lot more freedom. For example, maybe I can perform ten dynamic type tests to optimize the concat operation for different collections. Having ten different methods wouldn't make sense. What's your take on this? Which approach is better, and why?


title: What are standard directory layouts for storing database scripts in TFS?

text: I recently took over the maintenance of 10-15 SQL Server databases and to my surprise found out that the team does not store the code scripts anywhere. They currently deploy changes to each environment without any paper/code trail. The code for applications that use these databases are all stored in TFS and I need to implement a directory structure for storing the scripts - tables, views, stored procedures - in TFS. On our Oracle side of the house we use a two directory structure:   * ddl   * sql  But I think there could be improvement in storing the scripts on the SQL Server side. I was thinking of using something similar to the way SSMS stores objects:   * tables   * views   * stored procedures/functions Is there a standard structure or best practice that is used to store SQL scripts?


title: Why doesn't C# have local scope in case blocks?

text: I was writing this code:               private static Expression<Func<Binding, bool>> ToExpression(BindingCriterion criterion)     {         switch (criterion.ChangeAction)         {             case BindingType.Inherited:                 var action = (byte)ChangeAction.Inherit;                 return (x => x.Action == action);             case BindingType.ExplicitValue:                 var action = (byte)ChangeAction.SetValue;                 return (x => x.Action == action);             default:                 // TODO: Localize errors                 throw new InvalidOperationException("Invalid criterion.");         }     }      And was surprised to find a compile error: > A local variable named 'action' is already defined in this scope It was a pretty easy issue to resolve; just getting rid of the second `var` did the trick. Evidently variables declared in `case` blocks have the scope of the parent `switch`, but I'm curious as to why this is. Given that C# does not allow execution to fall through other cases (it requires `break`, `return`, `throw`, or `goto case` statements at the end of every `case` block), it seems quite odd that it would allow variable declarations inside one `case` to be used or conflict with variables in any other `case`. In other words variables appear to fall through `case` statements even though execution cannot. C# takes great pains to promote readability by prohibiting some constructs of other languages that are confusing or or easily abused. But this seems like it's just bound to cause confusion. Consider the following scenarios:   1. If were to change it to this:              case BindingType.Inherited:         var action = (byte)ChangeAction.Inherit;         return (x => x.Action == action);     case BindingType.ExplicitValue:         return (x => x.Action == action);      I get " _Use of unassigned local variable 'action'_ ". This is confusing because in every other construct in C# that I can think of `var action = ...` would initialize the variable, but here it simply declares it.   2. If I were to swap the cases like this:              case BindingType.ExplicitValue:         action = (byte)ChangeAction.SetValue;         return (x => x.Action == action);     case BindingType.Inherited:         var action = (byte)ChangeAction.Inherit;         return (x => x.Action == action);      I get " _Cannot use local variable 'action' before it is declared_ ". So the order of the case blocks appears to be important here in a way that's not entirely obvious -- Normally I could write these in any order I wish, but because the `var` must appear in the first block where `action` is used, I have to tweak `case` blocks accordingly.   3. If were to change it to this:              case BindingType.Inherited:         var action = (byte)ChangeAction.Inherit;         return (x => x.Action == action);     case BindingType.ExplicitValue:         action = (byte)ChangeAction.SetValue;         goto case BindingType.Inherited;      Then I get no error, but in a sense, it _looks_ like the variable is being assigned a value before it's declared.   (Although I can't think of any time you'd actually want to do this -- I didn't even know `goto case` existed before today) So my question is, why didn't the designers of C# give `case` blocks their own local scope? Are there any historical or technical reasons for this?


title: Design: multiple algorithms on the same large data sets

text: I have several algorithms that I would like to test against the same data sets to compare their results. I don't know how to design it so there is maximum readability and maximum efficiency. I have considered creating a class for each algorithm, and giving it a copy of the data to work with, but it doesn't seem that that is the right answer:   1. Each data set is fairly large (10,000 float numpy array), so I don't want to copy each one ~30 times.   2. Many of the algorithms have similar pre-processing routines (thus repeating them for each algorithm seems wasteful)   3. Some algorithms have nearly identical code, except a few parameters which are different. At the same time, having one function call per algorithm also seems wrong: as per (2), many will call the same preprocessing functions, and then it becomes very difficult to tell who is calling who. I want to be able to allow the user (which will be me) to easily call a variety of algorithms on the data, while keeping the code as clear as possible. I just keep thinking I need the inverse of a class; where each objects of a class will have the same methods but different data, I need something where each member will have the same data but different methods.


title: Fast cold start text editor

text: Is there text editor with c# syntax highlight which starts VERY FAST? I just want look source code some files in project and i donnt want wait 30 seconds while VS starts.


title: Where is the object browser in VS 2010

text: I am teaching myself C# and Im using a book that references Visual Studio 2008. However, I am using VS 2010. The book wants me to look at the object browser by choosing View, Other Windows, Object Browser from the menu. However, the object browser is not there. I moused over the icons on the menu and nothing stood out. So, where is it? Also, am I going to run into more problems like this? Is it worth getting an updated book?


title: Proper name for a project supports 2 different release

text: Is there a technical name for a software project where the current and prior stable releases are both maintained?


title: How does the Common Language Runtime improve performance?

text: I read on the wikipedia article for Common Language Runtime that one of the benefits that the runtime provides is "Performance improvements". Executing managed code (Or bytecode) must surely always be **slower** due to additional overhead for JIT compilation than executing native code. How then is it possible that the CLR causes "Performance improvements"? **Update:** I have looked at the question and answers to What backs up the claim that C++ can be faster than a JVM or CLR with JIT?, but it has not been helful as that question is actually asking why C++ would be faster rather than slower. What I am interested in is how it is possible, from an architectural point of view, that managed code could lead to performance improvements


I work for an e-commerce site that has lately been shedding its workforce. I was hired ten months ago as a UI Developer. At that time we had three other developers. One was the technical lead who had been with the company for 10 years. The other two were server-side developers who had been there for 10 and 3.5 years respectively. In ten months, the technical lead left for a better position, one developer was laid off, and the other very recently left. So, I am now the only developer on staff. We have one DBA and one network administrator. They are currently looking to hire another developer but are not willing to pay enough to hire a senior person. I consider myself a junior developer with two years of experience. I have argued that we need to hire at least one senior developer and another junior developer if we're going to keep our current site operational (not to mention develop new features)...even if that means laying off staff in other departments. Right now we get 6.5 million pageviews per month, and I feel like 3.2 million pageviews per developer must be incredibly abnormal. My question is then: what is a normal developer to pageview ratio? Are there any industry standards or literature on the subject that I can use to argue for more staff?


title: What is the name to differentiate between parts of an app that have different types of users in each part?

text: On a project I'm working on, I'm trying to find a noun to describe the different parts of the application dependent on user interface. There are three parts: super admin, admin and regular users. Each of these parts consist of modules, interfaces with users, interfaces with the other parts. I've tried "sub-system", "module", "environment", "platform" but none of these really described what each of these parts of the system is. I need a noun that captures everything included within each part e.g. the super admin(?) enables the owner to manually add and edit content. Normally I would just use "module" but there are many modules within each part.


title: Software Engineer with no post-secondary degree?

text: So here's the deal: Right now I am in college and due to a maelstrom of recent events including difficulty in non-cs and -math related courses, I'm really not sure that I want to continue studying at a university next year. While I thoroughly enjoy my computer science and math courses, I find that I just can't keep up with the class. Take my calculus-based physics for example. I'm sure that, given enough time, I could make it through the course and learn everything I need to know; but because I am working and taking 4 other courses, I just don't have that time. I feel that I would benefit a lot more from teaching myself these courses one at a time, i.e. finishing Calculus before I take calculus-based physics. I probably should have registered for the algebra-based course, but it's too late to do that now. What kind of repercussions (career-wise) would there be if I decided to drop out of school and learn on my own? I might consider coming back after a few years of working full-time, but I really don't know. Is it worth paying for school if I don't feel like I'm gaining as much as I can from it?


title: How to create Public API wrapper with different configuration parameters

text: I'm looking to see if there is a design pattern that can solve the following problem. The example is fairly specific but the goal is a public + internal API. I need specific information for my underlying library but I want to present the API generically. If my question is vague or terrible I'll try and spruce it up with your comments. As an example, let's say I am creating a public API and I want it to be agnostic to the implementation. Continuing the example, I am creating a job handler API using the Quartz (can be any library) library in the current implementation. I want people to be able to type:               Job job = jobManager.getJob("my.job.name");     String otherInformation = job.getOtherInformation();     job.setSchedule(new IntervalSchedule(repeatInterval, intervalUnit));     job.setSchedule(new CronSchedule(cronExpression));      The Quartz API has builders for schedules (used in Trigger):               CronScheduleBuilder.cronSchedule(cronExpression);     CalendarIntervalBuilder.calendarIntervalSchedule()                            .withInterval(repeatInterval,                                 DateBuilder.IntervalUnit.DAY);      In my current example I would have a base interface or class Schedule. With this structure how would it be possible to get the specific information I need for the schedule builders without revealing an implementation specific object in my interface while keeping it extensible. My goal is to prevent implementation classes from leaking in to the public API. If in the future Quartz falls out of favor, the public API doesn't need to change and deprecate the Quartz specific classes. What design pattern or code reorganization am I missing?


title: Copyright issues with encryption algorythms

text: I'm developing an application for Android/Java. This application is a kind of password manager, so I'm storing encrypted passwords under the hood of a master password. There are a number of encryption algorythms DES/AES/BlowFish/TwoFish and so on. My intention is to develop application which is free of commercial copyright issues. So the questions are:   1. If I use built-in Java encryption API's (e.g. DES/AES)- does it mean that I will be free from possible commercial interests of DES/AES alike copyright holders?   2. Encryption algorythms sometimes are export limited, keeping in mind that I'm from Moscow/Russia - are there any implications of that fact? Any other thoughts would be helpful.


title: need some concrete examples on user stories, tasks and how they relate to functional and technical specifications

text: Little heads up, I'm the only lonely dev building/planning/mocking my project as I go. I've come up with a preview release that does only the core aspects of the system, **with good business value** , and I've coded most of the UI as dirty throw-able mockups over nicely abstracted and very minimal base code. In the end I know quite well what my clients want on the whole. I can't take agile-ish cowboying anymore because I'm completely dis-organized and have no paper plan and since my clients are happy, things are getting more complex with more features and ideas. So I started using and learning Agile & Scrum Here are my problems: * * *   1. I know what a functional spec is(sample): Do all user stories and/or scenarios become part of the functional spec?   2. I know what user stories and tasks are.   Are these kinda user stories? I don't see any Business Value reason added to them. * * * I made a mind map using freemind, I had problems like this: Actor : Finance Manager >> Can Add a Financial Plan into the system because well _that's the point of it_? What Business Value reason do I add for things like this? > Example : A user needs to be able to add a blog article (in the blogger app) > _because..??_ It's the point of a blogger app, it centers around that > feature? * * * How do I go into the finer details and system definitions:   _Actor:_ Finance Manager >> _Action:_ Adds a finance plan. This _adding_ is a complicated process with lots of steps. What User Story will describe what a _finance plan in the system is_ ??   I can add it into the functional spec under definitions explaining what a _finance plan_ is and how one needs to add it into the system, but how do I get to the **backlog** planning from there? > Example: A Blog Article is mostly a textual document that can be written in > rich text in the system. To add a blog article one must...... But how do you create backlog list/features out of this? Where are the user stories for what a blog article is and how one adds/removes it? * * * Finally, I'm a little confused about the relations between functional specs and user stories. Will my spec **contain** user stories in them with UI mockups? Now will these user stories then branch out tasks which will make up something like a technical specification? Example : _EditorUser_ Can add a blog article.   1. Use XML to store blog article.   2. Add a form to add blog.   3. Add Windows Live Writer Support. That would be agile _tasks_ but would that also be part of/or form the technical specs? Some concrete examples/answers for my questions would be nice!!


title: Method overload in scala

text: I know method overload is not allowed in Scala and I have read some posts regarding the reasons. But still, I see some functions overloaded in Scala library (example: println). I want to know how it is done and if I can use the same mechanism to some of my methods.


title: Testing abstract class' behavior

text: I'm currently refactoring an existing design, which was created without TDD. There is a class hierarchy with one abstract base class and two subclasses. In the original design, these classes were mostly just data holders without much behavior. I have identified some functionality which should be implemented in the base class, and I'd like to write tests for this functionality now. But since the class is abstract, I cannot instantiate it (obviously). **Note:** The functionality I'd like to test doesn't invoke any `pure virtual` methods.               class Base {}; // Is abstract          TEST(BaseTest, doesSomethingAmazing) {         Base aBase; // <-------- Not possible!!!          ASSERT_THAT(aBase.amazeMe(), Eq(AMAZING_RESULT));     }      _Edit:_ To clarify a few things:   * Inheritance does actually make sense in this situation - both subclasses map to specific domain concepts, and polymorphism helps keep the surrounding code clean   * There is behavior which will be used in both subclasses, and which needs data that is common to both classes. So I think it makes sense to put it in a common super class. I can think of several possible solutions, but none of them seems optimal to me:   * Add a subclass to the test code, which implements all `pure virtual` functions. Downside: Hard to name that subclass in a concise way, understanding the tests becomes harder   * Instantiate an object of the subclass instead. Downside: Makes the tests pretty confusing   * Add empty implementations to the base class. Downside: Class is not abstract anymore I tend towards option 3, to make the tests as clear as possible, but I'm not really satisfied with that. Is there a better way I'm not aware of?


title: Python, magic and objects that add attributes to its owner

text: Let me start with a disclaimer: I'm _not_ the best programmer out there. I _do_ however study I.T. and learnt a bit of Java and C. I'm getting stuck into Python and Django + Mongoengine, I'm not going to explain it into detail as it will deviate from the original question. While trying to understand what is happening at this bit of Django code I was **shocked** by some of concepts I seemed to understand. Mostly I was completely confused by how one object could add accessible attributes to a parent object and how Python defines `__set__()` and `__get__()` in such a way as to be so confusing as that. Could someone tell me how _orthodox_ this design style is and whether I find it bizarre because I'm an amateur programmer.


title: copyright notice for client work

text: I'm wondering what's the best way to add copyright/info into source for a client. Normally I do projects for myself and release them as GPL however I'm working with a client and not sure how to give them the source. Would something like this be correct? > /* Package: Project Name   >  File: filename.php   >  Author: My name (emailme@example.net)   >  (c) 2011 Client Name All Rights Reserved > > File Description....   >  */ The client owns the code once they have paid for it but I still think it's a good idea to add a file description and copyright to each file. Maybe this is a conversation to have with each client but does this seem like a fair (and legal) way to do it?


title: Is it still ok to get MCTS in .NET 3.5?

text: As I work for a Microsoft Gold Partner, they are keen for me to become certified. They have left it up to me to decide which certifications I want to go for. I had started training for the .NET 4 MCTSs but I am finding them harder than expected. Part of the problem is that I mostly work with 3.5 as my part of job and only work with 4 at home. Should I just give myself a break and go for the 3.5 exams? Would other employers think it was bad/strange that I'm still sitting 3.5 exams in 2011? I would still like to know all the latest technologies but at the moment I'm just finding that there is too much. By the time I'm ready for .NET 4 they will probably have released 5, and the cycle will continue.


title: Why do bitwise operators have lower priority than comparisons?

text: Could someone explain the rationale, why in a bunch of most popular languages (see note below) comparison operators (==, !=, <, >, <=, >=) have higher priority than bitwise operators (&, |, ^, ~)? I don't think I've ever encountered a use where this precedence would be natural. It's always stuff like:                 if( (x & MASK) == CORRECT ) ...   // Chosen bits are in correct setting, rest unimportant            if( (x ^ x_prev) == SET )      // only, and exactly SET bit changed            if( (x & REQUIRED) < REQUIRED )   // Not all conditions satisfied      The cases where I'd use:                 flags = ( x == 6 | 2 );     // set bit 0 when x is 6, bit 1 always.      are near to nonexistent. What was the motivation of language designers to decide upon such precedence of operators? * * * For example, all but SQL at the top 12 languages are like that on Programming Language Popularity list at langpop.com: C, Java, C++, PHP, JavaScript, Python, C#, Perl, SQL, Ruby, Shell, Visual Basic.


title: SourceTree app, how do I know what is my current branch?

text: I have branched from my `develop` branch `bugfix/issue2` to work on a bugfix. Now that it's done I want to merge this branch `bugfix/issue2` back onto `develop` but it's asking me if I want to merge into my current branch. And I don't know if my current branch is `develop`? See attached screendumps: ![enter image description here](http://i.stack.imgur.com/cLFGl.png) ![enter image description here](http://i.stack.imgur.com/sEM44.png)


title: The physical implementation of quantum annealing algorithm

text: From that question about differences between Quantum annealing and simulated annealing, we found (in comments to answer) that physical implementation of quantum annealing exists (D-Wave quantum computers). Can anyone explain that algorithm in terms of quantum gates and quantum algorithms, or in physical terms (a part of algorithm that depends on quantum hardware)?


title: Is it a good practice to use smaller data types for variables to save memory?

text: When I learned the C++ language for the first time I learned that besides int, float etc, smaller or bigger versions of these data types existed within the language. For example I could call a variable x               int x;     or      short int x;      The main difference being that short int takes 2 bytes of memory while int takes 4 bytes, and short int has a lesser value, but we could also call this to make it even smaller:               int x;     short int x;     unsigned short int x;      which is even more restrictive. My question here is if it's a good practice to use separate data types according to what values your variable take within the program. Is it a good idea to always declare variables according to these data types?