title: How is IntelliJ better than Eclipse?

text: I know there have been questions like What is your favorite editor/IDE?, but none of them have answered this question: Why spend the money on **IntelliJ** when **Eclipse** is free? I'm personally a big IntelliJ fan, but I haven't really tried Eclipse. I've used IntelliJ for projects that were Java, JSP, HTML/CSS, Javascript, PHP, and Actionscript, and the latest version, 9, has been excellent for all of them. Many coworkers in the past have told me that they believe Eclipse to be "pretty much the same" as IntelliJ, but, to counter that point, I've occasionally sat behind a developer using Eclipse who's seemed comparably inefficient (to accomplish roughly the same task), and I haven't experienced this with IntelliJ. They may be on par **feature-by-feature** but features can be ruined by a poor user experience, and I wonder if it's possible that IntelliJ is easier to pick up and discover time-saving features. For users who are already familiar with Eclipse, on top of the real cost of IntelliJ, there is also the cost of time spent learning the new app. Eclipse gets a lot of users who simply don't want to spend $250 on an IDE. If IntelliJ really could help my team be more productive, how could I sell it to them? For those users who've tried both, I'd be very interested in specific pros or cons either way.


title: What happened to Concurrent C?

text: I recently checked out a fantastic book from my college library. It is a bit old at 1989, but the language it describes sounds rather nice. And even while I may not be using it soon, I wanted to research their paradigm some more. So I tried to wiki Concurrent c. nothing. I can't find any references to it on the internet really either. searching for "Concurrent c" mostly points you to that one book. (Stack overflow doesn't have even one reference.) Does anyone know where I might find some history on this programming language or other resources?


title: What is the name of this particular kind of over-engineering?

text: When faced with (even a small) project, I tend to fall into the following bad practice. I think about the structure of the problem. Then I create some base classes, derive from them and then derive from those my actual useful classes. I almost never have a chance to write code inside those base classes, they are just too broad for the concrete problem I am solving. The problem is not limited to inheritance. If I need to do something very simple, I make a class to do it, then a class to hold an instance of the "doer", and then a Manager to ... call methods inside the wrapper of the "doer". IMHO this is different form directly breaking YAGNI as I do not build unnecesery features for the end user. What term best describes this anti-patern? Any tips how to change my design process in order to avoid it?


title: Factory for arrays of objects in python

text: Ok, the title might be a little misleading. I have a `Window` class that draws widgets inside itself in the constructor. The widgets are all of the same type. So I pass a list of dictionaries, which contain the parameters for each widget. This works quite nicely, but I am worried that the interface to callers is obfuscated. That is, in order to use `Window`, one has to study the class, construct a correct list of dictionaries, and then call the constructor with only one parameter - widgets_params. Is this good or bad design? What alternatives does the python syntax provide?


title: Is Clojure development required to be open-source?

text: This question could be generalized to any language where the language development is open-source, potentially, but I'm most curious about Clojure specifically. If Clojure (as a language) is open-source, licensed by the Eclipse Public License, which per this GitHub side-project requires derivative works to disclose source, must any application written _in_ Clojure be distributed with source? Or must only derivative language projects (e.g. Continjuation or something) disclose the source? Or do I have a faulty major premise somewhere in there?


title: What the usual or accepted cost of a support contract for custom software?

text: For custom built web based software, what is the industry standard or generally accepted cost for support and maintenance of the software? Is it usual to be expressed as a % of the original development cost, and if so what is the usual % amount?


title: Where to Start When Making a Web Application on Your Own

text: I've been assigned an in-house web application that is basically an Employee and Project Management System. I'm getting confused as to where I should really start with this assignment (I mean I'm my own development manager and I really don't have experience with making a project alone) and I'm hoping that you guys could share your experiences when you were given an assignment/project to build by yourself. Thanks


title: Wiki-like tool for writing specifications and documentation

text: I am looking for a wiki or wiki-like system for writing and managing specification and documentation for a software project. I know there are lots of wiki-implementations available, but are there some that are especially well-suited for this kind of task? Actually it doesn't have to be a wiki, just a system that makes it easy to write and navigate specs and documentation, and which support change tracing.


title: Choosing the right resources

text: Once I heard that a good book on any programming language cannot be short, so the number of pages is the first criterium when choosing a tutorial. The statement was half a joke, but it has some truth in it. There are tens and hundreds of books available for most popular programming languages, frameworks and technologies, and it is hard to choose one. So that _dummy condition_ is the first one to check. Are there any criteria to help choose the "right" tutorials? What is the first (or probably the second) thing to pay attention on when choosing a technical tutorial?


title: What is the necessity to go for lambda functions and expressions in C++?

text: 1. What is the necessity to use lambda functions and expressions in C++?   2. Can you explain or show through examples how to use lambda functions and expressions?   3. I already gone through the related Wikipedia page, but I got only few ideas regarding this. Are there more resources I can read? May I know which compilers will fully support this lambda feature? Some answers I found are VS10 and GCC5 compilers. Is there any online compilers which are supporting this feature?


title: when to, and benefits, of replacing existing message passing with JMS in project?

text: I have moved to a new project and as the only 'software guy' I'm welcome, and expected, to suggest design improvements to the existing code (code just got out of prototype phase and needs extended to final releasable version; plus adding functionality) The code has multiple stand alone components which are suppose to run in concert, but each one can be rebooted on it's own. They are passing messages between these daemons via a few hand written classes which implement their own server with message queue's. It works well enough, the project made it passed prototype phase and while stability is one of their biggest long term focuses it's not notoriously unstable; just not quite up to par for a final release. Still, ever time I see the code all I can think is "I would have done this using JMS." If I went back in time to their implementation days I would have told them to do this in JMS from the start; and I am very tempted to insist on that now. Only problem is that, even if reinventing the wheel was suboptimal at the time, what they have mostly works now and I would hate to throw out large chunks of code. I have no doubt if we kept their message passing logic I would have to spend some time working on it; I'm not certain it is 100% reliable; there are some minor data-races that they get away with because they system should be able to recover even if it happens, some 'code smells' I want to investigate further etc etc. Still, replacing the whole system with JMS would be a pretty big overhaul. Require writing allot of new code, some debugging to fix issues they already ran into and corrected with their home brewed system, and ultimately add a dependency on JMS when we release this project which may be undesirable. To give a slightly better idea of the system as it is; it's mostly a direct pipeline with two way asynchronous calls. Each separate part of the system (called daemons) at most speak with two other daemon, the one in front of it in the pipeline, and the one behind it. Each daemon will pass requests further 'down' the pipeline to the low level architecture and want some response back (but doesn't block waiting for it), in addition asynchronous messages must be able to propagate back up the system. Multiple people can be making requests at once; but we don't expect an absurdly high number of total messages. Each customer will generate messages in a small burst, but the bursts aren't huge and I don't _think_ this has to scale up to an absurdly high number of customers. Lost of a message would likely result in inconsistent state; lost messages are quasi-detected currently, but nothing really done to 'clean up' when it happens; but the system is basic enough that inconsistent state isn't likely to break things as horrible as some systems could (plus we have our own tiny closed system, probably aren't going to lose messages). The current communication code is generic, any daemon can send any message to any other; and we just trust each daemon only sends messages to the correct daemons and that no daemon sends a message of a type another daemon doesn't know how to happen (all messages are enumerated, but some only are viable when sent to specific daemons) So the question is, can I justify a switch to JMS? I will feel more comfortable with stability if I know were using an enterprise system, and I think it would allow some of my other "crazy, probably never get around to implementing, but would be so cool" ideas a bit easier to implement later. However, we have a small team and can't possible do everything I would love to do anyways. Will JMS provide enough benefit to warrant the cost of rewriting mostly-working code (mostly working because we don't have an obvious "this doesn't work!" example, I know from code review that there are minor issues a few 'smells' that I need to look into further, and basically that it's a decent but no-where close to enterprise level, but the stuff I am certain I have to address wouldn't take as long as writing the JMS logic, much less testing and debugging). How 'bad' is it to create a dependency on an external system like JMS when we currently can run without it? Are there other useful advantages to JMS I'm not seeing (guaranteed message delivery seems a big one to me, but not sure just how much of a benefit that will be yet for this project) Incidentally, one of our eventual "long term, cool to have, were see if we get around to it" goals would be to replace the current use of SQL calls to fetch data by storing everything in memory. If we do store in-memory we will need very reliable message passing to keep state consistent between multiple daemons, and my inclination right now is that something like that should never be tried without the something like JMS. The state wouldn't change very often, but when it does change were have to stay consistent, worry about data race etc. We may not do that at all, would JMS make it substantially easier to keep consistent state and handle data-races, or will I still be doing the same logic in either case? Are there certain things particularly prone to failing with quickly written message passing systems I should be looking for explicitly?


title: What's the right way to work with a graphic designer?

text: Recently, we worked with a graphic designer (arranged by the client) to provide the skin for a Django+Bootstrap application we had built. The designer provided a series of static images of the new layout, along with a document describing some technical attributes (font sizes, colours, a few dimensions etc). It turned out to be incredibly time consuming to implement this. Although the whole site was basically a front page, an index page, and half a dozen detail pages, I spent at least 5 days just implementing the CSS and HTML changes. So I'll go out on a limb and call this _The Wrong Way_. My basic approach was:   1. Compare the static image and current rendering, and notice a difference.   2. Guess what change would be need in the CSS/HTML   3. Make that change   4. Go to step 1. Some of the particular issues were me not understanding that the design included a change from 8 columns to 12, some images provided in the wrong format (.png's can render differently on different browser/platform combinations), hassles trying to undo Bootstrap's styling, the usual CSS wrestling to achieve pixel perfect rendering etc. And occasionally I had to reorganise the HTML templates to get a certain behaviour. What's the right way?


title: How to handle deleting record with associated records?

text: this is not a technical question but rather about the right logic on handling delete with foreign key constraint. First of all, Im very new to programming and a dummy about software engineering. Im still a first year student. In my exercise app, I cascaded the record with OneToMany relationship with other records. In other words when I delete the record, Hibernate will automatically delete the associated records. My problem is, my teacher told me that Cascading is not right. He said that the user must delete first the associated records and he didn't tell me the details and he is kinda angry when he told us. (He is always like that, he wants to intimidate his students. Idk what's his problem but I don't really mind. I just want to learn). Please give me some advice because I cannot make up my mind. So far these are my thoughts: 1) After clicking delete, the system will tell the user that there are associated records and it will be deleted along if he continues. He will be then ask if he will continue. 2) After clicking delete, the system will tell the user that there are associated records and he can be redirected to a page or there is a pop-up that will show all the associated records and he can manually delete. 3) Don't allow the user to delete. Please advice....


title: How do I test my non-Ruby website using Ruby?

text: I would like to build some Ruby tests to test my non-Ruby website. I love the Ruby testing tools (webrat, capybara, etc.) but they seem to be targeted to testing local sites. How can I use these great tools to test external websites? Is there a way to override their settings so that they don't hit `http://localhost` for everything? Or do they work deeper and what I'm asking is impossible? MichaelT, I guess a better way to ask my question is: How do I continuously test a non-Ruby website (say, a .Net one) with Ruby tools? I want to crawl my website every 5 minutes, doing things like logging in, making sure the home page loads, adding things to my shopping cart, and checking out. If any of these steps fails or takes too long then I want the system to notify me in some way so that I can fix it. UPDATE: JustinC has the right idea, apparently this is a duplicate question and I wasn't able to find the correct question to ask. I think either of the solutions in your response will work and I'll play with them both. Thanx! NOTE: I know there are several SaaS providers on the web that do transaction testing but in a quick survey I was unable to find one that A) worked with non-Windows systems, and B) was able to be scripted without some sort of "recording" system (which didn't work on my system).


title: Balance Tree with depth n has how many nodes maximum?

text: I couldn't find the answer anywhere, but let's say we have a B-Tree with min = 1 and max = 2: What is the formula to calculate the maximum number of nodes in this B-Tree if the depth is say 100? This question was given on an in-class test to which most everyone had no idea what the answer was. I was completely stumped and am wondering if anyone knows what it is. Thanks a lot!


title: "flexible" functions in SQL Server 2012?

text: I'm looking for a very exotic thing and have no idea if it exists at all in SQL Server 2012. (Please forgive me - my background is in T-SQL, but not yet the fine details of SQL 'programming'.) So, whether this 'this' is a UDF or SP or something else - I don't know. The challenge is to have something so flexible that it could return a table with one or more records and a list of fields that is determined at runtime. I guess something like a virtual table, but 'lighter' and faster. Is that doable (and how)? As an example, let's say I have two records (IDs being `1` and `2`) and their values for field '`name`' are '`R1`' and '`R2`'. Some other logic makes me want to combine these into a record with ID '`virtual1`' and two fields names , '`F1`' and '`F2`' with value '`R1`' and '`R2`' - very much boiled down, but this what I'd like to achieve....


title: What are the key points of Code Complete?

text: I have heard a lot of people mention Code Complete as a book worthwhile reading. Unfortunately, I am so busy that I don't have time to read it, so can anyone tell me what the key points of the book are?


title: What are the criteria for evaluating an ORM for.NET?

text: I'm looking at evaluating ORMs. I've used SubSonic, Linq-to-SQL and Entity Framework. I've got a team of developers ranging from juniors to seniors. What are the criterias for evaluating an ORM for.NET?


title: Forking SQLite source

text: I am interested in modifying the SQLite source code and making it available as an experimental public fork (GitHub, Google Code, etc.) However, the SQLite source code is currently in the public domain. If I fork, am I allowed to relicense using GNU GPL 3+? I would like my changes to the original source to be licensed under GNU GPL 3+. Using this Q as an example, I plan to commit the last official source to a git repo and make a note in README about the original source code. I assume this will satisfy this clause: `The work must carry prominent notices stating that you modified it, and giving a relevant date.`


title: Why can data sent from the server be in a variety of formats, but sent to the server it can only be a string

text: I recently ran into an error, I guess caused by my lack of understanding of how HTTP works, where I was sending a JSON object to the server to be stored in session data, and then sent back to the client at a later time. When I was sending the data to the server all of my booleans were enclosed in quotes and so when they were later sent back to the client and parsed, all of my false values were evaluated as true - obviously quite a nooby error but it took me ages to debug because I was being stupid and seeing the "false" values in chrome dev tools and thought everything was fine with the response from the server and was looking for the problem elsewhere. So I was wondering, is there a way to set a content-type header when sending data to the server, that would cause data types to be maintained, as you can when sending a response from the server to the client?


title: Building proprietary software over haskell compiler

text: Is it perfectly legal to use GHC as base and build some commercial application over its top ? Are there such examples I can can interact with ?


title: Copyright/General Law for Publishing Online Software

text: I'm planning on releasing a program I made, but I'm not sure exactly how to ensure people don't just steal it. The price point is $1, but I'm not selling it through an "app store" or anything so I have to handle the legal stuff myself as well as building a website. How do I make it illegal (is it by default?) for people to resell copies of it. What about adding Copyrights to the code itself? Often, when I'm buying software, or even when it's free, I have to accept terms and conditions (which I obviously read _sarcasm_ ). Do I need something like that? I don't know if any other information is relevant, but just in case:   * It's written in Java   * There aren't any similar programs (in design) that I know of like it.   * I'm planing on using Paypal for the payment, though I may look into amazon or see the cost of an ssl certificate with my host to see if it makes sense to do it myself.


title: What is a NPR Syntax?

text: what is a NPR syntax, from what i have gathered from internet, i have come to conclusion that NPR is a performance related database. Its based on NPR database Given that what i have gathered is correct, how do i extract data from this Database, what language\Tools should i be using?


title: Advanced Java Articles

text: Recently, I've _really_ been getting into programming. I've always loved it, but now it's all I think about. 24 hours a day, 7 days a week. And now that I'm working a lot and about to graduate and get a full time job, I'm looking to sharpen those skills. Lately, all of my programming has been in Java and Javascript. I've nearly mastered the quirks of Javascript, but I'm still "new" to Java. I've written a lot of code, but I don't know the ins and outs. (For instance, I just discovered the try with resources statement.) TL;DR - I'm looking for some articles to hone my Java skills and really know the ins and outs of the language. Anything from refactoring tips to advanced security guides to performance optimizations. Where can I go to become a better Java programmer. (Besides my IDE. I spend enough time there. :p )


title: Typical instantiation of new object - is there a way to avoid repetitious syntax?

text: When learning C# (and OO concepts more generally at the same time) something I found very distracting is exemplified by the following line:               ExampleClass exampleObject = new ExampleClass();      It's the apparent redundant repetition that bothered me. Some light dawned when I grasped the difference between declaring a variable and assigning it a value or reference (and that these processes can be separate). However, the above usage is extremely common. Obviously, I've learnt to live with it (and am not expecting the C# syntax to change!) but I wondered if there is a better way. Would there be any merit in the following:               exampleObject = new ExampleClass();      Where the variable `exampleObject` is strongly typed as `ExampleClass` when it is not specified? **EDIT**   [after commenters pointed out ambiguity of above between a declaration of a new, and an assignment, of an existing, variable:] An alternative hypothetical shortened syntax, which avoids the declaration/assignment ambiguity, is:               ExampleClass exampleObject = new();      ...where this would create a new instance of `ExampleClass`, the type having been specified in the declaration of its referencing variable, `exampleObject`. .. but I'm sure this opens up other problems I haven't thought of!   **/EDIT** Obviously, if for some reason we wanted `exampleObject`to be of type `Object`, or - a more common requirement - to be of the type of a parent class of `ExampleClass`, we would specify these types in front of the variable name in the standard way, but is there any drawback to my suggested shorthand in this very common scenario?


title: Models, controllers, and code reuse

text: I have a blog where users can post comments. When creating a comment, various things happen:   * creating the comment object, associations, persisting   * sending notification emails to post's author given his preferences   * sending notification to moderators given their preferences   * updating a fulltext database for search   * ... I could put all this in the controller, but what if I want to reuse this code ? e.g. I would like to provide an API for posting comments. I could also put this in the model, but I wonder if I won't lose flexibility by doing so. And would it be acceptable to do all of this from the model layer ? What would you do ?


title: Where to go after Adobe Flex?

text: After this post http://blogs.adobe.com/flex/2011/11/your-questions-about- flex.html and especially this paragraph: > ... Does Adobe recommend we use Flex or HTML5 for our enterprise application > development? > > In the long-term, we believe HTML5 will be the best technology for > enterprise application development. We also know that, currently, Flex has > clear benefits for large-scale client projects typically associated with > desktop application profiles. ... Make no mistake, the days of Flex are over. Thus a lot of people are asking themselves: **Which technology(ies) will solve their and their customers problems in a future without flex?** P.S.: Obviously the correct answer for adobe would have been " ...Since we believe, that HTML5 will be the best technology enterprise application development, we will ensure that it will be targeted by future releases of the Flex framework ..."


title: I want to publish an android app, but I'm afraid of software patents

text: I wrote an application that helps you to save energy. Actually it is very simple. I check the current location of the phone and I make some changes to the configuration like "sound off, dark display, wifi off...", depending on the location of the user. Sony just released a new phone including one of my apps features (actually they have an extra entry in the options menue for this). I have no idea whether there is a patent for this function. Can I even release this app without risking to be sued some day? I'm very confused about the whole "patent" situation.   I'm about 20 years old and I can't even write a simple app, without investing lots of money for a lawyer. Edit: **I don't ask for legal advice**. I wanted to receive an overview about how developers see or handle the whole situation.


title: What are some tips for avoiding 'Death by PowerPoint' during a technical presentation?

text: What are some tips for keeping users interested in a technical presentation?


title: Detail of acceptance criteria in user story

text: I have the following example for a user story with acceptance criteria. I would like to know if I am allowed to describe how the GUI must be changed to support the new feature. How much detail can acceptance criteria have? This is my example: **User Story:** As forum administrator I will connect persons in groups, so that people can get organized. **Acceptance Criteria:**   1. The creation of a person group happens below a person group pool (person group pool is an object also visually available in the current software system)   2. The creation happens with a context menu of the persongroup pool. Below the pool one can create new groups.   3. A person group contains: person group-ID, description, remark May that be relevant an right acceptance criteria? Because I describe how you can create a new group by opening a context menu.


title: How to use Anorm correctly

text: So I'm new in scala-play world. And just got a look at Anorm and it seemed quite cool. But I was wondering what is the proper way to use it? I guess we shouldn't just put pseudo-SQL everywhere in our code.. I took a look at the website and there is a tutorial explaining some stuff, but it is not said how to actually effectively use it. Can anyone please share their 5cents?


title: What is the difference of the add and offer methods of Java's PriorityQueue?

text: In java.util.PriorityQueue we have the methods `add(E e)` and `offer(E e)`. Both methods are documented as: > Inserts the specified element into this priority queue. What are the differences between these two methods?


title: Are physically handicapped programmers at risk of being discriminated?

text: This thought hit me the other day: How would an employer look at a one-handed programmer being interviewed? I wouldn't be surprised if the person behind the desk were thinking: > Hm, he/she only has one hand. One hand is half of two hands, hence he/she > can type half as fast as a two-hander. Programmers type code, thus he/she > will produce half as much code. To wit, a one-hander is half as productive > as a two-handed coder. But good programmers do so much more than write code: they device algorithms and solutions to nitty problems; they do code-reviews and upkeep a high standard; they detect and fix bugs; and so much more. Most importantly, they think! If you want typing power, hire an orangutang! But maybe I'm barking at a non-existant problem. Maybe employers don't think a physical disability affects their programming skills. How would I know - I've never met a physically handicapped programmer, let alone a one-handed one, to confirm it. What's your experience? Have you, for example, witnessed a physically disabled programmer not be hired because it was thought he or she wouldn't be able to do the job because of the handicap?


title: Can PhoneGap and RoboVm work in harmony?

text: The Goal is to make an iOS app using phonegap and java. When writing phonegap plugins that interact with native code (objective-c) would it be possible instead to make it interact with java when using robovm?


title: Listing editors and IDE's in your resume?

text: > **Possible Duplicate:**   >  Hiring developers - listing IDE as a requirement? I've seen this from time to time, that people tend to mention editors in their resume/CV and I've been guilty of doing the same thing(although with IDE's). Is this in any way interesting for the employer, or is it maybe even regarded as something naive and negative? EDIT: I found this question which mentions a few reasons why maybe listing IDE's would be reasonable. Maybe this question should be closed.


title: How seriously should a programmer take a 'star performer' award?

text: I work at a medium sized software corp. in India (abt 6,500 employees). This company has a star performer policy; basically they select a person from each "grade" every quarter and give her the award(some gift vouchers and a trophy). Well, not that I am jealous ... but a colleague just got the award and I sort of feel left out. I cant seem to get over the fact that I didn't get it. Do these awards actually provide any benefit to a Programmers career? Do other programmers think more highly of programmers who have won these awards?


title: Text conversion - Javascript before saving to db, or php when retrieving?

text: Long story short, I have a social networking site I wrote a while back as a "proof of concept" to myself that I had the skills to do it. I decided to revisit it, and "improve" a lot of the bad coding practices I had when I first wrote the thing (3 years ago). # My current situation Users can create posts. When posting, some bbcode-style tags are allowed, as well as lots of smileys and such. Currently, I take the post, and store it in a mySQL database just the way it was written. When retrieving the post, I use php & regex expressions to convert these tags and smileys in to the appropriate html. For example, I might convert `:)` in to `<img src='/images/smiley.gif' />`. It works well... but then I got to thinking (probably a bad idea). # My proposed solution I got to thinking that doing this conversion every single time the post is retrieved from the database is probably not optimal, as there is an amount of server side CPU usage to perform the all the regex substitutions. The approach I think I would like to take is doing the conversion ahead of time, and storing the html version of the post in the database. This way, when I retrieve it the next 100 times or more, I don't need to keep doing the conversion. I plan on storing both the original text (to be used for editing the post) as well as the converted text (for displaying the post). Other than taking up more space in the database (I'm now storing a raw text version as well as an HTML version, is there any downside to the approach I'm thinking of using? Or does this sound like a reasonable optimization of the whole process? # Update So... after reading the comments from you guys, it sounds like there's probably not a lot of reason (okay, no reason) to try and do this client side rather than server side as I'm doing it now. Why did I come up with such a crazy idea in the first place? Well... right now, I store bbcode-ish text in the database, and when creating the page, run a function replacing all that code with html. What I **want** to do is show a preview box, similar to the StackExchange site, so that when the users are entering their posts, they can see what the formatted result would be. I assume that I need to do this via Javascript, so I've basically duplicated the preg_replace I use in php with replace functions in Javascript, so I can show the preview as the user enters their text. Soooo... I'm now duplicating the text replacement code, once in php, once in js. I figured maybe I should find a way to not have to write the code twice... but after some thought, maybe it's a small trade off to handle it this way. I just wanted to share what's rolling around in my head to put my on this path in the first place...


title: How do I find someone to build an app for me?

text: I have an idea that I would like to develop as an app. I have no programming skills though. -Can someone point to some resources on how I can hire a reputable company to do the job for me.   * What are important factors I should consider when choosing?   * Any warning signs or red flags that I should be aware of when choosing?   * Can anyone provide cost estimates? I do not have a large amount of capital to invest. Are there companies that would build and come in for a percentage of the app if they feel it would be successful? Thank you all for your time.


title: Is it easy for a developer to become a system/business analysts?

text: I've been developing for a while now and I'm a little bit bored of the tiny details of software development. I would like to be less technical and more focused on the bigger picture, like take more of a system wide approach from a business perspective. Therefore, I'm thinking I might become a business analysts. But so far, I can't seem to determine what a business analyst does that a developer can't do. I know they're supposed to know more about the business rules and how a user uses the system but as a developer, I feel you have to know that anyway. I mean, I've trained new BAs up when they've first started on how the system is used. I'm also good with people, and can write pretty well. So I'm happy to do that, but surely there's much more to the job right? It's just weird because BAs in my area seem to get paid a lot more than developers - what are the skill sets I'm missing as a developer that I need as a BA?


title: How do you cope with Java coming from javascript?

text: I learned some javascript as my introduction into programming, and now I'm trying to move on to Java and Python and from there to c++, c#, etc. I've been caught up with schoolwork, so I've had very little chance to learn anything yet, but I have been lurking around SO looking for easy Java questions that I might have asked myself and trying to learn from the answers. I saw one that was kind of interesting. It was a homework assignment about finding the most efficient order of jobs to do, assuming each job took two days and had to be in sequential order. I could have easily done this in javascript, but I'm having trouble figuring out how in Java. With javascript I would just return a two dimensional array. Each element being an array containing the profit and the days to work. Ignoring whether or not that's a stupid way to return data in javascript, what is the proper way to return data like this in Java? In other words, the javascript array I would return would look something like: [ ['1-3-5', 50], ['2-5-8', 90], ['2-4-7', 75] ] In Java, I would have to convert the integers to strings to start off, and then find a way to concatenate two two dimensional arrays... Needless to say, this is the wrong way to go about it.


title: Managing Multiple Projects that Share Code + Customization

text: I recently became lead developer of a project at my first non-internship programming position. I've been there for 8 months since I've graduated in December. The project is a web service we offer that is used to track inventory, provide reporting features, and other administration services. The project was originally created for a single client, but has started to become a general project that can be customized for each client. So as each new client signs on, we copy the code from the most recent project and start fresh again customizing the site for the new client. The Customization can be fairly dramatic in some areas of the site, or in some cases very little customization is needed. The problem I see is when we make improvements to the core functionality of the site, that all clients would benefit from, we would have to copy this new feature into every client's site. This seems very cumbersome to me, even with my limited amount of experience and feel there has to be a better way. And to be honest, it usually isn't copied over at all. Same for bug fixes. They'll go client by client, fixing the same bugs as they go in each site. Right now we use Microsoft's Team Foundation Server as our code repository, so a new project for each client is created and added. It may help to mention that it is a smaller company with about 40 employees. Of which 9 are programmer's. I feel like this could be a chance to prove my worth and figure out a better solution. If anyone here has had experience with a similar situation any input would be appreciated. **Update:**   Some questions that have been asked that I have added in here. Q. Describe what the application looks like. Is this a web application? Does the application on it's own look to have three (or more) tiers? Is the code a mess?      A. Yeah this is a web application that has a fairly extensive database, and is FDA regulated. It is used by Pharmaceutical companies to track pharmaceutical drug samples distributed by their representatives. The code isn't horrible, but it can definitely be improved. Which is something I have been trying to do. It was developed with ASP.Net and C#. Q. Tell me about the database. Is there a common database that all instances of the application interact with?      A. No shared database, each client has their own database instance. When a new client signs on we take a copy of the most recent client's database to be used. The database is written in a fairly generic way. Some business logic needs to be tweaked depending on the client, but it usually isn't too extensive and doesn't require modifying table structures or anything like that. And finally, most of the customization that has to be done involves business logic. We don't really change the UI per client or anything like that. Just acquire a copy of the Company's logo and smack it the default spot. Some of the more extensive changes had to do with the companies structure and involved the database/ BL. Most of the time though it is more minor changes.


title: Is it fair to call a database or a document a "Model", as in Model/View/Controller?

text: Part of my job is working on line-of-business applications built around client-side databases, such as Access or FoxPro. Other times these local LOBA's have direct document access, such as an exact one-to-one mapping between a logical object an an XML node or references to bookmarks in Word Documents or ranges Excel spreadsheets. While the code is about as messy as one would expect, it's usually fairly stable and the platforms these applications are built upon all have one thing in common: they translate program data to physical storage directly and transparently, from the programmer's point of view. Would it be fair to refer to the database or document in one of these LOBA's as a "Model", when referring to the Model/View/Controller separation of concerns? Or would it be improper to call separation of UI and business-logic MVC unless we make intermediate objects that in turn map to either the UI or the database?


title: Is over-engineering a warning sign?

text: So we present a straightforward coding exercise to new candidates with some well defined requirements. Occasionally we receive solutions which don't really solve the problem at hand, but are over-engineered to solve a perceived problem - often outside the bounds of the exercise. Now my question is, is this a warning sign? EDIT: Quite a lot of the discussion is based on the test being flawed - which is a fair point. As I described in a comment, the basic premise of the test is to show how you can read the data from the file in a sensible way (and you'd be amazed at the variety of approaches we see), and how to match the items before calculating the latency between the updates. Now for this to work, certain assumptions have to be made about the data, and we look for these assumptions, and we also state explicitly that we want to see the approach you take (including OO approach etc.) All this in a two hour time frame. IMHO, when I was interviewing it was the most complete exercise I came across. The particular scenario which I'm pondering about is where a candidate, rather than reading from the file, accepted "network" input in a multi-threaded application, which clearly is not in scope.


title: How should I architect multi-language support for a group of applications?

text: I have about 8 web applications (all of them ASP.NET based), and I want to implement multiple language support for all of them and have an architecture that I can leverage on new web applications down the road. I would also like to try to centralize the admin piece (where all the text translations and other language specific resources reside), do you know of any tool or architectural pattern that might be useful in this case? The only robust solution I can think of is to have a web application that manages the language support resources and all the other web applications connect to this centralized app/service, but I'm afraid that this solution will have a performance impact on all applications if not implemented the right way. I would greatly appreciate any suggestions.


title: GPL License - Selling and Stealing

text: I understand that when any software under the GPL is given to another the recipient has the same rights over the software that I do. I also understand that this applies to "a work based on the Program". Questions: 1) I noticed several companies sell wordpress plugins and require that you buy a new plugin for each website. Plugins are obviously "a work based on the Program". How do they do this with GPL? (ie I want to do this and not have someone take my plugin, turn around and sell it for themselves. I'm working with Drupal, however, not Wordpress). 2) If I write a module for in-house purposes and an employee takes that module home and puts it online, is that legal? What I mean is that if someone steals my code do they still have the same rights over the code that I do? 3) If I use Drupal modules in a software-as-a-service business and let people use it (ie hosted on my servers), do I still have to give them the source? References: http://www.gnu.org/licenses/quick-guide-gplv3.html


title: Is it better to use assert or IllegalArgumentException for required method parameters?

text: In Java, which is more highly recommended, and why? Both types will throw exceptions, so in that regard handling them is the same. `assert` is slightly shorter, but I'm not sure how much that matters.               public void doStuff(Object obj) {         assert obj != null;         ...     }      vs               public void doStuff(Object obj) {         if (obj == null) {             throw new IllegalArgumentException("object was null");         }         ...     }


title: How to conduct a 3 days training on current techniques like TDD and CI

text: I am tasked to conduct a training for an upcoming team of 20 Java developers for a new project. The project owner wants us to use state of the art development techniques like TDD and CI. The developers are skilled Java developers but have minor to no experience with unit testing, and most likely only superficial experience in refactoring. So the overall project manager scheduled a 3 day training for all developers, and some project managers, to learn the "new" techniques, get everybody in a shared mindset and get started. So I have 3 days (aka 20 hours) to teach them   * ~~Software Craftsmanship~~ deleted due to answer   * Unit Testing   * TDD/BDD   * Refactoring   * Static Code Analysis   * CI Obviously I can't teach them everything. So my questions is   * **how to distribute the available time on these (and other) topics** ,    * what to focus on and what do omit,    * and how to best **conduct a training session based on these topics**?


title: How to make big chunk of hardcoded menuitems in a programmable way

text: So in the javascript app, we have a lot of repeated chunk of `menu items` with the specific `settings`: URL, Name, Title, etc etc (these settings sometimes can be optional). Here is the gist of the menuItem and we have tons of them. The client pushes new changes every month or twice per month on these items, either the menu item should be named differently or the url is outdated or whatever. Instead of going and changing each URL everytime, I thought about:   * Creating a web-service, with a complete CRUD on menuitems, whatever comes in there, goes dirrectly via JSON, to the app Well, I would like to hear if you have some thoughts on this idea of `configuring` the application rather than hardcoding the app each time when the CR comes. Here is the gist of the menuItem and we have tons of them. All help will be appreciated


title: Good public API for use in demos and documentation?

text: I have created a utility library and open sourced it on Github, and I'd like to document the HTTP utilities. I created this around some apps I've developed, but none of the APIs I use are for public consumption. I want to use a well known public API in my documentation so that code samples will work and be really easy to understand for the user, but I don't work with any such API so I'm not familiar with any...looking for suggestions.


title: How to stop gold-plating and just be content to release working developments

text: The development team that I'm a member of has recently adapted to work according to Agile practices. This has personally highlighted the fact that I can't stop myself gold-plating code (and documentation) and I consequently exceed original estimates, when I could've delivered solutions that meet the requirements much earlier. I think my ethic is bordering on the obsessive in that I become too attached to my code and am rarely content to release before I've refactored and perfected it to the nth degree. I am happy that I have realised this but how can I change my attitude/mentality to be content with my progress and release on-time instead?


title: Which of these OOP examples demonstrate proper OOP concepts?

text: I'm still trying to wrap my head around OOP. All of the following examples work, of course, but is there one (or possibly another) that best exemplifies OOP concepts?               /**      * For the following examples the Image class queries an image      * and associated info from a database, which is passed on      * instantiation via dependency injection.      */          $image = new Image(new Db());      **Example 1:**               if ($image->setImageId($id, $size)) {         header('content-type: ' . $image->content_type);         header('content-length: ' . $image->length);         echo $image->getBytes();     }      **Example 2:**               if ($image_info = $image->getImageInfoByIdAndSize($id, $size)) {         header('content-type: ' . $image_info->content_type);         header('content-length: ' . $image_info->length);         echo $image->getImageBytesByIdAndSize($id, $size);     }      **Example 3:**               $image->setImageIdAndSize($id, $size);          if ($image_info = $image->getImageInfo()) {         header('content-type: ' . $image_info->content_type);         header('content-length: ' . $image_info->length);         echo $image->getImageBytes();     }


title: I'm going to quit my job because of our platform: how can I leave a productive explanation of this?

text: I'm planning on leaving my current job because we're locked into using Blub, with an enterprise Blub framework and a Blub-level web server, on mediocre shared hosting. My coworkers are friendly and my boss is an average small business owner - I want to leave entirely because of the technical reasons. I feel like being soaked in Blub is bad for my brain and making me a worse programmer. When I leave, how can I explain this to my boss and coworkers? How can I phrase my complaints about Blub productively? What kind of warning can I and should I leave for my successor in documentation? _(trying to make sure I meet thestandards)_


title: Interested in a million things, have a million goals: how to choose what to focus on

text: I am currently working as a Web Application developer using .NET Technologies. I am interested in learning more about the technologies that I work with, but I am ALSO interested in a million other things... (including Systems programming, Networking, Game Development, Mobile Development, Computer Science topics, Math, participating in an Open Source project, starting my own business, etc). I can't seem to focus on one thing to become an 'expert' in when there are so many **other** things to 'master' that are pulling at my attention, and there are only so many hours in the day... My question is, what are some good strategies to stop procrastinating and manage time effectively, so that you can get the most out of your free time and learn what you are interested in, while not losing sight of other priorities and letting other interests fall through the cracks? Or do I have to sacrifice, and if so, how do I prioritize what to sacrifice? I'd love to hear what you guys have to say... Thanks


title: How to model/structure data that contains parent/child relationships for the same entity?

text: I think it is just my thinking that is off here. Suppose I have two entities: question and choice. A question can be a parent or child, or both (in relation to other questions). It seems that this model is too simple and is an unresolved many-to-many, but I think my thinking is the problem here so this is more of a conceptual question. What is the best way to design/model this? Please explain why it is or isn't a many-to-many relationship, and whether or not it needs to be resolved and why. See below: ![idea](http://i.stack.imgur.com/7kUG9.png) A question can be a parent or a child, or both (potentially multiple times). Programming logic would prevent the child from being its own parent and vice versa. It seems I'm missing a linking solution of some sort here, or I'm just not wrapping my brain around this.


title: How to know if an Open Source project is mature enough to use in a product?

text: There are some open source projects that I'd like to incorporate into a product at work. We don't have the bandwidth nor the subject matter expertise to do it ourselves. I found these by searching in Google. I'm unaware of any "major players" that utilize the projects, but I'm pretty encouraged by what I see. Now, I'm a bit concerned about the amount of risk I'm exposed to by using joe- blow's open source project. If it takes me 95% of the way there, perhaps the remaining 5% is easy to add or fix. Perhaps it's non-trivial. **How do people go about determining whether an open source project is mature enough to use in a product?** This is not a hobby project, so stability, maintainability, etc. are paramount.


title: Should we enforce code style in our large codebase?

text: By "code style" I mean 2 things:   1. Style, eg.              // bad     if(foo){ ... }          // good     if (foo) { ... }        2. Conventions and idiomaticity, where two ways of writing the same thing are functionally equivalent, but one is more idiomatic. eg.              // bad     if (fooLib.equals(a, b)) { ... }          // good     if (a == b) { ... }      I think it makes sense to use an auto-formatter to enforce #1 automatically. So my question is specifically about #2. I like to break things down into pros and cons, here's what I've come up with so far: **Pros:**   * Used by many large codebases (eg. Google, jQuery)   * Helps make it a bit easier to work on new areas of the codebase   * Helps make code more portable (this is not necessarily true)   * Code style is automatic once you get used to it   * Makes it easier to fast-decline pull requests **Cons:**   * Takes engineers’ and code reviewers’ time away from more important things (like developing features)   * Code should ideally be rewritten every 2-3 years anyway, so it’s more important to focus on getting the architecture right, and achieving high test coverage   * Adds strain to code reviews (eg. “don’t do it this way, I like this other way better”)   * Even if I’ve been using a code style for a while, I still sometime have to pause and think about how to write a line better   * Having an enforced, uniform code style makes it hard to experiment with potentially better styles   * Maintaining a style guide takes a lot of incremental effort   * Engineers rarely read through the style guide. More often, it's cited in code reviews And as a secondary question: we also have many smaller repositories - should the same code style be enforced there?


title: Languages implemented in Python?

text: AFAIK, Scala and Clojure are implemented in Java and Java is implemented in C. I suppose that many or most languages are implemented in C, for instance Perl, Python and SQL. I don't know much about language implementation but maybe you can tell me the rationale to favor one implementation language Java over another C? Are there any theories about one language implementing another, or are we resorted to Turing machine theory where a language is regarded are a Turing machine?


title: Utility Classes in MVC - ASP.NET

text: So I was wondering today, where would you put utility classes in an ASP.NET MVC app? By utility classes I mean classes that can be static and are just used to perform a function. Like a class to send an email that takes email address , subject, and body as arguments.   I would assume maybe creating a separate folder and namespace would be good enough, but wanted to get everyone opinions


title: What is the pattern called when getters take responsibility for the setting?

text: I've been heavily using a pattern for years now, but I don't know what it's called. It looks like this....               class xzy     {            public function getFoo()       {         if ( undefined(this.foo) )         {            this.foo = new Foo;         }         return this.foo       }            public function setFoo(foo)       {         this.foo = foo;         return this;       }            public function getResult()       {         if ( undefined(this.result) )         {            this.result = this.getFoo().action();         }         return this.result;       }          }      It find it great for testing yet still allows for a high level of encapsulation. It's also great for drying up code. I also very rarely use a constructor. I'm now in a position where I could really do with specifying the pattern in some documentation but I don't know what it's called and it's a hard thing to try and Google.


title: Who does the UX on a scrum project?

text: OK. Let's say you're working on a textbook scrum project. You've got a scrum master collaborating with a product owner. The next sprint is UI-heavy - by the time your coders start building screens, you really want to have _some_ idea what they're going to look like. Who does the wireframing, and when? The product owner? Somebody supporting the product owner? The scrum master? If you have a UX expert, do they work alongside the coders _after_ the sprint has started, or do they supply wireframes & mock-ups up-front that sit alongside your story cards and constraints to guide and inform the work the developers are doing? I'm pretty sure we need some UX help, you see, but I'm really not sure where to apply it... EDIT: Let me rephrase the question. How do you deliver consistent, high-quality user experience on an agile project?


title: Keep my classes and methods as small as possible?

text: A few days ago, I was talking to a Software Engineering PhD candidate and at some point she said to me: > Keep your classes and methods as small as possible And I wonder if this is always a good practice. I mean for example, is it worthy to have a class with only 2 attibutes in it? For instance, In some methods I need pairs of integers to work with. Should i write a "PairOfIntgers" class? Could this way of thinking "break" the code in too many pieces?


title: Best practices for web application Authentication/Security (Any Platform)

text: I got a question today from my manager asking me my thoughts on what is considered an acceptable design for authentication of a web form application, especially in regards to the nature of many popular browsers to "Remember Password" for your typical user name password login fields. I am having trouble coming up with an answer that I feel is acceptable. In light of Sony's embarassing security flaws, I really want to be careful, even though the data being stored on people is of a lower sensitivity. We are not storing social security numbers or even addresses however we are storing phone numbers, email addresses and a photo of a visitor. He is concerned that a user can simply Remember Password on a public terminal, then someone can simply jump on this terminal and begin viewing or modifiy data in an unauthorized way. I am fairly certain however that at least on Windows workstations that the browser will not "Remember Password" across Windows user accounts. Beyond this I am implementing a one way password encryption at the server side (store encryped password in the database, encrypt user supplied password on the server, compare to encrypted string from database). There are no immediate plans to incorporate SSL encryption however this is still an option. Are there are any major security flaws with this approach? Do you have any better suggestions?


title: Understanding unit testing concept

text: I've just started writing unit tests and I'm not sure am I doing it the "right way." Should I test every class "by removing dependencies"? In other words, does unit testing mean: "test part of a code with assumption that provided dependencies to other modules are correct and test these dependencies as single modules later in other unit test classes"? For example, I write WinRT application in Model-View-ViewModel manner and I have MainViewModel class. This class has dependency to `IDataRepository` which is injected in constructor. `MainViewModel` is responsible for handling commands and connecting model with view. `MainViewModel` has commands like `CopyItems`, `LoadData` etc which are relying on `IDataRepository` implementation. Should I pass fake (mock/fake it??) `IDataRepository` in `MainViewModel_Tests` and test just is data loaded, copied etc. on command execution? Should one test check just things what class really do - not what dependencies do?


title: Is it ok if I don't know C but I am good with C++?

text: I have a question which I think can be best answered here. I am pretty good with `C++`, good as in I am comfortable with the language, I have read `Accelerated C++` and done almost all the exercises. However, I have a big problem. Do I need to learn `C`? I have never done `C` ever in my life. I just started with `C++` when I started with programming. Probably cause I was always interested in knowing why everyone calls the language so complex. Now though I know the answer to that question ;) I am particularly interested in knowing whether I can survive without knowing `C` in today's world. Like if I give an interview in a company, if I tell them that I don't know `C` \- will they take it as OK? The two languages I am good with is Python and C++. I am asking this cause I have heard that companies ask data structures in interviews. So if they ask me to implement it, and if I do it in C++, is it acceptable? And people who say 'how can you not know C when you C++', please don't reply :) No offense, but I fail to understand why learning C is prerequisite.


title: Can I release complementary Windows 8 and WP8 apps on their respective stores?

text: I am creating a pair of apps, one to run preferably on tablets, but also laptops and PCs, and the other for WP8. These apps are complementary - having one is of no use without the other. I know there is a Windows Store, and a Windows Phone store, so one would be released on one, and one on the other. My question is: as these apps are useless by themselves (although in most cases it won't be the same people running both apps), will there be a problem with offering these useless-when-used-alone apps? IOW: Person A will use the Windows 8 app to interact with some people that have the WP8 app installed; those with the WP8 app will interact with a person or people who have the Windows 8 app installed. What I'm worried about is if these apps go through a certification process where they must be useful "standalone" - is that the case?


title: Script files as resource or solution project?

text: I've written a program for another group within my company that uses scripts. These scripts are user selected by the use of two drop down lists: category and name. Currently the application uses an XML file that is on a network share to populate the drop down lists with the scripts and their associated categories and titles. The XML file also contains the network path location where the scripts are housed as well as title, description and usage details. I am trying to decide on the better way to manage access to the scripts without allowing the end users to be able to edit them with a text editor. I've been going between adding them as a project within the solution or adding them as references. Does anyone have any thought on either of those options or possibly a better solution? EDIT: I think I may have figured out a solution for what I'm looking to do. http://support.microsoft.com/kb/319292. I'll load the macros as well as the XML file and that should allow me to accomplish what I'm trying to do.


title: What exactly is my program "linking" with overall?

text: I have heard that my C++ programs "need to link with the C++ library/runtime". However, the C++ runtime is just the compiler inserting stack operation code in to the image, or "boilerplate" code if you will. The C++ runtime is basically intrinsic to the program itself, so "linking the runtime" is a bit illogical. Linking a library makes more sense, especially since the C++ libraries are independent objects which would otherwise need resolvement with the source program itself, and relocation. So I wondered, besides the C++ library, what else, or how do you know what you are linking with exactly? For example, if I'm supposedly linking with the C++ library, I also need to link with the OS-specific library and API as well, or at least a wrapper of some sort that will deal directly with it. So the linker will, in effect, link the main program file with the C++ library with the OS-API/library? That doesn't sound particularly right. Basically, the linker will link multiple libraries together(statically, in this example, at compile/link-time)?


title: Utilising Promises, Closures and Recursion in Node.js

text: I have employed a recursive call to a closure in order to mitigate against some race conditions I am getting (That's what I think it is). I'd like to know if (and why) this is a good solution or a bad solution.               function getResources(activity, resource) {         var q = when.defer(),         resourceQuery = constructSelectionQuery(resource),         timeoutCounter = 0,         timeoutLimit = 100;         function queryDatabase() {             query.getResult({                 query: resourceQuery             }, function(err, result) {                 if (result.length === 0) {                     if (timeoutCounter > timeoutLimit) {                         q.reject();                     }                     timeoutCounter++;                          //subsequent call(s)                     queryDatabase();                 } else {                     q.resolve(result);                 }             });         }              //initial call         queryDatabase();              return q.promise;              }      * * * What I am trying to ascertain is the validity of using recursion and closure in this combination - is this an acceptable way of approaching the problem of repeating the call to the database? Without the repeating of the call the result is sometimes empty. This is curious as this function is only called after the record has been saved. However this is in another system so I am assuming the speed of indexing is at fault in MySQL - I don't want to go into that aspect of the system as I'm happy with what I've got - My question is isolated to using this pattern - a recursive call to the closure as a way to repeat the call.


title: measuring database load

text: I was reading about memcache and one of the questions that I have for this moment is about 'measuring database load'. In this tutorial they are talking about a 'database load of 20'. How can I measure the database load of a web application?


title: Patterns for Handling Changing Property Sets in C++

text: I have a bunch "Property Sets" (which are simple `structs` containing POD members). I'd like to modify these property sets (eg: add a new member) at run time so that the definition of the property sets can be externalized and the code itself can be re-used with multiple versions/types of property sets with minimal/no changes. For example, a property set could look like this:               struct PropSetA     {         bool activeFlag;         int processingCount;         /* snip few other such fields*/     };      But instead of setting its definition in stone at compile time, I'd like to create it _dynamically_ at run time. Something like:               class PropSet propSetA;     propSetA("activeFlag",true);  //overloading the function call operator     propSetA("processingCount",0);       And the code dependent on the property sets (possibly in some other library) will use the data like so:                bool actvFlag = propSet["activeFlag"];      if(actvFlag  == true)      {        //Do Stuff      }      The current implementation behind all of this is as follows:               class PropValue     {      public:         // Variant like class for holding multiple data-types         // overloaded Conversion operator. Eg:         operator bool()         {           return (baseType == BOOLEAN) ? this->ToBoolean() : false;         }         // And a method to create PropValues various base datatypes         static FromBool(bool baseValue);     };          class PropSet     {           public:       // overloaded[] operator for adding properties       void operator()(std::string propName, bool propVal)       {         propMap.insert(std::make_pair(propName, PropVal::FromBool(propVal)));       }           protected:        // the property map        std::map<std::string, PropValue> propMap;     };      This problem at hand is similar to this question on SO and the current approach (described above) is based on this answer. But as noted over at SO this is more of a hack than a proper solution. The fundamental issues that I have with this approach are as follows:   * Extending this for supporting new types will require significant code change. At the bare minimum overloaded operators need to be extended to support the new type.   * Supporting complex properties (eg: `struct` containing `struct`) is tricky.   * Supporting a reference mechanism (needed for an optimization of not duplicating identical property sets) is tricky. This also applies to supporting pointers and multi-dimensional arrays in general. Are there any known patterns for dealing with this scenario? Essentially, I'm looking for the equivalent of the visitor pattern, but for extending `class` properties rather than methods. **Edit:** Modified problem statement for clarity and added some more code from current implementation.


title: Should I use the new method/action to retrieve records? (Rails)

text: I have an admin controller that is just used for its index action which renders a view with the most recent updates to certain resources:               class AdminController < ApplicationController              before_action :authenticate_user!         layout "admin"              def index             @events = Event.last(3)             @foos   = Foo.last(3)             @bars   = Bar.last(3)         end          end      Now, I want to create a new event. So I have an Events controller:               class EventsController < ApplicationController            before_action :authenticate_user!, only: [:new,:create]       layout "admin", only: [:new]                 def index         @events = Event.all       end            def show       end            def new       end            def create       end                    end      But I want to display a list of events that have previously been added in the same view as the form for creating a new event. Should I retrieve all the events in the new action? i.e.               def new       @events = Event.all     end      Or is there a better approach(perhaps more restful)?


title: RFC: Extending the MVC Design Pattern

text: I've been using the MVC pattern in my applications for years (with full separation of the controller from its views). Having to implement several hundred views to represent a little over 100 model's for a potential contract, this time around I'd like to reduce the development time of my UI tasks and also add a few additional features (view decoration, etc). I'm curious to find out if anyone has used or even implemented a design such as the one I'll explain bellow and if so, what were your pros and cons were. Without getting into too much detail, I'm going to simply elaborate on an example of an API I have been juggling with in my head for a few days along with some explanations a bit later on, so here goes:               Model m = dao.getInstance(ID);  // ie: possibly fetch it from a database          VTextField text = new VTextField();  // simply 'extends' the Swing components          text.setModel(m);          Decorator deco = DecoratorFactory.getInstance();  // specific to a customer          text.setDecorator(deco);          Controller c = ControllerFactory.getInstance(m);          text.setController(c);          Validator v = ValidatorFactory.getInstance(m);  // get the current validator          c.setValidator(v, "validateText");      So in the example above, the idea is that I will have the same application for several clients. Although each have accepted the general usability, each want their branded L&F to it, some based on business rules (ie: a text field has errors, the background of text-field should be in yellow with red fonts... an other want the text in black and the background yellow with a red border). What I was thinking was that on any event (on focus, loss focus, key typed, etc), the component would basically invoke the controller. In turn, the controller (through reflection) would invoke the validator. If validation passes, the controller simply updates the model. If validation fails, the controller does not update the model. The controller would keep a state of all of this (viewing, editing, editing with error, etc) and would delegate to the decorator which would adjust the L&F of each component based on client demands. This would avoid a ton of 'if/else' blocks directly in a single controller. The controller, validator and decorator knows which concrete instance to load based on which client is running the application. This way, I can separate the logic for each client and reuse when it is shared behavior. The decorator doesn't overide the paintXXX() methods, but simply calls the 'setBackground(c)', 'setBorder(b)' and all of these setter methods already available in the Swing components. The reason I extend each component is simply to add the 'setModel(m)' and 'setController(c)' methods along with any framework logic I'll need. When the component is in 'view' mode, it usually doesn't paint the border and background and all that stuff (looks more like a traditional web page). When it is in 'edit' mode then it looks more like a Swing component. When I design application UI's I usually stick to only a few major components (JTextField, JTextArea, JPanel, etc). So it wouldn't be too much work on that side. I have not started to implement any of this stuff just yet, so if you know of existing libraries which does something similar, please point them out. My only real issues I have at this time is how to handle cases where component depend on each other. For example, two text fields having an int value. If one field is odd then the other must also be odd and if one is even, then the other must be even. When the validation occurs, the validator would need the value of the other text field to properly validate... so I still have not ironed out that part.


title: heading in right direction? C++ and class templates

text: I'm working on some inherited code in C++ and am trying to use 2 classes with templates as I need 2-types of each class to operate on floating point or integer data (double v uint64_t to be exact). In the two classes that I'm trying to "templatize"(?), one inherits from the other. Data definitions needed for both are defined in the 'more base' class, some with the parameterized typename 'T', and some with resolved types (e.g. 'int') in the 'protected:' section. The corresponding implementation (.cc) file for the more base class compiles 'ok', but the implementation file for the derived class (which is also 'templated') isn't seeing the the class data from the 1st template. I thinking that the derived class file wants to see a resolved version of the more base class's template definition, but am not sure. Example: more base class template file (.h) has:               template < typename T > class FieldMeter : public Meter {     ...     protected:         int numfields_;         F *fields_;         F total_, used_, lastused_;     ...     };      'less base' class (.h) file:               template <typename T> class FieldMeterGraph : public FieldMeter <T> {         ...     }      Problem comes in less-base class .cc file when accessing 'numfields_' or 'fields_':               fieldmetergraph.cc:51:24: error: ‘numfields_’ was not declared in this scope       if (!heightfield_  && numfields_>0 && graphNumCols_ >0)      When both were simple classes, I didn't get the above, so it's a case where data being declared in the more base, 'templatized' class isn't accessible in the implementation of a derived template. My terminology may be a bit off -- but it seems like this should be doable -- with "end classes" like "`cpumeter`" that would pass a solid data type (`uint64_t`) to the toplevel `FieldMeterGraph` template. I'm tempted to resort to storing the type at compile time, and doing the resolution manually, at run-time like I would in 'C', but as I understand it, this should be resolvable by the compiler (g++ using C++11), at compile time. I do have Stroustrup's 4th tomb as reference, but it seems his examples are tending toward being a bit too generic for me to correctly derive a resolvable, concrete example that g++ likes (though g++'s error messages do seem to be extraordinarily more helpful and precise compared to what I normally get in perl..).... If someone knows how to more quickly resolve my conundrum, than my randomly trying various things that don't work, it would be appreciated! ;-) Thanks!


title: App shell using MEF

text: I am designing an WPF app shell using MEF. I would like to have the app start a "view" upon startup. I also would like the option of having another add-in have a "startup" attribute and then the app would load that one instead. I've made an interface:               [InheritedExport]     public interface IStartupParams     {         /// Gets or sets the WindowMode property.         WindowMode WindowMode { get; set; }              /// Gets or sets the NavigateUri property.         string NavigateUri { get; set; }              /// Gets or sets the Priority property.         int Priority { get; set; }     }      So the app would load multiple IStartupParams concrete classes and select the one with the highest priority. What do you guys thing about this design? Any ideas?


title: Write tests for unit tests in TDD?

text: In an answer to another question, I suggested creating a randomized value for input to a specific method. In my experience this has been useful for making tests more readable and it lets you skip the "trivial phase" where you hardcode specific results in a method. Here's the unit test code pasted from the other answer, for quick reference:               [Test]     public void FullHouseReturnsTrue()     {         var roll = AnyFullHouse();              Assert.That(sut.IsFullHouse(roll));     }     [Test]     public void StraightReturnsFalse()     {         var roll = AnyStraight();              Assert.That(sut.IsFullHouse(roll), Is.False);     }      A couple of comments in response suggested that this strategy would not work well, because the helper method would need to be tested also. In my experience, I've never had a need to test methods like this, since creating the corresponding production code also tests my test code. Do `AnyStraight()` and `AnyFullHouse()` need to have their own unit tests? If so, how do you solve the chicken-and-egg problem that presents? **EDIT** Would I still want to create dedicated unit tests for the `AnyFullHouse` algorithm if I inlined the method?               [Test]     public void FullHouseReturnsTrue()     {         var roll = listOfHardCodedFullHouseRolls[_random.Next(0, listOfHardCodedFullHouseRolls.Length)];              Assert.That(sut.IsFullHouse(roll));     }


title: Single configuration file for multiple WCF services

text: We have a scenario where we have multiple WCF services hosted on the same server connecting to same database. But currently they all have their separate web.config files. So each time there is some change or new deployment to another server, each and every web.config needs to be changed. Is there a way we can have a single configuration (be it on a file or in memory/db) which can be shared among all the services on any given server? If so what would that be? If not, why not? If we shouldn't go for this approach, why not? Currently we have such a hierarchy (Folder structure)   * Services      * Service1     * Service2 ... ...     * ServiceN


title: Is there a software engineering principle that relates reuse and regression test cost on a production system?

text: I've worked on a large financial transaction system for a bank that looked after Pensions and Investments. After 15 years of feature changes, the manual regression test cost had climbed to $200K per release. (10M LOC, $10M transacted per day). This system also interfaces with 19 other systems around the company moving lots of data around. This system was implemented in Java. What we observe however, is that the more 'reuse' we do, the more regression test costs go up. (The reason being that you need to "test the code you touch" - and reused/shared code impacts a multiplicity of places when it is touched. So despite 'DRY - Do Not Repeat Yourself' - ie don't copy and paste code - we observe a financial incentive to copy and paste code. This is to drive regression test costs down, because we don't want to modify code that could be shared, because that will cause a big regression test impact. ) My question is **is there a software engineering principle that describes the relationship between reuse and regression test costs?** The reason I'd ask this question is that arguably there is a cost benefit in decomposing the system into smaller parts to be tested. **Assumptions:**   1. 'Regression test' means 'acceptance test' - ie another group spending time to write new and reuse old tests against the system on behalf of the business, including environment and data setups.    2. I know the knee-jerk reaction to a big regression test cost is 'more automated tests'. This is a good principle. In this environment there are a couple of challenges.  (a) Automated tests are less useful across system boundaries, unless that system has a high automated test coverage as well. (Sphere of influence challenge). (b) It is culturally difficult to get momentum on programmer time or capital investment on high automated test coverage when your system is already large and complex. (c) The cost of maintaining automated tests is hidden on a project, and so they are easily discarded at a project level. (d) This is just the cultural reality of working in a bank. (e) I'm working to solve this problem in a different way (decomposition).


title: At what point should I have my Windows developers upgrade to the latest release of Windows?

text: At what point should I begin upgrading our developer's machines to a later Windows release? From experience, Microsoft typically has an epic fail about every other O.S. (I am really not trying to start a debate about this, it is my perception let it be) i.e. 2000 was a stable and useful O.S, yet m.e. didn't do well, xp was a great O.S. that many businesses still use, Vista didn't do well (I know that the reason this one didn't do well wasn't really Microsoft's fault and that Vista and 7 are the same major revision), while 7 seems to be an excellent O.S. that will be around for a while--sort of like xp is now. Anyways, this makes me reluctant to upgrade our development machines to Windows 8.   * a. I don't want to cost our business a ton of money for an O.S. that will only be used for a year or two.   * b. They also have to have linux dual boots, and I have read that Windows 8 and grub will not play well together. I do want our developers to develop in the latest environment and to have a leading edge in any technology they are developing with. I do want to stay ahead of--or at least with--the technology curve, yet I want it to make business sense. So in particular, should I upgrade their machines at this point? In general, what calculus should I use for deciding this sort of thing? **edit** They do write desktop UI applications as well as ASP.NET applications. Also, I do make sure that they always have the latest release of Visual Studio.


title: Is it a bad idea to ask an interviewer what the greatest strength and weakness of their development team is?

text: I was wondering if this was a good question to ask a possible employer when interviewing for a developer position: > What is the greatest strength and weakness of your development team? We all get this question when we are in an interview, so why not ask them in return? I think it is a very good question because we could find out about the team, and how this strength or weakness could affect us, but I don't want to annoy the interviewer. Is there any downside to asking this question when interviewing for a developer position?


title: OpenUp/Basic In Practice

text: I have some confusion understanding the OpenUp/Basic process. It is described as an iterative process consisting of four phases:   * Inception,   * Elaboration,   * Construction, and   * Transition.  I am not clear if a single iteration consists of all these phases or if we make several iterations within a single phase and then move to next phase. In the later case, it seems to be impractical but in former case feasibility of project can not be identified. Is there anyone who has experience implmenting it in the organisation?


title: What is the rationale behind semantic web?

text: Is the semantic web extended form of the relational database that the data should not be redundant? That is it should exist only as an entity and all its characteristics defined by the other entities should be linked via predicates.


title: Building one way chat?

text: I'm implementing a Windows 8 app using C#, part of it is One Way Chat. It will be for multiple users such as teacher and student. We want to use a chat room for every course. Teachers teach different courses that include many students and students study different courses, so when the teacher and student open the course page, they will find a chat page specific for this course. How can I build such a thing?


title: Should I refactor my unit tests when I extract a class out of the System Under Test?

text: I wrote this class that does a few things (perhaps this is a violation of the Single Responsibility Principle). I realize now that some other part of the project needs a _piece_ of that logic and the way I'm going to expose it is to extract a class out of my original System Under Test. I anticipate being able to do this without having to change any test code, but when I finish, you could argue that the test isn't a **unit** test anymore. It'll be testing the original class _and_ the class I've extracted. In other words, I'll have one test case, but two systems under test. Am I supposed to refactor my test code after I'm done? IE: Create an ExtractedClassTest and move all the relevant tests from OriginalClassTest into it? This seems like it could be a little risky: I may lose some coverage in the process, it may not be as simple as moving a test and I'd end up rewriting some test code that I know used to work but may not anymore, etc. On the other hand, if I leave the OriginalClassTest as-is, I can see this being a test maintenance issue. It'll be a little confusing to find where the ExtractedClass's tests are. Your first impression will be that it doesn't exist. Over time with lots of production code refactorings, this could become a serious issue. I'm new to TDD so I'd like an expert's advice. Thanks!


title: Nomenclature for wildcard vs regex expressions

text: When I see the term _pattern_ in a description of syntax I infer a regular expression is being specified. Is there a separate term that specifies a wildcard expression?               ^foo.*(bar|baz){3} <--  'regular expression' or 'pattern'     foo*bar.txt        <--- 'wildcard expression' or ...?      Or is a wildcard expression just another type of pattern requiring context information to discern the distinction?


title: Best practice to sync long paths to filesystems where path length is limited?

text: I wrote a sync tool to synchronize folders/files from Alfresco to Windows.   PROBLEM:   * In Alfresco, /files/can/have/very/very/very/long/filepaths/like/this.txt   * The Windows API prevents me from creating a path with more than 260 characters. In addition to telling the user there is a problem, what is the best practice in such a case?   1. Shorten the file's name?   2. Skip the file?   3. Create a sort of "folder's carriage return", a special folder from which the path can continue?   4. Something else? Files need to be 100% usable by other applications. If necessary directory names can be modified, I can keep a mapping.


title: Namespace and class name guidelines

text: I'm having problems naming my classes and services correctly when utils and other help classes are involved. How would you structure the following:               EventService.cs     EventServiceUtils.cs     EventServiceValidators.cs     EventServiceCoordinator.cs      etc... I have multiple services with the same needs as the above service. One thought is to separate all of this into a suitable namespace, making it look something like this:               Services.EventService.EventService.cs //(the actual service)     Services.EventService.Validators.DateValidator.cs     Services.EventService.Validators.ParticipantValidator.cs     Services.EventService.Coordinators.ParticipantCoordinator.cs     Services.EventService.ExtensionMethods.Extensions.cs      and so on. Every namespace is of course a separate folder. But this doesn't feel 100%, since there are probably more `DateValidators` in the other services, which can easily lead to an unwanted reference. And also the `Services.EventService.EventService.cs` includes the class name in the namespace, which is no good either. You could use `Services.Event.EventService.cs`, but there is of course already an entity with that name. This is the domain model.


title: Use of MIT-Licensed OSS with GPL Dependencies

text: I have been assigned to audit third-party dependencies for one of my company's products to make sure we aren't in danger of running afoul of any licenses. This is probably a job for a lawyer, but such is life when you work at a small company. At my company, we are using CS2J, an open-source project, to translate C# to Java. CS2J is itself MIT-licensed, and we use it in two ways. First, we use it as an internal tool to translate our source code from one language to another. Second, it comes with a support library (a jar file) that the translated files reference. We package this support library with our main distribution. It turns out that the support library depends on JavaMail, a GPL-licensed product. (There's technically another license option, but it has the same copyleft clause.) I believe at one time it had something other than a GPL license, but that is no longer the case. We had been planning on to ship the support library (CS2JSupport.jar) and JavaMail (mail.jar) as its dependency. I have a few questions:   1. Is CS2J allowed to be licensed under the MIT license in the first place if it's distributed with a GPL dependency?   2. If we are shipping mail.jar as a dependency of our dependency, does that mean the copyleft applies to us? Or does it just apply to CS2J?   3. We have a close relationship with the CS2J author. If we asked the CS2J author to make available a CS2JSupport.jar that had mail.jar included _inside_ the jar, then is CS2JSupport simply a derivative work of mail.jar? And since the derivative work is covered under the MIT license instead of the GPL license, would that exempt my company from the copyleft even if we wouldn't be exempt in the situation described in #2?


title: design pattern to expose MongoDB to REST api?

text: We are setting up something like a document library on Amazon AWS. The architecture is basically 1. AMI server running MongoDB 2. A bunch of PDF documents on elastic block storage 3. Some server-side scripting that pulls and parses metadata into MongoDB, and finally, 4. some front-end services that query the database. The end goal is a website that facilitates search and discovery of the PDF library (e.g. show me all PDFs written by X). First, I wonder if this is a reasonable way to go about things. (Is this a good design pattern?) Second, we are having a difficult time exposing MongoDB through REST API. We can access REST through the browser address bar, but getting stuck on sending GET requests in client-side javascript because of cross-server requests. Any help is appreciated.


title: Is performing a Waterfall every 2 weeks considered agile development?

text: I've been wondering if one can still classify a Waterfall type development approach, where the length of the waterfall cycle is 1-2 weeks, as Agile.


title: How can I select an appropriate licensing/obfuscation system for .NET?

text: I saw someone suggesting .NET Reactor once as a good obfuscator. I went to their website to check it out and saw they have a product called IntelliLock which is advertised as a pretty robust licensing system which has code protection/obfuscation built in. With that said, I tried to contact them and ask them a few questions regarding the product, but have not had any response. This is kind of a red flag for me. However, it seems like there is some user base for this product whom are satisfied. What .NET licensing system(s) with .NET code protection/obfuscation are you using? What are its pros & cons that you have encountered? Are there things I should be looking for or looking to avoid when evaluating these systems?


title: Difference between '\n' and '\r\n'

text: Yes yes, I am aware that `'\n'` writes a newline in UNIX while for Windows there is the two character sequence: `'\r\n'`. All this is very nice in theory, but my question is **_why_**? Why the carriage return character is extra in Windows? If UNIX can do it in `\n` why does it take Windows two characters to do this? I am reading David Beazley's Python book and he says: > For example, on Windows, writing the character '\n' actually outputs the > two- character sequence '\r\n' (and when reading the file back, '\r\n' is > translated back into a single '\n' character). Why the extra effort? I will be honest. I have known the difference for a long time but have never bothered to ask WHY. I hope that is answered today. Thanks for your time.


title: How is reactive logic programming different from functional programming?

text: As Reactive Programming model is perfectly suited to address the change propagation required for transaction processing, that is, when the server receives change (Insert, Update, or Delete) requests. The key approach borrows heavily from Domain Driven Design to provide declarative Domain Logic. But how does it differ from functional programming approach?


title: Earning extra cash as a programmer

text: I work as fulltime programmer and have a pretty well paid job for the country where I live, but I could do with a bit of extra cash at the moment (wife nagging about new kitchen etc.). I'd be interested in taking on small projects in my spare time. I'm not interested in writing malware or get rich quick schemes. I've checked out a few sites programmer freelance sites, but the projects all see to be very poorly paid or people that want malware creating (or both). Are there any good freelancing sites that I may have missed? Are there any other ways to find small freelance projects?


title: What is ant build file and maven build file?

text: Can somebody please tell me in simple words what exactly is ant build file and maven build file?


title: Purposely raising exceptions to use catch

text: For a typical `if...else` wrapped with exception handling, is something like the following example a recommended practice to avoid code duplication?               try     {         if (GetDataFromServer())         {             return ProcessData();         }         else         {             throw new Exception();         }     catch(Exception ex)     {         return null;     }      instead of...               try     {         if (GetDataFromServer())         {             ProcessData();         }         else         {             return null;         }     }     catch(Exception ex)     {         return null;     }      I know there is a slight performance hit, but I'm wondering if this is considered to be an acceptable practice. I currently do it the second method - especially in cases where I need to handle specific exceptions differently - but I was wondering if the first method is appropriate for simple cases.


title: What is the correct way to implement Auth/ACL in MVC?

text: I am looking into making a correctly laid out MVC Auth/ACL system. I _think_ I want the authentication of a user (and the session handling) to be separate from the ACL system. (I don't know why but this seems a good idea from the things I've read.) What does MVC have to do with this question you ask? Because I wish for the application to be well integrated with my ACL. An example of a controller (CodeIgniter):               <?php     class forums extends MX_Controller     {         $allowed = array('users', 'admin');         $need_login = true;                  function __construct()             {             //example of checking if logged in.                 if($this->auth->logged_in() && $this->auth->is_admin())             {                 echo "you're logged in!";             }         }         public function add_topic()         {             if($this->auth->allowed('add_topic')             {                 //some add topic things.             }             else             {                 echo 'not allowed to add topic';             }         }     }     ?>      ### My thoughts `$this->auth` would be autoloaded in the system. I would like to check the `$allowed` array against the user currently (not) logged in and react accordingly. Is this a good way of doing things? I haven't seen much literature on MVC integration and Auth. I want to make things as easy as possible.


title: What's a "Professional Fit" interview?

text: So I went through an initial interview on school campus, and an on-site interview(one day, mostly technical interviews) with this company, and then a week later, I am told that there will be an additional phone interview with one of their hiring managers, called "Professional Fit Interview", which I have no idea what it is. Before I thought the on-site interview was gonna be the last round, at least that's the impression I got from them. So what this "professional fit interview" might be? How should I prepare for it? Thanks a lot! A follow-up: Thank everyone for the replies. As everybody has mentioned, it's a HR type interview. The interviewer did some introduction of the team, then asked if I have some questions, and asked me a couple of questions like "where do you see yourself in 2 years". Anyway, a rejection email came about one week later.


title: Do I need to buy individual ios developer subscriptions for the members of my team, if I have a company subscription?

text: My guess is I have to, and if I do, I'll buy them while the company license is under review.


title: Is there any Windows installer maker with decent scripting capabilities?

text: I need to do complex dependency processing during the installation of our solution, install a few related programs from their own installers and also probably run a few simple tests to determine performance of the machine to choose the right parameters for our application. I'm thinking something like Lua would be a great fit for this task, yet all scripting in installers I found so far is something like Pascal script of Inno Setup which leaves a lot to be desired and NSIS scripting language is nonexistent. I guess I'm missing something really obvious here as my task is not unique and has probably been solved before.