How effective are code signing certificates when it comes to customer behavior or acceptance?

Whenever a potential customer downloads a copy of my software they get the "Unknown Publisher" warning message. I understand that if I purchase a code signing certificate this message goes away and the customer does not get the scary warning. I'd like to know if anyone has information on how effective these code signing certificates are with regard to customer behavior. What difference did you see in customer behavior or acceptance after you signed your code using a certificate?


Why did the creators of the Internet Protocol decide to use IP addresses to identify a particular computer? Why not just have a unique ID assigned to each computer upon manufacture, then use that ID for identification of the computer?


An efficient way of starting an arbitrary number of consumer threads?

I have a Producer/Consumer implementation where the number of consumers is configurable (this is a form of configurable throttling). The producer and consumer are kicked off like this:               var cts = new CancellationTokenSource();     var processCancelToken = cts.Token;          Task.Run(() => Parallel.Invoke(new ParallelOptions() { CancellationToken = processCancelToken }                                    , producer                                    , consumer                                    )                    , processCancelToken);      The producer action is quite simple and just populates a BlockingCollection with objects that are derived from System.Threading.Tasks.Task (yes it is possible!). Here is a simplified example:               var pollingInterval = 30000;          var producer = new Action(() =>     {         Random rnd = new Random(DateTime.Now.Second);         while (!processCancelToken.IsCancellationRequested)         {             for (int ii = 0; ii < 10; ii++)             {                 var r = rnd.Next(2, 15);                 _mainQueue.Add(new Task(() =>                 {                     //this is a dummy task for illustrative purposes                     Console.WriteLine("        Queued task starting, set to sleep {0} seconds, ID: {1}", r, Thread.CurrentThread.ManagedThreadId);                      Thread.Sleep(r*1000);                 }));                 Console.WriteLine("    Producer has added task to queue");                  }             System.Threading.Thread.Sleep(pollingInterval);         }         Console.WriteLine("Exiting producer");     }      For this example it creates an anonymous task that sleeps for a random number of seconds between 2 and 15. In the real code this producer polls the database, extracts data entities representing work items, then transforms those into executable tasks that are added to the collection. I then have a consumer task that uses a `Parallel.For()` to start _n_ instances of an anonymous action which then dequeues a task from the collection, then starts and waits on the task, then repeats:               var numberConsumerThreads = 3;          var consumer = new Action(() =>     {         Parallel.For(0, numberConsumerThreads, (x) =>         {             //this action should continue to dequeue work items until it is cancelled             while (!processCancelToken.IsCancellationRequested)             {                 var dequeuedTask = _mainQueue.Take(processCancelToken);                 Console.WriteLine("   Consumer #{0} has taken task from the queue", Thread.CurrentThread.ManagedThreadId);                      dequeuedTask.Start();                 while (!processCancelToken.IsCancellationRequested)                 {                     if (dequeuedTask.Wait(500))                         break;                     Console.WriteLine("   Consumer #{0} task wait elapsed", Thread.CurrentThread.ManagedThreadId);                 }             }             Console.WriteLine("Exiting consumer #{0}", Thread.CurrentThread.ManagedThreadId);         });     }      **The question:** is this an efficient way to start and operate an arbitrary number of consumers? Or is there a more efficient way of using PLINQ from within the main consumer action that both continues to execute queued tasks, blocks while there isn't any, and can still be cancelled using `processCancelToken`? (Note: `processCancelToken` is operated separately to cancel tokens contained within the queued tasks - they are independently cancelable. This all runs within a Windows service and `processCancelToken` is used to cancel everything if the service is stopped).


Make or Buy: Web Based Accounting App Advice needed…

My company has a client (in the US) that currently offers small businesses web-based payroll software. They want to offer small businesses a web-based accounting package that integrates well with their current web-based offerings. The company does have a CPA on staff which is a bonus. To this point they have said it needs to be a double-entry accounting system, GL, subledger, sales invoicing, cash receipts processing, payables entry and payment processing. So my question is … Should we try and write this ourselves from scratch with the on-staff CPA, try the open source path and see if we can adjust it to what we need or is there a different option that I’m not thinking of? Any advice in any direction would be greatly appreciated.


Module system for OOP language

I'm designing a simple OO programming language. It's statically typed, compiled, and executed by a VM - similar to Java. The difference is that I don't want to have such a strong emphasis on OOP. The code itself will mostly resemble C++ (classes, functions, and variables allowed in the file scope). One of the things that I need to have is a module system. I have the following figured out:   1. Every file is a module (once compiled) - like Python   2. Programmers must import a module with the `import` keyword, which causes the compiler to search for modules in standard directories and the file directory (the VM has to do this at runtime as well) And now I have no idea how should I introduce the concept of submodules and module hierarchy. One option, for example, is to depend on the directory hierarchy, so that `import engine.graphics.renderer` would expect to find a directory called "engine" in the working directory, and inside a directory called "graphics", with a module called "renderer". What are the drawbacks of such a design? Am I missing anything?


How is quality important to the programmer, the person?

I didn't ask how the quality of the software is important to the product itself, the customers/users, the manager or the company. I want to know how it is important to the **programmer** that build it. I'll be interested in any **books** (please specify the chapter), **articles** , **blog post** , and of course your **personal opinion** on the subject regardless your experience.


How to present self-taught knowledge?

I work as a senior software engineer (5+ years of exp) at the moment at my company, developing some networked systems. Since a year, I've noticed that I'm becoming increasingly interested in distributed/high-performance file systems (like apache hdfs, GFS) , cloud- scale databases (like azure table storage, hypertable) and that led me to start reading a lot about it. I've started buying books, playing with existing similar open-source software, reading their source code and modifying them as an exercise. To sum up, I've read around 10 books on that topic (including topics that are somehow relate to DFS, like low-level high-performance IO optimization techniques, to minimize the hardware-related latency), spent approximately 15-25 hours per week hacking some code in that area, implementing some small proof-of-concept projects for a whole year. It was pretty fun. But as it is said that the appetite grows with eating, and now I want to start spending all my days working on such systems - in short, change my job and start developing a commercial, widely used DFS. Now, is there a way other than going back to school and doing a PhD on that topic, to find a job that would be related to an area that has not been on my resume (commercial experience) for the past five years? How to convince an employer that I have managed to gain more knowledge than my resume is showing in that area? I am aware that I would be applying for a much less senior position that currently I'm holding.


Will javascript be in the HTML5 standard

I'm pretty new to the web development scene, and I just want to be absolutely clear on this because I've read a few conflicting statements. I was under the impression that "html5" is a particular way of constructing xml to represent data for a webpage and "javascript" is a programming language that runs as client-side code in the browser. But left and right I see APIs for javascript (workers, geolocation, local storage, etc.) being referred to as an "html5 technology". Wikipedia says that html5 doesn't have a standard yet, so I can't look it up to see if it somehow mandates stuff about javascript. So will APIs for javascript somehow be apart of the html5 standard? Or has it become a common bad practice to label javascript APIs "html5 technology"?


Best practice: Secure Android app online authentication

Currently, I develop an Android App needing online authentication for login (and registration). The main focus is on **security**. I’m amaing for:   * keeping the users’ passwords safe and   * preventing MITM attacks. Secondary aims are performance and user experience. Besides, I’d prefer not to use third-party solutions. I studied a lot about different approaches[1][2][3]. My problem is now how to _combine_ these ideas into _one_ secure mechanism. To put it differently, **have I overlooked something?** Long story short, I came up with the following: ![Flowchart. Basically, if an authToken is present, it is sent to the server and checked there. If successful, the login process is completed. Else or if no token was present, the user has to enter his credentials. His/Her password is hashed, sent to the server which generates a token and doing so completes the process and enables the user to login automatically the next time.](http://i.stack.imgur.com/ZnxZO.png) The illustration you see shows the login process performed by the app’s background Service before it downloads notifications for this user. The idea is to send the hashed user password only once and then to work with a server- side generated authentication token which is kept in an encrypted **KeyStore** on the phone and renewed on every login process. Further information: The app–server communication is done over **HTTPS**. The hash is a randomly **salted** **bcrypt** created on the phone. The database table consists only of `id`, `username`, `hash`, `salt`, `authtoken`. What do you think about these considerations?   I am looking forward to your critism and feedback. Qdeep _Some ideas were “stolen” in theThe definitive guide to form based website authentication here on SO. Others found by searching for `android secure authentication`._


Better support for controlling printing options like headers and footers from Javascript

Why is it that browsers do not provide a mecanism to set the printing defaults regarding headers and footers from within the app? Web apps are fully fledged apps nowadays, and modern browsers are capable of sending a very well formatted page to a printer (or even download it as a PDF), but web apps cannot rely on this method because browsers don't allow them to control the metadata completely. Current possibilities don't allow websites to store the printing settings along with the report or file on the server. Each browser provides it's own mandatory dialog form to set printing settings that could be replaced when needed by a more convenient experience: in-app options, adapted to the use case, cloud-persistent and consistent along different browsers. The options that are currently available are:   1. Delegating part of the work on the user (i.e., having him/her change the metadata options and paper size/orientation themselves).   2. Using other methods that can quickly become too expensive and complicated, like generating PDF's on the server for the user to download. Opting for number 1 is not always our decision. As professional web developers, the final users are usually not our direct clients, but our client's target audience. Also, we would be forcing the final user to do extra work. Experience says that it wouldn't be done and reports will be printed with the default settings of the browser, usually with headers and footers that the user don't really want (and the associated paper waste if he/she decides to print it againg without them). Option 2 --generating server side PDF's-- is becoming less of an option every day. Modern web apps are heavy users of javascript, and reports benefit from excellent plotting libraries made with JS that can generate charts in HTML canvas elements that could be printed right away if we weren't using this "do it all over again on the server" approach. The resulting reports never look the same, and programmers have to maintain two versions of every report.   Moreover, generating PDF's on the server can be really slow and resource consuming. So, is there a compelling reason why browsers programmers opted not to support this kind of customization?


What was Java enterprise programming like before Eclipse?

I'm your standard Java/Oracle developer at a large software firm and Eclipse 3.6 is what I spend most of day in. Java is incredibly verbose and that can be painful (but we don't need another blog post explaining this), but Eclipse eases a lot of that pain with one-click renaming, auto-completion, dynamically adjusting your classpath, etc. I cannot imagine trying to do my job without a tool like Eclipse at my disposal. So for those of you who were around before my time, what was it like? The disadvantages are obvious, but were there any advantages?


To branch or not to branch?

Till recently my development workflow was the following:   1. Get the feature from product owner   2. Make a branch (if feature is more than 1 day)   3. Implement it in a branch   4. Merge changes from main branch to my branch (to reduce conflicts during backward merging)   5. Merge my branch back to main branch Sometimes there were problems with merging, but in general I liked it. But recently I see more and more followers of idea to not make branches as it makes more difficult to practice continuous integration, continuous delivery, etc. And it sounds especially funny from people with distributed VCS background who were talking so much about great merging implementations of Git, Mercurial, etc. So the question is should we use branches nowadays?


Understanding branching strategy/workflow correctly

I'm using svn without branches (trunk-only) for a very long time at my workplace. I had discovered most or all of the issues related to projects which do not have any branching strategy. Unlikely this is not going to change at my workplace but for my private projects. For my private projects which most includes coworkers and working together at the same time on different features I like to have an robust branching strategy with supports long-term releases powered by git. I find out that the Atlassian Toolchain (JIRA, Stash and Bamboo) helped me most and it also recommending me an branching strategy which I like to verify for the team needs. The branching strategy was taken directly from Atlassian Stash recommendation with a small modification to the hotfix branch tree. All hotfixes should also merged into mainline. ![Planned Branching Strategy](http://i.stack.imgur.com/zOdcE.png) **The branching strategy in words**   * _mainline_ (also known as _master_ with git or _trunk_ with svn) contains the "state of the art" developing release. Everything here was successfully checked with various automated tests (through Bamboo) and looks like everything is working. It is not proven as working because of possible missing tests. It is ready to use but not recommended for production.   * _feature_ covers all new features which are not completely finished. Once a feature is finished it will be merged into _mainline_. Sample branch: `feature/ISSUE-2-A-nice-Feature`   * _bugfix_ fixes non-critical bugs which can wait for the next normal release. Sample branch: `bugfix/ISSUE-1-Some-typos`   * _production_ owns the latest release.   * _hotfix_ fixes critical bugs which have to be release urgent to _mainline_ , _production_ and all affected long-term *release*es. Sample branch: `hotfix/ISSUE-3-Check-your-math`   * _release_ is for long-term maintenance. Sample branches: `release/1.0`, `release/1.1` `release/1.0-rc1` * * * I am not an expert so please provide me feedback. Which problems might appear? Which parts are missing or slowing down the productivity?


Web API Development and SVN

We are planning to develop a ASP.NET Web API project starting soon. For source control we use svn. We typically follow the pattern of the trunk being stable and doing all of our work in the branches. Most of the time we are lucky that one developer is working on the project. For this Web API project there are at least two, possibly three developers working on different parts. By this I mean that one may be working on a set of controllers for working with document models while the other developer is working on a controller or controllers for user authentication and maintenance. Seeing that these two should not have overlapping work what are advantages/disadvantages to both developers working on a single branch with daily "updates to latest version" to keep both working copies consistent versus each developer working on an individual branch and merging the two branches back into the trunk when they are complete? It seems to me that a single branch would be better in that the daily updates will keep each developer up on what the other is doing and this can possibly help share code. My main concern is with performing trial and error coding. What happens when some code is committed that really probably should not be pulled down by the other developer? Should that even be a concern? Another thought I had was that with each developer having their own branch if either developer has code that the other can use that is stable enough we merge that back to the trunk. Then the developers would update daily from the trunk instead. Finally I had a thought that maybe we create one branch for this "feature set" and then each developer branch from that branch. They would then push stable features back to the main branch and update daily from the main branch. This would keep the trunk clean and stable until the feature set is released. Those are my thoughts and sorry for the long question. I really want to start this project right and any guidance would be greatly appreciated.


Can branching ever be considered a bad practice?

> **Possible Duplicate:**   >  To branch or not to branch? A co-worker is against branching. I use branching all the time. I put the team onto a basic 3 branch system. I create my own feature branches. Said co-worker tends to have good ideas, follow best practices and I tend to agree with him on many such things. Except this. The successful software shops I've read about: Microsoft, Google, fogcreek all use branching. My co-worker argues that because of the way our shop runs (medical field), branching causes problems. Instead, he says we should create many small project's (*.csproj files) and never work on the same code at the same time. I agree, we have issues with merging. I argue the root cause of these issues are a lack team communication and a lack of knowledge on how to correctly use our source control system to full effect (TFS). I consider his approach to be programming in Silo's and a DLL management nightmare. Are there situations where Branching is a bad idea? Am I wrong?


Develop in trunk and then branch off, or in release branch and then merge back?

Say that we've decided on following a "release-based" branching strategy, so we'll have a branch for each release, and we can add maintenance updates as sub-branches from those. Does it matter whether we:   1. develop and stabilize a **new** release in the trunk and **then** "save" that state in a new release branch; or    2. first create that release branch and only merge into the trunk when the branch is stable? I find the former to be easier to deal with (less merging necessary), especially when we don't develop on multiple upcoming releases at the same time. Under normal circumstances we would all be working on the trunk, and only work on released branches if there are bugs to fix. What is the trunk actually used for in the latter approach? It seems to be almost obsolete, because I could create a future release branch based on the most recent _released_ branch rather than from the trunk. **Details based oncomment below:**   * Our product consists of a base platform and a number of modules on top; each is developed and even distributed separately from each other.    * Most team members work on several of these areas, so there's partial overlap between people.   * We generally work only on 1 future release and not at all on existing releases. One or two might work on a bugfix for an existing release for short periods of time.   * Our work isn't _compiled_ and it's a mix of Unix shell scripts, XML configuration files, SQL packages, and more -- so there's no way to have push-button builds that can be tested. That's done manually, which is a bit laborious.   * A release cycle is typically half a year or more for the base platform; often 1 month for the modules.


Git branches avoided by the office where I work

The place I work at does the following:   1. They manage a dev version of an app    2. They manage another replicate version of that app, they call this the rep version   3. The live version of the app that is running   4. They believe branches are evil We are asked to manually copy paste the code from one version to another. What are the circumstances under which git branches are considered harmful?(we all add code to master)


Values, types, kinds, and…?

We all know what a value is. A type is the type of a value. A kind is (loosely) the type of a type. A type constructs a value; a kind constructs a type. So what is the type of a kind, a thing that constructs kinds? Is there such a thing? Does it have a name? Is it useful?


How should the cppcms template hierarchy be used

I understand that the hierarchy, in cppcms for templates, goes skin (topmost, representing a namespace), then view (representing a class) and finally template (representing a function). I want to know when I should use a skin and when I should use a view; would each page be a skin or would it be a skin per application, etc. Could you explain when each should be used and could you give some examples?


Replace Type Code with Class (From Refactoring [Fowler])

This strategy involves replacing the likes of this:               public class Politician     {         public const int Infidelity = 0;         public const int Embezzlement = 1;         public const int FlipFlopping = 2;         public const int Murder = 3;         public const int BabyKissing = 4;              public int MostNotableGrievance { get; set; }     }      With:               public class Politician     {         public MostNotableGrievance MostNotableGrievance { get; set; }     }          public class MostNotableGrievance     {         public static readonly MostNotableGrievance Infidelity = new MostNotableGrievance(0);         public static readonly MostNotableGrievance Embezzlement = new MostNotableGrievance(1);         public static readonly MostNotableGrievance FlipFlopping = new MostNotableGrievance(2);         public static readonly MostNotableGrievance Murder = new MostNotableGrievance(3);         public static readonly MostNotableGrievance BabyKissing = new MostNotableGrievance(4);              public int Code { get; private set; }              private MostNotableGrievance(int code)         {             Code = code;         }     }      Why exactly is this preferable to making the type an enumeration, like so:               public class Politician     {         public MostNotableGrievance MostNotableGrievance { get; set; }     }          public enum MostNotableGrievance     {         Infidelity = 0,         Embezzlement = 1,         FlipFlopping = 2,         Murder = 3,         BabyKissing = 4     }      There is no behavior associated with the type and if there was you would be using a different type of refactoring anyways, for example, 'Replace Type Code with Subclasses' + 'Replace Conditional with Polymorphism'. However, the author does explain why he frowns on this method (in Java?): > Numeric type codes, or enumerations, are a common feature of C-based > languages. With symbolic names they can be quite readable. The problem is > that the symbolic name is only an alias; the compiler still sees the > underlying number. The compiler type checks using the number 177 not the > symbolic name. Any method that takes the type code as an argument expects a > number, and there is nothing to force a symbolic name to be used. This can > reduce readability and be a source of bugs. But when trying to apply this statement to C#, this statement doesn't appear to be true: it won't accept a number because an enumeration is actually considered to be a class. So the following code:               public class Test     {         public void Do()         {             var temp = new Politician { MostNotableGrievance = 1 };         }     }      Will not compile. So can this refactoring be considered unecessary in newer high-level languages, like C#, or am I not considering something?


What is lightweight lock in distributed shared memory systems?

I started reading Tanenbaum's Distributed Systems book a while ago. I read about two phase locking and timestamp reordering in transactions chapter. While having a deeper look from google I heard of lightweight transactions/lightweight transactional memory. But I couldn't find any good explanation and implementation. So what is lightweight memory? What are the benefits of lightweight locks? And how can I implement them?


Truth condition testing with BOOL

BOOL myBool;     myBool = YES;     ...     if (myBool) {       doFoo();     }      I have read that because there are instances where the above does not actually call the `doFoo()` function, it is best to instead always test against `YES`, as such:               if (myBool == YES)      But for the most part this just makes my code wordy and repetitive. Any thoughts?


APIs, Versioning and Models

I have my (JSON) API structured like this (which I'm pretty happy with): ### API Project               /_V1         /Controllers             V1EntityController.cs        // Applies to version 1 only     /_V2         /Controllers                   V2OtherEntityController.cs   // Applies to versions 2 and below     /Controllers/         EntityController.cs              // Applies to versions 2 and above         OtherEntityController.cs         // Applies to versions 3 and above      ### Core Project               /Data/Entity.cs     /Data/OtherEntity.cs      But as the project has progressed both the `Entity` and `OtherEntity` classes has become full of legacy properties and a bunch of `ShouldSerializexxx` methods. They also then also contain properties and sub-classes which are only for serialization. Would a better solution for this be to create "Models" in the API project like so: ### API Project               /_V1         /Controllers             V1EntityController.cs         /Models             V1EntityModel.cs     /_V2         /Controllers                   V2OtherEntityController.cs         /Models             V2OtherEntityModel.cs     /Controllers         EntityController.cs         OtherEntityController.cs     /Models         EntityModel.cs         OtherEntityModel.cs      Then convert to and from the classes in the core project? What's the industry recognised practice for handling this scenario?


Programming vs Planning

Recently, I have been tasked with more high-level planning assignments due to the lead developer of my team leaving. I hate long-term planning. My brain just doesn't naturally seem wired for it, and I am not interested enough in it to spend the time to learn it (it is hard enough to keep up with the programming side of the picture). Can one still be a good programmer without being a high-level planner, too? As a senior programmer, is one expected to be good at planning out the entire product and picking a date of completion?


What is Configuration Management?

In all projects that I have been involved with that have had input from an outside consultant the question has been asked about what sort of Configuration Management we were using. In none of these cases has the consultant been able to define Configuration Management. So what is it?


How to deal with an outsourcing company that brings your production system down?

We have a high load SAAS product and due to lack of resources the board has outsouced reporting and OLAP & Warehouse work to a 3rd Party Company. When we started working with them, they accidentally DOS'ed our production system, now they have made too many long running queries on the production databases and slowed the system down to unuseable. They are about to deliver and we have a maintainence contract with them. How do you deal with 3rd companies you can't really trust no to bring your production system down? And what do you do about it when they do? Has anyone any experience of this? (note they have a test environment set up to do everything they need to on). I'm not looking for answers on how to prevent someone bringing down our system, I'm after what to do with the 3rd party company itself.


Unit testing in Django

I'm really struggling to write effective unit tests for a large Django project. I have reasonably good test coverage, but I've come to realize that the tests I've been writing are definitely integration/acceptance tests, not unit tests at all, and I have critical portions of my application that are not being tested effectively. I want to fix this ASAP. Here's my problem. My schema is deeply relational, and heavily time-oriented, giving my model object high internal coupling and lots of state. Many of my model methods query based on time intervals, and I've got a lot of `auto_now_add` going on in timestamped fields. So take a method that looks like this for example:               def summary(self, startTime=None, endTime=None):         # ... logic to assign a proper start and end time          # if none was provided, probably using datetime.now()              objects = self.related_model_set.manager_method.filter(...)              return sum(object.key_method(startTime, endTime) for object in objects)      How does one approach testing something like this? Here's where I am so far. It occurs to me that the unit testing objective should be _given some mocked behavior`by key_method` on its arguments, is `summary` correctly filtering/aggregating to produce a correct result?_ Mocking datetime.now() is straightforward enough, but how can I mock out the rest of the behavior?   * I could use fixtures, but I've heard pros and cons of using fixtures for building my data (poor maintainability being a con that hits home for me).   * I could also setup my data through the ORM, but that can be limiting, because then I have to create related objects as well. And the ORM doesn't let you mess with `auto_now_add` fields manually.   * Mocking the ORM is another option, but not only is it tricky to mock deeply nested ORM methods, but the logic in the ORM code gets mocked out of the test, and mocking seems to make the test really dependent on the internals and dependencies of the function-under-test. The toughest nuts to crack seem to be the functions like this, that sit on a few layers of models and lower-level functions and are very dependent on the time, even though these functions may not be super complicated. My overall problem is that no matter how I seem to slice it, my tests are looking way more complex than the functions they are testing.


Wise way to implement a website login and database tables for a small shop

Im building this website for a small store and I was told that its better **not** to keep the login and the rest of the users information on the same table. Now im wondering, what is the best way to implement this website's database? Some of the database tables are:   * Customers   * Providers   * Products   * Etc.. I need to have different users, after someone is logged in the site, depending on their rights they can do a series of things:   * If they are a customer they can order stuff   * If they are employees they can order stuff, manage stock, add customers, etc   * If they are the owner or administrator they can add employees and everything else. Should I keep the login and the rest of the information of the user in the same table?


How to (professionally) back up reasons for choosing open source technologies in a large project

I know the title is a bit vague so I'll try to be more precise in explaining what's my actual question (I apologize in advance if this is a duplicate). I work for a small company (8 people) that works with Linux / PHP / MySQL to deliver various solutions (CRM amongst everything) to several larger financial institutions. The process of actually winning the contracts was always painful and I was tasked with explaining why use MySQL and not MSSQL or PostgreSQL or Oracle 11g, why use PHP and not a compiled language or ASP.NET or Java and the list goes on. And this is the problem - I really am not proficient enough with mentioned commercial solutions (databases). I've done some worth with mentioned databases, but that was simple testing, such as how to create view in this RDBMS opposed to MySQL, how to do a trigger here, how to declare a stored procedure here, how to profile a query - but, I've never worked with any of the mentioned databases extensively as much as I have with MySQL. On the other hand, I've been introduced to MySQL in early 2000. only to be more and more proficient with it, its quirks and even extending it trough UDFs or hacking the source code in order to see how things work behind the scene - so, as I like to think, I know how MySQL works, what to expect of it and how to add functionality we require. A few days ago we started initial negotiations with our next-to-be client who is in need of bespoke solution for client / business management. They have their own team, however those people didn't succeed in delivering what the company actually needs - which is where my company enters. Naturally, first thing I wanted to know was what kind of technology was used to build systems that are currently running and keeping the client's company running - and I saw things from Postgres for smaller apps to MSSQL for the actual client database. Of course, as the company isn't satisfied with their current system(s), that implies something is going wrong. Currently, there's no way of synchronizing data between the main company and its branches, thus - there's no unified client database. It's incredibly hard to track expenses, again - due to disparate systems. And here is what I have problems with - as soon as I mentioned technology we use, the company's development team frowned upon us and belittled us saying that open source technologies are insecure, buggy, prone to hacking, slow opposed to commercial ones (without any actual proof). Just for argument's sake, I've worked with larger datasets built upon MySQL (25TB+) that stores various information and I've been able to keep up with any requirement I had so far when it comes to response times and performance of the application built upon MySQL. But, since I am not experienced enough with other databases - I'm unable to provide actual facts representing that technology I use is at least on par (if not better + cheaper!) than commercial solutions. How would you defend your (my) position when faced with a technical person who favors Microsoft's software over open source one in a company that employs several tens of thousands of people with over 10 million customers? Would you even choose MySQL for the database behind a system that should be powering such a large company? If not, what would you choose and why? Sorry for the wall of text :)


What are some good examples of using pass by name?

When I write programs I using pass by value or pass by reference always seem to be logical methods. When learning about different programming languages I came across pass by name. Pass by name is a parameter passing method that waits to evaluate the parameter value until it is used. See Stack Overflow pass by name question for more information on the method. What I would like to know is: what are some good examples and/or reasons to use pass by name and should it be re-introduced into some more modern languages.


Pulling changes from master to my work branch?

There's two of us working on something. We're using this branch structure   * master   * dev-A   * dev-B We both work on separate branches (dev-A,B) and whenever we're done - we promote our changes to master. But the drawback of this is we can't get changes the other developer makes. Everything exists in the master tree - but we can't get the latest updates the other developer made. Is there a way to resolve this or should we change our branch structure (per feature?)?


Microsoft Most Valuable Professional Selection Criteria[SO?]

How are Microsoft's MVPs selected? I read somewhere that most of the professionals are selected on the basis of the usenet(other communities) performance. Is is true for SO as well. Can someone be elected as MS MVP on the basis of his/her stackoverflow performance?


How to represent a geometric line programmatically?

I have been trying to design a library to do some simple geometric computations in an Euclidean space regardless of its dimension. While it is easy to represent points, vectors, hyperspheres and hyperplanes in a generic fashion, I am still unable to find a generic way to represent a (infinite) line, even though lines share properties across dimensions. My best guess is that I could store some of the parameters of its parametric equation since it is easy to extend a parametric equation to a line in a space of any dimension:               x = x0 + at     y = y0 + bt     z = z0 + ct     // can be extended to any dimension      But even with this equation, I can't find what should be stored and what should not be in order to compare lines. With an ideal solution, two objects of type `Line`:   * would be programmatically equal (with `operator==`),   * would have equal representations in the memory. What should I store in order to achieve that?


Feeling of Despair before programming?

When I have a programming assignment or some program that I have to start on I sometimes have this feeling of despair, I just do whatever to starting and then I just start feeling like crap, and that makes me not start even more...it's like a vicious circle. All my friends seem to just get things done...Is it just me or are there others that have this problem? Am I not a in "love" with programming? If there are others, how do you overcome this feeling and just start? EDIT: @Kennith it's actually kinda hard to describe but it kinda like very mild depression, i think it may be because the work required of us is so challenging. I remember in high school I loved programming because after learning the synthax of a language(ie java) you felt like an expert and could do a lot of programming. But in university the there is just so much complexity to programming and so many little things that I never considered before, log time, data structures, insane algorithms, graphs, np problems, etc.that I think I've lost that confidence that I once had. I don't think I've had to do any programming over the last 3-4 years where I knew much about what I was doing (had an overview but it was all new territory), every single project I work on is new material, new concepts, language, theory, etc. It's good for learning...in hindsight, but when your learning it's hard and frustrating. But you sort of never feel like your progressing or actually accomplishing anything. You feel good for a little while after finishing one proj, but as soon as you look the next one...its back to ground zero. What I love(d) about programming is that feeling of mastery, that was motivation enough, now when you're always doing something new, its really hard to get that feeling back.


Plagued by multithreaded bugs

On my new team that I manage, the majority of our code is platform, TCP socket, and http networking code. All C++. Most of it originated from other developers that have left the team. The current developers on the team are very smart, but mostly junior in terms of experience. Our biggest problem: multi-threaded concurrency bugs. Most of our class libraries are written to be asynchronous by use of some thread pool classes. Methods on the class libraries often enqueue long running taks onto the thread pool from one thread and then the callback methods of that class get invoked on a different thread. As a result, we have a lot of edge case bugs involving incorrect threading assumptions. This results in subtle bugs that go beyond just having critical sections and locks to guard against concurrency issues. What makes these problems even harder is that the attempts to fix are often incorrect. Some mistakes I've observed the team attempting (or within the legacy code itself) includes something like the following: **Common mistake #1** \- Fixing concurrency issue by just put a lock around the shared data, but forgetting about what happens when methods don't get called in an expected order. Here's a very simple example:               void Foo::OnHttpRequestComplete(statuscode status)     {         m_pBar->DoSomethingImportant(status);     }          void Foo::Shutdown()     {         m_pBar->Cleanup();         delete m_pBar;         m_pBar=nullptr;     }      So now we have a bug in which Shutdown could get called while OnHttpNetworkRequestComplete is occuring on. A tester finds the bug, captures the crash dump, and assigns the bug to a developer. He in turn fixes the bug like this.               void Foo::OnHttpRequestComplete(statuscode status)     {         AutoLock lock(m_cs);         m_pBar->DoSomethingImportant(status);     }          void Foo::Shutdown()     {         AutoLock lock(m_cs);         m_pBar->Cleanup();         delete m_pBar;         m_pBar=nullptr;     }      The above fix looks good until you realize there's an even more subtle edge case. What happens if Shutdown gets called _before_ OnHttpRequestComplete gets called back? The real world examples my team has are even more complex, and the edge cases are even harder to spot during the code review process. **Common Mistake #2** \- fixing deadlock issues by blindly exiting the lock, wait for the other thread to finish, then re-enter the lock - but without handling the case that the object just got updated by the other thread! **Common Mistake #3** \- Even though the objects are reference counted, the shutdown sequence "releases" it's pointer. But forgets to wait for the thread that is still running to release it's instance. As such, components are shutdown cleanly, then spurious or late callbacks are invoked on an object in an state not expecting any more calls. There are other edge cases, but the bottom line is this: **Multithreaded programming is just plain hard, even for smart people.** As I catch these mistakes, I spend time discussing the errors with each developer on developing a more appropriate fix. But I suspect they are often confused on how to solve each issue because of the enormous amount of legacy code that the "right" fix will involve touching. We're going to be shipping soon, and I'm sure the patches we're applying will hold for the upcoming release. Afterwards, we're going to have some time to improve the code base and refactor where needed. We won't have time to just re-write everything. And the majority of the code isn't all that bad. But I'm looking to refactor code such that threading issues can be avoided altogether. One approach I am considering is this. For each significant platform feature, have a dedicated single thread where all events and network callbacks get marshalled onto. Similar to COM apartment threading in Windows with use of a message loop. Long blocking operations could still get dispatched to a work pool thread, but the completion callback is invoked on on the component's thread. Components could possibly even share the same thread. Then all the class libraries running inside the thread can be written under the assumption of a single threaded world. Before I go down that path, I am also very interested if there are other standard techniques or design patterns for dealing with multithreaded issues. And I have to emphasize - something beyond a book that describes the basics of mutexes and semaphores. What do you think? I am also interested in any other approaches to take towards a refactoring process. Including any of the following:   1. Literature or papers on design patterns around threads. Something beyond an introduction to mutexes and semaphores. We don't need massive parallelism either, just ways to design an object model so as to handle asynchronous events from other threads **correctly**.   2. Ways to diagram the threading of various components, so that it will be easy to study and evolve solutions for. (That is, a UML equivalent for discussing threads across objects and classes)   3. Educating your development team on the issues with multithreaded code.   4. **What would you do?**


As a professional .NET developer, should you learn to work with MSIL using reflection?

I was reading through the code of StackOverflow's new SQL Object Mapper. And I noticed at the bottom of the SqlMapper.cs there is some code that I had never seen before. After reading some of the documentation on MSDN and a tutorial on MSIL this feels a little over my head. As a professional .NET developer (6 years), should I invest time to learn this? What is the advantage of understanding the ILGenerator? I hope I'm not confusing things and the question is clear. Thanks!


Generic Handler vs Direct Reference

In a project where I'm working on the data access layer I'm trying to make a decision how to send data and objects to the next layer (and programmer). Is it better to tell him to   1. reference my dll, OR   2. should I build a generic handler and let him take the objects from there (i.e. json format) If I understand correctly, In case of 2. he would have to handle the objects on his own, whereas in case 1. he will have the entities I've built. Note: It is very probable that other people would need to take the same data, though, we're not up to that yet. Same question here - should I make it into a webservice, or have them access the handler?


Migrating large system from WebForms to MVC

I'm looking for advice from people who have actually migrated a large system from WebForms to MVC. What are the things to watch out for? The literature says that both can co- exist for the same system but was it really that easy? Was managing authentication between the two seamless? Was maintenance easier/tougher after that? Thanks.


Storing a mailing address in a database: What structure should I use for International apps?

I will have international users use my database, but I don't know how the mailing system operates outside of the US. Are the concepts "City", "State, Country and possibly "Zip" sufficient to capture any hierarchy (even if it was only 2 levels deep: (city/country)


How exactly can I check for new rows in sql with ajax?

How do certain services, just like google plus and facebook, check for new content without reloading the page? Whenever you are on any of those websites a new notification of a post related content just pops up without the need to refresh the page. Can someone give me some tips on how this works? :)


Fear of releasing a hobby project - how to overcome?

I don't know if this question is strictly related to software development, but still I'll give it a try: Like a lot of programmers, I love to work on hobby projects. Sometimes, seemingly good ideas turn out to be not so good, so I drop the project. But sometimes, something useful comes out of the project. So, I could release it, present it to the world, right? Wrong. Somehow, I don't seem to be able to make this step. I fear that my code is not good enough, I can always think of things which are suboptimal, of features which could be added. So, I don't release anything, I lose interest, and at one point abandon the project. Is this normal? How do you overcome such a situation?


How do I better engage the users who starred my project on GitHub?

I recently put up a project, called Hebel, that I've been working on to GitHub. It's a framework for GPU accelerated deep learning written in Python and Nvidia CUDA. I posted about it on Google+ and soon afterwards it was picked up on Hacker News and went slightly viral for a few days. I later posted about it again in the Machine Learning subreddit as well and altogether my project picked up 822 stars and 47 forks on GitHub, which was really exhilarating. 822 stars means my project is in the top 200 Python projects on GitHub and in fact has more stars than some high profile and widely used Python projects like virtualenv. Despite the considerable interest for my project, I'm very disappointed with the actual engagement I have seen so far. None of the 47 forks of my projects have ever had any commits, I haven't received any pull requests, and only three issues submitted were submitted by two people. It seems that my project is potentially very interesting to many people, but they only star or fork it once and then never return to it again or use it on a continuous basis. How can I improve engagement in order to have users either submit bugs or enhancement requests or have contributors submit changes?


Static Methods in Business Layer to achieve data from DAL! Yes? No?

Some advice here, I've run into a system where the DAL contents of hundreds of sql command calls are split up on a class per table. There are also a Business layer which get it's data from this DAL, recieving it further to other methods and layers in other places. Nearly 100% of those Business Methods are pure forwarding of data. Few of them contain logic that affect the data (because the data are already sorted/evaluated or somewhat in the sql-commands/stored-procedures. **Now to the real question.**   All of those methods in business layer are static.   This is easy because I can call them from everywhere without instantiation.   Is static methods really preferrable?   Why and how do you think? I mean static methods need to be in heap and so far I really can't se the cosmetic profit because of it. I also feel the whole system is very hard to debug, especially now because the system has V E R Y high variety of response time, without many changes in load from users.


Is reusability roughly synonymous with good design?

Reusability is a feature of good software design. Is reusability an acceptable gloss ("brief notation of the meaning") for good software design? Why?


Software background building tools

I develop a cross-platform project (Windows, Linux, Mac OS X) and use CMAKE, some python and platform-dependent scripts (sh, bat) for construction. Nevertheless I find the process of construction before release rather boring and annoying. Switching between computers, typing commands, copying binaries, eeww. Does anyone use some kind of building daemon? Something which can build project in the background by request or by reading special git/svn commit message.


Switch vs Polymorphism when dealing with model and view

I can't figure out a better solution to my problem. I have a view controller that presents a list of elements. Those elements are models that can be an instance of B, C, D, etc and inherit from A. So in that view controller, each item should go to a different screen of the application and pass some data when the user select one of them. The two alternatives that comes to my mind are (please ignore the syntax, it is not a specific language) 1) switch (I know that sucks)               //inside the view controller     void onClickItem(int index) {         A a = items.get(index);              switch(a.type) {              case b:                  B b = (B)a;                  go to screen X;                  x.v1 = b.v1; // fill X with b data                  x.v2 = b.v2;               case c:                  go to screen Y;              etc...         }     }      2) polymorphism               //inside the view controller     void onClickItem(int index) {         A a = items.get(index);         Screen s = new (a.getDestinationScreen()); //ignore the syntax         s.v1 = a.v1;   // fill s with information about A         s.v2 = a.v2;         show(s);     }          //inside B     Class getDestinationScreen(void) {         return Class(X);     }          //inside C     Class getDestinationScreen(void) {         return Class(Y);     }      My problem with solution 2 is that since B, C, D, etc are models, they shouldn't know about view related stuff. Or should they in that case?


MVC class modeling

I have following requirement and I am trying to design class diagram. This is the first time I am creating class diagram so I would like to get some advice from experts.. :) This is a simple login functionality implementation using mvc. ![enter image description here](http://i.stack.imgur.com/zssbk.jpg) I have a login controller that take login and logout request from the view. It uses security module class to authenticate users, check if the user already logged in or not and holds the list of logged in users. Would you consider this as a valid approach? and also if you can point out the room for improvement, I would really appreciate. Thanks.. :)


I'm currently a student in software engineering and I am very passionate in computer science. In my university we learn how to design an application with design patterns and a bunch of other techniques to have a good software. But I have a really bad problem: I want to know everything. I'm currently writing a little game engine in c++ while I write an application for iOS5 while building a website for a client while doing my homework, and my homework takes a lot of time for not that much learning. I Recently came to a conclusion: I can't achieve all my projects. Some of my friends tell me to drop university so I can learn faster because I will be able to work my other projects at my _fast_ rhythm. Do you think university is a good learning environment or is it better to be autodidact?


Do I need a degree in Computer Science to get a junior Programming job?

Do I need to go to Uni to get a job as a Junior C# coder? I'm 26 and have been working in Games (Production) for 6 years and I am thinking of a change, I've had exposure to VB6, VBA, HTML, CSS, PHP, JavaScript over the past few years and did a web design NCFE at College, but other than that, nothing else! I'm teaching myself C# at the moment with books and I was wondering 'how much' I need to learn and also how I can improve my chances of getting a programming job! Am I a late started to learn coding? (I know many people who started at a very young age!) Thanks for the help :)


Onion Architecture Structure

I am looking to understand and implement the Onion Architecture and have a vague idea on how to structure everything but need help to clear up some of my confusion. ![Onion Architecture](http://i.stack.imgur.com/iyWBg.png) Based on different examples and articles I Have read I created the above structure. One of my main confusion comes when I look at "02-Service: Services Interfaces". Lets take the IUserService.cs. I assume this interface would contain different signatures like RegisterUser(), LoginUser(), BanUser(), ModifyUser(), ChangeAuthenticationLevel() and so on? Is this correct? If not what other examples would we find? And are these considered Domain Services or Application Services?


Preventing ip resolvers in a skype-like program

I'm currently in the process of creating a Skype-like program, that uses a hybrid peer to peer system to communicate between users (i.e. server contains all users IPs, a client that wants to connect to a friend will tell the server, that will then send each client the other's IP so they could start hole punching to establish a connection between them). I know that with Skype, there are many websites that allow you to enter a username and easily get his IP address. My question is, what is the best way of preventing such an exploit? Here are a few solutions I could think of:   * save each and every users' friends lists on the server (so the server can just drop IP requests from users that aren't in the requested client's friends list)   * whenever the server is asked for a client's IP, ask that client if the asker is on their friends list (if not, don't reply)   * have each client use some secret key to communicate with the server (so only registered clients will be able to send IP requests) Feel free to add a different solution, again, these are just solutions I could think of off the top of my head while writing this question. In addition, a related question that I wanted to ask - what would be the best practice in such a program: Have each client store his friends' IPs and make the server notify him whenever they are changed -VS-  Have the client ask the server for a friend's IP whenever he wants to start a direct connection with him (keep in mind that the client anyway has to tell the server whenever he's trying to connect to someone, in order for the hole punching to work). P.S. I've never created such a program and I'm not following any tutorial or such. If there's any better way of doing something I wrote, or if I got anything wrong, I'd be very glad if you could mention it.


What's more important for advancement writing lots of code (maybe only bug patches) or learning more CS?

I'm currently a graduate student in Computer Science. I've had a few jobs before coming back (doing some coding for the Army while in) and working in an Oracle shop. Both jobs could be done by monkeys with a semester of computer science. I want to be a great programmer. So, right now I'm back in school working on my master in computer science and I'm looking to do my thesis in data mining and natural language processing. I have limited time and right now I'm using my free time to work through Structure and Interpretation of Computer Programs, Machine Learning, OpenGL SuperBible (to learn the basics of graphics) and Cormen's Intro to Algorithms during the break before Winter quarter starts. I'm writing most of the programming projects that go along with those books too. Does this seem like a good use of my time, or should I cut my time in half on that and start trying to do bug fixes for some open source project (I've never done open source stuff and barely have the vaguest idea of how to get started)? If you recommend open source how should I go about getting started (really, step by step would be nice, I haven't done any so far because I literally don't know how to start) or if continue studying what should I focus on? Thanks.


Migration to embedded systems

My company has so far been developing a medical device, which is connected via USB to a desktop system (running x64 Windows 7) to run the image analysis and do everything GUI related. I am familiar with both Windows and Linux programming, C, C++, C++11 and C#, but now our new project coming from management would be a handheld, embedded system, and since I am the only software engineer, I have absolutely no idea how embedded systems work. Is it totally different from the "normal" programming job, should I recommend hiring someone with embedded experience, are there good ressources for introduction to embedded computing? I am at a loss here, since I do not know what exactly to expect (it'll be in theory the same as with the desktop systems, a sensor acquiring an image, and the software doing analysis). Can someone help me get an idea what I would have to expect for this? Edit: there is no framework, as to what hardware to use. We can use whatever we want, as long as it is small enough to be handheld. We will be using a third party sensor (either photo-sensor, or acoustic sensor, thats not been established yet), but again, we are pretty much free to decide, so my guess will be that it will have a well established API. I don't even really know what embedded systems are, I have experimented privately with an Arduino, does that count as embedded already?


What is convention based framework?

I'm reading about ColdBox, and I came across this word. So what is meant by convention based framework?


Who can learn to program?

I always hesitate when talking to professors about trying to improve the percentage of people who graduate with a CS type degree compared to the number that start out thinking that is what they want. On one hand I really do think it is important for professionals to be involved and give this feedback, on the other hand it would be better if less sub-par students ended up with CS degrees. I don't think every mind is built for this field and you have to be a good life long student. You have to have a high degree of patience and problem solving skills just to eek by. If you do have the "right" kind of brain, those hard problems are what drives you to continue. If you just get a long list of easy problems you get bored so these people are actually not good at more repetitive jobs. I don't need to go into all the details... if you are reading this you probably know what I'm getting at. So the question is: How do you find the balance of a degree program that is accessible to enough people to be funded and considered successful but also doesn't turn out people who aren't really cut out for the job? Maybe a better question is, what metric do you use to know if the changes you are making in a degree program are making it better? I don't know that a higher graduation rate is a good metric. And it seems that the feedback that you could try to capture many years later about the jobs that the graduates hold would be too far delayed. I've struggled with this question for a long time, mostly because I don't think there is an answer. But I thought I'd ask to see if anyone knows of any research that has actually been done on it. Addition: I recently had a very wise professor remind me that not everyone who graduates with a CS degree even wants to be a full-time programmer once they have actually discovered what that means. But, with the education that they received they could possibly make great Project Managers, Managers, system admins, etc. I think this was a very good point that I hadn't thought to consider here. There are a very high percentage of people who don't end up working in the field they majored in, CS isn't an exception to that. Having the extra folks helps not only in budget for the degree but also to expand the percentage of non-programmers who still know enough about it to work with programmers.


Visual C++, CMap object save to blob column

I have a MFC CMap object, each object stores 160K~ entries of long data. I need to store it on Oracle SQL. We decided to save it as a blob. Since we do not want to make additional table, we also thought about saving it as local file, with the SQL column pointing to that file. We would prefer to just keep it as blob on the server and clear the table every couple of weeks. The table has a sequential key as ID, and 2 column of time. I need to add the blob column in order to store on every row that CMap. Can you recommend a guide to do this approach (read/write Map to blob or maybe a clob)? Thanks.


How to prevent duplicate data access methods that retrieve similar data?

In almost every project I work on with a team, the same problem seems to creep in. Someone writes UI code that needs data and writes a data access method:               AssetDto GetAssetById(int assetId)      A week later someone else is working on another part of the application and also needs an `AssetDto` but now including 'approvers' and writes the following:               AssetDto GetAssetWithApproversById(int assetId)      A month later someone needs an asset but now including the 'questions' (or the 'owners' or the 'running requests', etc):               AssetDto GetAssetWithQuestionsById(int assetId)     AssetDto GetAssetWithOwnersById(int assetId)     AssetDto GetAssetWithRunningRequestsById(int assetId)      And it gets even worse when methods like `GetAssetWithOwnerAndQuestionsById` start to appear. You see the pattern that emerges: an object is attached to a large object graph and you need different parts of this graph in different locations. Of course, I'd like to prevent having a large number of methods that do almost the same. Is it simply a matter of team discipline or is there some pattern I can use to prevent this? In some cases it might make sense to have separate methods, i.e. getting an asset with running requests may be expensive so I do not want to include these all the time. How to handle such cases?


What would be the best way to handle errors in parallel programs?

With parallel algorithms knocking at the door, it might be a good time to think about error handling. So at first there were error codes. Those sucked. It was free to ignore them, so you could fail late and produce hard-to-debug code. Then came exceptions. Those were made impossible to ignore once they occur, and most people (except Joel) like them better. And now we got libraries that help parallel code. Problem is, you can't handle exceptions in parallel code as easily as you could with non-parallel code. If you asynchronously launch a task and it throws an exception, there's no stack trace past it to unwind; best you can do is capture it and register it on the task object, if there's such an object. However, it defeats the primary strength of exceptions: you have to check for them and _you can ignore them without any additional effort_ , whereas in single-threaded code an exception will necessarily trigger the appropriate actions (even if it means terminating your program). How should language implementations or libraries support errors in parallel code?


In PHP, what are the different design patterns to implement OO controllers as opposed to procedural controllers?

For example, it's very straightforward to have an index.php controller be a procedural script like so:               <?php          //include classes and functions          //get some data from the database     //and/or process a form submission          //render HTML using your template system          ?>      Then I can just navigate to http://example.com/index.php and the above procedural script is essentially acting as a simple controller. Here the controller mechanism is a basic procedural script. How then do you make controllers classes instead of procedural scripts? Must the controller class always be tied to the routing mechanism?


What encoding is used by javax.xml.transform.Transformer?

Please can you answer a couple of questions based on the code below (excludes the try/catch blocks), which transforms input XML and XSL files into an output XSL-FO file:               File xslFile = new File("inXslFile.xsl");     File xmlFile = new File("sourceXmlFile.xml");     TransformerFactory tFactory = TransformerFactory.newInstance();     Transformer transformer = tFactory.newTransformer(new StreamSource(xslFile));     FileOutputStream fos = new FileOutputStream(new File("outFoFile.fo");     transformer.transform(new StreamSource(xmlFile), new StreamResult(fos));      inXslFile is encoded using UTF-8 - however there are no tags in file which states this. sourceXmlFile is UTF-8 encoded and there may be a metatag at start of file indicating this. am currently using Java 6 with intention of upgrading in the future.   1. What encoding is used when reading the xslFile?   2. What encoding is used when reading the xmlFile?   3. What encoding will be applied to the FO outfile?   4. How can I obtain the info (properties) for 1 - 3? Is there a method call?   5. How can the properties in 4 be altered - using configuration and dynamically?    6. if known - Where is there info (web site) on this that I can read - I have looked without much success.


Difference between free and open software?

> **Possible Duplicate:**   >  Open Source but not Free Software (or vice versa) I recently was at talk were Stallman was the keynote speaker, and he stated he hated the term open software, because it was geared to confuse people. Now, I have since then read on to understand his stance, but I am unable to draw a line where free software becomes open source, and which licenses can be considered in each group. For example I know that GPL, LGPL are free software licenses, but they are also open source licenses as well. Is there a pure open source license? like MIT license? or is it all shades of grey. Can a line be drawn? Thanks!


'Recommended' file length and line widths

I was curious if anyone knew of a recommendation from a reputable source for the max number of lines of code for a given file. For example, Google's Closure Linter recommends that each line should not exceed 80 characters.


Why is black box called functional testing when it tests also non functional?

This has been bothering me for a while. Security, performance tests etc. are all done typically using the black box approach. But these are nonfunctional,while black box is called functional testing. Is it because it judges the function and it is just a naming or there is an inconcistency? References:   Software Engineering by Salleh   Software Engineering and Testing by Gupta,Tayal   Software Engineering by A.A.Puntambekar   Software Testing : a Practical Approach by Sandeep Desai,Abhishek Srivastava I cannot see the reason for downvote as obviously many are confused as I am (from the comments saying "I have never seen it before".


How important is it for a programmer to know how to optimize code, solve complex puzzles, answer technical questions quickly?

So I'm in the process of looking for a job. And I have had plenty of test and just recently someone sent me a puzzle. It's the crackless wall problem and I have no idea how to approach it. I could cheat and google the answer, but I'm an honest fellow and it's taken me 2 days and still no solution. Also performance is a key issue as well. Should I take some time to master solving programming puzzles? Or should I focus on learning the language first, then master optimization techniques? I'm having issues choosing the best approach. Just today I found out from a previous interview that they chose someone else over me because that candidate seemed more knowledgeable than me because during the technical interview this candidate was a bit more snappy with his/her responses. I knew all the answers but I wasn't fast enough with them. Does this matter with all interviewers? Should I invest time in mastering core concepts in java so I can have just as fast recall? (To shed some light on my background: I am a recent graduate with a little over a year of java programming experience under my belt. I only have a bachelors degree. I know this is irrelevant, but I'm also 23.)


Decorating a class that calls its own public methods

I've written a system that calculates discounts for a shopping cart based on a set of rules. Each rule is implemented with the following interface (C#):               interface IRule     {        bool IsActive();        bool IsApplicableTo(IShoppingCart cart);        decimal CalculateDiscount(IShoppingCart cart);     }      A concrete implementation might look something like this:               class Rule : IRule     {        bool IsActive() { return true; }             bool IsApplicableTo(IShoppingCart cart)        {            if (!IsActive())               return false;                 return TestIfApplicable(cart);        }             decimal CalculateDiscount(IShoppingCart cart)        {            if (!IsApplicableTo(cart))               return 0m;                 return CalculateStuff(cart);        }     }      Now I'm trying to introduce some logging to the system. To keep things clean, I don't want to jam it into the Rule class. So I thought I'd make a Decorator for IRule, which handles the logging:               class LoggingRule : IRule     {         IRule decoratedRule;              bool IsActive()         {             LogImportantThings();                  return decoratedRule.IsActive();         }              //And so on.     }      The issue that I'm running into here, is that the Rule class actually calls the IsActive and IsApplicableTo methods itself. When that happens, the decorator is simply passed by, and nothing is being logged. I suppose I could make the LoggingRule a subclass of Rule. It would mean that I would have to make a LoggingRule variant for every IRule implementation. That could potentially cause a lot of duplication. I could also put the logging into a base class, and use the Null object pattern when I don't want to log anything. But then again, 99 out of 100 times I don't want to log anything. And when these methods are called many many times, is it worth the potential overhead? So neither solution seems particularly elegant, and I'm struggling to find a better alternative... Any suggestions?


How show Attributes which appear In Many To Many association

As we know a many to many association are shown by two asterisks in both end of association. Now I have a association between two entities "Good" and "Invoice" so Good and Invoice have a many to many association but I want to show the "count of each good" in each invoice on class diagram. How can I show it?


How to prevent re-checking already-checked data?

I have a class with a `validId($id)` method that is called by the constructor and by `public function load($id)`. The method queries the database to see if the id exists and returns true/false. The constructor optionally takes an `$id` (if no $id, then the object will be empty). The constructor checks the $id with `validId($id)`, and if it passes, then it calls `load($id)`. I should not take `validId()` out of `load()` because `load()` is public and the input has to be checked! The same goes for the constructor. How do I avoid calling `validId()` twice? I was thinking I could add a parameter to `load($id,$check_id)`, but that would be ridiculous. You can't give clients the option to not validate data! I could add a protected property like `$id_is_valid` that gets set to true by `validId($id)`. But how do I know the value that was valid is the same one being received by my `load()` method? I'm using PHP. Hopefully this isn't a stupid question.


How do I make the most of the chance to meet one on one with a programming guru?

So, I'm not a programmer, though I've been writing code all of my life. As is my habit, I attempt to contact well know experts in almost any domain I find of interest, and interestingly, I get a lot of meetings, which I value a great deal. So, here's the deal -- a meeting has been set for me to meet a very well known programmer and I would like advice on how to make the most of it. They've written a number of books, some of which I've read, but nothing strikes me as a point of conversion; meaning they know I'm not a real programmer, though I am very interested in talking to them about their advice for becoming a programmer. Should I attempt to have a potential coding topic, set of code to review, etc -- or just show up and get general advice?


How should you cleanly restrict object property types and values in Python?

I have been learning python from no long time ago. But nearly at the beginning I stumbled on simple question: how to set a restriction (limitation) on object value or object's properties without making a difficult class description. There is no problem with python's unstrict typification. I search for the methods to control not only the variable types, but the variable value diapasons also. For example let creating the classical educational class - "Circle". A Circle - object should have three properties: two origin coordinates (some x, y) and a radius, in that (in our human visible world) x and y should be real numerical, a radius should be real positive numerical. I somehow solved this task, correspnding method of "Circle" class below:               def __setattr__(self,name,value):         def setting_atr(name,value):             if isinstance(value,(float,int)):                 if name=='radius' and value<0:                     raise ValueError("Attribute 'radius' should be no negative")                 self.__dict__[name]=value             else:                 raise TypeError("Attribute should be numerical")         if len(self.__dict__)<3: #number of object attribute             return setting_atr(name,value)         elif name not in self.__dict__:             raise AttributeError("'Circle' object has no such attribute")         else:             return setting_atr(name,value)      Nevertheless I utterly displeased with way I have done that. The code is huge for so small conception, and it's almost no reusable (I know about the descriptors - it will give the near same result). I would prefer some declarative stile. When I had been starting search for an alternative my first thought was to add my own operator. But after hard googling I realized that it impossible to make that in python itself (if I'm still wrong - please correst me). Such as I only newbie, and entering in python developers team or forked python ( :)) is no way for me, I gave up for this thoughts. The another possibly path in declarative stile is writing something like:               radius=radius if isinstance(radius,(float,int)) else raise TypeError("Attribute should be numerical")     radius=radius if radius>=0 else raise ValueError("Attribute 'radius' should be no negative")      of course it not work, because we haven't ability to use 'raise' by that. I should be able calling errors object as function to brought it for reality. The simplest way to do that it wrote the error-raised function like this:               def SomeError(exception=Exception, message="Something don't well"):     if isinstance(exception.args,tuple):         raise exception     else:         raise exception(message)      So it allow to write:               radius=radius if radius>=0 else SomeError(ValueError("Attribute 'radius' should be no negative"))      I also thought about followed form:               @dfValueError(['isinstance(radius,(float,int))'],"Attribute should be numerical")     @dfTypeError(['radius>=0'],"Attribute 'radius' should be no negative")     def fun_radius(x)         return x      The small problem with this approach is in the more complex and less informatively evident error outing print. At the first the error message lead to the fake error raised function, the place where "oops" actually occurred only in second lines. My goal is to make possibility raise exception from lambda functions and code lines like has showed above, to make code more evident. To do this I should create my own exceptions class with call method implemented. Problem: inherited class didn't see itself in own name spase, so method               __call__(self):         raise self #yes ha-ha      give in result:               TypeError: __call__() missing 1 required positional argument: 'self'      So my question is simple: is it possible to make error object be callable? If yes, what I should read, to do it. And also, if someone solve this small problem, I would be happy. P.S. I know samples (about radius variable declaration) showed above can't be implemented in this "circle" class as is. I give it only as example to show my thoughts track. Please, don't pick on it. **Afterword (by Marat)** Thank very much who wrote and voted in this topic. After readed answers, I thought very long, and finaly raised myself to add some augment to this topic (even if it entail some risk to infringe rules). For the first. Some people have wrote that we dont't need care about errors at the object creation state, and even no need to control variable types at all (inasmuch as it no has implemented in python by default). Although I have been no long time in object oriented programming, before that I had (and still have) been work on calculation a technical processes and devices. So I'm very confident about this words: "Possible error should be localized as soon as possible (I didn't say improved)". Many algorithms for calculation a real physical processes use iterations and recursions so if you slip out (for later handle) some occurred mistake it could brought a hard detectable error in final result. So, there is python, from this point of view. Python's "Duck Typing" is great for quick prototyping and simplifying applied programming. But "Duck Typing" is not a religion demand. Nevertheless Python's unstrict typification it isn't a bizarre thing to add a type control, if you think you need that. But the style which Python impose to perform it differ from the style in the static typification languages as C++, Java and etc. In Python we can control the object only in some "control points". This guide us to the "System Oriented Programming" principles (Therm is mine, but I didn't check if it exist in press, so it may has differ meaning from the same of another authors, and what I mean may also has another name). We should (if will) set the "control points" at the inlet and outlet of the elements of ( **main** ) system. What is for the system elements? It should be any object who has own name space and can interact with outside as function (by methods also). The simplest version of inlet controlling for function element is:               def func(a,b,c):         #just like this         a=int(a)         b=str(b)         c=list(c)      More comlexity and interesting approach shown here: Type-checking decorator for Python 2 Separately, about method that was suggested by my co-author. "Property" decorator use the same methods as descriptor, so it emulate **object** attributes by **class** methods. This mode should be used carefully because in python the objects of same class are shared the class name space. I let myself rewrote the same programm that have wrote by @Izkata with `__setattr__` (again):               filter_function_for_radius=lambda value: value if value>0 else SomeError(ValueError, 'Radius cannot be negative')     class Circle(object):         def __init__(self, x=0, y=0, radius=1):             self.x = x             self.y = y             self.radius =radius         def __setattr__(self,name,value):             if name=='radius':                 value=filter_function_for_radius(value)             self.__dict__[name]=value      ...and if you need some another (perhaps complex or negative) radius for some hipothetical circle you don't need to inherit or redefine the class, just "change filter". But that advantage of function style may be obtain only by using `__setattr__` or by creating own metaclass. And once more thank you, for answering.


When developing algorithms, is skipping the pen&paper phase a bad habit?

I heard many people saying that when developing algorithms you should first use pen and paper, flowcharts and what not, so that you can focus on the algorithm itself, not worrying about the implementation of said algorithm (i.e., you deal with one problem at a time). However, most of the time I find it easier to actually develop my algorithm on the fly. That is, I think a bit about the problem until I know the general direction to take, and then I start writing code and making changes until the algorithm emerges and works. Is this a bad habit that I should try to change?


How to transition from a web developer to an embedded developer?

I've been doing web development, and backend Java development, professionally for about 5 years now. My passion has always been closer to the metal though. Applying to embedded jobs has not been successful, and I believe it's because I lack experience. Perhaps there are open source projects I should undertake to show that I'm serious? How does one make a transition from being a web developer to an embedded developer?


What is the meaning of 'high cohesion'?

I am a student who recently joined a software development company as an intern. Back at the university, one of my professors used to say that we have to strive to achieve "Low coupling and high cohesion". I understand the meaning of low coupling. It means to keep the code of separate components separately, so that a change in one place does not break the code in another. But what is meant by high cohesion. If it means integrating the various pieces of the same component well with each other, I dont understand how that becomes advantageous. What is meant by high cohesion? Can an example be explained to understand its benefits?


Is there a reason for initial overconfidence of scientists and engineers working on artificial intelligence in the 1960s?

I just started an AI & Data Mining class, and the book. AI Application Programming, starts off with an overview of the history of AI. The first chapter deals with the history of AI from the 1940s to present. One particular statement stuck out at me: > [In the 60s] AI engineers overpromised and underdelivered... What was the reason for the overconfidence? Was it because of mathematical prediction models showing that a breakthrough was around the corner, or due to the ever-increasing hardware capability to take advantage of?


When inheriting from a class in C#, which naming convention is preferred?

If you inherit from Tile, for example, should the subclass be called CollisionTile or just Collision? What about for painting tools in an application like Paint? PenTool or just Pen? Are there any published guidelines for this?


When is a requirement considered complete?

Which elements must a requirement contain that it can be considered complete? Or if this works better - which questions should I ask about a requirement to find out if it is complete. I am not talking about the implementation of the requirement but the requirement itself. I am asking this from the perspective of an analyst who wants to make sure that his requirements are complete before passing them on to the design team.


What's the best way to undo a Git merge that wipes files out of the repo?

So imagine the following the happens (and that we're all using SourceTree):   1. We're all working off origin/develop.    2. I go on holiday for a week.   3. My coworker has been working locally for the past several days without merging origin/develop back in to his local develop branch.   4. He tries to do a push, gets told he has to merge first, and then does a pull.   5. He gets a conflict, stopping the automatic commit-after-a-merge from proceeding.   6. Assuming that Git is like SVN, my coworker discards the "new" files in his working copy and then commits the merge - wiping those "new" files from the head of origin/develop.   7. A weeks worth of dev work goes on on top of that revision.   8. I come back from holidays and find out that several days of my work is missing. We're all very new to Git (this is our first project using it), but what I did to fix it was:   1. Rename "develop" to "develop_old".   2. Merge develop_old into a new branch "develop_new".   3. Reset the develop_new branch to the last commit before the bad merge.   4. Cherry pick each commit since then, one by one, resolving conflicts by hand.   5. Push develop_old and develop_new up to the origin. At this point, develop_new is, I'm hoping, a "good" copy of all of our changes with the subsequent weeks worth of work reapplied. I'm also assuming that "reverse commit" will do odd things on a merge, especially since the next few weeks worth of work is based on it - and since that merge contains a lot of things we _do_ want along with stuff we don't. I'm hoping that this never happens again, but if it does happen again, I'd like to know of an easier / better way of fixing things. Is there a better way of undoing a "bad" merge, when a lot of work has gone on in the repo based on that merge?


Is there any evidence that lisp actually is better than other languages at artificial intelligence?

There seems to be a long-held belief (mainly by non-lispers) that lisp is better than most languages at AI. Where did this belief originate? And is there any basis in fact to it?


Are any top software products outsourced? (offshore or otherwise)

Is there any software that is both ahead of the competition and outsourced? By that I mean software products which are big sellers and which are highly reviewed, and developed by an entity outside of the entity that owns the product itself. The "outside entity" could be a domestic or foreign business, performing development work on a contractual basis. I am excluding open source here, as the process is more democratized than the typical product (where the product owner dictates the design and requirements directly). I'm thinking desktop software like:   * Adobe Creative Suite   * MS Office   * Aperture   * Visual Studio   * ReSharper Or web apps/sites like:   * Yelp   * Pandora   * 37 Signals apps   * Zendesk   * Salesforce   * Amazon I'm looking for data points, here, and not subjective ideas about what's popular. We can measure popularity by sales or Google rank or other metrics.


Comparison of languages by usage type?

Does anyone know of a good place to go find comparisons of programming languages by the intended platform/usage? Basically, what I want to know, is of the more popular languages, which ones are meant for high level application development, low level system development, mobile development, web, etc. If there's a good listing out there already, I'm not finding it so far. Does anyone know of a place that would have this? Thanks.


Accessing a Web Service: Learning Resource needed

I have been searching for resources to learn (Java) Web Services. Although I have found a lot of resources and tutorials on JWS, I am confused with the version numbers, the abbreviations and Metro. Plus the last update to Metro was in 2008. Is it a worthwile thing to learn? I wanted to learn how to access Web Services, since an upcoming project is about accessing one. I have some experience with OAuth on Twitter(using code available). Things I know about the project:   I have to access a Web Service.   Java is the preferred platform to use(Although I know I can use any).   Axis can be used to access the Web Service(I have never used Axis) I have a meeting scheduled to learn more, but I sure don't want to look silly since I am no Java expert, have never created or accessed Web Services using Java. My Questions: 1.Can someone point me to a tutorial which will help me learn how to access a already running Web Service (Preferably SOAP(?), not REST. It's XML based)   2\. Will you recommend using PHP or Python to do the work of accessing the web service? I am expecting a lot of nay saying, but I hope I get some answers too. I will clarify things if needed.


Do I have to include the Copyright notice from the original author?

I'm using some codes that I modified, from Paradigms of Artificial Intelligence Programming to create another project, the project is released under GPL V2. The License agreement is written here, it says: Copyright © 1998-2002 by Peter Norvig. My question is: Were's almost in 2014, do I still have to include that license or did it expire and therefore I may use the codes anyway that I like?


Handling database schema changes when pushing new versions

During times of heavy development, the database schema changes both rapidly and continuously, and by the time our weekly push to the beta build comes around, the schema has changed so much that the only sensible option is to nuke all of the tables I can and copy the new versions from my dev database. Obviously, this isn't going to work once we launch, since nuking production data is a recipe for disaster, so I was wondering what strategies were out there for managing database schema changes from one version/revision to another? Some I've found or experienced:   1. Straight nuke-and-dump from one database to another (what I am doing now)   2. Maintaining an UPDATE.sql file with SQL statements that get run either via script or by hand.   3. Maintaining an update.php file with a corresponding "db-schema-version" value in the active database The third option seems to be the most sensible, but there still exists the possibility of a badly constructed SQL query failing mid-script, leaving the database in a half-updated state, necessitating a restoration of a backup. It seems like a non-issue, but it does happen, since we as a team, we use phpMyAdmin, and I can't seem to even rely on myself remember copying the executed SQL statement to paste into the update.php file. Once you navigate to another page, I have to re-write the SQL statement out by hand, or reverse my change and do it again. I guess what I am hoping for is a solution that doesn't impact our established development workflow?


Practical reference for learning about graph reduction

Are there any practical references (with actual examples) for getting started implementing a small, lazy functional programming language with graph reduction? A reference that included the lexing and parsing steps would be especially helpful. So far I've read most of the _Implementation of Functional Programming Languages_ by Simon Peyton Jones and the Wizard book (SICP).


Database Table Prefixes

We're having a few discussions at work around the naming of our database tables. We're working on a large application with approx 100 database tables (ok, so it isn't that large), most of which can be categorized in to different functional area, and we're trying to work out the best way of naming/organizing these within an Oracle database. The three current options are:   * Create the different functional areas in separate schemas.   * Create everything in the same schema but prefix the tables with the functional area   * Create everything in the same schema with no prefixes We have various pro's and con's around each one but I'd be interested to hear everyone's opinions on what the best solution is. Edit: Thanks for all the answers. It's hard to pick a right answer seems it is very subjective so I'll go for the one with the most votes (it helps that it matches what I was thinking! ;-)


Is there a canonical book on x86 assembly?

There are lots of books on assembly. However, they usually deal with ISAs about which I don't care, such as MIPS or ARM. I don't deal with these architectures; there's no reason for me to try to learn them. But x86 assembly books seem... nonexistent. Let's say for example I'm trying to build a toy compiler generating Windows Portable Executable files. Is there a book out there that's the de-facto standard for describing best practices, design methodologies, and other helpful information on x86 assembly? What about that book makes it special?


How to prevent code from leaking outside work?

> **Possible Duplicate:**   >  How to manage a Closed Source High-Risk Project? I'm working on an institution that has a really strong sense of "possession" - each line of software we write should be only ours. Ironically, I'm the only programmer (ATM), but we're planning in hiring others. Since my bosses wouldn't count the new programmers as people they can trust, they have an issue with the copies of the source code. We use Git, so they would have a **entire** copy of _each_ of the projects they work on, when they clone the repository. We can restrict access to them to a single key with Gitolite and bind that to their PC's, but they can copy those keys to another computer and they would have the repository access in another PC. Also (and the most obvious method) they could just upload the files somewhere else, add another remote, or just copy the files to an USB drive. Is there any (perhaps clever) way to prevent events like these? **EDIT:** I would like to thank everyone for their insights in this question, since it has been not only _more_ eye opening, but also a firm support of my arguments (since you basically think like me, and I've been trying to make them understand that) against my bosses in the near future. I am in a difficult situation work-wise, with my coworkers and bosses (since I'm basically in the middle) being like two gangs, so all this input is greatly, greatly appreciated. It is true that I was looking for a _technical_ solution to a _people_ problem - both the management and the employees are the problem, so it can't be solved that way (I was thinking about some _code obfuscation_ , perhaps working with separate modules, etc., but that wouldn't work from my developer POV). The main problem is the culture inside and outside the company - development is not taken seriously in my country (Venezuela) so naivity and paranoia are in fact a real issue in here. The real answer here is an NDA (something that here in Venezuela doesn't completely work), because that's the _people_ solution, because no sane developer would work in those conditions. Things will get ugly, but I think I will be able to handle that because of your help. Thank you all a lot! <3