title: Difference between these 3 manager roles

text: Roles:   * Development Manager   * Program Manager   * Project Manager I have read a bit and independently I understand them well enough. However when you combine them, it seems to me that some responsibilities overlap and it becomes uncertain who is responsible for what. Does anyone have a clear way of defining how each role differentiate from the other? Or mainly which tasks are exclusive to each one? I want to avoid overlapping of responsibilities. I know there are other similar questions on the matter, but none exactly the same... Thanks EDIT: This 2 questions help a little, but still can't quite place each role when pushed together: What is the difference between a Program Manager and a Project Manager? The Written Roles of Software Development Manager


title: How popular is ITIL in the rest of the world?

text: I am sorry if this question is not 100% Programming wise, I just didn't know where to ask. Consider yourself lucky if you don't know what ITIL is. You can understand from my tone I don't like it - I find ITIL the complete opposite of how IT Company should work, being too bureaucratic and complicated. In Germany, where I work, it seems to be very popular, and I have been asked in several job interviews if I know ITIL. Do you know popular is it in the rest of the world? Should I worry about ITIL or I can snub it? I must also ask my European colleagues - Why do you think is ITIL so popular? Is there a strong **empirical** evidence that ITIL does work?   By empirical, I mean not personal experiences of the kind "We are a company that is working with ITIL...". I can hardly imagine a multi-million dollar company like Apple or Google work with ITIL, but I can also hardly see how it can benefit small companies...


title: Do VMs use one stack for everything?

text: Most VMs have a "call stack" to keep track of where to return from each function that was called. This is often simply regarded as "the stack". However often a stack is needed for operations that aren't related to function calling, such as performing arithmetic. My question is: is the same stack (i.e. the call stack) used also for these kinds of operations? Or do operations such as performing arithmetic use a different stack? (I'm talking about most VMs).


title: Light-weight visual requirements tool (combination of mockups and use cases)

text: For my team, mockups are the primary artifact for development and the requirements process. We use balsamiq mockups for confluence. We also write use-cases to point out the workflow and for adding information such as how the system will respond to an action, UX requirements and other references. It's not ideal, because the documents are separate. We're looking for a tool that's entirely mockup-based, with structured contextual texts to the side for requirements, system response, etc. (note: I know I can add annotations, what I'm looking for is structured entry and structured presentation of requirements). It should also visualize the flow and states of pages in the form of a storyboard. Does such a tool exist and could you recommend one to me? Thanks! Rolf


title: A completely free and open programming language

text: With Oracle vs Google trial, it seems that Java is not entirely Open and free (as free software) as I expected. Although there exists completely free/open JVM, it's hard to know what is a copyright infringement with Java, and what is not. So I'd like to know if there is a completely Open and free language with open and free IDE (Eclipse-like) out there, Object Oriented if possible, and able to make window-based applications for the main OSs (Linux, Mac, Windows).


title: today's multi-device world for web development

text: With the huge explosion of mobile devices and addition of HTML5/CSS3, there seems to be a shift towards "responsive" designs (i.e., adapting to smaller screen sizes) which seems to be achieved using CSS3's Media Queries. My question is, given the current need of adapting to both desktop and mobile, is it common practice to actually organize two versions of your website (one for desktop and one for mobile)? Or is there just one version with different css files for targeting different devices and screens? Handling just cross-browser (ie6, ff3, opera9, etc...) HTML4/5, CSS2/3 was already hard enough, but now we're expected to handle cross-device (phone, tablet, etc...) as well, so my assumption is company's would create a separate project for mobile and redirect based on the user agent, but this is just a guess.


title: Programming vs Engineering

text: I am in high school at the moment and soon reaching stages where I would have to make choices. To introduce, I love programming. I had started learning programming a year ago and have some experience with ActionScript3 and Java + (the web languages like html CSS JavaScript. But php I have found a bit hard to understand). Other subjects which I absolutely love are mathematics, physics and chemistry. The professions related with these subjects that really interest me are engineering (piping engineer, mechanical engineer, electrical engineer etc.). People say to me that I should choose the profession based on my interests. But I have absolutely no preference of one over another. My choice really depends on the demand of these professions in future. So my questions are -   * Is the demand of programming going to degrade in future due to a excessive number of programmers in future? Or is it going to remain a profession in high demand.   * Is engineering going to lose its demand? Almost everybody seems to be going for the profession of an engineer these days and it is scary to think what will happen of the world with the number of engineers there are.   * Which profession is likely to remain well paid in future too?


title: Development setup for TDD. Is it correct?

text: This is how my team has it's development environment set up:   1. Each team member has a local development environment on their own computer, where they check out the code from a shared repository.   2. Every developer work in their local development environment, once they finished writing the code they commit back.   3. The code is then checked out to a staging/testing server with the same environment setup   4. If everything is OK, it will be pushed to a production server. We're trying to integrate unit testing and BDD (behavior driven development) into this setup and we'd like to use a continuous integration server (Jenkins) too. My question is where should we install this and where should we test the code?   1. Install the full testing stack for each developer: TDD tools + BDD tools + Jenkins?   2. Install the test tools only on the staging/testing server and only test code here once each developer made his/her code commit? How is your setup?


title: How to quickly try out Java code?

text: When I'm coding in Python and I want to try something out, I open IDLE of Python on the command line and am able to quickly try something out. Is there a similar way I could do that for Java? I have heard about Java "shells" (e.g. http://www.beanshell.org/). Has anyone tried them?


title: Implementing a Service Layer with MVC4 while honoring Single Responsibility

text: I'm trying to learn some best practices while I ramp up on MVC4. I have a solution with three projects:   1. Web: MVC stuff   2. Core: Data Model   3. Tests: Testing classes I'm now trying to add:   1. Services: Business Logic This will take logic such as "GetFilteredItems()" from my controllers and place them into a Service project, which depends on Core, and upon which Web depends. Nothing to do with HTTP requests. As I'm beginning to do this, I want to honor single responsibility and create one class per method. My questions: 1) Is this a good approach? 2) Say I need a GetFilteredItems method that takes an ID and returns a List. What's the convention here in terms of naming classes and methods? I can't have a class SampleClass with a method SampleClass() that returns something, right?


title: programming on handheld devices

text: This is a little vague. But I've tried to put the things to the point. As much as the handhelds (smartphones, tablets) are becoming extremely popular every passing day, What I wonder is, why there are no great programming tools for them? With great processing power of these devices, I don't think there's any problem in running compilers or even small scale IDEs on them. It is perfectly acceptable that conventional programming languages are very difficult to write with an onscreen small keyboard. I'd never want to write java on my Android. But are there any special tools or languages that are being developed in this direction? For exaple, I had an android application for BrainF**k that worked fine with limited number of symbols (though the language itself is boring enough for not using it). What in general is the scope of this area and direction of the research if any? Thank You. EDIT Note that I mean programming ON mobile devices. Not FOR mobile devices.


title: Centralised Integration framework

text: We are looking to centralise our Integration in our company and I'm wondering what sort of solutions other have for this and what the best way to approach it would be. At the moment we have different types on integration running different lanuages, different frameworks on different servers so we are looking to move them all to a single framework to make it easier to manage. Some of the current Integration includes:   * SQL Server scheduled tasks (on 3 or 4 servers)   * SQL Server Integration services (on 2 or 3 servers)   * Console applications (.NET on 2 Servers)   * Windows Services (.NET on 2 servers) What we are after is:   * 1 server that manages all integration jobs scheduling (so this only needs to be setup once and we always know where to find it)   * A job monitor that displays the history of jobs run (Much like the SQL Server Job Activity monitor)   * Jobs might need to run custom .NET code, here some sort of API might be used to allow for more flexibility over SQL Server Integration Services


title: Reading recommendations on development of web applications

text: For a programmer/cs student that wishes to dive into web development and freelancing... what are some good books/publications/portals/blogs? Please take into consideration also that I'm used to developing websites by googling my each step to find an example. I'm interested in technologies like php, javascript, jquery, ajax.. And maybe later: ruby and ror. It would be great if there would exist a book (or a collection of books) on web development that would cover the whole process of development, plus different techniques, principles, examples.. etc.


title: Is it acceptable practice to give an object a pointer to “the world”?

text: I often find myself in situations where objects need to communicate between each other. For example, a button might need to talk to various textboxes. Would it be proper to simply construct each widget with a pointer to the container for all of them? Would it be better to give it a pointer to a resource container map where the object can locate another object by string or something? This area has always been very vague to me. I could easily implement everything I want to do if I just constructed objects with pointers to containers of every other object, but that seems wrong. In the case of a widget, would it actually just be more proper if the widget knew nothing about the outside world and instead its action listeners were constructed with resource access? Thanks I understand that it is a bad idea but what are some solutions in these situations eg: good design patterns for gui oriented software? If a button's click needs to write a file, how can that be done in a clean way? Action Listeners? But where do they get created and by what?


title: How much web-design work should a web programmer commit?

text: I'm creating a website for a friend of mine, and the plan is to eventually solicit outside sources to take care of the overall design. So it's got me wondering, how much design should I be covering now? I'm primarily driven to just code the logic for the website and get everything _functional_ before I care too much about how it actually looks. My thoughts so far have been, I'll try to organize the code and create an effective skeleton to be drawn in. What's your thoughts? Is usability and functionality my only two concerns, or should I also be playing a preemptive role in the design decisions? How is this work typically split up in the industry?


title: Proving Yourself

text: I guess it isn't that common but occasionally there are some software developers who didn't actually go to college and just spent their teens hacking away at pet projects and learned enough to work out of high school. My question is if you were hiring a candidate how would you determine if someone who didn't go to a university but is claiming to be (more than)proficient and fully able to develop software just as well as a student with a degree? What do you look for? What would you want to see from this person that would put them at or above the level of a college grad when it comes to hiring?


title: How to deal with a dev who asks too many questions

text: I've recently stepped in to a managing position which of course involves overseeing other people's work, and guiding juniors. There's this guy who won't stop asking questions, and many times it's really basic stuff - which eats a lot of my time and breaks my in-the-zone mode. I tried the easy-going approach of sending him a link with "Let me Google that for you", but he only got excited about the joke, and didn't get the clue. Other times I'm just telling him I'm busy, and that he should go and research it himself. The thing is, when I wasn't in the office he did a decent job on his own, so most of what he's assigned with he can handle. The question is how can I make him filter the issues he comes to me with? I realize that I'm the professional authority he should be addressing when he needs help, I only wish he would do it on non-trivial matters.


title: Is the jRails Project something I should use?

text: The jRails project is a drop in replacement for the Prototype/scriptalicious helpers already a part of the Rails framework. Are your experiences with this project positive? Does it do what it says on the tin? Is it still being maintained or is this a bad choice if I want to do jQuery with RoR?


title: OOP - Composition, Components and Composites Example?

text: I've been reading a bit about OOP in relation to Composition, Components and Composites. I believe I understand the fundamental principle (not sure). Can someone please provide a code example of a person or car (both have many properties) using Composition, Components and Composites? I think seeing it in code would clear up the confusion I have regarding this pattern. Preferably in Java or PHP.


title: Ensuring transactional consistency with DDD

text: I am starting out with DDD and understand that aggregate roots are used to ensure transnational consistency. We should not modify multiple aggregates in one application service. I would like to know however how to deal with the following situation. I have an aggregate root called Products. There is also an aggregate root called Group. Both have Id's, and can be edited independently. Multiple Products can point to the same Group. I have an application service that can change a product's group: `ProductService.ChangeProductGroup(string productId, string groupId)`   1. Check group exists   2. Get product from repository   3. Set its group   4. Write the product back to repository I also have an application service where the group can be deleted: `GroupService.DeleteGroup(string groupId)` 1\. Get products from repository whose groupId is set to provided groupId, ensure count is 0 or abort 2\. Delete group from groups repository 3\. Save changes My question is the following scenario, what would happen if: In the ProductService.ChangeProductGroup, we check the group exists (it does), then just after this check a separate user deletes the productGroup (via the other GroupService.DeleteGroup). In this case we set a reference to a product which has just been deleted? Is this a flaw in my design in that i should use a different domain design (adding additional elements if necessary), or would i have to use transactions?


title: How can I get my progress reviewed as a solo junior developer

text: I am currently working for a 2 person company, as the solo primary developer. My boss gets the clients, mocks up some png design templates and hands them over to me. This system has been working fine and i'm really enjoying it. The types of projects I work on are for small - medium sized businesses and they usually want a CMS system. Developed from scratch i'll build a customised backend for the client to add/edit/remove categories, tags, products etc and then output them to the front end according to the design template handed to me. As time has gone on, the projects have increased in complexity, with shopping cart / ordering features and other common e-commerce type features. Again, this system has been working fine and i'm really enjoying it. My issue is my personal development as a programmer. I spend a lot of my spare time reading programming blogs, checking through stackexchange, reading suggested programming books (currently on 'The Pragmatic Programmer', really good so far), doing brain exercises (lumosity.com and khanacademy math problems), doing lots of physical exercise and other personal development type activities. I can't help but feel though, that I'm missing out on feedback, critique. My boss is great and never holds back on praise in regards to my work, but he unfortunately is either to busy to check my code, or to be honest, I don't think it's one of his specialties and so can't provide feedback. I want to know what i'm doing wrong and what i'm doing right. Should I be putting that much logic in the controller, am I modulating my code enough etc. So what I have done is developed a little 'Family Budgeting' app and tried to do it as cleanly and effectively as I currently know how. What i'm wanting to know is, is there somewhere I can submit this app, and have some seasoned developers provide feedback. It's not just a subsection of my code like 'codereview.stackexchange' appears to require, it's my entire workflow that I want critiqued. I know this is a lot to ask, and I expect the main advice given will be to look for a job within a team, which is certainly something I will look into later down the track, but for now I want to persist with my current employment situation, but just don't want to develop too many bad habits. Let me know if I can provide any further information to help clarify, or if this isn't the right place for this type of question I apologise in advance. Didn't want to use reddit as I felt this community fosters more well thought out responses.


title: Can I Put My Past Company's Project in my Resume?

text: I am building my resume now but I am unsure if I am allowed to put my past company's project in the Project's section of my resume. I am not planning on disclosing proprietary details, just the name and the description of the project (if the name doesn't count as proprietary). Thanks!


title: How do I convince my team to use smaller classes/methods?

text: Disclaimer: I'm a newcomer (this is my third day of work), and most of my teammates are more experienced than me. When I look at our code, I see some code smells and bad engineering practices, like the following:   * Somewhat inconsistent naming guidelines   * Properties not marked as readonly when possible   * Large classes - I noticed a utility class that consisted of hundreds of extension methods (for many types). It was more than 2500 lines long!   * Large methods - I'm trying to refactor a method which is 150 lines long. The latter two seem to be a real problem. I want to convince my teammates to use smaller classes and methods. But should I do that? If yes, then how? My team got a mentor from the main team (we're a satellite team). Should I go to him first? * * * **UPDATE** : Since some responses asked about the project, please know that it's a working project. And IMHO, huge classes/methods of that size are always bad. Anyways, I never want to piss my team off. That's why I asked - Should I do that, and if yes, then how I do that gently? **UPDATE** : I decided to do something based on accepted answer: because I'm newcomer, so I see everything in "fresh eyes" I will take note on all code smells that I found (position, why it bad, how can we do it better,...), but at the moment, I just try hard to gather respects from my team: write "better code", know people, know why did we do that... When the time is right, I will try to ask my team about some new code-policies (naming guidelines, smaller classes, smaller methods,...), and if possible, refactor some old code. It should work, IMHO. Thank you.


title: Best practice to prevent potential paying customers from creating many trial accounts

text: I have an idea for a web app, and I want to make it a freemium service. Those who sign up will have the ability to create 3 pieces of content for free and will be required to pay a premium to obtain the ability to create further content. Provided that the two account types will have identical behaviors except for the quantity of content, what is the best way to prevent these users from circumventing my pricing plan and creating tonnes of trial accounts? Have you thought about this before? What do you do on your web app? I could monitor email addresses, IP addresses, phone numbers, etc., but all of these are easily circumventable. Thoughts?


title: which input sanitization function is better?

text: apparently, some of our websites have been hacked by a hack bot. The reason: bad input sanitzation. Our boss is giving us this file to put on all our servers to secure them: http://pastebin.com/0gJ19TQG Personally, i just do this on my personal websites: `filter_var(mysql_real_escape_string($_POST['Nom']), FILTER_SANITIZE_STRING);`. So you tell me, which one is better and why?


title: Can you prototype a complex system change?

text: I'm currently in the process of redesigning parts of a large and complex application server to allow it to be distributed across multiple machines. I've been asked to provide a prototype of the redesign in a relatively short time period. I don't think it's possible to create a prototype of this; the changes are in existing code, and the changes are at such a low level that the system can only be in one of two states: working or not working. There's no middle ground. The changes have to be implemented all at once, because they all rely on each other. There's no way to partially implement all of the changes, the system won't work unless they're all fully implemented. At this point, I'm unsure of what to do. I know that it's hard for others to tell without knowing every detail, but on a generic level, am I right in that something like this can't be prototyped? Is there some way to prototype things like this that I don't know about?


title: REST Relationships Besides Parent/Child

text: This would seem to be a pretty basic question, but I can't seem to find appropraite guidelines for it. What is the "restful" way of `POST`ing a relationship between two entities that are not necessarily parent/child. As an example, consider customers and orders. One could create a customer with a `POST` to `/customer`. However, what is the best way to create the order? One example would be a `POST` to `/customer/123/order`, but what if the order isn't assigned to a customer directly, and could exist on its own (in the case of a web-cart that allows for "anonymous" checkout)? Is the right way, then, to do `POST /order?customerId=123` Further, consider the case that an order can be submitted separately from payments (let's say we are invoicing a customer). You could create the order (per either of the methods above), but how would we make the payment? `POST /order/123/payment` or `POST /payment?orderId=123` (if we assume that a payment can be made for something other than an order, and one might want to get information about an order/payment without knowing the specific customer).


title: Are certifications through O'Reilly worthwhile?

text: Other than being able to put "I know Python" on a resume, are the certifications from O'Reilly School of Technology (they are issued by the University of Illinois) any good for obtaining employment? I am interested in learning many of the topics covered by these programs and since they are fairly well-priced, I was thinking of going this route. However, I don't really want to do it if it's about as worthwhile as a degree from University of Phoenix. Does anyone know what effect these certs may have on obtaining employment vs not obtaining a certification, but learning on your own?


title: The need for source control software - Team Foundation Server? or something different?

text: Recently, Here at the company, more than one programmer was appointed in charge for a LightSwitch(C#) software development project and immediately there was a need of some sort of source control/sync. We have never used Team Foundation Server but we'd gladly use it if it's worth it.   * Is it the right tool to use for   synchronising code between   programmers?   * Does it have the needed features?   * Do you have any other tool in mind? (I have used TortoiseSVN but   it was too simple and 'texty' if you know what I mean, we need a   professional tool)   * What other features does Team Foundation has that we can use? (if you did not understand any of the above please ask me to clarify further)


title: Seeking LOC counter with estmated cost to write those LOCs

text: I had one (Linux only) and I lost it. I'd like another, either Windows or Linux will do. Please _don't_ turn this into a "such estimates are useless" discussion. I need ... something, anything ... to show that s/w development is not free. Even a wild guess is better than nothing. The last one I used said something like X lines of code - the average US programmer would take Y months to do that at a salary of $Z. Again, please don't tell me why I don't want it - because I do. Apologies for trying to fend off the noise before it even starts. Thanks in advance for any help.


title: Scrum: how to integrate work done by an overachieving developer out of band?

text: We have a "typical" SCRUM team and we commit to work for a sprint, and also maintain a backlog. Recently we have run into a problem of trying to integrate/handle the work of an overachieving developer doing out of band work (choosing to work outside of the normal working hours/sprint). To give an example, if the team takes in 50 points of work, let's say that they will complete all that work within the SCRUM framework by the end of the sprint and they and the company is happy. One of the team members decides to work on their own, on a backlog item, on their own free time. They do not check in this work, but instead save it (we use TFS and it is in a shelveset). How to handle this? A few of the problems ..   * During the next sprint this team members says the programming work is 99% done and just needs code review and testing. How do you deal with this in the SCRUM and agile methodology?   * Other developers complain about not being involved in design decisions related to these stories, since the work was done out of band.   * Our product owner is tempted to pull in this "free" work and the overachieving members is likely doing this on purpose in order to get more features into the product that the team otherwise would not be able to accomplish in the sprint(s). There is a view that this is breaking the "process". Obviously QA, UI and documentation work still need to be done on this work. I see a lot of discussion about not forcing a SCRUM team to work overtime, but what about a member of the team working above and beyond the expectations put forth during planning and execution of sprints? I would hesitate to reign this person in and say you cannot work extra (cautioning on burn out of course), but at the same time it seems to be causing some issues with certain members of the team (but not all). How to integrate work done by an overachieving member into the SCRUM and agile process for software development?


title: How using tab affects commands like diff

text: In the page at http://pear.php.net/manual/en/standards.indenting.php, it is advised to use space instead of tab as it causes issue with diff, patches. Here is the excerpt from the page. > Use an indent of 4 spaces, with no tabs. This helps to avoid problems with > diffs, patches, SVN history and annotations. So, my question is if we are using tabs everywhere, how it is going to affect these commands?


title: How to make hardware sizing sheet?

text: We build some software platform, and now we need to make hardware sizing sheet for the server-side piece of this software. So, I should prepare some mathematical model that, for example, given the number of concurrent users, can predict the number of physical servers or storage capacity or network bandwidth. How to make such model?


title: When forking an dual-licensed permissive/GPL project, can I drop one of the licenses?

text: Consider an existing project that is dual-licensed GPL + either MIT or BSD. Since it's dual-licensed, when I fork, can I pick one license in the fork? Or do my forked files need to continue to be dual-licensed? It sure would be simpler to track only one license.


title: Was it necessary to build this site in ASP.NET?

text: From what I'm told, the whole StackOverflow/StackExchange 'stack' is based on Microsoft's ASP.NET. SO and the SE sites are probably the most complex that I visit on a regular basis. There's a lot going on in every page - lots of different boxes, pulling data from different places and changing dynamically and responding to user interaction. And the sites work very smoothly, despite the high traffic. My question is, could this have been achieved using a different platform/framework? Does ASP.NET lend itself to more complex projects where other web frameworks would strain and falter? Or is the choice pretty incidental?


title: How to avoid to be employed by companies which are candidates to DailyWTF stories?

text: I'm reading The Daily WTF archives and especially those stories about IT- related companies which have a completely wrong approach of software development, the job of a developer, etc. Some stories are totally horrible: a company don't have a local network for security reasons, another one has a source control server which can only be accessed by the manager, etc. Add to it all those stories about managers who don't know anything about their work and make stupid decisions without listening to anybody. The thing is that I don't see how to know if you will be employed by such company during an interview. Of course, sometimes, an interviewer tells weird things which gives you an idea that something goes very wrong with the company (in my case, the last manager said I should work 100% of my time through Remote Desktop, connected to on an old and slooooow machine, because _"it avoids several people to modify the same source code"_ ; maybe I should explain him what SVN is). But in most cases, you will be unable to get enough information during the interview to get the exact image of a company. So how to avoid being employed by this sort of companies?   * I thought about asking to see some documents like **documentation guide** or **code style guidelines**. The problem is that I live in France, and here, most of the companies don't have those documents at all, and in the rare cases where those documents exist, they are outdated, poorly written, never used, or do force you to make things that don't make any sense.   * I also thought about asking to see **how programmers actually work**. But seeing that they have dual screens or "late-modern-artsy-fartsy furnishings" doesn't mean that they don't have people making weird decisions, making it impossible to work there. Have you been in such situations? What have you tried? Have it worked?


title: DDD and validation of aggregate root

text: Suppose an aggregate root : MailConfiguration (wrapping an AddressPart object). The AddressPart object is a simple immutable value object with some fields like senderAdress, recipentAddress (to make example simple). As being an invariant object, AddressPart should logically wrap its own Validator (by the way of external a kind of AddressValidator for respecting Single Responsibility Principle) I read some articles that claimed an aggregateRoot must validate its 'children'. However, if we follow this principle, one could create an AddressPart with an uncohesive/invalid state. What are your opinion? Should I move the collaborator AddressValidator(used in constructor so in order to validate immediately the cohesion of an AddressPart) from AddressPart and assign it to aggregateRoot (MailConfiguration) ?


title: Dependency injection: what belongs in the constructor?

text: I'm evaluating my current PHP practices in an effort to write more testable code. Generally speaking, I'm fishing for opinions on what types of actions belong in the constructor. Should I limit things to dependency injection? If I do have some data to populate, should that happen via a factory rather than as constructor arguments? (Here, I'm thinking about my `User` class that takes a user ID and populates user data from the database during construction, which obviously needs to change in some way.) I've heard it said that "initialization" methods are bad, but I'm sure that depends on what exactly is being done during initialization. At the risk of getting too specific, I'll also piggyback a more detailed example onto my question. For a previous project, I built a FormField class (which handled field value setting, validation, and output as HTML) and a Model class to contain these fields and do a bit of magic to ease working with fields. FormField had some prebuilt subclasses, e.g. FormText (`<input type="text">`) and FormSelect (`<select>`). Model would be subclassed so that a specific implementation (say, a Widget) had its own fields, such as a name and date of manufacture:               class Widget extends Model {         public function __construct( $data = null ) {             $this->name = new FormField('length=20&label=Name:');             $this->manufactured = new FormDate;                  parent::__construct( $data ); // set above fields using incoming array         }     }      Now, this does violate some rules that I have read, such as "avoid `new` in the constructor," but to my eyes this does not seem untestable. These are properties of the object, not some black box data generator reading from an external source. Unit tests would progressively build up to any test of Widget-specific functionality, so I could be confident that the underlying FormFields were working correctly during the Widget test. In theory I could provide the Model with a FieldFactory() which could supply custom field objects, but I don't believe I would gain anything from this approach. Is this a poor assumption?


title: New Job Over Budget

text: I recently started a new job as a contract developer, and my non-developer boss of about two weeks ago gave me the task to re-create an app from another language and developer that he will reuse with multiple clients (replacing the front-end), that I estimated would take longer than his estimate of 12 hours. Two weeks later, I'm 230% over-budget. I admit this was my 2nd web app, I had been a wordpress developer in the past, so I am somewhat new to code igniter, but not shabby php by any means. My boss hired me knowing this and I was clear that it would take longer than his 12 hours. He's seen me in the office on task for 2 weeks, he should be somewhat prepared for this bill. Do I expect the full amount of hours, or do I filter against how much of learned? Can I bill for research as a developer?


title: Which framework should a ruby beginner start with: rails or sinatra?

text: What is the best framework for start: rails or sinatra? I heard that sinatra is more flexible but rails has a lot of documentation and tutorials. What's your choice?


title: Is it okay to rollback code if your client refuses to pay you?

text: A friend of mine did some contracting work to add localization support to an existing mobile app. He was not contracted to add any other features or fix any already existing bugs. He has finished his work, but the client refuses to pay him because of an already existing bug that he hasn't fixed. The only card my friend has left is to rollback the server code to the state it was before he began working, which will probably break the mobile app and hopefully force the client's hand. Is this legal? Is there a better way to handle the situation?


title: Is it practical to use Twitter for service logs?

text: Recently my boss suggested that we post logs of our service that is hosted on Windows Azure into twitter. His idea is that it's conveniently readable and if Azure cloud fails logs persist. He also said, _lots of people do this_ , I Googled and couldn't find any data about this. Currenly my concerns are the following. First, perhaps twitter is not very convenient for logging something that can happen very frequently (for example, when our service role starts each instance writes tens of records over several minutes). Second, even if twitter EULA allows such use at this moment it might be changed in future to cut off tweets that occur too often to be human- originated. Is it practical to post service logs on twitter? What to consider if we implement this?


title: WCF hardware requirement

text: I read the hardware requirements of WCF in a book and two of them are the following ones:   * A DVD-ROM drive   * A 1024 × 768 or higher resolution display with 256 colors or more Why is there a requirement for the screen resolution, or to have a DVD drive? Perhaps, this requirement is necessary for Visual Studio to work. Am I wrong?


title: Is C++0x Compatible with C?

text: I have heard that there will be a lot of changes done in C++ because of the new standard (C++0x). My question is: What are the major changes, and will C++0x be compatible with C++ 98 and **C** ?


title: Chosing a parser for a code beautifier

text: I'm in the planning stage of making a code beautifier (similar to AStyle or Uncrustify) - originally I was going to just contribute to one of those projects, but reviewing their source led me to the conclusion that I have different design goals and that their source is written in a way that makes it difficult for an outsider to easily contribute. AStyle, for example, instead of building some sort of AST, uses over 100 state variables such as `isInComment`, `foundClassHeader`, `isLineReady`, etc. I'm deciding between using scanner and parser generators (such as flex and bison) and writing my own parsing system. Which would be a better approach? I've been through a compilers class in university, so I do have some experience with scanning and parsing theory. Below are the advantages I've thought of for each: **Generators**   * Arguably simpler/faster to develop   * Possibly more optimized than my initial stab at a custom parser, though a custom one might leave more room for improvement **Custom parser**   * Arguably easier to debug   * _Programmers_ seems to prefer custom lexers and parsers in past questions - "Anyone who wants a decent lexer doesn't use Lex"   * Fewer dependencies   * Could possibly allow for "fuzzier" parsing - since I'm just developing a beautifier, the parser wouldn't need to be nearly as strict or detailed as one for a compiler    * Parallelization - flex and bison (or what I've seen of them) use global state. If I want to parse multiple files at once (in separate threads), a custom solution would be simpler to compartmentalize


title: Established coding standards for pl/pgsql code

text: I need to standardize coding practices for project that compromises, among others, of pl/pgsql database, that has some amount of nontrivial code. I look for:   * Code formatting guidelines, especially inside procedures.    * Guidelines on what constructs are considered unsafe (if any)    * Naming conventions.    * Code documentation conventions (if this is practiced)  Any hints to documents that define good practices in pl/pgsql code? If not I'm looking for hints to practices that you consider good. There is related question regarding TSQL: Can anyone recommend coding standards for TSQL?, which is relevant to psql as well, but I need more information on stored procedures. Other related questions:   * http://stackoverflow.com/questions/1070275/what-indenting-style-do-you-use-in-sql-server-stored-procedures


title: using this in a constructor, why does it work?

text: I got two classes.   * busiObj(created from ancient flat files)   * key(provides means to tell busiObjs apart) key has a c'tor that takes a busiObj               public key(busiObj foo)     {         bar = foo.someThing;         [...]     }      I want to create the key in the c'tor of the busiObj               public busiObj(...)     {         myKey = new key(this);         [...]     }      However: Why on earth does it work?   I firmly expected the compiler to throw something like:   "You cannot reference an object that is currently being made, duh". So: How is it that I can reference an object while it is still being constructed?


title: User directory - framework

text: I'ld like to create a very basic directory where user can enter their social network profiles and pick a username. From that data a little website gets generated. The sign in process should be managed via Twitter or Facebook. Where do I start with this? Are there any frameworks, api's or something like that available? Thanks, Bob


title: Google App Engine: How to be notified when APIs change or become available?

text: I am thinking about writing a GAE app but am a little hesitant because the EULA gives Google full rights to change their APIs anytime they want, for any reason. Obviously, they'd be out of business quick if they just 'upped and refactored their entire APIs, so I have to imagine they have some kind of notification system, perhaps even an RSS feed, etc. to notify developers well in advance of looming changes, or new features coming out in future releases. However, for the life of me I can't seem to find any trace of the existence of such a notification system. Perhaps the Google forums is the only place to get such updates? I guess I'm asking any battle-worn GAE veterans for re-assurance that there are reliable ways of getting notifications about policy or API changes from Google such that I could react and make the necessary app changes without production breaking or impacting any clients.


title: Facebook Java API

text: I'd like to write a program in java (not a servlet, not jsp, not a webapp) which allows me to do simple things, such as connecting to a FB account and retrieve the status or posts on the wall. I know facebook no longer supports official JavaAPI, so I was wondering what are the best (and most simple, being the program very basic) unofficial api out there. If possible, i would also like some example-code. searching through the web, I've read that you need two secret keys to create a facebook application, and I have not a fb account. Is it indispensable to have an account? thank you everyone


title: I don't want to patent my business software, but I don't want to get ripped off later

text: I feel patents are innovation killers, but I don't want something I've written and put a private licence on end up being patented 3 years later by some troll. What's a good compromise here? Or, am I actually not at risk? _I understand most of the members on the site aren't lawyers._


title: ISO, Six Sigma, SEI-CMM, etc., in Fortune 500 companies

text: Do large corporations and product companies follow any standard quality models/processes at all?   For example, I have seen that many large organizations have proprietary processes in IT and software development. Back in the days (even before Motorola's Iridium project,) I remember many IT companies scampering for SEI- CMM certification. Do any of the Fortune 500 company try to adopt these quality processes? In my limited experience I have not seen them undergoing audits for adherence to processes. Most of the audits are either financial, or issues pertaining to legalities. Am I just being ignorant, or is this true? If true, how stringently do the companies adhere to the processes?


title: Long Keywords like `function` and `namespace`

text: In many English-based programming languages like C++ and JavaScript, there exist long keywords like `function`, `namespace`, `exception` (in OCaml languages) and such. Do you think shorter keywords like `func` should replace them? Why or why not? What about replacing them with digraph operators? The long keywords we will be mainly talking about, but not limited to, are mainly from curly-brace imperative languages: `function`, `namespace`, `implements`, `instanceof` and `synchronized` (I always misspell that). You should also show the examples from your favourite programming language.


title: A question regarding linked list vs vector insert/remove results comparison

text: I was reading this blog post: http://kjellkod.wordpress.com/2012/02/25/why- you-should-never-ever-ever-use-linked-list-in-your-code-again/ and I found there a code to run: http://ideone.com/62Emz I've compiled it using gcc 4.7.2 with `g++ -std=c++11` on my old laptop with T5450 cpu with two cores with 32 Kbytes L1 cache each and 2 Megabytes of (common?) L2 cache and I have got this results:               ********** Times in microseconds**********     Elements ADD (List, Vector)     ERASE(List, Vector)     100,     , 0, 0,                0, 0     200,     , 0, 0,                15625, 0     500,     , 0, 0,                0, 0     1000,    , 15625, 0,            0, 15625     4000,    , 109375, 140625,              46875, 31250     10000,   , 750000, 875000,              312500, 187500     20000,   , 2968750, 3468750,            1296875, 781250     40000,   , 12000000, 13843750,          5359375, 3156250     Exiting test,. the whole measuring took 45375 milliseconds (45seconds or 0 minut     es)      Which actually says an opposite, at least for `ADD` operation comparing to what author of that blog post says. List is faster for `ADD` than Vector. What conclusions should I make from my results? Does it proof anything? What should I think or understand?


title: Detecting misusage of delete[] vs. delete at compile time

text: I'd like to know if it's possible to detect the `delete` error commented below at compile time? Especially, I'd like to hear about g++ compiler.               ClassTypeA *abc_ptr = new ClassTypeA[100];       abc_ptr[10].data_ = 1;       delete abc_ptr; // error, should be delete []        Thanks in advance!


title: Acceptance tests done first...how can this be accomplished?

text: The basic gist of most Agile methods is that a feature is not "done" until it's been developed, tested, and in many cases released. This is supposed to happen in quick turnaround chunks of time such as "Sprints" in the Scrum process. A common part of Agile is also TDD, which states that tests are done first. My team works on a GUI program that does a lot of specific drawing and such. In order to provide tests, the testing team needs to be able to work with something that at least attempts to perform the things they are trying to test. We've found no way around this problem. I can very much see where they are coming from because if I was trying to write software that targeted some basically mysterious interface I'd have a very hard time. Although we have behavior fairly well specified, the exact process of interacting with various UI elements when it comes to automation seems to be too unique to a feature to allow testers to write automated scripts to drive something that does not exist. Even if we could, a lot of things end up turning up later as having been missing from the specification. One thing we considered doing was having the testers write test "scripts" that are more like a set of steps that must be performed, as described from a use- case perspective, so that they can be "automated" by a human being. This can then be performed by the developer(s) writing the feature and/or verified by someone else. When the testers later get an opportunity they automate the "script" for regression purposes mainly. This didn't end up catching on in the team though. The testing part of the team is actually falling behind us by quite a margin. This is one reason why the apparently extra time of developing a "script" for a human being to perform just did not happen....they're under a crunch to keep up with us developers. If we waited for them, we'd get nothing done. It's not their fault really, they're a bottle neck but they're doing what they should be and working as fast as possible. The process itself seems to be set up against them. Very often we end up having to go back a month or more in what we've done to fix bugs that the testers have finally gotten to checking. It's an ugly truth that I'd like to do something about. So what do other teams do to solve this fail cascade? How can we get testers ahead of us and how can we make it so that there's actually time for them to write tests for the features we do in a sprint without making us sit and twiddle our thumbs in the meantime? As it's currently going, in order to get a feature "done", using agile definitions, would be to have developers work for 1 week, then testers work the second week, and developers hopefully being able to fix all the bugs they come up with in the last couple days. That's just not going to happen, even if I agreed it was a reasonable solution. I need better ideas...


title: Branching library behavior based on 3rd party library existence

text: Someone proposed to me this pattern which I have never heard of before and can't find any information on it. The basic idea is, when building a library for other developers to use; if the developer includes my library along with a 3rd party library the behavior of the API calls to my library changes. An example:   1. I have a library/API for inserting, getting, updating, deleting on a database.   2. Developer includes a 3rd party database encryption library.   3. My library/API changes to require a "unencrypt(password)" call to be made before inserting, getting, updating, deleting. Is this a safe practice? Is there anything else out there like it? What advantages and disadvantages are there to this pattern?


title: Should you answer programming interview questions with library?

text: Some questions can be answered easily by using specific language library. For example Java has Set, Maps, and List. Is it possible to answer those coding questions during interview by using these library or should we go more with a traditional down to earth approach, making it a C- kind of answer?


title: Does long term programming affect writing in a native spoken languages?

text: So, I am getting some years under my belt in long term programming. I have noticed, however, when the frequency and duration started increasing in my coding sessions that when I actually went to write a paper, email, document, or anything else that required writing more than a few sentences that my writing quallity appeared to suffer. I started forgetting the basic rules and vocabulary of written English. I am now going back for my Masters and find that writing papers does not come as easy as it used to. I remember thinking to myself how my Creative Writing class back in my freshman year of college helped a great deal in writing for my other classes. Hate to say it, but it feels like I could use a refresher. Also, my hand writing has especially not got any better! I feel inclined to say it's a side-effect of long term programming but want know any if real studies have been done or just from personal experience from programmers.


title: How to store personal information properly?

text: It's not about security or something. There is a table to record user information, like username, password, postcode and so on, one record per person. There is also a table called post to record the posts the users posted. It's very easy to set a relation to identify the user who posted the post. But think of this situation, how to store the posts that has been read by a user? If use many-to-many relation, the table will increase to very huge size. What's more, there's a lot things to record, I just take one of them for example. I call this personal information. The problem is how should I store it properly?


title: What kind of research study would cause you to change your software practices?

text: Software development today isn't evidence-based. That is, we don't really choose technologies and practices based on the outcome of research studies the way (we hope!) they do in, say, medicine. As an example, there was a study published in early 2011 in the Journal of the American Medical Association that suggested removing lymph nodes of breast cancer patients does not improve survival rates, which had an immediate impact on surgical practice. Imagine you found yourself reading a paper about a software engineering study which suggested that a software practice or technology that you currently use did not actually have the benefit you thought it did: i.e., this study was in contradiction with your personal experience. Assuming that the paper was published in a reputable venue that you trusted, what properties would the study need to have for you to actually change your practices based on the result?


title: Time complexity of a nested loop where the inner value is decreased in every step

text: I have problems to give the right time complexity in O notation for the following loop:               k := 0     for i := 0 to N        for j := k to M          // something        k = k + 1      Where N = M. Without the modified starting value of j of the inner value this would be of course O(N * M), but with the decreasing running time of the inner loop in every step of the outer loop I am quite confused. How can this be approached?


title: IRC Bot permission structure, best approach?

text: I'm making an IRC bot in PHP. And I've come to the point when I need to determine how would user permissions/accesses would look in the database (and in the application in general). Here are the requirements:   * There are global and local permissions, global are for all channels, while local are channel specfiic.   * There are permissions such as "root", "bot_admin" "glob_op" "op on #channel", in this example, each is weaker than the last (root is strongest, meaning that no one can take actions against root).   * I haven't completely decided on exactly how many permissions are there, and the bot will be extensible, so there needs to be an option of expanding. Some approaches I had in mind:   * Assign each permission level a number (1, 2, 4, 8, 16) and add them together to form the access level of a specific user (even adding all of the numbers until `n-1`, they would still be lower than `n`). As for expanding, I could leave gaps (1, 16, 256, etc) and fill it in later. I don't think it's a very good one, as it would be hard to maintain and read later on, even if I use constants to make it more readable.   * Have each permission in its own boolean column. That seems just silly, and there's no easy way of determining the power relations between each role. So what say you? Have a better approach I can take?


title: Is "regular" a technical term for a grammar?

text: Reading the Go language specs, I read in the intro: "The grammar is compact and regular, allowing for easy analysis by automatic tools such as integrated development environments." Is the word "regular" here a technical term, or should it be interpreted just as a vague English word?


title: What quality level in the commit history can/should I expect/enforce?

text: I worked as a lone developer for a long time. During this time, I developed a way of formulating and ordering commit messages: Refactor first, describe exactly the reason for the commit in the message, link to the issue tracker, ... There is even a script to create several sorts of change log (public, company-internal, developer) from the commit history. This way I always know, when and why the code in the codebase changed to the state it is now. With the advent of interactive rebase and commit reordering, I can easily make sure that history (and, thus, documentation) looks exactly the way I want it to be. Bad code doesn't even get into the history. So, every commit has its well-defined purpose. It took me years to evolve this practice, which I consider a good one. (Is it?) However, applying this to someone else's code changes (i.e., rewriting the history of someone else's changes) is, for me, a painfully time-consuming task. I have tried this in order to identify unnecessary or even faulty changes. The total size of the patch in question is slightly too big to be reviewed as a single unit, and there are a few questionable code changes. In fact, it turns out that I cannot afford to control the code base as a "dictator". It just costs too much time. So I'd like to lose some control while maintaining a good quality of the code. Currently, I just don't see how to achieve this. "How clean" should the history of a project be? Which format and granularity for the commits should I require? Should I ask the developer to reformat history (e.g., to split a commit), even if it would require education on how to split a commit after the fact? Should I teach developers to work on feature branches? Can commit templates help? How frequently should the changes by the others be reviewed?


title: What is a software maintenance retainer contract?

text: I'm a one man software start up and need to consider a software maintenance retainer contract for a client. What is this, in simple terms? How could it benefit me or my client?


title: The false element in a Logical operation

text: I wish to know if there's some way to know which is the elemnet of a logic operation is false?   Example.               if( String.IsNullOrEmpty(obj1) || (String.IsNullOrEmpty(obj2) )        throw("...............");       How can I kown which one of those is the empty one?


title: How do I get away from PHP in the web industry?

text: I'm just looking for some tips on getting away from using PHP for web development. I'm self-employed but it seems like all of the work I find deals with PHP. I'm not complaining about the work -- just the poor choice of a language that is incredibly popular. I'd love to do my web development in Python, Perl, C#, or even a fun and fancy functional language. There's the old saying that you don't tell a carpenter what kind of a hammer to use. At the same time, you do tell them what kind of material to build your house out of and how much you're willing to spend. The problem I am running in to is that I don't know how to get out of this spiral. I can't just turn down work because then I wouldn't have any. I really don't want to go work for another company -- and even if I did, I'd probably still be stuck using something I don't enjoy. I'm hoping someone has "been there" before and might have some good ideas on how to get out of this situation. Thanks!


title: calling test methods within other test methods

text: To test a method that returns a clone of the object it is called on, i need to re-run the test suite on the newly created object if i am to ensure that full functionality is retained, i found my instinct was to clone the object then call all other test methods in sequence i order to reduce code duplication. However that approach now smells to me and i can't pinpoint why. Is there a better way to test this kind of functionality?


title: Is there value denoting a key as "Primary"?

text: Question: Is there value in denoting a key as "Primary"? This question is not about the definition of a primary key. It is not about the fact primary's aren't nullable. It is not about implementations such as MySQL which automatically perform clustered index voodoo behind the scenes on primary keys. **NOTE** : The question is not about the benefits of auto-number-ID surrogates over natural keys. Suppose a table has 3 candidate keys. All non-nullable. All immutable. I find no value denoting a key as "secondary" or "tertiary". I don't find the concept of precedence useful when dealing with multiple keys. I find the same logic against "secondary" and "tertiary" flags applies to the "primary" flag. I even feel the word "candidate" is not useful for a key. It implies the candidate is not as important as the key that won the primary election. I don't feel precedence has any place in describing keys. The attributes of the key itself (unique, non-nullable, etc) should be sufficient. Would the relational model be missing anything if we did not have the "primary" attribute to describe 1 of a table's keys?


title: What does the term Virtualization encompass?

text: I have seen on a number of resumes the term "virtualization." While every resume is unique, what does the broader term or skill of "virtualization" mean or imply? I feel that the ability to install virtual machines is not the only thing that this means. I have installed VMs and in my experience it was mostly following instructions. Is there something else to it that I'm missing, like actually _programming_ virtual machines? Is there an implied IT expertise on the issue, or relevant programming knowledge?


title: How would you explain HTTP to a lay person

text: I got this question in one of the interviews I took. I started by explaining that it is like a set of rules that should be followed while moving resources around, but I did not feel convinced. Is there any other analogy or take on this question ?


title: Does contributing to open source projects to boost a résumé make sense?

text: I've only worked on commercial projects, and I'm having a hard time trying to find a project that interests me. I'm looking at a new job soon, and I'm thinking about contributing to a few open source projects in the short term so that I can add them to my résumé. Is having open source projects on a résumé important? If so, would trying to contribute to several in a few months look too much like trying to boost my résumé?


title: How safe are hidden AJAX requests that fake performance?

text: ## What is a hidden AJAX request? I've noticed an increase in the usage of hidden AJAX requests designed to make a user's action appear to happen immediately. I'll refer to this type of AJAX request as non-blocking. It's an AJAX request made without the user being aware it's happening, it's performed in the background and it's operation is silent ( _there is no verbose to indicate a successful completion of the AJAX call_ ). The goal is to make the operation appear that it has happen immediately when it really has not finished. Here are examples of non-blocking AJAX request;   * User clicks delete on a collection of emails. The items disappear immediately from their inbox, and they can continue with other operations. Meanwhile, an AJAX request is processing the deletion of the items in the background.   * User fills out a form for new records. Clicks save. The new item appears in the list immediately. The user can continue to add new records. To clarify, here are examples of blocking AJAX request;   * User clicks delete on a collection of emails. An hourglass cursor appears. The AJAX request is made, and when it responds the hourglass cursor is turned off. The user has to wait a second for the operation to complete.   * User fills out a form for new records. Clicks save. The form turns grey with an AJAX loader animating. A message is shown "Your data was saved", and the new record appears in the list. The difference between the two above scenarios is that a non-blocking AJAX setup does not provide feedback of an operating performing, and a blocking AJAX setup does. ## The Risk Of Hidden AJAX Requests The biggest risk of this style of AJAX request is that the web application could be in a completely different state when the AJAX request fails. For example, a non-blocking example;   * User selects a bunch of emails. Clicks the delete button. The operation appears to happen immediately (the items just disappear from the list). The user then clicks the compose button and starts typing a new email. It's at this time that the JavaScript code discovers the AJAX request failed. The script could show an error message, but it really is pointless at this time. Alternately, a blocking example;   * User selects a bunch of emails. Clicks the delete button. Sees an hour glass, but the operation fails. They get an error message saying "error. blah blah blah". They are returned back to the list of emails, and they still have the emails they wanted to delete selected. They could attempt to delete them again. There are also other technical risks for performing non-blocking AJAX requests. The user could close the browser, could navigate to another website and they could navigate to another location in the current web that makes the context of any error response meaningless. ## So Why Is It Becoming So Popular? Facebook, Google, Microsoft, etc.. etc.. all these large domains are increasingly using non-blocking AJAX requests to make operations _appear_ that they are performed instantly. I've also seen an increase in form editors that have _no save or submit button_. As soon as you leave a field or press enter. The value is saved. There is no _your profile has been updated_ message or saving step. AJAX requests are not a certainty, and shouldn't be treated as successful until they have completed, but so many major web applications are operating just like that. Are these websites that use non-blocking AJAX calls to simulate responsive applications taking an unnecessary risk at the cost of appearing fast? Is this a design pattern that we should all be following in order to remain competitive?


title: Performance of a Skip-List algorithm

text: Here is a simple code for a randomized skip-list:               Coin_Side flip()     {         if ( random() % 2 == 0 )             return HEADS;         else             return TAILS;     }      Note: random() returns an integer that uses a modulus of the form M = 2^B. Then, what is the expected performance of the skip list algorithm? So we have: (ax mod M) mod 2 = (ax mod 2^B) mod 2 = (ax mod 2) mod 2^B I can see than ((ax mod 2) == 0) will be true if ax is even. Then, by adding mod 2^B, we will skip more values in the skip-list. We would have only the even numbers that are multiples of 2^B. So would that make the algorithm better or worse?


title: Why doesn't libxml2 support XPath 2.0?

text: Libxml2 is the faster, stable and most popular "open DOM engine"... And the "XML C parser and toolkit of Gnome". The initial release of Libxml2 was September 1999, 13 years ago. XPath v1.0 was also released at 1999. XPath v2.0 became a recommendation on January 2007, 6 years ago. We can suppose that the Libxml2 community have time and people to develop a XPath2... So, _what is the problem?_ **Why doesn't libxml2 (or a "libxml2 fork" or an "experimental lib"!) support XPath 2.0?** Some raised hypotheses to discussion at answers,   1. Because Libxml2 community (and Gnome community) dislikes and have no motivation to develop something to XPath2 or xQuery.  1.1. XPath2 needs (by mathematical proof) a very heavy parser, much slower, etc. that is not suitable to real-world Libxml2 applications. 1.2. Other "ideologic" dislikes/motivations.   2. Because it is written with C, and for XPath2 is better to develop with C++.   3. Because the above hypothesis of "Libxml2 community have time and people" is false.   4. Because XPath2 became stable in 2010 with its "Second Edition" release, and ~2.5 years is not (?) enough time.


title: how to work in team and organize tasks in web development

text: My problem is that i used to work as a freelancer web developer. Now i work in a company and have a small team. I'm responsible for organizing this team to work in a project. I have no idea about organizing tasks or putting plan for a team. Can any one tell me how to do that.


title: How to ensure the success of processes after a deadlock exception occurs?

text: No matter the programming language is and whatever the database is, the concept should be the same: I have 2 threads, each locking some database entities and inserting new data in database.   Let's suppose the fact that those threads run simultanously may cause deadlock exceptions. Obviously, the main action we can do first of all is to analyse the code deeply to find a good alternative avoiding any deadlocks.   But sometimes, we really can't avoid them. Should I catch the exception and retry the concerned process?   At first glance, it would be acceptable, but...what if those conflicting processes are replayed at the same time, other deadlocks again (the snake biting its tail)? What is a good way to ensure that the processes eventually succeed?


title: Term to describe keyword followed by statement block

text: Is there a general term to describe a keyword followed by a statement block? E.G.               if() {statement block}     while() {statement block}     try{statement block}     finally{statement block}      Or even something made up: `controlScope{statement block}`


title: Is not being paid for training normal?

text: I'm a recent college graduate, and I recently had a interview with a company for an entry-level programming job. The company told me that they require two months of unpaid training for all entry level programmers. The reason given was that since they are providing free training, there wouldn't be any compensation. Is this normal? **Update** For other junior developers looking at this: Don't go for these type of scams. This was my first interview. I interviewed with 10 other companies around the area and got about 9 job offers from them. I worked for a fortune 50 company for 9 months with good pay and recently found a better opportunity for even better pay and better work. I guess moral is to be patient and have confidence in yourself.


title: Domain security involving domain logic

text: Together with my application's domain logic I am trying to outline the security model. I am stuck with a requirement that prevents me from considering security just a cross-cutting concern over my domain logic. Here follows my situation. A user in my system can potentially be allowed to create a certain kind of objects, say, 'filters'. I introduce a permission called 'CREATE_FILTER', and a user is either allowed to create filters or not, depending on whether the admin assigned such a permission to this user, or not. Ok. Now consider a more complex requirement when the number of filters a user can create is limited. So, e.g. the admin should be able to set max number of filters any user is allowed to create, or even more complex, to assign max numbers individually to users, say value of 3 to User1, 5 to User2 and so on. So, the security system, in order to authorize filter creation to a user, is not sufficient to check whether a user has such a permission assigned, but has to analyze the domain model in a complex way in order to look how many filters there are already created by the user to make the decision. To make things more complex, we can imagine that the max limit will depend on the amount of money user has on their account, or something. I want to conceptually separate (at least in my mind), whether such a complicated security logic purely pertains to security (which will of course depend on the domain model) or is this already a full-fledged part of the domain logic itself? Does it make sense to keep a 'permission' concept, when assigning/removing permissions does not help much (since it's domain state on which depends authorization decision rather than assigned permissions)? Would it be a way to go, say, to have a complicated permission concept which not simply allows an action by a mere fact of its existence but would rather involve some complex decision making logic?


title: Debugging memory corruption

text: First off, I do realize this is not a perfect q&a style question with an absolute answer, but I can't think of any wording to make it work better. I don't think there is an absolute solution to this and this is one of the reasons why I'm posting it here instead of stackoverflow . Over the last month I have been rewriting a fairly old piece of server code (mmorpg) to be more modern and easier to extend/mod. I started with the network portion and implemented a 3rd party library (libevent) to handle stuff for me. With all the refactoring and code changes I introduced memory corruption somewhere and I have been struggling to find out where it happens. I can't seem to reliably reproduce it on my dev/test environment, even when implementing primitive bots to simulate some load I dont get crashes anymore (I fixed a libevent issue which caused some stuff) I have tried so far: Valgrinding the hell out of it - No invalid writes until the thing crashes (which may take 1+ day in production.. or just an hour) which is really baffling me, surely at some point it would access invalid memory and not overwrite stuff by chance? (Is there a way to "spread out" the address range?) Code-Analysis tools, namely coverity and cppcheck. While they did point out some.. nastiness and edge cases in the code there was nothing serious. Recording the process until it crashes with gdb (via undodb) and then working my way backwards. This /sounds/ like it should be doable, but I either end up crashing gdb by using the auto-complete feature or I end up in some internal libevent structure where I get lost since there's too many possible branches (one corruption causing another and so on). I guess it would be nice if I could see what a pointer originally belongs to/where it was allocated, that would eliminate most of the branching-issues. I cant run valgrind with undodb though, and I the normal gdb record is unusably slow (if that even works in combination with valgrind). Code review! By myself (thoroughly) and having some friends look over my code, though I doubt it was thorough enough. I was thinking about maybe hiring a dev to do some code review/debugging with me, but I cant afford to put too much money in it and I wouldn't know where to look for someone who'd be willing to work for little-to-no money if he doesnt find the issue or anyone qualified at all. I should also note: I usually get consistent backtraces. There are a few places where the crash happens, mostly related to the socket class becoming corrupted somehow. Be it an invalid pointer pointing to something which isnt a socket or the socket class itself becoming overwritten (partially?) with gibberish. Although I suspect it's crashing there the most since that's one of the mostly used parts, so it's the first corrupted memory which gets used. All in all this issue has had me busy for nearly 2 month (on and off, more of a hobby project) and is really frustrating me to the point where I become grumpy IRL and think about just giving up. I just cant think about what else I am supposed to do to find the issue. Are there any useful techniques I missed? How do you guys deal with that? (It cant be that common since there isn't much information about this.. or I'm just really blind) Edit: Some specs in case it matters: Using c++(11) via gcc 4.7 (version supplied by debian wheezy) The codebase is around 150k lines Edit in response to david.pfx post: (sorry for the slow response) > Are you keeping careful records of crashes, to look for patterns? Yes, I still have dumps of the recent crashes lying around > Are the few places really similar? In what way? Well, in the most recent version (they seem to change whenever I add/remove code or change related structures) it would always get caught in an item timer method. Basically an item has a specific time after which it expires and it sends updated info to the client. The invalid socket pointer would be in the (still valid as far as I can tell) Player class, mostly related to that. I am also experiencing loads of crashes in the cleanup phase, after the normal shutdown where it's destroying all the static classes that havent been explicitly destroyed (__run_exit_handlers in the backtrace). Mostly involving std::map of one class, guessing that's just the first thing that comes up though. > What does the corrupt data look like? Zeros? Ascii? Patterns? I havent found any patterns yet, seems somewhat random to me. It's hard to tell since I don't know where the corruption started. > Is it heap-related? It's entirely heap-related (I enabled gcc's stack guard and that didnt catch anything) > Does the corruption happen after a free()? You're gonna have to elaborate a bit on that one. Do you mean having pointers of already free'd objects lying around? I'm setting every reference to null once the object gets destroyed, so unless I missed something somewhere, no. That should show up in valgrind though which it didnt. > Is there something distinctive about the network traffic (buffer size, > recovery cycle)? The network traffic consists of raw data. So char arrays, (u)intX_t or packed (to remove padding) structs for more complex things, each packet has a header consisting of an id and the packet size itself which is validated against the expected size. They are around 10-60bytes with the biggest (internal 'bootup' packet, fired once at startup) having a size of a few mb > Lots and lots of production asserts. Crash early and predictably before the > damage propagates. I once had a crash related to std::map corruption, each entity has a map of it's "view", each entity that can see it and vice versa is in that. I added a 200byte buffer infront and after, filled it with 0x33 and checked it before each access. The corruption just magically vanished, I must've moved something around which made it corrupt something else. > Strategic logging, so you know accurately what was happening just before. > Add to the logging as you get closer to an answer. It works.. to an extend. > In desperation, can you save state and auto-restart? I can think of a few > pieces of production software that do that. I somewhat do that. The software consists of a main "cache" process and some other worker ones which all access the cache to get and save stuff. So per crash I dont lose much progress, it still disconnects all the users and so on, it's definitely not a solution. > Concurrency: threading, race conditions, etc There's a mysql thread to do "async" queries, that's all untouched though and only shares information to the database class via functions with all lock. > Interrupts There's an interrupt timer to prevent it from locking up that just aborts if it didnt complete a cycle for 30seconds, that code should be safe though if (!tics) { abort(); } else tics = 0; tics is "volatile int tics = 0;" which is increased each time a cycle is completed. Old code too. > events/callbacks/exceptions: corrupting state or the stack unpredictably Lots of callbacks are being used (async network io, timers), but they shouldn't do anything bad. > Unusual data: unsual input data/timing/state I've had a few edge cases related to that. Disconnecting a socket while packets are still being processed resulted in accessing a nullptr and such, but those have been easy to spot so far since every reference gets cleaned up right after telling the class itself it's done. (Destruction itself is handled by a loop deleting all the destroyed objects each cycle) > Dependency on an asynchronous external process. Care to elaborate? This is somewhat the case, the cache process mentioned above. Only thing I could imagine off the top of my head would be it not finishing quick enough and using garbage data, but that's not the case since that's using network too. Same packet model.


title: Good abbreviations for XML ... things

text: I've never been very good at maintaining a coherent bunch of variable names for interfacing with XML files because I never name the variables in my interfaces the same way across my source. There are Elements, Attributes, Documents, NodeLists, Nodes, DocumentFragments and other stuff. What's a good scheme for keeping track of this stuff as variables? Is there a standard in regard to Hungarian notation? Do you even put anything signifying that the data is actually XML, is this bad practice? Also, what is the difference between the way you name your constants (signifying Namespaces, Elements and Attribute Names) and your variables (signifying Namespaces, Elements, Attributes, Nodes, Node Lists and Documents)


title: Groovy/Grails course content

text: Some Java developers have asked if I could give them a 2-day primer on Grails development. I'm assuming they're familiar with:   * Java language and libraries   * Java web development, e.g. Servlets, JSPs   * Spring   * Hibernate   * Client-side development, CSS, HTML, JavaScript I'm further assuming they have no experience with Groovy or Grails. AFAIK, the app that they'll be building is a new project, so there's no need to cover topics like using GORM with a legacy database. I'm trying to decide how I should structure the course, e.g. what topics to cover and how much time to spend on each. I reckon about 1/2 - 3/4 days on Groovy and the rest of the time on Grails would be adequate. I'll probably use the Groovy console to demonstrate the Groovy language concepts and a simple Grails app for explaining the conventions and structure of a Grails project. If anyone has a list of Groovy/Grails topics that I should cover, or even an outline of a similar course that they've given/taken, I'd be very grateful. Naturally, I will credit for any resources that I use during the course.


title: Why do C# developers newline opening brackets?

text: I've spent most of the last several years working mainly with C# and SQL. Every programmer I've worked with over that time was in the habit of placing the opening brace of a function or control flow statement on a new line. So ...               public void MyFunction(string myArgument)     {          //do stuff     }          if(myBoolean == true)     {         //do something     }     else     {         //do something else     }      I have always been struck by how ugly and space wasteful this is, especially in if/else statements. And I know alternatives exist in later versions of C#, like:               if(myBoolean == true)         //do something on one line of code      But hardly anyone used them. Everyone did the curly-brace-on-newline thing. Then I got back into doing JavaScript after a long absence. In my memory, JavaScript developers used to do the exact same curly-brace-newline thing but with all the fancy new libraries and stuff, most developers put the opening brace after the declaration:               function MyJavaScriptFunction() {         //do something     }      You can see the sense in this, because since using closures and function pointers has become popular in JavaScript, it saves a lot of space and makes things more readable. So I wondered why it wasn't seen as the done thing in C#. In fact, if you try the above construct in Visual Studio 2013, it actually reformats it for you, putting the opening brace on a new line! Now, I just saw this question on Code Review SE: http://codereview.stackexchange.com/questions/48035/questions-responses-let- me-tell-you-about-you In which I learned that in Java, a language I'm not overly familiar with, it's considered de-rigour to open your curly braces right after the declaration, in modern JavaScript fashion. I had always understood that C# was originally modelled after Java, and kept to a lot of the same basal coding standards. But in this instance, it seems not. So I presume there must be a good reason: what is the reason? Why do C# developers (and Visual Studio) enforce opening curly brackets on a new line?


title: Should I know more than one implementation of version control?

text: I'm using Windows and am comfortable with SVN (well, TortoiseSVN) because it's dead simple. It works for me. However, because it's been working so well, I haven't any reason to try anything else. Should I bother learning a different system, for example, Mercurial or Git?


title: Giving away sensitive information about previous employers during interview

text: When you are being interviewed by potential future employers, it is of course of benefit to both parties to discuss what your previous job entailed (ie, what you have been doing for the last few years). What if the technology (and the ideas behind the technology) that you have been working on is sensitive and confidential? I'm working on some really cool stuff at the moment, things that would impress an interviewer, that could demonstrate my passion and understanding, but at the same time I can't just come out and explain the nature of it without disclosing too much about my current employer. On the other hand, if I keep it vague without explaining the subtleties, it just seems as though I am working on fairly basic applications. The key is in the middle ground- the way the applications are constructed- which makes what I currently do both special and difficult. But even acknowledging this middle ground gives away vital information about how my employer competes. Hope that made some sense. What should I do in an interview? Is there like a 2-way NDA for interviews so I can just launch into an in-depth explanation of my past experience, or do I need to be deliberately vague and apologise for not being able to go into detail?


title: How to use Option Type Pattern in a language that doesn't support generics?

text: I've been interested to start using the ~~Null Object /~~ Option Type approach for replacing my old habits of null-checking multiple parts of my code. But, from the many examples I saw out there, it seems it's a pattern used in conjunction with generics. Great for C#, Java, Haxe and a bunch of others I'm sure. _NOT_ so great for **ActionScript 3.0** (which is what I was intending to use it for). So, am I under the wrong impression that this won't be possible / worthwhile in a language that doesn't support Generics? Or is there a way to pull it off without them? **NOTE:** It seems the " _Null Object_ " pattern shown in **this PatternCraft tutorial** doesn't quite resemble the way _Option Type_ was described in some of the other discussions in this stackexchange site. His way looks more like a factory class that spits out a **_Null???_** derivative of some base-class. I was hoping there could be a way to create Null-Objects without needing to write a dedicated class for every single case scenarios where a null-check would typically be used. * * * **EDIT: My apologies, I didn't realize "Null Object" and "Option Type" were two completely different beasts. For the sake of keeping the answers and feedback relevant to the question though, I only changed the title (was originally`How to use Null Object / Option Type Pattern in a language that doesn't support generics?`).**


title: NoSQL design - Storing project assignments

text: I currently have a planning tool using SQL tables that are sort of setup like this:   * Date table (Contains dates & indicates if that day is a weekend / holiday etc)   * Employee (Simple data)   * Project (Simple data)   * Assignments (Associates the three tables, key date + employee id + project id) I have one SQL query that, for a specific month/year, a joined list of employees + dates + assignment, e.g. 01/01/2014 employee_1 project_1. In case of no assignments, it returned the date anyway, as this makes it the most manageable on the front-end. I was toying around with node.js & mongodb for the first time today, and was wondering if my setup is something that could translate well to NoSQL. I really like the idea of using the JSON notation all the way, but I figure that this might be one of those cases where I'm better off with a RDBMS?


title: What are the drawbacks of not declaring a class-method static?

text: On the 'Interfaces' trail on the Oracle website, we are presented with the following scenario: > Imagine a futuristic society where computer-controlled robotic cars > transport passengers through city streets without a human operator. > Automobile manufacturers write software (Java, of course) that operates the > automobile—stop, start, accelerate, turn left, and so forth. Another > industrial group, electronic guidance instrument manufacturers, make > computer systems that receive GPS (Global Positioning System) position data > and wireless transmission of traffic conditions and use that information to > drive the car. > > The auto manufacturers must publish an industry-standard interface that > spells out in detail what methods can be invoked to make the car move (any > car, from any manufacturer). The guidance manufacturers can then write > software that invokes the methods described in the interface to command the > car. Neither industrial group needs to know how the other group's software > is implemented. In fact, each group considers its software highly > proprietary and reserves the right to modify it at any time, as long as it > continues to adhere to the published interface. > (http://docs.oracle.com/javase/tutorial/java/IandI/createinterface.html) So we create an interface like this:               public interface OperateCar {             // constant declarations, if any             // method signatures             // An enum with values RIGHT, LEFT        int turn(Direction direction,                 double radius,                 double startSpeed,                 double endSpeed);        int changeLanes(Direction direction,                        double startSpeed,                        double endSpeed);        int signalTurn(Direction direction,                       boolean signalOn);        int getRadarFront(double distanceToCar,                          double speedOfCar);        int getRadarRear(double distanceToCar,                         double speedOfCar);              ......        // more method signatures     }      and implement it as:               public class OperateBMW760i implements OperateCar {              // the OperateCar method signatures, with implementation --         // for example:         int signalTurn(Direction direction, boolean signalOn) {            // code to turn BMW's LEFT turn indicator lights on            // code to turn BMW's LEFT turn indicator lights off            // code to turn BMW's RIGHT turn indicator lights on            // code to turn BMW's RIGHT turn indicator lights off         }              // other members, as needed -- for example, helper classes not          // visible to clients of the interface     }      So far so good. Now suppose that, in addition, each car manufacturer is required to create a prototype car, and suppose that, for some reason, we wish to keep track of these prototype cars. One solution is to add a new method to the `OperateCar` interface:               public OperateCar getPrototype();      Then each implementing class could implement this method by returning its prototype car. But there's a problem with this: the prototype car has nothing to do with any instantiation of the implementing class; instead, it belongs to the class itself. In other words, if we didn't have the interface, we'd automatically declare this method as `static`. But we can't do that here, because Java interfaces don't allow static methods. What are the problems associated with not declaring a class-method static? Is it OK in this case just to leave out the `static` keyword so that the code compiles? Or are the drawbacks so great that it's better to look for another solution?


title: Sprint pressure causes quality issues?

text: The burn down chart displays a clear deadline and the progress towards the deadline. When the progress is slow and the completion of the committed work is at risk, people start to get sloppy on design and code reviews and on the depth of testing. Quality suffers. The question is whether in your organization you were successful to maintain high quality standards regardless of the time remaining to the end of the Sprint. Another question is whether perhaps it is best to drop the burn down chart to somewhat reduce the pressure or even move from Scrum or Kanban or other agile methodology that doesn't mandates iterations.


title: Do I own copyright of program I made in own time?

text: I created a software package that aids electrical engineers with common calculations used on site (substations to be specific). I created the package in my own time, without being asked and without guidance. The package is now widely used within my company and I intend to distribute it nationally. Do I own the copyright? My contract does state that all work produced is theirs, but this was outside of work and outside of my 'scope of work'. My company is mainly a civil and construction company and had no influence in the creation of the program. **From comments:** This is the paragraph "During the course of your service, you will disclose to the company all information, formulae, processes, inventions or improvements which you have learned, discovered or evolved during the course of your service or in connection with the business of the company and will sign any necessary documents to enable the company to obtain patent protection whether still in the company service or not. " They are taking it seriously and have got their lawyers. UPDATE::::::::::::::: email just received Dave, As you know we've been pursuing the request you and your patent attorney raised earlier this year, paraphrased below: ... a patent attorney, who has advised me to seek official clarification from _{redacted}_ over the IP and copyright ownerships before I launch the company. In effect, they will produce a legal contract which states all IP and copyrights are owned by my self in exchange for free copies of _{redacted}_ for all MUS engineers. The free offer doesn’t extend to partner companies. This review process has taken longer than hoped as we are obliged to review our contractual position with the _{redacted}_ and also with our employer _{redacted}_. However, _{redacted}_ are willing to release all IP an copyrights on the condition that we continue to use _{redacted}_ for our _{redacted}_ engineers and receive a 15% royalty on the profits derived from the sale of _{redacted}_ licences over a term to be agreed. I am more than happy to discuss this proposal with you at a mutually convenient time, and we can use your legal advisors or ours to draft a IP transfer agreement. Kind regards, _{redacted}_


title: Node.JS testing with Jasmine, databases, and pre-existing code

text: I've recently built the start of a core system which is likely going turn into a monster product. I'm building the system with node.js, and decided after I got a small base built, that It'd be a great idea to start using some sort of automated test suite to test the application. I decided to use jasmine, as it seems pretty solid and has a lot of features for stubbing spying and mocking methods and classes. The application has a lot of external data stores and api access (kestrel, mysql, mongodb, facebook, and more). My issue is, I've got a good amount of code written that I want to start testing - as it represents the underpinnings of the application. What are the best practices for testing methods/classes that access external APIs that I may or may not have control over? As an example, I have a data structure that fetches a bunch of data from a MySQL database. I want to test the method that retrieves the data; and I'm not sure how to go about it. I could test the `fetch` method which is supposed to return an array of objects, but to isolate the method from the database, I need to define my own fixture data. So what I end up doing is stubbing the mysql execution, and returning a static dataset. So, I end up writing a function that returns the dataset that makes my test pass. That doesn't seem to actually test the code, other than verifying a method is being called. I know this is kind of abstract and vague, it seems that the idea of testing is very much abstract though, so hopefully someone has some experience and can guide me in the right direction. Any advice, or reading I can do is more than welcomed. Thanks in advance.


title: How long does one have to wait to consider design change in code?

text: I had a few days ago. I was having trouble with threads. Had lots of questions asked on StackOverflow and honestly for the first time I did not get the answer I was looking for. Finally, I decided to do a huge re-design of my system code and magically within a few hours I found a solution. So my question is, is it normal to often do a re-design if I get stuck with a problem or should I push on hard till I find a solution? Mind you this is the first time I was stuck for this long on a piece of code.


title: Team Software Development using Ruby on Rails

text: I used to work alone on small to medium sized programming projects before and **have no experience working in a team environment**. Currently, there will be 3 of us in an in-house software development team that is tasked to develop a number of software for an academic institution. We have decided to use the web for the majority of the projects and are planning to choose Ruby on Rails for this and I would like to ask for your inputs, advices and approaches with regards to software development as a team using the RoR web framework. One thing that has really confounded me is how you divide the programming tasks of a project if there are 3 of you that are really doing the coding. It’s obvious that we as developers approach a problem in a modular way and finish it one after another. If the project consists of 3 modules, should each one of us focus on each of those modules? Would it be faster that way? How about if the 3 of us would focus on one module first (that’s what I really prefer). Is using a distributed version control system such as Git the answer to this type of problem? Please don’t forget to put your tips and experiences with regards to team software development. Cheers!