How to automate a tasks system in a CMS software

I'm currently developing v2.0 of my personal cms. However, I'm stuck. I strongly feel that my old solution for "tasks" is not very dynamic and must be revisited. Currently I'm looking the whole concept of how to dynamically add tasks and run them. **What I mean by task system**   Like always in cms software, there are a lot of content, such as images, dynamic files, database entries, etc. I created my own task system aka. The Parser (sounds evil right?) It is made of two files, one parser-classes and other the triggers with the `$parser = new ParserClasses();` (I hope you understand what I mean.) Some of the features the parser does:   * First turn off the site (after the parser is done, turn it back on)   * Checks for active files (files that don't have parent mysql entry, will be deleted)   * Clears out old cache   * Generates new static cache   * Deals with languages and translation related cache   * and other tasks related to cms management and maintenance **Why do I want to make it more automatic**   Basically all plugins and some themes (add-ons in general,) use this task system. But the problem is that it's not very dynamical, because all functions sit in one huge class. This means that the add-on cannot be installed without opening your php editor. **How I was planning to do it**   First I would create my own _task language_ , with preset functions to handle files, cache, etc. (very broad example: `GenerateFreshCache('pages')`). Now, storing it is the issue.. My ideas are:   1. To create tasks-table in mysql database. Then add tasks there, with my _task language_. Later `while()` them from the database and `eval()`. _(This is a good way, because I can add scheduled times and similar in function, for CRON jobs. Or even categorize the tasks.)_   2. Add .php files to some folder, where they get loaded. They will probably use the same _task language_ , but don't need to be `eval()`'ed. _(I'm scared that this would slow down the parser, because so many files are getting included.)_ However, I'm not sure about those ideas and I'm hoping someone has already come across this functionality and can give me pointers. All crazy ideas and concepts are welcome, thanks in advance. **Conclusion**   Thanks to everyone who replied. I picked the answer, that helped me the most and not "ohh, too much work, use framework". My task systems core is done and working. Took 2-3 days and currently ~600 lines of code and two classes (outer and inner core.) I finally ended up with two mysql tables, one with tasks (task db) and another with combos (multiple tasks combined together for easier run.) Also, added some features so it would be safe to run via ajax (cant really talk about that, top secret^^). There are might be too many loops, handling the tasks parsing, however this makes adding new tasks very very simple.. Just add it to tasks DB and add the task to cron-list-automatic-run- list or run it straight up via the admin panel.


What are the benefits of having a remote database for your command line utility

I'm current working on a command line app that will grab resources online for you when you're setting up a new project locally. Right now all the urls for the resources I need are hardcoded into the application and adding new targets require updating the software. What are the benefits of hosting a database remotely that the application would query to get new packages. Sort of like `npm` and any other generic package manager out there. Are there any best practises in setting something like this up?


Can regexp be used to check for palindromes?

Can regexp pattern matching be used to check for palindromes within a given text in Java? My intuition is that in order to check for palindromes, we may need to remember the character that was parsed, which cannot be done using regexp. Is that correct?


using / linking to MS-PL licensed code from (A)GPLv3

I have some trouble understanding MSPL (Microsoft Permissive License) conditions regarding linking to / using a library under MSPL from a project of mine which I want to license on either AGPLv3 or pure GPLv3 (the Affero-part should not play a major role in my question as far as i can see - but please correct me if I am wrong). What I know for sure is that MSPL is incompatible with all versions of the GPL. But is there some kind of linking exception that allows using it from within GPL covered code? Background: I want to use ASP.NET MVC 2 as well as Managed Extensibility Framework (both licensed under MSPL) in my web application project as frameworks. Thus, I will be referencing to them. But I want my web application to be licensed under GPLv3. I DO NOT want to modify or distribute ASP.NET MVC2 or MEF neither in source nor binary form along with my web application. I really guess this is possible, but I can't find any passage in the MSPL which explicitly allows me to do so. If anybody has a link with more information on that, greatly appreciated! What I am also pretty sure about: if ASP.NET MVC2 or MEF would be licensed under GPLv2 (and v2 only) I could definitely NOT use GPLv3 as my projects license. Even though I would not ship source or binary of ASP.NET or MEF then, my project would still be considered a derived work. EDIT: I should mention that I do not want to use original .NET4 from Microsoft but Mono. Mono ships with ASP.NET MVC2 and MEF, both licensed under MSPL.


Should temporary code be put under version control and how?

Here are some examples of temporary/local code. It is needed in order to work with the codebase, but would be harmful to be part of it:   1. Project files. Paths may need to be edited in order to reflect the layout on the current PC.   2. Makefiles. For example optimization may need to be turned off during debugging, but not for the CI server.   3. Dirty ugly hacks. For example `return 7` in the middle of a function, in order to test something, depending on the function, and suspected to break at value of 7. Or 7 is the code of the not yet implemented button, that I am implementing and need to test throughout the life of my branch.  I have tried keeping those in a git commit that I always rebase to the top before pushing to the repo and then push `HEAD~`. This is quite inconvenient and doesn't work with svn. Stashing scares me even more - "did I remember to pop after pushing??". Keeping the code out of version control introduces unpleasant noise everytime a commit is being assembled plus it might accidentally get introduced into a commit some friday evening. What would be a sane solution for such throw-away code?


Why does Aptana need Git installed on Windows?

Why does Aptana Studio need Git installed on Windows?


Augmenting functionality of subclasses without code duplication in C++

I have to add common functionality to some classes that share the same superclass, preferably without bloating the superclass. The simplified inheritance chain looks like this:               Element -> HTMLElement -> HTMLAnchorElement     Element -> SVGElement -> SVGAlement      The default `doSomething()` method on `Element` is no-op by default, but there are some subclasses that need an actual implementation that requires some extra overridden methods and instance members. I cannot put a full implementation of `doSomething()` in `Element` because 1) it is only relevant for some of the subclasses, 2) its implementation has a performance impact and 3) it depends on a method that could be overridden by a class in the inheritance chain between the superclass and a subclass, e.g. `SVGElement` in my example. Especially because of the third point, I wanted to solve the problem using a template class, as follows (it is a kind of decorator for classes):               struct Element {         virtual void doSomething() {}     };          // T should be an instance of Element     template<class T>     struct AugmentedElement : public T {         // doSomething is expensive and uses T         virtual void doSomething() override {}         // Used by doSomething         virtual bool shouldDoSomething() = 0;     };          class SVGElement : public Element { /* ... */ };     class SVGAElement : public AugmentedElement<SVGElement> {         // some non-trivial check         bool shouldDoSomething() { /* ... */ return true; }     };     // Similarly for HTMLAElement and others      I looked around (in the existing (huge) codebase and on the internet), but didn't find any similar code snippets, let alone an evaluation of the effectiveness and pitfalls of this approach. Is my design the right way to go, or is there a better way to add common functionality to some subclasses of a given superclass?


How can I make sense of the word "Functor" from a semantic standpoint?

When facing new programming jargon words, I first try to reason about them from an semantic and etymological standpoint when possible (that is, when they aren't obscure acronyms). For instance, you can get the beginning of a hint of what things like Polymorphism or even Monad are about with the help of a little Greek/Latin. At the very least, once you've learned the concept, the word itself appears to go along with it well. I guess that's part of why we name things names, to make mental representations and associations more fluent. I found Functor to be a tougher nut to crack. Not so much the C++ meaning -- an object that acts ( _-or_ ) as a function ( _funct-_ ), but the various functional meanings (in ML, Haskell) definitely left me puzzled. From the (mathematics) Functor Wikipedia article, it seems the word was borrowed from linguistics. I think I get what a "function word" or "functor" means in that context - a word that "makes function" as opposed to a word that "makes sense". But I can't really relate that to the notion of Functor in category theory, let alone functional programming. I imagined a _Functor_ to be something that creates functions, or behaves like a function, or short for "functional constructor", but none of those seems to fit... How do experienced functional programmers reason about this ? Do they just need any label to put in front of a concept and be fine with it ? Generally speaking, isn't it partly why advanced functional programming is hard to grasp for mere mortals compared to, say, OO -- very abstract in that you can't relate it to anything familiar ? Note that I don't need a definition of Functor, only an explanation that would allow me to relate it to something more tangible, if there is any.


Is there a way to use RAII techniques in COM?

I am caught between two conceptual models of how to construct objects, and am having trouble working out what standard I want to adopt. I prefer to program in .NET and often try to use RAII and read-only properties to make immutable objects with their data passed in through constructor parameters. This has been a major advance compared to the VB6 days when we had to simulate constructors and by convention call "Init" or "Factory.Create" to get objects into a good state. However, I am often making COM-callable wrappers to let me call functions via Automation from other applications. As you probably know, COM wants objects to have a constructor without any parameters. This is a dissonance with the RAII/immutable scheme that I have been using with such success in the .NET world. I remember older object models like ADO where you would usually instantiate an object, set properties like ConnectionString, then call Open. The object could be immutable not via a ReadOnly declaration, but via throwing an "Can't change while open" exception on the property setter. Is this the best pattern to use for COM? Am I missing a better way to skin this cat? Since RAII came out of the C++ community, how do they handle COM being based on a different initialization scheme?


Estimation of Effort and Schedule for a project with almost no familiar elements

To the best of my understanding the schedule for the project is derived using the effort estimates for the individual tasks (in person hours), and the number of relevant resources used for the particular task. As discussed in this question, we are starting a project using a new platform, featuring a brand new API and feature-set. How do we estimate the schedule of the tasks involved in the project, knowing only the top level task breakdown? Also, if some efforts are allocated to the tasks, the estimations would have a wide probability distribution. What is the best way to communicate the same to management?


Factory method vs Factory design pattern

I know about Simple Factory Idiom, Factory Method and Abstract Factory Design patterns. But I have two situations that I'm not sure how to call (PHP code example) :               class User {       public static function LoadUserById($id) {         $objUser = new User();         //load details from DB         return $objUser;       }     }          class UserFactory {        public function Create($id) {         $objUser = new User();         //load details from DB         return $objUser;        }     }      What are these two situations? Simple Factories (programming idiom) or are they called something else? Is a good practice to name the class UserFactory? Isn't this something that might get confused with the A factory design pattern? Should I use different name for it like UserFinder? When I think of the Factory Design Pattern I always think of examples where there are families of components derived from a parent class but it is clearly not the case here.


When would one give up backward compatibility in favor of new and improved interface implementation?

I have been working at the same software company for more than ten years. As a result, I have implemented a large code base using various object-oriented programming languages. I was a beginner programmer when I first started my career and I didn't know much about good interface and class design principles. I would like to think that my design skills have improved over time, but I now face more and more difficulties in improving my earlier code because of backward compatibility concerns. My code is used by a large number of customers as part of the products that my company sells. My question is: when should one stop trying to keep backward compatibility of old interfaces and bite the bullet in favor of implementing a brand new design? I think there comes a point where keeping backward compatibility becomes such a big burden that useful changes to interfaces become impossible. Has anyone experienced similar concerns, who can provide some feedback?


Incremental and partial drawing of the large graphs

I have the following problem: I'm developing a software for data visualization where I get a graph structure and represent it in 3D space. So far, I've been using force-based algorithms to draw graphs and it worked well, until I got requirement that my software should represent very big number of vertices and edges (few millions). It would be very impractical to hold all those in memory, so I'm looking for an algorithm that will enable me to stream small portions of graph as I "walk" through the space. However, the main problem is in showing and dynamically repositioning of vertices, since I don't have already predefined positions, and I must calculate them. Can you point me to some algorithms for incremental drawing and streaming of graph? Thanks in advance!


programming PID loops in C

I'm an electrical engineer that was kind of thrust into the digital world and learning as I go. I'm programming a TI processor to do a PID (proportional- integral-derivative) loop, illustrated by this diagram: ![PID loop image from Wikipedia](http://i.stack.imgur.com/g7Rsk.png) I'll also describe it: Negative feedback op-amp, with non-inverting terminal grounded. Input through negative terminal. The feedback loop is an RE series circuit in parallel with a resistor and all that in parallel with a cap. Anyone have any idea how to convert this circuit to C code? I'm a bit out of my element on this and could use the help.


Anonymous software license

I am aware of some of the problems of the concept of "releasing a work to the public domain" (as mentioned here and here; I haven't listened to this specific discussion yet). IANAL, but the main problems seem to be as follows:   1. Releasing to the public domain doesn't exist in many jurisdictions; rather, a work becomes public domain after copyright _expires_.   2. Some moral rights are inalienable due to (certain ratifications of) article 6bis of the Berne Convention. However, aren't you still allowed to publish a work anonymously? If you anonymously publish a work, in such a way that authorship can't be proven or even distinguished, wouldn't that effectively "unlicense" your code? I would think so: since then any claim of authorship can't be validated, the rights implied by authorship can't be enforced, not even by the original author. If so, I'd really like to know which permissive license (ISC/MIT/BSD-style) would be fit for such publications. (Especially when they've managed to get rid of the lengthy `THIS SOFTWARE IS PROVIDED IN "SCREAMING CAPS"`-style liability waiver.) If no such license exists yet, how would one modify an existing license to be suitable for an anonymous publication?


Why is it so hard to get people to pay for software?

Where I come from software is considered something you can get for free (same goes for movies, etc.) The willingness not to pay for software is quite strong. It is putting me off, that people would rather go through hoops and risk legal issues than to pay a small amount of money for a piece of software. This attitude is somehow embedded in the society. I'm just trying to understand the situation. What do you think is causing this? Why won't some people pay for software even if it's cheap and they use it every day?


How to write less code

A quality what I would like to develop is to write more concise code. With writing more concise, at least in my opinion, the opportunity to add bugs to the code is smaller. It is easier to read the code for other. My question is if it is something that just comes with experience or is it something you can do explicitly for developing that quality?


How to package static content outside of web application?

Our web application has static content packaged as part of WAR. We have been planning to move it out of the project and host it directly on Apache to achieve the following objectives.   * It's getting too big and bloating the EAR size resulting in slower deployment across nodes. Faster deployment times.   * Take the load of Application Server   * Host the static content on a sub domain allowing some browsers (IE) to load resources simultaneously   * Give us an option to use further caching such as Apache mod_cache apart from the cache headers we send out to browsers. We use yuicompressor-maven-plugin to aggregate and minimize JS file. _My question is how do package and manage this static content out side of the web application?_ My current options are.   * New maven war project. Still use the same plugin for aggregation and compression.   * Just a plain directory in SVN and use YUI/Google compressor directly. Or is there a better technology out there to manage static content as a project?


model association or controller?

I'm trying to create a rails app that allows users to submit information about their pets. I've come to a point where my knowledge is limited and I don't know enough about what/how this could be done so I'm hoping this will be relatively easy to answer. At the moment I have a model called Pet, this model currently stores basic information like name, picture etc but it also holds more specific data like type, breed, date of birth etc. What I would like to be able to do is create a page that can match various records without having to be manually categorized if that makes sense so a users pet could be matched to other pets with the same breed, age etc. I've read about nested models as I understand this information could be submitted to 2 models in one form but I am not sure whether this could be done directly in a separate controller which would only be visible to users with pets in these matched "groups" if that makes sense. So in essence is it best practice to use 1 table to store all the information and just use a controller to match pets based on rows having the same values or would it be far simpler to have a form with a nested model and link 2 tables together? The main feature needs to be matching without a user having to create a group or categorize pets so the second model would need to add id's to an array instead of just creating more and more rows.


Languages supporting unicode logic operators

Are there any programming languages that support the use of unicode logic operators? For example, many programming languages use " **!=** " as the _"does not equal"_ operator, but in mathematics the symbol is " **≠** ". Since unicode is now more standardized, why don't programming languages support their use as logical operators? Many of the symbols are on my keyboard, I just hit the `alt` button.


Where (if there is) is the IEEE glossary newer than 1990?

I have been looking for some formal definitons but could not find any IEEE newer than 610, which is from 1990. Could you help me please?


What free bug tracking systems integrate very well with git?

What bug tracking system works with git and has these requirements? Requirements:   * Shows git commit log    * Hides git source code For the system you're suggesting, what are its strengths and weaknesses?


How do you explain to an "agile" team that they still need to plan the software they write?

This week at work I got **_agiled_** yet again. Having gone through the standard agile, TDD, shared ownership, ad hoc development methodology of never planning anything beyond a few user stories on a piece of card, verbally chewing the cud over the technicallities of a 3rd party integration ad nauseam without ever doing any real thinking or due dilligence and architecturally coupling all production code to the first test that comes into anyone's head for the past few months we reach the end of a release cycle and lo and behold the main externally visible feature that we have been developing is too slow to use, buggy, becoming labyrinthinly complex and completely inflexible. During this process "spikes" were done but never documented and not a single architectural design was ever produced (there was no FS, so what the hell eh, if you don't know what you are developing, how can you plan or research it?) - the project passed from pair to pair, each of whom only ever focused on a single user story at a time and well the result was inevitable. To resolve this I went off the radar, went (the dreaded) waterfall, planned, coded and basically didn't swap off the pair and tried as much as I could to work alone - focusing on solid architecture and specifications rather than unit tests which will come later once everything is pinned down. The code is now much better and is actually totally usable, flexible and fast. Certain people seem to have really resented me doing this and have gone out of their way to sabotage my efforts (possibly unconsciously) because it goes against the holy process of agile. So how do you, as a developer, explain to the team that it is not "un-agile" to plan their work, and how do you fit planning into the agile process? (I'm not talking about the IPM; I'm talking about sitting down with a problem and sketching out an end-to-end design that says how a problem should be solved in sufficient detail that anyone who works on the problem knows what architecture and patterns they should be using and where the new code should integrate into existing code)


What are my choices for server side sandboxed scripting?

I'm building a public website where users share data and scripts to run over some data. The scripts are run serverside in some sort of sandbox without other interaction this cycle: my Perl program reads from a database a User made script, adds the data to be processed into the script ( ie: a JSON document) then calls the interpreter, it returns the response( a JSON document or plain text), i save it to the database with my perl script. The script should be able to have some access to built in functions added to the scripting language by myself, but nothing more. So i've stumbled upon node.js as a javascript interpreter, and and hour or so ago with Google's V8(does v8 makes sense for this kind of thing?). CoffeeScript also came to my mind, since it looks nice and it's still Javascript. I think javascript is widespread enough and more "sandboxeable" since it doesn't have OS calls or anything remotely insecure ( i think ). by the way, i'm writing the system on Perl and Php for the front end. To improve the question: I'm choosing Javascript because i think is secure and simple enough to implement with node.js, but what other alternatives are for achieving this kind of task? Lua? Python? I just can't find information on how to run a sandboxed interpreter in a proper way.


As a software architect, am I supposed to focus that much on analysing the logs and fixing other's bugs?

Since my graduation (late 2005) I was working for the same company as a c++ software engineer. A year ago I was promoted as a software architect but I have found myself involved more and more in qualification and fixing bugs, level 2 support. 50% of my time spent in Notepad++ analysing the software logs and trying to figure out what went wrong. 30% fixing other's bugs and the remaining (if any) reviewing developers spaghetti code. I started hating this product and thinking about an exit strategy out of this company. What do you think I can do in this situation? do you other software architect still fixing bugs in the code?


Are ASP.NET MVC automated code good enough to be used in real live applications

I have been trying to get my hands dirty with ASP.NET MVC which looks pretty good (I am not certain, but some users say that even StackOverflow and other StackExchange websites made use of it). The tutorial I am following is from asp.net, named MVC Music Store. It's a pretty fast paced tutorial and a good one too. The question that bother's me while going through the various tutorials available on this site including the MVC Music Store is the automated code used for developing them. Like, this tutorial makes use of Entity Framework 4, which supports a development paradigm called code-first. You add an Entity class inheriting from Entity Framework database context , add two lines of code and it will handle our create, read, update, and delete operations for us.               public class MusicStoreEntities : DbContext     {         public DbSet<Album> Albums { get; set; }         public DbSet<Genre> Genres { get; set; }     }      Similarly, when I used the Scaffolding feature while adding a controller, like following : ![enter image description here](http://i.stack.imgur.com/RVt1x.jpg) It does a hell amount of work on its own :   * It creates the new StoreManagerController with a local Entity Framework variable   * It adds a StoreManager folder to the project’s Views folder   * It adds Create.cshtml, Delete.cshtml, Details.cshtml, Edit.cshtml, and Index.cshtml view, strongly typed to the Album class. As you can see, the developer's life made a hell lot easier with this automation but the question remains is whether or not this automatic code is good enough for production development ? Does anybody use(Does SO) use them. Is there any downside associated with these codes or one should be encouraged to use them ?


How is IETF different from W3C?

I've been following these organizations (institutes, entities, whatever) for near 3 months now, and both of them claim that they're trying to make the Internet a better place. They're creating documents under the name of RFC (for IETF) and Recommendation (for W3C) to guide others. Yet another organization called WHATWG has started another path to develop web, and another community is in action under the title of Internet Society. I don't know, why many organizations? I mean, can't they simply get merged? Are they really different? How?


Languages to complement C++

I primarily work in C++. My question is, for a C++ developer, what languages are beneficial to learn, from a job-profile point of view. For example, I see a lot of work combining C++ and Php these days. Conversely, I don't see a lot of work combining Ruby and C++ (unfortunately). Of course, learning another language is beneficial regardless of whether it compliments a language.


What's a good, concise way to explain the dangers of copy-paste programming to non-programmers?

I'm looking for a good analogy or metaphor that could illustrate the problems of copy-paste programming to non-programmers. I occasionally do code/system reviews for potential clients, and one of the common problems I see are vast amounts of copy-paste code all over their code bases. It's something I routinely call out in the reviews, and each time I have to explain why this is a problem (this is especially difficult with clients who know just enough about programming to understand that reuse is a good thing, but not enough to understand why copy-paste isn't a good form of reuse). Obviously, I can (and do) explain the problem in terms of code maintenance, but it would be nice to have a good, concise analogy for this problem that would hit home with non- programmers. Bonus if the analogy illustrates why search-and-replace is not an effective solution for this problem. Any suggestions? Just to clarify (based on Jaroslav's answer below) - I'm not talking about using code snippets here; what I see (disturbingly often) is copying-and- pasting of vast swaths of code, or a ten-line piece of code to get some user data (complete with inline SQL query) pasted into dozens of PHP or ASP.NET pages. So, duplicate code from elsewhere in the same project. Update: There are several really good answers here; I've explained in the comments why I chose Scott Whitlock's answer, but I would also highly, highly recommend whatsisname's answer if you're dealing with customers who are familiar with manufacturing at all.


How do I handle this intense client situation?

I have worked with a client for two weeks who knows nothing about the complexity of programming a CMS. After two weeks, our relationship has gone from mildly discomforting to the point where I have said "forget this, I quit if you are going to act like this". Problem is we have two week's worth of code developed (on my server luckily). I emailed him and said that I should keep the downpayment and he can get the code. I think he can find someone overseas to finish up my tasks within a few days as the project is about 80% done. He seems to think that is unfair and wants the code AND the downpayment back. What rights or what avenues should I take to resolve this? What would you do? I would not like to give the code back as I do not feel that he should receive something I have spent two weeks developing for free. I feel that if he gets the downpayment back I have every right to keep the code and destroy it. Seeking honest answers from fellow programmers. Any help is greatly appreciated.


AJAX IRCX Client and Server

I am currently developing an IRCX AJAX Chat Based system and have a few questions regarding the Server and Client implementation. Any suggestions are welcome: **Server:** Should this be implemented as a Web Service or a Windows Form application? I have experience in developing Windows forms based servers however I am wondering if this would be better implemented as a Web Service, if so why? **Client:** How are Web Based Clients implemented today and what is the preferred way to implement a web based client? My solution so far are:   * ASP.NET Web Forms with an AJAX Update Panel (This seems the most viable)   * Using jQuery connecting to the web service with a JavaScript timeout **Polling:** How frequently should the server be polled for new messages? 0.5 seconds seems a bit excessive and anything between 2 or 3 seconds seems sluggish? Thanks for your input


Software and/(x)or Hardware Projects for Pre-School Kids

I offered to participate at my kid's pre-school for various activities (yes, I'm crazy like that), and one of them is to help them discover extra- curricular (big word for a pre-school, but by lack of a better one... :)) hobbies, which may or may not relate to a professional activity. At first I thought that it wouldn't be really easy to have pre-schoolers relate to programming or the internal workings of a computer system in general (and I'm more used to teaching middle-school to university-level students), but then I thought there must be a way. So I'm trying to figure out ways to introduce very young kids (3yo) to computer systems in a fun and preferably educational way. Of course, I don't expect them to start smashing the stack for fun and profit right away (or at least not voluntarily, though I could use the occasion for some toddler tests...), but I'm confident there must be ways to get them interested in both:   * using the systems,   * becoming curious about understanding what they do,   * interacting with the systems to modify them. I guess this setting is not really relevant after all, it's pretty much the same as if you were aiming to achieve the same for your own kids at home. ## Ideas Considering we're talking 3yo pre-schoolers here, and that at this age some kids are already quite confident using a mouse (some even a keyboard, if not for typing, at least to press some buttons they've come to associate with actions) while others have not yet had any interaction with computers of any kind, it needs to be:   * rather basic,    * demonstrated and played with in less then 5 or 10 minutes,   * doable in in groups or alone,   * scalable and extendable in complexity to accommodate their varying abilities. The obvious options are:   * basic smallish games to play with,   * interactive systems like LOGO, Kojo, Squeak and clones (possibly even simpler than that), or thngs like Lego Systems. I guess it can be a thing to reflect on both at the software and the hardware levels: it could be done with a desktop or laptop machine, a tablet, a smartphone (or a crap-phone, for that matter, as long as you can modify it), or even get down to building something from scratch (Raspberry Pi and Arduino being popular options at the moment). I can probably be in the form of games, funny visualizations (which are pretty much games) w/ Prototype, virtual worlds to explore. I also thought on the moment (and I hope this won't offend anyone) that some approaches to teaching pets could work (reward systems, haptic feedback and such things could quickly point a kid in the right direction to understanding how things work, in a similar fashion - I'm not suggesting to shock the kids!). ## Hmm, Is There an Actual Question in There?   * What type of systems do you think might be a good fit, both in terms of hardware and software?   * Do you have seen such systems, or have anything in mind to work on?   * Are you aware of some research in this domain, with tangible results? Any input is welcome. It's not that I don't see options: there are tons, but I have a harder time pinpointing a more concrete and definite type of project/activity, so I figure some have valuable ideas or existing ones. * * * **Note:** I am not advocating that every kid should learn to program, be interested in computer systems, or that all of them in a class would even care enough to follow such an introduction with more than a blank stare. I don't buy into the "everybody would benefit from learning to program" thing. Wouldn't hurt, but not necessary in any way. But if I can walk out of there with a few of them having smiled using the thing (or heck, cried because others took them away from them), that'd be good enough. * * * ### Related Questions I've seen and that seem to complement what I'm looking for, but not exactly for the same age groups or with the same goals:   * Teaching Programming to Kids   * Recommendations for teaching kids math concepts & skills for programming?


Asynchronously returning a hierarchal data using .NET TPL... what should my return object "look" like?

I want to use the .NET TPL to asynchronously do a `DIR /S` and search each subdirectory on a hard drive, and want to search for a word in each file... what should my API look like? In this scenario I know that each sub directory will have 0..10000 files or 0...10000 directories. I know the tree is unbalanced and want to return data (in relation to its position in the hierarchy) as soon as it's available. I am interested in getting data as quickly as possible, but also want to update that result if "better" data is found (better means closer to the root of c:) I may also be interested in finding all matches in relation to its position in the hierarchy. (akin to a report) > **Question:** > > How should I return data to my caller? My first guess is that I think I need a **shared object** that will maintain the current "status" of the traversal (started | notstarted | complete ) , and might base it on the `System.Collections.Concurrent`. Another idea that I'm considering is the **consumer/producer pattern** (which ConcurrentCollections can handle) however I'm not sure what the objects "look" like. Optional Logical Constraint: The API doesn't have to address this, but in my "real world" design, if a directory has files, then only one file will ever contain the word I'm looking for. If someone were to literally do a `DIR /S` as described above then they would need to account for more than one matching file per subdirectory. * * * **More information** : I'm using Azure Tables to store a hierarchy of data using these TPL extension methods. A "node" is a table. Not only does each node in the hierarchy have a relation to any number of nodes, but it's possible for each node to have a reciprocal link back to any other node. This may have issues with recursion but I'm addressing that with a shared object in my recursion loop. Note that each "node" also has the ability to store local data unique to that node. It is this information that I'm searching for. In other words, I'm searching for a specific fixed RowKey in a hierarchy of nodes. When I search for the fixed RowKey in the hierarchy I'm interested in getting the results FAST (first node found) but prefer data that is "closer" to the starting point of the hierarchy. Since many nodes may have the particular RowKey I'm interested in, sometimes I may want to get a report of ALL the nodes that contain this RowKey.


Where to start learning to use the Boost libraries?

Boost has recently become available on the project on which I'm working, and I don't have much experience with it. The library has so many parts and features that it's hard to know where to get started in learning it - especially since I'll be trying to learn it while making production code (so it can't slow me down too much). I would greatly appreciate it if someone could list around 3 to 5 features which are very useful in general, every-day programming and state why they're useful. Then I can start to learn those and use them - it'll at least give me a foothold in the library and a friendly place to start learning it/applying it :) Thanks in advance!


Can two developers form an agile team?

I am working on a company's project alone at the moment, but the company is getting soon a junior developer whom I will be mentoring. Considering he will be learning a lot in first few days I am planning on using pair programming for first couple of weeks. I believe that doing pair programming would make daily standup a redundant practice. I definitely will keep the retrospective as well as tdd. I wanted to ask if you would suggest any other agile practices that would benefit our small team of two developers? What have worked for you?


Professionalism of online username / handle

I have in the past, and continue currently, used the handle "thanatos" on a lot of Internet sites, and if that isn't available (which happens ~50% of the time), "deathanatos". "Thanatos" is the name of the Greek god or personification of death (not to be confused with Hades, the Greek god of the underworld). "Dea" is a natural play-on-words to make the handle work in situations where the preferred handle has already been taken, without having to resort to numbers and remaining pronounceable. I adopted the handle many years ago — at the time, I was reading Edith Hamilton's _Mythology_ , and Piers Anthony's _On a Pale Horse_ , both still favorites of mine, and the name was born out of that. When I created the handle, I was fairly young, and valued privacy while online, not giving out my name. As I've become a more competent programmer, I'm starting to want to release some of my private works under FOSS licenses and such, and sometimes under my own name. This has started to tie this handle with my real name. I've become increasingly aware of my "web image" in the last few years, as I've been job hunting. As a programmer, I have a larger- than-average web presence, and I've started to wonder: Is this handle name professional? Does a handle name matter in a professional sense? Should I "rebrand"? (While one obviously wants to avoid hateful or otherwise distasteful names, is a topic such as "death" (to which my name is tied) proper? What could be frowned upon?) * * * To try to make this a bit more programmer specific: Programmers are online — a lot — and some of us (and some who are not us) tend to put emphasis on a "web presence". I would argue that a prudent programmer (or anyone in an occupation that interacts online a lot) would be aware of their web presence. While not strictly limited to just programmers, for better or worse, it is a part of our world.


How would you design a generic layer for OpenGL windowing that does not care how the program underneath actually looks like?

The kind of OpenGL windowing that I refer to is like GLFW, GLUT, SDL, etc. Imagine three C++ programs: (ignore syntax) Game A:               class Game         resize()         keyEvent()      Game B:               resize()     keyEvent()      Game C:               class Key         event()     class Display         resize()      In A, everything is in one class, in B nothing is in a class, and in C the two events have their own classes. Another that is not shown is subclassing a provided 'Game' class that has predefined functions overloaded. I would like any reasonable means that can allow the main library to delegate out to each of these three cases. The solution should not require separate storage of a 'this' parameter. I have thought of a couple of ideas, one is a way of mapping the function in a functor. Another was lambdas. Lambdas are not okay, because they are not widely implemented yet. (Compilers of choice are VC 2010, gcc (latest stable), and Apple's clang). Any new C++ 2011 features that are widely implemented are reasonable thoughts. A gentleman at the local university suggested something similar to the functor, but I cannot remember the function he was talking about.


What do you call a customer's customer in a specification document, use case, or scenario?

My team and I develop software that our customers will use to interact with their customers. Additionally, we also eat our own dogfood and use the software ourselves to interact with our customers. Therefore, it can sometimes be difficult to explain use cases and scenarios, as our employees can be operators, our customers can be operators, and our customers' customers can be visitors. However, our customers can also be visitors interacting with our operator employees, our customers' customers can be visitors interacting with our customer or our employee. Here is a model where:               A is an employee     B is a customer     C is our customers' customer          X  interacts with  Y     Operator --> Visitor           A  -->  B           A  -->  C           B  -->  C      Because sometimes our customers can play different roles, it's sometimes necessary to refer to the specific role, Operator or Visitor, instead of Employee and Customer. It's also a mouthful to say "customer's customer" all the time. I was wondering how other development shops handle these semantic details when writing their use cases and scenarios.   * Are there any one-word, generic terms that can apply to any product that involves a third-level actor?   * Other than using the specific roles, Operator and Visitor, what words could be used to identify a customer of a customer?  The word would need to be short enough as to be adopted within an organization. If longer than a couple syllables, it's shortened form must still differentiate it from the other actors.


Algorithm for creating cluster groups on two criteria

I would like to group a population based on two criteria. I will use an analogy to simplify my question. Let's say I want _n_ number of groups. I want to populate those groups based on person's age and weight, so that all groups contain about the same total age and are evenly distributed by weight (so that there are about same number of heavy and light people in each group). What kind of algorithm could I use to automate this process? Is there a simple Excel formula or some other method? **UPDATE** Here is the motivation for this statistical analysis. I would like to set up partitioning in a database which will have the best performance. I need to store a lot of data which is grouped by county. I do not know ahead of time, what would be the best number of partitions. Partitions should be uniform, so that they contain about the same number of rows. A partition should hold data rows for one or more counties. Each county will be ranked on the frequency and possibly quantity of updates. Partitions should be built so that frequently updated county data is uniformly distributed. It does not seem as if there is a simple way to do this. So what kind of algorithm would work for this? I probably would not use VBA for coding, instead most likely I would use perl to write the program for doing the analysis. Are there any ready-made statistical tools that do these type of analysis? Let me clarify what I mean when I say _n_ number of groups. I will basically pick a number of groups (partitions), plug it into the formula or analysis tool, or custom program. Then I will repeat the process for a different number of groups (partitions) until I find by trial and error, the number of partitions that yields best performance. Maybe there is a name for this type of analysis? Something that I could try to research via a search engine?


How to persuade programmers to follow the basic rules

There are several rules I must keep asking programmers to follow very often. They write code and, if it works, job is just done, for them. Most basic rules might be:   * Commiting changes   * Not writing Model issues in View or Controllers   * Avoid hardcoding Can you tell me about your experience? How do you manage this?


C++ - Best way to have a central data repository

I'm coding in C++. I have a server that will have clients connect to it, and each client gets spun off into its own thread for communication. This server is hosting a game, so there is information that must be shared between all client threads, as well as any other threads I choose to spawn off. This data is like level data, players online, etc, so all threads might possible have to access any of the data at any time. When I was doing this in C#, I just had a static static with all static fields. Is there a superior way to do this? I really don't want to have to deal with passing a reference to a specific object everywhere, but I figure my current implementation goes against OOP etc. Would this be a good case for using a singleton design pattern? Any other ideas are welcomed!


What is Business Process Management software?

I'm in a position to write something along the lines of business process management (BPM) software for a small to mid-sized company, but I have no clue about the design goals, and patterns I can adapt for typical BPM. What defines BPM and are there any typical approaches to it? How do I learn more about it?


Best practices for replacing licensed software with an in-house solution

My company has been licensing a commercial application to fulfill our need for the past few years. The programmers (myself included) have been modifying (with permission) the software to better suit our needs. Now we're talking about replacing the licensed software with an in-house solution we create ourselves. We want to be fair (and legal) in our dealings, but we've all been influenced by the ideas we've had while hacking. I'm sure this isn't the first time this has happened, and I wondered if there are common practices or development patterns which are followed in such situations?


Print fixed width list sorted by column

I have a list of varying length where items is strings of varying length. I want to print them by (a mirrored N)/order by column. Major points being:   * Columns shall have fixed width == widest data in that column.   * It shall be as compact as possible.   * Number of columns is varying/induced by available width of canvas.   * Order of items should **not** be rearranged.   * _(Item lists printed column wise on a horizontal order disgusts me.)_ Optionally:   * Distribution should optionally favour either lower left or upper right. I currently use this in terminal by bash, C etc. but other uses is not hard to imagine. Result of calculations should be:   * columns   * lines   * width of each column As, by this, one can fairly easy print the data in a fixed with column table. **Main question** : Is there is some nifty way to do this. _(I'm inspired byKnuth's Computer musings.)_ My current approach is rather straight forward. Hard to specify the question without some gory details so here we go: * * * ## Data Examples E.g. (by index of string array):               0  4  8 12   or    0  4  8 12     or   0  3  6  9 12 15     1  5  9 13         1  5  9 13          1  4  7 10 13     2  6 10 14         2  6 10             2  5  8 11 14     3  7 11 15         3  7 11                       favouring lower left     favouring upper right     0  4  8 12               0  4  8 11     1  5  9 13               1  5  9 12     2  6 10                  2  6 10 13     3  7 11                  3  7      E.g. (by data - actual output):               0) Item number 00000 4) Item Number 04        8) Item Number 008   12) Item Number 00012     1) Item Number 00001 5) Item Number 5         9) Item Number 00009 13) Item Number 0013      2) Item Number 02    6) Item Number 00000006 10) Item Number 10        3) Item Number 003   7) Item Number 7        11) Item Number 11      * * * ## Current implementation As of now I do this by (approximately) e.g. in bash:   1. Adding the length of each item to array `lens` and track `longest` item.   2. Add width for number + 1 for `)` \+ 1 for `space` to `longest` item.   3. Calculate maximum columns given that width.   4. Re-calculating width of item number (The one before `')'` in the print.) for each column.   5. Calculating actual longest width for items in each column.   6. Re-calculating:               while `lines` > 1 ; do                * Available width = Canvas width - total print width           * Test:                 Find longest item in last column as if columns was increased by 1.           * If longest_in_last_column_test < available width                  increase columns by 1.                  recalculate all column widths.             Else                  break             End If      done        7. Print list. * * * ## Thoughts Cant' help but wonder if there is some way to calculate this by other means. E.g. by using matrix mathematics, - or perhaps some nice algorithm out there. Perhaps hard in bash, but in C by pointers to structs or object related languages. Exempli gratia:               struct item {         int len;         char *val;     }          struct item items = {{5, "Hello"}, {3, "You"}, ...}      Which would give a matrix of typically               # index:length     0:5 1:2 2:1 3:3 4:5      5:2 6:6 7:9 8:1 9:6      Then by having the restraint of sum of each row being <= available width, e.g. 25, rearrange matrix.               longest: 5 5 9 6 => sum 25     --------------------------              5 3 6 1 => sum 15              5 5 9 6 => sum 25              1 2 1   => sum  4


Setting Up A Study Group

Has anyone had experiences before in setting up a study group to empower individuals (employees) work towards a certification while still working. There are plenty of google hits out there on this subject, but I would be particularly interested in the anecdotal experiences of people in this forum. In particular:   1. What was the format?   2. What sort of commitment is required, both individual and employer   3. Optimal group sizes   4. Length and frequency of meetings   5. Absolutely anything else of relevance.


I have URL and ID pairings, and I send the URLs to an API which it returns in no specific order. How should I pair them back up?

This is a programming problem that I haven't came across yet and I want to make sure I'm tackling it in an efficient manner. I have an array of dictionaries, with each dictionary consisting of a "url" key and a "id" key with their corresponding values. I then iterate over this array and throw each URL value into a request object that I then send to an API to be processed. The API sends them all back at once, not necessarily in the order I sent them with other attributes that I use the API for gathering. **My question is:** Now that I have all these URLs and their data, how do I match them back with the IDs that they corresponded to in order to add all these attributes (the ID + the new attributes the API returned) into a database? **My solution:** Create _one_ dictionary with the URL of each item as the _key_ and the ID as the _value_ of the key, and then when I get the URLs back just find the value that responds to that URL key. Is there a better solution to this problem? Maybe architecturally I should be doing this all differently in a way that better facilitates an answer?


Connecting with OAuth, dealing with logout and browser sessions

I work on a open-source web application (Moodle) which connects to a number of external services such as Google Drive, Dropbox etc. to allow users to exchange files with these services. Primarily we are using OAuth based APIs to connect with these services. One of the _user interaction_ problems we are facing is that our users do not expect that after they login to an external service that they stay logged into it. That sounds silly, but the scenario is this:   1. User wants to get a file from their Google Drive account   2. Moodle requests an oauth2 token from Google to browse google drive   3. User is not logged into Google, so needs to login to Google   4. Moodle gets token and user carries on their business in Moodle   5. User logs out of Moodle and does not expect they are still logged into Google My _programmer viewpoint_ is that the browser session is completely the responsibility of user and that our application should not get involved. But we hear from our users about this misconception all the time. Its particularly a problem because our application is often used in shared environments. Is there a good pattern for dealing with this problem which other applications use?


Arguments for Functional Programming

I've recently been learning F# for fun (I'm a VB.NET/C# dev), and I really like some of what it has to offer. Theoretically that is. But I'm having trouble thinking up of scenarios where I would choose to code in F# rather than in C#. Any ideas?


Free app licensing - Could it be creative commons?

I am creating a free nokia application for which I am about to use images from a creative common website. Now my question is if a free application come under creative commons as it is not a paid one? Thanks in advance.


What changes are too big to be made easy by proper design?

This is a rather vague question, but it's something I've never felt has been answered in a satisfactory way when reading about proper design. Generally, when learning about Object Oriented programming, abstraction, factoring out, etc, the holy grail of design - and the reason they always claim you're using the development techniques in question - is that it will make your program "easy to change", "maintainable", "flexible", or any of the synonyms used to express such a productive-sounding concept. By marking ivars private, splitting code up into many small, self-contained methods, keeping interfaces general, you supposedly gain the ability to modify your program with total ease and grace. For relatively small changes, this has worked well for me. Changes to internal data structures used by a class to increase performance has never been a major difficulty, and neither have changes to the user-interface end, independent of the API, such as redesigning a text entry system or overhauling the graphics for a gameplay element. All of these changes seem inherently self-contained. None of them involve any changes to the behavior or design of the component of your program being modified, as far as outside code it concerned. Whether or not you're writing procedurally or in an OO style, with large functions or small, these are easy changes to make even if you have only a moderately good design. However, whenever the changes become big and hairy - that is, changes to the API - none of my precious "patterns" ever come to the rescue. The big change remains big, the affected code remains affected, and many hours of bug- spawning work lie ahead of me. So, my question is this. How big a change does proper design claim to be able to facilitate? Is there some further design technique, either unknown to me or that I have failed to implement, that truly does make sticky-sounding modification simple, or is that promise (which I have heard made by so many different paradigms) merely a nice idea, completely disconnected from the immutable truths of software development? Is there a "change tool" I can add to my toolbelt? Specifically, the problem I am facing that's led me to the forums is this: I've been working on implementing an interpreted programming language (implemented in D, but that's not relevant), and I've decided that my closures' arguments should be keyword-based, rather than positional as they currently are. This requires modifying all existing code that calls anonymous functions, which, luckily, is rather small because I am early on in the development of my language (< 2000 lines), but would be enormous if I had made this decision at a later stage. In such a situation, is there any way that by proper foresight in design I could have made this modification easier, or are certain (most) changes intrinsically far-reaching? I'm curious if this is in any way a failure of my own design skills - if it is, I'd be very eager to improve them with the necessary reading material if there is a way to ameliorate the severity of the problem. To be clear, I am in no way skeptical of OOP or any of the other patterns commonly in use. For me, however, their virtues are in the original writing, rather than the maintaining, of code bases. Inheritance allows you to abstract repetitive patterns out well, polymorphism allows you to separate code by human-understood function (which class) rather than by machine-understood effect (which branch of the `switch` statement), and small, self-contained functions allow you to write in a very pleasant "bottom-up" style. However, I'm skeptical of their claims of flexibility.


How to best distribute client specific configuration settings

I'm writing a WinForms desktop application which will be shipped out to several different clients and am wondering what the best way to implement a user configuration file is. Normally I would use the built in `Settings.settings` or `app.config` to store user settings but in this case what I want to store is unique for every client, I want it to be configured before sending it out and I want to avoid recompiling every time we ship to a new client. What I want my config file to do is to store some information about the client specific graphics used in the program and some (hashed) passwords. We don't suspect that the users would be hacking into anything in the program; we're just trying to avoid regular 'tech' level users from making changes or accessing certain modules that a manager should change. Up until now the password has been hardcoded and over a few years of use everyone has gotten to know what it is. We'd like to be in more control of what passwords go where but not necessarily give the clients control of the password changes. I wrote a separate program that (de)serializes a configuration class to an XML file that would be put in the appropriate directory upon installation so that all people need to do (after I'm out of the picture) is have the `.msi` of the program, create an xml config file using this separate program, include the graphics they want in a sub folder and zip it all up. Then when the user unzips and installs, everything is put in the right place. When my program loads it looks for my config file to finish loading. If it can't find it it gives the user a change to locate it otherwise the program doesn't open. I've been reading about the `ConfigurationManager` class but can't figure out how I could best use it. I haven't found much on people using outside configuration files and am not sure if my situation truly is unique or I'm not thinking inside the box enough. Is this a good design? Should I be doing this differently? If you have had a similar situation how have you solved it?


Can programmer certifications substitute for degree requirements

I am a Computer Technician without a computer science background and planning to become a Java programmer. My question is, if I pass a Java certification, would that be enough to for me to get a job since I don't have Bachelor's degree in computer science? More generally, can programmer certifications substitute for a specific degree requirement in a job posting?


PHP composer question

just getting started with composer and I have a couple of questions. When I use composer to add a dependency, the dependency gets added to my folder's Vendor directory. The newly added package not only comes with the source code for that package, but all packagist required files for the developer to test and add that package to packagist repo (composer.json, .travis.yaml, license, readme.md, etc). For my project, do I need to keep the vendor's required packagist files in my project? Can I clean the package folder structure up a little? I added the package, Slim micro framework, which nests the source files three directories deep upon installation, `../vendor/slim/slim/Slim/(source Files)`. Is it worth moving these files to the top Slim directory like: `../vendor/Slim/(source files)`? Or will this ruin the integrity of the package?


Does mobile based (Android) development, benefit from Object Oriented Programming?

My development on Android is based on scientific programs and while I'm building these most of the code is in one or two long classes. When I come to deploy these programs I try to decouple everything and use classes and objects like I would on a Java desktop application. However reading guide Designing for Performance | Android Developers about Internal Getters/Setters it seems OO is not a good approach. My question is what is best approach when designed Android applications, should I still use lots of classes with getters/setters and lots of object passing around. This seems counter intuitive thinking about the architecture of Android, but it also does not seem right to have lots of code in long classes. I have looked at source codes from other projects and these seem to follow the OO approach. My applications involve heavy image processing and time and performance is important. I am more of a science researcher than a programmer so thanks in advance for any help.


Should I get a patent before asking for help in development? I think I have a great idea but don't have the technical know-how to proceed. Simply don't wish to give away my idea


Proper terminology for a small set of tightly coupled classes?

What is the proper terminology for a small (2-4) set of tightly coupled classes? These classes can't work independently. I was thinking _system_ , but after googling for a bit, I've determined that the word is typically used to describe the software as a whole. Then, I thought of _subsystem_ , but I don't know if the term applies if the number of classes in the subsystem is small. What do you guys think? This is for a presentation for a professor who wants me to provide definitions for everything. **Edit:** Essentially, I am describing various ways to architect game object _systems_ , found in game engines. I'm using the term _system_ as a way to include all the classes involved in the game object apparatus. Calling it a _game object system_ feels right to me, but I'm not sure if it is the right terminology. I don't view game objects as a _layer_ , since it doesn't really work as a layer in a game engine. A _module_ or _package_ , to me, seem more suitable for a bunch of purely functional or stateless classes. If I am not making sense, please let me know!


Where should SQL/DB Queries be encapsulated in a software system?

I frequently write small applications (either web based or otherwise) that require heavy database usage. i've attempted various ways of handling where to put the actual sql queries (sort of ad-hoc ORM systems). These include:   * Models that build themselves up - and only allowing SQL to be inside of a model.   * A sort of factory style method where the models are built by a factory class that is allowed to know about SQL.   * A third entity that maps models based on their fields/keys into the database and generates SQL code on the fly based on this. Is there a common knowledge of which method is best? Or another way I have missed? Clearly a lot of it will be based on the context of the system itself, which for me is usually to produce lightweight tools or utility frameworks. In experimenting, I've never found any of them that feel intuitively "right" and not clunky, but I also do not want to go for a full framework such as Django or Ruby - both because the tools I create are in a variety of languages and because they usually do not warrant that level of surrounding footprint.


Strategies for avoiding SQL in your Controllers... or how many methods should I have in my Models?

So a situation I run into reasonably often is one where my models start to either:   * Grow into monsters with tons and tons of methods OR   * Allow you to pass pieces of SQL to them, so that they are flexible enough to not require a million different methods For example, say we have a "widget" model. We start with some basic methods:   * get($id)   * insert($record)   * update($id, $record)   * delete($id)   * getList() // get a list of Widgets That's all fine and dandy, but then we need some reporting:   * listCreatedBetween($start_date, $end_date)   * listPurchasedBetween($start_date, $end_date)   * listOfPending()  And then the reporting starts to get complex:   * listPendingCreatedBetween($start_date, $end_date)   * listForCustomer($customer_id)   * listPendingCreatedBetweenForCustomer($customer_id, $start_date, $end_date) You can see where this is growing... eventually we have so many specific query requirements that I either need to implement tons and tons of methods, or some sort of "query" object that I can pass to a single ->query(query $query) method... ... or just bite the bullet, and start doing something like this:   * list = MyModel->query(" start_date > X AND end_date < Y AND pending = 1 AND customer_id = Z ") There's a certain appeal to just having one method like that instead of 50 million other more specific methods... but it feels "wrong" sometimes to stuff a pile of what's basically SQL into the controller. Is there a "right" way to handle situations like this? Does it seem acceptable to be stuffing queries like that into a generic ->query() method? Are there better strategies?


What should be the "depth of design"?

We all know that the process of creating a design and the whole architecture of the software is very important before writing the code. But how deep should be dive into the design stuff - should we start from the general architecture and go down til the names of the classes or should be just designate common parts and start coding?


How would you explain that software engineering is more specialized than other engineering fields?

I work with someone who insists that any good software engineer can develop in any software technology, and experience in a particular technology doesn't matter to building good software. His analogy was that you don't have to have knowledge of the product being built to know how to build an assembly line that manufactures said product. In a way it's a compliment to be viewed with an eye such that "if you're good, you're good at everything", but in a way it also trivializes the profession, as in "Codemonkey, go sling code". Without experience in certain software frameworks, you can get in trouble fast, and that's important. I tried explaining this, but he didn't buy it. Any different views or thoughts on this to help explain that my experience in one thing, doesn't translate to all things?


"Integratable" but not "integrated" GPL

There has been much debate over whether or not merely linking to a piece of code makes it a derivative work. I know FSF says "yes", so according to them I can't dynamically link a non-GPL compatible program to a GPL library and distribute the whole. But I could do that for private use, as long as no code is released to the public. That made me wonder: what if I don't redistribute the GPL code at all? If my program can work alone (reinforcing my claim that it's **not** a derivative work), but can do more if the GPL library is also installed to the system, couldn't I just release my application under my own licensing terms - without including any GPL code - and post instructions for anyone interested to separately download the GPL code and do the integration "for their private use"? I know it's against the "spirit" of the GPL, so I'm not suggesting it's a good idea to do that. However, this question is bugging me for some time, specially because of the implications of each answer: If I **can not** do that:   * can I write another library with a similar API? (before answering "of course you can", remember that having the same API would allow both libraries to be swapped at will by my customers - so I don't need to work too hard on my library or even make it "working". How to determine if a similar program is just similar or is a circumvention attempt?)      * (Edit: as @Karl Bielefeldt pointed out, that library would be a derivative work, so this point is moot) If I **can** do that:   * can I also be paid to perform the **service** of installing the GPL library for a customer? (I sell them my program, install it in their machines, download and install the GPL library too)      * (Edit: this practice would be evidence of my **intent** to combine both programs, reinforcing the claim that mine was conceived witht the goal of being combined - and thus is a derivative work)   * can I put the two programs in the same website? In two different CDs? (I know I said the idea was **not** to redistribute the GPL code, I'm just thinking in excuses people could use to claim they're not redistributing even though they are)      * (Edit: that would be an "aggregate", so no problem with it) * * * **Update:** having analyzed @Eli Rosencruft's and @Karl Bielefeldt's answers and links, and read some external resources, I'm getting closer to a conclusion. I made some edits to the question according to the feedback, and below I'll post a few of my findings so far:   * The intrinsic qualities of both programs is a more determining factor when deciding whether or not one derives from another than the technological means to achive their integration. The intent of the authors of achieving some goal is also as relevant as the means they used to reach it (in this scenario). Quoting a blog post that - though not authoritative on the subject - I believe is relevant to the question (emphasis mine): > Since under the GPL the end-user can do whatever they want with the code > (short of redistribution constraints), the end-user can always PULL various > software on the Net and choose to combine and use them in any way they wish > (assuming all parts are legits and legitimately obtained of course). (...) > It does NOT mean that I can offer (PUSH) to the user a proprietary software > **that has been conceived with the goal/intent of being combined** with a > GPL software ( **whether it is deemed to be combined before or after > distribution** ).   * Whether legally significant or not, I now comprehend the motivation behind FSF's insistence on static vs dynamic linking: a non-free program that interfaces with a free one in complicated ways is _de facto_ restricting the users' freedom over the latter, since they can't modify it substantially without breaking the integration (this also enables EEE, in case the free part is also modified to fit the non-free one). So, if one cares for the free software movement, s/he should comply to their terms or, at the very least, take the necessary measures to safeguard the receiver's freedoms.


Why should I not always pass a Django request context in a view?

According to the relevant Django documentation, a request context offers more than a normal context in that it merges request data into the context. It is hence necessary for views that perform form submission in Django. However, I am wondering why one cannot just always pass a request context for every view. After all, a request context offers more than a normal context. Why not create a helper function called, say, `render()` that automatically passes a request context? Is there a performance disadvantage?


What are the standard practices for database access in .net?

I have seen weird database access practices in .net. I have seen stored procedures for every database tasks. I have seen every database property name is preceded by it's table name. I have seen fully separate layer/.dll for very few or no business logic. I have seen along with ORMs, there are separate data access layer playing the same role. And with them, I have always heard- "These are the standards you have to maintain". So, what are the real standards for data access in .net? What are the rules you follow?


Better to use one large plist or many small plists when developing for iOS?

I'm creating a simple "find one of our locations" app for iOS 4, for which I have a list of >70 places, complete with addresses, business hours, etc. Is it better to put all of this data in one large plist or many small ones?


Polling and control devices

I am in the early stages of planning for an input device which will consist of some as-yet-to-be determined number pf physical controls. From previous experience with such devices I have found that it would be extremely advantageous to have the device return data about the state of all controls in response to a query from the system, as opposed to reporting changes as they occur. Assuming an acceptable poll frequency of 1000 queries per second or higher, is the embedded hardware sufficiently advanced to support this? Would a driver for such a device be excessively resource-intensive? What would a good ballpark estimate for the ram/cpu required on both the "server" and "client"?


Querying the NuGet official source asynchronously?

I've been playing around with the NuGet.Core package to see if I can search the NuGet repository for specific packages. I started with the sample code:               //ID of the package to be looked up     string packageID = "EntityFramework";          //Connect to the official package repository     IPackageRepository repo = PackageRepositoryFactory.Default.CreateRepository("https://packages.nuget.org/api/v2");          //Get the list of all NuGet packages with ID 'EntityFramework'     List<IPackage> packages = repo.FindPackagesById(packageID).ToList();          //Filter the list of packages that are not Release (Stable) versions     packages = packages.Where (item => (item.IsReleaseVersion() == false)).ToList();          //Iterate through the list and print the full name of the pre-release packages to console     foreach (IPackage p in packages)     {         Console.WriteLine(p.GetFullName());     }      The problem is that this is all done synchronously, instead of asynchronously. I could not find any async methods in NuGet.Core, so I was thinking about rolling out my own way of querying NuGet's official feed. The problem is that I have no idea how to even query the official feed at all, so I have no idea what classes or methods I have to use. Or, is there a way to use parts of the NuGet.Core interfaces but just perform a query async?


Algorithm Identification [ String & Dictionary ]

I recently heard of an interview question:                Given a string and a dictionary. Break the string into meaningful words      and I remember solving this before with dynamic programming fairly quickly (maybe O(n) time? ) in one of my old algorithm classes but I can not remember the name of the algorithm. Could someone point me in the right direction?


When to release a lite version of an iOS app?

I have created an iPhone application and I have submitted it to Apple and it is currently waiting for review and I have been debating with myself for the past half an hour if I should release a lite version of an app. I was wondering when one should release a lite version of an app once the full app is in the App Store?


Comparison of operator overloading abuse in different languages

A common argument against operator overloading is that it can be and is abused, e.g. `A+B` doing something completely different to addition. Examples are often quoted in C++ snippets, where the functions overloading the operators don't name the operators (e.g. `operator+()`). Compare this to Python, where the operators _are_ named (e.g. `__add__`). Does this help to deter programmers from abusing overloading in the aforementioned manner? Anyone have any experiences of Python operator overloading being abused?


code cowboy on the team

How do you deal with a team member who is senior to you and always jumps on other people's projects and completes them over night or over the weekend? She seems to work 80 hour weeks whether there is an emergency or not and it is somewhat difficult to predict which part of your todo list she is going to strike next. Sometimes days of your work are wasted because on Monday morning you find a checkin completing the project you've spent most of the previous week working on. To people asking of the quality: Usually it is quite good but: there is also a lot of refactoring of code involved, including code 'owned' by other team members, w/o regard for the test coverage, with the obvious results.


Distribute load evenly across many cycles

I am looking for a solution that is fast and still readable. I have to do this in C but the code will be static in the end, which mean I could use any tool to generate it. I have a task which runs cyclically and calls different functions also cyclically > Main functions cycle is 1. > > Function a has also cycle 1. So the main function calls it every time > > Function b has cycle 2. Main function calls it every second cycle. > > Function c has cycle 2. > > Function d has cycle 4. > > Function e has cycle 4. > > Function f has cycle 4. > > Function g has cycle 4. > > ... many more .... > > Function X has cycle 500. If we have many functions that run in the same cycle we try to distribute them.   So for function b we would call it in one cycle and c in the other. Distributing the load evenly.   Similar for d to g. Each one gets called in a different cycle. My current implementation is very bad.   Every developer who had to add their task to main function calculates their on modulo and calls when needed. This leads to a very unreadable code. I was thinking of doing something like:               uint32 mod4 = timer % 4;     bool fourth_1 = mod4 == 0;     bool fourth_2 = mod4 == 1;     bool fourth_3 = mod4 == 2;     bool fourth_4 = mod4 == 3;     bool second_1 = fourth_1 || fourth_3;     bool second_2 = fourth_2 || fourth_4;     /* and so on*/      But this seems cumbersome and too error prone specially as the highest cycle time is too high. How to approach this kind of problem? -Edit- As asked i have compiled some information about the number of functions that i have:   * 32 functions cycle 1   * 9 functions cycle 2   * 14 functions cycle 4   * 3 functions cycle 8   * 3 functions cycle 32   * 3 functions cycle 40   * 2 functions cycle 200   * 2 functions cycle 400


Should I enter an employment agreement before finishing school?

I am a year away from finishing graduate school, and the campus drives in my college are about to start. It's mostly big names that come to campus, but I am really interested in a specific small company. I applied, and then after a series of telephone interviews and online tests, they seem to be interested in me. But, I don't want to start work until after I graduate. However in the meantime, if I make a commitment to join them, they plan on providing training assistance and some small assignments, in exchange for staying away from future recruitment drives. They want a written assurance from me that I'll join their company, but how can _I_ be assured that after graduating, there will still be a job for me? For example, if they decide they don't need my expertise anymore or if they shut down. Is it reasonable to enter into such an agreement with a company prior to the actual hire?


Low Level Exercises

I'm pretty comfortable with high-level languages and application development. However, although I have learned about low level topics such as the ones listed below, I have never done anything with that knowledge outside of school. Some examples:   * bit twiddling   * dealing with little vs big endian   * memory management (stuff relating to the stack/heap/malloc, etc)   * multi-threading with mutexes and semaphores What are some ways that I can practice these in my spare time, while working at a company that writes managed code?


What would be a good first functional programming project? I am looking to finish with a bang on my bachelor project and I want to finish it with a functional programming project. We didn't study it in school but we are encouraged to try to learn new things ourselves, and I thought learning a new paradigm not only a new language would be a great exercise for me, and probably something interesting for the teachers to see too. The problem is I want to start a bit ahead of time on my project to take advantage of the summer holiday and get a better understanding on functional programming, and get familiar with one language. What would you say would be a good practice project that is a bit challenging, but also lets me learn the language, paradigm etc. And then what would you think would be a good project (a more advanced one) for my bachelor project? Suggestions for the best language to start with when going into functional programming would be appreciated too.


Why should I use List<T> over IEnumerable<T>?

In my ASP.net MVC4 web application I use IEnumerables, trying to follow the mantra to program to the interface, not the implementation.               Return IEnumerable(Of Student)      vs               Return New List(Of Student)      People are telling me to use List and not IEnumerable, because lists force the query to be executed and IEumerable does not. Is this really best practice? Is there any alternative? I feel strange using concrete objects where an interface could be used. Is my strange feeling justified?


What is this design pattern called?

I have some code:               /// <summary>     /// Represents Record Locator class     /// </summary>     public class RecordLocator : IRecordLocator     {         /// <summary>         /// The Record Locator string, for example: ZT8C4O         /// </summary>         public string Name { get; private set; }              /// <summary>         /// Initializes a new instance of the <see cref="RecordLocator"/> class.         /// </summary>         /// <param name="recordLocator">The record locator string.</param>         private RecordLocator(string recordLocator)         {             Name = recordLocator;         }              /// <summary>         /// Parses the specified record locator.         /// </summary>         /// <param name="recordLocator">The record locator string.</param>         /// <returns></returns>         public static IRecordLocator Parse(string recordLocator)         {             if (string.IsNullOrEmpty(recordLocator))             throw new ArgumentNullException("recordLocator");                  if (recordLocator.Length != 6)             throw new ArgumentException("recordLocator.Length != 6");                  return new RecordLocator(recordLocator);         }     }          /// <summary>     /// Represents Record Locator interface     /// </summary>     public interface IRecordLocator : IHideObjectMembers     {         /// <summary>         /// The Record Locator string, for example: ZT8C4O         /// </summary>         string Name { get; }     }        1. What is this design-pattern called? When you have a class, which instantiating itself (and probably have a private constructor)? Another example of this is `System.DateTime` class of .NET framework.   2. Is it OK to do it like that?


Separation of Concerns While Creating a Generic Concept of a "Cart Item"

Pretty simple setup: I've got a `Cart` and the cart has `Items`. I've got many varying types of "products" that can't really be boiled down into one thing or even a common ancestor, so I've instead decided to simply create a representation of the product as a `CartItem`, which contains all the information from the product needed to make the sale. That's where the question comes in. I could handle this in three ways that I see. For these examples we'll just say I have two types of "products": `Widget`s and `Gizmo`s. Again, these two things are so vastly different that it doesn't make sense for them to inherit from any base class. 1) Both a `Widget` and a `Gizmo` have the ability to create a `Cart Item` to represent themselves, but this requires both to have knowledge of `CartItem` and any change to `CartItem` will require me to touch both `Widget` and `Gizmo` (not ideal, obviously) 2) A `CartItem` can create itself from either a `Widget` or a `Gizmo`. This would essentially be a factory pattern and would require `CartItem` to have knowledge of both `Widget` and `Gizmo`. This is better than #1 in that I don't have to make changes to every kind of "product" if I change `CartItem`, but I _do_ have to remember that if I change a particular "product" then I must change the factory method of `CartItem` for that. (still not ideal, because Murphy says I will forget). 3) Use something like the controller as the "glue". `WidgetController` and `GizmoController` will have `AddToCart` actions that translate a `Widget` or `Gizmo`, respectively, into a `CartItem`. This really sort of presents the same problems as #1, in that if `CartItem` changes, I need to update all the "product" controllers, and in fact mixes in the problems of #2, in that I must remember to always maintain this mapping if something on either side changes. However, it _feels_ more like a job for the controller: it's oriented for dealing with multiple types, whereas it just feels wrong to mix in types at the model level. 4) Three that I can see; #4 would be something I have yet to consider that one of you kind individuals may happen to suggest. I'm open to any comments here. If I'm missing something completely obvious, feel free to call me a moron and point how just how big a moron I am. I like feeling stupid; that's when I'm learning ;).


How to deal with a valuable person going in all directions?

I am working with someone producing user content to be included in a software application. He is not a coder, but rather an expert in his field, sharing the knowledge. His contribution, taken piece by piece is great, but he goes in all directions and has issues producing work sequentially. He works on 25 pieces of content at the same time, and as soon as he reads something 'interesting', he wants to rewrite some of his stuff to improve the quality of it. He does not converge naturally. He collects tons of informations, produces some valuable stuff, but in a completely unstructured way. We addressed this issue with him some time ago and in order to try to solve it, we created a document with the 100 items he had to fill. Problem is, it does not seem to work very well. How to deal with those people and collect information? I was thinking about a new technique: ask him to send his bits, out of order, little by little, as soon as they are ready, and keep a list of what remains to be done, and show him that list to give him direction. This situation is stressing the hell out of me. If his production was not good, I would not be trying so hard to make this work. If you have experience to share, it is welcome.


What mindset should an ASP.NET developer have in terms of client-side vs server-side code?

I'm jumping back into ASP.NET development after spending the past 7 years playing manager, dba, and winforms developer. I've dabbled with a few things web related, primarily maintenance of existing webforms apps, but I haven't done anything with newer technologies. My, how things have changed! After watching a lot of videos, reading a lot of articles, and messing around with some of the new tools, I think I must be looking at things the wrong way. I tend to think in terms of writing web apps using C# and server-side processing rather than client-side processing. I never used much JavaScript and depended on things like Infragistics NetAdvantage controls and their asynchronous refresh panel. Is it reasonable to assume that "modern" web developers think in terms of JavaScript and client-side coding, only hitting the server via a service for data processing, retrieveal, and storage?


Decimal to 17-bit 2's Complement Signed Number

I am trying to convert decimals, (0.05, -0.28, 25.00, etc), to a 17-bit 2's complement Signed Number. The parameter data I am sending is SysEX Midi Data (to some external Synthesizer). The data parameters are composed of 3 bytes. For example, the example given is as follows:   * The parameter data to set the value to -0.02 is (07 7F 70) (Data2,Data1,Data0) I was wondering if anyone could give me guidance for doing this in Java, here are the specifications I am going off of:   * The parameter data is a 17-bit number 2’s complement signed number.   * data2= Mix channel number and most significant bits (bits 14-16) of parameter’s data (with the format 0xxx xyyy, where xxxx is the mix channel number (0-15) and yyy are the uppermost bits (bits 14-16) of the parameter data.)   * data1= Bits 7-13 of parameter’s data   * data0= Least significant bits (bits 0-6) of parameter’s data  So, here is what I am able to assume so far:   * The 3 bytes is composed of 17 bits, + the 4 bits for sending #'s 0-15 (The Mix Channel)   * The 17th bit is the signing bit?   * The signing bit only needs to be set if It's a negative number, and in which that case needs to be formatted w/ 2's complement   * The highest bit for each parameters data byte is set to 0 With all this in mind, can someone help me understand, post, or help me write a function to format this 17-bit number from a signed decimal value? Binary Bit Adding / Subtracting In Java, Two's Complements, etc...It would be greatly appreciated it anyone has any example functions, or explanations! Cheers


How do I help a team member be more confident?

I have two team members who come from backgrounds that differ from what they're currently being asked to do: how can we encourage them to step up, develop their skills, and learn the new ways?


How to unit test method that returns a collection while avoiding logic in the test

I am test-driving a method that is to generate a collection of data objects. I want to verify that the properties of the objects are being set correctly. Some of the properties will be set to the same thing; others will be set to a value which is dependent on their position in the collection. The natural way to do this seems to be with a loop. However, Roy Osherove strongly recommends against using logic in unit tests ( _Art of Unit Testing_ , 178). He says: > A test that contains logic is usually testing more than one thing at a time, > whicfh isn't recommended, because the test is less readable and more > fragile. But test logic also adds complexity that may contain a hidden bug. > > Tests should, as a general rule, be a series of method calls with no control > flows, not even `try-catch`, and with assert calls. However, I can't see anything wrong with my design (how else do you generate a list of data objects, some of whose values are depended on where in the sequence they are?--can't exactly generate and test them separately). Is there something non-test-friendly with my design? Or am being too rigidly devoted to Osherove's teaching? Or is there some secret unit test magic I don't know about that circumvents this problem? (I'm writing in C#/VS2010/NUnit, but looking for language-agnostic answers if possible.)


Who gives out the awards to "Award-Winning Software"?

Time and time again, I've seen companies advertise their software by saying things like "Award Winning Software" or "Download our Award-Winning Android App", etc. Who is giving out these "awards"? I've been in the software industry for a few years now and I've never heard of anyone getting an award for their software. Is there actually a body that gives awards to companies or is it just the case that some obscure magazine gave the software a good rating and they then proceed to label their product as "Award-Winning"?


Pros and cons of sending data from android to php in string and/or json

I have seen some tutorials and some stackoverflow discussions on how to send data from android to php page. most of the cases i have seen people sending data in string format but returning in json format. My question is that is it better to send data from android to php in json format. or in what cases i should use json over string. Regards


is this javascript property defaulting pattern a code smell?

In some javascript code I'm working on refactoring I've handled cases where I wanted to default an object property to true without having to go through the code-base and add the property to every instance of the object by doing something like this:               if(typeof(thisBool) === 'undefined' || thisBool) {         //do cool stuff here;     }      so for existing instances I only had to fix up the model in cases where I wanted to set `thisBool` to some value calculated somewhere else, or to set it to false; if it was unset then this code treated it as true. The objects are built dynamically when used - they're not defined classes, but are "instantiated" something like this:               var thing1 = {         Name: 'thing No 1',         HasCat: false,         [thisBool: true]     };      and `thing1` is passed into the function Is this a terrible idea? I'm updating that code (and all of the instances) so now is the time to fix this, if it's a code smell. For my own part I would rather be more explicit, but I also see the value in not having to supply a `thisBool: true` in hundreds of places, where by default `thisBool` should be true. Is there a better way to achieve this?


GPU Data Flow Architecture

I am currently working on CUDA, DirectX. I want to know the data flow architecture of GPUs. The one presented for CUDA and DirectX are parallel programming model and graphics pipelines respectively. But, I want to know the data flow architecture (like, the data flow architecture of 8086 processors).


This question branches out of this question, What are the differences between algorithms using data structures and algorithms using databases?. # The General Question Should a database table(s) structure match its intended data structure(s) in the logic? # Some Context The simplest example (and it may be oversimplified) of what I am thinking about is a database table whose columns match the properties of a linked list data structure. So the properties I think of for a linked list are the following: ## Linked List   * Node identity.   * Item/Content in node.   * Next node. In regards to the general question, the database table columns that I think of getting mapped are the following: ## Linked List > Database Table   * Node Identity **>** Primary Key Column(s).   * Item/Content in node **>** Column(s) containing data that is to be persisted.   * Next node **>** Column containing a reference to the record that is to follow it in the same table. An application I can think of that represents the above is to say, keep track of a trail of points you have been to on a map. So I can imagine saving the coordinates of point A then putting in the mapped Next node column, the coordinates of point B. Letting my imagination run a little further, then retrieve this data and load it into a linked list, use its properties to do the traversal, and draw these points on a map again at a later point in time. # Questions   1. I can see how creating a mapping like this simplifies thinking about the data, but I also feel it restricts you to thinking about the data in only this way. How conforming do you make your database tables to data structure(s), if at all?   2. Should databases be viewed as realms of raw data that are to be shaped and molded (translated) to data structures selected dependent on the program's purpose? I restate what I said in the last post. I know answers without a specific context are difficult. Food-for-thought, advice, or discussion points are mainly what I'm looking for and would be most appreciated! I did try to give a more specific context in this post.