What algorithms can I use to detect if articles or posts are duplicates?

I'm trying to detect if an article or forum post is a duplicate entry within the database. I've given this some thought, coming to the conclusion that someone who duplicate content will do so using one of the three (in descending difficult to detect):   1. simple copy paste the whole text   2. copy and paste parts of text merging it with their own   3. copy an article from an external site and masquerade as their own **Prepping Text For Analysis** Basically any anomalies; the goal is to make the text as "pure" as possible. For more accurate results, the text is "standardized" by:   1. Stripping duplicate white spaces and trimming leading and trailing.   2. Newlines are standardized to \n.    3. HTML tags are removed.    4. Using a RegEx called Daring Fireball URLs are stripped.    5. I use BB code in my application so that goes to.   6. (ä)ccented and foreign (besides Enlgish) are converted to their non foreign form. I store information about each article in (1) statistics table and in (2) keywords table. **(1) Statistics Table** The following statistics are stored about the textual content (much like this post)   1. text length   2. letter count   3. word count   4. sentence count   5. average words per sentence   6. automated readability index   7. gunning fog score _For European languages Coleman-Liau and Automated Readability Index should be used as they do not use syllable counting, so should produce a reasonably accurate score._ **(2) Keywords Table** The keywords are generated by excluding a huge list of stop words (common words), e.g., 'the', 'a', 'of', 'to', etc, etc. **Sample Data**   * text_length, 3963   * letter_count, 3052   * word_count, 684   * sentence_count, 33   * word_per_sentence, 21   * gunning_fog, 11.5   * auto_read_index, 9.9   * keyword 1, killed   * keyword 2, officers   * keyword 3, police It should be noted that once an article gets updated all of the above statistics are regenerated and could be completely different values. How could I use the above information to detect if an article that's being published for the first time, is already existing within the database? * * * I'm aware anything I'll design will not be perfect, the biggest risk being (1) Content that is not a duplicate will be flagged as duplicate (2) The system allows the duplicate content through. So the algorithm should generate a risk assessment number from 0 being no duplicate risk 5 being possible duplicate and 10 being duplicate. Anything above 5 then there's a good possibility that the content is duplicate. In this case the content could be flagged and linked to the article's that are possible duplicates and a human could decide whether to delete or allow. As I said before I'm storing keywords for the whole article, however I wonder if I could do the same on paragraph basis; this would also mean further separating my data in the DB but it would also make it easier for detecting (2) in my initial post. I'm thinking weighted average between the statistics, but in what order and what would be the consequences...


What is a "Business Intelligence" Developer?

What traits / skills does the Business Intelligence Developer role expect over a traditional Web Developer role?


unit/integration testing web service proxy client

I'm rewriting a PHP client/proxy library that provides an interface to a SOAP- based .Net webservice, and in the process I want to add some unit and integration tests so future modifications are less risky. The work the library I'm working on performs is to marshall the calls to the web service and do a little reorganizing of the responses to present a slightly more -object-oriented interface to the underlying service. Since this library is little else than a thin layer on top of web service calls, my basic assumption is that I'll really be writing integration tests more than unit tests - for example, I don't see any reason to mock away the web service - the work that's performed by the code I'm working on is very light; it's almost passing the response from the service right back to its consumer. Most of the calls are basic CRUD operations: CreateRole(), CreateUser(), DeleteUser(), FindUser(), &ct. I'll be starting from a known database state - the system I'm using for these tests is isolated for testing purposes, so the results will be more or less predictable. My question is this: is it natural to use web service calls to confirm the results of operations within the tests and to reset the state of the application within the scope of each test? Here's an example: One test might be createUserReturnsValidUserId() and might go like this:               public function createUserReturnsValidUserId() {        // we're assuming a global connection to the service        $newUserId = $client->CreateUser("user1");        assertNotNull($newUserId);        assertNotNull($client->FindUser($newUserId);        $client->deleteUser($newUserId);     }      So I'm creating a user, making sure I get an ID back and that it represents a user in the system, and then cleaning up after myself (so that later tests don't rely on the success or failure of this test w/r/t the number of users in the system, for example). However this still seems pretty fragile - lots of dependencies and opportunities for tests to fail and effect the results of later tests, which I definitely want to avoid. Am I missing some options of ways to decouple these tests from the system under test, or is this really the best I can do? I think this is a fairly general unit/integration testing question, but if it matters I'm using PHPUnit for the testing framework.


Usefulness of pre and post order traversal of binary trees

This may be very naive, but I was wondering, it the context of binary trees (plain, sorted and balanced), of all the traversal types:   * depth-first pre-order   * depth-first in-order   * depth-first post-order   * breadth-first what's the actual utility of pre and post-order ones? I mean, is there some type and/or configuration of binary tree in which pre and/or post-order traversal would give an(some) advantage(s) over the other two? AFAICS, there are certain types and configuration of binary trees for which in-order and breadth-first might give a certain advantage:   * for a balanced binary tree any depth-first traversal will use less memory storage space as compared to breadth first (eg. for balanced binary tree of 6 or 7 nodes, height is 2 so any depth-first traversal will need to store a max of 2 nodes at any given time, while last level has 3 or 4 nodes so breadth-first traversal would need to store up to 3 or 4 nodes at some point). In this case using in-order traversal uses the least amount of memory and visits the nodes in their natural order.   * for a non-balanced binary tree, if it's close to the worst-case insertion scenario, traversing it breadth-first would use less memory as compared to any of the depth-first traversals. So in this case breadth-first offers an advantage. In-order traversal has the again the advantage of visiting values in their natural order. However I can't think of a situation where pre and post-traversal would give an advantage over the other two.


How can I scale spring application context?

I'm currently working on a project that need to be dynamically scaled on demand according to the need. My question is about scaling spring context. My web application has a classical multi module core (service, persistence, domain), which use use by client application (webapp, api). The user end application could be clustered, database too, but I don't know how to proceed with spring context. I plan to use Scala Akka actors on Spring service, but I can't be persuaded by the solution of using one context exposed by actors. All of the rest of the application is built with event driven techniques (Spring events are produced by the service layer). I already built different webapps by user profile to scale according to user role (Eg. admin, enduser), however the only thing is Spring Context for business operations. **Question:** Do I have to merge in one single context shared by all client applications or should I initialize one context per application? > ![http://i.stack.imgur.com/0ysv7.png](http://i.stack.imgur.com/0ysv7.png)


Is there a way to play the role of Javascript with any other language like C#? One way came up in my head is, having silverlight installed, using C# instead of Javascript for all the client side scripting (Though C# is not a scripting language). Is it possible? I am not talking about something like GWT(Java) or Script#(C#). Probably the question can be stated as- "With silverlight installed, can I do everything supported by Javascript(like DOM manipulation etc) with C#?" Hope it's clearer.


Making Agile and DevOps methodology compatible with PCI requirements

Would like to hear from those working in a PCI compliance environment and is practicing agile development and devops methodology, how you maintain compliance with PCI requirements. Specifically, what do you do to address:   * separation of duties between development/test and production   * alignment of continuous integration / deployment and change control   * alignment of agile stories to requirement documentation


Does SCRUM usually involve massive overtime?

I would like to know if overtime is normal for sprints, or if it is an abuse of this methodology. I feel naive and spineless doing all-nighters if I don't have to. * * * Question is SCRUM specific. Compare methodologies.


Who gets source code access with agpl

After reading for what seems days on the specifics of GPLv3 and more specifically AGPLv3, I have one question as far as distributing and to whom. If I create a web app (server and client) for a client. They pay me, I hand over all source and ownership. The web app is currently only accessible to employees and contractors; but for the sake of argument, it could be anyone since it's on the internet. The AGPLv3 code is not modified (in this case iText), it is used to generate a PDF from other text (and all this [could] happen in its own project/dll completely separated from the main web app). To who does the source have to be released and shared with:   1. Employees   2. Any user of the app   3. Any non-employee user (clause for distribution within an organization's employees)


Model View Presenter for WebForms and Winforms

I have a windows forms project using the Model View Presenter pattern and would like to build a web forms project on top of the same MVP structure. The windows forms project knows nothing of ASP.Net Membership and just communicates via the presenter to the model and then to the business layer to do user log on/validation. In the web forms project I have created custom classes that inherit from the built in membership and role provider classes so that I can use the existing user and roles tables as well as integrate nicely with the ASP.Net login controls. However, currently I have had to reference the business layer directly in the custom membership class to validate users, so if I follow MVP, the membership code shouldn't be in the view with references to business layer, it should be in the model but that means referencing System.Web.Security in the model. Is there a way to still use ASP.Net membership with MVP where the webforms and winforms projects are built on top of the same MVP structure? I think I need to pass in the dependency on membership to the presenter and then to the model but can't quite see a clean way to do this. One of the commonly mentioned benefits of MVP is that it allows for building different UI's on top of the same presenters, models, etc. However, in practice, does this really work well or is it best to implement MVP separately per UI technology? Also in relation to the web forms project, is Session state something that the view can just deal with or does this need wrapping with a custom class and interface and passing to the presenter to maintain?


Web revisioning and the Accept-Datetime header

I have been in the process of generating documentation for an upcoming project. One of the features of the data available in this project is that it will be revisioned (or at least large parts of it will be). I came across the (as I understand it, very new) "Accept-Datetime" HTTP header. This looks absolutely perfect for enabling access to revisioned data using existing interfaces. My question is this. Which return type should be used for:   1. A date received that is before the initial data date (I am thinking maybe 404 with body error description)?   2. Data that is requested using the header, but that does not support versioning (This is the really sticky one for me. Not sure whether an error, or just the normal data is better) Edit: For the moment, in the second case, I am tentatively putting code 406 - Not Accepted


Is there a practical guide to Team Software Process?

I have seen the Carnegie Mellon site covering TSP. I am looking for a practical, non-academic guide to application of TSP in the real world. I would really like to know, how does TSP reduce bugs?


Python 3.1 books still directly applicable to learning Python 2.7?

I need to learn Python (v2.7) for my job, and looking for the best intro book for professional programmers. I found (via amazon) that "The Quick Python Book" is the best, but it's for Python 3.1 I know there's a lot of similarities in 2.7 and 3.1, and somewhere read that you can mostly use 3.1 syntax in 2.7 as a good "future practice". Can someone with experience please verify that a book for learning Python3 would still be directly applicable for 2.7? Thank you very much. edit: "The Quick Python Book" is for 3.1


How do I prevent useless content load on the page in responsive design?

In responsive design, elements are hidden in the page with `@media` queries and `display: none` in CSS. Ok. In my design however browsers that have less than `800px` in width should avoid loading some content at all. When accessed with on a device with more than 800px of screen, the page loads fully. In mobile devices or even on desktop with less than `800px` of width some content is hidden. I want to make the page load faster for low-resolution devices and avoid loading chunks of content that the user will never see. How can I go about this?


Bug severity classification issues

In a book I have, there is a following classification of defect:   1. Critical : A defect receives a “critical” severity level if one or more critical system functionalities are impaired by a defect with is impaired and there is no workaround.   2. High: A defect receives a “high” severity level if some fundamental system functionalities are impaired but a workaround exists.   3. Medium: A defect receives a “medium” severity level if no critical functionality is impaired and a workaround exists for the defect.   4. Low: A defect receives a “low” severity level if the problem involves a cosmetic feature of the system. To be honest, I do not get it.. For example point 2. What if fundamental but not critical feature is impaired and there is NOT a workaround. The same for point 3: what if no critical functionality is affected but there is no workaround? E.g. optional field in the registration form does not work. No workaround but barely an issue.


In good Scrum, when and how should the ideation and story writing occur?

It seems like most of the Scrum articles and books that I've read as well as the lectures I've heard have very little to say about the process of creating the items on the backlog. How should a team on a medium or large project (i.e. more than a few team members) go about creating and detailing the items on the backlog? When and how should the ideation and story writing occur? Who should be involved and when? When should team members (other than the product owner, of course) join the process? How much of the team is needed? Note that I am not asking about how a small group would create a user story or other backlog item from ideas. I'm asking more about when and how this ideation and story writing should occur and who should be involved. How can we be more Agile in the ideating/story writing stages?


Should website frontends be rendered in client-side or server-side?

I've been talking to a colleague that comes from `AS3` to the `HTML` world. He has created a small website (there are apparently no dynamic contents) following the no-flash rules for his very first time, and as if you own a hammer you tend to hammer everything, he decided to create a framework in `JavaScript`, so he could do all "the `AS3` way", with frames, pure X-Y coordinates animation and so, to animate contents. The page would be fully loaded at first, load the vast amount of JS at first and then the page would be accessible without changing url. Views would turn into class methods (where the class represents a section, and the method stands for a view) which append text to a variable that is then added to a div. He defends this situation with many reasons:   * Websites with a high amount of users do this to prevent server overloading.   * It is easier to create new sections.   * It is easier to translate, as translations, texts and almost everything is loaded from a `JSON`.   * You can expand more sections directly from a `JSON` file.   * Everything is smooth, as you don't move to another page. Now, here comes the PHP-loyal developer, which defends the opposite side. I say that views should be split into smaller files but contained in `.php` or even `.html` files, with the business logic in a controller and the view logic in these files. This releases the client, as it can disable `JavaScript` and still show the content without a matter. Of course your server needs to make calculations, but it's just rendering files. Some benefits could be:   * You don't need to load the whole website at first. Webpages loaded faster.   * Your urls are always clean and (in case you did so) friendly, without plugins and working seamlessly in old browsers, as you move to another page.   * Views are kept in independent files, so it is easier to work with them in a team.   * Views are regular `html` files, instead of calls to methods appending strings, so editing them is just natural.   * You still need `PHP` (or any other language) to load data from a server (NodeJS not considered here) And, of course, here comes the real question. **Should views be rendered on client or server side?**


Would Task-based programming in C++ require new language standard features?

So I saw this video on Youtube with all these C++ masters on GoingNative 2012 : Interactive panel where everybody could ask the questions. This is the video I was talking about: GoingNative 2012 - Day 1 - Interactive Panel: The importance of being native And at time 0:24:00 someone put a very interesting question: > We've been doing concurrent programming for some time using pthreads, using > windows threads, and so on and I'm so happy that C++ and C caught up with > concurrent programming, but it seems to me like it's already behind by five > years or ten years because right now we have we have all these powerful > multicores and the programming of these multicores really should not be > based on threads, it should be task-based [...] and Microsoft has the _PPL > library_ and so on and this is totally not reflecting in the C++ standard. > [...] The only thing I'm afraid of is that the standard could be locked into > threads and sort of make it very difficult to move to _Task-Based > Programming_... Now I'm quite new to these concepts and I'm a little confused. What is actually _Task-Based Programming_. Does this term refer to the same thing that _Lock-Free Programming_ refers to? Are these two equivalent terms or are there any links between them?


Do you allow presentation layer code to be deployed outside of a build cycle?

For any standard web project you will have server-side code, server pages, JavaScript and CSS files as your code assets. It's pretty standard practice for server-side code to have a test suite and a scripted build process to compile/package/deploy code. Builds usually go on a schedule after code has been tested and validated in a QA environment. On the flip side, we frequently have a requirements to be able to push presentation layer code assets at will. Since they don't require compilation or restarts, this is feasible, but I'm of the mind that this code is coupled to the server-side code and is equally likely to destroy the whole site if it's broken. Therefore, it should never be pushed outside of a build cycle. What is considered best practice for this?


Shift bytes through a fixed sized buffer

I'm writing an `InputStream` that processes data streams containing "trailer" data. That is, the final **_n_** bytes of the stream is a piece of data that must be handled separately and shouldn't be returned from the `read` methods. My class will maintain an internal byte array of length **_n_** and read data into this byte array from the underlying stream. Data will then be popped from the front of the buffer to service the requests to `read`. Implementing the `int read()` method is simple enough - I just call the same method on the underlying stream, shift my byte array by 1 and pop the result to the caller. Implementing `int read(byte[] b)` is more challenging as it requires shifting a large number of bytes through my **_n_** -byte buffer, whilst popping and collating the bytes from the front. Essentially a "sliding window" buffer, always containing the last **_n_** bytes from my underlying stream. I get the feeling I'm re-inventing the wheel if I start coding this from scratch. Can anyone suggest if I've overlooked an existing `InputStream` or `Queue` implementation that would be well suited to this task?


Database in the cloud?

Some of my recent clients are asking for remote connections to the office server, for standalone work, etc, in winForm applications. Since the concept of the web is remote connection to a server both of data and resources, it should be possible to place both of this in cloud and have the winForm apps connect to it as if web Apps. As any one tested this, is working like this? Is it fast enough? Is it secure? What is the best cloud host for this type of work ?


Deploy multiple emails to email providers, but without showing favouritism

We are currently developing a new email deployment system. We have the system currently configured so that it reads a record from the database and loads the email content and deploys it to the target. Now we want to move this over to multiple threads. That is easily done, except we then hit the email providers returning SMTP codes referring to "Too many connections", or "Deferred connection". The solution to this is to have a thread open up a connection to the email provider and deploy _n_ emails and then disconnect. We have currently configured the application so that it will support these _session_ based email deployments. The problem is this, the database table has multiple email addresses in and they aren't grouped by email provider because that will show favouritism. We need to be able to retrieve a set number of, i.e. Hotmail, emails (@hotmail.com, @hotmail.co.uk, @live.co.uk) so that we are reducing the number of connections to Hotmail and reducing the risks of getting the "Too many connections" error. We are at the point now where we have gone round and round in circles trying to get a solution, so I thought I'd throw it out there and see if anyone has any ideas? **EDIT** I would like to stress that this application is not used for spamming purposes.


Fast algorithm to search a sorted array of floats to find the pair of floats bracketing an input value

I have an array of floats, sorted from smallest to largest, and need to be able to pick out the nearest float greater than or less than a passed input value. This input value is not necessarily present as a value in the array. A naive approach would be to do a simple linear search through the array. That might look like this:               void FindClosestFloatsInArray( float input, std::vector<float> array,                                     float *min_out, float *max_out )     {         assert( input >= array[0] && input < array[ array.size()-1 ] );         for( int i = 1; i < array.size(); i++ )         {             if ( array[i] >= input )             {                 *min = array[i-1];                 *max = array[i];             }         }     }      But obviously as the array gets larger, this will become slower and slower. Does anyone have an idea about an algorithm that would let me find this data more optimally? I've already switched to a binary search, which has improved matters somewhat, but it's still a lot slower than I'd like, and since I'm not actually looking for a specific value that exists in the array, it can never terminate early. More information: The floating point values in the array are not necessarily distributed evenly (that is, the array could consist of the values "1.f, 2.f, 3.f, 4.f, 100.f, 1200.f, 1203.f, 1400.f". I'm doing this operation hundreds of thousands of times, but I can do any amount of pre-processing on the array of floats, if it'll improve the lookup time. I absolutely can change to use something other than a vector to store them, if that'll help.


What is the standard /an acceptable period of time to support a particular version of software?

Let's say version 2.4.x of Software Package X was released 2 years ago, and was sold up until about 6 months ago. Version 3.1.0 is now out (which fixes a lot of the issues with version 2.4.x), and is the only version actively being sold. In this case, the software is being sold to large businesses, not individuals, so the maintenance effort required is substantial. For how long should the company offer support for version 2.4.x?


How do web services for downloading ringtones work?

I am interested in knowing more about how ringtone download web services work. I do web programming in java, and i would like to make a web service that sends a ringtone to the user's mobile phone when the user sends a SMS to the web service.   * Is anyone familiar with this type of service?   * What do I need to be able to create somethig like that?   * Does the ringtone system get some profit for each SMS, or does the mobile company get all of it?


how could I draw the database transaction commit in the sequence diagram

How could I draw the database transaction commit in the sequence diagram? EDIT I want to draw in sequence diagram database transaction commit/rollback process


Is this a Proper "Rule" for Identifying the "Big O" Notation of an Algorithm?

I've been learning more about Big O Notation and how to calculate it based on how an algorithm is written. I came across an interesting set of "rules" for calculating an algorithms Big O notation and I wanted to see if I'm on the right track or way off. **Big O Notation: N**               function(n) {         For(var a = 0; i <= n; i++) { // It's N because it's just a single loop             // Do stuff         }     }      **Big O Notation: N 2**               function(n, b) {         For(var a = 0; a <= n; a++) {             For(var c = 0; i <= b; c++) { // It's N squared because it's two nested loops                 // Do stuff             }         }     }      **Big O Notation: 2N**               function(n, b) {         For(var a = 0; a <= n; a++) {             // Do stuff         }         For(var c = 0; i <= b; c++) { // It's 2N the loops are outside each other             // Do stuff         }     }      **Big O Notation: NLogN**               function(n) {         n.sort(); // The NLogN comes from the sort?         For(var a = 0; i <= n; i++) {             // Do stuff         }     }      Are my examples and the subsequent notation correct? Are there additional notations I should be aware of?


In plain English, what is a database index most similar to?

**Setup** : Suppose you are teaching an introduction to Databases class, the students are CS students that have a working knowledge of tree structures, how they can speed up searches, and have probably implemented a few in their lifetime. **Question** : How would you describe the way in which a database uses indexes to search a table for a set of keys? What structure is a database index most similar to? **Bonus** : How does someone write a SQL query where clause to take advantage of the searching capability of the index they design on a given table? Answers should correspond to all database products as a whole. I'm looking for general tips which allow faster searching on all databases. Plain english descriptions please, no code, Big O searching descriptions are fine. This question might be too specific for this site, I considered asking on StackExchange but since I'm requesting a plain english description of a broad concept I thought this site would be Ok.


Meaning of MIT license

Suppose I use this ActionScript API released under MIT license to build a software: http://www.cove.org/ape/docs/api/   1. Can I sell that software?   2. Do I need to give the source code of my software away?   3. Is anyone receiving my software permitted to resell the software?


How to implement a system to hide spammed user content?

I'm trying to work out a good way to manage user submitted content and create a method to determine when spammed/poor content should be hidden. The aim is to create comment voting similar to youtubes like/dislike comments and if the score is good show the comments, else they're invisible. **Approach** My thought is to do this via the comments table, you could create two columns rateup, ratedown. For each rate up the comment gets the **rateup** colulmn is: rateup = rateup + 1 and the same for the **ratedown** : ratedown = ratedown + 1 You can then put a clause into your database query to only select comments if their rateup ratio is greater than a number, say -5:               WHERE (rateup - ratedown) > -5       but this would need a lot of voting up and down if a user posts many spam/poor content posts over the site? To strengthen the approach I could add the same two columns to the user table and also update these columns to give an overlal view of the users combined content submission ratio and then display comments like so:               WHERE ((comment.rateup - comment.ratedown) > -5 ) && ((user.rateup - user.ratedown) > -5 )      **Issues** Would this approach lead to instances of users creating mass fake accounts to attack good users and ruin their reputation? What other methods could I use to help hide spammed/poor content without moderators having to manually go through everything?


Does Play framework approach necessarily leads to confuse code?

I want to start a new project and I just got in touch with Play framework, which has a ruby on rails -like approach that called my attention. I am not an expert in rails, but I think that the productivity in these frameworks are great. I am following some tutorials but I am wondering: Play has the Model, which is used to populate the view but also used to perform DB queries. I find that somehow awkward, but I noticed that rails has also this approach. I wonder if using the same entity for Object Relational Mapping and to populate the view may cause troubles. Here are two examples I can think of:   * My view required only a name and an ID from a big entity   * My view requires information from different entities For the second case, I suppose I would be able to perform a join. But it seems somehow messy: joins in my controller, DB entities being used to populate views. Am I missing some point here? I mean, these frameworks seem great and I would like to use them, but I wonder if my code wound turn into an spaghetti code. It seems to be on the opposing direction of I learned about separation of concerns. If I separate in a layered architecture (models for my views, business logic layer and DAO layers), should I keep using play or should I move to something different like Spring?


How can Scrum be adapted to an academic environment?

I'm currently working with a professor at my university to develop new curricula for the Software Engineering and Capstone Design courses offered in my college. Up until recently, both courses used the waterfall model exclusively, and thus students spent a majority of their time writing lengthy reports. After much pressure from me, my professor decided to include Scrum in the Software Engineering curriculum this past semester. The first half of the semester was still waterfall-esque, with students writing 40-page design reports and software specification documents. Mid- semester, all teams were required to release a demo of their applications. At that point, the course switched to Scrum, with two 3-week sprints. We are now trying to figure out how to eliminate waterfall altogether and create an exclusively Scrum-based curriculum. Unfortunately, we encountered a few incompatibilities between Scrum and the students:   * Daily Scrum meetings are nearly impossible for students. Even during the class itself, it's inconvenient for students to hold Scrum meetings since the professor is usually lecturing.   * Estimating points/hours is difficult, since students are inexperienced and therefore can't accurately predict how long something will take.   * Scrum works best with full-time, co-located developers, but students are neither. At most, students dedicate 15-20 hours per week to the course, and organizing work meetings can be extremely difficult. Teams can have up to 10 students (and there's always one or two slackers).   * Professors crave documentation! I haven't heard of any Scrum reports—just the backlogs and burndown charts (which I'm not sure will be enough to appease the academics).   * Students often assume that agile means "Jump right in and start coding without looking back". This leads to some of the most horrible code imaginable. Therefore, I'm looking for a way to enforce proper design without requiring a 50-page document or a pile of UML diagrams. Given these problems, how do you think my professor and I can adapt Scrum to function in an academic environment (and should we even bother with Scrum in the first place)? Also, is there still value to teaching the waterfall model? Thanks in advance for any feedback!


Difference between "String" and "string" in .NET and which is best?

In the .NET Framework, at least in the C# language, we have two "versions" of the string type:   * "string"   * "String" It appears that they are interchangeable, but are they really? If they are not interchangeable, is it generally better to use one instead of the other, and under what circumstances?


Is it safe to install TortoiseSVN on production servers?

Small shop, few production servers, no test or development servers, all Win2k3 WEB based. There is a need to keep versioned files on one of the machines. Is TortoiseSVN safe against exploitability, does it need extra hardening? Any known license problems, incompatibilities?


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

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


Separating model from UI

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


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

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


How can I reduce my problem into Max flow problem?

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


Java devs: why not use Groovy?

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


How to speed up PHP powered websites?

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


Many small classes vs. logical (but) intricate inheritance

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


Naming of types, classes and exceptions sometimes go wrong

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


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

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


About the book "Peopleware - Productive Projects and Teams"

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


Separate Pages Separate Loads?

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


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

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


What pitfalls are inherent in using partial classes?

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


Subversion Tools To Help With Branching and Merging

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


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

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


Dual licensing with GPL library

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


Creating an interface of interfaces

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


best (web) architecture for my project

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


Making Simple IF Statements Shorter

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


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

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


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

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


Modify then sell another person's code

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


What is a good measure of testing/tester efficiency?

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


MongoDB: Is this a good schema design?

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


Pointers for transitioning from SOAP to REST based services

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


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

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


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

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


Which design pattern is more suitable for logging?

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


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

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


How can I automate production deployments without experiencing extreme anxiety?

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


What is the point of the string.Empty property

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


Is Programming generally an overtime exempt field?

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


Developing Salesforce apps in Ruby on Rails

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


Query something and return the reason if nothing has been found

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


Could Ruby on Rails have been created in another language?

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


Organizing uncommented, dirty code?

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


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

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


python random with a skew

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


LGPL 2.1 vs LGPL 3.0 Advantages and Disadvantages

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


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

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


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

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


How fast can Go go?

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


How do you compress ASCII strings into smaller bytes?

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


How to abstract transition between Views?

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


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

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


Can being funny hurt your promotion opportunities?

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


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

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


Does this Relational Database Model make sense?

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


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

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


Automating release management and CI on python projects under mercurial VCS

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


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

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


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

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


How much to "automatically" do?

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


What to do when time estimation goes wrong?

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


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

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


Google Chrome Extension Development for Dummies?

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


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

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


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

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


Terms for different types of development

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


How to encapsulate method parameters in Java?

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


Phenotropic Program Design

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


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

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


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

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


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

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


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

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


Testing multi-threaded race conditions

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


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

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


From where is a DES key generated?

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