title: Source code and project documentation requirements for legal agreement

text: # Question What kind of documentation and other artifacts would you expect to get in case of taking over existing Java webapp (probably it uses JBoss Seam framework) made _in-house_? I would expect to get:   * Source code in form ready to open in specified IDE.   * All external elements (i.e. DB schema as SQL scripts, installation scripts).   * Configuration files (both for devel, testing and production environments).   * All external libraries needed by project.   * All external tools used in project or at least their description (i.e. make program, version control software).   * Detailed info about:     * How to compile project (IDE, libraries, their versions, compilers, OS),     * How to setup development environment (database version, OS, DB schema),     * How to install and run application -- server specification (OS, database, versions, minimal hardware, configuration both app and DB),  Probably it would be also nice to have:   * Archive of the whole version control system (to make possible checking changes from the past).   * UML diagrams or other form of _big picture_ of application design.   * DB schema. What I miss? # Some background details Friend works as a lawyer for a company which needs legal agreements with people who develop applications for them. Just in case something goes wrong. In general -- the company wants to have source code deposited somewhere. But source code is not enough to maintain or even compile and run webapp, so they also needsome documentation which helps maintain the app. I've never taken someone else's project in a similar case (no access to previous developers), and I am not Java developer, so I expect there are a lot of things to miss. ## More details added after a few answers The bosses of company (named it **A** , small corporation), which ordered and uses the app and company (named it **B** , a few people) which writes the app, are friends. Development is _in-house_. No formal spec, no written specification. All features are discussed over mail or on meetings. Everything, including hosting the app, is managed by **B**. Friend (who is also one of heavy users of the app -- let's say she is _product owner_ ) doesn't trust developers from **B** at all. Friend also doesn't believe in **B** competencies (believe me -- she should not). So to protect **A** business friend wants written legal agreement with **B** in case **B** would go away with **A** data and app... As MSalters wrote -- don't laugh -- it happens :(. **A** already made **B** to make and provides backups.


title: Resolving merge conflicts due to refactoring

text: I got involved in a discussion recently on how to handle refactoring in general (which is an interesting topic in itself). Eventually the following question was brought up: **How does one handle merge conflicts that occured due to that someone did a refactoring of a part of the code, while someone else was working on a feature for the same piece of code?** Basically, I have no idea how to deal with this in an efficient manner. Are there any best practices that one should follow regarding this? Is there any difference on how one should handle this for a system with tons of legacy code?


title: Can we replace XML with JSON entirely?

text: I'm sure lots of developers are familiar with XML and JSON, and they've used both of them. Thus no point in explaining what they are, and what is their purpose, even in brief. If we try to map their concepts, we can say (correct me if I'm wrong):   1. XML tags are equivalent to JSON `{}`   2. XML attributes are equivalent to JSON properties   3. XML tag collection is equivalent to JSON `[]` The only thing I can think of, which doesn't exist in JSON, is XML Namespaces. The question is, considering this mapping, and considering that JSON is highly lighter in this mapping, can we see a world in future (or at least theoretically think of a world) without XML, but with JSON doing everything XML does? Can we use JSON everywhere XML is used? PS: Please note that I've seen this question. It's something entirely different from what I'm asking here. Thus please don't mention **duplicate**.


title: Dependency Injection and method signatures

text: I've been using YADIF (yet another dependency injection framework) in a PHP/Zend app I'm working on to handle dependencies. This has achieved some notable benefits in terms of testing and decoupling classes. However,one thing that strikes me is that despite the sleight of hand performed when using this technique, the method names impart a degree of coupling. Probably not the best example -but these methods are distinct from ... say the PEAR Mailer. The method names themselves are a (subtle) form of coupling               //example     public function __construct($dic){         $this->dic = $dic;     }          public function example(){         //this line in itself indicates the YADIF origin of the DIC         $Mail= $dic->getComponent('mail');                 $Mail->setBodyText($body);         $Mail->setFrom($from);                 $Mail->setSubject($subject);     }      I could write a series of proxies/wrappers to hide these methods and thus promote decoupling from , but this seems a bit excessive. You have to balance purity with pragmatism... How far would you go to hide the dependencies in your classes?


title: What "jobs" benefit by having someone with a programming background perform them?

text: What non-programming jobs should someone look for who doesn't have the passion for programming? There are a percentage of people who make it through a computer science type of degree but do not have the passion for programming. I have worked with many people who have a programming background but became a project manager or tester and it has made my job as a programmer easier... and our products better. This is not a failure of the system or person... they are just finding where they fit. So, I wonder what non-programming jobs benefit from having someone in them that is a programmer and why does it make that person a stronger or weaker candidate for that job? For instance: Programmers make good project managers because they may be able to express requirements in a detailed fashion that makes sense to the programmers that will work on those requirements. But they may be to accustom to talking about things in a technical way that the customers may not understand and they may have a tendency to try to communicate a design for a solution instead of presenting the problem in a raw fashion.


title: Namespaces just seem to be making things more complicated. Am I missing something?

text: Now that I am using namespaces in my php files which match the file's path, I have to append a namespace to pretty much every class instantiation. The namespaces definitely help my autoloader find files, but the code is becomming harder to read/write. aren't namespaces supposed to simplify my code? why is it making things more complicated? Am I using it wrong? Not sure I see how using a namespace is much better than having super long class names... example: file: /root_path/init.php               <?php         namespace root_path;         $foo = new \sub_path\bar();     ?>      file: /root_path/sub_path/bar.php               <?php         namespace root_path\sub_path;         class bar {              }     ?>


title: Are Design Patterns SuperSet of OOP or SubSet?

text: Initially I started learning OOP and later started grasping concepts of Design Patterns. I wonder whether it is the Design Pattern which is the SuperSet of OOP or it is the OOP itself.


title: Which language and GUI toolkit would you use for a prototype program?

text: Suppose, I have an idea and I have to put it into code quickly. And then I am presenting it to someone who is not so computer savvy. Which language should I use for quick and dirty coding? And which GUI toolkit should I use so that the the computer semi-literate find it easy to use (read shiny-eye-candy). It is a desktop application.


title: How to use GPL v3 with Apache License 2.0?

text: Based on this page, I can see that only Apache License 2.0 is compatible with GPL v3. Now my question is, in layman's term, how do I make those two work together? My current situation is that I am developing an application that is made from a GPL v3 licensed programming language. I want to put some form of security on the application and figured I can achieve that via a web service. However, I don't want to expose my web service's code as GPL v3 since it is part of a larger system that I am working on which will be closed source. Is there any way to use the Apache License 2.0 in this scenario? EDIT: For clarity's sake, the programming language I am going to use is LiveCode.


title: Unit testing C++: What to test?

text: **TL;DR** Writing good, useful tests is hard, and has a high cost in C++. Can you experienced developers share your rationale on what and when to test? **Long story** I used to do test-driven development, my whole team in fact, but it didn't work well for us. We have many tests, but they never seem to cover the cases where we have actual bugs and regressions - which usually occur when units are interacting, not from their isolated behaviour. This is often so hard to test on the unit level that we stopped doing TDD (except for components where it really speeds up development), and instead invested more time increasing the integration test coverage. While the small unit tests never caught any real bugs and were basically just maintenance overhead, the integration tests have really been worth the effort. Now I've inherited a new project, and am wondering how to go about testing it. It's a native C++/OpenGL application, so integration tests are not really an option. But unit testing in C++ is a bit harder than in Java (you have to explicitely make stuff `virtual`), and the program isn't heavily object oriented, so I can't mock/stub some stuff away. I don't want to rip apart and OO-ize the whole thing just to write some tests for the sake of writing tests. So I'm asking you: What is it I should write tests for? e.g.:   * Functions/Classes that I expect to change frequently?   * Functions/Classes that are more difficult to test manually?   * Functions/Classes that are easy to test already? I began to investigate some respectful C++ code bases to see how they go about testing. Right now I'm looking into the Chromium source code, but I'm finding it hard to extract their testing rationale from the code. If anyone has a good example or post on how popular C++ users (guys from the committee, book authors, Google, Facebook, Microsoft, ...) approach this, that'd be extra helpful. **Update** I have searched my way around this site and the web since writing this. Found some good stuff:   * When is it appropriate to not unit test?   * http://stackoverflow.com/questions/109432/what-not-to-test-when-it-comes-to-unit-testing   * http://junit.sourceforge.net/doc/faq/faq.htm#best Sadly, all of these are rather Java/C# centric. Writing lots of tests in Java/C# is not a big problem, so the benefit usually outweights the costs. But as I wrote above, it's more difficult in C++. Especially if your code base is not-so-OO, you have to severely mess things up to get a good unit test coverage. For instance: The application I inherited has a `Graphics` name space that is a thin layer above OpenGL. In order to test any of the entities - which all use its functions directly - I'd have to turn this into an interface and a class and inject it in all the entities. That's just one example. So when answering this question, please keep in mind that I have to make a rather big investment for writing tests.


title: Does syntax really matter in a programming language?

text: One of my professors says "the syntax is the UI of a programming language", languages like Ruby have great readability and it's growing, but we see a lot of programmers productive with C\C++, so as programmers does it really matter that the syntax should be acceptable? I would love to know your opinion on that. Disclaimer: I'm not trying to start an argument. I thought this is a good topic of discussion. Update: This turns out to be a good topic. I'm glad you are all participating in it.


title: What is the exact semantic of reduce in clojure?

text: The Clojure docs regarding `(reduce f val coll)` state: > If val is supplied, returns the result of applying f to val and the first > item in coll, then applying f to that result and the 2nd item, etc. So I tried:               (reduce str ["s1" "s2"] "s3")      Which leads to:               "[\"s1\" \"s2\"]s3"      However, when I try               (apply str ["s1" "s2"])      I get:               "s1s2"      So why does the vector get converted into its string representation?


title: Why do some websites showing 0 bytes in Chrome's developer tools

text: I am doing a page speed optimization for my website and studying how other websites do it. I noticed that some websites such as as Facebook or Ringgitplus show 0 bytes for some of their resources in Chrome's developer tools, Network tab, while the real content size is several kilobytes. ![The screenshot of Network tab showing 0 bytes for some resources](http://i.stack.imgur.com/asvBh.png) I read some articles that says that _size_ is the amount being fetched and _content_ is the actual size of the response. So when size is 0 bytes, it means it served from cache. But the same thing happened when I open the page using Incognito or clearing all my cache. How is this possible and how can I achieve the same thing for my websites?


title: Need help with deciding elements for icon creating application

text: I'm trying to practice programing by creating a simple application which, I think, I can manage to do in .Net C# in VisualStudio 2010. I'm working on simple application which will let me to create small pictures (icons) in sizes such as 8x8, 16x16, 32x32 (ect) pixels. I will be creating a grid representing each size by scaling to amount of pixels. Each pixel will be represented in a small square which will be able to click to change color ect. So here's my question regarding what elements such app should have:   * What VS tool would let me to create a grid for my project? Keeping in mind that each small square should be generated automatically by using X/Y size provided by user and boxes should be clickable. Also, I probably should be able to be able to click one pixel and drag mouse to select other pixels.   * What simple functions should such small app have? Ex. choosing colors.   * What minimal functions should I have? I hope this is place for such question. I'm trying to get the general idea of how to make such small app work and what user might expect when opening small, icon creating, application.


title: What's the best way to cache a growing database table for html generation?

text: I've got a database table which will grow in size by about 5000 rows a hour. For a key that I would be querying by, the query will grow in size by about 1 row every hour. I would like a web page to show the latest rows for a key, 50 at a time (this is configurable). I would like to try and implement memcache to keep database activity low for reads. If I run a query and create a cache result for each page of 50 results, that would work until a new entry is added. At that time, the page of latest results gets new result and the oldest results drops off. This cascades down the list of cached pages causing me to update every cache result. It seems like a poor design. I could build the cache pages backwards, then for each page requested I should get the latest 2 pages and truncate to the proper length of 50. I'm not sure if this is good or bad? Ideally, the mechanism I use to insert a new row would also know how to invalidate the proper cache results. Has someone already solved this problem in a widely acceptable way? What's the best method of doing this? EDIT: If my understanding of the MYSQL query cache is correct, it has table level granularity in invalidation. Given the fact that I have about 5000 updates before a query on a key should need to be invalidated, it seems that the database query cache would not be used. MS SQL caches execution plans and frequently accessed data pages, so it may do better in this scenario. My query is not against a single table with TOP N. One version has joins to several tables and another has sub-selects. Also, since I want to cache the html generated table, I'm wondering if a cache at the web server level would be appropriate? Is there really no benefit to any type of caching? Is the best advice really to just allow a website site query to go through all the layers and hit the database every request?


title: What steps should be taken to ensure that an open source database gets ready for production?

text: I am considering using GridSQL in a production environment. However, I do have some indications that it is not ready. One is that it got excluded by the offering of EnterpriseDB a while ago, and the forums seem to report a few wrong results and relatively severe bugs. The alternatives to GridSQL, however cost around 100.000$ to buy, so I was thinking to utilize some of this money to ensure that GridSQL gets ready for production. At the same time, I could risk spending 50.000$ and months of work on the development of GridSQL, just to discover that the design was flawed and that a complete rewrite is needed. Then I would have to buy the commercial alternatives to GridSQL and the existence of my startup would be at risk. **Question** What steps would you take to ensure that there is as little risk as possible that the worst case scenario described above would happen? It is unrealistic that I could do much testing nor code review/coding myself (I am also not the best developer), so please describe where to find the guys that would need to do the work.


title: Hiring "off-platform" - what are the indicators for successful candidates?

text: When looking for candidates you often want to have people with direct experience with the technologies and platforms you are using today. However, that may not always be a possibility. The particular requirements may involve niche tech, outdated tech, or your team has already drained the local area of everyone with that particular tech (not everyone works in Silicon Valley, some of us work and live in some smaller metro area for reasons unrelated to the profession). So often that can leave you with hiring people who are "off-platform" like Dot-Net people for a Java project, or Cobol programmers for an iPhone app (or vice versa). Or even just a language switch, from Visual Basic to Scala or JavaScript to C. My question is what qualities, attributes, and experience would you look for as in interviewer to indicate that the candidate can successfully switch platforms or languages, and what are the indicators as to the level of success and timeframe. Also, decent "war stories" related to this would get a solid upvote from me.


title: How should I approach developing a Java based client-server application?

text: I have been asked to develop a client-server application (requires database) for a company. I am very handy with java so would like to go with it. Its up to me how I develop the application. It may be an JSP web application or Java Swing GUI based application. I have following queries/doubts. So if I go on to develop a web application, I have to teach the company personnel     1. How to install Tomcat   2. How to load the web application Tomcat   3. How to start the server to start the application. If I go on to develop a Java Swing GUI based application,   1. It should start when the computer starts up. i.e it should be auto added into the service start-up of the OS on installation   2. Have application shortcut in quick launch, tray bar on installation. On Database Part: I would like to have MS-access like DB but free one. This is because,   1. No need to worry about installation of DB engine (like we have to take care in-case of MySQL).   2. DB would maintained in some Drive (like .mdb file in case of MS-Acess) unharmed even if their OS crashes. Please guide me how should I approach in developing the software.


title: What are the (or some) tenets of software security?

text: When developing security, what tenets should you keep in mind and follow in order to practice due diligence?


title: Writing a game engine using javascript

text: ..by this I mean a logic handler for a chess game. Basically validating a move and checking if somebody has won. Now ignore the complexity of the game(if you can..) I'd like some sort of psuedo code on how it would look using callbacks in javascript. For arguments sake imagine once a move is completed in the browser it sends a JSON object of the piece that has been moved and to which space it has been moved to. On the server we have access to a JSON object which contains data for the complete board. With this information I expect to pass it in to my engine and determine from the output if the move is valid..and if so is it a winning move? I'm not looking for any specific logic on how to determine a move in chess -> just a kind of psuedo example/template of the flow of the game using the above paragraph as a guide to what must be done. The reason for this is I would like to understand how callbacks can be used to produce something of this nature as opposed to synchronous code.


title: Best practice or design patterns for retrieval of data for reporting and dashboards in a domain-rich application

text: First, I want to say this seems to be a neglected question/area, so if this question needs improvement, help me make this a great question that can benefit others! In my experience, there are two sides of an application - the "task" side (where the users interact with the application and it's objects where the domain model lives) and the reporting side, where users get data based on what happens on the task side. On the task side, it's clear that an application with a rich domain model should have business logic in the domain model and the database should be used mostly for persistence. Separation of concerns, every book is written about it, we know what to do, awesome. What about the reporting side? Are data warehouses acceptable, or are they bad design because they incorporate business logic in the database and the very data itself? In order to aggregate the data from the database into data warehouse data, you must have applied business logic and rules to the data, and that logic and rules didn't come from your domain model, it came from your data aggregating processes. Is that wrong? I work on large financial and project management applications where the business logic is extensive. When reporting on this data, I will often have a LOT of aggregations to do to pull the information required for the report/dashboard, and the aggregations have a lot of business logic in them. For performance sake, I have been doing it with highly aggregated tables and stored procedures. As an example, let's say a report/dashboard is needed to show a list of active projects (imagine 10,000 projects). Each project will need a set of metrics shown with it, for example:   1. total budget   2. effort to date   3. burn rate   4. budget exhaustion date at current burn rate   5. etc. Each of these involves a lot of business logic. And I'm not just talking about multiplying numbers or some simple logic. I'm talking about in order to get the budget, you have to apply a rate sheet with 500 different rates, one for each employee's time (on some projects, other's have a multiplier), applying expenses and any appropriate markup, etc. The logic is extensive. It took a lot of aggregating and query tuning to get this data in a reasonable amount of time for the client. Should this be run through the domain first? What about performance? Even with straight SQL queries, I'm barely getting this data fast enough for the client to display in a reasonable amount of time. I can't imagine trying to get this data to the client fast enough if I am rehydrating all these domain objects, and mixing and matching and aggregating their data in the application layer, or trying to aggregate the data in the application. It seems in these cases that SQL is good at crunching data, and why not use it? But then you have business logic outside your domain model. Any change to the business logic will have to be changed in your domain model and your reporting aggregation schemes. I'm really at a loss for how to design the reporting/dashboard part of any application with respect to domain driven design and good practices. I added the MVC tag because MVC is the design flavor du jour and I am using it in my current design, but can't figure out how the reporting data fits into this type of application. I'm looking for any help in this area - books, design patterns, key words to google, articles, anything. I can't find any information on this topic.


title: How to tackle complex business rule and logic?

text: I have a domain expert to work with, but he would throws a lot of details to me verbally. The business logics are complex, business rules change often, the business process is long and multi-ending / intermediate wait-state. There are a lot of cases to deal with (because there are many states for the account, product and subscription). What's the best way to deal with it? BPMN diagram isn't even low level enough to explain. Written documentations are time consuming to write and read. UML state diagram can become crazily complex very soon. Any advice would be appreciated.


title: Using a progress dialog and multi threading

text: My .NET Windows desktop application creates an HTML report, and has 3 main phases. It may create multiple reports. I show a progress bar so the user knows (estimates) how long it will take (as well as reassure the system didn't crash by an updating GUI). So, if I needed to generate 3 reports, there would be a total of 9 phases (3 phases * 3 reports). The issue I now have, is the process is taking too long. As such, I need to use threads so I can start on phase 1, then open a new thread which completes phase 2 and 3. Whilst phase 2 and 3 are in progress, the next item on the list begins with phase 1 and the process continues. I'm hoping this makes sense. So I'm now thinking what to do with the progress bar since multiple phases will be being run at once. At the moment, the only logical thing I can think of is               Report 1. Start phase 1. New thread -> Phase 2 and 3          Check to see if Report 2 is last report. It isn't, so, during Report 2 phase 2, start Report 2 phase 1. New thread -> Phase 2 and 3          Check to see if Report 3 is last report. It is. So, during report 2 phase 2, start Report 3 phase 1, then continue on the same thread with phase 2 and 3      The above will mean I update the Progress Dialog during phase 2 and 3 of the last Report (and I guess I need to add some checks to ensure the other phases are actually finished). I can't imagine I'm doing any thing new or different to what has been before and as such, I was wondering if there is already a pattern for dealing with type of situation?


title: Am I bound by the license of a library that is used in my project but is not distributed with it?

text: I want to publish a small open source project on GitHub. I'd like to release it with either MIT or Apache license. The project has unit tests that use JUnit library. JUnit is released with the Eclipse Public License v1.0. JUnit is not distributed in the project - it is downloaded and used at build time by Maven, the build tool. Am I bound by the license of a library that is used in the project but is not distributed with it? If I am, can I use a library released with the Eclipse Public License in MIT or Apache licensed projects? **My own thoughts (the most pessimistic scenario)** As the unit tests use JUnit, the project is a derivative work of JUnit, even though JUnit is not distributed with it. Distributing the project automatically means distributing JUnit. The Eclipse Public License (the JUnit's license) says: > A Contributor may choose to distribute the Program in object code form under > its own license agreement, provided that … its license agreement: There is a list of four requirements here that sound trivial but which, perhaps, are not fully addressed in the MIT and Apache licenses (disclaiming all warranties, excluding any liability, a statement about additional provisions, a statement about availability of the source code). So, the Eclipse Public License may not be compatible with the MIT and Apache licenses, and I may not be able to use JUnit.


title: Checked vs Unchecked vs No Exception... A best practice of contrary beliefs

text: There are many requirements needed for a system to properly convey and handle exceptions. There are also many options for a language to choose from to implement the concept. Requirements for exceptions (in no particular order):   1. **Documentation** : A language should have a mean to document exceptions an API can throw. Ideally this documentation medium should be machine usable to allow compilers and IDEs to provide support to the programmer.   2. **Transmit Exceptional Situations** : This one is obvious, to allow a function to convey situations that prevent the called functionality from performing the expected action. In my opinion there are three big categories of such situations : 2.1 Bugs in the code that cause some data to be invalid. 2.2 Problems in configuration or other external resources. 2.3 Resources that are inherently unreliable (network, file systems, databases, end-users etc). These are a bit of a corner case since their unreliable nature should have us expect their sporadic failures. In this case are these situations to be considered exceptional ?   3. **Provide enough information for code to handle it** : The exceptions should provide sufficient information to the callee so that it can react and possibly handle the situation. the information should also be sufficient so that when logged this exceptions would provide enough context to a programmer to identify and isolate the offending statements and provide a solution.   4. **Provide confidence to the programmer about the current status of his code's execution state** : The exception handling capabilities of a software system should be present enough to provide the needed safeguards while staying out of the way of the programmer so he can stay focused on the task at hand. To cover these the following methods were implemented in various languages:   1. **Checked Exceptions** Provide a great way to document exceptions, and theoretically when implemented correctly should provide ample reassurance that all is good. However the cost is such that many feel it more productive to simply bypass either by swallowing exceptions or re-throw them as unchecked exceptions. When used inappropriately checked exceptions pretty much looses all it's usefulness. Also, checked exceptions make it difficult to create a API that is stable in time. Implementations of a generic system within a specific domain will bring it's load of exceptional situation that would become hard to maintain using solely checked exceptions.   2. **Unchecked Exceptions** \- much more versatile than checked exception they fail to properly document the possible exceptional situations of a given implementation. They rely on ad-hoc documentation if at all. This creates situations where the unreliable nature of a medium is masked by an API that gives the appearance of reliability. Also when thrown these exceptions loose their meaning as they move back up through the abstraction layers. Since they are poorly documented a programmer cannot target them specifically and often needs to cast a much wider net than necessary to ensure that secondary systems, should they fail, do not bring down the whole system. Which brings us right back to the swallowing problem checked exceptions provided.   3. **Multistate return types** Here it is to rely on a disjoint set, tupple, or other similar concept to return either the expected result or an object representing the exception. Here no stack unwinding, no cutting through code, everything executes normally but the return value must be validated for error prior to continuing. I have not really worked with this yet so cannot comment from experience I acknowledge it resolves some problems exceptions bypassing the normal flow but still it will suffer from much the same problems as the checked exceptions as being tiresome and constantly "in your face". So the question is : What is your experience in this matter and what, according to you is the best candidate to make a good exception handling system for a language to have ? * * * EDIT: Few minutes after writing this question I came across this post, spooky !


title: redimension multidimensional arrays in Excel VBA

text: Take a look at the following code. What my problem is is that I can't figure out how to redimension the n integer and the b integer. What I'm doing is the array sent1 is already working and it is populated with about 4 sentences. I need to go through each sentence and work on it but I'm having trouble. ` dim sent1() dim sent2() dim n as integer, b as integer, x as integer dim temp_sent as string b = 0 For n = 1 to ubound(sent1) temp_sent = sent1(n) for x = 1 to len(temp_sent1)               code               if a then     b = b + 1      **THIS IS THE PART OF THE CODE THAT IS NOT WORKING**               redim preserve sent2(1 to ubound(sent1), b)     sent2(n,b) = [code]          next      next `


title: Service Registry - is it needed?

text: Suppose you develop a system that has multiple services (implemented by different teams, in different countries, using different technologies including java, php, c#, c++ and more). Let's assume that despite using different technologies, somehow you have agreed to integrate using RESTful APIs. Does such a system need a Service Registry? I understand that basically it's not mandatory, since each service may have its own configuration where the service it uses are located. However, creating a central location makes the life of operations easier: they don't need to configure the same service multiple times. But creating a Service Registry may be complex. It's another system in the solution and it requires resources and even more important ownership. Who will owner it? I can think about more pros and cons of a Service Registry. So what do you think?


title: POST/Redirect/GET with invalid form submission?

text: In the field of web development, is it good practice to do a POST/Redirect/GET when fields in a form submission are invalid, as well? Typically, no sensitive transaction would have taken place, in this event. However, can an argument be made that, nonetheless, it is still good practice to utilize the POST/Redirect/GET pattern?


title: Copying (forking) an open source project to your own repository

text: I'm currently using an open source project called CodeFirstMembership for one of my projects. There's a critical issue that I need to get past, and the more I use it, the more I find things I need to modify. It's extremely useful, except it doesn't look like the developer has much time to update it (totally cool, we've all been there). I'm wondering about the etiquette and legality and general "hey, you stole my code you jerk" responses I'd get if I copied the source, moved it to github and made my own fork. On Github, we do this all the time, forking projects, but it FEELs less jerk- ish because there's a connection to the original. Is there anything wrong with me doing this, whether legal or otherwise since there's no copyright notice or license associated with this library?


title: is it okay to remove copyright info from a free, open source API even if you are explicitly told not to do so?

text: Just wondering if text such as the following, which appears inside the source files of a free, open source API, means anything in a court of law                   // Permission is hereby granted, free of charge, to any person obtaining a copy         // of this software and associated documentation files (the "Software"), to deal         // in the Software without restriction, including without limitation the rights         // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell         // copies of the Software, and to permit persons to whom the Software is         // furnished to do so, subject to the following conditions:         //         // The above copyright notice and this permission notice shall be included in         // all copies or substantial portions of the Software.         //         // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR         // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,         // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE         // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER         // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,         // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN         // THE SOFTWARE.


title: Splitting an image into many pieces to improve perceived performance? Good or Bad?

text: Time to time, I have to work on a website that involves a huge background in size and resolution (1920 x 1080 in resolution, over 2mb in size). I've been using preloaders and it worked very well, except that users have to wait a little bit. I noticed that google map splits a big image into many pieces. I researched about it and found out that it actually increases perceived performance. Is this true?


title: What is the difference between an Array and a Stack?

text: According to Wikipedia, a stack: > is a last in, first out (LIFO) abstract data type and linear data structure. While an array: > is a data structure consisting of a collection of elements (values or > variables), each identified by at least one array index or key. As far as I understand, they are fairly similar. So, what are the main differences? If they are not the same, what can an array do that a stack can't and vice-versa?


title: Do I suffer from encapsulation overuse?

text: I have noticed something in my code in various projects that seems like code smell to me and something bad to do, but I can't deal with it. While trying to write "clean code" I tend to over-use private methods in order to make my code easier to read. The problem is that the code is indeed cleaner but it's also more difficult to test (yeah I know I can test private methods...) and in general it seems a bad habit to me. Here's an example of a class that reads some data from a .csv file and returns a group of customers (another object with various fields and attributes).               public class GroupOfCustomersImporter {     //... Call fields ....     public GroupOfCustomersImporter(String filePath) {              this.filePath = filePath;              customers = new HashSet<Customer>();              createCSVReader();              read();              constructTTRP_Instance();          }          private void createCSVReader() {         //....     }          private void read() {         //.... Reades the file and initializes the class attributes     }          private void readFirstLine(String[] inputLine) {         //.... Method used by the read() method     }          private void readSecondLine(String[] inputLine) {         //.... Method used by the read() method     }          private void readCustomerLine(String[] inputLine) {          //.... Method used by the read() method     }          private void constructGroupOfCustomers() {         //this.groupOfCustomers = new GroupOfCustomers(**attributes of the class**);     }          public GroupOfCustomers getConstructedGroupOfCustomers() {         return this.GroupOfCustomers;     }      } As you can see the class has only a constructor which calls some private methods to get the job done, I know that's not a good practice not a good practice in general but I prefer to encapsulate all the functionality in the class instead of making the methods public in which case a client should work this way:               GroupOfCustomersImporter importer = new GroupOfCustomersImporter(filepath)     importer.createCSVReader();     read();     GroupOfCustomer group = constructGoupOfCustomerInstance();      I prefer this because I don't want to put useless lines of code in the client's side code bothering the client class with implementation details. So, Is this actually a bad habit? If yes, how can I avoid it? Please note that the above is just a simple example. Imagine the same situation happening in something a little bit more complex.


title: When is it acceptable to NOT fix broken windows?

text: In reference to broken windows, are there times when refactoring is best left for a future activity? For example, if a project to add some new features to an existing internal system is assigned to a team that has not worked with the system until now, and is given a short timeline in which to work with - can it be ever be justifiable to defer major refactorings to existing code for the sake of making the deadline in this scenario?


title: What are linkers and loaders? How do they work?

text: I am trying to understand things like linkers and loaders better. What area of computer science do they belong to? Compiler, Operating System, Computer Architecture? Where do linkers and loaders come into play during development?


title: Constructs for wrapping a hardware state machine

text: I am using a piece of hardware with a well defined C API. The hardware is stateful, with the relevant API calls needing to be in the correct order for the hardware to work properly. The API calls themselves will always return, passing back a flag that advises whether the call was successful, or if not, why not. The hardware will not be left in some ill defined state. In effect, the API calls advise indirectly of the current state of the hardware if the state is not correct to perform a given operation. It seems to be a pretty common hardware API style. My question is this: Is there a well established design pattern for wrapping such a hardware state machine in a high level language, such that consistency is maintained? My development is in Python. I ideally wish the hardware state machine to be abstracted to a much simpler state machine and wrapped in an object that represents the hardware. I'm not sure what should happen if an attempt is made to create multiple objects representing the same piece of hardware. I apologies for the slight vagueness, I'm not very knowledgeable in this area and so am fishing for assistance of the description as well!


title: How can I work on different projects without losing focus?

text: I'm doing a full-time job (developer) and at the end of the day, I work on my part-time job (developer). How do you work, with different projects, without loosing focus? Often, my focus on the full-time job still remains at my head when working on my part- time job or the other way around.


title: How to do MVC the right way

text:
I've been doing MVC for a few months now using the CodeIgniter framework in PHP but I still don't know if I'm really doing things right. What I currently do is: **Model** \- this is where I put database queries (select, insert, update, delete). Here's a sample from one of the models that I have:               function register_user($user_login, $user_profile, $department, $role) {              $department_id = $this->get_department_id($department);         $role_id = $this->get_role_id($role);              array_push($user_login, $department_id, $role_id);              $this->db->query("INSERT INTO tbl_users SET username=?, hashed_password=?, salt=?, department_id=?, role_id=?", $user_login);         $user_id = $this->db->insert_id();                  array_push($user_profile, $user_id);              $this->db->query("                 INSERT INTO tbl_userprofile SET firstname=?,                  midname=?, lastname=?, user_id=?             ", $user_profile);     }      **Controller** \- talks to the model, calls up the methods in the model which queries the database, supplies the data which the views will display(success alerts, error alerts, data from database), inherits a parent controller which checks if user is logged in. Here's a sample:               function create_user(){         $this->load->helper('encryption/Bcrypt');         $bcrypt = new Bcrypt(15);               $user_data = array(             'username' => 'Username', 'firstname' => 'Firstname',             'middlename' => 'Middlename', 'lastname' => 'Lastname',                 'password' => 'Password', 'department' => 'Department',                  'role' => 'Role'         );              foreach ($user_data as $key => $value) {             $this->form_validation->set_rules($key, $value, 'required|trim');         }              if ($this->form_validation->run() == FALSE) {             $departments = $this->user_model->list_departments();             $it_roles = $this->user_model->list_roles(1);             $tc_roles = $this->user_model->list_roles(2);             $assessor_roles = $this->user_model->list_roles(3);                  $data['data'] = array('departments' => $departments, 'it_roles' => $it_roles, 'tc_roles' => $tc_roles, 'assessor_roles' => $assessor_roles);                  $data['content'] = 'admin/create_user';                      parent::error_alert();                 $this->load->view($this->_at, $data);                  } else {             $username = $this->input->post('username');             $salt = $bcrypt->getSalt();             $hashed_password = $bcrypt->hash($this->input->post('password'), $salt);             $fname = $this->input->post('firstname');             $mname = $this->input->post('middlename');             $lname = $this->input->post('lastname');             $department = $this->input->post('department');             $role = $this->input->post('role');                      $user_login     = array($username, $hashed_password, $salt);                 $user_profile   = array($fname, $mname, $lname);             $this->user_model->register_user($user_login, $user_profile, $department, $role);                  $data['content'] = 'admin/view_user';                      parent::success_alert(4, 'User Sucessfully Registered!', 'You may now login using your account');                       $data['data'] = array('username' => $username, 'fname' => $fname, 'mname' => $mname, 'lname' => $lname, 'department' => $department, 'role' => $role);             $this->load->view($this->_at, $data);         }          }      **Views** \- this is where I put html, css, and JavaScript code (form validation code for the current form, looping through the data supplied by controller, a few if statements to hide and show things depending on the data supplied by the controller).                    <form class="well min-form" method="post">

User Registration

              Username         <input type="text" id="username" name="username" class="span3" autofocus>              Password         <input type="password" id="password" name="password" class="span3">              First name         <input type="text" id="firstname" name="firstname" class="span3">              Middle name         <input type="text" id="middlename" name="middlename" class="span3">              Last name         <input type="text" id="lastname" name="lastname" class="span3">              Department         <input type="text" id="department" name="department" class="span3" list="list_departments">              <datalist id="list_departments">             <?php foreach ($data['departments'] as $row) { ?>                 <option data-id="<?php echo $row['department_id']; ?>" value="<?php echo $row['department']; ?>"><?php echo $row['department']; ?></option>             <?php } ?>         </datalist>              Role         <input type="text" id="role" name="role" class="span3" list="">              <datalist id="list_it">             <?php foreach ($data['it_roles'] as $row) { ?>                 <option data-id="<?php echo $row['role_id']; ?>" value="<?php echo $row['role']; ?>"><?php echo $row['role']; ?></option>             <?php } ?>         </datalist>              <datalist id="list_collection">             <?php foreach ($data['tc_roles'] as $row) { ?>                 <option data-id="<?php echo $row['role_id']; ?>" value="<?php echo $row['role']; ?>"><?php echo $row['role']; ?></option>             <?php } ?>           </datalist>              <datalist id="list_assessor">             <?php foreach ($data['assessor_roles'] as $row) { ?>                 <option data-id="<?php echo $row['role_id']; ?>" value="<?php echo $row['role']; ?>"><?php echo $row['role']; ?></option>             <?php } ?>           </datalist>
             <button type="submit" class="btn btn-success">Create User</button>
     </form>                The codes above are actually code from the application that I'm currently working on. I'm working on it alone so I don't really have someone to review my code for me and point out the wrong things in it so I'm posting it here in hopes that someone could point out the wrong things that I've done in here. I'm also looking for some guidelines in writing MVC code like what are the things that should be and shouldn't be included in views, models and controllers. How else can I improve the current code that I have right now. I've written some really terrible code before(duplication of logic, etc.) that's why I want to improve my code so that I can easily maintain it in the future. Thanks!


title: How safe & trustworthy are hosting sites such as sourceforge, github or bitbucket for closed-source projects?

text: I am considering using sourceforge, bitbucket or github for managing source control for my business. I have open projects and I participate in open projects such as gcc. But I also have a business where I develop closed-source software for my living. How trustworthy are sourceforge, github or bitbucket in terms of keeping software secure from prying eyes? How stable is the hosting in terms of data loss prevention? Has anyone out there based their business logic with such an outfit? Has anyone out there surveyed several of the hosting solutions? Thank you


title: Do I really want a dynamic Enum, or something else? Better caching? A Struct?

text: This question is asked on SO and this site often it looks like. "How do I do a dynamic enum?" Answers range from you shouldn't to possible compile time solutions. Now my question is do I want a dynamic enum that is generated from look up tables in the DB, or do I want something else that is similar? I have a solution using T4 at build time to generate enums from DB tables, that works fine. But now some of the look up tables have an 'active' flag on them. Does this mean they are not look up tables anymore? If that is changed I want to somehow regenerate my code without having to redeploy. These tables will not change often. Currently the app when it wants to populate a dropdown or something will query the DB. But if the values mostly remain static, why go to the DB every time, hence the use of enums. It also has the added benefit of getting rid of magic strings and numbers. Would static structs be better? Some sort of caching for the look up tables? Any advise welcome.


title: Can you recommend good quality online master's programs?

text: I've been looking at online master's degree programs in software engineering. Have you completed a master's program online? If so, where? Did you like it? Was it relevant or out of date?


title: Better to use error monad with validation in your monadic functions, or implement your own monad with validation directly in your bind?

text: I'm wondering what's better design wise for usability/maintainability, and what's better as far as fitting with the community. Given the data model:               type Name = String          data Amount = Out | Some | Enough | Plenty deriving (Show, Eq)     data Container = Container Name deriving (Show, Eq)     data Category = Category Name deriving (Show, Eq)     data Store = Store Name [Category] deriving (Show, Eq)     data Item = Item Name Container Category Amount Store deriving Show     instance Eq (Item) where       (==) i1 i2 = (getItemName i1) == (getItemName i2)          data User = User Name [Container] [Category] [Store] [Item] deriving Show     instance Eq (User) where       (==) u1 u2 = (getName u1) == (getName u2)      I can implement monadic functions to transform the User for instance by adding items or stores etc, but I may end up with an invalid user so those monadic functions would need to validate the user they get and or create. So, should I just:   * wrap it in an error monad and make the monadic functions execute the validation   * wrap it in an error monad and make the consumer bind a monadic validation function in the sequence that throws the appropriate error response (so they can choose not to validate and carry around an invalid user object)   * actually build it into a bind instance on User effectively creating my own kind of error monad that executes validation with every bind automatically I can see positives and negatives to each of the 3 approaches but want to know what is more commonly done for this scenario by the community. So in code terms something like, option 1:               addStore s (User n1 c1 c2 s1 i1) = validate $ User n1 c1 c2 (s:s1) i1     updateUsersTable $ someUser >>= addStore $ Store "yay" ["category that doesnt exist, invalid argh"]      option 2:               addStore s (User n1 c1 c2 s1 i1) = Right $ User n1 c1 c2 (s:s1) i1     updateUsersTable $ Right someUser >>= addStore $ Store "yay" ["category that doesnt exist, invalid argh"] >>= validate     -- in this choice, the validation could be pushed off to last possible moment (like inside updateUsersTable before db gets updated)      option 3:               data ValidUser u = ValidUser u | InvalidUser u     instance Monad ValidUser where         (>>=) (ValidUser u) f = case return u of (ValidUser x) -> return f x; (InvalidUser y) -> return y         (>>=) (InvalidUser u) f = InvalidUser u         return u = validate u          addStore (Store s, User u, ValidUser vu) => s -> u -> vu     addStore s (User n1 c1 c2 s1 i1) = return $ User n1 c1 c2 (s:s1) i1     updateUsersTable $ someValidUser >>= addStore $ Store "yay" ["category that doesnt exist, invalid argh"]


title: Attended (CEH or other) course but have no certification

text: Last summer I attended course for "Certified Ethical Hacker" led by Mr. Wayne Burke. The course was great. Mr. Burke was awesome, flashing with energy all the time, he would stay hours late just to share another piece of his experience with us. I learned a lot of new things, took lot of notes (to which I keep returning), and most importantly, it pushed my way of thinking in a direction. However, due to unfortunate circumstances, I did not attend the actual certification exam, therefore I do not hold the certificate. Now I'm looking for a job (in QA, not necessarily security-related) and while updating my CV, I ask myself: Should I mention the course in the CV? I'm thinking about two possible final effects:   * positive, since I _have_ been there, seen it, understood most of it---better than nothing, well?   * negative, as it could be perceived as failure, so why remind it? Plus, I definitely don't want to look like someone who is boasting with CEH and then turns out he did not make it Is there a recommended rule of thumb on these situations? Does anyone have similar experience? Note: Frankly (aside from what should be considered rational in context of career market), personally I _do_ feel strongly enlightened by the course, and I _do_ believe it helped me a lot in my growth. I don't even consider the missing cert as a personal failure: compared to the actual course, the (preview) questions were a bunch of numbers and tool names to cram up my head. **Update:** Finally I decided to list the course, in spirit as @tdammers wrote about. Anyway, in of interview I've been to, I was not given questions about C|EH-- neither technical ones nor "where is your ~~homework~~ certificate", which is not surprising since as I have pointed out, I wasn't looking for particularly security-centered position. Now I have a new job--just as exciting as I hoped for.


title: What are some games involving recursion?

text: I need to introduce a group of 5-15 people to recursion and I would like to do so by using a physical game/dance/activity they can play to get a feeling for recursion. The class is not so much focused on CS than general concepts so anything computer or programming related is out (but programmers are still the best people I could think of to bombard with such as question). I was thinking about using some kind of clap game such as teenie girls like to play that includes recursion but couldn't come up with one yet. The game/dance might well be ridiculous, it should just be interactive and get them some intuitive feeling for what recursion is and how omnipresent it is in our surroundings. Looking forward to your suggestions!


title: Is version history really sacred or is it better to rebase?

text: I've always agreed with Mercurial's mantra 1, however, now that Mercurial comes bundled with the rebase extension and it is a popular practice in git, I'm wondering if it could really be regarded as a "bad practice", or at least bad enough to avoid using. In any case, I'm aware of rebasing being dangerous after pushing. OTOH, I see the point of trying to package 5 commits in a single one to make it look niftier (specially at in a production branch), however, personally I think would be better to be able to see partial commits to a feature where some experimentation is done, even if it is not as nifty, but seeing something like "Tried to do it way X but it is not as optimal as Y after all, doing it Z taking Y as base" would IMHO have good value to those studying the codebase and follow the developers train of thought. My very opinionated (as in dumb, visceral, biased) point of view is that programmers like rebase to hide mistakes... and I don't think this is good for the project at all. So my question is: have you really found valuable to have such "organic commits" (i.e. untampered history) in practice?, or conversely, do you prefer to run into nifty well-packed commits and disregard the programmers' experimentation process?; whichever one you chose, **why does that work for you?** (having other team members to keep history, or alternatively, rebasing it). * * * 1 per Google DVCS analysis, in Mercurial "History is Sacred".


title: When should we clean up old, no longer used GIT branches?

text: We have several bugfix branches that are starting to pile up. They have been merged into master, and deployed to production. Is there a good benchmark for when these branches should be cleaned up? Should they ever be cleaned up, or is it good to have the historical data?


title: Why does git allow you to "change history"?

text: > **Possible Duplicate:**   >  When should the VCS history of a project be deleted? I am experienced using svn and recently started learning git. I was quite shocked to learn that git has features that allow you to "rewrite history". Coming from svn, I had accepted as sacrosanct the source control principle that once a change is committed, there is no way to "undo" the commit itself... the most one can do is execute a later commit that effectively "reverses" the changes made in the earlier commit, but one can always reproduce the state of any commit that had been done in the past. What is the rationale for changing this "principle"? Is there something different about git that makes this OK, or does the design of git reflect a different "philosophy" of source control that differs with the "philosophy" of svn?


title: Syntax Memorization

text: > **Possible Duplicate:**   >  Programmers forgetting syntax   >  Do programmers need a good memory? I'm a new web developer. I began learning HTML/CSS around June of this year. I picked them up easily, now I'm moving on to Javascript. My problem is this. I understand the concepts that the training material are teaching but I find myself coming up short when it's time to apply those lessons. Mainly it's due in part to the syntax. I memorize a function, apply it, test it, move on then forget it a few days later (the syntax, not the concept). My question is this. Should I be spinning my wheels trying to remember everything, or is knowing the concept enough. I know this has been addressed before but I couldn't find any real definitive real world answers. Feel free to discuss what methods worked for you when you started out.


title: Do programmers need a good memory?

text: It seems one has to remember all sorts of syntax to be able to program. If one don't have a good memory for remembering names, will it be more difficult to learn to program?


title: Is it a good idea to do UI 100% in Javascript and provide data through an API?

text: My primary day job is making HTML applications. With that I mean internally used CRUD-type applications with lots of editable gridviews, textboxes, dropdowns, etc. We're currently using ASP.NET webforms, which do get the job done, but the performance is mostly dismal, and quite often you have to jump through hoops to get what you need. Hoops which are hung from the ceiling and set aflame. So I'm wondering if it perhaps would be a good idea to move all UI to the JavaScript side. Develop a strong set of reusable controls which are tailored specifically to our needs, and only exchange data with the server. Yes, I like the "control" (aka "widget") paradigm, its quite well suited to such applications. So on the server side we would still have a basic layout simliar to our current ASPX markup, but that then would get sent to the client only once, and the Javascript part would take care of all the subsequent UI updates. The problem is I've never done this before, and I've never seen anyone doing this either, so I don't know what the problems would be. In particular, I'm worried about:   * **Performance** still. Benchmarking shows that currently the main delay is on the client side, when the browser tries to re-render most of the page after an AJAX update. ASP.NET webforms generated markup gives a new meaning to the word "web", and the rich Devexpress controls add their own layer of Javascript complexity on top of that. But would it be faster to recalculate all the necessary changes on Javascript side and then update only what needs to be updated? Note that I'm talking about forms that have several editable gridviews, lots of textboxes, many dropdowns each with half-a-zillion filterable items in them, etc.   * **Ease of development**. There would be a lot more Javascript now, and it would probably mix with the HTML markup of the page. That or some kind of new view engine would have to be produced. Intellisense for Javascript is also a lot worse than for C# code, and due to the dynamic nature of Javascript it can't be expected to get a lot better. Coding practices can improve it a bit, but not by much. Also, most of our developers are primarily C# developers so there will be some learning curve and initial mistakes.   * **Security**. A lot of security checks will have to be done twice (server-side and UI-side), and the data-processing server side will have to include a lot more of them. Currently, if you set a textbox to be read-only on server side, you can depend on its value not changing through the client roundtrip. The framework already has enough code to ensure that (through viewstate encryption). With the data-only approach, it gets harder, because you have to manually check everything. On the other hand, maybe security holes will be easier to spot, because you will have only data to worry about. All in all, will this solve our problems, or make them worse? Has anyone ever attempted this, and what were the results? Are there any frameworks out there that help in this sort of endeavor (jQuery and moral equivalents aside)?


title: What data structure should I use for this caching strategy?

text: I am working on a .NET 4.0 application, that performs a rather expensive calculation on two doubles returning a double. This calculation is performed for each one of several thousand _items_. These calculations are performed in a `Task` on a threadpool thread. Some preliminary tests have shown that the same calculations are performed over and over again, so I would like to cache _n_ results. When the cache is full, I would like to throw out the least- ~~often~~ recently used item. ( **Edit:** I realized least-often doesn't make sense, because when the cache is full and I would replace a result with a newly calculated one, that one would be least often used and immediately replaced the next time a new result is calculated and added to the cache) In order to implement this, I was thinking of using a `Dictionary<Input, double>` (where `Input` would be a mini-class storing the two input double values) to store the inputs and the cached results. However, I would also need to keep track of when a result was used the last time. For this I think I would need a second collection storing the information I would need to remove a result from the dictonary when the cache was getting full. I am concerned that constantly keeping this list sorted would negatively impact performance. Is there a better (i.e. more performant) way to do this, or maybe even a common data structure that I am unaware of? What kinds of things should I be profiling/measuring to determine the optimality of my solution?


title: Programming knowledge vs. programming logic

text: Is there any difference between the two topics? I have seen companies asking for _Good Programming knowledge_ some _Good Programming logic_. I have seen this in Job profiles for a developer – for e.g. "good Programming logic", "strong Programming knowledge". I believe that Programming knowledge is related to knowledge about the language in consideration and Programming logic is problem solving logic using programming (in general).   Please correct me if I am wrong. Also what is more important? **Edit:** Do selection of components for application, designing interfaces validating user inputs fall under programming knowledge or Programming logic?   Does programming logic simply imply problem solving, or is there anything else which it should comprise of?


title: What is the best way to maintain software tool chains?

text: **Short Question**   What is the best way to create, maintain, and distribute software development tool chains? **Background**   I am trying to develop a workflow / process to create an isolated environment in install and deploy software tool chains for embedded targets. Each tool chain typically would contain an IDE, compiler, and a small set of common tools. I have looked into two solutions but the both have their limitations and I hope to find a solution that has the best of both implementations. The rational behind a stand alone tool chain is so that all developers would be able to build the exact same code (matching CRC etc..). As well as be able to rebuild the same code after X number of years to support legacy code. A third option would be to use a central build server, which we plan on doing for nightly builds, but we still need to be able to build 'on the fly' when working on a test bench or remotely. So only using a build server will not suffice. **Ideal Goals for Deployed tool chain**   * Work on Windows XP, Vista, and 7 (excluding drivers)    * Contain all required information to run use the tool chain (excluding drivers)  **\------------------ Possible Options ------------------** **Option 1: Full Stand alone Virtual Machine**   _Pros_   * Open Source packaging via Virtual Box   * 100% isolation    * Guarantees the tools can interact with one another  _Cons_   * Licensing multiple copies of windows   * At best only one developer could **legally** use a Windows VM at a time.    * Running the same VM on **physically** different lap tops (Macbook Pro, Dell 830, Dell E6500, etc...). Typically when Windows see's a new CPU or motherboard it will force a re-activation.    * _Very_ large files to maintain **Option 2: Virtualized Application**   _Pros_   * Through packagers like Cameyo, applications can run on nearly all versions of Windows. (Note that Cameyo is also free)   * Little to no licensing issues for most tools / IDEs. Purchased compilers might have additional restrictions, all of our current compilers do support this type of usage.    * Smaller files to maintain via a SCM, such as SVN or GIT.  _Cons_   * Difficult, if even possible, to get a single file that contains the entire tool chain    * Difficult, if even possible, to get the tools to see / work with one another. I have seen this very issue with Cameyo.  **Closing Thoughts**   There may not be a solution that meets all of my design goals, but I would like to find out if anyone else been successful in this type of deployment.


title: Is it better to team up with a designer, or to piece out design work to a contractor?

text: I am clueless when it comes to design but I am proficient in programming. If you are a programmer who lacks visual design skills, what has worked best for you -- to pair up with a graphic designer or to do all the programming and then piece out specific work? I have done some piecing out of work but I am not completely satisfied because I see too much of my influence come out in the design. I guess this happens since I have to be explicit in what I want with contractors, and they are limited in creativity by the architecture I have created. It feels like having a partner would allow for greater collaboration, but I have read plenty of entrepreneur books that warn against partnerships.


title: Favoring Immutability in Database Design

text: One of the items in Joshua Bloch's Effective Java is the notion that classes should allow mutation of instances as little as possible, and preferably not at all. Oftentimes, the data of an object is persisted to a database of some form. This has led me to thinking about the idea of immutability within a database, especially for those tables that represent a single entity within a larger system. Something I have been experimenting with recently is the idea of trying to minimize the updates I do to table rows representing these objects, and trying to perform inserts instead as much as I can. A concrete example of something I was experimenting with recently. If I know I might append a record with additional data later on, I'll create another table to represent that, sort of like the following two table definitions:               create table myObj (id integer, ...other_data... not null);     create table myObjSuppliment (id integer, myObjId integer, ...more_data... not null);      It is hopefully obvious that these names are not verbatim, but just to demonstrate the idea. Is this a reasonable approach to data persistence modeling? Is it worth trying to limit updates performed on a table, especially for filling in nulls for data that might not exist when the record is originally created? Are there times when an approach like this might cause severe pain later on?


title: What is the value of the Cloudera Hadoop Certification for people new to the IT industry?

text: I am a software developer with 8 months of experience in the IT industry, currently working on the development of tools for BIG DATA analytics. I have learned Hadoop basics on my own and I am pretty comfortable with writing MapReduce Jobs, PIG, HIVE, Flume and other related projects. I am thinking of taking the exam for the Cloudera Hadoop Certification. Will this certification add value, considering that I have less than 1 year of experience? Many of the jobs I've seen relating to Hadoop require at least 3 years of experience. Should I invest more time in learning Hadoop and improving my skills to take this certification?


title: Is all industry experience equal (for the most part)?

text: I graduated not too long ago with a degree in computer science. I've been working for a software company for a couple of months, but the work that I'm doing doesn't seem to fall into any defined category (at least the categories that exist in my mind - developer, tester, project manager). My job will occasionally require me to do a bug fix in Java (5%), but the majority of it seems to consist of either querying a client's database and adding/editing/deleting information (60%), or troubleshooting and then giving the response, "You forgot to do such and such before you submitted the form, and that's why you got an error" (35%). My worry is that down the road if I try and apply to some other company for a more senior developer/tester/PM position, they'll look at my work experience and say, "You seemed to have dealt more with database management / technical support than the actual software development cycle". Is this a valid concern on my part? **EDIT** Since the consensus seems to be that it's low-end/support, I have another question. I've been here a relatively short amount of time, and I've had offers for interviews at a couple of other companies (residual contacts from posting my resume online) where I would be doing development (which is what I'd prefer to be doing). I took this position because they were the first to make an offer (the pay is pretty decent) and I'm hoping to go to graduate school in the next year or so, so I wanted to start saving money. Would it be worth it to pursue these other interview offers (who are going off my resume of me coming straight from university), and just act like these last couple of months didn't happen (resume wise).


title: Is testable code actually more stable?

text: A google scholar search turns up numerous papers on testability, including models for computing testability, recommendations for how ones code can be more testable, etc. They all come with the assertion that more testable code is more stable, however I can't find any studies which actually demonstrate this. I tried looking for studies evaluating the effect of testable code vs. quality, however the closest I can find is Improving the Testability of Object Oriented Systems, which discusses the relationship between design flaws and testability. Is testable code is actually more stable? And more importantly, how strong is this relationship? Please back up your answers with references or evidence to back up your claim. For example, there is a lot of study regarding the relationship of cyclomatic complexity and defect rate. Troster finds a correlation of `r = .48` There are metrics for "testability", such as code coupling. I'm looking for research conclusions relating these to defect rate. Ideally I would love a graph plotting some measure of testability vs. defect rate.


title: How to provide a solid explanation that no two software should have same version number?

text: We are an outsourcing company. We develop firmware and software for our client. They have a hardware engineer team with whom we, firmware developers, work. Our client has a **strictly defined process** to release a firmware. A change in firmware version number has a big impact in that process. When we release a firmware to them for testing, the hardware engineers test it first. Then another SQA test it. Finally, the product is released to customers. Sometimes, when the change is minor in a new release, our client insist to keep the version number same as the last one. Say, latest release from developers (not released to the customers) had version number 10. Then we found a place for optimization. Or may be slightly change in behavior of the firmware in a very special case which may or may not be visible from outside. When we propose them that we found these places for minor improvements, they insist us to do the changes but keep the version number 10. We insist that every firmware we release must have distinct version number. We pointed out several common pitfalls if we don't change the firmware version number with every release. They say that they understand why it is necessary. Yet they force us to keep the version number same. Keeping the version number same will help their **strictly defined process** of releasing firmware to customer end. We manage the code in our own repository (SVN). We strictly tie a given version number to a given revision number. The version number is stored in the EEPROM of the product our client release. There is defined 2 bytes where the version number is stored. The PC software that reads version number always reads the 2 bytes and display the version number in PC monitor. There is no other way to define version number. They won't change the software that read version number and they won't allocate more memory to introduce another version number that developers can only use. I'm about to change a firmware and release with the modifications today. I've got another request to keep version number same as previous one. I want to email several unbeatable arguments again what problems we might face if we keep the version number same as previous release. How can I convince my client not to use same version number?


title: How do I find which line connected two squares?

text: In the Permissive Field of View algorithm, a destination square is _visible_ from a source square if any unobstructed line can be drawn from the source square to the destination square. The algorithm works by defining a series of view fields (essentially, triangles) and checking if the destination square exists inside of a view field. Unfortunately, the algorithm does not make available the actual line that it found between the source square and the destination square; it only tells you whether such a line is guaranteed to exist. How can I find the line, presuming it is guaranteed to exist? I've tried plotting lines between the edges of the source square to the edges of the destination square, but this apparently is just an approximation (it can fail to find the line).


title: Multi sourced search in WPF app

text: If I’m using the MVVM pattern – this one for my WPF application And my project requires a search function on different sources – say clients, accountants, cases. What would be the best way to go about it so that I only have one search view and the search results shown in the ListView are ‘dynamic’ in that they could be result for clients or accountants or cases Should I have a base search view model and specific view models for clients, accountants, cases that then somehow set as the datacontext for the search view Or try to build the grid dynamically in a code behind for the search and then somehow get the data back into the view model without the search view knowing about the view model. **For clarification** The searches are separate and will not need to be combined, I would only every return results for clients or accountants or cases.


title: Customer wants to modify the .properties files packaged in our WAR file

text: I have a customer who wants the ability to modify the .properties files packaged in the web applications WAR file so that they have the control to modify environments at settings. They will be hosting this site on their own servers so I can't say I blame them but I am a little unsure what the best course is. I would think that any adminstrator of a Java EE application server should know how to drill into the WAR package with a zip tool and find and modify the properties files themselves. I am unsure if this is common knowledge or not. I have typically always packaged my build artifacts with the property files appropriate for a given environment, but this is kind of an oddball case where WE build the WAR and hand it off to the customer. I might try to keep the property files external from the WAR but then it gets messy because of classloader issues (JBoss classloader, Tomcat classloader, etc...) I am thinking that as a convenience we maintain properties files for THEIR environments and change and build these on their requests. My manager likes this idea because it keeps us in control but the customer doesn't like this. What would you do?


title: Translate soap input of one web service into input of another

text: We need to support a legacy web service using a new web service implementation. At a given time the old input as well as new input should work. So here is what we need to achieve > Old SOAP input -> translate -> New SOAP input -> New WS -> New WS output -> > translate -> Old SOAP output. For now, I have created xslt for translating input and output But looks like that has little use if I implement a webservice to handle old input Given that we know the input and output XSD for all formats involved, how to implement a web service that will take old soap input, translate it (using XSLT) and call the new service? What tools (spring ws,cxf ..) are most suited?


title: Will they release a Wrox Box 4?

text: does anyone know if there will be a Wrox Box 4? I would love to get something like that, but the latest collection of Wrox books seems to be the release for 3.5. I really need to get up to date with the latest version of .NET. I'm not sure if there will be a Wrox Box 4 though, because it looks like Wiley is now publishing Wrox books under Wiley, and not Wrox anymore. So it looks like I'm going to have to go with Professional ASP.NET 4 in C# Instead of the Wrox Box 3.5


title: Anyone using Intel Performance Primitives library (IPP) with Delphi?

text: I'm considering purchasing the Intel Integrated Performance Primitives (IPP) library for use with my Delphi applications. I'm interested in the signal processing functions. Mainly for re-sampling and FFT. Has anyone used IPP with Delphi? How did it go? I'm wondering how easy it will be to begin using the library. I don't have any experience using non-Delphi code/libraries with Delphi.


title: How do open source projects deal with complex setup and deployment?

text: At most of my corporate clients they have very complex systems with multiple entities to be deployed and tested. (e.g. client software, user database, system, database, identity manager application, etc). They usually don't have an easy way to deploy all this. Neither in production nor for development. I wonder how open source projects/applications deal with this? Do open source projects tend to be smaller in scope therefore less complex to setup? Do they manage to avoid complexity as no-one pays for their time wasted in setup? I wonder what complex open source projects are there in terms of complexity. I thought about a couple of examples. Neither of them perfect for my purpose. **Wordpress** \- The .com site is probably quite complex in terms of deployment but AFAIK the version that can be downloaded from .org is quite simple. It cannot be distributed to multiple servers. **Wikipedia** ? Most of the software it is using is open source but it is not itself a downloadable open source project so it does not really fit. Details of their system can be found on Wikipedia **Diaspora** \- the Facebook replacement is not working yet but it might become such project. **Dreamwidth** is originally a LiveJournal fork. Dreamwidth is mostly open source. Its wiki page has information with some production notes. I got some input from them in IRC that I posted on their forum to get further clarifications. So I am interested in further examples of open source applications/system that are complex in terms of deployment and testing.


title: Performance considerations when using Go for my project

text: I'm looking at using Go (aka golang) for a project (a SQL database, but that mostly doesn't matter here) where performance is critical, but under low load the primary bottleneck will be I/O to disk. In this case, I think Go would be great! Under high load or while hitting cache a lot, CPU and memory utilization will increasingly become bottlenecks, and I'm worried that Go could make the high- end of the performance spectrum significantly lower than what C/C++/D might provide. Can anyone with experience working in Go give some insight into how quickly that bottleneck is reached (networking applications are subject to the same bottleneck, typically) and what you can do to relax it in Go other than rewriting the bottleneck in a faster language? * * * Note my question was sufficiently different that I asked it anyway after reading related question:   * What kind of software is done best with The Go Programming language? I have a specific application I'm asking about, and I've limited my concerns to performance (not usability, library support, development tools, etc).


Why doesn't Java's BigInteger class have a constructor capable of taking a numeric literal? Every single time I use BigIntegers, and many times I merely think about them, I wonder this. What reason could the designers of java have had to exclude one despite the overwhelming convenience of one should it exist?


title: Does 'Me' in VB.NET refer to the instantiated object only?

text: Does 'Me' in VB.NET refer only to an instantiation of the type? Just occurred to me that since I can reference properties in my VB.NET class without using 'Me', that I don't see a reason for using it for this purpose. Will referencing the variable either way always refer to the actual stored value for the property at runtime?


title: How get and set accessors work

text: The standard method of implementing get and set accessors in C# and VB.NET is to use a public property to set and retrieve the value of a corresponding private variable. Am I right in saying that this has no effect of different instances of a variable? By this I mean, if there are different instantiations of an object, then those instances and their properties are completely independent right? So I think my understanding is correct that setting a private variable is just a construct to be able to implement the get and set pattern? Never been 100% sure about this.


title: Are elements returned by Linq-to-Entities query streamed from the DB one at the time or are they retrieved all at once?

text: Are elements returned by Linq-to-Entities query streamed from the database one at the time ( as they are requested ) or are they retrieved all at once:                   SampleContext context = new SampleContext(); // SampleContext derives from ObjectContext         var search = context.Contacts;              foreach (var contact in search)         {            Console.WriteLine(contact.ContactID); // is each Contact retrieved from the DB                                                   // only when foreach requests it?         }      thank you in advance


title: Relation between objects

text: For a few weeks I’ve been thinking about relation between objects – not especially OOP’s objects. For instance in **C++** , we’re used to representing that by layering pointers or container of pointers in the structure that needs an access to the other object. If an object `A` needs to have an access to `B`, it’s not uncommon to find a `B *pB` in `A`. But I’m not a **C++** programmer anymore, I write programs using functional languages, and more especially in **Haskell** , which is a pure functional language. It’s possible to use pointers, references or that kind of stuff, but I feel strange with that, like “doing it the non-Haskell way”. Then I thought a bit deeper about all that relation stuff and came to the point: > _“Why do we even represent such relation by layering?_ I read some folks already thought about that (here). In my point of view, representing relations through explicit graphes is way better since it enables us to focus on the _core_ of our type, and express relations later through combinators (a bit like **SQL** does). By _core_ I mean that when we define `A`, we expect to define what `A` is _made of_ , not what it _depends on_. For instance, in a video game, if we have a type `Character`, it’s legit to talk about `Trait`, `Skill` or that kind of stuff, but is it if we talk about `Weapon` or `Items`? I’m not so sure anymore. Then:               data Character = {         chSkills :: [Skill]       , chTraits :: [Traits]       , chName   :: String       , chWeapon :: IORef Weapon -- or STRef, or whatever       , chItems  :: IORef [Item] -- ditto       }      sounds really wrong in term of design to me. I’d rather prefer something like:               data Character = {         chSkills :: [Skill]       , chTraits :: [Traits]       , chName   :: String       }          -- link our character to a Weapon using a Graph Character Weapon     -- link our character to Items using a Graph Character [Item] or that kind of stuff      Furthermore, when a day comes to add new features, we can just create new types, new graphs and link. In the first design, we’d have to break the `Character` type, or use some kind of work around to extend it. What do you think about that idea? What do you think is best to deal with that kind of issues in **Haskell** , a pure functional language?


title: What are the common approaches & practices for big applications?

text: Developing big applications requires huge effort. There may be teams for each phase of development and they must use different design patterns and go through the whole SDLC. I have two years of experience as a software developer on small applications and I'm interested on what are the common approaches & practices for big applications? Especially from a project management perspective. How can I adopt such working practices?


title: Is there a such thing as a Program Manager for Outsourcing Companies?

text: Accordingly to the first paragraph of Joel's post, a Program Manager is a very good thing to have in products. But what about having a Program Manager for a company that doesn't have a product, but have projects? The only coincidence that I'd see if you ask me and ask me to answer right away is that a Program Manager for an outsourcing company would be someone that oversees all the projects that the company have, ensuring that the things are being done aligned to the company strategy, from a technical point of view.


title: Independent Developer Pre-Coding Planning/Design/Architecture

text: For the independent developers, or the weeknight/weekend developers, when you are about to begin a large/enterprise project, what are you first steps to take when hashing out the pre-coding details and designs? What are the tools you use? Do you find it easiest to keep with the traditional mechanical pencil and pad of paper? Do you use a text editor to get your ideas and requirements in a bulleted format? Do you use UML? What my question is, is what's the first step you take when designing a large application? What medium do you use to record your notes? And when are you typically content to start writing code?


title: How to write useful Java programs without using mutable variables

text: I was reading an article about functional programming where the writer states > >     (take 25 (squares-of (integers))) >   > > Notice that it has no variables. Indeed, it has nothing more than three > functions and one constant. Try writing the squares of integers in Java > without using a variable. Oh, there’s probably a way to do it, but it > certainly isn’t natural, and it wouldn’t read as nicely as my program above. Is it possible to achieve this in Java? Supposing you are required to print the squares of first 15 integers, could you write a for or while loop without using variables? > **Mod notice** > > This question is _not_ a code golf contest. We are looking for answers that > explain the concepts involved (ideally without repeating earlier answers), > and not just for yet another piece of code.


title: Would using Quercus make my code fall under the GPL?

text: Quercus is an implementation of PHP written in Java, and released under the GPL. If I use it, does my PHP code fall under the GPL? What about my Java code? Assuming I write new Java code, and new PHP code, and use Quercus to run my PHP code on the JVM and call into my Java code, which pieces fall under the GPL? Also, assume that the result is commercial software that I want to distribute.


title: What do you think was a poor design choice in Java?

text: Java has been one of the most (the most?) popular programming languages till this day, but this also brought controversy as well. A lot of people now like to bash Java simply because "it's slow", or simply because it's not language X, for example. My question isn't related to any of these arguments at all, I simply want to know what you consider a design flaw, or a poor design choice in Java, and how it might be improved from your point of view. Something like this.


title: Obstacles to using Git Flow in Subversion

text: My team at work is starting a new project, using Subversion as our VCS (you may consider this set in stone for the purpose of this question). We're still in the early stages of the project and are trying to agree on a branching model. Our previous project was based on a non-standard version model that led to issues when managing hot-fixes and patches to existing releases. I've found different branching models to be rather complicated, but one model that I do understand fairly clearly is git flow. I'm curious how hard/undesirable it would be to implement a variation of this in Subversion. Obviously there would some difference in terms of people collaborating on branches. The feature branches would have to be centralized rather than limited to local repositories, but the other concepts of the model should be reproducable in Subversion as I understand it. What would be the drawbacks or challenges to this approach. What I've heard is that in SVN "merging is expensive" relative to Git. But I'm not completely clear on what this means in practice or how it would effect our ability to use a git flow like branching model. What would be the biggest concerns with this approach. Is there a similarly clear approach that is more natural in Subversion?


title: What is a practical level of abstraction in a web application?

text: (Originally asked on StackOverflow - http://stackoverflow.com/questions/14896121/what-is-a-practical-level-of- abstraction-in-a-web-application) I still consider myself a newcomer to OO programming, especially in php, so forgive me if I have missed some fundamental principle! Say I have an intranet application with a `staff` object with properties and methods unique to being a member of staff:               class staff {         ...         private $job_title;         private $start_date;         etc...     }      In the quest to keep the maintainable parts of my code in one place, make my data model more intelligent and make my code less tightly-coupled, is it reasonable to abstract each object property to another level? For example, I expect each property to have a `value`, but to complicate matters, I'm also interested in what `label` and `description` to use when referring to it in human-readable applications. More of interest is which `type` it is, as well as the capability of the object to validate itself, if its member properties can validate themselves also. It seems then, that properties of the majority of objects have a lot in common. So, the `$start_date` property might actually be an object in itself:               abstract class property {         public $value = NULL;         protected $label; // A simple label which can be used on user forms, reports, etc.         protected $description; // Some detail to describe what this property is used for         protected $type; // Helps choose the right HTML form control and validate user input         protected $regex; // Regular expression to prompt user entry and validate return value         protected $unique = FALSE; // If TRUE, check for duplicates in the persistence layer         protected $default_value; // Prompt the user when entering new values         protected $HTML_form_element; // Which form element suits this field best?         etc....     }          class start_date extends property {         ...         public function __construct(){             ...             $this->label = 'Start date'; // Might be an i18n entry             $this->description = 'Enter the date on which the contract starts for this staff member'; // Might be an i18n entry             $this->type = 'VARCHAR(512)'; // Better to use persistence layer's requirements?             $this->regex = '/^([0-9]{1,2})[/.-]([0-9]{1,2})[/.-]([0-9]{2,4})$/'; // UK date             $this->default_value = date('Y-m-d'); // Depends on the business policy of the company             $this->HTML_form_element= 'datepicker'; // Chooses the correct HTML element when building forms automatically             ...         }         etc...     }          class staff {         ...         public function __construct(){             ...             $start_date = new start_date();             ...         }         etc...     }      In previous applications, these related things have lived in different places; random global variables, commented code, decorator objects, a config file, embeded in HTML, a database table, a scrap of paper. It makes sense to bring all an objects properties together in one place, but is this the right way?


title: How to extract operators from the grammar productions for conflict resolution in LALR parser?

text: Is there some standardized or widely accepted algorithm for picking up operators in shift/reduce conflicts in LALR parser? The question is naive, my problem is not with implementing my solution, but implementing the solution is already widely used. For shift the operator is the next input token, for reduce, it depends -- I consider all already read symbols (for given production) declared as operators:   * if there is one -- it is the operator   * if there are more than one -- I report grammar error   * if there is none I use the input token as operator So for example:               E ::= E + E     E ::= E * E     E ::= num      in case of               E + E | * num      Considering first production I read `+`, and since it is the only one operator read I pick this one for reduce operator. `*` is the first token in input so it servers as shift operator. But is my algorithm correct (i.e. the same as normally used for LALR parsers)? I am especially worried for the point when I have more than 1 operator in the read tokens. * * * ## Update What I **NOT** am asking here I don't ask how to resolve shift/reduce conflict once you have the operators. I don't ask how to set the precedence for operators. What I **am** asking here I ask how to extract operators from the "stream" of tokens. Let's say user set some precedence rules for `+`, `-` and `*`. The stack is: `-` `E` `+` `E` and input is `E`. Or the stack is `E` and input is `*`. What is the operator for reduce in first case? And in the second? Why? _The stack is really entire right hand side of production._