title: Why is it impossible to produce truly random numbers?

text: I was trying to solve a hobby problem that required generating a million random numbers. But I quickly realized, it is becoming difficult to make them unique. I picked up Algorithm Design Manual to read about random number generation. It has the following paragraph that I am fully not able to understand. > Unfortunately, generating random numbers looks a lot easier than it really > is. Indeed, it is fundamentally impossible to produce truly random numbers > on any deterministic device. Von Neumann [Neu63] said it best: “Anyone who > considers arithmetical methods of producing random digits is, of course, in > a state of sin.” The best we can hope for are pseudo-random numbers, a > stream of numbers that appear as if they were generated randomly. Why is it impossible to produce truly random numbers in any deterministic device? What does this sentence mean?


title: What language should I use for making a cross platform library?

text: I want to build a SyncML parsing library ( **no UI** ) which should be able to build up messages based on information provided by the host application, fed in by the library's methods. Also, the library should to be able to do callbacks to methods in the host application. I want to be able to compile this and have it available on as many platforms as possible: Windows, Windows Phone 7 OS, OSX, iOS, Linux, Android, BlackBerry. Basically as many platforms as possible. The priority is to have this available on mobile devices. **Questions:**   1. What setup should I use? (programming languages, compilers, IDE etc.)   2. How would I compile this library for these different platforms and how would I connect to it?   3. Any other info? e.g. articles that cover the subject of cross-platform development? I haven't done this sort of a cross-platform project before, so any available information to put me in the right direction would be welcomed. Myself, I have a background in C#/.NET and Objective-C.


title: Reading source code to learn

text: As you develop as a programmer, software developer, or coder, IMHO, you begin to see different (best or worst) practices, different algorithms, and "more than one way to do it". Seeing this code can be a great learning experience for you, even though you did not write the code. But is doing this only going to confuse you? For example, let's say you have a library in any language that was created by a colleague, and you have been using it for a while. You decide to look at the actual source code, regardless of how extensive it is, and get a better look at how this library is written. For the sake of example, the function you use most often from this library is the `max` function, which finds the largest of two numbers. But this function is a lot more complicated than it needs to be. The way it is written is confusing the heck out of you, and you don't know how this works. Will this make you a better programmer, because you realize how complicated it is for such a simple function, or will it make you a worse coder because you feel less confidant? So my question, in general, is **does reading source code make you a better programmer and if so how? If not why do people still do it?**.


title: Why did object-oriented paradigms take so long to go mainstream?

text: I read this question and it got me thinking about another fairly recent thing. Object oriented languages. I'm not sure when the first one was created, but why did it take so long before they became mainstream?   * C became vastly popular, but didn't become the object-oriented C++ for years(decades?) later   * No mainstream language before the 90s was object oriented   * Object oriented really seemed to take off with Java and C++ around the same time Now, my question, why did this take so long? Why wasn't C originally conceived as an object-oriented language? Taking a very small subset of C++ wouldn't have affected the core language a whole lot, so why was this idea not popular until the 90s?


title: Where can I locate business data to use in my application?

text: This question talks about any and all free public raw data which appeared to have valuable pieces but nothing that really provides what I am looking for. Instead of using a socially defined listing of businesses (foursquare), I would like a business listing data set of registered businesses and associated addresses that could then be searchable based on location (coordinates). The critical need is that the data set should be filterable based on varying criteria (give me all restaurants, coffee shops, etc...). If the data is free that is great but anywhere that sells this type of data would also suffice. Infochimps looked like a possibility but perhaps something a bit more extensive exists. Where can I find a free or for fee data set of registered business that is filterable based on type of business and location?


title: Recommendation for a database to query records with attributes that are arrays or hashes?

text: I'm building site with a very simple data structure: documents that are nodes that reference other nodes that each have arrays of parents, children and siblings, so the structure is:               Node:     uuid     name [string]     description [string]     children, parents, siblings [arrays of node uuids]      What is most important is making the following query fast and easy: `all nodes with uuid x in their children/parents/siblings array`. I'm considering using Riak or possibly Postgres with hstore, but would like other suggestions as to a good database designed to easily and quickly store and retrieve data with this structure. Persistence is important, scalability is a secondary concern right now.


title: Are Verification and Validation both Quality Assurance and Quality Control?

text: Having read a book I found a note that verification and validation can be both quality assurance and quality control. I cannot see how it can be quality assurance because both just provide evidence whether or not the product meets its use, requirements etc., which is quality control.   IMHO V&V cannot assure quality, they only asnwers the question "does it work?", "is it correct?.


title: What is the difference between "data hiding" and "encapsulation"?

text: I'm reading "Java concurrency in practice" and there is said: "Fortunately, the same object-oriented techniques that help you write well-organized, maintainable classes - such as encapsulation and data hiding -can also help you create thread-safe classes." The problem #1 - I never heard about data hiding and don't know what it is. The problem #2 - I always thought that encapsulation is using private vs public, and is actually the data hiding. Can you please explain what data hiding is and how it differs from encapsulation?


title: using business object as a key in a dictionary

text: I keep seeing it all over the place. I think it is an anti-pattern, it requires partially instantiated business object to be able to find the full one in a dictionary. Am I correct? Why would people love it so much? I dislike:               class Thingy {       Id id; // first component of the key       SubId subId; // second component of the key       Data data; // useful payload       public Thingy(Id id, SubId subId, Data data) {...}       // equality & compare & hash override     }          Set<Thingy> things;      I like:               class Thingy {       public static class Key {         Id id; // first component of the key         SubId subId; // second component of the key         // equality & compare & hash override       }            Key key;       Data data; // useful payload       public Thingy(Key key, Data data) {...}     }          Map<Thingy.Key, Thingy> things;


title: How are new file formats constructed?

text: I've used a software suite that is installed in offices and on remote vessels. The installations communicate back and forth, and they do that by using a simple proprietary file format that looks something like this:               /SHIP:16     MILES=45213          /ORDER:22943     STATUS=OPEN     TOTAL=447.84     URGENCY=HIGH          /ORDERLINES:22943     ITEM=3544     QUANTITY=1     PRICE=299.99     ITEM=11269     QUANTITY=5     PRICE=29.57      Recently, I've been writing a piece of software for a customer that saves information in the same kind of flat file format. When the file is opened, the lines are iterated over, and "stuff happens" to the lines (i.e. they're inserted into a database, or whatever). But it got to me on to thinking, how would this kind of file scale? (I like things being able to scale) I could of course `gzip` it; but how does a file format evolve from being something basic like to this, to being monolithic? What typical practises are employed when making a file format for a new piece of software? How are they typically built? Related: Is there a proper way to create a file format? and Should I encrypt files saved by my program


title: GIT and different versions of a project: what are the best practices?

text: I'm very new in using GIT as a versioning system and despite a lot of searches, I can't seem to really understand how to handle my scenario. I have this web project that needs to be developed in two versions:   * the first is a general version used for demos   * the second is a customized version for my client. As for now, the second versions differs in minor things, mainly branding (i.e. icons, some titles) and database connections. The idea is to enhance its code with suggestions and real use cases provided by the client and, as we progress with bugfixes and new features, port the changes to the "general/unbranded version" - but keeping those minor differences. In the future the "general" version could be forked and enhanced more with some independent features. Are branches an useful way to deal with this scenario? I think they're not, as (at least so I understood) they're more meant to make changes to be merged back in short- or mid-term.


title: Count Sort Algorithm efficiency

text: As I am reading a Book about "Algorithm Analysis", I came across count_sort Algorithm. A question has been raised in my head. I read in many other papers, that "Quick Sort/ Merge Sort" are the best and the most efficient sorting algorithms. However, the complexity of this Algorithms is O(n+k), same for Quick sort, and better than Merge sort O(n ln n). My question:   * What is the problem with this sorting Algorithm.    * What are the best sorting Algorithms that I have to check ?              def count_sort(seq):         b, c = [], defaultdict(list)         for x in seq:             c[x].append(x)              for k in range(min(c), max(c)+1):             b.extend(c[k])         return b


title: Is this any form of service pattern, some other pattern, SOA or just an anti-pattern?

text: I'm going to set out a scenario/pattern I've encountered and then I have a few questions pertaining to it. During an MVC request in a web framework (PHP, Laravel in my case), if I have an abstract base class `Service` where subclasses:   * Do not return values   * Deposit the result of their work into a common `Response` singleton, even across multiple service classes.   * Never throw exceptions but instead report error situations as another bag of values in the response singleton.   * Offer a fluent API to chain calls to a single `Service` subclass.   * When a caller (controller) does finally want data, they terminate the fluent API with a `getResponse()` method which returns the `Response` singleton, with no idea of what might be in it or what transpired and when over the course of the prior chained calls. Would I have an anti-pattern on my hands here? My concerns being:   * `Service` subclasses now hide the data they return in a generic bag of data - `Response`   * Because of the desire to implement a fluent API, services are now more or less a relocation of controller code, rather than portable business logic. In order to do fluent calls, the methods all have to exist on the same instance which means you are now forced to mix unrelated functionality into the same instance.   * Callers of a service class (typically controllers and other services) are now coupled to the structure of the `Response` class, rather than being provided with the data they request (say an ORM collection, or a simple language collection type), they're now having to perform extra work rather than simply deal with pure, returned data.   * Separation of concerns when creating inter-dependent services, especially during error situations whereby the scope of the failure is lost.   * Loss of the ability to detect accidental circular dependencies between services via dependency injection   * Is this "SOA"? Are there any more risks in this design or if it's a known one, are there advantages to this pattern over simply writing plain classes that return the domain data directly for a service layer?


title: taxonomy of software project resourcing models

text: I would like to understand the impact of different resourcing models for software projects. First, I would like to identify the different resourcing approaches that are used to resource software projects. Here are some models that I can think of based in my own experiences:   1. Product centred resourcing   2. Planned resource pooling   3. Chaotic resource pooling _Model 1_ \- has resources that are product focused. In this model the project team is dedicated to a product (e.g. a SOA service). In this model, the product is the central concept and the team stays and grows with the product. This model promotes continuous learning for the team in the product domain, and facilitates rapid development of new features because the project team is intimately knowledgeable about the product. This model seems to be very effective for evolving existing products in product centered companies. _Model 2_ \- pulls resources from a resource pool when starting up new projects. This model appears to be most suitable when developing new products from scratch. In this model team members need to acquire the domain knowledge required before starting the project. The model does not seem to be effective for product based companies because product domain knowledge is lost when resources disband after the project completes. This model is typical in consulting organisations. _Model 3_ \- is really an extension of Model 2. In Model 3, resources are replaced with other resources mid-project. Thus model treats resources as commodities where new project team members are expected to acquire the same knowledge as the resource that they replaced. This model leaks the most domain knowledge, and is is characterised by low morale and low productivity. This model is usually found in organisations that are constantly fire-fighting. **Question** : Is there a taxonomy of software resourcing models that I can use rather than creating my own?


title: using internal or external iterators over graph edges

text: I've written some code to manipulate sparse graphs for school work I'm doing, and I have an operation which requires me to loop over all the edges of a graph. The interface I need to implement is some function               int gimme_some_edges(graph* g, int k, int* I, int* J)      which puts the next `k` edges of the graph `g` into the arrays `I` and `J`, and returns the number of edges actually found in case there are fewer than `k` left. The iterator pattern seems like the tool for the job. The biggest consideration I want to take account of is that my program is parallel; each thread is responsible for processing a disjoint subset of the graph's edges. In that case, the current edge of the iterator has to be private to each thread, and the iterator has to be stopped from continuing past some ending point into the edges for which another thread is responsible. **Do I want graph edge iterators to be internal or external to graph objects?** If the graph edge iterator is external and called by the client, there's more to do in the maintenance of this object but the parallelism is straight- forward. Moreover, they'll get deleted at the end of the edge processing function. On the other hand, if the iterator is a part of the graph, my code looks simpler on the surface. But, I have to make sure I store an array of them, one for each thread. They're also persistent, so their state can get screwy before the next edge processing unless I'm circumspect (don't bet on it).


title: How do you name your GUI controls?

text: It's a generally considered a bad practice to use the Hungarian notation, but is common to find GUI controls named `userNameTextBox` and `userNameLabel`. Do you put the control type in it's name? Isn't this a kind of Hungarian notation?


title: Do CS departments have formal procedures to choose languages taught?

text: I'm not talking about countryside colleges/unis.   * Are there any thought-out procedures in top-ranking institutions based on formal criteria, actual statistics or demand from the industry?   * If so, what are the criteria used?   * Are the decisions to drop certain languages and introduce others made systematically or in a haphazard manner?


title: Should I use multiple column primary keys or add a new column?

text: My current database design makes use of a multiple column primary key to use existing data (that would be unique anyway) instead of creating an additional column assigning each entry an arbitrary key. I know that this is allowed, but was wondering if this is a practice that I might want to use cautiously and possibly avoid (much like goto in C). So what are some of the disadvantages I might see in this approach or reasons I might want a single column key?


title: Session size management

text: From what I know, the session information is usually saved on the server.   In Java the data is handled as a Map which I guess contains the a String identifier and an object reference which points to a memory zone from the server. Considering that, is it safe to assume that storing a `Properties` file on the session will not have a critical effect on performance? I have to handle some Language Properties files (`ResourceBundle`). For some reason I have to translate at every request at least 30 strings in one of 3 languages. This results in many conditional clauses which can be avoided by storing the Properties file on the session. **Note:** The `Properties` file is just an example. The aim of the question is to determine why and how placing an Properties object in the session differs from pacing an String object. I am aware of the size aspect but does this issue stands while all Objects are stored on the server?


title: Managing constants in application

text: Our application is having 2 parts a web app running ROR and a web service running Sinatra. The application communicates with the mobile device for which we use different constants depending on the message we need to the send to the device. We are currently using integer constants saved up in a module. Eg:               SEND_HI="122"      As the application has grown and we have around 50+ constants we are realizing that this is a bad way to handle constants as different developer seems to give different constants and clashes occur. Also there is a mismatch between the constant values in ROR and sinatra (due to developers mistake obviously). What is a pain free way to handle constants or message identifiers.


title: Why are interfaces not casteable/ducktypeable?

text: One thing that always irked me (in C#) was that there's a hard dependency between an interface/abstract class and the implementing class and assembly. Meaning that that if two different assemblies implements the same interface either one of them have to reference the other (where the interface lies) or they both have to reference a third assembly with the interface. It makes it harder to test different parts of an application separately and makes code much less flexible since you have to implement that specific interface. It also makes distributing libraries to third parties less tidy since if you want only to distribute part of your functionality you will either have to rework the class for thirdparties to include the interface, or have some silly assembly containing all but a interface in some cases. Shouldn't there be a way to have ducktypeable interfaces? So for instance if you have two objects with a method that takes an interface as parameter, and each assembly has separate but identical interfaces, then you would be able to interchange the two. I'm sure there are instances where we want the good 'ol strict interface dependencies we have right now but also having the possibility of "soft interfaces" might be a good idea? Or is the concept too convoluted and applicatable in too few situations (like multiple inheritance for instance). Are there languages which aren't completely ducktyped that have solved this issue and is there perhaps some designpattern to use to avoid the dependency? **Example:** Assembly A:               public interface ISomeInterface      {         ReadBooks();         WriteLetters();     }          Public ClassA : SomeInterface     {     }      Assembly B:               public interface ISomeOtherInterface      {         ReadBooks();         WriteLetters();     }          public class ClassB     {         public DoStuff (ISomeOtherInterface someOtherInterface)         {           ....         }     }      Here I'd like to have a Assembly C that references A and B and do:                 ClassA classA = new ClassA();       ClassB classB = new ClassB()       classB.DoStuff(classA as ISomeOtherInterface);      There's no direct dependency between A and B, but they can still be used together. I guess in this instance I could make an adapter class, but it feels clunky and in some instances not appropriate. Specific casting is one way to go, another would be to declare an interface as dynamic (or whatever) and then it would only check that the interfaces are identical (but not that they are the same interface). A third way would to be able to specify "dynamic" on parameters so the object could allow or disallow that kind of interfaces. Perhaps it even should be the other way around that unless you declare an interface as "explicit" you can always do that kind of typing.


title: How effective are CSS, Javascript and HTML compression tools and is it worth to compress files?

text: I looked into minified versions of jQuery and also various online CSS & HTML compression tools. I tried compressing few CSS files and gained only 20-30% compression. Are these compression tools worth using and do they add considerable performance improvements? I am looking for tools to compress ASP.NET (.aspx) files.


title: Is it a good idea for exams to be done on a computer?

text: In some colleges students are let to use an IDE and Internet and in mine you have to write down your solution in paper. As far as I know, it's pretty much impossible to make a correct non-trivial program on the first try. I'd be fine with no using computers if my teachers assessed my _approach_ instead my _code_ -literally-... that's not the case unfortunately. Which ones are more usual, 'written' or 'coded' exams? And which way is the most adequate? **Edit** \- question title changed (it used to be _Should students have the right to do exams using a computer?_ )


title: Problems (such as maintenance) in development with unpopular language

text: I'm developing some application with clojure(lisp) alone in my team. It starts as small application. No problem. But as it's having features and extending the area, it's becoming important program. I worried about maintenance or something. No one in my team knows clojure or lisp nor is interested in languages such as them. So, isn't it wrong to do programming in unpopular languages? (for my own fun?) Should I use more popular languages? (at least such as python) I'm sure if I leave the team, --not saying I'm leaving. :)-- no one would maintain it. This program will be destroyed and some will develop with other language. I'm very enjoying developing with clojure though, I came across with that this might be not for my team. What do you think about this? I think many programmers loving unpopular languages have been concerning similar issue.


title: .NET Reflector is no longer free - how does everyone feel about this?

text: The upcoming version of .NET Reflector, coming in March, will no longer have a free version. .NET Reflector started out as a free utility written by programmer Lutz Roeder and quickly became fairly indispensable to a lot of programmers. After about four years he sold it to RedGate software, who has maintained a free version ever since, as well as a "Pro" version about a year ago which adds capabilities and starts at $99/seat. The new version will no longer have a free version, will be $35 for the non- Pro versions, and the existing free versions will still work until the end of May. On the one hand it's annoying that the existing free versions will die and obviously I'd prefer there be a free version going forward. On the other hand I respect where RedGate is coming from and the cost for a license isn't prohibitively expensive. Plus it may encourage more frequent updates. **EDIT:** I originally said it was $35 for everyone but according to this FAQ there's still going to be a Pro version.


title: Online programming degree that employers will not disregard?

text: I already have a bachelors in an entirely different field, but I am looking to start a career in programming. However, traveling into school would be very difficult for me at this point. Are there any online programming degrees that are as valuable (in terms of getting a job) as those from a brick-and-mortar college?


title: Should I sacrifice code succintness to ensure the narrowest variable scope?

text: In many languages (e.g. both Perl and Java - which are the two languages I work most with) it is possible to narrow the scope of local variables by declaring them within a block. Although it adds extra code length (the opening and closing block braces), and possibly reduces readability, should I create blocks purely to narrow the scope of variables to the statements that use the variables and to uphold the principle of narrowest scope or does this sacrifice succinctness and readability just to unnecessarily uphold an agreed 'best practice' principle? I usually declare local variables to functions/methods at the start of the function to aid readability, but I could not do this, and just create blocks throughout the function and declare the variables throughout the code - within those blocks - to narrow their scope.


title: Build status reporting on javascript project

text: I have a javascript project which uses Grunt and several plug-ins such as:   * jshint   * qunit   * requirejs optimizer Not all of the developers run the grunt tasks locally (e.g. jshint, qunit), so they might not know if code they committed has issues. It's easy enough to set up a grunt watch task, but emailing the team upon error/warning has been less obvious than I expected. I was expecting to find something like grunt-contrib-emailstatus for emailing a nicely-formatted status, but so far have not come across this. Did I miss it? If not, what's the recommended practice here? In the past I've seen things like Cruise Control, Jenkins, or Hudson handle the build status reporting, but it seems like too big a hammer for this nail. And on the other hand, trying to use crontab to email status seems too small.


title: Controlling cookies with many tabs

text: I have a peculiar problem. My application has different levels of authentication. One specific level of user (super user) needs to be able to use the application as another user (subordinate user) that has lower privileges. We decided that when the super user selects to be a subordinate user then another tab in the browser will be opened and will load the subordinate user's privileges and their respective cookie. The problem we have is: **how can we get the reference for the new cookie in this new tab?** Also the super user will be able to open multiple tabs and each tab need to reference its own cookie.


title: How do we call a concept when my acceptor loop is ran by some real application while all services are plugins for that application?

text: So say we have an app (server) that somehow attaches to itself plugins (services) in form of .dll or .so libraries. Is there any nice short name for such server behaviour model?


title: How to view my commits on SourceForge

text: I want to link to a source forge project for a job application but I can't seem to find where a user's commits are listed. If I go to > https://sourceforge.net/u/USER_NAME/profile/ All I see is the project that I worked on (which just leads to the project page, not my individual activity) and then there's Personal data and skills list. How do I get to a user's actual code?


title: How can I shorten the amount of time it takes to change variables dependent on environment (QA/Dev/Prod)

text: I'm working on a Java Project, and I wrote a small plug-in to the existing project. I wrote it on my Mac(dev), QA is on Windows and Prod is on Unix. In the code I make specific API calls to a different program. On my mac though I'm just reading in a file. In Dev it is using windows file path to execute an external programs CLI. Prod will be the same. I'm aware of property files, should I use a property file for this to quickly switch environments. At the moment it is just a lot of commenting/uncommenting to get everything up and running.


title: What are the main bottlenecks to know about Java portability?

text: Java is known to be portable; _"compile once, run anywhere"_. I know this is often true because I have many times deployed **jar** or **war** without any cross-platform troubles. Still, I am left wondering if this is always true. For example, Swing applications look different between different OS platforms. Also, JDK-1.7 is still a preview release for Mac OS X. _**So, what are the common problems that prove that Java applications are not entirely cross platform?_**


title: What are the Most Important things to know about iPhone Development?

text: For example I just learned today about NARC. Never release something unless you made it "New, Alloced, Initialized or Copied". That just fixed a couple different bugs in my app that I couldn't find. What other things are very important for iPhone development? _**EDIT_**   I have no idea how to make this Community Wiki.


title: When using several languages for different projects, how do you keep the different syntaxes straight?

text: Context: I'm taking several classes this semester in which I'll be coding. Here is a list of possible languages I'll be using:   * Java   * C (system and embedded level)   * C++ (contest programming)   * VHDL (for FPGA work)   * Python   * Scheme Is it possible to keep all these languages floating around in one's head? How can one code without having to look up reference material every time they start working?


title: GSP Algorithm explanation

text: I've been trying to implement the GSC algorithm in C++, however I need help with clarifying the definition: http://en.wikipedia.org/wiki/GSP_Algorithm >   1. GSP Algorithm makes multiple database passes. In the first pass, all > single items (1-sequences) are counted > Basically this means that you have something like this? :               std::vector<int> numberSequence = GenerateSequence();          std::vector<in> numberSequenceFrequence;     numberSequenceFrequence.resize(numberSequence .size());          for(int i = 0; i < numberSequence.size(); i++)     {         numberSequenceFrequence[i] = CountNumberOccurenceInVector(numberSequence[i]);     }      And then for part 2: >   1. A set of candidate 2-sequences are formed, and another pass is made to > identify their frequency. > But how do you construct the set of candidate 2-sequences? I'm not exactly sure what they mean. Does this mean that **X** number of elements from `numberSequence` with the lowest counts in `numberSequenceFrequence` are removed from `numberSequence` and the process is repeated? According to this: > Candidate Generation. Given the set of frequent (k-1)-frequent sequences > F(k-1), the candidates for the next pass are generated by joining F(k-1) > with itself. A pruning phase eliminates any sequence, at least one of whose > subsequences is not frequent. Does it mean popping the last element of the vector each step? > A pruning phase eliminates any sequence, at least one of whose subsequences > is not frequent. This part implies I need to be working with vectors of vectors, so I think I've completely missed the point. And finally: > Support Counting. Normally, a hash tree–based search is employed for > efficient support counting. Finally non-maximal frequent sequences are > removed. The definition of **nonmaximal** means something that is not comparable, but an `int` is always comparable to an `int`: http://en.wiktionary.org/wiki/nonmaximal


title: How to programmatically turn off LED on USB?

text: I would like to find out how to programmatically turn off the LED on the USB flash drive. I haven't found any tutorials or good source to get to started with it. I'm willing to try to rewrite or to debug drivers if it will be required. I have experience with programming(any language, but preferably C or Python). I have experience with OllyDBG and IDA PRO. I have some experience with engineering(small devices like Arduino). I'm not interested in disconnecting LED form the board, or closing it with black duct-tape. I need to do it manually using some script, tool, or by rewriting the driver. I have seen a lot of question like this, but non of them have any information that can be used. I also tried to contact some of the persons who have answered to similar question, but no luck so far. I would really appreciate if someone could give me some information or guideline of how to do this. P.S. I need this a start with another project. I want to disable LED on the USB webcam that I have, but I don't know where to start, so I think it will be easier to do with a USB flash drive first. Also, I want to do this on Windows. But if any information is available for Linux I will gladly look at it. Any information regarding any flash drive or webcam will do just fine. * * * I think I have confused many of you. This question is not about turning off LED on **webcam**. It's about turning off LED on **flash drive**. Regular USB flash drive, where no hard can be done if LED will be disabled. I'm sure that they have opinion to blink. For example when transmitting data on flash drive LED in blinking. When it's inactive the LED is on or off. Of course it depends on the flash drive model and manufacturer. But if someone can point how to do it on any flash drive and point where to buy it(eBay, Amazon or any other e-shop), I will be gladly to try it out.


title: Program license : Open-Source and commercial?

text: Currently programming a new software, I'm searching for information about protecting my concept and my source-code. I precise I'm quite new in licensing. As I'm feeling very concerned by Open-source and sharing with the community, I'm puzzled on the other hand because I want to make some profit of my work (around 1 year of free-time, you can imagine the amount of missed beers in pub!). So I'm looking for a double license, that is compatible, and allows software source-code distributing, but force companies to get a commercial license, or to negotiate directly with me. But I think it is totally contradictory with GPL like licenses. What are you thinking about that?


title: mobile app development noob

text: I know c, most of c++, a little assembly, win32 console, etc I'm looking for free, cross-platform, c / c++, emulator, etc. I'm a beginner to the mobile app world, so I'm lost. Some that pop to mind on this list:   http://en.wikipedia.org/wiki/Mobile_application_development Airplay SDK, Aqua, BatteryTech, DragonFireSDK, IwGame Engine, Symbian, Windows Mobile I don't want to use a API that is considered obsolete.


title: Enforcing a uniform Scrum approach to all teams within a department

text: Where I work we recently switched the Agile development using Scrum. We went through the typical growing pains but have reached an approach that seems to work for now (whether it'll work in the long term is for another question!). Obviously, the department management is happy the transition to Scrum is working. But they have starting doing something that, to me, feels wrong. Management will observe a team, see what works for them, and the prescribe it to the entire department. Things like:   * The definition of "Done"   * Which story point values can be used for story pointing (eg, omitting 8 from the fib. sequence because 1, 2, 3, 5, 13, etc were the only ones used during a sprint they observed)   * Telling teams they must calibrate their story point value of 1 to "updating a UI label," and limiting them to an upper bound of 20      * (although not all our projects have clients and not all developers have UI experience)   * Telling teams to use story point estimates of 100 to mean "we'll split this story later"   * Telling teams to use story point estimates of infinity to mean "this is an epic" or "we need more info" I understand they're trying to be helpful, but shouldn't all the things above be Scrum-team specific? That is to say, what works for one group of individuals on one project may not make sense to another group on another project. I'm concerned we're drifting into a very prescriptive and stiff Agile approach. Am I justified in thinking this, or am I overreacting? ## Edit Just to clarify... by "Management" and "Manager" I don't mean the Product Owner. I mean any manager outside the Scrum Team, but within the Software Department.


title: how to filter 'must-have' requirements from 'nice-to-have' requirements

text: In building a software from scratch, there is necessity to conduct detailed needs assessment and find out what the clients/stakeholders **really** need. When interviewing the end-users, organizing workshops or directly participating in business process for which the software product is written, there are many requirements which are very important, they are 'must-to-have' requirements . In the same process, the clients name some functionalities, which **are related to** software, but they do not seem do solve any problem, so say 'nice-to-have' features., e.g. have the possibility to change the interface color, or be able to manage some processes which the software could do without their interference. There should be some pattern to manage this kind of requirements. How to distinguish between these 2 kind of featuures? How to estimate does an additional feature add value to the software or is just augments the scope of the project? Besides, how to persuade the clients that 'nice-to-have' features are somehow useful, but not really necessary.


title: Functional Programming on the rise?

text: I have noticed lately that functional programming languages are gaining popularity. I recently noticed how the Tiobe Index shows an increase in their popularity in comparison to the last year although most of them do not even reach the top 50 most popular languages according to this index. And this has been the case for quite some time. Functional programming simply has not become as popular as other models (i.e object oriented programming). I have seen however a reborn interest in the power of functional programming and now that multicores are more and more popular, developers have started to show interest in other models of concurrency already explored in the past by languages like Haskell and Erlang. I see with great interest the fact that despite of their lack of a big community acceptance, more and more languages of this sort continue to emerge. Clojure (2007), Scala (2003), F# (2002) are just three examples of the recent last decade. I have been, myself, investing some time learning Haskell and Scala. And I find a great potential in the paradigm which for me was totally new despite of being out there for so long. And of course, my biggest question is if any of these are really going to become popular enough as to consider putting any effort in them, but this is a question that not even Mandrake could answer, despite of all the fuss people is making about them. What I do want to ask is:   * In which scenarios should I consider a functional programming languages better suited to do a given task? Besides the so recently popular multicore problem of parallel programming.   * If I decided to switch to a functional programming language which do you consider are the biggest pitfalls that I will face? (Besides the paradigm change and the difficulty to evaluate performance due to lazy evaluation).   * With so many functional programming languages out there, how would you choose the one the better suit your needs?  Any recommendations for further research will be more than welcomed. I have searched the web for opinions and it appears the all this renew popularity come from the idea that now were about to hit the wall of Moore's Law and functional programming languages will come and heroically save us. But if this is the case, I would say there are more probabilities of existing popular languages adapting to the paradigm. Some of you, with more experience working every day with these languages perhaps can offer more insight on the subject. All your opinions will be better appreciated and carefully considered. Thanks in advance!


title: Using BSD Licensed source code

text: Someone wrote a .NET library to use the Google Maps API (link to the project). I downloaded the entire repository and there are only source files, no LICENSE.txt, readme, etc. However, I guess Google makes you pick a license when creating a new project so the author specified "New BSD License". What I would like to do is download the source and rework it (maybe include JSON.net, add features, etc) and keep it in my github account. So I have a few questions related to this:   * Is the license valid even though the author doesn't have an explicit file with his name, copyright, etc?   * If the license is valid, then do I just put his name and year into that BSD License Template?   * In general, if there is a license included with a project, how do I make sure I am doing right by the author? Would I just leave their license information in tact and then add my own on top of it?   * Am I over thinking this and some of these licenses just amount to a "do whatever you want just don't sue me" (kind of my feelings, since I would be delighted if anyone wanted to use my code for anything at all)?


title: What values in an application should be configurable?

text: What values in an application should be configurable, or otherwise not hard coded? Does this differ based on application type (batch vs UI) and are there any published standards or guidance on this topic (IEEE, ACM, vendor, etc)?


title: Why did Embarcadero make me sign a waiver?

text: Just signed in to the Embarcadero Developer Network and got this: > EXPORT CONTROLS ON EMBARCADERO SOFTWARE Your EDN membership and access to > Embarcadero Software is subject to your agreement to and compliance with the > following terms: > > -You agree that U.S. export control laws govern your use of the Embarcadero > Software. > > -You are not a citizen, national, or resident of, and are not under control > of, the government of Cuba, Iran, Sudan, North Korea, Syria, nor any country > to which the United States has embargoed or prohibited export. > > -You will not provide or export Embarcadero Software, directly or > indirectly, to the above mentioned countries nor to citizens, nationals or > residents of those countries. > > -You are not listed on the United States Department of Treasury lists of > Specially Designated Nationals, Specially Designated Terrorists, and > Specially Designated Narcotic Traffickers, nor are you listed on the United > States Department of Commerce Table of Denial Orders. > > -You will not provide or export the Embarcadero Software, directly or > indirectly, to persons on the above mentioned lists. > > -You will not use the Embarcadero Software for, and will not allow the > Embarcadero Software to be used for, any purposes prohibited by United > States law, including for the development, design, manufacture or production > of nuclear, chemical or biological weapons of mass destruction. I think it's BS, but what craziness is forcing companies like Embarcadero to hold developers to these very high standards? Also, what is "Embarcadero Software"? Does that mean I can't put a benign videogame on a website that may have a runtime that might be downloaded by a Iranian who love scrabble. Or does "Embarcadero Software" refer to anything I develop using Delphi.


title: Other than XML, what are some examples of "coding" a GUI design?

text: I've been trying to think outside of the box as to how desktop GUIs can be designed in code(not a graphical designer!). I've come across basically three ways this is done:   1. XML   2. Raw code (create a window, create a text box, add text box to window, etc)   3. HTML and friends I'm sure that someone has done something other than these three though. Are there any existing examples of frameworks or languages which allow you to code a GUI using a format other than these three


title: What techniques do you use when interviewing developers?

text: I realize there have been lots of discussions about this type of thing and they often devolve into dogma around whether you ask the "100 logical pirates" type of questions or whether you get them to write "fizz buzz". I'm interested in what techniques and questions have been effective for _you_ when interviewing potential developers for jobs. One technique per answer so we can vote on them, please.


title: Testing (deterministic) algorithms with multiple or difficult to prove correct right answers

text: I'd like to preface this that this question is similar, but my question doesn't involve randomness, just finicky determinism, so the answer of "use a known seed" doesn't really apply. Likewise, this question is similar, but again, I'm not expecting the algorithm to ever fail -- I just don't know which way it will be correct. This question came about while testing graph algorithms. but is by no means limited to them. Some algorithms such as A* can have multiple correct answers. Depending on your exact implementation you may get any one of several answers, each of which are equally correct. This can make them difficult to test, though, because you don't know which one it's going to spit out ahead of time, and it's very time consuming to compute the answers by hand. In my specific case, I got around it by modifying Floyd-Warshall to spit out _every possible_ shortest path, and spent the time hand testing that. It had the benefit of being a good feature in its own right. Then I could test other functions in terms of the known correct paths from FW (if the returned path is any one of the paths returned by FW for that start/end pair, it's correct). Of course, this only works for dense graphs due to how FW works, but it's still nice. However, that may not always be viable for all algorithms with this characteristic. So far, the best answer I've come up with is to test for the characteristics of a correct answer, rather than the correct answer itself. To go back to shortest path algorithms, you can check the cost of the returned path against the known right cost and make sure the path is valid. This works, but it can run the risk of not verifying everything correctly the more criteria for correctness there are, especially if the verification is itself complex (e.g. while correct algorithms exist, verifying a minimum spanning tree is a known hard problem; probably harder than constructing the MST itself), in which case you now have to extensively test your testing code. Worse: presumably you have to construct an MST to test an MST verification algorithm so you now have a great scenario where your MST test relies on your MST verification algorithm working, and your MST verification algorithm test relies on your MST generation code working. Finally, there's the "cheap way", which involves observing the output, verifying it by hand, then hard coding the test to test the output you just verified, but that's not a great idea since you may have to revise the test every time you change the implementation a little (which is what automated testing is supposed to avoid). Obviously the answer depends on the exact algorithm you're testing to a degree, but I was wondering if there were any "best practices" for verifying algorithms that have several definite, deterministic "correct" outputs, but those precise correct outputs are difficult to know ahead of time, and possibly hard to even verify after the fact.


title: What diagrams, other than the class diagram and the workflow diagram, are useful for explaining how an application works?

text: I am working on a small Delphi project, composed of two units. One unit is for the GUI, and the other for data management, file parsing, list iterating and so on.. I've already made a class diagram, and my workflow looks like hell- it's too complex, even for anyone to read. I've considered making a dataflow diagram, but it would be even more complex. A use case diagram wouldn't be of use either. Am I missing some diagram type which could somehow represent the relationship between my two units?


title: Is wrapping byte[] for stronger typing good practice?

text: I'm working on a Java-based library which makes use of PKCS #10 requests. There are PKCS #10 libraries available for Java (Sun and IBM libraries that come with the respective JDKs), and the open-source Bouncy Castle library. I'd rather not couple my library to another through the API, so my initial thought was to create a wrapper. However, PKCS #10 is potentially complex, so the scope of the wrapper would expand quite quickly, and users of that wrapper would probably "unwrap" the wrapper and use one of the aforementioned libraries for any heavy-lifting, particularly if they use PKCS #10 in their own applications already. My remaining option is to provide a simple wrapper around a byte array. Is providing a very thin wrapper just for the sake of typing good practice?


title: Can't understand on how to implement MVP/MVC for my software requirements

text: Recently I decided to start developing a client/service based system using WCF and a Duplex Channel (callbacks from Service to client). The clients will behave as "slaves", that is, they will only connect to server and from then on, only the server communicates with them. Eventually the server may request that the clients send "data streams" to him (frequent updates of new content/objects). I want to make my software as loosely coupled as possible, but even reading about the different patterns for this, such as MVC and MVP, they don't seem to be designed to fulfill my specific requirements. What is the best code architecture or pattern for my problem? Considering the technologies I am using?


title: Strategy for maintaining offline repository safely using git

text: I use git for versioning. Just yesterday I was working on refactoring my Python code base. After adding a test I found that I had introduced a bug in one of project euler solutions. So I checked out a previous version offline, found the diff and went back to latest version and fixed the problem. It was a bit after that I found a mess up had been done due to this. I use .gitignore to leave many of the unneeded files or WIP things out of git. I found that using checkout and going back to the latest version deleted some files which were not checked in. Now I am finding that a new repo that I keep in an ignored Folder is completed cleaned. It did not have much so far but still all is gone. So I am confused about what is a good way to keep offline codebase intact in case there are many such folders/files that I do not want to check in? Also how to organize codebase on local for new projects? Just take backups on a drive?


title: Manage ClickOnce releases for different parties

text: I'm struggling with release management of a piece of software. First some general information:   * It is a ClickOnce application   * I follow the release often practice   * There are about 30 parties served with this software   * I need full control which update will be delivered to which party   * Not each party is allowed to get the latest update/release   * Each party has multiple clients that are all allowed to get the latest update, served for the specific party So that's what my requirements are in a rough description. So let me explain what I was thinking about how to solve this.   * I would like to create a "deployment" website (asp.net) that will handle all the requests   * There are two endpoints one for download the client and one where the client checks for updates   * So each party has a separate endpoint like DeploymentSite/party1 and another for DeploymentSite/party2   * The Application Files should still be stored centralized So I thought it would be manageable with mage.exe with the following steps   1. Build application and store new release into Application Files Repository/Folder   2. Get parties that should be updated (config file, database what ever)   3. Run mage.exe to create a new application and deployment manifest for each party in the update list with new Application File Location (1.0.2)  Actually I'm really struggling with this mage.exe staff. I can't create the appropriate files with the needed codebase. How to handle thes requirements?


title: How should I test boolean function with many possible permutations

text: When I write an unit test I usually provide a context (plain object or mocked/stubbed object) that I setup in some ways and then I can run assert statement on the context: note: code is in pseudo-code; groovy like syntax:               test myTest() {       def o = getTestContext();       o.string = "testme"       o.number = "2"       assert o.mult() == "testme testme"      }      But how to organize the test when you need to test a complex boolean expression that takes many parameters ? EDIT: I have replaced the one line expression with something more readable to avoid confusion.               //this is not a real class, this is an example. Naming is bad, for conciseness sake     //the expression is coming from randomness realm, so it is probably refactorable and simplifiable, but complex real world expression still exists.     enum Type {X,Y,Z}     class C {       boolean a,b,c,d;       Type t;                 boolean isEnabled(boolean anotherFlag) {              def condition1 = (a || b)         def condition2 = (c && d)         def goodType1 = t == X || t == Y         def goodType2 = anotherFlag && t == Z || t == Z && !condition1               return (  condition1  || condition2 ) && (goodType1 || goodType2)        }     }      All tests for this kind of methods I've read so far are very verbose, not complete and hard to understand. And it is quite a shame that such a small line of code, even if it is 'complex', generates awful tests. I've tried to break the boolean expression into smaller sub methods, but sometime it is not so convenient and the permutation count is still high. I also usually break the expression into intermediate variables, but this is not helping in unit test world... How should I test something like this to have test code matching the briefness of the tested code and the completeness that must assert that my code works as expected ? **Edit: about the retained solution.** Refactoring is indeed a way to go, but I really don't want to 'unroll' all combinations manually in my tests: it is verbose, ugly and good be hard to understand to. However I'll keep this answer as a preliminary mandatory step: break the expression into smaller pieces before anything else. Once the refactoring is done and the test still result in combinatory tests, then I'll use the TruthTable solution proposed. I'll just generate the combinations and not declare everything. I found this interesting, but outdated, article about test combination in Groovy.   The tool they spoke about is out of search engine radar, so it must be dead !   However I'll used the same pattern:               assertThat(permutations, expectations, instanceObject)      Where   * permutation is all possible values to assign to properties in a 'condensed map': (a:[true, false], b:[true, false], ...)   * expectation is all combinations that return a specific value, all other combination will be checked against a default value.


title: Synchronizing web ui and third party async services

text: I'm looking for concepts, approaches or even Framework/libraries to help me synchronize state reliably from web UI to a third Party Service. For example: creating a JavaScript irc Client ui you need an own backend to handle the IRC connection. The IRC protocol is asynchronous in a way that you send a command to the server and then the server will eventually answer with an event changing the state of your irc connection. In similar ways the JavaScript/web UI is asynchronous when it comes to reflecting changes in that state. From my understanding there are two main issues I am having with implementing something like this. Usecase: Joining a channel:   1. In JavaScript UI I enter a command which will trigger an AJAX(?) call. On the server this request triggers an execution of an IRC command. At this point I Need to have an eventlistener for the possible answers a server could give me and determine whether I have joined the given channel or not. This ideally should result in the ui being updated with either an error message or an opening channel window   2. In IRC you could also be invited by someone to join a channel, or your could be kicked from a channel. Then you have to react to the irc connection state changes and update the ui accordingly Is this a solved problem?


title: Alternatives to Professional Version Control

text: We're teaming up with some non programmers (writers) who need to contribute to one of our projects. Now they just don't like the idea of using Git (or anything for that matter) for version controlling their work. I think this is because they just don't find it worthwhile to wrap their heads around the twisted concepts of version control. (when I first introduced them to branching and merging -- they looked like I was offending them.) Now, we're not in a position to educate them or convince them to use it. We're just trying to find alternatives so that we get all their work versioned (which is what we need) -- and they get easy workflow and concentrate on what they do. I have come up with some ideas...   * tell them to save their work as a separate file every time they make some non-trivial change, and then use a diff on our side to just track changes.   * write a program (in Python) that implements the "milestones" in CSSEdit in some way. _**About the project:_** _It is a natural language processing system (written in C + Python). We've hired some writers to prepare inputs for the system in different languages. And as we evolve the software, we'd need those writers to make changes to their inputs (articles). Sometimes the changes are very small (a word or two), and other times big._ _The reason we need to version control those changes is because every small/big change in the input has the potential to change the system's output dramatically._


title: Display rich text in tool tip

text: In this particular website, when you hover your mouse over a particular region, it displays something that is clickable. I know of tool tips, but in my experience, I have only used tool tips to show static text, not click able html text. http://www.cry.org/projects/projects.html What technology do you think is being used here? Also, is this a tool tip?


title: Does everyone need a framework to work better?

text: I have been working with a complex system written with Java. It is made by with many java programs and many shell scripts which call them and some cronjobs to schedule them. The system is hard to maintain. Input/Output/Error/OK files were distributed in different place of the system by the hands of different programmers. In order to know what is going on, I need to check the config file to see where are the relevant files, and go there to check the status of the program by viewing some logs or ok files(a blank file with extension of .ok to indicate the success of a scheduled job). Moreover, I am tired of wasting my time on the JDBC connection/object which need to open explicitly and close explicitly. I've heard that people's compliment over the famous Struts Spring Hibernate (SSH) frameworks. I have never touch any of those, would they help me make a better project which is easy to maintain?


title: Design Methodology for Developing Interoperable Systems?

text: **A bit of background** The company I work for has been creating database applications since around 1980 and, until relatively recently, most of these systems have been stand- alone "silo" systems. However, in the last few years, we've seen more of a shift towards gathering "intelligence" across all systems within our customers requirements. For example, a system that might collect data about people's dental records may need to talk to a system that collects data about people's optician records, share information about the same person and provide search capabilities across both systems (makes sense, although the example I've used is fictional). In the fictional example above, the dental and optician systems may or may not both be written by the company I work for (in other words we are looking at both internally-developed interfaces and interfaces to systems from third- party providers). **What we've done so far** We have a basic web-services API ( **.asmx** ) for one of our products, but I'm concerned about the change management, in terms of keeping it up-to-date as we add new features to the main product (in terms of providing the new features through the API without breaking compatibility with older interfaces). We have also produced one **WCF** service. The rigid contracts put my mind slightly more at ease than working with the ASMX service, but I think a lack of experience within the company is holding us back, so I'm looking for some guidance on best practice that I can read up on to help move us along (or at least point us in the right direction). **The question**   * **Is there a particular methodology or programming practice for designing systems to maximise their ability to interface to other systems?**   * **Are there any good online (or offline) resources for these programming practices (assuming they exist)?** Any other advice you can provide based on the information above would be appreciated, but not essential. We primarily develop in Microsoft .NET (mainly ASP.NET, with some windows forms applications as well) with a SQL Server/Oracle database back-end, although I expect the programming practices might be language independent. (I've used the .NET tag as an afterthought, but I might take it out later..!) Thanks for your time.


title: Moving legacy application to a testable framework?

text: We have a web application which contains a web service with over 50 methods. The application is currently installed at a number of sites and is currently being maintained by one developer. The application is currently a single user system where all the data is stored in XML files. One of our main tasks is to make it a multi user system whilst at the same time put in a database (RDBMS or NoSQL, not decided yet). In addition to other new features we want to get a team of developers (around 5) working on other new features. From what I have seen, the application is not testable. There are no test units and all the code is pretty much in the web service methods. I need to put a framework in place so that the other developers can simply start working on their features using TDD and then finally when we have the database in place we can switch that in at a later date. I was thinking of first moving all the code into libraries and then introducing UNITY and test/mocking frameworks to provide some of the services that the other developers will need. That way via inversion of control they at least have interfaces they can work with. I am not sure if this is the right way to go or whether I should focus on some other area. I was thinking about putting unit tests around the original code but then all the code will change later so this may be pointless in the long run. We have a period of about 6 weeks before we get the other developers involved. Any help would be appreciated.


title: What's the difference between dictionary word "Scheme" and Computer term "Schema"

text: What's the difference? In my opinion, I can replace the term "Schema" with "Scheme". Can I?


title: How in the earth CHRW produce unicode codes given that it only accept 65k possible input?

text: http://babelstone.blogspot.com/2005/11/how-many-unicode-characters-are- there.html says there are 1 million unicode characters and around 240k of which are already assigned. 1 million > 240k > 65k However, http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.strings.chrw says that chrw accept 65k characters. Not only that chrw accept integer. Integer is 4 bytes in vb.net right and can store way more than 65k characters. The numbers do not match up and so what am I missing?


title: OOP terminology in Ruby and C++

text: I am taking a C++ class in my school. Since I've programmed in Ruby I know some OOP stuff. But in C++ there are member functions, member variables, and static functions. In Ruby we have instance methods, instance variables, and class variables. And there are more... Any reason they're different? Are they quite different levels of OOP? Or just some differences in tradition these ecosystems have?


title: DDD - Aggregate Roots - Dealing with Efficiency and Concurrency

text: First off, I'll admit that I'm a newbie to DDD and need to read the "blue book". I'm building a system that has an AggregateRoot of type "Match". Each Match can have a collection of "Votes" and also has a readonly "VoteCount" property which gets incremented when a user up-votes or down-votes a Match. Since many users could be voting on a Match at the same time, Votes have to be added/removed from the Match and the VoteCount has to be incremented/decremented as one atomic operation involving write locks (with locks handled by the DB). (I need VoteCount as a static value in the database to be queried on efficiently by other processes/components.) It seems to me that if I were adhering to strict DDD, I would be coding this operation as such:   1. An application service would receive a vote request object   2. The service would then retrieve the Match object from a Match Repository   3. The service would then call some sort of method on the Match object to add the Vote to the collection and update VoteCount.   4. The Repository would then persist that Match instance back to the DB However, this approach is not feasible for my application for 2 main reasons, as I see:   1. I'm using MongoDB on the backend and cannot wrap this read-write operation into a transaction to prevent dirty reads of the Match data and its associated Votes and VoteCount.   2. It's highly inefficient. I'm pulling back the entire object graph just to add a Vote and increment VoteCount. Although this is more efficient in a document db than in a relational one, I'm still doing an unnecessary read operation.  Issues 1 & 2 are not a problem when sending a single Vote object to the repository and performing one atomic update statement against Mongo. Could Vote, in this case be considered an "aggregate" and be deserving of its own repository and aggregate status?


title: How to explain to non-programmers that programming is not a repetitive task?

text: Some people have the view of programming that it is just repetitive typing on a keyboard. None of this is true. First of all, there is so much more you have to do than actually typing down the code, such as design architecture and so on. Secondly, it could be a greatly varying, non-repetitive task, with new challenges coming all the time. How should you explain that programming is _not_ a repetitive task to **non- programmers**?


title: What are some good assignments for an introductory course, to reach today's students?

text: I periodically teach an **introduction to programming course using Java**. I want to give my students some exciting **assignments that they can relate to or find interesting**. At the very least, I want assignments that make sense and have an internal cohesion (for example, some very bad programming exercises seem contrived just so that you have to use the most recent programming construct covered). To give you an idea of scope, **here's what's being covered** :   * The assignments must be in Java, using some external library can be done, but it would need to be a simple API and not a full framework   * Variables, Primitives and Strings   * Console input and output   * `if`, `for`, `while`   * Arithmetic and logical operators   * Simple graphics with line and shape drawing   * Static methods   * One-dimensional arrays The students will not go into advanced topics (e.g., no recursion, no emphasis on inheritance). Thus, I'm _not_ looking for complex projects: "Have them write a C compiler. I did it when I was 5 and it was the only way I learned!" _If you have ideas that are more advanced than the scope, please post them on the "Challenging" question linked below, and not this one._ Instead, what I'm looking for are interesting ideas that can be accomplished in a short program. For example:   * Students can write a console version of the "Star Wars Name" Generator. This is effectively reading Strings and using `substring`, but I think it's fun. A similar variation would be a "Mad Libs" program. _I used this one five years ago, and perhaps it's already "stale."_   * Using some trig supplied to them, students can draw regular polygons, and create interesting spiral shapes.   * It's also not out of the question to use some simple animation class with most of the code supplied to them. And if you know a Twitter or Facebook service that can be accessed with a simple API, I would be very interested to know. Please note that this question is different from the "Challenging Java questions for beginners" Question. I'm not looking for challenging per se, just interesting. I think if students work on something where they can easily answer "why would anyone ever want to program that?" then they will learn better. Even simple problems like computing Miles per Gallon can be good. Although, if there's a way to update it to be more relevant, all the better. If you have an exercise from somewhere else (a book or a website), please cite the source. To help you think about the typical freshman today, check out **the Beloit Mindset list**, for many examples that will surely make you feel old.


title: How can I automatically undo checkouts on unmodified files?

text: From time to time, I realize that files that haven't been modified have been checked out by my Visual Studio. It's either because I changed something and undid it, or just because Visual Studio decided to check out the file for no obvious reasons (eg if you modify the code of a winform, Visual Studio will automatically checkout the associated .Designer.cs for you) Since I have the habit of making a diff of all my checkins, It would be a nice time-saver to be able to spot them at a glance (or event to automatically perform undo checkout on those) Did someone find a solution to this?


title: What is the term that describe objects representing both logic and data?

text: The reason I am asking this question is I want to know how to properly call an architecture where classes have either data or logic but not both. I know this goes against object orientation and encapsulation. I want to use the proper terms for discussing this architecture. * * * EDIT: By reading the answers I have received, I can see my question wasn't clear. I also feel the edit that was made didn't push the question in the direction I was going for. I will restate the question in other terms. Suppose you are working in C#, Java or some other OO language. You have 2 designs: DESIGN A:               class Car     {          // data          int numberOfWheels;           Engine carEngine;               // methods          public void StartCar();     }      DESIGN B:               class Car     {          // this class contains only data (be it entity, DTO, whatever)          int numberOfWheels;          Engine carEngine;     }          class CarStarter     {          public void StartCar(Car aCar);     }      In DESIGN B, some classes are used as data structures/DTO/entities (they contain only data and should not contain methods). Other classes contains logic and work with the data classes. Now suppose you have a design/architecture where DESIGN B, should be applied throughout rather than design A. I was looking either for a term that described DESIGN B, or the OOP term/notion that consist of DESIGN A. Preferably both. For the OOP term I guess encapsulation could be it. From Wikipedia Encapsulation > A language construct that facilitates the bundling of data with the methods > (or other functions) operating on that data. I still don't know how to call DESIGN B though.


title: How do I negotiate with a company to develop software?

text: I am a programmer, I am developing software expected to be between 50k to 100k line of code. I'd like to hire a company to develop an interface to my tool with other software by writing a plugin. This company has done it successfully in the past and I was recommended to use them. However I have never negotiated before and I don't know how its done. I heard in retail one side gets lawyers to put in as much things as possible and the other removes as much as possible. In a different industry I heard distributors or publishers will promise large % of royalties however you'll never see them even if the product has done well. How do I negotiate with a software company on pricing and possibly timeline of this plugin? What do they suspect I'll do? What should I expect them to do?


title: How do I figure out the minimum number of swaps to sort a list in-place?

text: In-place sorting is essentially swapping elements without using extra storage, correct? How can I find the minimum number of swaps required for a list?               A C D Q R Z   E   // input     | | | > > > <<<   // movement     A C D E Q R   Z   // output      Swapping:               A C D Q R Z E          swap Q with E, ACDERZQ     swap R with Q, ACDEQZR     swap R with Z, ACDEQRZ. done.      3 swaps. Shifting items left or right is essentially swapping, but I want the optimal number for plucking an item out of line and switching its place with another.


title: How to Leverage Clearcase's features

text: We use Clearcase at our office, and based on my admittedly light knowledge of clearcase, it just _seems_ like a really bloated source control tool. I know from hearing friends talk about Clearcase that it's really powerful. **My question is, what are some features of Clearcase that make it 'powerful', and what are good tips and tricks for getting the most out of Clearcase?**


title: Should speed reading be applied while reading Tech Books

text: > **Possible Duplicate:**   >  How do people read big technical books? It's a known fact that, Science and Tech readings requires most attention, to at least make sense of what one reads. In the age of rapid change of platforms, particularly in the Information Technology Industry, we need to read vast and varied amount of text. How feasible is it to Speed-Read Technology books? I understand, there isn't any objective answer to the question, but interested to know the approaches that can be used to effectively perform Speed-Reading on Software Development/Programming related books.


title: Should I use a parser generator or should I roll my own custom lexer and parser code?

text: What **specific** advantages and disadvantages of each way to working on a programming language grammar? Why/When should I roll my own? Why/When should I use a generator?


title: To master C programming language is necessary to have a full knowledge of the standard library?

text: I'm currently studying C from K&R book. In some examples the authors introduces new functions, my question is, to master C is necessary to know all the functions that are part of the standard library?. Suppose that is an extra-time cost to learn. NOTE: I want to master the language, and as K&R says; the standard library is not part of the language. Thanks


title: Querying key/value store

text: I don't know whether this question is reasonably answerable (and therefore will be closed), but I will take my chances: What are the possible problems (and solutions), one might encounter, when developing query mechanism for key/value store/database (like redis for example)? All the values will consist only of JSON documents and all data will be located only in RAM. Query mechanism should be able to search/query for data based on document field values, so I assume one of the problems might be performance based on number of docs in database (this could however be lowered by partitioning documents based on their type like posts, comments, ...).


title: Example bad code project to motivate refactoring / good design

text: This is sort of the opposite of Is there an open-source project that can be an example of well-written code?. I am teaching software engineering to undergraduates and I would like a blob of object oriented code that demonstrates tight coupling, bad abstraction, low encapsulation, poor maintainability, the works. Anyone have a good example? Something that is digestible (as in, able to skim in an hour or less) would be great. Thanks in advance.


title: What are the differences between QA engineers and software engineers?

text: The way I see it is if you write code that does something useful then you're a software engineer but from what I gather QA engineers seem to have an inferiority complex. It seems like QA engineers are much less reluctant to call themselves programmers than software engineers. Are there any real reasons for this divide and the perception that software engineers are the "real" programmers?


title: What things do I need to become expert ASP.net MVC

text: I graduated in computer science. I had pretty good knowledge in Java. I have about a year experiences in ASP.net C# Web form. What other things do I need to know if I want become expert in ASP.net MVC which I able to do a complex eCommerce website?


title: What should Competent Java programmer Be Able To Do?

text: To call yourself a competent Java programmer, what should you expect of yourself and what should others expect from you? Does anyone have ideas for a project or problem that would help measure someones "java-smarts"?


title: How do I speed up XML parsing operation?

text: I currently have a php script set up to do some xml parsing. Sometimes the script is set as an on page include and other times it is accessed via an ajax call. The problem is the load time for this particular page is very long. I started to think that the php I had written to find what I need in the XML was written poorly and my script is very resource intense. After much research and testing the problem is indeed not my scripting (well perhaps you could consider it a problem with my scripting), but it looks like it takes a long time to load the particular xml sources. My code is like such:               $source_recent = 'my xml feed';      $source_additional = 'the other feed I need';           $xmlstr_recent = file_get_contents($source_recent);     $feed_recent = new SimpleXMLElement($xmlstr_recent);          $xmlstr_additional = file_get_contents($source_additional);     $feed_additional = new SimpleXMLElement($xmlstr_additional);      In all my testing, the above code is what takes the time, not the additional processing I do below. Is there anyway around this or am I at the mercy of the load time of the xml URL's? One crazy thought I had to get around it is to load the xml contents into a db every so often, then just query the db for what I need. Thoughts? Ideas?


title: What is the difference between WCF service and a simple Web service in developing using .NET Framework?

text: My questions are:   1. What is the difference between WCF service and a simple Web service in .NET Framework?   2. What a WCF Service can do which a .NET Web service cant? In other words, what are the limitation of .NET Web services which were overcome in WCF services? I understand that WCF are REST based and .NET web services are SOAP based. But I need to know more than that. How a developer will make a design decision whether to developer a Web service or a WCF service?


title: Steps to take to create the Product Backlog for starting our project with Scrum

text: A small team (3 or 4) are working on a fairly big project that might take 1 year to complete. We are basically re-designing an existing software (that had been developer over 5-6 years while being used without any direction). Currently we have a list of things we would like to have (features). We have about 25 of them. How do we effectively turn these into a number of backlog tasks and also build our specs from here. Any resources or help would be appreciated as we are all fairly new to design process.


title: Is it advisable to force your web server to parse HTML files for PHP code?

text: I can't remember what site I glanced over and picked up that tidbit, but someone suggested that you should keep PHP parsing to .PHP files, and not modify one's webserver's htaccess to include PHP parsing within .HTML files. Is this true? Is there any generally agreed upon reason as to doing it one way or the other?


title: API design involving standard and custom settings

text: Suppose a class allows some kind of configuration that has some well-known default values but also has the option of defining a custom value. For example, suppose you want to let users configure a person's title. They can choose from a set of standard values (Mr., Mrs., Ms., etc.) but they can also specify a custom (Dr.). What is the most elegant way to put this in an API? Some examples in Java:               public class Person {       public enum Title {MR, MRS, MS, CUSTOM};            setTitle(Title title, String customTitle);     }      This one is quite bad because whenever you specify anything else than Title.CUSTOM the second argument is silently ignored. So maybe:               public class Person {       public enum Title { MR, MRS, MS, CUSTOM};            setTitle(Title title);       setCustomTitle(String title);     }      I don't really like this one either, because it's not immediately clear that calling one will overwrite the effects of the other method. Is there a more elegant interface that I'm overlooking?


title: Creating my own PHP framework

text: Disclaimer: I don't want to start any flame war so there will not be no name of any framework mentioned. I've been using quite many from the existing PHP frameworks and my experience in each case was similar: everything is nice a the beginning but in the moment you require something non standard you get into lot of problems to fix otherwise simple issues. In case of frameworks following the MVC design pattern there are some issues with the implementation of each layer for example there is a lot of codding used for model and data access with using ORM and presentation is not much more than pure phtml. Some frameworks use their own wrappers for existing PHP functionality and in some cases severely limiting original functionality. Depending on framework you can have additional problems like lack of documentation, slow or non existent development cycle and last but not least speed. While ago I made my own framework which while doing it's job and being used for few different applications after couple of years more of experience with PHP doesn't seem to be perfect piece of codding. I could write my own framework and use additional experience I've gathered during these years to make it better on the other hand I'm aware that there is quite many better programmers working on creating/upgrading existing frameworks. So does it make at all nay sense to write my own PHP framework if there is so many possibilities to choose from?


title: Handling optional GPL dependencies

text: Assume I have a library A which is licensed under a two-clause Free BSD style license. Library A optionally depends on library B (the availability of the dependency is configured at build-time), which is licensed under the GPLv3. If I distribute both bundled together, the license will need to be GPL. But am I still able to distribute library A under the FreeBSD license? How do I indicate that the license changes, when the use of library B is enabled? Do I need to distribute two different versions or can I just have one that contains both licenses and states which applies under which conditions? Any example project I can have a look at to see it done?


title: Is there a real difference between dynamic analysis and testing?

text: Often testing is regarded as a dynamic analysis of a software. Yet while writing my thesis, the reviewer noted to me that dynamic analysis is about analyzing the program behind the scenes - e.g. profiling and that it is not the same as testing because its "analysis" which looks inside and observes.   I know that "static analysis" is not testing, should we then separate this "dynamic analysis" also from testing? Some books do refer to dynamic analysis in this sense. I would maybe say that testing is a one mean of dynamic analysis? As for testing definitions: > IEEE 829 broadens the idea to “analyzing,” thus including “static testing.” > And ISTQB takes the full step and includes both “dynamic and static.” > Testing is both dynamic and static. So maybe it is just a matter of semantics? If testing is considered to be an analysis, then its both static and dynamic analysis is a testing approach.


title: How is the system software stored in Computer?

text: We usually have a lot of system software inside our PC's like Operating Systems (which contains different interrupt handlers etc.), Assemblers and Compilers, Drivers. My question is how do we store this information in the computer? Are these all softwares stored in machine instruction format inside the computer at specific locations inside the PC-ROM? Or they are stored as is in the high-level language (like C) in which they are written and then compiled every time the programs are called?


title: What are DRY, KISS, SOLID, etc. classified as?

text: **Is something like DRY a design pattern, a methodology, or something in between?** They do not have specific implementations that could neccessarily be demonstrated(even if you can easily demonstrate a case NOT using something like KISS... see The Daily WTF for a plethora of examples), nor do they fully explain a development process like a methodology generally would. Where does that leave these types of "rule of thumb"'s?


title: Is there a design pattern for modelling job execution flow?

text: In my application I have a set of jobs to execute:   * Each job goes through the states "not started", "started", "completed", "failed" etc.    * Each job has a set of pre-conditions and post-conditions.    * Job cannot start until the preconditions are satisfied and should be marked as failed if it doesn't satisfy the post conditions.  For example let's say the job imports a text file into the database. Pre- condition would be to check if the source file exists and post-condition would be to check if data exists in database. On top of these pre and post- conditions, sometimes job is also dependent on other jobs to finish. It is easy to create a jobs table and have a dependency table for jobs, but is it actually possible to make these pre and post validation checks to be configurable in database (so that no code changes need to be made if these conditions change or new conditions are added)? Even if it is possible somehow, is it a good idea to do so? There is a requirement to make this model generic so that other applications can also make use of it even if the validation checks to be performed are entirely different for other applications.


title: Reliable secure data exchange between service written on .NET and an iOS client app

text: I have a service written on .NET working on a company server. It designed to do a very simple thing, to receive a request via WCF named pipes from another service working locally on the same server, process it and send a response through named pipes back. Request an response are just a fairly small, XML formatted text. And now I need to couple it somehow with our in-house iOS application to do the same thing but with a remote connection through internet. I'm not all too experienced with an Objective-C iOS development and not sure how to proceed. I was considering adding a TCP endpoint to the same WCF service but then I'm not sure how reliable will it be plus I'll have to use some sort of encryption "manually" on both ends of the connection. I can extend or change code of both .NET server and Objective-C iOS client as much as I need but I'm not sure how to ensure reliability and most of all security of data transfer between server and client. Right now I'm considering rewriting my service part to be a web based app since it works at request-response principle anyway but what would be the best approach? Would it be possible to consume a WCF HTTPS endpoint with an iOS client effective enough?


title: Do there exist programming languages where a variable can truly know its own name?

text: In PHP and Python one can iterate over the local variables and, if there is only once choice where the value matches, you could say that you know what the variable's name is, but this does not always work. Machine code does not have variable names. C compiles to assembly and does not have any native reflection capabilities, so it would not know it's name. (Edit: per Anton's answer the pre-processor can know the variable's name). Do there exist programming languages where a variable would know it's name? It gets tricky if you do something like `b = a` and `b` does not become a copy of `a` but a reference to the same place. _**EDIT:_** Why in the world would you want this? I can think of one example: error checking that can survive automatic refactoring. Consider this C# snippet:               private void CheckEnumStr(string paramName, string paramValue)     {         if (paramName != "pony" && paramName != "horse")         {             string exceptionMessage = String.Format(                 "Unexpected value '{0}' of the parameter named '{1}'.",                 paramValue,                 paramName);               throw new ArgumentException(exceptionMessage);         }     }     ...     CheckEnumStr("a", a); // Var 'a' does not know its name - this will not survive naive auto-refactoring      There are other libraries provided by Microsoft and others that allow to check for errors (sorry the names have escaped me). I have seen one library which with the help of closures/lambdas can accomplish error checking that can survive refactoring, but it does not feel idiomatic. This would be one reason why I might want a language where a variable knows its name.


title: What is the best practice for website design and markup now that mobile browsers are common?

text: Back in 2008, smartphones were a small market and it was commonplace for sites to be designed for a fixed width - say, 900px or 960px - with the page centered if the browser window was larger. Many designers said fluid width was better, but since user screens typically varied between 1024x768 and 1920x1080, fluid width allowed longer line length than is optimal for ease of reading, and so many sites (including Stack Exchange) use fixed width. Now that mobile devices are common, what is the the best approach to support both desktop and mobile browsers?   * Establish a separate mobile site (e.g: mobile.example.com)   * Serve a different CSS to mobile devices; if so how? Server-side browser sniffing, or a @media rule?   * Use Javascript or something to adapt the website dynamically to the client? Should all websites be expected to be responsive?   * Some kind of fluid layout   * Something else?


title: How can I tell whether my computer is Harvard or von Neumann architecture?

text: I understand the difference between the two architectures is the separation of instructions from data in the Harvard architecture. But how do I know which type of system I'm on? Is it possible to write a program such that the program determines whether the system is von Neumann or Harvard? Could there be another architecture or are these architectures the only ones known?


title: Why isn't Japanese software industry as strong as their hardware technology?

text: I admire Japanese technology and their innovation. They always seem to be one step ahead of everyone else. But why isn't their software industry just as developed? Why aren't there any Japanese operating systems, high-end game engines, 3D digital content creation applications? I would like to see their take on these and I think it could bring alot of innovation. Btw I mentioned 3D software because the animation industry is strong there as well, but they are using North American software for this.


title: How to really master MySQL?

text: I have been using mysql for the same amount of time I have been using PHP. However I feel about 10x more confident in PHP; or any other programming language. But I just can't seem to really really grasp SQL. I mean, I can select, update, insert, delete, join, etc. but when it comes to more complex stuff I am lost. How to write a more complicated select statement, how to use indexes properly, which engine to use, etc. For some reason I really find the mysql docs hard to follow, but the php ones easy to follow. I am starting to think that maybe my brain is just wired in a way that makes programming make since but sql confusing. I don't know. Most people think Regex is so confusing but to me it makes more scientific sense than how to construct an sql statement. Please don't get me wrong, I am not hating on SQL, I really like it, I just want to understand it better. Whats the best/fastest way to really master MySQL? When I say "master" I don't mean the guru among gurus, I mean smart enough to figure out most of the questions I ask on SO myself without needing help.


title: Performance consideration and code reduction for Templates

text: I'm trying to decide if this might be a good idea to help reduce the size of some of my xaml resource dictionaries on a large project. Except I'm concerned about any potential performance issues going this route so hoping to get some insight from other technically proficient folks. So as example, say there's dozens of control `Style` templates which I've standardized to use shared naming conventions in their objects and handling. To make it a more clear example say you have things like Buttons/TextBoxes/GridSplitters/CheckBoxes etc etc etc. They all have their own Style template, but they all would have say a `Border` which is Collapsed by default but each has the same Visibility toggling `DoubleAnimation` in their respective `Storyboard` for the MouseOver state as defined in the `VisualStateManager` Which basically makes the exact same repeated `DoubleAnimation` over and over for dozens of controls for that MouseOver state. My question is could I potentially negatively impact performance if I made each of these overly repetitive `Storyboards` into their own resource so instead of repeating the same thing over and over again on each style template like;               <VisualState x:Name="MouseOver">        <Storyboard>           <DoubleAnimation .../>        </Storyboard>     </VisualState>      Could I instead take that currently repeated exact same `Storyboard` and do something like this with out negatively impacting (and hopefully actually even improving) the performance of such a large project like;               <Storyboard x:Name="TheRepetitiveAnimation">        <DoubleAnimation ..../>     </Storyboard>      Then on each instance in each template instead of having the whole animation repeated I could just do;               <VisualState x:Name="MouseOver>        <BeginStoryboard Storyboard="{StaticResource TheRepetitiveAnimation"/>     </VisualState>      Because if I could do it this way, I could probably shave at minimum another thousand lines out of my resource dictionaries by exchanging the multi-line repeated animations with a one line reference to a master `Storyboard` that way. Except I'm concerned doing this for so many control templates calling back to reference the same storyboard for all of the same instance might produce opposite results of what I'm trying to do. Which is simply to reduce the size/footprint of all the XAML and hopefully even speed things up in the process. Any thoughts welcome, cheers.


title: SQL Server + database design and non mandatory fields

text: I am developing an app which allows a user to upload a maximum of 20 photos, the straight forward way is of course adding 20 columns to my database table but if the user only uploads 1 image, the remaining columns becomes redundant. Anyone can advice me on a more efficient way to design it? Thanks.


title: What can I do without the iPhone SDK and Xcode?

text: I want to develop an iPhone application, I do not have Xcode nor the iPhone SDK (nor a macbook but I plan to buy one). What could be done without those products? Edit: I intend to release it on AppStore (I know I need a mac for it)


title: What kind of software should we write? What technology should we deliver?

text: I like that companies like Twitter and Facebook can push the boundaries of technology. But I wonder, what is the purpose of Twitter and Facebook? Why did they write that software and not something more useful? Do you think developers have some kind of responsibility to work on technology that could further human progress or should they just develop anything that some users want? For example, a bridge engineer or architect build things that may solve a tough problem and maybe there is an explicit need. But no one needs a Facebook account. Note: Some have acknowledged that Twitter and Facebook can be used in emergency situations like with the Japan crisis. But this is after the fact that twitter became popular. I don't think the main purpose of Twitter is to facilitate finding missing people during a crisis.