title: Using an issue tracker as a single programmer

text: If this is tl;dr, scroll down to "The Question" ### Why this is not a duplicate: The linked question talks about version control (which I have), a one step build script (which I have) and to "have an issue tracker at all" (which I have, but I'm having trouble optimizing), none of the answers to that question answer any of my questions. This question is not about "minimum subset", it is about practical issues in a specific real world situation. ### Background: I am the sole developer at my company, which is only 5 people. Only one of my coworkers has any development experience, and he is not working on any of the production code. He is my boss, but he doesn't have any interest in the details in specific issues. My job is honestly more of a side project of one of the partners (my boss's boss), the company already makes money from things that have nothing to do with me. He is reluctant to give me more resources until I can prove that this project has viability; once I do, he plans to give me a lot more resources, but until then this is my situation. ### The issue: As a result, I am finding it challenging to use my project management platform (currently Redmine). I think that if there were more programmers or even testers, it would be a great communication tool. However, because I am doing 100% of the development work and 95% of the testing, it just seems like a massive time sink to keep the cases up to date, and sometimes even to create them! Most of the time, when I find a bug, I just fix it immediately. The only time it ever makes it into the issue tracker is if it's not something I can fix and test in less than half an hour. As the only programmer, there is no code review. No one who works here is interested in using my redmine server; I'm lucky if I get a bug report via email, usually they just walk over to my desk and tell me - and even that is rare. I have tried to get my boss to use the server by making him watcher of many of the cases, and having it email him when I make changes, but he hasn't even logged onto it in the last 3.5 months. Before I was using redmine, I was using Wunderlist - and honestly that seemed to be a much better fit. It was definitely inferior from a features standpoint, but it did the job - I could make notes of things much more quickly. Note: I am comfortable with my version control routines, most of the time; this is much more about issue tracking and communication with the non- developers. ### The Question: I would appreciate input on any of these questions:   * As a lone programmer, do you prefer a full featured issue tracker like redmine or a simpler personal organization system like Wunderlist or Evernote? \-- If you use redmine or similar, do you use most of the features?   * Any tips for getting YOUR BOSS who has had zero interest in using an issue tracker in the past to start using it?   * When testing existing code (assume code that was not written with TDD), if you find a bug, in what situations to you add the issue to the issue tracker?   * Any other advice that seems relevant for me.


Recently I heard someone say they built a "SaaS" application. At first I thought "this guy knows something new", and I figured SaaS was some hyped enterprise framework or design pattern, but after looking up the SaaS Wikipedia page I realized it's similar in meaning to "web app". What is the origin of the phrase "SaaS"? When was it first used?


title: Should you implement a repository pattern with an MVVM javascript framework?

text: When coding a MVVM pattern I use Dependency Injection (DI) and try and code against interfaces. One of the common patterns is a Repository pattern, so I can swap my data storage provider. If I'm creating a web server side REST/ODATA API to server data to a MVVM/JavaScript/HTML UI, should I need to include a repository pattern in my MVVM JavaScript client code or just leave the repository pattern at the Web Server API level? I just can think of a 'Use Case' which would have me swapping out the Web Server API for another API at this stage. What do others do? In my case I've chosen to implement AngularJS as the HTML/JavaScript MVVM client framework and Microsoft MVC WebAPI as the data/business logic service for Angular.


title: Is there an easy way to map directory structure to a MongoDB schema?

text: I'm trying to store a directory structure, including files and their content, in MongoDB. The work is part of a synching app, and is using in Node/Mongoose. Now, I'm new to Mongo, and it's late here - is the idiomatic implementation as easy as it looks - ie, something like this?               var FileStoreSchema = new Schema({       fullPath: {         type: String,         index: { unique: true }       },       filename: String,       [Metadata and other useful fields]       });


title: Losing a lot of motivation at work. Help?

text: For the longest time (about 5 years out of school now), I've been fairly motivated enough to go to work each day and do actual quality work. Lately I've been losing a ton of motivation. I'm starting to realize that this is really affecting my performance at work for the last several months now. I just don't enjoy doing this anymore. It's just too tedious (especially my current project). I think I might be able to work on easier projects or just do maintenance type work (like fixing bugs or things that don't require an elaborate design document). I think I could be fine doing that sort of thing instead. I really have no idea what is causing my loss of motivation. It just sort of happened recently and now I find myself really struggling to even work on my current task. Help? Maybe I should finally just quit and start working on an iPhone app or something. lol.


title: Getting to the big leagues & managing time as a novice game developer?

text: I'm a 23-year-old novice game developer who just got his first job in the industry a year ago. Unlike most programmers I know, I started programming pretty late, during my second year in college, and I didn't work on any projects of my own until a couple of months ago. I feel like I'm doing quite well and picking things up quickly, but what intimidates me the most is just how many "prodigies" there are in the industry. If you read the biographies of any set of randomly-picked indie developers, you'll almost certainly find that they started programming at the age of 8, that they made 20 games before starting their latest successful venture, that they got together with a group of friends to start a company straight out of college, that they do music and art in addition to programming, etc. Especially now that I no longer have the free time afforded by a lack of responsibilities, I'm starting to get scared that I'm running out of time. So my question is this: how important, really, is this time differential? Does it actually take 10 years to "catch up" to a developer who's been programming since they were a kid, or does that difference matter less when you're programming professionally? And more generally, if you're less experienced than your peers, how on earth do you juggle expanding your technical knowledge, networking with fellow developers, working on side projects, planning a business, maintaining a social life, and retaining a job while at the same time not dying of exhaustion? Apologies if this isn't a good question — I'll delete if I see downvotes.


title: Teaching programming by solving puzzles?

text: I'm going to teach the basics of programming to a group of young kids (c.a. 10 year old) and was wondering if asking them to solve puzzles or play simple games with programming might be a clever thing to do? For example by asking them to write down the though process behind playing Tic-Tac-Toe. (1. Can I make a line? Then put a marker there 2. Can the enemy make a line? Then put a marker on that line. 3. Otherwise just put a marker anywhere.) Or something like that? If so are there any specific puzzles or simple games that are more suited to simple algorithms? Or should I just do it the traditional way by explaining variables, conditionals, etc. using examples and a console program?


title: Outline for technical software documentation

text: Say I have a software project for which the technical documentation should include   * A license document   * A list of used terminology   * An introduction about what the software does   * A short quick-start guide   * Complete documentation of tools covered by the project   * Documentation of file formats and protocols   * An API Reference   * A list of known bugs   * A todo list   * A set of examples What is a good order of these points? How can these points be organized into chapters, sections, subsections, and subsubsections? One of the tools has an hierarchical configuration structure. Should this structure be represented in the documentation outline (this will result in a really deep outline) or should it be flatted in some way?


title: Trying to get a better understanding of object-oriented design's performance pitfalls

text: I'm currently in a high-performance computing class taught in C++. Usually, I do work in C#, meaning everything is taken care of for me, and optimization comes behind maintainability and higher-level features. It's like... a nice productivity furnace that keeps me nice and warm in the programming project winter at the expense of my CPU cycle/cache miss electricity bill. However, now that I'm in C++ and efficient algorithm land, that stuff takes a back seat to optimization. Since most of my work has been in C#, object-oriented programming is sort of my style. However, I have been reading/hearing more and more about how object- oriented code is an enemy of performance. As my understanding of software architecture shifts from being exclusively about class structure and encapsulation to understanding how things are disposed of from L1 cache and pipelining, I'm trying to understand the real reasons why object-oriented design (especially as it applies to C++) causes waste of hardware resources. Can you guys give me a few basic reasons why it impacts computer performance? I know there are other debates about OOP, but I'd like to just keep it to performance on a hardware and algorithmic level.


title: Custom class for monetary amount (money value) instead of BigDecimal

text: On StackOverflow I found multiple advices to stick with `BigDecimal` in Java instead of reinventing the wheel. Despite that, I decided to create my custom class, and I would ask if that was a good idea and pros or cons about my design in comparsion to BigDecimal. The reasons to choose custom implementation and characteristic of my design are:   * no double/float constructors like in BigDecimal (risk of mistake) - **`long` internally with 8 decimal places** \- this restrics min/max to ~10 bilion but system is cryptocurrency-targeted so typical values are small.   * no difference in "0.0" and "0.00" as BigDecimal have   * simple SQL compatibility by BIGINT column   * hard connection to currency object/code - cannot create amount wihtout currency and also cannot do arthimethic/comparsion of two values in different currencies   * Control of creation possible values to not overflow long (-10 bilion to 10 bilion)   * internal overflow protection on computations **Do you think that those reasons as good to choose custem implementation instead of BigDecimal?** To minimize risks I have cover very lot of situations by unit test and also use BigDecimal for initial conversion from string:               BigDecimal decimal = new BigDecimal(value);     ... check MIN/MAX allowed values ...     BigDecimal multiplied = decimal.multiply(new BigDecimal(String.valueOf(DECIMAL_DIVIDER)));     long internalResult = multiplied.toBigInteger().longValue();     return new Amount(internalResult, cryptoCurrency.getInternalCode());


title: What is the best way to learn programming if you've never done so before?

text: Like the title says, what is the best way to learn programming if you've never done so before? Should one start explaining variables, sequential execution, objects, algorithms; where does one start? Of course, this may differ from person to person, but maybe there is a best "average" way which helps the most amount of people on average. I myself don't actually remember the time when I started programming, which is why I'm interested of this. Also, I've often wondered how programmering to newcomers should be taught in the best way.


title: Is there such a thing as having too many private functions/methods?

text: I understand the importance of well documented code. But I also understand the importance of _self-documenting_ code. The easier it is to visually read a particular function, the faster we can move on during software maintenance. With that said, I like to separate _big_ functions into other smaller ones. But I do so to a point where a class can have upwards of five of them just to serve one public method. Now multiply five private methods by five public ones, and you get around twenty-five hidden methods that are probably going to be called only once by those public ones. Sure, it's now easier to read those public methods, but I can't help but think that having too many functions is bad practice. **[Edit]** People have been asking me why I think having too many functions is bad practice. The simple answer: it's a gut feeling. My belief is not, for one bit, backed by any hours of software engineering experience. It's just an uncertainty that gave me a "writer's block", but for a programmer. In the past, I have only been programming personal projects. It's just recently that I moved on to team-based projects. Now, I want to ensure that others can read and understand my code. I wasn't sure what will improve legibility. On one hand, I was thinking of separating one big function into other smaller ones with intelligible names. But there was another side of me saying that it's just redundant. So, I'm asking this to enlighten myself in order to pick the correct path. **[Edit]** Below, I included two versions of how I _could_ solve my problem. The first one solves it by _not_ separating big chunks of code. The second one _does_ separate things. First version:               public static int Main()     {         // Displays the menu.         Console.WriteLine("Pick your option");         Console.Writeline("[1] Input and display a polynomial");         Console.WriteLine("[2] Add two polynomials");         Console.WriteLine("[3] Subtract two polynomials");         Console.WriteLine("[4] Differentiate two polynomials");         Console.WriteLine("[0] Quit");     }      Second version:               public static int Main()     {         DisplayMenu();     }          private static void DisplayMenu()     {         Console.WriteLine("Pick your option");         Console.Writeline("[1] Input and display a polynomial");         Console.WriteLine("[2] Add two polynomials");         Console.WriteLine("[3] Subtract two polynomials");         Console.WriteLine("[4] Differentiate two polynomials");         Console.WriteLine("[0] Quit");     }      In the above examples, the latter calls a function that will only be used once throughout the program's entire runtime. Note: the code above is generalized, but it's of the same nature as my problem. Now, here's my question: which one? Do I pick the first one, or the second one?


title: Design pattern for sharing Social Authentication across subdomains?

text: Right now building an app that authenticates using either email or different social accounts. Because it is going to function on multiple subdomains and domains, I'm wondering if there's a design pattern that's been used in the past to accomplish this without issue. Basically, it's for authentication only as we are using profile information stored locally. I was originally thinking of doing something like an iframe pointed to `accounts.domain.com` that could always check login status of social accounts. Thanks!


title: What process should I follow to implement (code) a web site in HTML5/CSS?

text: The title question is unfortunately pretty vague (or at least may be asking differently than what I intend)... but let me elaborate. I know basic HTML5 and CSS. I don't need to learn the tags and how they work. What I'm looking for is some information on what sort of process to follow when actually coding a professional style website. I want to make a portfolio website for myself from scratch (that is, not to use turnkey software such as Wordpress and such) but I don't know what to do as a process to making a clean site from the start. I'm a CS student and my skill set is in Java/C#, but I do want to learn web development as well. I know that HTML is for the content of the site, CSS is for the look, and Javascript is for the behavior. Do I need to have an idea of what the site is ultimately going to look like before I start the HTML? Can I just write the HTML to describe the content and worry about the look of the site afterward, or do I have to write the HTML knowing what I want the site to look like as I write it? If I want a horizontal nav bar at the top, do the links have to be side by side in the HTML code? These are all things I don't know... how to actually **build** a proper website. I know how to make basic pages with text and links and headers and all that, but to make a professional website is foreign to me. Every page I find on Google is either too high level (giving a design and implementation process without giving examples of how to implement once you know what you want) or is too beginner (trying to teach me HTML and CSS when I already know what I need to know in that regard).


Why were frames deprecated in HTML5, but not iFrames? After all, there is almost no difference between the two. In many instances using either of them would give the same output (pardon me if I am wrong)?


title: Preventing override of methods in Objective-C

text: Objective-C lacks private methods or java-esque final methods. This means that it is possible for a subclass to (accidentally) override some of the internals of a superclass. How does one prevent overriding methods in Objective-C?


title: Is it alright to create another reference to a javascript object just for ease of access

text: I have a use case where I need to create say two javascript objects & use their properties in one another. eg -               var Object1 = {       settings: {        property1: 'someValue',        property2: 'someValue'       }     }          var Object2 = {       foreignProperty: Object1.settings.property1;     }      I wanted to know if its alright to use a reference object for settings if I know that I will be using the settings property a lot. eg-               var Object1Settings,         Object1 = {           settings: {           property1: 'someValue',           property2: 'someValue'         }     }     var Object1Settings = Object1.settings;          var Object2 = {       foreignProperty: Object1Settings.property1;     }      Is this approach acceptable in terms of right ways of coding & performance? Thanks


title: OSS dual licensing / market segregation

text: I have an open-source project, which I would like to commercially license to various types of businesses. xGPL licenses do not work for me since they don't allow any conditional addenda. What I'm seeking to achieve is:   * require commercial licensing for businesses   * allow use and changes under some OSS license for individuals   * allow free use (same as above) to specific business branches on individual selection basis (e.g. educational institutions). I'm really confused about how to achieve this and don't violate the terms of the OSS part of license at the same time. **Edit** : I'm looking for an existing free license, which doesn't explicitly forbid dual licensing like GPL family does.


title: why do some job posts say "high pressure environment"?

text: Why would there be any pressure if everyone knows what they are doing and the projects are accurately estimated? If there's pressure, or even high pressure, then it implies what they are currently doing is not working, why would any good programmer want to join a team like that? Are these kind of job posting failed at trying to show off or are they really just being honest? Or is there really some good reasons for having pressure?


title: The best method to get personal projects done

text: I have numerous personal projects I've begun and never seem to finish because I get sidetracked with other ideas. I was wondering what the best method to get personal projects done is? Any tricks or tips to it? The problem is I get a spurt of inspiration on some projects, and I don't wanna lose track of my ideas and right now my method of "saving my ideas" is to just get as much stuff done on the ideas as possible in one night and then store some GitHub issues as to dos. I find that this makes me never get back to older projects tho.


title: I want to sell my software [C# desktop application] but I was Stuck in licencing

text: > **Possible Duplicate:**   >  if I use .NET Framework for my application, do I have to pay anything to > Microsoft? I have developed a desktop application called "Institute Management System" which has modules like Class manager, Subject manager, Topics manager, Student inquiry manager Student admission manager, Fees manager, Exam manager etc. using C# for the front end and MS Access for the back end. The main problem is that I want to sell it and earn some money but I heard that my application needs to be registered at Microsoft, and I would have to get a license from them for selling, and have to pay them money too. I have spent four months developing it at my own expense, and worked very hard to develop it. So I want some tips, advice, any suggestion for the same. Please also tell me the procedure for all of the required registrations and payment issues. And I also want to ask you if you **Can you suggest any other technology where I develop my application and sell it without worrying about licencing and related issues?** I am now more confused about that "MS technology is open source or not? "


title: Intermediate to advanced book for improving VIM knowledge and understanding

text: I use `vim` already for quite a while and every day try to learn new things. But, somehow I yet don't feel that I own it. I'm looking for some intermediate to advanced books on `vim` which may be used as a reference as well in every day development. What I look for in the book is more explanations of concepts and general background philosophies than cheat sheet style lists of actions. Maybe it could cover some commonly used plugins and plugin development as well.


title: Where did the convention of naming command line arguments as 'argv' come from?

text: It seems like Python, PHP, and Ruby all use the name "argv" to refer to the list of command line arguments. Where does the name "argv" come from? Why not something like "args"? My guess is that it comes from C, where the v would stand for "vector". Wikipedia has a footnote that says: > the vector term in this variable's name is used in traditional sense to > refer to strings. However, there isn't any source for this info. Really, I'm curious if it has roots that trace even farther back. Did C use it because something before that used it?


title: How to find people to help translate my open source project?

text: I'm a big StackOverflow fan, but I think this question belongs here, correct me if I'm wrong. So basically I'm trying to localize my plugin in as many languages as possible. I posted a section on the docs to reach people that wants to help translating but I only got one contributor that attached a German translation. So far I got 4 languages, English, Spanish, French and German. So my question is, how do you guys translate your projects? Where do you find people interested in contributing? Does anybody use Google translate to do the job?


title: Useful Pre-requisites for Operating Systems course?

text: How important is knowledge of data structures and algorithms for an Operating Systems and Systems Programming course where we will be required to design and implement a kernel of a real-time operating system (done using C and 68K)? How useful will programming experience implementing data structures like linked lists, queues, binary trees etc. in C++ be for this type of course? thanks!


title: When do rounding problems become a real problem? Is the least significant digit being one off really a big deal?

text: If I do `.1 + .1 + .1` in Python, I get `0.30000000000000004`. (I am not asking about Python in particular, and do not want Python specific answers.) The only problem I can see with this is `0.30000000000000004 != 0.3`, so I need to take care in how I compare floats. Are there any other problems I need to be aware of with float rounding? I can't imagine that last digit being much of a problem in real life. For example, if I ask for a "0.30000000000000004 meter metal rod", I'm not going to later complain that "this rod is 0.00000000000000004 meters too long!" (I can just cut the extra off, right? :) Even with a lot of float calculations going on, I can't imagine the rounding getting so far off that it matters. Am I missing something? When do floating point rounding errors really matter?


title: What can be done to programming languages to avoid floating point pitfalls?

text: The misunderstanding of floating point arithmetic and its short-comings is a major cause of surprise and confusion in programming (consider the number of questions on Stack Overflow pertaining to "numbers not adding correctly"). Considering many programmers have yet to understand its implications, it has the potential to introduce many subtle bugs (especially into financial software). What can programming languages do to avoid its pitfalls for those that are unfamiliar with the concepts, while still offering its speed when accuracy is not critical for those that _do_ understand the concepts?


title: Python Class Layout - Conventions

text: What is the proper or standard way to layout a class. If a class where to have attributes, methods, private attributes, private methods, class property (methods), and class methods. I am done 99% of my coding procedurely and beyond working with ORM haven't focused to much on OOP. I am changing that in a current project and was just curios what the standard way of organizing your classes was.               Class MyClass():        attr1 = value1        attr2 = value2        _attr3 = value3        def __init__(self):           do some stuff        def do_something(self):           do some more stuff             def __do_something_else(self):           more stuff        @property()        def attr4(self):            return do_some_stuff_else()             @classmethod()        def generator_a_bunch_of_these(cls):            do_some_more_things


title: Can I use machine learning for screening experimental data?

text: I am a experimental physicist. In our research, we have our experimental data in a 400*400*400 matrix(x, y, z axis of a 3d space), each entry is associated with a value("brightness"). We expect the brightest entries will form a closed path in the 3d space. But some portion of the path is always too dark to identify, also there are some noise in the space(random bright lines). Our current algorithm generates random seed points into the space, they are attracted by the brightness of the data. After certain amount of time, they will be trapped in the path. If we record the seed points position we can get the path. Our current algorithm does a fairly good job while I still need to manually add those relatively dark points to the path. I am not familiar with machine learning, but I am wondering if it can be used on this case? For example, is it possible that I tell the program which data points are on the path, the program will know how to choose the data points for the path in the future. Or if there is some other method we can use? Thanks!


title: Question/Answer for multiple Users - How should I design it?

text: I'm wondering about a good way to deal with a Question/Answer - Model for multiple Users. My goal is to have an efficient and readable model where all the results of my users are stored. Every user has the same questions/answers! At the moment I have three classes, `Question`,`Answer` and `User`. A `user` has a `Set of Questions`. A `question` has a `Set of Answers` and an extra field `selected_value` which is the answer the user clicked. Every user has a copy of the same set of questions. Therefore I can easily see what a user has clicked. This is an unnecessary overload because I need to store the questions/answers more than once. But the good thing about this approach is the availability of my questions/answers in my user-model as I need to see what every user clicked. It's also easy to extract this information (e.g. via xml) doing just a loop around every user and his questions. But what kind of approach would you recommend to use? Should I create a model "result" inside of my User-Model where I simply store a list of pairs like "QuestionId, AnswerId"? Is there any more accepted way to do so?


title: Github Workflow: Pushing small fix branches to remote, or keep them local?

text: In Scott Chacon's workflow (explained eg in this SO answer), with essentially two silos (`development`, and `master`), if, say I have a small bug to fix (e.g. can be fixed with a few characters) is the optimal way of doing that: a) branch off of `development` a branch called e.g. `fix_123`. Push this branch to origin as I work on it. When it's done, code-reviewed, whatever, merge into `development` and push `development` to origin. b) Same as above, but without pushing `fix_123` to origin.


title: Help with algorithmic complexity in custom merge sort implementation

text: I've got an implementation of the merge sort in C++ using a custom doubly linked list. I'm coming up with a big O complexity of n^2, based on the `merge_sort()` > `slice` operation. But, from what I've read, this algorithm _should_ be `n*log(n)`, where the log has a base of two. Can someone help me determine if I'm just determining the complexity incorrectly, or if the implementation can/should be improved to achieve `n*log(n)` complexity? If you would like some background on my goals for this project, see my blog. I've added comments in the code outlining what I understand the complexity of each method to be. _Clarification_ \- I'm focusing on the C++ implementation with this question. I've got another implementation written in Python, but that was something that was added in addition to my original goal(s).


title: Best way to use GIT to maintain web application template

text: I am a sole developer and I have a web application template that I have created in Visual Studio. I am using GIT for source control, but only on my development machine. Presently I have a master and I create branches for new features, merging them back in to the master as I complete the features. I am at a point now where I am ready to use the template for deployments, and of course I want to continue adding new features via branching/merging. My question is: what would be the typical/recommended way for me to create application deployments based on the master? Should I clone the repository into a new directory that is for a particular web application? Or should I also use branching to do project development based on the main project? The projects would never be merged back into the master. However, it would be nice if I could merge future features into the master and have the ability to incorporate them into previously completed projects if desired. For more specific details of my environment: I am using TortoiseGIT in Windows 7, Visual Studio 2012, ASP.NET Web Pages. Obviously the main differences between deployments would simply be differing pages, CSS files and jQuery scripts. * * * I found this post as I was writing this one. In order to do this should I clone the master repository and checkout from it?


title: map data structure in pacman

text: I am trying to make a pacman game in c#. I have done some basic work and have previously replicated games like copter-it and minesweeper. I am confused about how to implement the map in pacman. Which datastructure to use, so it can be used for moving AI controlled objects and check collisions with walls? I thought of a 2d array of ints but that didn't make sense to me.


title: How much time should you allow for clock skew?

text: We are writing a B2B application that uses OAuth 2.0. Before a token expires we want to refresh it since it faster to refresh a token, than request a new one. However, we want to build in some resilience in the system to clock skew so we want to consider a token expired a few seconds/minutes before it would actually expire. How many seconds/minutes is it reseasonable to expect two servers connected to the internet, in different locations, to be?


title: Why did the Microsoft developers did not put T4MVC (or its working) in the core MVC?

text: What T4MVC does makes complete sense to us. It converts the simple string input into strongly typed input, which eases things for the developer. Like this -               return View("foo");       to               return View(Views.foo);  // better (T4MVC)      What could be a reason as to why the MS people are NOT doing it this way?


title: Confused about the definition of 'abstraction' in OOP

text: I am trying to understand the definition of 'abstraction' in OOP. I have come across a few main definitions. Are they all valid? Is one of them wrong? I'm confused. (I re-wrote the definition with my own words). **Definition 1:** Abstraction is the concept of taking some object from the real world, and converting it to programming terms. Such as creating a `Human` class and giving it `int health`, `int age`, `String name`, etc. properties, and `eat()` etc. methods. **Definition 2:** A more general definition. Abstraction is a concept that takes place **anywhere** in a software system where **_'making things more general/simpler/abstract'_** is involved. A few examples:   * An inheritance hierarchy, where the higher classes are simpler or more general, and define more general and abstract implementation. While the lower classes in the hierarchy are more concrete and define more detailed implementations.   * Using encapsulation to hide the details of implementation of a class from other classes, thus making the class more 'abstract' (simpler) to the outside software world. **Definition 3** Another general definition: Abstraction is the concept of moving the focus from the details and concrete implementation of things, to the types of things (i.e. classes), the operations available (i.e. methods), etc, thus making the programming simpler, more general, and more abstract. (This can take place anywhere and in any context in the software system). It takes place for example when encapsulating, because encapsulation means to hide the details of implementation and only show the types of things and their more general and abstract definitions. Anotehr example would be using a `List` object in Java. this object actually uses the implementation details of an `ArrayList` or a `LinkedList`, but this information is abstracted using the more general name `List`. Is any of these definitions correct? (I am referring to the **most conventional and accepted** definition).


title: MVC exposes database primary keys?

text: I'm going through a MVC tutorial, and I notice that convention seems to be to expose a tables primary key on detail pages/urls (ie. /Movies/Details/5 as an example from the tutorial). It's obviously not a problem for things like a movie record or a SO post, but it might be a bit different for an invoice or transaction with confidential information on it if the key was sequential or guessable. So, is it just this tutorial or do MVC apps typically expose a tables primary key? Is there a common library or pattern for hiding the key if you don't want to expose it?


title: DB connection Dependency Injection and static creator methods

text: I often use static "factory" methods to create objects from database.               class Job {       protected $objDb;       public function __construct($objDb) {         $this->objDb = $objDb;      }           public static function LoadArrayByProjectId($intProjectId, $objDd) {        //some code that loads the jobs        $objJob = new Job($objDb);        $arr[] = $objJob;        //end of loop        return $arr;      }           public static function LoadArrayByUserId($intUserId, $objDb) {        //similar code      }      } So I try to use Dependency Injection by passing into the constructor the $objDb. The problem is the $objDb param in the static functions. It's very annoying to pass the param around. How do you handle this case? Are there better solutions?


title: What's it like to work in a large programming team?

text: I've always felt lucky to work in a small programming team. I think the most I've worked with is 11 programmers. What is it like working on a project with hundreds of developers? Thousands? What does scale and what doesn't? EDIT: Thanks for all the responses! There seem to be very few positives:   * possible to work on mega-large codebases   * better internal career development   * employee protection against abusive management (this is more -ve on small than +ve on large) Is there any other benefit to large teams?


title: Subscript/assignment binary operator in C++

text: I was designing a kind of a parser when I thought that it would be nice to have an operator overload like this: `operator[]=(subscipt_type s, rvalue_type val)`. For example we have a class:               //collection of Foos     class FooCollection     {     public:              //assume class Foo is defined         Foo& operator[]=(int i, const Foo& val);         //.....     };      And we need to assign a subscripted value:               Foo value;     FooCollection c;     c[42] = value;      then the last line of this code will resolve into               c.operator[]=(42,value);      The advantage of this operator in comparison to existing `Foo& operator[](int i)` is that we know the rvalue of assignment during the subscripting, so we can do something that could be unwished in ordinary `operator=`. For example, I tried to design a parse tree consisting of polymorphic nodes with minimal interface. This is the basic node class, all other node types are inherited from it:               class AnyNode     {     public:         virtual AnyNode& operator=(const AnyNode& op)         {             //Takes almost no actions here.             //Overloaded in each subclass to take some sensible actions         }              virtual AnyNode& operator[](int i)         {             //Returns special null value of AnyNode type.         }     };      The AnyNode class is not pure virtual, so it's possible to construct `AnyNode` objects. One of the syntax elements that I try to parse is a python-like list, which may contain heterogenous values and may be subscripted with an integer. A class for it:               class ArrayNode : public AnyNode     {     public:          AnyNode& operator[](int i)         {             //Returns a reference to i-th element         }     };      So what will happen when we try to assign something to the array cell, which was not assigned before and it's concrete type was not defined? `AnyNode& operator=(const AnyNode& op)` from `class AnyNode` will be called and no actions will be taken. But I want to know the `AnyNode&` rvalue just after subscripting, so that it could be possible to deduce it's concrete type with RTTI and take some sensible actions. Subscript/assignment operator could look like this:               AnyNode& operator[]=(int i, const AnyNode& val)     {         //AnyNode::getType() is provided and it returns a value of the predefined enum.         //stor is an underlying container that holds pointers to AnyNode,          //assume it's possible to reference stor[i].         //NodeNumber is another subclass of AnyNode.         switch(val->getType())         {         case nodetypeNumber:             stor[i] = new NodeNumber();//Also we may need to delete stor[i] before new allocation.             //Process further specific initialization of stor[i].             break;         //................         }         //Or we could use dynamic_cast instead of switch(val->getType())     }      I suppose, such kind of subscipt/assignment operator can be easily and consistently built into language. Moreover, it delimits the pieces of code which execute when the subscripted expression is an lvalue and when it's an rvalue: with it the usual subscript operator should be called only when the subscription is rvalue. Of course, if the proposed operator is not defined, but a `operator[]` is defined, the code should execute in a usual way. So my questions are: what pitfalls could I miss about this operator and why does it not included into the language? Can it break language consistency in any way or can it bring up any ambiguity into the language?


title: Versioning an API

text: I'm starting a side project, the first stage will be a building a web application with MVC, in later stages we will be adding clients for mobile platforms. My thought was to create one API that all of the applications (web and mobile) go through to get/save data. Because these different platforms will be on different release cycles I'll need a way for, say IPhone, to work with one version of the API while the website is using an updated version. What's the best way to do that? My ideas so far are:   * Create a separate project to host the MVC Web API and host that in a subdomain or in a subfolder of the root site. Then either reference the DLL directly or reference it through the web (seems like an unnecessary http call)   * House the API within the MVC project that will be the website and try to version it based on url in there. I did some quick testing with that this morning and wasn't able to get it to work, it always resided at \api (I couldn't get it to reside at \api_v2)


title: Is it true that websites don't need to use an event driven framework given the stateless nature of the web?

text: I feel like it's critical to use an event driven architecture with a lot of application types that aren't web sites. However, when coding web sites(which are stateless at the most basic level) it seems like it isn't really necessary to use an event driven architecture. Is this true? Do most web frameworks not use events to communicate between objects?


title: Entity Framework and distributed Systems

text: I need some help or maybe only a hint for the right direction. I've got a system that is separated into two applications. An existing VB.NET desktop client using Entity Framework 5 with code first approach and an ASP.NET Web Api client in C# that will be re-factored. It should be possible to deliver OData. The system and the datamodel is still evolving and so migrations will happen in undefined intervals. I'm struggling how to manage my database access on the web api system. My favoured approach would be use Entity Framework on both systems but I'm running into trouble while creating new migrations. Two solutions I've thought about: Shared Data Access dll The first idea was to separate the data access layer into a separate project and reference from each of the systems. The context would be the same as long as the dll is up to date in each system. This way both soulutions would be able to make a migration. The main problem is that it is much more complicated to update a web api system than it is with the client Click Once Update Solution and not every migration is important for the web api. This would cause more update trouble and out of sync libraries Database First on Web Api The second idea was just to use the database first approach an on the web api side. But it seems that all annotations will be lost by each model update. Other solutions with stored procedures have been discarded because of missing OData support and maintainability. Has anyone ran into similar conflicts or has any advice oon how such a problem can be solved!


title: Can I charge for closed source J2EE .ear module relying on GPLed EJBs?

text: A customer asked me to add a (fairly generic monitoring and notifications) functionality to the in-house solution he has assembled on top of JBoss and couple of GPL-licensed components (downloadable from the open source vendor as EARs). I am using JMS and JMX to communicate with these components. Do I have to provide the source and redistribution rights to my customer to satisfy GPL restrictions? In other words, does configurable code that uses JMX and JMS mechanisms constitutes a derivative work? I would actually prefer to open source my code, but part of it relies on a patented third party logic that is unwilling to GPL it, but would gladly supply it to this customer. I am not asking for a legal advice, just for the opinion in terms of best practices / fair use.


title: How can I inspire engineers to positively conduct telephone interviews

text: Our (mid-size) company (with 150 employees) has witnessed considerable growth since last year, and as a result we have been conducting lots of interviews to hire more and more engineers to bring new projects in motion. To begin with, following is our interview process   1. Screening resume by HR   2. Telephone technical interview (conducted by senior engg)   3. Final technical + HR interview (conducted by team-lead/PM) After some analysis we found that telephone interviews are not really becoming effective, due to which we are not able to find good number of engineers in final interview. My analysis revealed that engineers don't consider interviewing as important/serious activity, since it's internal and non- billable. Also I see that engineers don't find it really prestigious to carry a label of "interviewer" (at-least telephone interviewer). We do have set of good experienced engineers in company who can take any interview very effectively, but since number of telephonic interviews is large, this pool is not sufficient. Hence we try to use other engineers as well. What can be done to inspire engineers to conduct telephone interviews seriously and positively (not treating this as mundane job)? * * * [Update-2011/12/28] Thanks for sharing your valuable opinions. It really helped me to look at problem from variety of different angles. Alongside I was discussing issues with few colleagues as well and I personally feel that there is no single silver bullet for such issue. I will need to think recruitment process as a whole unit and plan to improve different areas/stages in it.


title: Correct For Loop Design

text: What is the correct design for a `for` loop? Felix currently uses               if len a > 0 do       for var i in 0 upto len a - 1 do          println a.[i];        done     done      which is inclusive of the upper bound. This is necessary to support the full range of values of a typical integer type. However the for loop shown does not support zero length arrays, hence the special test, nor will the subtraction of 1 work convincingly if the length of the array is equal to the number of integers. (I say convincingly because it may be that 0 - 1 = maxval: this is true in C for unsigned int, but are you sure it is true for unsigned char without thinking carefully about integral promotions?) The actual implementation of the for loop by my compiler does correctly handle 0 but this requires two tests to implement the loop:               continue:       if not (i <= bound) goto break       body       if i == bound goto break       ++i       goto continue     break:      Throw in the hand coded zero check in the array example and three tests are needed. If the loop were exclusive it would handle zero properly, avoiding the special test, but there'd be no way to express the upper bound of an array with maximum size. Note the C way of doing this:               for(i=0; predicate(i); increment(i))      has the same problem. The predicate is tested after the increment, but the terminating increment is not universally valid! There is a general argument that a simple exclusive loop is enough: promote the index to a large type to prevent overflow, and assume no one will ever loop to the maximum value of this type.. but I'm not entirely convinced: if you promoted to C's size_t and looped from the second largest value to the largest you'd get an infinite loop!


title: Distributed Version-Control for Small Projects

text: When it comes to very small projects (just a few devs), how effective are distributed version-control systems (e.g., git) compared to systems with a central repository? I like the idea of having a central repository because it seems much more elegant and organized. However, after watching Linus Torvalds's Google Talk, I have my doubts. Are all those benefits really noticeable with such a small project, though?


title: Does learning to develop for iOS create a lock-in?

text: If I begin my career (first job) with developing on the iOS platform, does that lock me in into iOS and Mac OS X development only? By locking me in I mean will that create barriers for me to switch technologies as I would be mainly working with Objective-C. If yes, does that make my career choices limited? I'm interested in comparing this with Android development, which if pursued will leave me with Java skills (correct me if I'm wrong) which I can use elsewhere.


title: Should I use a Class or Dictionary to Store Form Values

text: I am working on a C# .NET Application, where I have a Form with lots of controls. I need to perform computations depending on the values of the controls. Therefore, I need to pass the Form values to a function and inside that function, several helper functions will be called depending on the Control element. Now, I can think of two ways to pass all the Form values: i) Save everything in a Dictionary and pass the Dictionary to the function or ii) Have a class with attributes that corresponds to each of the Form element. Which of these two approaches , or any other, is better?


title: UI Developer Interview Question

text: I keep getting the following question in interviews; and judging from the reactions I've gotten, I'm not giving the best answer. "What methodology do you use for developing user interfaces?" Which seems like a rather broad question. Besides dividing work between markup, stylesheets, and javascript (control logic), what are the best practices? What am I missing in this question? Any thoughts?


title: Can I fork Linux source code, change it around to suit my desires, and claim it as my own kernel without doing any of the originating work?

text: Is it acceptable form to take Linux kernel source from any version, change it, claim it is mine, and then distribute it for monetary gain? In such a case open-source software is entitled to a sort of "grab, change, sell" mechanism in which anyone can just tinker with something to look different from the original source, make it work their way, and sell it as if they made it entirely themselves. Isn't that illegal?


title: When writing an interpreter, how should the type inference algorithm change the parsed AST? Should it?

text: _When writing an interpreter, how should the type inference algorithm chance the parsed AST? Should it?_ Or parsing and inference are done necessarily simultaneously? I have implemented a strongly typed functional language interpreter, in which each function can be declared only one time (i.e., with no signature variants). As soon as the non-typed implementation parser was concluded and working, I have written the type inference algorithm, feeded by the parser's resulting AST. Hindley- _Damas_ -Milner is working like a charm, but the program use it and if the type checking passes, it just forgets about the matter and pass the AST to the interpreter. To the moment, the "target language" (i.e., the one in which the interpreter is written) have satisfied the interpreter type needs, but **I am wondering if this approach is usual: to discard all the type inference fruits after an "ok" result.** Also, would writing a compiler instead of an interpreter make any difference is this sense?


title: Eloqua API Full Code Example in JAVA

text: **Is there anyone out there who has mastered to retrieve some data programmatically from Eloqua?** First of all, I'm more or less a newbie, as far as JAVA. I can follow tutorials, take directions and will Google till my fingers bleed. I understand the basics and am slightly familiar with OOP. My main problem is that I have a Friday deadline (and tomorrow is Thanksgiving). At any rate, all the Eloqua code snippets (that I've been able to find) illustrate one aspect of a specific issue, and that's it. In my case, **I would greatly appreciate a JAVA project of some sort** , with all the necessary files to do web services (WSDL, SOAP and perhaps WSIT) and the main class and all that included. No, I don't want you to do my work for me! Just give me enough to find my way around, enter the information I need to retrieve and all that. I'll take it from there. Any pointers, links or suggestions?


title: What's up with the Class::get(id) idiom in PHP

text: I am a new PHP developer (coming from .NET). The experienced php dev that I work with said that calling a static get method on a PHP class with an ID as a parameter is common in PHP. Is there a name for this idiom? Is there a reason why developers do this? Can someone point to a link to an example class? I would like to understand more of what he is saying. He is talking about code like this I think, to pull car #1 from the database:               $car = Car::get(1)


title: Is Java "dead in the water" as a consequence of Oracle buying Sun and subsequently suing Google

text: Google has led many useful Java features (guava, gson); now that Oracle has purchased Sun, will it affect its future enhancements and utilization as a development language? What exactly, or even approximately, are the legal ramifications? I thought Java was open source and would therefore remain unaffected ... ? Should Google just buy Oracle to get rid of the whole mess, that would be cool wouldn't it ? Do you think this is the beginning of the end for Java as a widely used language ? Its continued success as an open source/free technology is now doubtful?


title: General rules for writing a X compiler to Z in Y

text: Suppose X is the input language, Z is the output language, then f is the compiler, which is written in language Y.               f = X -> Z      Since f is only a program, I think Y can be any language, right? So we can have compilers f1, f2, each written in Y1, Y2.               f1 = f Y1         f2 = f Y2          g = Z -> M     h = g . f    # We get a compiler X -> M      Take cpython compiler for example, X is Python, Z is the Python VM code, Y is C.               cpython = Python -> PythonVMCode C     interpreter = PythonVMCode -> Nothing     interpreter2 = PythonVMCode -> MachineCode      Python sources are compiled to the Python VM code, the .pyc files, then interpreted by the interpreter. Looks like it's possible there exists a compiler which can directly do Python -> MachineCode, though much hard to implement:                  hardpython = interpreter2 . cpython       We can also write another compiler do the work Python -> PythonVMCode, in another language, say Python itself.               mypython = Python -> PythonVMCode Python     mypython2 = Python -> PythonVMCode Ruby      Now, here is the complicated example PyPy. I'm just a newbie of PyPy, correct me if I'm wrong: PyPy doc http://doc.pypy.org/en/latest/architecture.html#pypy-the-translation- framework > Our goal is to provide a possible solution to the problem of language > implementers: having to write l * o * p interpreters for l dynamic languages > and p platforms with o crucial design decisions. We can think l is X, p is Y. There exists a program which translates all RPython programs to C:                rpython_compiler = RPython -> C  Python           pypy = Python -> Nothing RPython           translate = compile the program pypy written in RPython using rpython_compiler           py2rpy = Python -> RPython  Python      py2c = Python -> C Python       py2c = rpython_compiler . py2rpy      RPython programs are just like VM instructions, rpython_compiler is the VM. **q1.** pypy is the interpreter, a RPython program which can interpret Python code, there is no output language, so we can't consider it as a compiler, right? Added:   * I just found that even if after the translating, pypy is still a interpreter, only this time written in C.   * If we look deep into the interpreter pypy, I believe there must exist some kind of compiler, which compiles the Python sources to some AST, then execute like this:               compiler_inside_pypy = Python -> AST_or_so      **q2.** Can compiler py2rpy exist, transforming all Python programs to RPython? In which language it's written is irrelevant. If yes, we get another compiler py2c. What's the difference between pypy and py2rpy in nature? Is py2rpy much harder to write than pypy? **q3.** Is there some general rules or theory available about this? More compilers:               gcc_c = C -> asm? C  # not sure, gimple or rtl?     g++ =   C++ -> asm? C     clang = C -> LLVM_IR  C++     jython = Python -> JVMCode java     ironpython = Python -> CLI C#      **q4.** Given f = X -> Z, a program P written in X. When we want to speed up P, what can we do? Possbile ways:   * rewrite P in more efficient algorithm   * rewrite f to generate better Z   * if Z is interpreted, write a better Z interpreter (PyPy is at here?)   * speed up programs written in Z recursively   * get a better machine ps. This question is not about the tech stuffs of how to write a compiler, but the feasibility and complexity of write a certain kind compiler.


title: The optimal recipe problem

text: Suppose I have a list of Ingredients In My Fridge which are going off soon, and a list of Recipes which use up various Ingredients. (Some of which I don't currently have.) Is there an algorithm which produces the optimal set of Recipes, where an optimal set maximises the number of Ingredients In My Fridge used up and minimises the number of Ingredients I Have To Buy From The Store? (Alternate formulation: In a card game, I can combine some Cards according to various Rules; I can also obtain new Cards in various ways. How do I find the best set of Rules to use up the most Cards I have for the minimum effort in obtaining new Cards?)


title: Gevent - Make blocking calls non-blocking

text: I have the blocking code shown below. Is calling `monkey.patch_all()` enough/optimal to make it non-blocking? Does Gevent handle iterations like these?               # front page     def front_page():         database = db.posts.find() # find all items in posts collection              return render_template(                                'index.html',                                 database=database                               )               # single post     def single_post(slug):         post = [v for k,v                      in db.posts.find_one(                                          {'slug': slug}                                         ).iteritems()                ] # iterate over found items and store it as post              return render_template(                                'post.html',                                 title=post[3],                                 body=post[0],                                 slug=post[2]                               ) # extract the title, slug and body


title: Can this argument be enough?

text: We have two C++ classes named `Important` and `Small` The class `Small` use a few methods and attributes from the class `Important`, but not all. Since our application is performance critical, instead of copying all attributes (possibly pointers) of `Important` that are needed by `Small` and redefine the few methods in `Small`, we decided to just let `Small` hold a pointer on `Important`. Can performance justify such a design choice?


title: GRE CS Subject Test: Can you recommend the top books to read?

text: I am a long time professional C programmer planning to get admitted for a Masters degree in Computer Science. The University requires that I submit GRE CS subject test scores. I'm planning to sit for it this coming October, and have until then to prepare for it. I do not have a CS undergraduate degree, so suggestions of reading my undergraduate texts wouldn't be helpful. Which books would you recommend for me to purchase and read that will cover maximum percentage of the test topics? The test breakdown includes: > **I. SOFTWARE SYSTEMS AND METHODOLOGY — 40%** > > A. Data organization > > Data types > > Data structures and implementation techniques > > B. Program control and structure > > Iteration and recursion > > Procedures, functions, methods and exception handlers > > Concurrency, communication and synchronization > > C. Programming languages and notation > > Constructs for data organization and program control > > Scope, binding and parameter passing > > Expression evaluation > > D. Software engineering > > Formal specifications and assertions > > Verification techniques > > Software development models, patterns and tools > > E. Systems > > Compilers, interpreters and run-time systems > > Operating systems, including resource management and protection/security > > Networking, Internet and distributed systems > > Databases > > System analysis and development tools > > **II. COMPUTER ORGANIZATION AND ARCHITECTURE — 15%** > > A. Digital logic design > > Implementation of combinational and sequential circuits > > Optimization and analysis > > B. Processors and control units > > Instruction sets > > Computer arithmetic and number representation > > Register and ALU organization > > Data paths and control sequencing > > C. Memories and their hierarchies > > Performance, implementation and management > > Cache, main and secondary storage > > Virtual memory, paging and segmentation > > D. Networking and communications > > Interconnect structures (e.g., buses, switches, routers) > > I/O systems and protocols > > Synchronization > > E. High-performance architectures > > Pipelining superscalar and out-of-order execution processors > > Parallel and distributed architectures > > **III. THEORY AND MATHEMATICAL BACKGROUND — 40%** > > A. Algorithms and complexity > > Exact and asymptotic analysis of specific algorithms > > Algorithmic design techniques (e.g., greedy, dynamic programming, divide and > conquer) > > Upper and lower bounds on the complexity of specific problems > > Computational complexity, including NP-completeness > > B. Automata and language theory > > Models of computation (finite automata, Turing machines) > > Formal languages and grammars (regular and context-free) > > Decidability > > C. Discrete structures > > Mathematical logic > > Elementary combinatorics and graph theory > > Discrete probability, recurrence relations and number theory > > **IV. OTHER TOPICS — 5%** > > Example areas include numerical analysis, artificial intelligence, computer > graphics, cryptography, security and social issues.


title: Introducing "20% time" at a workplace

text: 20% time it's the culture of an employer allowing it's employees to spend 20% of their time working on projects that they find interesting - it may be inventing a new app, or improving an existing process, etc. Some people _may_ know this as skunk work, however that term may not mean anything (or something entirely different) to you. There are many documented cases of great products being born out of 20%/skunk work at a company. It seems like a win/win situation; the company potentially gain a great new product or application, and the developer has the opportunity to flex his/her creative muscles and innovate. I tried on numerous occasions to introduce some form of 20%/Skunk working at my previous employer with no success. How can I better justify it to management? What's the "right" way to approach this kind of work arrangement?


title: A vector of pointers to different derived classes of the same base class

text: I am writing a game in C++ which has different enemy types. I have defined a base **_Enemy_** class and I also have derived classes **_enemy1_** , **_enemy2_** etc. Now for updating these enemies in each iteration of the game, I want to have an array: **_EnemyArray_** with its elements pointing to the existing enemies so that I can make sure to update them all with their own version of **_update()_** , etc. One way of doing this, would be to define separate arrays for each enemy type and that would be a clean way of solving the problem. However, I was wondering if the fact that these enemy classes are all derived from the same base class makes it possible to somehow have my EnemyArray as an array of **_Enemy_** 's and do some modifications later.


title: What is a Neural Network in simple words

text: Can you please explain neural networks in _simple words_ with an example?


title: Single responsibility: how does this code cause problems?

text: Given the following interface               interface Modem {         public void Dial(string pno);         public void Hangup();         public void Send(char c);         public char Recv();     }      Uncle Bob writes > However, there are two responsibilities being shown here. The first > responsibility is connection management. The second is data communication. > > ... > > Should these two responsibilities be separated? That depends upon how the > application is changing. If the application changes in ways that affect the > _signature of the connection_ functions, then the design will smell of > Rigidity because **the classes that call _send_ and _read_ will have to be > recompiled and redeployed more often than we like**. Can anyone explain to me how is the highlighted statement true? Why would I have to recompile code that calls the sending/receiving methods if the connection signature changes? I could have injected a ready made connection to the code using it.


title: Mobile App Development-Architecture/Platform: Main performance concern: device/UI responsiveness

text: I am currently investigating different alternatives for building a mobile instant messaging application for iOS and Android, using an XMPP server (probably ejabberd) as the back-end. Main requirements are a nice UI and of course good performance on most devices. I have identified three different alternatives, two of which include using the Marmalade SDK Option A): Use Marmalade C++, creating the UI with Marmalade Libraries such as IwNUI/INUI. In this option, the UI is created in C++ code. My assumption is that this should be good in performance, however I am not sure how easy it is to achieve a nice, custom UI that has a good/modern feel to it, such as other high-quality apps. Another advantage: This would target iOS/Android with one code base. Option B): Also Marmalade, using the C++ s3eWebView api to load local web pages packaged in the application package. UI would be designed in these web pages using HTML/CSS/JavaScript. For the application logic, JavaScript or C++ can be used, as there is a JavaScript Bridge (http://docs.madewithmarmalade.com/display/MD/The+Javascript+interface) to communicate between C++ and JavaScript code. Would also target iOS/Android in one go. Option C): Non-Marmalade: Go with two code bases. Use Objective-C (i.e. "standard way") for iOS, and Google Android SDK for Android. Build the app twice. I am currently leaning towards Option B, as this would allow for use of one code base, and leverage existing HTML5/CSS/JavaScript technologies (nice especially for UI), together with the ability to use C++. However, my concern is whether device/UI responsiveness will be acceptable with this. I have run some preliminary tests for simple things such as loading CSS3 dropdown menus into an s3eWebView via C++, and this seems fairly responsive (i.e. menu drops down quickly and smoothly).


title: How deterministic are SessionIDs from SHA'd GUIDs?

text: Assume I'm using the following code to generate pseudo-random sessionID's:               sessionID = SHA-512(GENERATE-GUID())      The GUIDs are pretty deterministic, i.e. I see lots of GUIDs with a lot of the same hexadecimals. My simple question is: How deterministic are my resulting sessionID's? The algorithms for SHA are supposed to create very different hashes even if a small number of bits are different due to its cascading effect, so how easily could you "guess" (within reasonable time) another sessionID from the resulting hashes?


title: Is it possible to modify a native executable and change (dynamic) library it depends on?

text: Say I compile a simple application called `myproggy` that depends on the `libfoo` dynamic library. Assuming I have another dynamic library `libbaz` that implements absolutely the same interface (in other words it has definitions of the same functions as libfoo), is it possible to modify the `myproggy` to depend upon `libbaz` without the need for rebuild? I can easily do this in the case when I can dynamically load the library, but what if I can't, and I also can't re-compile the library? I am also aware of the security issues related to this.


title: How should this relationship be structured in a relational database?

text: In a recent project I was asked to implement an events system. An `Event` had to have a `Location` which was originally specced out as simply a physical location with some optional extra notes. Then the spec changed (as they have a habit of doing) and we needed to have "online" events too. These would not have a physical address but would still need notes on how to attend (e.g. the URL, joining instructions). We decided to adapt the existing Location table by adding an `IsOnline` field and it wound up looking like this:               +-----------------+     +---------------+     |      Event      |     |    Location   |     +-----------------+     +---------------+     | Id              |  .--+ Id            |     | Name            |  |  | Name          |     | Summary         |  |  | Address       |     | Date            |  |  | Postcode      |     | Capacity        |  |  | IsOnline      |     | LocationId      +--'  | Notes         |     +-----------------+     +---------------+      An example of a physical and an online entry in the Location table look like this:               +----+----------------+--------------------------------------+----------+----------+---------------------------------------+     | Id |      Name      |               Address                | Postcode | IsOnline |                 Notes                 |     +----+----------------+--------------------------------------+----------+----------+---------------------------------------+     |  1 | Physical Event | 10 Downing Street, London            | SW1A 2AA |        0 | Ask the policeman to let you in       |     |  2 | Online Event   | http://programmers.stackexchange.com | null     |        1 | You will need a stackexchange account |     +----+----------------+--------------------------------------+----------+----------+---------------------------------------+      It works (currently) for our simple use case but it is clearly a bit of a hack and it got me thinking - what would be the correct, normalized way to model this kind of relationship (Where an entity must have an A or a B but not both)?


title: If I were to claim I knew C++, what libraries would you expect me to know?

text: I'm unsure as to the definition of knowing a programming language, so I'm picking C++ as an example. How much does it take to someone to be qualified as knowing C++?   * Should they just know the basic syntax?   * Template and generic-programming?   * Compiler flags and their purposes (Wall, the difference between O1, O2 and O3)?   * STL?   * Garbage collection strategies?   * Boost?   * Common libraries like zlib, curl, and libxml2?


title: Integrated PowerShell Console Window

text: I would like to have a tab open for PowerShell inside of my VS2012. There are other consoles that I have access to, such as "Command Window" and "Package Manager Console" Is there any way to get a Powershell console window open? I've attached an image that shows where I would like the PS window.![enter image description here](http://i.stack.imgur.com/zgwn8.png) http://i.imgur.com/kDs9Yhv.png


title: Simple C: How do I scan this information in properly?

text: OK this is a simple question but for some reason I just can't get it right. I have to scan from a file hundreds of lines of code and store it in a array (which I can normally do a ok job with) however At one point the code will specify a number that then corresponds to the next batch of chars ints and floats going into various arrays. As I know I am not describing this correctly here is a example. one line of the file I am reading will contain something close to this. > 0221 T 2 S P 850 150 0.90 0.75 500 24 2 2012 G A 7 9600.00 0.1 1000 > Name_of_place > > 0104 L 1 F 400 1.00 0.75 500 24 2 2012 G A 7 9600.00 0.1 1000 Ballroom the problem I am having is This part here > 0221 T **2 S P 850 150** 0.90 0.75 500 24 2 2012 G A 7 9600.00 0.1 1000 > Name_of_place > > 0104 L **1 F 400** 1.00 0.75 500 24 2 2012 G A 7 9600.00 0.1 1000 Ballroom The rest after this is Generally the exact same however at this point the number at the front descides all the values that are going in. I am almost completely lost on how to write a way that can scan this and store the data into arrays correctly


title: How to name a variable when the word is both a noun and a verb

text: I have run into a corner-case problem with the general guidance of:   * nouns for variables   * verbs for functions Specifically, I have a case where the word is ambiguous - it can be either a verb **_or_** a noun. And in some cases when we're discussing the application, it will be used _both_ ways in the same sentence. My intent is to make sure the program will remain readable to future developers as well as myself when I return to sections of code months later. One of the examples is with a `battery`. A `battery` has a `charge` and you can also `charge()` a battery. I think that having both `Battery.Charge` and `Battery.Charge(value)` will be confusing to future developers. My current solution is to simply pick a different word for one or both of those cases (the variable and the function). My problem with that approach is the `Battery` object's variable and function for `charge` won't align with design discussions involving the `Battery`. **My question is if there is another / better way to handle this conflict in naming convention?** * * * Some additional reading on the subject. None really addressed the particular of my question.   * Meaningful concise method naming guidelines   * Naming conventions for variables   * The selected answer from What naming guidelines do you follow?


title: Custom maven mojo and tools

text: I'm writing maven plugin which depends on several java tools. I'm quite happy with it and want to share it with the community. I'm interested in correct way to handle dependency to these tools:   1. Use usual dependency way - put to central repository. But I'm not owner of these tools and I'm not going to maintain them. But I could start discussion with author   2. As I saw like several other plugins require for user to download these tools and provide path to them through configuration. But they are java tools, as well this is much less convenient for the end users I'm asking community what would be the best and "right" in maven way to handle this.


title: RESTful Design: Multiple Relationships Between the Same 2 Entities

text: I am in the process of designing RESTful web services and got stuck at one point. The design is very simple with 3 entities:               - Project     - Status     - Employee      The part I am having trouble with is capturing the relationships:               - A project has a current status (1 to 1 between Project and Status).     - A project has multiple 'possible subsequent status' (1 to many between Project and Status).      The Visual Studio designer does not allow these two different relationships to be defined between these two entities. I am aware that it is just a modelling tool but at the same time, I am willing to know if this is the right approach. Also, with this design, I am not sure how to access the Status entities using these two relationships.               http://serviceRootURL/Project(2)?$expand=Status // For current status     http://serviceRootURL/Project(2)?$expand=SubsequentStatus // For subsequent status      Is it possible to use arbitrary relationship names with the expand keyword? _(The question probably touches OData a little bit as well since I am trying to make my library OData-compliant.)_


title: Are there advantages to using a DVCS for a solo developer?

text: Right now, I use visual svn on my server, and have ankhsvn/tortoise on my personal machine. It works fine enough, and I don't have to change, but if I can see some benefits of using a DVCS, then I might give it a go. However, if there's no point or difference using it without other people, then I won't bother. So again, I ask, are there any benefits to using a DVCS when you're the only developer?


title: Getting my feet wet with open source - creating a small project on my own VS contributing to a big one?

text: I want to contribute to the open source community, but I've never done it before, and I have some concerns regarding the collaboration process - I am afraid that I will just "get in the way" of other developers, and since (I assume) that they are pretty polite guys, they will feel bad about telling me to bug off. I imagine things like adding the feature X in 1.3.0, just to realize that there was actually such thing in 1.1.5, but it was intentionally removed in 1.1.8 because of Y. Being an independent contractor (a freelancer) I work very rarely with other developers, as a team, and I do understand that the software collaboration is a complex area (I've read a couple of books on management of big teams, seems to be a delicate area, at least to me). To my actual question - should I start with something small (that I will create), and wait for other contributors to join it (ones that will know how "the stuff works", so I can slowly get my head straight on the collaboration part), or I should try to join a big project, which has a lot of activity in it, so I can see the big picture (but risking to be a pain for them) ?


title: Should I encourage junior developers to use explicit or implicit typing?

text: I am looking to solicit the community's opinion on whether or not it would be advisable to teach junior developers to code with implicit typing (using var) or should I encourage the use of explicit types. This is not really a question about the advantages or disadvantages of implicit typing. Junior developers (at least the ones that I deal with) tend to develop very long lasting coding habits in their first years as professional developers and I am trying to think through the potential downside of starting a developer off with the implicit typing approach. Are there specific scenarios that would warrant the advocacy of explicit typing? What about as part of the discipline of TDD? **And on the issue of ReSharper...** @Eben Geer mentioned ReSharper in his answer. Should we keep the default suggestion to use implicit typing in the inspection templates that our junior developers use?


title: Feature code + infrastructure code - how to structure the commits / JIRA issues?

text: Say that you work on a feature described by a **single JIRA ticket** and during the work, you:   1. Create **feature-specific code** like the GUI or specific use-case behavior.   2. Some of the code was generic so you placed this **infrastructure code** in a shared library. As an example (deliberately simple), say that the ticket is about changing a message somewhere in the application and that the message should contain the current year somewhere in it. So you first amend your PHP code where the message is and also create a helper function `getCurrrentYear()` in your `DateUtils` library. What is the best practice now to store these changes to a source code repository and assign those code changes to JIRA ticket(s)? (Assigning commit to a JIRA ticket means in our case adding a tag to a commit message, for instance _"Implemented feature #123"_.) As I see it, there are these main options:   1. Create one commit and assign in to the given JIRA ticket.   2. Create two commits (one for the use-case logic and one for the infrastructure code). Assign both of them to the single JIRA ticket.   3. Assign only the feature-specific commit to the JIRA issue and leave the other unassigned (when viewing the ticket in JIRA, only the first commit will be visible in the "source code" tab).   4. Similar to 3 but you have a generic ticket like "Infrastructure improvements". Is there a best practice / recommended way? What are some of the benefits and problems of the various possibilities?


title: Database Design - Optimise Relationships

text: I am about to embark on a redesign of an application, one where querying the database is particularly annoying. I intend to redesign the database as much as possible but the data shape cannot change too much. The database has a main table and 10 other tables each representing a record type. The main table has all of the data the record types have in common. Record ID, DateLogged etc. Around 30-40 columns in total. The other tables are all completely different as each record type is very different from another. They all have about 20-30 columns each. The main table has a column called type, which is an int. However nowhere does it reference what record types the type numbers refer to. You can just figure it our by looking at the procedures. The main table has to join with each type table to allow searching. I have added an image representing what I am trying to describe. ![enter image description here](http://i.stack.imgur.com/FbdZp.png) Is there a better way to create these relationships? I would like to ditch the verbose stored procs used with ADO.NET and move to EF. I need to think of a better way to relating the data so people in the future wont need to work out the relationships by scouring stored procedures for clues.


title: Designing a robust architecture for multiple export types?

text: I'm looking for patterns or architectural guidance for an upcoming feature I'm designing. Basically, it's an export feature with multiple export targets, and I'm looking to find a way to make it generic enough where plugging in new export targets don't require a lot of core changes. By export targets, I'm simply referring to different types of output, whether that be PDFs, PowerPoint presentations, Word documents, RSS, etc. I have a base set of data, which is represented in JSON and XML. This data are used to construct images (using any number or export types [e.g., PNG, JPG, GIF, etc), graphs, textual representations, tables, and more. I'm trying to find a way to abstract all the rendering and layout into some kind of rendering or layout engine that handles the addition of further export targets. Any help/suggestions/resources as to how to approach this would be greatly appreciated. Thanks in advance. For a pictorial representation of what I'm trying to achieve. ![enter image description here](http://i.stack.imgur.com/aAvE9.png)


title: TDD: What happens before the first unit test?

text: I mostly understand the theory of TDD, but I can't figure out how to get started. I sit down to write a unit test for a personal project and realize . . . I have no idea what I am testing. What objects, what functionality, etc. E.g., let's say I want to write an app to help our family manage chore assignments. Here are some questions in my mind: How do I go from this idea to my first test? How much should be decided before I start, and how much do I figure out after I start writing tests? When do I make decisions like whether to store data in a text file or a database? Should I have user acceptance tests before I get started? Should I have the UI designed? Should I have a spec? (I do realize at least some of these example questions are probably in a "gray area"). In addition to the title question about getting to the first unit test, could you also give an example of what the first unit test for a project like the sample project might look like?


title: How to handle multi-processing of libraries which already spawn sub-processes?

text: I am having some trouble coming up with a good solution to limit sub-processes in a script which uses a multi-processed library and the script itself is also multi-processed. Both, the library and script are modifiable by us. I believe the question is more about design than actual code, but for what it's worth, it's written in Python. The goal of the library is to hide implementation details of various internet routers. For that reason, the library has a "Proxy" factory method which takes the IP of a router as parameter. The factory then probes the device using a set of possible proxies. Usually, there is one proxy which immediately knows that is is able to send commands to this device. All others usually take some time to return (given a timeout). One thought was already to simply query the device for an identifier, and then select the proper proxy using that, but in order to do so, you would already need to know how to query the device. Abstracting this knowledge is one of the main purposes of the library, so that becomes a little bit of a "circular- requirement"/deadlock: To connect to a device, you need to know what proxy to use, and to know what proxy to create, you need to connect to a device. So probing the device is - as we can see - the best solution so far, apart from keeping a lookup-table somewhere. The library currently kills all remaining processes once a valid proxy has been found. And yes, there is always only one good proxy per device. Currently there are about 12 proxies. So if one create a proxy instance using the factory, 12 sub-processes are spawned. So far, this has been really useful and worked very well. But recently someone else wanted to use this library to "broadcast" a command to all devices. So he took the library, and wrote his own multi-processed script. This obviously spawned `12 * n` processes where `n` is the number of IPs to which he broadcasted. This has given us two problems:   1. The host on which the command was executed slowed down to a near halt.   2. Aborting the script with `CTRL`+`C` ground the system to a total halt. Not even the hardware console responded anymore! This may be due to some Python strangeness which still needs to be investigated. Maybe related to http://bugs.python.org/issue8296 **The big underlying question** , is how to design a library which does multi- processing, so other applications which use this library and want to be multi- processed themselves do not run into system limitations. My first thought was to require a pool to be passed to the library, and execute all tasks in that pool. In that way, the person using the library has control over the usage of system resources. But my gut tells me that there must be a better solution. * * * **Disclaimer:** My experience with multiprocessing is fairly limited. I have implemented a few straightforward which did not require access control to resources. So I have not yet any _practical_ experience with semaphores or mutexes. **p.s.:** In the future, we may have enough information to do this without the probing. But the database which would contain the proper information is not yet operational. Also, the design about multiprocessing a multiprocessed library intrigues me :)


title: Generic rule parser for RPG board game rules - how to do it?

text: I want to build a generic rule parser for pen and paper style RPG systems. A rule can involve usually 1 to N entities 1 to N roles of a dice and calculating values based on multiple attributes of an entity. For example: Player has STR 18, his currently equipped weapon gives him a bonus of +1 STR but a malus of DEX -1. He attacks a monster entity and the game logic now is required to run a set of rules or actions: Player rolls the dice, if he gets for example 8 or more (base attack value he needs to pass is one of his base attributes!) his attack is successfull. The monster then rolls the dice to calculate if the attack goes through it's armor. If yes the damage is taken if not the attack was blocked. Besides simple math rules can also have constraints like applying only to a certain class of user (warrior vs wizard for example) or any other attribute. So this is not just limited to mathematical operations. If you're familiar with RPG systems like Dungeon and Dragons you'll know what I'm up to. My issue is now that I have no clue how to exactly build this the best possible way. I want people to be able to set up any kind of rule and later simply do an action like selecting a player and a monster and run an action (set of rules like an attack). I'm asking less for help with the database side of things but more about how to come up with a structure and a parser for it to keep my rules flexible. The language of choice for this is php by the way. **Edit I:** Let me refine my goal: I want to create a user friendly interface (that does not require somebody to learn a programming language) to build more or less complex game rules. The simple reason: Personal use to not need to remember all the rules all the time, we simply do not play that often and it's a stopper to look them up each time. Also: Looks like a fun task to do and learn something. :) **What I've tried so far:** Just thinking about a concept instead of wasting time building a wrong architecture. So far I have the idea to allow a user to create as many attributes as they want and then assign as many attributes as they want to any kind of entity. An entity can be a player, a monster, an item, anything. Now when calculating something the data is made available to the rule parser so that the rule parser should be able to do things like if Player.base_attack + dice(1x6) > Monster.armor_check then Monster.health - 1; The question here is about how to create that parser. **Edit II:** Here is an example of pretty basic value but to calculate it properly there are lots of different things and variables to take into account: > Base Attack Bonus (Term) Your base attack bonus (commonly referred to as BAB > by the d20 community) is an attack roll bonus derived from character class > and level. Base attack bonuses increase at different rates for different > character classes. A character gains a second attack per round when his base > attack bonus reaches +6, a third with a base attack bonus of +11 or higher, > and a fourth with a base attack bonus of +16 or higher. Base attack bonuses > gained from different classes, such as for a multiclass character, stack. A > character’s base attack bonus does not grant any more attacks after reaching > +16, cannot be less than +0, and does not increase due to class levels after > character level reaches 20th. A minimum base attack bonus is required for > certain feats. You can read it here http://www.dandwiki.com/wiki/Base_Attack_Bonus_(Term) including the links to classes and feats which have again their own rules to calculate the values that are required for the base attack. I began to think that keeping it as generic as possible will also make it pretty hard to get a good rule parser done.


title: how to patent software

text: I am interested in patenting a piece of software that I have created with a group of people. I live in europe. I have no idea how to go about it, but I have multiple users tell me that I should have it patented for safety. So I was wondering where do I start? There are so many links online giving me a whole load of information. I was just hoping for a more straight forward answer. If more info needed, please let me know, happy to share.


title: How are operators organized in memory

text: How are operators organized/saved in the memory in context of a programming language. Are they procedures/functions saved somewhere and compilers just manipulate things to call these procs whenever the operators are used in the program?


title: How Byte loading/storing is implemented By the CPU?

text: I know that in 32bit machine, cpu read from memory 32bits at a time. since the registers in this case is 32bit in size too, I can understand how this works. What I don't understand is how the cpu implement load instructions of 1 byte. does it load the whole word where the single byte is located to the register, then perform some kind of "byte shifting", or does the cpu can load a single byte, in this case when does the byte masking happen, is it until the byte got loaded in the register, or it happen when byte is send through the data bus ? P.S. The cpu Im using is MIPS, the instructions Im talking about are: lb or lbu


title: Would form keys reduce the amount of spam we receive?

text: I work for a company that has an online store, and we constantly have to deal with a lot of spam product reviews, and bogus customer accounts. These are all created by automated systems and are more of a nuisance than anything. What I am thinking of (in lieu of captcha, which can be broken) is adding a sort of form key solution to all relevant forms. I know for certain some of the spammers are using XRumer, and I know they seldom request a page before sending us the form data (Is this the definition of CSRF?) so I would think that tying a key to each requested form would at least stem the tide. I also know the spammers are lazy and don't check their work, or they would see that we have never posted a spam review, and they have never gained any revenue from our site. Would this succeed in significantly reducing the volume of spam product reviews and customer account creations we are seeing? EDIT: To clarify what I mean by "Form Keys": I am referring to creating a unique identifier (or "key") that will be used as an invisible, static form field. This key will also be stored either in the database (relative to the user session) or in a cookie variable. When the form's target gets a request, the key must be validated for the form's data to be processed. Those pesky bots won't have the key because they don't load the javascript that generates the form (they just send a blind request to the target) and even if they did load the javascript once, they'd only have one valid key, and I'm not sure they even use cookies.


title: Is it better to pass the whole object or use a setter?

text: Here is my initial code that I would like to modify by using strategy design pattern.               class Bar     {       int a;       int b;       ...     }          Class Foo     {       Bar *bar;            bool action1(){          // this function does a lot of work that only uses "bar.a"       }       bool action2(){          // this function does also a lot of work that only uses "bar.a"       }       void command(){         ...         Bar bar2 = new Bar();          bar = bar2; // this function modifies the attribute bar.         ...       }            ...     }      I am trying to separate the code of both action1 and action2 from the class Foo by creating a strategy object that will implement those actions. I don't know which of those implementations is better. First Solution:               class ActionStrategy {       Bar *bar;            bool action1();       bool action2();     }          Class Foo     {       Bar *bar;       ActionStrategy strategy            bool action1(){          strategy.action1();       }       bool action2(){          strategy.action2();       }       void command(){         ...         Bar bar2 = new Bar();          bar = bar2; // this function modifies the attribute bar.         ...       }            ...     }      Second Solution:               class ActionStrategy {       int a;            bool action1();       bool action2();     }          Class Foo     {       Bar *bar;       ActionStrategy strategy            bool action1(){          strategy.action1();       }       bool action2(){          strategy.action2();       }       void command(){         ...         Bar bar2 = new Bar();          setBar(bar2); // this function modifies the attribute bar.         ...       }            void setBar(Bar* target) {         bar = target;         strategy.a = target->a;       }            ...     }


title: UML class diagram: how to annotate observer-subject relationship?

text: How can I annotate in a UML class diagram that an instance of ClassA is registered as an observer of an instance of ClassB? (Both implement the appropriate interfaces). This doesn't really belong in a class diagram, because they are static, but if this is something that is important to the design - how can you annotate it in this type of diagram? Edit: To clarify: I know how to annotate the Observer pattern in UML. My question is more specific. ClassA being registered as an observer to ClassB is important for the design, however I'm not sure if an association relationship between the two classes is appropriate, since **ClassA and ClassB don't know about each other. They're totally decoupled, and only connected through the Observer pattern**.


title: Which are the fundamental stack manipulation operations?

text: I'm creating a stack oriented virtual machine, and so I started learning Forth for a general understanding about how it would work. Then I shortlisted the essential stack manipulation operations I would need to implement in my virtual machine:               drop ( a -- )     dup  ( a -- a a )     swap ( a b -- b a )     rot  ( a b c -- b c a )      I believe that the following four stack manipulation operations can be used to simulate any other stack manipulation operation. For example:               nip  ( a b -- b )       swap drop     -rot ( a b c -- c a b ) rot rot     tuck ( a b -- b a b )   dup -rot     over ( a b -- a b a )   swap tuck      That being said however I wanted to know whether I have listed all the fundamental stack manipulation operations necessary to manipulate the stack in any possible way. Are there any more fundamental stack manipulation operations I would need to implement, without which my virtual machine wouldn't be Turing complete?