How to divide work among development team members in a website project using MVC pattern

I am working on a webapp project using flask framework and sqlalchemy orm in python. Its the first time I am working on a project like this and I am having trouble in how to divide work properly among my teammates. We are 5 guys, one is handling designing, two front end and 2 on backend. I am on the backend. Flask follows MVC type pattern. How does teams divide work in MVC pattern? Moreover I am more confused in dividing work with my team mate in backend. Should one handle all the database queries and let the other one handle processing on those returned results? Need some advise on work division in web projects.


Why is there no here document syntax in .Net?

* Is it considered bad form? Maybe it promotes non-separate model / view?   * Is it inefficient?   * Was it just left out? I guess every language has features that certain developers wish were there, and not every language can have everything. I've just always found this feature to be pretty handy. Why does .Net not have a here document syntax?


How does one minimize or prevent User lawsuits?

I work in a bunch of tools that do things to customer's computers. Some of these tools allow scripting, which allows someone to run a script to nuke files, registry keys, or the like. Of course, if the script is bad, or if there's a serious bug in the tool, it could cause damage to the person's system. I'm concerned that a user might become... angry... with me if something goes wrong. How do I minimize the likelihood of being sued as a result of publishing such a tool?


Adding dynamic business logic/business process checks to a system

I'm wondering if there is a good extant pattern (language here is Python/Django but also interested on the more abstract level) for creating a business logic layer that can be created without coding. For example, suppose that a house rental should only be available during a specific time. A coder might create the following class:               from bizlogic import rules, LogicRule     from orders.models import Order          class BeachHouseAvailable(LogicRule):              def check(self, reservation):             house = reservation.house_reserved             if not (house.earliest_available < reservation.starts < house.latest_available )                 raise RuleViolationWhen("Beach house is available only between %s and %s" % (house.earliest_available, house.latest_available))             return True          rules.add(Order, BeachHouseAvailable, name="BeachHouse Available")      This is fine, but I don't want to have to code something like this each time a new rule is needed. I'd like to create something dynamic, ideally something that can be stored in a database. The thing is, it would have to be flexible enough to encompass a wide variety of rules:   * avoiding duplicates/overlaps (to continue the example "You already have a reservation for this time/location")   * logic rules ("You can't rent a house to yourself", "This house is in a different place from your chosen destination")   * sanity tests ("You've set a rental price that's 10x the normal rate. Are you sure this is the right price?" Things like that. Before I recreate the wheel, I'm wondering if there are already methods out there for doing something like this.


Online Computer Science BS Degree?

Does anyone know of a good online undergraduate Computer Science program? My girlfriend is almost done her Masters of Science in Nursing online at Vanderbilt. All her courses are online, she does clinicals at local hospitals and private practices, and flies to Nashville for a long weekend every couple of months. I've been looking for something similar for Computer Science, but can only seem to find programs at scam schools. If it's possible to get the credentials which will give you the ability to suture and prescribe narcotics online, shouldn't computer science be handled similarly? Yes, I am aware of the social implications (e.g. college is a great place to meet people, develop as a person, etc...). I did attend a traditional college, and have about 85 credits. The difficulty is, my business started making money, so I'm too busy to attend scheduled courses. The university wouldn't work with me, at all, so I stopped going. I see value in having a degree, and would like to finish, but it has to be on my time.


How do you define a node and an edge when talking about McCabes Complexity?

I am trying to understand the formula, but I am a bit in doubt how exactly you define edges and nodes. Edges seem to be every possible exit from a statement and nodes seem to be statements, is this definition wrong?


What are the dangerous corners of Qt?

There's nothing perfect under the sun. Qt is no exception, and it does have limitations: we can't use pixmaps in a thread other than GUI, we can't use QImage with 16-bit-per-channel image format, etc.. Which situations have forced you to spoil the design because of Qt's limitations?   What are the most hated quirks?   **Which design decisions should one avoid while using Qt in his projects?**


Grid framework for CSS

I see there are large number of grid frameworks in CSS like 960, heroku grid, etc being used by huge websites. I want to know whether using grid structure is really useful? If yes, then how? One of the biggest problem I saw with grid is **having equal heights for elements**. If we are using three grids like `grid_2`, `grid_7`, `grid_3` for 3 vertical panels then it becomes very difficult to have these three panels positioned in a way such that they have equal heights and all of them change height when any of the content exapnds or collapse. This is because elements are floated in grid system and they don't change height along with neighbouring element.


Understanding Abstract Data Types (ADTs)

Just browsing through Code Complete last night and I came across the explanation of abstract data types. I must have read it 5 times, and the Wikipedia article doesn't help much either. So what I'm looking for is a simple explanation of exactly **what is an Abstract Data Type**? Any solid examples? In C# or VB? I understand that String is supposed to be one, why is this? And why isn't Int32 one? Or is it? Any pointers much appreciated.


What is a good way to keep track of strings for dictionary lookups?

I am working through the Windows 8 app tutorial. They have some code about saving app data like so:                private void NameInput_TextChanged(object sender, TextChangedEventArgs e)             {                 Windows.Storage.ApplicationDataContainer roamingSettings =                      Windows.Storage.ApplicationData.Current.RoamingSettings;                 roamingSettings.Values["userName"] = nameInput.Text;             }      I have worked with C# in the past and found that things like using constant string values (like "userName" in this case) for keys could get messy because auto-complete did not work and it was easy to forget if I had made an entry for a setting before and what it was called. So if I don't touch code for awhile I end up accidentally creating multiple entries for the same value that are named slightly differently. Surely there is a better way to keep track of the strings that key to those values. What is a good solution to this problem?


what are some good interview questions for a position that consists of reviewing code for security vulnerabilities?

The position is an entry-level position that consists of reading C++ code and identifying lines of code that are vulnerable to buffer overflows, out-of- bounds reads, uncontrolled format strings, and a bunch of other CWE's. We don't expect the average candidate to be knowledgeable in the area of software security nor do we expect him or her to be an expert computer programmer; we just expect them to be able to read the code and correctly identify vulnerabilities. I guess I could ask them the typical interview questions: reverse a string, print a list of prime numbers, etc, but I'm not sure that their ability to write code under pressure (or lack thereof) tells me anything about their ability to read code. Should I instead focus on testing their knowledge of C++? Ask them if they understand what a pointer is and how bitwise operators work? My only concern about asking that kind of question is that I might unfairly weed out people who don't happen to have the knowledge but have the ability to acquire it. After all, it's not like they will be writing a single line of code, and it's not like we are looking only for people who already know C++, since we are willing to train the right candidate. (It is true that I could ask those questions only to those candidates who claim to know C++, but I'd like to give the same "test" to everyone.) Should I just focus on trying to get an idea of their level of intelligence? In other words, should I get them to talk and pay attention to the way they articulate their thoughts, and so on?


How important is it for a programmer to know how to implement a QuickSort/MergeSort algorithm from memory?

I was reviewing my notes and stumbled across the implementation of different sorting algorithms. As I attempted to make sense of the implementation of QuickSort and MergeSort, it occurred to me that although I do programming for a living and consider myself decent at what I do, I have neither the photographic memory nor the sheer brainpower to implement those algorithms without relying on my notes. All I remembered is that some of those algorithms are stable and some are not. Some take O(nlog(n)) or O(n^2) time to complete. Some use more memory than others... I'd feel like I don't deserve this kind of job if it weren't because my position doesn't require that I use any sorting algorithm other than those found in standard APIs. I mean, how many of you have a programming position where it actually is essential that you can remember or come up with this kind of stuff on your own?


Instantiating Interfaces in C#?

I am reading/learning about interfaces in C# at the moment, and thus far I managed to understand how it differs from an abstract class. In the book I am reading the author explains that interfaces are the ultimate abstract class and that it simply sets the standard of certain methods the inheriting class will have, but then provides the following example.               static void Main(string[] args)     {     ...     Circle c = new Circle("Lisa");     IPointy itPt = null;     try     {     itPt = (IPointy)c;     Console.WriteLine.(itPt.Points);     }     catch (InvalidCastException e)     {      Console.WriteLine(e.Message);     }     ...     }      The line that absolutely throws me off is the `IPointy itfPt=null;` did he just declare an interface? I thought interfaces are abstract and can only be inherited? What kind of sorcery is going on here?


How can a website look different in safari Windows and Safari mac?

I have a website. I've been testing crossbrowser on my windows PC, and it looks good in all browsers, but on Mac in Safari it looks like the CSS is not getting interpreted right, or there is a critical javascript error. When I look in the console cross-browser, the error log shows exactly the same. Chrome on mac interprets the site as intended, so why do I have a problem with safari? It is the same across different computers, and iphone safari also shows the site wrong. How is this possible and how do I debug?


Should we use RSS or Atom for feed generation?

For various reasons we are required to add feeds to our product. The main reason is to be able to say to potential buyers that "yes, we have feeds". We do not actually expect the feature to be used that much. Ideally we would like to provide both RSS and Atom feeds. However, at the moment we are severely pressed for time and are forced to select just one of these. Should we use Atom or RSS? Feature-wise we are fine with either, so I am only looking for information about the popularity and support for the various formats. Are there many feed readers out there without Atom support? EDIT:   The reason we only want to implement one format is not related to generating the actual feeds. That in itself will not be very time consuming. It is more of a UI problem. If we implement both Atom and RSS, we need to present the user with a UI where he/she can select between the different formats. For usability purposes we would also need help texts, tooltips etc. to make sure that the user can understand the different options. And since our product is localized into multiple languages all of the above would need to be translated, and someone has to pay for that. It all adds up and becomes a lot more work. If we settle on a single format we only need one button with a tooltip pointing to an .aspx with the feed. Besides, it is not my decision anyway. :) Someone above me has already decided that this functionality will be implemented for this release.


Since Garbage Collection is non-deterministic, why isn't it used for secure random number generation?

I get that /dev/random is a good source of entropy, and is what is usually used-- It's just as I'm reading up on GC, at least in Java, it seems accepted that the garbage collection daemon executes non-deterministically. If this it true, why don't we use the timing of the garbage collection as a source of entropy instead of the variable /dev/random?


Has anyone used "Design Pattern Framework (TM)"?

Has anyone purchased Design Pattern FrameworkTM? Are these samples worth investment? Are they practical? What are the pro and cons of the guidelines? Anyone used this in the real-world development?


What do you do when there is a last minute request to exclude a feature from a release?

There is a feature that has already passed acceptance testing, both internally and by the customer. It is a fully working feature. However, there is now a request to exclude this feature from an upcoming release. According to the customer, this feature should be removed because the users have not been trained on how to use it. What is the best course of action to handle this situation? Should we design software in anticipation that a feature might be excluded last minute using configuration settings? Are there context-dependent solutions that might be more correct in some situations than others?


What do programmers at security firms do?

I have heard of security firms who consult on the security of a clients systems. All of the people I know in this field are network engineers, but I know programmers get involved in security as well. What do security programmers who perform audits/consulting actually do? Do they literally go through the codebase looking for every vulnerability in people’s legacy systems? I have always assumed that is what they did, but it seems like this would be highly unreliable and not do much more than providing a false sense of security. Note: I’m not talking about programmers who write encryption algorithms or anything like that, only those concerned with software security audits/consulting.


Extracting domain logic from the forms to which they are coupled?

Many applications do nothing to separate the interface from domain logic. I’ve been programming for a couple decades and have worked at more than a dozen shops and none of them have taken any measure of separating the interface from the domain logic. That is, they're all using the Autonomous View pattern. This runs counter to all the wisdom I’ve read about separating concerns. When the user needs to choose an item from a set of items, that selection is directly tied to a combo box rather than an abstraction. A huge drawback with all this coupling is that it makes it impossible to write unit tests. To run any unit tests the application in its entirety must first be loaded. In my mind, the use case should be encapsulated within an abstraction that can later have a database and an interface attached to it. This kind of separation would make implementing unit tests trivial by comparison. Given that the average shop has its interface and domain logic tightly coupled, how to we refactor to separation? That is, a complete rewrite is off the table. What I’m talking about is taking a proposal to management about how to go about creating domain objects (whatever these happen to look like) that live in isolation from the database and the interface. In other words, it would be useful to be able to explain how this concept of presenting the user with a choice (something that is now represented by combos on forms) and to see how some methodology/framework/pattern represents that in an abstract sense and how that abstraction is then tied to the interface. This would make replacing combos with listboxes nothing more than a slight detail. What are some good ways for extracting abstractions (domain use cases) from forms? Any good online resources? My current shop is on .NET, though I am interested in ideas from any development platform. Ultimately, what I need to provide is a concrete example (code) of how this might be accomplished.


Do we ethically have the right to use the MAC Address for verification purposes?

I am writing a program, or starting at the very beginning of it, and I am thinking of purchase verification systems as a final step. I will be catering to Macs, PCs, and possibly Linux if all is said and done. I will also be programming this for smartphones as well using C++ and Objective-C. (I am writing a blueprint before going head first into it) That being said, I am not asking for help on doing it yet, but what I’m looking for is a realistic measurement for what could be expected as a viable and ethical option for purchase verification systems. Apple through the Apple Store, and some other stores out there have their own "You bought it" check. I am looking to use a three prong verification system.   1. Email/password   2. 16 to 32 character serial number using alpha/numeric and symbols with Upper and lowercase variants.   3. MAC Address.  The first two are in my mind ok, but I have to ask on an ethical standpoint, is a MAC Address to lock the software to said hardware unethical, or is it smart? I understand if an Ethernet card changes if not part of the logic board, or if the logic board changes so does the MAC address, so if that changes it will have to be re-verified, but I have to ask with how everything is today. Is it ethical to actually use the MAC address as a validation key or no? Should I be forward with this kind of verification system or should I keep it hidden as a secret? Yes I know hackers and others will find ways of knowing what I am doing, but in reality this is why I am asking. I know no verification is foolproof, but making it so that its harder to break is something I've always been interested in, and learning how to program is bringing up these questions, because I don't want to assume one thing and find out it's not really accepted in the programming world as a "you shouldn't do that" maneuver. I am just learning how to program, and I am just making sure I'm not breaking some ethical programmer credo I shouldn't.


technique for checking modifications in configuration file while starting up a program

I'm writing a software for periodically checking a specific range of networked devices' reach-ability. I'm specifying the address range and the time frequency for checking their reachability, in an xml file. Which technique can I use to check that xml file during the start up of the program for any modifications done in either the range or the frequency and do the necessary update in specific database?


When a team size gets over 10, can you still do release planning together?

When deciding what to work on for the next release, and estimating timings for each user story (and sub tasks for a given story), do you guys do this in a group or just managers? For a team size of 10, is this practical? How long does it take?


Writing a style guide, what are the best examples for breaking long lines?

You are writing a style guide and you are at the chapter about breaking long lines. What would be the best examples of long lines to demonstrate your rules of breaking long lines. The examples should be in a c-like syntax. I think it is best to keep the examples more or less language agnostic. You can use language specific features for extreme long lines like the many modifiers in java, the implements clause or the throws clause. Note: this is not about the rules of how to break long lines. This is about collecting the best examples for the rules of how to break long lines. I have prepared a question for the rules, but i wanted to collect the best examples first. Please not break your long line, at least not much. just break it as much so that it is readable in this website. You can break your long line to your hearts content in this question once we have a good set of example lines. One example per answer please.


Does anyone have any experience with scene7 image server?

Scene7 is Adobe's image server. It seems like many people are using it. We are considering using it. I want to know the developers experience. Was a pain to develop with or did it make things easier? What experiences have you had?


What are the benefits of not having logic within integration tests?

In the excellent http://artofunittesting.com/, i saw recommendation to keep logic out of unit tests. Does this hold true for functional/integration tests?


How to choose a research discipline in Computer Science?

I got my bachelor's degree in CS five years ago and after that I've been working as software engineer building Voice Over IP (VOIP) or Video Surveillance System. But now for some personal reason I feel that I would like go back to get a PhD degree. But now, the problem is, I am not quite sure which branch of Computer Science I should choose. As most of my working experience is related to multimedia, perhaps professors who study that would be more willing to accept my application. However, I am not quite sure if multimedia is still popular research domain in North America. And if there are not too much works left in this domain, what are other possible choices. I am also interested in programming languages, but I don't know if programming languages could be considered a research area. Another important question is, after I have decided in which domain I would like to study. How can I find most influential research results in this area to get an overview of it? In other words, since there must be plenty of papers in a domain, how can I know which I should read. BTW: If you happened to be a PhD student in Computer Science, what kind of skills or personality do you think your professors prefer? (This last question might be too subjective, so please ignore it if you feel it's ridiculous) Thanks a lot!


If you use multiple computers, how do you sync everything?

I have like 4 or 5 computers now, and I need a better system for syncing everything. I use git and github a lot to sync my files for programming projects, but then there are databases, .bash_profile files, bash scripts, etc. Sometimes, instead of syncing files, I just ssh in from one computer to another. But this is getting fairly chaotic. Some of my computers are Ubuntu and others are OS X. Any suggestions for managing a workflow that spans multiple personal computers?


Architecting Python application consisting of many small scripts

I am building an application which, at the moment, consists of many small Python scripts. Each Python script processes items from one Amazon SQS queue. Emails come into an initial queue and are processed by a script, and typically the script will do a small unit of processing (for example, parse email and store some database fields), then an item will be placed on the next queue for further processing, until eventually the email has finished going through the various scripts and queues. What I like about this approach is that it is very loosely coupled. However, I'm not sure how I should implement live. Should I make each script a daemon which is constantly polling its inbound queue for things to do? Or should there be some overarching orchestration program or process? Or maybe I should not have lots of small Python scripts but one large application? Specific questions: How should I run each of these scripts - as a daemon with some sort or restart monitor to restart them in case they stop for any reason? If yes, should I have some program which orchestrates this? Or is the idea of many small script not a good one, would it make more sense to have a larger python program which contains all the functionality and does all the queue polling and execution of functionality for each queue? What is the current preferred approach to daemonising Python scripts? Broadly I would welcome any comments or opinions on any aspect of this. thanks


How do I tell a user that bps means bits per second or bytes per second?

I'm writing an application that deals with the network and the hard drive. For the network portion, the application measures in bits per second, while the disk portion measures in bytes per second. This becomes an issue as they both are abbreviated `b/s` or `bps` everywhere I've seen. How could I inform the user that one means _bits_ per second, while the other means _bytes_ per second? If I were writing a specification, I could just add a footnote, but as this is an application, I can't do that. So, my question is **How do I tell a user that one means bits per second while the other means bytes per second and how would I style the lettering (i.e. megabinarybytes is MiB, but what is megabinarybits)?**


What sort of wiki or other solution can be used to put updates/software changes in our office?

We use sourcesafe to keep all of our code up to date in what we do in our office, but it's getting to the point where we need to write a few notes and attach different versions of our code for different things (mainly webapps, asp.net) Is there a wiki out there designed for this? Ive looked at Trac but i'm not sure it's best for the job. We really just need somewhere where we can login and see okay x did a release to our main server on y with z changes. We could make one but don't really have the time at the moment. Any suggestions? Thanks a lot, Tom


How to configure these REST API Resources

I'm still in the design phase of my REST API, and I'm a bit stuck on how to configure the resources. The API will be consumed by mobile devices (Android, iOS, and Windows). Communication through HTTPS. These are the features the API will support:   1. View a list of previous reservations    2. View a previous reservation   3. Create a new reservation   4. Create a new anonymous reservation I was thinking of naming my resources as following:   1. api/users/{id}/reservations (GET)   2. api/users/{id}/reservations/{id} (GET)   3. api/users/{id}/reservations (POST)   4. api/users/0/reservations (POST) I'm not sure if the resource for 4 is a good design? Also 1, 2, 3 require a user to have an account and be authenticated. Authentication will be done using an access-token. This means the user has to log in every X period. Is it bad to store the user id on the device so it is able to perform requests where the user id is required? Or should I just remove the /users/ part from the resource and have the server decide based on the access-token which user is trying to perform a specific action? The REST API will be built using ASP.NET MVC4.


browser syntax highlighting

I find myself reluctant to read code without syntax highlighting. On an almost daily basis, I end up downloading or copy-pasting large blocks of code from a browser window into vim just for the sake of seeing it in color. Is there a more elegant solution? is there a plugin for firefox or chrome that allows me to apply syntax highlighting to any page?


Using Ubuntu for commercial software development

I am plaining to use Ubuntu for developing Android and php application which I will sell in market. As far as I understand Ubuntu falls under GNU GPL license. In this case do I need to make my source code open for all?


What's RAII? Examples?

Always when the term RAII is used, people are actually talking about deconstruction instead of initialisation ... I think I have a basic understanding what it might mean but I'm not quite sure. Also: is C++ the only RAII language? What about Java or C#/.NET? or is C++/CLI not RAII anymore?


Recommendations for teaching kids math concepts & skills for programming?

I've got two very bright kids who are showing interest in learning programming. Of course their primary goal is to develop video games. They have decided they want to be game developers when they finish their schooling! However, I seem to have been reading a lot lately about how software companies are frustrated with the level of math skills in their job candidates - apparently schools are not teaching math adequately for programming. There are already other questions about how to teach programming to kids but I'm more specifically interested here in improving kids relevant MATH concepts & skills. What specific suggestions can you give? Just for the record, I'm not seeking to force math on them as a chore rather I'm wondering if there's something enjoyable I could get them to do and they could learn from it at the same time (e.g. similar to how Lego Mindstorms gets recommended for teaching kids programming). Mind you, if someone recommended some great math book that helped their kid that would be great too.


Writing a spell checker similar to "did you mean"

I'm hoping to write a spellchecker for search queries in a web application - not unlike Google's "Did you mean?" The algorithm will be loosely based on this: http://catalog.ldc.upenn.edu/LDC2006T13 In short, it generates correction candidates and scores them on how often they appear (along with adjacent words in the search query) in an enormous dataset of known n-grams - Google Web 1T - which contains well over 1 billion 5-grams. I'm not using the Web 1T dataset, but building my n-gram sets from my own documents - about 200k docs, and I'm estimating tens or hundreds of millions of n-grams will be generated. This kind of process is pushing the limits of my understanding of basic computing performance - can I simply load my n-grams into memory in a hashtable or dictionary when the app starts? Is the only limiting factor the amount of memory on the machine? Or am I barking up the wrong tree? Perhaps putting all my n-grams in a graph database with some sort of tree query optimisation? Could that ever be fast enough?


Purely technical reasons for PHP as a first choice?

I know this may come off as a flame-y / troll-y, but I hope you will take my word for it that it's not my intention. I am just trying to understand the PHP phenomenon. After looking at the many technical issues with the language design of PHP, I am hard pressed to find any redeeming technical advantages where PHP surpasses all other languages. Before coming to the conclusion that there would simply be no reason to choose PHP as a development language **on purely technical grounds** , I would like to ask, if all non-technical factors were equal (such as what language the developers already know, what languages the hosting provider offers, language of existing code, cost, license, corporate fiat, etc.), would there be any type of **new** software system that would indicate making PHP a first choice for development? If so, what technical advantage does PHP have over **all** other languages that would cause you to choose it? **EDIT:** I am not interested in comparing PHP "out of the box" with other languages "out of the box". If PHP has a certain feature "out of the box" that another language has only after installing some readily available add-on, that is **not** considered an advantage for PHP for the purposes of this question.


Best representation for relative dates & durations

I use ISO 8601 to represent dates & durations and all is OK. But now I need to represent relative dates and durations like:   * The date for first day, at midnight, of the next week    * All the last month period. In fact I need to have a syntax for it, I prefer a standard one. I don't need code (I yet have all the code) but a syntax to store relatives date or durations just like ISO 8601 use "P1Y2M10DT2H30M" for a duration. Thanks...


Cost of heavy autoloading in PHP applications?

I have an application which does heavy autoloading, meaning, that only two classes are "included" directly. For every module tha the application has (total like 14 modules), that module defines an autoloader. However, I wanted to know if is too time expensive to load all classes using autoloaders and what could I do to speed it up. As a side note, at this point I'm not experiencing a slow application, I'm just trying to predict if it could happen. Thanks in advance


Grateful for opinions on Language and Framework for my Windows Application

I have read some related questions on this site, including: What language should I seek to learn if I would like to develop for Windows   and How to start programming in Windows but feel that my situation is slightly different and I have a few other questions that I would like some opinions on. I'm a mature student doing an undergraduate degree in Computer Science. I have to choose an idea for my final year project pretty soon. I have my mind set on producing a specific Windows software product (desktop application - web enabled) when I leave uni, and see my final year project as an opportunity to get a head start on this. In particular I want to tackle all the hard parts such as networking and security. I'm not really concerned at the moment with cross-platform compatability, because the market for this product all use Windows, but I need to choose the language and framework that I should use pretty soon. I'm certified in Java (OCPJP (used to be SCJP)) and at uni we've been using Java, C and Occam (uurrghh). However, I was thinking of learning C++ so that I could use the Qt framework which looks pretty good. I do have some concerns though. Would it be quicker to use C#, rather than C++ and Qt? What would the advantages be of using Qt? I'm hoping it will make development quick and will make my software secure and difficult to crack. I am aware that I have to pay for the privilege (I do not want to use the option which is free, as I would have to make my source code available). If I use C#, then I will learn the .NET framework which is basically a lot of helper classes to speed Windows development, is that correct? I understand that I can use quite a few different languages with .NET and they'll all get compiled into the same intermediate language. What's the difference between the Microsoft Foundation Class Library and the Windows Presentation Foundation? Does anyone know the advantages of using either one? I don't think the software will be uber complex. I have professionally used 4 different products of the type that I want to make (I'm a mature student) and the actual processing part does not have to be cutting edge because the demand is never that great for even pretty low powered modern computers (obviously I will still try to be efficient), but the overall design and usability was suprising lacking in most of them and I'm hoping to do better. I just want to make sure that it looks good and that I can develop it quickly. Should I continue reading Ivor Horton's Visual C++ which covers C++, basics of Windows programming, Windows Forms and the Microsoft Foundation Classes? Or does someone have a better suggestion. Limited time available so I need to decide on the tools I'm going to use for the finished product now. I'm very sorry that this post is so long, but it's very important to me to get some good advice on this. Many thanks :) Edit: Good article on StackOverflow Another Edit: Is memory management something which is automatic when developing with C++/Qt? I understand that if you're using .NET with C++, then it's all garbage collected.


.NET Properties - Use Private Set or ReadOnly Property?

In what situation should I use a Private Set on a property versus making it a ReadOnly property? Take into consideration the two very simplistic examples below. First example:               Public Class Person              Private _name As String              Public Property Name As String             Get                 Return _name             End Get             Private Set(ByVal value As String)                 _name = value             End Set         End Property              Public Sub WorkOnName()                  Dim txtInfo As TextInfo = _                 Threading.Thread.CurrentThread.CurrentCulture.TextInfo                  Me.Name = txtInfo.ToTitleCase(Me.Name)              End Sub          End Class          // ----------          public class Person     {         private string _name;         public string Name         {             get { return _name; }             private set { _name = value; }         }              public void WorkOnName()         {             TextInfo txtInfo = System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo;             this.Name = txtInfo.ToTitleCase(this.Name);         }     }      Second example:               Public Class AnotherPerson              Private _name As String              Public ReadOnly Property Name As String             Get                 Return _name             End Get         End Property              Public Sub WorkOnName()                  Dim txtInfo As TextInfo = _                 Threading.Thread.CurrentThread.CurrentCulture.TextInfo                  _name = txtInfo.ToTitleCase(_name)              End Sub          End Class          // ---------------          public class AnotherPerson     {         private string _name;         public string Name         {             get { return _name; }         }              public void WorkOnName()         {             TextInfo txtInfo = System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo;             _name = txtInfo.ToTitleCase(_name);         }     }      They both yield the same results. Is this a situation where there's no right and wrong, and it's just a matter of preference?


Developing linux p2p applications

I have been tossing the idea around in the old noggin of creating a simple p2p chat application that would run in a linux environment and possibly be written in C. It's been awhile since I have written an application that wasn't a web app and I have been wanting to do more with C. I have always been curious just how p2p applications function so I figure this would be a nice way to further my understanding of both the C programming language and the architecture of p2p apps. The only problem is I'm not quite sure where to start. I have done a bit of initial research and found the following C library for p2p applications here. Right now my questions would be:   1. What else should I research before starting the project?   2. Does anyone know of any other C libraries for p2p applications?   3. Does anyone have any good links or know of good books on p2p protocols? My final goal for this would be to have an executable that two people could open on their system and communicate back and forth...simple I know, but education is my primary goal here. Any other information on the topic is also greatly appreciated! Thanks :)


How to pay more attention to detail as a developer?

Are there any resources for paying more attention to detail as a software developer? (Especially edge cases, or small mistakes in code, details in the problem description, ramifications for certain changes to a large system) Some thoughts so far:   \- Books of some sort?   \- Exercise of some sort (e.g. just solving math problems [a professor during undergrad mentioned math teaches attention to detail..although another said assembly language programming teaches detail too...])?   \- Some type of method for decomposing problems/thinking to force attention to every detail?   \- Some way of noting down details so as not to forget them later Example of what I mean: Someone said a good question to ask a prospective developer how many 7's between 0 and 100. I did it quickly and thought of 10, forgetting about 70-76 and 78-79. Basically it's just a lack of attention to detail.... Another example is during a white board coding interview, there was an easy problem and while the initial version was correct, as we kept making it more efficient I kept making more and more small mistakes. Once pointed out it was easy for me to fix them, but it was embarrassing to have them pointed out by the interviewer instead of me finding the issues on my own and fixing them. Another example is just compiling code. Initially I would write code, go over it once before compiling and catch many errors. Now I miss many more errors and the compiler (or interpreter) finds many more errors than it used to. Also I noticed that when I first came out of undergrad it was much easier to hang onto tons of detail where as now even the detail that I initially knew I seem to forget more as time goes on. Which is why in addition to paying attention to detail for new problems I could also use resources for keeping track of detail from older problems without having to rely on memory.


How to approach documentation translation for an open source project?

I'm going to start a little open source project with some friends from all over the world. As I know that one of most important things in open source projects is to help users use the project itself, I want to make some wiki/tutorials/whatever in different languages. What are best tools or way to think/act in general for managing translations? Can you give me some advice?


ASP.NET Mvc3 - application/request lifetime and dependency injection

I thought of asking on SO, but it seems this is more of a "concept" type question than a "problem" type question. If it needs to be moved, please do so. Anyway, I'm having a tough time finding straight info on this. I'm using Unity.Mvc3 to setup dependency injection for controllers and other components the controllers might use. From what I understand from the Unity.Mvc3 website, anything that is `IDisposable` will be disposed at the end of the request from the container if it is registered with a `HierarchicalLifetimeManager`. Does that mean that things registered with the `ContainerControlledLifetimeManager` will be registered as the same instance for all requests for as long as the server/application is running? Can I register an instance using the `HierarchicalLifetimeManager` or does it have to be a type? How do the application/session/request lifetimes work? I ask, because I come from PHP and PHP has no scope outside the request, so this is obviously something I need to get a hang of.


Wrote an application for a friend. Who is the owner of the software?

Friend asked me to develop a software application for him. I did and he paid me. There was no written contract. I live in UK and he resides in Canada. My question is: who is the owner of the software now? Can my friend make and sell copies without my permission? Can I do the same? I'm asking this because another person also wants to buy it, but friend insists on receiving some kind of sale commission, because the software was originally written at his request.


What toolkit to use for card game?

I'm new at this and I was wondering if someone could suggest the most appropriate API to use to make a card game that is:   * cross-platform   * two-player   * peer-to-peer   * capable of laying out cards (png files)   * open-source   * beginner-friendly (well documented) If it helps to give a better answer, the game is based on _Set_ : http://www.setgame.com/set/puzzle_frame.htm ### Edit 1 This will be a standalone client application using C#, or any other suitable language for cross-platform GUI-based applications (e.g., Ruby, Java & Swing, Python). ### Edit 2 There are a number of toolkits listed at:   * http://content.gpwiki.org/index.php/Game_Engines This helps, but which toolkit would be most suitable?


What algorithm should I use to find the shortest path in this graph

I have a problem about the calculation of shortest paths on an unweighted and undirected graph. Which algorithm I use to calculate the shortest path between a node A and node B that passing through a node C on an undirected and unweighted graph?


In ASP.NET MVC/Razor, how to add initializer JavaScript to a "control"?

Actually, I already have at least 3 different solutions for the problem, I just don't like any of them for various reasons. In ASP.NET MVC/Razor, there are no controls anymore, in the sense as they were in ASP.NET. An ASCX control used to be view+controller intertwined, so I get it. Instead we have html helpers that emit strings, html fragments. Let's say I want to create a helper method in a library that creates a jQuery UI date picker. First solution. I just write a method that first creates a textbox (actually I can just call `TextBoxFor` because it does the same thing for me), then it creates a small JavaScript code fragment that calls `$('#textboxid').datepicker()`. Then I can call that in my Razor views and it works. I don't like the fact that view-related stuff is done in code, and not in Razor, but all default editor templates are like that, sadly. I don't like the fact that there will be lots of small script fragments after each textbox in the output html. And my code fragment can get complex, if that initializer JS had many parameters, it would look ugly, there would be string escape issues, etc. Microsoft is pushing unobtrusive JavaScript architecture. I could just put a CSS marker class on my textbox, add some data-attributes if needed, and emit only one JavaScript that turns all my textboxes to date pickers, based on the CSS marker class. This one last part is the main problem, I do need an imperative JS code to do that. Unobtrusive AJAX and validation work well because they don't need that at all, they just respond to user interaction events. This is not the case, I need to turn my textboxes to date pickers whenever they appear. And they can appear dynamically in an editable grid, or after an AJAX call, whenever. Third solution, view should be done in Razor, so let's do it in Razor, as an editor template. Problem is, we're talking about a class library here. In the past, I have seen ugly hacks to embed .cshtml files as embedded resources or compile them to actual C# code during compilation. Last I checked, they seemed like ugly hacks and weren't supported. Is there another solution? If not, which of the above is the nicest, the one that most conforms to the state of the art coding conventions, or Microsoft's idea, etc?


How has an increase in the complexity of systems affected successive generations of programmers?

As a "new" programmer (I first wrote a line of code in 2009), I've noticed it's relatively easy to create a program that exhibits quite complex elements today with things like .NET framework for example. Creating a visual interface, or sorting a list can be done with very few commands now. When I was learning to program, I was also learning computing theory in parallel. Things like sorting algorithms, principles of how hardware operates together, boolean algebra, and finite-state machines. But I noticed if I ever wanted to test out some very basic principle I'd learned in theory, it was always a lot more difficult to get started because so much technology is obscured by things like libraries, frameworks, and the OS. Making a memory-efficient program was required 40/50 years ago because there wasn't enough memory and it was expensive, so most programmers paid close attention to data types and how the instructions would be handled by the processor. Nowadays, some might argue that due to increased processing power and available memory, those concerns aren't a priority. My question is if older programmers see innovations like these as a godsend or an additional layer to abstract through, and why might they think so? And do younger programmers benefit more learning low-level programming BEFORE exploring the realms of expansive libraries? If so then why?


Is the flyweight pattern a good security choice for managing permissions?

I'm designing a system, and it needs future expandability for the use of a permission system of some kind. I'm wondering if the flyweight pattern would be a good choice to implement this. I'm not responsible for the implementation right now, as it is just a prototype, and we're not prototyping any parts that need the right system. However, because of the demand for future extensibility to parts that need permission management the interface needs to be solid. This means that in the end it will be a thought experiment, rather than a real part of what I have to work on. However, I do need to be able to explain and justify my design in this area of the application. In favour of using the are that you can define permissions by having them symbolized through a token class, as represented in the flyweight pattern. If you're dealing with hundreds of users, this would somewhat simplify the handling and issuing of the rights a user holds, and the required rights a user needs for an action within the system; as well as the memory usage of the rights assigned to all the users. In the system I have in mind, a factory method of some kind will assign the rights needed at construction time. As I'm not really experienced with designing with security in mind, I'm having a paranoid line of thought of which I can't determine if it's justified, security wise. A shared pointer could be hijacked by 'evil intruders' to gain rights they should not be getting. This is the major argument against the use of a flyweight that keeps bugging me, Even though the 'how' is undefined, and I wouldn't know how someone would get it done. (no experience in the security mindset, or it's workings. However, I'm not really looking for a lecture in security beyond the secure use of patterns, unless motivated and clearly related to the question) Q: Is the flyweight pattern a suitable pattern to manage the representation of the rights of a user (or other some 'hand out' type of data) in the design of a software system that needs to be secure by design? Does the use of flyweight objects as representation of permissions pose more of a security risk than other patterns (I could also use a decorator chain for it, even though that would take up more memory) when dealing with permissions?


Please help me understand the relationship between script file size and memory usage?

I am programming in PHP and I have an include file that I have to, well, include, as part of my script. The include file is 400 MB, and it contains an array of objects which are nothing more than configuration settings for a larger project. Here is an example of the contents:               $obj = new obj();         $obj->name = "myname";         ....          $objs[$obj->name] = $obj->name;     {repeat}     ....     return $objs;      This process repeats itself 40,000 times and ultimately is 650,000 lines long (the file is generated dynamically of course.) If I am simply trying to load a file that is 400MB, why then would memory usage increase to 6GB? Even if the file is loaded into memory, wouldn't only take up 400 MB of RAM?


What is the better way to design flexible menus?

I would like to have a menu like this in surfdome. I don't mean the UI but the flexibility of this menu. I will try to explain it. I have some products. I want to match these products with some categories and have multiple type of menus based on these categories. e.g. _(in [] are the categories and in () are the products)_ A menu like               [Men] -> [Shoes] -> [Running] -> (Product1)     [Men] -> [Accessories] -> [Running] -> (Product2)     [Women] -> [Shoes] -> [Running] -> (Product3)     [Women] -> [Accessories] -> [Running] -> (Product4)      or               [Running] -> [Men] ->[Shoes] -> (Product1)     [Running] -> [Women] -> [Shoes] -> (Product3)     [Running] -> [Men] -> [Accessories] -> (Product2)     [Running] -> [Women] -> [Accessories] -> (Product4)      or               [Shoes] -> [Men] ->[Running] -> (Product1)     [Shoes] -> [Women] -> [Running] -> (Product3)     [Accessories] -> [Men] -> [Running] -> (Product2)     [Accessories] -> [Women] -> [Running] -> (Product4)      ... What i think it could be done with a `tag system`, but i would like to ask if anyone know a way to do it?


Functional Methods on Collections

I'm learning Scala and am a little bewildered by all the methods (higher-order functions) available on the collections. Which ones produce more results than the original collection, which ones produce less, and which are most appropriate for a given problem? Though I'm studying Scala, I think this would pertain to most modern functional languages (Clojure, Haskell) and also to Java 8 which introduces these methods on Java collections. Specifically, right now I'm wondering about map with filter vs. fold/reduce. I was delighted that using foldRight() can yield the same result as a map(...).filter(...) with only one traversal of the underlying collection. But a friend pointed out that foldRight() may force sequential processing while map() is friendlier to being processed by multiple processors in parallel. Maybe this is why mapReduce() is so popular? More generally, I'm still sometimes surprised when I chain several of these methods together to get back a List(List()) or to pass a List(List()) and get back just a List(). For instance, when would I use:               collection.map(a => a.map(b => ...))      vs.               collection.map(a => ...).map(b => ...)      The for/yield command does nothing to help this confusion. Am I asking about the difference between a "fold" and "unfold" operation? Am I trying to jam too many questions into one? I think there may be an underlying concept that, if I understood it, might answer all these questions, or at least tie the answers together.


Why do arrays in Java not override equals()?

I was working with a `HashSet` the other day, which has this written in the spec: > [add()] adds the specified element e to this set if this set contains no > element e2 such that (e==null ? e2==null : e.equals(e2)) I was using `char[]` in the `HashSet` until I realized that, based on this contract, it was no better than an `ArrayList`! Since it's using the non- overridden `.equals()`, my arrays will only be checked for reference equality, which is not particularly useful. I know that `Arrays.equals()` exists, but that doesn't help when one is using collections such as `HashSet`. So my question is, why would Java arrays _not_ override equals?


Resources or advice useful coming to C# from python 2.7.1

I'm a python monkey at heart. I eat drink sleep and dream in it, and have found that it's taught me much more about writing quality code than my degree in Computer Science ever did, however I've been asked to write an automated testing project in C# at work to link in with Team Foundation Server. Having looked at the language it looks very similar. I've noticed that it seems to be statically typed but I never had any problems with that in C++ or Ada. I've tried looking online for tutorials etc, but they all seem to start from the basics. I was hoping to be able to find information on differences and code translations et al similar to Norvig's lisp to python article. A search on google hasn't rendered any results for me so I was hoping to have a bit more luck here. * * * As a little background I have about 4 years of python, 2 of C++, but that was a few years ago, and bits and pieces of knowledge of other languages. I try not to mention BASIC any more...   It is because of my extended current experience with python that I wish to compare C# with it.


How do I work badges into my open-source project?

Stack Overflow has an awesome set of badges that recognizes a persons contribution to the community and allows an individual's capabilities to grow the more he contributes. What techniques can I use for open-source or coding projects? For example, a person's contribution to the code base earns them badges along with ever- increasing set of capabilities on the project? > ### Moderator note > > Providing a link to a recommendation is not enough: please provide detailed > answers about _how_ to incorporate gamification elements into an open-source > project. Any answer that doesn't do this **will be deleted.** > > See Good Subjective, Bad Subjective for more information about the types of > questions, and the types of answers, we're looking for on Programmers.


Corporate website design

We are redesigning our corporate website with the following functions:   * we want to give the marketing users flexibility and freedom to add new static pages, change the static pages or contents of static pages without the developer(s)/deployment team getting involved.   * we want developers to work on the dynamic portion of the website.  How to architect the website to make sure that the layout/look and feel of the website stays same across all the pages and achieve the above mentioned work? Any experience? Suggestions?


how to avoid workaholic tag

As we all know a programmer just needs a computer and a network connection. When these things are available at your disposal you can program anywhere in the world.   Now this is causing me a bit of problems. Since its not necessary to work at your workplace only you are asked anytime of your vacation or week-off to help out the client on reported bug.   Also if you do enjoy doing it at your pass time, any one seeing you stare at the computer may treat you workaholic which I don't enjoy.   How do you make them realize that its not just about the work.It can be a hobby also.   In my understanding a workaholic is a person who _works to earn_ but an enthusiast is the one who _works to learn_.


Representation of a question mark in variable names

I once in my childhood read a SF story in which it was assumed that the capital letter `'P'` would be a good representation for a question mark, if you cannot use that character directly, eg. in variable names. However the story is quite old and things may have changed :) **Is this a good practice?** BTW: The story was called 'Enter P' or something like that. * * * ### Edit Additional questions that are answered below.   **Is this only writer's phantasy or is it based on an actual language's habit?**   **If yes, which language would that be?**


Is there a good site to hire programmers for little projects?

I need to a piece of php code that goes beyond my abilities so I need to hire somebody to do it. It's not really something too long or complex so I wanted to know if there was a straightforward way to post my request and find somebody to do it for a certain amount. Does such a website exists or what's the best alternative? Anyway thanks a lot


Why is the use of the STE template no longer recommended for EF5?

I was looking to upgrade my project from EF4.1/Framework 4.0 to EF5/Framework 4.5. After reading up on migrating the t4 templates for STE's (Self-Tracking Entities), I came across this link that indicates that STE's are no longer recommended. Why is Microsoft no longer recommending the use of STE's?


Recommend a text that explains the physical implementation of C (stack, heap, etc)

One of the most popular questions on stackoverflow.com is this one: http://stackoverflow.com/questions/4025768/what-do-people-find-difficult- about-c-pointers Many of the answers seem to gravitate toward the fact that students often don't get a good understanding of what is physically going on when code executes... the very most basic part of this seems to be stack/heap. I've read through K&R twice and finally have a good understanding of the language, but I don't think that is enough. Nearly every tough question here has the work "stack" or "heap" in the answer, and while I have a limited understanding of what those mean just from context and wikipedia searches, I prefer the comprehensive approach of a textbook. So, please recommend a textbook which explains things like stack, heap, memory allocation, etc from a physical standpoint, as it relates to C programming. I tried asking this question on stackoverflow and apparently it was not the right place to ask it. So I hope this site is a better location. If not, please consider migrating it to the proper stackexchange site. Thanks.


What problems can arise from emulating concepts from another languages?

I've read many times on the web that if your language doesn't support some concept, for example, object orientation, or maybe function calls, and it's considered a good practice in this other context, you should do it. The only problem I can see now is that other programmers may find your code too different than the usual, making it hard for them to program. What other problems do you think may arise from this?


Is donationware a good monetization model for developers?

I've been developing for Android for about 2 years (and ~1 year for iOS), releasing freeware and open source applications (mostly because my AdSense account was disabled in 2010), but recently I had an idea for a great app that I wanted to get some money, since it would take some effort to develop and also I would like to test this "commercial" model to know if this could make me invest more time improving and making my apps better. Since my AdSense account was disabled and then I'll not be about to sell it on the Google Play Store, I thought about making it a donationware so I would distribute it for free (and probably open source too) and users that really liked the app and wanted to give me a thanks and a incentive to continue developing it could donate any amount of money. So, what's your experience with donationware? Is it worth compared to paid apps?


Should package names be singular or plural?

Often, in libraries especially, packages contains classes that are organized around a single concept. Examples: **xml, sql, user, config, db**. I think we all feel pretty naturally that these packages are correct in the _singular_. > com.myproject. **xml**.Element   >  com.myproject. **sql**.Connection   >  com.myproject. **user**.User   >  com.myproject. **user**.UserFactory However, if I have a package that actually contains a **collection of implementations of a single type** \- such as **tasks, rules, handlers, models, etc.** , which is preferable? > com.myproject. **tasks**.TakeOutGarbageTask   >  com.myproject. **tasks**.DoTheDishesTask   >  com.myproject. **tasks**.PaintTheHouseTask or > com.myproject. **task**.TakeOutGarbageTask   >  com.myproject. **task**.DoTheDishesTask   >  com.myproject. **task**.PaintTheHouseTask


how can we improve documentation of project

We are planning to develop a database api for our project. I want to know how can we improve our documentation. The Current Structure of a document is :               Introduction :     Database Objects :List     Each Object (Table) Field List     List of Common Input Parameters.     loop of each command of database api        Input Parameter of command         Output Parameter of command         Example of using the command      End of loop      Please suggest if we can improve our documentation. :)


In Java, should I use "final" for parameters and locals even when I don't have to?

Java allows marking variables (fields / locals / parameters) as `final`, to prevent re-assigning into them. I find it very useful with fields, as it helps me quickly see whether some attributes - or an entire class - are meant to be immutable. On the other hand, I find it a lot less useful with locals and parameters, and usually I avoid marking them as `final` even if they will never be re-assigned into (with the obvious exception when they need to be used in an inner class). Lately, however, I've came upon code which used final whenever it can, which I guess technically provides more information. No longer confident about my programming style, I wonder what are other advantages and disadvantages of applying `final` anywhere, what is the most common industry style, and why.


Why declare final variables inside methods?

Studying some classes of Android, I realized that most of the variables of methods are declared as final. Example code taken from the class android.widget.ListView:               /**     * @return Whether the list needs to show the top fading edge     */     private boolean showingTopFadingEdge() {         final int listTop = mScrollY + mListPadding.top;         return (mFirstPosition > 0) || (getChildAt(0).getTop() > listTop);     }          /**      * @return Whether the list needs to show the bottom fading edge      */     private boolean showingBottomFadingEdge() {         final int childCount = getChildCount();         final int bottomOfBottomChild = getChildAt(childCount - 1).getBottom();         final int lastVisiblePosition = mFirstPosition + childCount - 1;         final int listBottom = mScrollY + getHeight() - mListPadding.bottom;         return (lastVisiblePosition < mItemCount - 1)                          || (bottomOfBottomChild < listBottom);     }      What is the intention of using the final keyword in these cases?


Why do some software packages have an "amd64" suffix for 64-bit systems?

When downloading various software packages, and executables for Windows, I always see two different types of executables to download. One just says `...32-bit` and the other always says `...amd64`. I know this has nothing to do with AMD, but it is referring to 64-bit operating systems, so why is this still a norm? Even large companies like Google and Ubuntu have packages set up like this. Thanks for any insight! ~Carpetfizz


Where are octals useful?

I just banged my head against the table for some 20 minutes looking at a totally weird bug in PHP, and then I realized there's octal. The <%(*&#> octal. In short, I padded some literals with zeros so the code would be aligned, I know, big mistake. Forgot about octals. The question is, does anyone use octals for anything other than file permissions? (I personally prefer `chmod ugo+rwx` but I understand that if they have to be programmaticaly generated, it's useful to use octals.) But are they useful in any other situation?


Tracking changes to posts

I'm currently in the process of writing a support ticket system... Let's say it's a small forum application, or something like Uservoice. Now I want my users to be able to edit their tickets, but still be able to see the old versions of them. Which route should I take in terms of Database-Design? I've thought of something like: SupportTickets   * Identifier   * Author   * Subject   * SupportTicketContentId SupportTicketContents   * Identifier   * Content   * CreatedOn Now when viewing a ticket, I'd simply query the most recent `SupportTicketContent` depending on the `CreatedOn` column... But is there a better way? Or is there a better naming of these tables?


Developing iOS apps as web developer

My Boss has sold a few 'iPhone apps' to clients, we are a web development shop. I have explained to him that I do not know the first thing about them, but it's such a powerful buzz-word and we need to meet clients expectations. I do have some experience in C, Java and Python which should help if I need to use objective-C. I have even done a few Android tutorials. These apps will more or less be HTML, in my mind they are not real apps, but faux apps which have the same functionality as the clients' websites. To me a real app is something that uses the phones hardware inputs and outputs, gps, accelerometer, speaker etc. What resources can I use to get up to speed iOS development and how to build apps in html. I have no idea where to begin.


I love programming but never get projects started

I read this question and the most voted answer and said to myself "Those things are what I want to do! But why the heck I'm not doing it?" The problem here is that I can't get anything started. I hope you get some kind of idea what I'm interested in and can help me continue programming. I'm interested in embedded programming and I'd like to learn some ARM assembly. I think those could be combined with image processing. Also I'd love to create programs that are actually useful to some people but it seems like there are already multiple programs for pretty much every purpose. Maybe if I found an interesting program without open source alternatives I could get a great project to work on. How could I get myself to finally start a project or few and keep myself interested in them? I just want to get myself to do something I love.


Speed of Java vs. JS / HTML / CSS for web applications

I am creating a web application. I have primarily used Javascript specifically jQuery. Because of some very specific functionality, I am running into practical limitations of Javascript--they're not hard limitations but stuff that I would find easy in Java, like making an equation editor where you can edit directly as opposed to entering TeX, is difficult in JS even using MathJax as a base. I'm going to have to build even more complex functionality that involves 3D and physics engines. For a large scale application like this--specifically one that involves 3D and physics engines--would Java be slower or faster than Javascript when one is run within a browser? (Assume that code is written well in both cases.) Or is it completely uncertain--i.e. dependent on far too many specific variables? Thanks.


How do open-source licenses work when the application is for internal use only?

I am writing a MATLAB application that makes fairly heavy use of the MATLAB File Exchange. Most of the functions I use from here fall under the BSD license. My application is being deployed for _internal use only_ and is not meant for public consumption. While my particular case uses code that falls under the BSD license, generally speaking what implications are there for using open- source code (GPL, BSD, etc) for programs that will never go public? Do I have to include a license file to cover the code that was licensed as BSD?


MVVM pattern - Best design approach to manage an application

One year ago, I discovered the WPF technology and I developed a little application, as first experiment, to compare the content of two different directories. The content of each directory is shown in a different DataGrid. At that time, I didn't develop the application using MVVM pattern, because it was only an experiment, not so good, but it worked. Now that I've much more experience with WPF and with the design patterns, I'm not so proud of that work, and I want to rewrite the application, improving it and following the recommended MVVM pattern. Actually, I designed the application in this way:   * the MainModel, with the main common algorithm.   * the MainView is the unique view of the application with the datagrids where I can show the results of my algorithms.   * a MainViewModel, that it will take care of handling the connection between other two ViewModels, the MainModel and the MainView.   * One ViewModel for each DataGrid. In this way, I'll separate the behavior and the data of the two DataGrids. The MainModel contains the main algorithm used to search the files in a given directory, like this:               public class MainModel     {         public MainModel()         {}              public List<Results> GetFiles(string directoryPath)     }      The MainViewModel will instantiate an object for each ViewModel (I have a ViewModel for each datagrid), using some properties to do it:               public class MainViewModel     {         public MainViewModel()         {             FirstViewModel = new ViewModelDG1();             SecondViewModel = new ViewModelDG2();         }              public ViewModelDG1 FirstViewModel         {get;set;}              public ViewModelDG2 SecondViewModel         {get;set;}     }      I wanted to apply a design pattern to help me manage the application, like a Factory Method or Builder, or a Template Method, but I think they're not suitable for my application for the different usages/conditions of those design patterns. I'm not so sure of this design, I don't know if this a is correct implementation of the MVVM pattern and if it promotes a loose coupling and high cohesion. Can you help me in the design? Is mine a correct implementation of the MVVM? If not, then what is the correct one? What are your opinions? Thank you.


Reusable and customizable charting library on top of d3js

I have started building a charting library on top of d3js using javascript's inheritance. My goal is to develop reusable and fully customizable chart components. I read the article: Towards Reusable Charts. Then, I went through the source code of nvd3. NVD3 uses boiler plate code in each chart like: copying and pasting definitions for width, height, margin etc. BUT I would rather use inheritance to avoid such boiler plate code. I would like properties like: dimensions, axes and functions like zooming and event listeners to be reusable among all charts and customizable through any instance (object) of the chart. Here is what my current library looks like. (It only supports bubble chart for now.)               var BaseChart = function(){         this.width = 200;          this.height = 200;//and others like: margin/ chart title     }          //XYChart inherits from BaseChart     var XYChart = function(){         //It contains members for axes, axis groups, labels, ticks, domains and ranges         //Example: One of the members it contains is "this.yAxis"         this.yAxis = d3.svg.axis().scale(this.scaleY)                 .orient("left")                 .ticks(this.yTickCnt)                 .tickSize(-this.width);     }          //Extends XYChart and adds zooming     var ZoomableXYChart = function(){         this.zoom = function(){             this.svg.selectAll(this.dataShape)                 .attr("transform", function(d, i) {                     var translate = that.calculateTranslation(d);                     return "translate(" + translate.x + "," + translate.y + ")";                 });         }     }          //Extends zoomable XY chart and adds support for drawing shapes on data points     var BubbleChart = function(){         this.dataShape = "path";              this.drawChart = function()         {             this.prepareChart();//Attaches zooming, draws axes etc.             var that = this;             this.svg.selectAll(that.dataShape)                 .data(that.data)                 .enter()                 .append(that.dataShape)                 .attr("transform", function(d) {                     return that.transformXYData(d);                 })                 .attr("d", symbolGenerator().size(100).type(function(d) {                     return that.generateShape(d);                 }))                 .attr("fill", function(d) {                     return that.generateColor(d);                 })                 .on("click", function(d) {                     that.onClickListener(this, d);                 })         }     }      I can create a chart in this way:               var chart = new BubbleChart();     chart.data = someData;     chart.width = 900;     chart.elementId = "#myChart";     chart.onClickListener = function(this,d){}     chart.drawChart();      This solution allows me to use common properties and functions across all charts. In addition to that, it allows any instance of any chart to override default properties and functions (like: onClickListener). Do you see any limitations with such a solution? I haven't really seen javascript's inheritance used for d3.js and I wonder why? Is "chaining" that important? Using Mike Bostock's suggestions, how can we share functions like zooming across all XY charts? Isn't inheritance absolutely necessary to share functions and properties?


Ext JS licensing issue

First of all I'm not asking for legal advice but just checking if anyone agrees with my suspicions. That might help in convincing Sencha to change their license. Their commercial license says: > The Open Source version of the Software (“GPL Version”) is licensed under > the terms of the GNU General Public License versions 3.0 (“GPL”) and not > under this License Agreement. **If You, or another third party, has, at any > time, developed all (or any portions of) the Application(s) using the GPL > Version, You** may not combine such development work with the Software and > **must license such Application(s) (or any portions derived there from) > under the terms of the GNU General Public License version 3** , a copy of > which is located at http://www.gnu.org/copyleft/gpl.html. Meanwhile there exist libraries licensed under MIT or BSD, that use ExtJS. GeoExt is one example. It's likely some contributors of those libraries have not bought the commercial license of Ext JS, and are using its GPL-licensed version. Reasonably GPL-licensed Ext JS shouldn't "infect" GeoExt code if it's distributed without the Ext JS library. Now the problem is, if I use GeoExt then likely "portions" of it **have** been "developed using" the GPL version. Specifically Sencha clarifies what they mean by "develop using" in their FAQ: > The license prohibits combining code that you **develop using a GPL licensed > version** of the software with code that you develop using a commercial > licensed version. In other words, **you may not begin development with our > GPL version and then "convert" it to our commercial version**. My interpretation is that it's not allowed by the Sencha commercial license to combine Ext JS with GeoExt and who knows what other libraries whose contributors at some point may have "developed using" a GPL version of Ext JS. This may or may not include OpenLayers, jQuery and other libraries developers would likely also need to use in their commercial projects. If Sencha then so desires, according to their commercial contract they can demand commercial customers who combined Ext JS with other libraries, to release their software under the GPL, since the commercial license doesn't offer any other resolution. My question is: do you agree that this sounds like developing commercial software using Ext JS may be risky, or is my interpretation incorrect?


Event sourcing and persistence

I'm reading up on event sourcing and have a question regarding persistence. I can still have a DB with all entities, right? Or should the events be replayed every time the application is started to get the latest version of each entity in the memory? Seems like a waste on larger systems (as in large amount of data)? The point with event sourcing is that I can can replay the events to populate a data store if required? (or analyze the data)


Why is a Bayes classifier used for spam filtering?

I've been reading about Bayesian spam filtering and I think I understand the theory, but I just don't see why this approach is needed in order to calculate the likelihood of a message being spam, given that it contains a certain word. If we have a set of messages already classified by the user as either 'spam' or 'ham' and we receive a new message (containing the chosen word) which we want to classify, then surely all we need to do is divide the number of spam messages that contain the word, by the total number of messages that contain the word... Why all the equations?


What data cannot be compressed by huffman codes?

What kind of data cannot be compressed by using the huffman codes and why? I tried looking for the answer, but I only came across loss-less and lossy compression. I don't really understand what types of data cannot be compressed by huffman and why they can't be compressed using it.


Is there another name for Sql Azure's programming language?

According to this page on MSDN the sql language used on Sql Azure is called **transact-sql** (the same as on sql server). But is this the only way to refer to programming on Sql Azure? The Sql Azure variant of transact-sql doesn't support a bunch of features including global temporary tables, distributed queries and system tables; and has partial support for other areas. So is calling it transact-sql appropriate and does anyone know if another name has taken unofficial hold (azure-sql, a-sql ...)?


Should a contract programmer have a portfolio?

I realize that the more you go towards the spectrum of "freelance", there is a need for a portfolio (at least for web development) but I would think that a structured contracted job (like a 3 month duration contract to hire, for example) would be a bit more professional in realizing that a professional programmer spends most of their time writing proprietary applications for companies and thus has no portfolio of these to show off.. The area where I live is not a major tech center so a lot of employers and recruiters here seem a bit less than professional when it comes to tech stuff (but it is a big U.S. city) and I get, fairly often, recruiters asking if I have a portfolio to share, etc.. Sure I have done my own projects but I don't keep them up to date and the work that I do for my current employer is my main focus. Anyways, I guess this is just a generalized question about how to differentiate between "freelance" and "contract" (even though I thought I had been doing so on my resume)


When to Use Shared Libraries

Note: I'm not sure if this question is more suitable for Stack Overflow or Programmers. The thought process behind putting it here was that it doesn't actually relate to coding itself. I noticed a small freeware utility I have on my computer uses a couple of DLLs. From their names ("RenderAllChunks" and "RenderSlice"), it looks like they're being used just for specific functions. If outsourcing program- specific functions is really necessary, wouldn't it be better to just stuff them in a separate header file? It seems quite pointless to go through all the trouble of compiling, linking and distributing DLLs just for one function.   * Is it bad to use shared libraries for small projects?   * When/why are shared libraries preferable over static libraries (or even header files)?


If you take a year or two out from being a developer, is it really that hard to get back into it?

I've been working as a developer for about 3 years now (straight from uni), I'm wondering, if I take a year or two out would it be impossible to get back into the industry? I didn't get the gap year thing out of my system after uni, and I'm thinking that I should probably do it before I hit 30 (24 now), my main concern is that if I leave the industry now, I might not get back into it at all and end up working some dead end job. The way I see things is, that general concepts / design patterns etc remain similar over the years, and it is mostly coding syntax / actual implementation that evolves, so it shouldn't move on dramatically. Also, women developers (yes there are some out there!) take years out to have kids and still carry on with their career afterwards, so it can't be impossible. Ultimatum : Would taking a year or two out destroy the (small) career I've built up so far?


Structuring multi-threaded programs

Are there any canonical sources for learning how to structure multi-threaded programs? Even with all the concurrency utility classes that Java provides I'm having a hard time properly structuring multi-threaded programs. Whenever threads are involved my code becomes very brittle, any little change can potentially break the program because the code that jumps back and forth between the threads tends to be very convoluted.


Is there a synonym for "Blittable" that is more common?

Is there a more common name for a "Blittable" data type? In my software there is a distinction between a variable sized structure and a fixed size structure that has a similar behavior to "blittable" but I have only seen the name used in Microsoft software.


How to create a some kind of value for sentences?

![enter image description here](http://i.stack.imgur.com/qLzG4.png)I want to identify most matching sentence using some pattern. That means by using java algorithm I want to create identical value for each sentences.Each sentence when entering to that algorithm can be out some kind of identical value. How can I develop it? What can I refer any web sites do you know? What sort of sites should I look for? Actually I want clarify about when I'm giving as ex: 5 sentence to algorithm that possible to generate some kind of 5 values.Then I compare with those values with previously generated values(I should be store those values in my database) and get the gap between new 5 value and previously stored values.Then I get the distance and I selected most suitable sentence as most lowest gap value. I'm use those things for my machine translation tool. As an example we think using my ruled based translation model generate 2 sentences. 1\. I want eat an apple. 2\. I want eat a house. In my corpus we think more sentences include and I store values for sentences in my database. (Value assign part is I don’t know yet) I want to create java algorithm to assign value for each sentence. As an example if we think Sentence 1 value: 250.8 Sentence 2 value : 290.5 Database included values 248, 400,800 Then I got the difference. So we can see here most minimum difference get for 250.8 and most suitable sentence is 1 one.


How to abide the "allocate in caller" rule when the size is computed in the callee?

Let's say we have an opaque type `handle_t` that is managed through a simple interface with functions such as:               handle_t *handle_init(void);     int handle_do(handle_t *);     void handle_free(handle_t *);      The problem is that the size cannot be always determined in the initialization step and it has to be calculated in `handle_do`. One solution I have seen is calling `handle_do` two times, the first of which returns the size needed to allocate, but doesn't that affect the performance? Is it a bad practice to allocate or reallocate memory in `handle_do`? Does it even matter when using handle types (since the init/free routines are made clear)?


Do programmers keep error reporting on or off?

I was wondering if php programmers keep error_reporting in php.ini on or off after delivering the website?


Best IDE for HTML, CSS, and Javascript for mac

I'm currently looking to move to using an IDE for web development. The options I'm considering are:   1. Aptana Studio   2. Coda   3. Expresso Please base your answers on the following criteria, in descending order of importance:   1. Supports HTML, CSS, JavaScript   2. Powerful (having good code completion, good debugger, great syntax highlighting etc)   3. Fast and light   4. Supports HTML5, CSS3, and major JavaScript frameworks (JQuery or YUI)   5. Great design (both usability and aesthetics)   6. Supports PHP, Ruby, and Python   7. Has Git integrated I've updated the question to be more objective. I'm mainly looking for an answer that addresses how well each of the IDEs addresses my criteria.


What is the difference between a stock-hardware and a micro-coded machine in "A Critique of Common Lisp"?

I was reading this article: A Critique of Common Lisp and finding it hard to make out the precise definition of "stock-hardware machine" and its difference with "micro-coded" machines. I tried to search for a precise definition of the former to no avail. What I currently construe stock-hardware machine to be is that, it refers to the computer chip-set commonly available in the market (without much customization). So given that I would like to ask, what is meant by a stock-hardware machine (in the context of the paper) and how does it differ from a micro-coded machine?


Best practice for copying static content between a web project and a self hosted EXE project

I have a visual studio solution that has, amongst other project the following three:   * **NamespacePrefix.NancyFX.csproj:** Some Nancy modules   * **NamespacePrefix.NancyFX.IISHosting.csproj:** A web solution to host the nancy modules   * **NamespacePrefix.NancyFX.Selfhost.csproj:** An exe to host the nancy modules In addition to rest services there is some html javascript and css in the Views/, Scripts/, and Content/ folders. I want this content in both the IIS Hosting and the Self hosting project. Currently I store the files in the Web project, and copy them over to the self hosting project bu editing the csproj xml like so:               <Target Name="BeforeBuild">                                                                                <ItemGroup>                                                                                <ContentItems Include="..\NamespacePrefix.NancyFX.IISHosting\Content\**\*.*" />                                              <ScriptItems Include="..\NamespacePrefix.NancyFX.IISHosting\Scripts\**\*.*" />                                               <ViewItems Include="..\NamespacePrefix.NancyFX.IISHosting\Views\*.*" />                                                    </ItemGroup>                                                                                <Copy SourceFiles="@(ContentItems)" DestinationFiles="$(TargetDir)\Content\%(RecursiveDir)%(Filename)%(Extension)" />       <Copy SourceFiles="@(ScriptItems)" DestinationFiles="$(TargetDir)\Scripts\%(RecursiveDir)%(Filename)%(Extension)" />        <Copy SourceFiles="@(ViewItems)" DestinationFolder="$(TargetDir)\Views" />                                                </Target>                                                                                This works fine, but is there a better way? This seems to give me the best intellisense, etc.


How to avoid "managers" in my code

I'm currently re-designing my Entity System, for C++, and I have a lot of Managers. In my design, I have these classes, in order to tie my library together. I've heard a lot of bad things when it comes to "manager" classes, perhaps I'm not naming my classes appropriately. However, I have no idea what else to name them. Most of the managers, in my library, are composed of these classes (although it does vary a little bit):   * Container - a container for objects in the manager   * Attributes - attributes for the objects in the manager In my new design for my library, I have these specific classes, in order to tie my library together.   * ComponentManager - manages components in the Entity System     * ComponentContainer     * ComponentAttributes     * Scene* - a reference to a Scene (see below)   * SystemManager - manages systems in the Entity System     * SystemContainer     * Scene* - a reference to a Scene (see below)   * EntityManager - manages entities in the Entity System     * EntityPool - a pool of entities     * EntityAttributes - attributes of an entity (this will only be accessible to ComponentContainer and System classes)     * Scene* - a reference to a Scene (see below)   * Scene - ties all the managers together     * ComponentManager     * SystemManager     * EntityManager I was thinking of just putting all the container/pools in the Scene class itself. i.e. Instead of this:               Scene scene; // create a Scene          // NOTE:     // I technically could wrap this line in a createEntity() call in the Scene class     Entity entity = scene.getEntityManager().getPool().create();      It would be this:               Scene scene; // create a Scene          Entity entity = scene.getEntityPool().create();      But, I am unsure. If I were to do the latter, that would mean I would have a lot of objects and methods declared inside my Scene class. ## NOTES:   1. An entity system is simply a design that is used for games. It is composed of 3 major parts: components, entities, and systems. The components are simply data, which may be "added" to the entities, in order for the entities to be distinctive. An entity is represented by an integer. Systems contain the logic for an entity, with specific components.   2. The reason I'm changing my design for my library, is because I think it can be changed quite a lot, I don't like the feel/flow to it, at the moment.


Question about moving to embedded systems

I currently work as a .net developer and have coming up to 3 years experience in the industry as well as a degree in computer science specifically software engineering (I know that means nothing but just wanted to explain that I'm not your general back bedroom programmer). When I finished Uni, I started contracting for a company. I wont mention their name but some of you may have heard of them just by the description. Basically they take in fresh graduates and in return for training and contracting experience you have to go to the clients they say for a minimum of two years. I cant say this was great but I do feel I know more than people with the same years of experience as me. The problem is that I've now started heading down the route of web development because of the lack of choice in clients. How difficult is it to change from a .net field to embedded/low level programming? I have the enthusiasm for it and the strive but I'm not quite sure how to go about moving. Unlike application development, knowing the language and having some business etiquette doesn't seem to be enough. > For example hardware wise I can set-up a computer but wouldn't know how to > manually attached wires and program these systems. Is this kind of knowledge > necessary? Thank you in advance. Also if anyone has similar experience of swapping, should I? tl;dr Developer that doesn't know how to get from web development roles into embedded systems. Edit:: Thank you all for the advice.


Can someone else patent my open-sourced algorithm?

I've written a recursive search algorithm to find the boundaries of a voxel data structure in order to render it more efficiently. I've looked around, and either it's such a simple and obvious technique that nobody's bothered to patent it, or it's novel and nobody's done it this way before. It's openly "published" on GitHub and protected under the GPL. I'd like to show it to others, to see if it can be improved, however... I fear that although I've written and published it, someone may attempt to patent the same idea. Am I safe, protected by the banners of open source software, or must I attempt to protect myself like the big guns and patent trolls do? It's my belief that software patents are evil, and that in order for the best software to be written, many eyes need to see it. I'm worried this may be a rather naïve viewpoint on how software is written, though, and I'm curious as to what others think.


If you had two projects with the same specification and only one was developed using TDD how could you tell?

I was asked this question in an interview and it has been bugging me ever since. > You have two projects, both with the same specification but only one of > these projects was developed using Test Driven Development. You are given > the source for both but with the tests removed from the TDD project. How can > you tell which was developed using TDD? All I was able to muster up was something about the classes being more “broken up” into smaller chunks and having more visible APIs, not my proudest moment. I would be very interested to hear a _good_ answer to this question.


Suggested HTTP REST status code for 'request limit reached'

I'm putting together a spec for a REST service, part of which will incorporate the ability to throttle users service-wide and on groups of, or on individual, resources. Equally, time-outs for these would be configurable per resource/group/service. I'm just looking through the HTTP 1.1 spec and trying to decide how I will communicate to a client that a request will not be fulfilled because they've reached their limit. Initially I figured that client code `403 - Forbidden` was the one, but this, from the spec: > Authorization will not help and the request SHOULD NOT be repeated bothered me. It actually appears that `503 - Service Unavailable` is a better one to use - since it allows for the communication of a retry time through the use of the `Retry-After` header. It's possible that in the future I might look to support 'purchasing' more requests via eCommerce (in which case it would be nice if client code `402 - Payment Required` had been finalized!) - but I figure that this could equally be squeezed into a 503 response too. Which do you think I should use? Or is there another I've not considered?


Are there any concrete examples of where a paralellizing compiler would provide a value-adding benefit?

Paul Graham argues that: > It would be great if a startup could give us something of the old Moore's > Law back, by writing software that could make a large number of CPUs look to > the developer like one very fast CPU. ... The most ambitious is to try to do > it automatically: to write a compiler that will parallelize our code for us. > There's a name for this compiler, the sufficiently smart compiler, and it is > a byword for impossibility. But is it really impossible? Can someone provide a **concrete example** where a paralellizing compiler would solve a pain point? Web-apps don't appear to be a problem: just run a bunch of Node processes. Real-time raytracing isn't a problem: the programmers are writing multi-threaded, SIMD assembly language quite happily (indeed, some might complain if we make it easier!). The holy grail is to be able to accelerate any program, be it MySQL, Garage Band, or Quicken. I'm looking for a middle ground: is there a **real-world problem that you have experienced** where a "smart-enough" compiler would have provided a real benefit, i.e that someone would pay for? **A good answer** is one where there is a process where the computer runs at 100% CPU on a single core for a painful period of time. That time might be 10 seconds, if the task is meant to be quick. It might be 500ms if the task is meant to be interactive. It might be 10 hours. Please describe such a problem. Really, that's all I'm looking for: **candidate areas for further investigation**. (Hence, raytracing is off the list because all the low- hanging fruit have been feasted upon.) **I am not interested in why it cannot be done.** There are a million people willing to point to the sound reasons why it cannot be done. Such answers are not useful.


How to manage Inquiries of more than one products?

I can't guess the perfect title of this question, so please read my case and please help me. We have 4 different products. Each is having their own site and database, means they are totally independent. Now I want a common system that can manage "contact us" page inquiries. Moreover I can pull out the contact inquires from each database. And even I should be able to send bulk mail to all of them. etc etc. So what kind of application is this? Is there any software available? If yes then which are those? Or do I need to create a new custom application? Please advise..