Is ASP.NET MVC completely (and exclusively) based on conventions?

**\--TL;DR**   * Is there a "Hello World!" ASP.NET MVC tutorial out there that doesn't rely on conventions and "stock" projects?   * Is it even possible to take advantage of the technology without reusing the default file structure, and start from a single "hello_world.asp" file or something (like in PHP)?   * Am I completely mistaken and I should be looking somewhere else, maybe **this**?   * I'm interested in the MVC framework, not Web Forms **\--Background** I've played a bit with PHP in the past, just for fun, and now I'm back to it since web development became relevant for me once again. I'm no professional, but I try to gain as much knowledge and control over the technology I'm working with as possible. I'm using Visual Studio 2012 for C# - my "desktop" language of choice - and since I got the Professional Edition from Dreamspark, the Web Development Tools are available, including ASP.NET MVC 4. I won't touch Web Forms, but the MVC Framework got my attention because the MVC pattern is something I can really relate to, since it provides the control I want **but**... _not quite_. Learning PHP was easy - and right form the start I could just create a "hello_world.php" file and just do something like this for immediate results:               <!-- file: hello_world.php -->     <?php>         echo "Hello World!";     <?>      But I couldn't find a single ASP.NET (MVC) tutorial out there (I'll be sure to buy one of the upcoming MVC 4 books, only a month away or so) that would start like that. They all start with a sample project, building up knowledge from the basics and heavily using conventions as they go along. Which is fine, I suppose, but it's now the best way for me to learn things. Even the "Empty" project template for a new ASP.NET MVC 4 Application in VS2012 is not empty at all: several files and folders are created for you - much like a new C# desktop application project, but with C# I can _in fact_ start from scratch, creating the project structure myself. It is not the case with PHP:   * I can choose from a plethora of different MVC frameworks   * I can just create my own framework   * I can just skip frameworks altogether, and toss random PHP along with my HTML on a single file and make it work I understand the framework needs to establish some rules, but what if I just want to create a single page website with some C# logic behind it? Do I really need to create a whole bloat of files and folders for the sake of convention? Also, please understand that I haven't gotten far on any of those tutorials mainly because of this reason, but, if that's the only way to do it, I'll go for it using one of the books I've mentioned before. This is my first contact with ASP.NET but from the few comparisons I've read, I believe I should stay the hell away from Web Forms. Thank you. (Please forgive the broken English - it is not my primary language.)


How do I easily print number triangles? Using for loops

I know how for loops work and what a nested loop is but I get very frustrated while printing those number or asterisk triangles in java. It makes me wanna quit learning programming :( Please someone tell me an easy way to master loops.               for(int i=1;i<7;i++){             for(int j=1;j<i;j++){                 System.out.print(j);             }             System.out.println();         }      i want to add a mirror image of this triangle before itself.


What is the accepted style for using the `this` keyword in Java?

I come from languages like Python or Javascript (and others that are less object-oriented) and I am trying to improve my working knowledge of Java, which I know only in a superficial way. Is it considered a bad practice to always prepend `this` to the current instance attributes? It feels more natural to me to write               ...     private String foo;          public void printFoo() {         System.out.println(this.foo);     }     ...      than               ...     private String foo;          public void printFoo() {         System.out.println(foo);     }     ...      as it helps me to distinguish instance attributes from local variables. Of course in a language like Javascript it makes more sense to always use `this`, since one can have more function nesting, hence local variables coming from larger scopes. In Java, as far as I understand, no nesting like this is possible (except for inner classes), so probably it is not a big issue. In any case, I would prefer to use `this`. Would it feel weird and not idiomatic?


Algorithmic problem - quickly finding all #'s where value %x is some given value

Problem I'm trying to solve, apologies in advance for the length: Given a large number of stored records, each with a unique (String) field S. I'd like to be able to find through an indexed query all records where Hash(S) % N == K for any arbitrary N, K (e.g. given a million strings, find all strings where HashCode(s) % 17 = 5. Is there some way of memoizing this so that we can quickly answer any question of this form without doing the % on every value? The motivation for this is a system of N distributed nodes, where each record has to be assigned to at least one node. The nodes are numbered 0 - (K-1) , and each node has to load up all of the records that match it's number: If we have 3 nodes   * Node 0 loads all records where Hash % 3 ==0   * Node 1 loads all records where Hash % 3 ==1   * Node 2 loads all records where Hash % 3 ==2 adding a 4th node, obviously all the assignments have to be recomputed -   * Node 0 loads all records where Hash % 4 ==0   * ...    * etc I'd like to easily find these records through an indexed query without having to compute the mod individually. The best I've been able to come up with so far: If we take the prime factors of N (p1 * p2 * ... ) if N % M == I then p % M == I % p for all of N's prime factors e.g. 10 nodes : N % 10 == 6 then   * N % 2 = 0 == 6 %2    * N % 5 = 1 == 6 %5 so storing an array of the "%" of N for the first "reasonable" number of primes for my data set should be helpful. For example in the above example we store the hash and the primes _HASH_ _PRIMES (array of %2, %3, %5, %7, ... ])_ 16 [0 1 1 2 .. ] so looking for N%10 == 6 is equivalent to looking for all values where array[1]==1 and array[2] == 1. However, this breaks at the first prime larger than the highest number I'm storing in the factor table. Is there a better way?


Is it possible to get a job in a high-demand company without having hobby projects?

I was curious if the recruitment team at high-demand companies such as Google takes a lack of hobby projects into consideration when evaluating candidates. I'm a straight 40 hour/week programmer, who is lucky to spend an hour or two a month outside of work on anything programming related. I love hanging out on SO/SE during my breaks at work, and love answering questions, but after work I leave the programming world and go back to my life. I already understand that you don't need hobby projects to be a good programmer, but does this lack of hobby projects affect my chances getting a job at a company that always has a long list of candidates trying to get in?


Differences between imperative-language and functional-language debuggers

Up to now I have always worked with imperative languages like Pascal, C, C++, Java in a production environment, so I have experience with debuggers for these languages (Turbo Pascal, Turbo C, GDB / DDD, Visual Studio, Eclipse). A debugger for an imperative language normally allows to   * Set break points on statements, and execute the program until the next break point is encountered.   * Execute the program one statement at a time, with the option of entering a function / method call or skipping over to the following statement. When program execution is paused, one can examine the current state of the program, i.e.:   * Inspect the contents of the stack to see the current nesting of function calls.   * Inspect local variables, actual function parameters, global variables, and so on. Since I have never worked with a functional programming language in a production environment, I was trying to figure out how a debugger for such a language would look like. For example:   * How does the debugger walk through the program if there are no statements like in an imperative language? Where does one set break points?   * In a language with lazy evaluation like Haskell, the sequence of function calls can be different from that of an eager language: will this make a big difference when trying to understand the call stack?   * What about variables? Since there is no state, I imagine that a debugger will only show the variable bindings for the current scope (?), i.e. there will be no local or global variables changing value as I step through the program. Summarizing, are there any general, common features of functional-language debuggers that clearly distinguish them from imperative-language debuggers?


Is it possible for a good programmer to have never used version control?

I am looking for an expert programmer to help solve a difficult situation. The interviews so far have been surprisingly disappointing. The best candidate so far is a very experienced programmer who has never used version control software. The problem in itself might not be too serious because it is something which can be learned in a short time. But there is a deeper aspect, which worries me: How is it possible to actively develop software for 10-15 years without ever needing version control? Is the fact itself of not looking for a solution to the problem of tracking changes a sign of a wrong attitude to programming?


Multiple Quartz scheduler for different Applications in a same schema?

Currently I've defined a specific quartz scheduler for all of my applications in a same schema with same tables. Also, there is a specific trigger for all of them. Everything is fine after running two applications. But when I run third and forth application I've got this warning, and quartz job isn't called for third and forth application.               Application A -> Scheduler A -> Trigger 1      Application B -> Scheduler A -> Trigger 1     Application C -> Scheduler A -> Trigger 1     Application D -> Scheduler A -> Trigger 1 and Trigger 2      `2014-02-11 13:56:13,465 [QuartzScheduler_QuartzJobCluster-1APP381392087198304_ClusterManager] WARN jdbcjobstore.JobStoreTX - This scheduler instance (1APP381392087198304) is still active but was recovered by another instance in the cluster. This may cause inconsistent behavior.` Now I want to use different scheduler's instance for each application with specific trigger in a same schema. So,I like to know is that correct to use a **same schema and tables** for all of the applications or I should use different schema for them? Does any one know what's the best practice for this situation? Also, the forth application has two triggers. The second one is different with others.               Application A -> Scheduler A -> Trigger 1      Application B -> Scheduler B -> Trigger 1     Application C -> Scheduler C -> Trigger 1     Application D -> Scheduler D -> Trigger 1 and Trigger 2


What programming languages are well suited for developing a live coding framework?

I would like to build a "live coding framework". I should explain what is meant by "live coding framework". I'll do so by comparing live coding to traditional coding. Generally put, in traditional programming you write code, sometimes compile it, then launch an executable or open a script in some sort of interpreter. If you want to modify your application you must repeat this process. A live coding framework enables code to be updated while the application is running and reloaded on demand. Perhaps this reloading happens each time a file containing code is changed or by some other action. Changes in the code are then reflected in the application as it is running. There is no need to close the program, to recompile and relaunch it. In this case, the application is a windowed app that has an update/draw loop, is most likely using OpenGL for graphics, an audio library for sound processing ( SuperCollider? ) and ideally a networking lib. Of course I have preferred languages, though I'm not certain that any of them would be well suited for this kind of architecture. Ideally I would use Python, Lua, Ruby or another higher level language. However, a friend recently suggested Clojure as a possibility, so I am considering it as well. **I would like to know not only what languages would be suitable for this kind of framework but, generally, what language features would make a framework such as this possible.**


TDD vs. Productivity

In my current project (a game, in C++), I decided that I would use Test Driven Development 100% during development. In terms of code quality, this has been great. My code has never been so well designed or so bug-free. I don't cringe when viewing code I wrote a year ago at the start of the project, and I have gained a much better sense for how to structure things, not only to be more easily testable, but to be simpler to implement and use. However... it has been a year since I started the project. Granted, I can only work on it in my spare time, but TDD is still slowing me down considerably compared to what I'm used to. I read that the slower development speed gets better over time, and I definitely do think up tests a lot more easily than I used to, but I've been at it for a year now and I'm still working at a snail's pace. Each time I think about the next step that needs work, I have to stop every time and think about how I would write a test for it, to allow me to write the actual code. I'll sometimes get stuck for hours, knowing exactly what code I want to write, but not knowing how to break it down finely enough to fully cover it with tests. Other times, I'll quickly think up a dozen tests, and spend an hour writing tests to cover a tiny piece of real code that would have otherwise taken a few minutes to write. Or, after finishing the 50th test to cover a particular entity in the game and all aspects of it's creation and usage, I look at my to-do list and see the next entity to be coded, and cringe in horror at the thought of writing another 50 similar tests to get it implemented. It's gotten to the point that, looking over the progress of the last year, I'm considering abandoning TDD for the sake of "getting the damn project finished". However, giving up the code quality that came with it is not something I'm looking forward to. I'm afraid that if I stop writing tests, then I'll slip out of the habit of making the code so modular and testable. Am I perhaps doing something wrong to still be so slow at this? Are there alternatives that speed up productivity without completely losing the benefits? TAD? Less test coverage? How do other people survive TDD without killing all productivity and motivation?


Beta-testing app good practice

I have just released an iOS app for beta-testing with TestFlight. I'm wondering what is good practice during beta-testing?   * Should I halt development of the app during beta-testing?   * Should I continue developing but make a snapshot image of what the code looked like when it was released for beta-testing?   * Issues that could rise that I can think of is that if I make any changes to the code and then a bug is detected in the code that I have changed this would not be ideal. There are probably other issues to deal with but these are the ones that I could think of at the moment. I'm the only developer of the app at the moment.


Am I covered with GPL If I want to create a derived work from a GPLv2 project and change the project name?

Recently I create a fork from an "open source project GPLv2" with different name. I make a major changes in source code and I gave a new name to the modified open source. I kept in the header of each source file the origin author copyright. And then I publish my new open source in github. is this behavior is legal according to GPLv2 License statements ? do I have the right to change the name of the modified open source ? Could you please provide justification from licenses with the answer.


CoffeeScript and Named Functions

Elsewhere: an argument has arisen over the terminology of a named function in CoffeeScript. In particular somebody refereed to something like this                foo = ->         console.log("bar")      as a named function. But its been objected that everything in CoffeeScript is anonymous functions and there are no named functions. This is certainly true, CoffeeScript only has function expressions which can then be stored in a variable. But I don't think that means it is wrong to call this a named function. As I see it, it is a named function because its a function that has been given a name. True, its not a named function in the same way that some other languages have named functions, but I think its close enough that its not inappropriate to call it a named function. To insist otherwise just seems to be nitpicking. Am I out to lunch in thinking that insisting that this isn't a named function is just nitpicking?


Fair 2-combinations

I need to fairly assign 2 experts from `x` experts (`x` is rather small - less than 50) for every `n` applications, so that:   * each expert has the same number of applications (+-1);   * each pair of experts (2-combination of `x`) has the same number of applications (+-1); It is simple to generate all 2-combinations:               for (i=0; i<n; i++) {       for (j=i+1; j<n; j++) {         combinations.append(tuple(i,j));       }     }      But to assign experts fairly I need to assign a combination to an application i correct order, for example:               experts: 0 1 2 3 4          fair combinations:          counts          01234          01   11000     23   11110     04   21111     12   22211     34   22222     02   32322     13   33332     14   34333     03   44343     24   44444      I'm unable to come up with a good algorithm for this (the best I came up with is rather complicated and with `O(x4)` complexity). Could you help me?


Way for store User recent playlist in database

Every time when user hears one music on system, the system stores this music to recent list, but I am afraid to pass over than decimal(19,0) limit in future. If I do Reseed I will get some problems insert invalid duplicate pirmary keys, but if I reallocate all id's it is possible. Is there a better way for that? With possibility to clean the jump of id (55-60) without future headache with Primary key overflow? Note: I can limit this list for `255(smallint)` maybe, but I want evade use same id`s.


Best OOP design pattern for a sequence of operations

I am working on an application, a module of which does the following financial operations sequentially: When a user requests for a certain amount to be transferred into her bank account:   1. check whether any transaction can happen now? (transaction can be carried out only during a certain time period)   2. check whether the user has requested for a minimum amount to be withdrawn   3. check whether the user has any default account The result of all the above actions should be logged. If all the above condition satisfies, the transaction is carried out. In future, there might be some additional checks. Which object oriented design pattern should be best suitable for the above case?


setSoftInputMode versus InputMethodManager

I have seen and used both of the methods to hide the on screen keyboard while coding Android:               getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);      and:               InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);     imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0);      I have read through the documentation for both and I am still unclear as to how each is different, the same, which is a better method or practice to use, and which one should be used in which situations. Here is an excerpt from the `.setSoftInputMode` documentation: > Specify an explicit soft input mode to use for the window, as per > WindowManager.LayoutParams.softInputMode. Providing anything besides > "unspecified" here will override the input mode the window would normally > retrieve from its theme. And here is an excerpt from the `InputMethodManager` documentation that seems to say nearly the same thing: > You can also control the preferred soft input state (open, closed, etc) for > your window using the same windowSoftInputMode attribute. > > More finer-grained control is available through the APIs here to directly > interact with the IMF and its IME -- either showing or hiding the input > area, letting the user pick an input method, etc. So what is the difference in these two options to hide the Android soft keyboard, and does one have a benefit over the other? Is one more efficient? What are specific uses for each?


how do early stage startups hire ninja programmers

I am programmer who just started working on a startup idea. At the moment I want to bring onboard at least one programmer. This programmer should be a ninja - a 10x engineer. Since early days are probably the most risky for a startup, I want to make sure I approach this problem the best I can. How do I find these people? and How do I convince them to come onboard? I would love to hear from people who started their own companies and what their thoughts are about hiring **Update** : I would like to get the ninja as a co-founder so besides being a ninja (ie. great programmer with computer science background) he/she has to have a healthy appetite for risk (for great programmers this is not a big deal because they can be hired anytime into mainstream jobs if the startup doesn't work)


How do you organize your usability testings?

* What is your process?   * How do you get feedback?   * What software do you use? (like Morae from TechSmith)   * Who does them?   * Have you measured how it positively affected the quality of your software? I'm looking for your experience on the subject. This is something I want to improve.


sqlite trigger or application event?

I've have two event queues(table mapped queues) based on two different states of same data stored in two different tables. The events are generated on create/update/delete on both the tables. Constrain is that both the tables have to be in sync. The create/update/delete in one table has to be reflected into other table. So the question is that should i use trigger to queue events in table or application/object to queue events in table? and Why? Note:   1. Update on either is capable of generating 3 different types of events. So on application layer extra diff logic would be required to generate correct event.   2. The Negative thing in trigger is that it will introduce duplicate events from both sides. i.e. if some event is processed on one table it will create an event for processing on other table.


Do you think natively compiled languages have reached their EOL?

If we look at the major programming languages in use today it is pretty noticeable that the vast majority of them are, in fact, interpreted. Looking at the largest piece of the pie we have Java and C# which are both enterprise-ready, heavy-duty, serious programming languages which are basically compiled to byte-code only to be interpreted by their respective VMs (the JVM and the CLR). If we look at scripting languages, we have Perl, Python, Ruby and Lua which are all interpreted (either from code or from bytecode - and yes, it should be noted that they are absolutely not the same). Looking at compiled languages we have C which is nowadays used in embedded and low-level, real-time environments, and C++ which is still alive and kicking, when you want to get down to serious programming as close to the hardware as you can, but still have some nice abstractions to help you with day to day tasks. Basically, there is no **real** runner-up compiled language in the distance. Do you feel that languages which are _natively_ compiled to executable, binary code are a thing of the past, taken over by interpreted languages which are much more portable and compatible? Does C++ mark an end of an era? Why don't we see any new compiled languages anymore? * * * **I think I should clarify:** I do not want this to turn into a "which language is better" discussion, because that is not the issue at hand. The languages I gave as example are only examples. Please focus on the question I raised, and if you disagree with my statement that compiled languages are less frequent these days, that is totally fine, I am more than happy to be proved mistaken.


Is software better designed and developed by people who will use it?

I see many apps written by programmers who obviously don't use the program like the end customers in a production environment. This results in features that don't really make sense in practice, inferior ways of doing things, half- baked functionality, bad workflow, many tools doing similar things, etc. But on the other hand, in rare cases you see the same end customers making similar apps in an effort to overcome these shortcomings, and they might not be as sophisticated code-wise as the ones written by programmers but they work much better and feel like it's written by someone who uses the program professionally just like the end customers. So is software better designed and developed by people who will use it, people who have intrinsic knowledge of the domain the program will serve in?


What advantages does TFS have over Tortoise SVN in this scenario?

This is neither a Holy War invocation nor is it http://stackoverflow.com/questions/661389/tfs-vs-svn \- This question is much more specific and would potentially make a team of developers very happy: I used an earlier version of TFS for two years but I have not used it for years. What advantages does it have over Tortoise SVN? For example, does the merging work seemlessly or does it involve a lot of manual work; and does the shelving actually work (we could not get it working)? The Platform is Windows (does TFS run on anything else) and the intended use is version control through Visual Studio 2008 / 2010 with the scope for Continuous Integration on x86 or 64bit build servers (depending on the product). There would any ever be one develop stream per product. Projects would typically last less than two weeks (large pieces of work would be broken down into these discrete chunks of this size). The maximum team size to work simultaneously on a product would be less than six developers. Checkins on a branch would occur at any time (only explicit rule is that it builds). Merges back into the trunk (head) occur after project completion. Running a TFS trial is likely to be costly to a business. Therefore, I have asked the question on here. I want to hear answers from those who already know (as well as those who anticipate pitfalls). There is no point reinventing the wheel. It makes no sense to incur unnecessarly research costs. To reiterate: my major concern is merging. I know SVN Tortoise works (it has a few quirks around ASP.Net .csproj files but I can live with that) but TFS is supposed to have a great deal of features. I want the best deal for the devs.


0x9e3779b9 golden number

i'm trying to understand a constant 0x9e3779b9 what kind of data is this? it's not binary, not decimal, what is this? it's a constant used on the TEA algorithm it says it's derived from the golden number but the golden number is 1.618?


Best practice to save data in different databases using C# ADO.NET

I would like to know if you guys have any best practice when dealing with transaction between different databases vendors. For example, if you have a C# application that save customer data in two databases (one Oracle and the other Microsoft), what would you do? Would you use OleDbTransaction? Is it possible?


How exactly is an Abstract Syntax Tree created?

I think I understand the goal of an AST, and I've built a couple of tree structures before, but never an AST. I'm mostly confused because the nodes are text and not number, so I can't think of a nice way to input a token/string as I'm parsing some code. For example, when I looked at diagrams of AST's, the variable and its value were leaf nodes to an equal sign. This makes perfect sense to me, but how would I go about implementing this? I guess I can do it case by case, so that when I stumble upon an "=" I use that as a node, and add the value parsed before the "=" as the leaf. It just seems wrong, because I'd probably have to make cases for tons and tons of things, depending on the syntax. And then I came upon another problem, how is the tree traversed? Do I go all the way down the height, and go back up a node when I hit the bottom, and do the same for it's neighbor? I've seen tons of diagrams on ASTs, but I couldn't find a fairly simple example of one in code, which would probably help.


What is the main difference between HAS_MANY and BELONGS TO relationship in mysql?

After making little progress in web development and php I figured out if I can make my grip strong on database designing, I will be able to reduce much code and time in developing the application. But I happen to be a dumb in database designing so can anyone please help to differentiate between has many and belongs to relationship. They seems quite same to me


I've been programming in one language for many years. Is this career suicide?

I have been programming in the same Object Oriented Programming language for many years (Windows-based). The problem is this particular language is not very popular, and not one of the hottest ones in demand in job postings and such. Should I be worried? Would a Java employer understand that I'm a programmer and can pick up any language in a matter of a week or two, or would they be under the impression that since I haven't programmed in their specific language professionally, then I'm just not qualified? PS. As far as learning, I do play around with different technologies at home. But at work, I'm pretty much stuck with the same language.


What is the term for a really BIG source code commit?

Sometimes when we check the commit history of a software, we may see that there are a few commits that are really BIG - they may change 10 or 20 files with hundreds of changed source code lines (delta). I remember that there is a commonly used term for such BIG commit but I can't recall exactly what that term is. Can anyone help me? What is the term that programmers usually use to refer to such BIG and giant commit? BTW, is committing a lot of changes all together a good practice? UPDATE: thank you guys for the inspiring discussion! But I think "code bomb" is the term that I'm looking for.


Why is putting something on the stack called "push"?

According to http://dictionary.reference.com > push > > verb (used with object) > >   1. to press upon or against (a thing) with force in order to move it away. > >   2. to move (something) in a specified way by exerting force; shove; drive: > _to push something aside; to push the door open_. > >   3. to effect or accomplish by thrusting obstacles aside: _to push one's > way through the crowd._ > >   4. to cause to extend or project; thrust. > >   5. to press or urge to some action or course: _His mother pushed him to > get a job._ > > This IMO fits to FIFO queues. Is there an explanation for this?


chat/game server best way to implement, is WCF the way to go?

I'm creating a game on wp7 and it will be an online game played between a max of 4 players. The game will be a turn based game. My question really is what is the best way to do this server wise? is WCF the way to go? The following is information transferred to and from the server from each player.   * Player Chat message   * Chat message from other players.   * Players points from game.   * Picture sent to each player for start of game


websites that show real world scenarios for OOP beginners so that they can implement them

Since programmers learn more by implementing the real world scenarios rather then by gaining theoretical knowledge and concepts about programming, I wanted to know that is there any website that tells about real world scenarios for OOP learners so that they can practice their designing skills and implement these scenarios using c#? Like which can help them making designing decisions for a problem for e.g in which scenario one should use abstract classes, interfaces, virtual overriding etc.


improving IM communication skills

I am an email person, but found that at my new job, co-workers use IM a lot. I have to admit that I have been largely ignoring the IM/SMS as a way of communication by thinking it is only for teenagers... The IM-style of communication is quite different from emailing. The sentences are shorter and there is less time for a response. So when I chat with someone, more often than not, I feel that I lag with the answer and then I just pick up the phone - and the conversation usually last minutes ... which plainly defeats the idea of the "instant" communication. Are there some recommendations that I can follow to improve my IM communication skills?


How much data should exceptions hold?

Almost all the exceptions I have ever written have been very lightweight, containing a String message and optionally a throwable. In some situations I have included some application specific enum or some other field.               public class MySpecialException()     {         private MyErrorCode errorCode;              public MySpecialException(String message, Throwable cause, MyErrorCode errorCode)         {             super(message, cause);             this.errorCode = errorCode;         }              ....     }      Now I face a situation where I need to put in 5 or 6 fields in the exception because the error handler that catches them needs them to generate the output. Would you consider that to be bad code? Can an exception be too big?               public class MySpecialException()     {         private String name;         private int age;         private int id;         private int height;         private String duck;         private String whatever;              ....     }


What do you as developers think of a marketplace for PC apps?

I just wanted to get some honest opinions from developers about the prospect of a marketplace/app store for the PC? Would you build apps for it? Examples are silverlightmarket.com, allmyapps.com etc etc... Cheers, Ash.


When was source control invented?

I'm aware of many version control systems: CVS, SVN, TFS etc... I've googled for the very first "revision control/version control system" and seen various conflicting answers. When was source control invented? Who invented it? What was it called?


Why does EL have such low visibility?

Use of EL in JSP's is the proper way to code logic according to the Sun tutorials and samples, which also recommend against the use of Java scriptlets. Yet searching job listings for EL | "expression language" in the SF bay area on craigslist yields 0 hits (vs 144 for jsp, 8 for jstl and 678 for java. this is searching ad text not the titles) so it doesn't seem to be a skill of interest. Also 0 hits on programmers on the topic and I had to create a new tag ;-) What's good or bad about EL and why the low interest? As a java technology you would expect a lot more.


COBOL & Mainframe & Business

I have made a search on a Hong Kong job seeking website. There numerous of jobs titled "Computer Analyst". These are the requirements of the job:               Over 3 year experience relevant working experience in IBM Mainframe environment.     University degree in Computer Subject.     Proficient in system analysis, design and coding for the banking systems.     Application knowledge of Core banking and Card applications is definitely an advantage.     Sound in using IBM CICS/COBOL, and VSAM for both online and batch application systems.     Good communication skills with internal users.      Quite a number of jobs are similar: They requires candidates to have the following qualities:   * Computer Subjects especially Computer Science   * 3 years above experience   * IBM Mainframe COBOL   * Proficiency Then it comes to my question:   1. It makes it hard for new programmers to enter the industry. How should someone enter the industry, i.e. making him/herself suitable for this kind of position?    2. Do they still want new programmers in this field?   3. How should one learn to operate IBM Mainframe(Or any kind of Mainframe)?   4. Is knowledge in finance required or crucial?


Should we leave our contact details in source code?

I usually leave my email address as a courtesy in case someone wants to ask me a question about it later. Do other people leave more or less information than that? Does anyone leave a phone number??


Functional reactive programming — is Fay expressive enough?

> So I'm doing a fairly involved javascript/html client with lots of ajax > calls and other involvements of callback-ism. I'm entertaining the thought > of using Fay for this purpose. I'm aware of Elm. Tried it and liked the FRP > elements. Now I'm looking to know if similar structure is possible in Fay. > > Are there any concrete examples of FRP in Fay out there at this point? This question was migrated from SO due to not adhering to its intended format. Since it got some upvotes there I thought I could move it. I wont be doing FRP with my current code for now but I'm interested for future reference. Some relevant technologies:   * Arrowlets, arrowised FRP in javascript   * FlapJax, another javascript alternative   * Bacon.js, FRP in javascript One possible solution, using Bacon. With demo.


Can you claim that your product is fit for purpose when it uses OSS software which does not guarantee it?

I am working on a product for a client that must be valid and fit for purpose. It's built on a LAMP stack (PHP/Cake), so there's GPL, MIT, PHP, APACHE licenses: > "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express > or implied, including, without limitation, any warranties or conditions of > TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or **FITNESS FOR A PARTICULAR > PURPOSE**. You are solely responsible for determining the appropriateness of > using or redistributing the Work and assume any risks associated with Your > exercise of permissions under this License. My rationale that my product is valid and fit for purposes:   * The signed UAT doc proves validity and fitness for purpose.    * The stack is so widely used by developers, industry and end users (netcraft, gartner etc. stats), that there is a consensus that it IS fit for purpose. (ie we can disregard the fitness for purpose statement in the warranty disclaimer to an extent) Is this a valid point? Can I make claims that my software is fit for purpose?


Why is there a decline in CS majors?

Although I've read on various websites until 2007-2008 that CS majors in decline, I don't understand why--I haven't entered the job market yet. Bruce Webster has an excellent chart regarding the topic: http://brucefwebster.com/2008/03/05/the-decline-in-computer-science-students/ What are some factors that lead to this decline? Is there still deficient amount of graduates? Are more people just skipping higher education altogether to get inside the industry? Does a "Software Design" major exit now? So many questions.


Can a pure-functional solution to this problem be as clean as the imperative?

I have an exercise in Python as follows:   * a polynomial is given as a tuple of coefficients such that the powers are determined by the indexes, e.g.: (9,7,5) means 9 + 7*x + 5*x^2   * write a function to compute its value for given x Since I am into functional programming lately, I wrote               def evaluate1(poly, x):       coeff = 0       power = 1       return reduce(lambda accu,pair : accu + pair[coeff] * x**pair[power],                     map(lambda x,y:(x,y), poly, range(len(poly))),                     0)      which I deem unreadable, so I wrote               def evaluate2(poly, x):       power = 0       result = 1       return reduce(lambda accu,coeff : (accu[power]+1, accu[result] + coeff * x**accu[power]),                     poly,                     (0,0)                    )[result]      which is at least as unreadable, so I wrote               def evaluate3(poly, x):       return poly[0]+x*evaluate(poly[1:],x) if len(poly)>0 else 0      which might be less efficient (edit: I was wrong!) since it uses many multiplications instead of exponentiation, in principle, I do not care about measurements here (edit: How silly of me! Measuring would have pointed out my misconception!) and still not as readable (arguably) as the iterative solution:               def evaluate4(poly, x):       result = 0       for i in range(0,len(poly)):           result += poly[i] * x**i       return result      Is there a pure-functional solution as readable as the imperative and close to it in efficiency? Admittedly, a representation change would help, but this was given by the exercise. Can be Haskell or Lisp aswell, not just Python.


eCommerce use case: removing a product

I am starting to design the database schema for the eCommerce element of a web service I am creating. The thing I'm trying to get my head around is how to deal with the use case of a seller (user of my web service) deleting a product. The issue I have is that this product could be referenced in a customers basket, to be paid orders, pending orders, deliveries, past orders etc... This problem is surely one that everyone developing such a system has come across. I'm just wondering if there is a best practice way to address it? Can it be addressed at the database schema level? Or maybe it just requires certain validation checks on database data before allowing a product to be deleted, or to stop an error if a customer is trying to pay for an order that had a reference to a product, but that reference has been deleted (i.e. product was deleted).


Naming methods that do the same thing but return different types

Let's assume that I'm extending a graphical file chooser class (`JFileChooser`). This class has methods which display the file chooser dialog and return a status signature in the form of an `int`: `APPROVE_OPTION` if the user selects a file and hits _Open_ / _Save_ , `CANCEL_OPTION` if the user hits _Cancel_ , and `ERROR_OPTION` if something goes wrong. These methods are called `showDialog()`. I find this cumbersome, so I decide to make another method that returns a `File` object: in the case of `APPROVE_OPTION`, it returns the file selected by the user; otherwise, it returns `null`. This is where I run into a problem: would it be okay for me to keep the `showDialog()` name, even though methods with that name — **and a different return type** — already exist? To top it off, my method takes an additional parameter: a `File` which denotes in which directory the file chooser should start. My question to you: Is it okay to call a method the same name as a superclass method if they return different types? Or would that be confusing to API users? (If so, what other name could I use?) Alternatively, should I keep the name and change the return type so it matches that of the other methods?               public int showDialog(Component parent, String approveButtonText) // Superclass method     public File showDialog(Component parent, File location) // My method


generic programming, how often is it used in industry

I do programming in an academic setting at the moment, so I can use whatever I want. I'm using the boost graph library for a few things, and I'm wondering whether investing effort in understanding GP more deeply is worth it. I'm curious - is generic programming (GP) used much in industry? My guess is that most programmers are much more comfortable with OOP or are using languages that don't emphasize or support GP, so that outside of calling STL data structures/functions in C++, my impression is that GP isn't used all that frequently in practice. But, being outside industry at the moment, it'd be nice to hear from practitioners on this. (as I'm writing this, I see that generic-programming isn't even a valid tag!)


best practices for testing backbone.js apps with jasmine?

I've recently started using jasmine to do javascript unit testing. loving it so far. one of the projects i'm working on is a plugin for backbone.js. since backbone is an mvc style framework for javascript, a lot of what it does is view manipulation - typically through jquery. my plugin is no exception to this. i have several things being manipulated in html elements, through backbone views. right now, i am doing what might be some awful stuff to make this worth with jasmine. here's an example of how i'm laying out my tests:               describe("conventionBindings", function(){       beforeEach(function(){         this.model = new AModel({name: "Some Name"});         this.view = new AView({model: this.model});         this.view.render();       });            afterEach(function(){         this.view.close();       });            describe("... that thing it does ... ", function(){         it("... stuff .... ", function(){         });       });     });      The important bits here, are the beforeEach and afterEach. notice that i'm calling my view's render method, and then my view's close method. here's what those methods do:               AView = Backbone.View.extend({       render: function(){         this.html = $("");         $("body").append(this.html);       },            close: function(){         this.html.remove();       }     });      i'm specifically adding this "close" method to my view for the tests, because if i don't, then the jasmine page that i'm viewing when i run the jasmine test server would show the inputs that i've appended to the body of the page. so... here's my questions: is this a horrible thing to be doing? should i be testing my views and html element manipulations in some way other than appending elements to the body of the page? right now i don't have a need to run these tests in any kind of CI server, but if i do, what kind of problems will i run into? how can i write better jasmine tests, so that i can test my backbone plugin in a CI server, knowing that the plugin has to manipulate html elements during the test?


OpenID and data espionage

This answer[link] to another question here talks about OpenID and data espionage. I quote: > [Data espionage] Why let them gather the detailed statistics from many > consumer site and help them build personal profiles of people? Who knows > what they'll do with it? Sell it, use it to adjust their marketing tactics, > submit it to CIA? This has been also a concern of mine. If you use Yahoo, Yahoo now has a track of all the sites you went to (and signed with your OpenID). I'm wondering if this issue has been addressed more thoroughly. I think we here are the best people to have this discussion, because we're unbiased developers who don't get paid by OpenID or any provider (Yahoo, Google, etc.). What do you think about this?


Issues with time slicing

I was trying to see the effect of time slicing, and how it can consume significant amount of time. Actually, I was trying to divide a certain task into a number of threads and see the effect. I have a two core processor. So two threads can run in parallel. I was trying to see if I have a task `w` that is done by 2 threads, and if I have the same task executed by `t` threads with each thread doing `w/t` of the task. How much does time slicing play a role in it. As time slicing is time consuming process, I was expecting that when I do the same task using a two thread process or by a `t` thread process, the amount of time taken by the `t` thread process will be more. Any suggestions?


Does waterfall require code complete before QA steps in?

The process used at a certain company consists of: >   1. Create a layout according to some designs made in a web page design > tool. (CSS, html) >   2. Requirements come in with "functional requirements". These consist of > 100's of lines of business directions. E.G. Create a Table on page X. > Column1 has numeric data. Column1 is the client code. Column2 is a > string...etc. > >   3. Write code to meet all functional requirements. > >   4. When all code is checked in, send to QA (which is the BA that wrote the > requirements) for inspection, bug finds and change requests. >   5. Punt back to developer with a list of X bugs and Y change requests. >   6. While bug finds or change requests > 0 go to step 4. > The agile development environments I have worked in allow, if not demand, early QA inspection and early user acceptance. So, pieces of the program can be refined and redefined before the entire application is in place. Not only that, but the process leaves little room for error or people changing their minds. Instead, those "change requests" come in at the last stage when they do the most damage. And being that a bug-fix's cost increases over time, this is a costly way to write code. I am no waterfall expert. As described, is this waterfall being mishandled in some way? How does waterfall address my concerns?


Modern web application development! Is flash and silverlight still relevant?

When building an application one considers the appropriate technology of choice for best long term impact and scalability. If building a media streaming application for mobile and desktop should one still use flash or silverlight, or html5 and javascript? How does one select the right technology?


Is it a bad design to specify default bindings when using Inversion of Control (IOC) containers and dependency injection (DI)?

I'm using Ninject, but this is not a Ninject-specific question. I'm wondering if the advanced and flexible capabilities of the IoC container are giving me enough rope to hang myself with a bad application design. I've got a service interface:               public interface IBuilderService {         IBuilder Create(string category, string clientID);     }      and I lean on Ninject Factory Extension's `ToFactory()` to create what I'd guess you'd call a proxy implementation at runtime. I have `IBuilder` bindings like this:               kernel.Bind<IBuilder>().To<NullObjectBuilder>(); // for unbound categories     kernel.Bind<IBuilder>().To<CatOneBuilder>();     kernel.Bind<IBuilder>().To<CatTwoBuilder>();     kernel.Bind<IBuilder>().To<CatThreeBuilder>();     kernel.Bind<IBuilder>().To<CatOneBuilder_ClientA>();     kernel.Bind<IBuilder>().To<CatOneBuilder_DefaultClient>(); // for unbound clients     // etc...      I've been experimenting with custom instance providers and binding generators with Ninject (I'm guessing other IoC containers may have similar constructs for overriding basic binding behavior), but I have **two distinct binding scenario goals** :   1. if a **category** of binding cannot be resolved from the `IBuilderService.Create` `category` argument, then a `NullObjectBuilder` should be resolved - this is the _default_ binding in this case.   2. if a **clientID** of a binding cannot be resolved, then a default client implementation like `CatOneBuilder_DefaultClient` for a `category` of `CatOne` should be resolved - this is the _default_ binding in this case. This is a situation where unknown category requests **are expected** , so it seems a shame to use expensive exception handling for something I know will happen very often. I want there to be fallback behavior to " _handle the unhandled_ " in a very plain way - in this case, it would be the `NullObjectBulder` for unknown categories, and `*_DefaultClient` for _unknown clients_ of _known categories_ \- two distinct fallback behaviors for two different _types_ of unknown behavior. I'm having trouble keeping the two fallback behaviors mapped to their respective scenarios, but it's given me pause to think about the friction I'm feeling in fleshing out this design… Is it a flawed design to have _default_ bindings and the logic used to determine when one is needed contained in IoC custom implementations, rather than an exception being thrown? Is this a mis-use of IoC containers?


How should I incorporate a hotfix back into a feature branch using gitflow?

I've started using gitflow for a project, and I have an outstanding feature branch as well as a newly created hotfix. Per the gitflow workflow, the hotfix gets applied to both the _master_ and _develop_ branches, but nothing is said or done about extant feature branches. Nevertheless, I'd like to incorporate the hotfix changes back into my feature branch, which as near as I can tell leaves three options:   1. Don't incorporate the changes. If the changes were needed for the feature branch, it should've been part of the feature branch.   2. Merge _develop_ back into the feature branch. This seems to follow the gitflow workflow the best, but would cause out-of-order commits.    3. Rebase the feature branch onto _develop_. This would preserve commit order but rebasing seems to be completely absent from the general gitflow workflow. What's the best practice here?


Single codebase for client and server with Node.js

There are a few claimed benefits to Node.js that I typically hear. Some (many?) I agree with. There is one that I completely do not understand, which is the one language argument: "You can now use one language on both the client side and the server side." This does not make sense to me on many levels:   1. most people already know more than one language, and learning a second is anyway not that big of a deal.   2. JavaScript is not that great of a language; if people had any choice they'd probably choose something else on the client side, but they're locked in.   3. the beauty of the server side is you can choose ANY language (so it makes sense to choose the best, most capable language, with the least baggage). The only reasonable argument I've heard is "if I'm using backbone I can re-use my models". Since I haven't used backbone myself I'm not sure how much that actually amounts too however. Can someone shed some light?


Functional programming readability

I'm curious about this because I recall before learning any functional languages, I thought them all horribly, awfully, terribly unreadable. Now that I know Haskell and f#, I find it takes a little longer to read less code, but that little code does far more than an equivalent amount would in an imperative language, so it feels like a net gain and I'm not extremely practiced in functional. Here's my question, I constantly hear from OOP folks that functional style is terribly unreadable. I'm curious if this is the case and I'm deluding myself, or if they took the time to learn a functional language, the whole style would no longer be more unreadable than OOP? Has anybody seen any evidence or got any anecdotes where they saw this go one way or another with frequency enough to possibly say? If writing functionally really is of lower readability then I don't want to keep using it, but I really don't know if that's the case or not..


How do I manage a JavaScript library with TFS?

I know that I can share files between Visual Studio projects using linked files and assemblies using project references. Is there a good approach for JavaScripts? I'd rather not use linked files since it doesn't allow projects to have their own version of the script.


How does it matter if a character is 8 bit or 16 bit or 32 bit

Well, I am reading Programing Windows with MFC, and I came across Unicode and ASCII code characters. I understood the point of using Unicode over ASCII, but what I do not get is how and why is it important to use 8bit/16bit/32bit character? What good does it do to the system? How does the processing of the operating system differ for different bits of character. My question here is, what does it mean to a character when it is a x-bit character?


Anemic domain models - what sort of methods a domain object might need?

This question might seem strange, but it's something I've faced sometimes. I've been trying to adopt DDD, however I'm always facing the problem of anemic domain models. The problem is that when I start to think about what should be the behaviors of the domain objects, nothing comes to mind. I've started then to seek on the internet what should be put inside the behavior of the domain objects and many people say that are rules and validations. The problem is that I've faced the situation many times where to customer who wants the system doesn't want any validation. Once I've asked a customer: "what are the required properties for this object?" and he said "no, I don't want anything like that, sometimes I want to just place one property and leave the others because I'm without time". Then I've asked: "and what sould be the format of data for this property?" and he said "I don't want anything checked, I want to be free to put as I like". So the customer _didn't want_ validation at all, so I coudln't implement it. In that case, there's no validations, there are no rules in place. Then I've looked at the controllers (it was built with MVC) to see if there was any logic specific to the domain entities, and there wasn't any. Just logic to read and write data. So in cases like that, is it a problem to have anemic domain models? Also, I'm working with .NET. In .NET we can put validation with Data Annotations, and we can write getters like properties. So methods to do validation when setting data aren't requireds, because the Data Annotations do the job, also methods to calculate data aren't required, because properties with just a special get can do the job. So what the behaviors become after all?


What is the difference between Avalanche and WaterScrumFall?

Recently I learnt about a new methodology based on waterfall and scrum: Water- Scrum-Fall.   Some say that is the new "reality" and is what scrum pragmatist use nowadays.... But, from the definition of "Avalanche": > The Avalanche model is a Software Engineering project management anti- > pattern, it is a combination of a sequential process such as the Waterfall > model and Agile software development methodologies [...] What do you think about these two models? Aren't those the same? * * * More info:   http://www.infoq.com/news/2011/12/water-scrum-fall-is-the-norm http://www.slideshare.net/harsoft/water-scrumfall-isrealityofagileformost


Need clarification concerning Windows Azure

I basically need some confirmation and clarification concerning Windows Azure with respect to a Silverlight application using RIA Services. In a normal Silverlight app that uses RIA services you have 2 projects:   * App   * App.Web ... where App is the default client-side Silverlight and app.web is the server-side code where your RIA services go. If you create a Windows Azure app and add a WCF Web Services Role, you get:   * App (Azure project)   * App.Services (WCF Services project) In App.Services, you add your RIA DomainService(s). You would then add another project to this solution that would be the client-side Silverlight that accesses the RIA Services in the App.Services project. You then can add the entity model to the App.Services or another project that is referenced by App.Services (if that division is required for unit testing etc.) and connect that entity model to either a SQLServer db or a SQLAzure instance. Is this correct? If not, what is the general 'layout' for building an application with the following tiers:   * UI (Silverlight 4)   * Services (RIA Services)   * Entity/Domain (EF 4)   * Data (SQL Server)


Is knowing .NET only enough for a successful career in IT industry?

> **Possible Duplicate:**   >  Is it better to specialize in a single field I like, or expand into other > fields to broaden my horizons? Recently, I don’t know from where I got a thought in my mind that, “is knowing .NET development environment enough for a successful career in IT industry”. Should I be learning more languages too or will .NET suffice me for next 10-15 years. By successful career I mean earning decent living and having good growth opportunities.


Is it okay to be generalist?

> **Possible Duplicate:**   >  Is it better to specialize in a single field I like, or expand into other > fields to broaden my horizons? I work at a ~50 employee company (UK), where all the technical people do a bit of everything. Specialising in anything for very long (6 months) is discouraged. For example, last week, I built a new Debian webserver, refactored some Perl, sat on a sales phone call, did a tape backup, reviewed code, built and deployed an RPM, gave opinions about x, y, z... With such a work scheme, I have gained a general knowledge how many things work, and pretty specific knowledge. I maybe program for 5 hours a week, despite officially being a developer. Does anyone else work like this, (or is this company unique)? Is it a problem to have skills developed in this way? (i.e. know a bit about everything in a certain domain, rather than know everything about say, one programming language?) Is it okay to be a generalist?


An aspiring programmers proverbial fork. (asp.net or ...)

> **Possible Duplicate:**   >  Is it better to specialize in a single field I like, or expand into other > fields to broaden my horizons?   >  Do Diversified Skills Foster or Hinder Specialization? Afternoon, I am seeking some career guidance, as the road seems to be splitting, winding and veering off in many different directions. It is my desire to be a professional software engineer, focusing (more so) on web applications. My background in web design lead me to php, mysql and minimal javascript (as so many have). From here I'm starting to learn visual studio, C# MS SQL and many tools / scripting languages that I feel would make me a better programmer and asset to a web team (REGEX, HTML5, MSSQL,). The more I dwell into Visual Studio, ASP.NET aspx syntax ( <% %> ) and now reading the up coming razor syntax. I am starting to get this feeling of cornering, isolation from those who develop in areas that I also find interesting. I get it, it's just the nature of life when you become specified in any area of expertise, you have to focus somewhere or you'll be a jack of all trades. But at the same time I would love to "reach over" and be able to dab into objective-C or Java, so I can design web applications that are intended for cross-platform use. It is not my intention to come of whining, I'm just looking to be told "it'll be ok, push hard an any of these directions and you'll be able to do anything you want." Where, my next 4 years of effort in becoming an asset in C# and asp.net will no damn me to a life of servitude to Microsoft technology related jobs. Upon my visit to Google's HQ back in April it really inspired me and opened my eyes a bit. But from what I hear their technological push does not utilize any C# or .NET for that matter. So I guess a summed up question would be: Do professional software engineers have the freedom (and time for that matter) to learn, professes and become an asset of other technological sectors? Does one who masters Visual Studio also have a mastery of VIM or EMACS?


Does being a jack-of-all-trades hurt your career?

> **Possible Duplicate:**   >  Is it better to specialize in a single field I like, or expand into other > fields to broaden my horizons? Looking at job postings, the vast majority ask for extremely specific qualifications and requirements and a great deal of experience in very narrow areas. Having written a job description or two myself, I know that the "requirements" are more of a wish-list than anything, and actual job duties can vary wildly. That said, if I look at these job postings as a potential applicant, I don't think I'd even be considered for most of them - mainly because I don't really have a specialty or area of strong focus. I can do just about anything marginally well (programming, database, networking, you name it), and have had experience with a wide range of different technologies (at varying levels of expertise), but I've never had a job that required or otherwise had a need to drill deep down into something, spend a lot of time on it, and "master" it. Does being a jack-of-all trades really hurt your career (long term)? Does that mean that you will never be able to move up or advance beyond something like Tier 1/2 tech support or general IT-lackey? In the same vein, is it possible to make a career out of being versatile with technology, having a wide range of (albeit shallow) experience, but without specializing in a particular technology?


How to name an subclass that add a minor, detailed thing?

What is the most concise (yet descriptive) way of naming a subclass that only add a specific minor thing to the parent? I encountered this case a lot in WPF, where sometime I have to add a small functionality to an out-of-the-box control for specific cases. Example: TreeView doesn't change the SelectedItem on right-click, but I have to make one that does in my application. Some possible names are   * `TreeViewThatChangesSelectedItemOnRightClick` (way too wordy and maybe difficult to read because there is so many words concantenated together)   * `TreeView_SelectedItemChangesOnRightClick` (slightly more readable, but still too wordy and the underscore also breaks the normal convention for class names)   * `TreeViewThatChangesSIOnRC` (non-obvious acronym),    * `ExtendedTreeView` (more concise, but doesn't describe what it is doing. Besides, I already found a class called this in the library, that I don't want to use/modify in my application).   * `LouisTreeView`, `MyTreeView`, etc. (doesn't describe what it is doing). It seems that I can't find a name which sounds right. What do you do in situation like this?


Why is "Select * from table" considered bad practice

Yesterday I was discussing with a "hobby" programmer (I myself am a professional programmer). We came across some of his work, and he said he always queries all columns in his database (even on/in production server/code). I tried to convince him not to do so, but wasn't so successful yet. In my opinion a programmer should only query what is actually needed for the sake of "prettiness", efficiency and traffic. Am I mistaken with my view?


How do you determine which skills are marketable?

While this question might be relevant to other fields, I'm interested specifically in searching for jobs as a developer. Namely, when you are searching for an applying for a new job you might look for listings that are for C# or Java developers; however, most jobs aren't just writing one language so how do you determine which skills are worth highlighting on a résumé or more likely on a targeted cover letter? Likewise, are there some skills that aren't worth mentioning because it is implied that most developers should know it (i.e. XML) or is it better to list everything?


Extracting color profile information from JPEG files

I'm trying to look up info about reading JPEG's color profile info and to my surprise there's very little open specific how-to information on that regard, but rather lots of general explanation on what it is. **Does anyone know how to find and read the color profile information from JPEG?**


Do any database "styles" use discrete files for their tables?

I've been talking to some people at work who believe some versions of a database store their data in discrete tables. That is to say you might open up a folder and see one file for each table in the database then several other supporting files. They do not have a lot of experience with databases but I have only been working with them for a little over a half year so I am not a canonical source of info either. I've been touting the benefits of SQL Server over Access (and before this, Access over Excel. Great strides have been made :) ). But, other people were of the impression that the/one of the the benefit(s) of using SQL Server over Access was that all the data was not consolidated down into one file. Yet, SQL Server packs everything into a single .mdf file (plus the log file). My question is, is there an RDBMS which holds it's data in multiple discrete files instead of one master file? And if the answer is yes, why do it one way over the other? **edit** Thank you everyone for you're answers. This has really helped clarify the whole situation.


What advantages are conferred by using server-side page rendering?

I am developing a web app and I have currently written the entire website in html/js/css and on the backend I have servlets that host some RESTFUL services. All the presentation logic is done through getting json objects and modifying the view through javascript. The application is essentially a search engine, but it will have user accounts with different roles. I've been researching some frameworks such as Play and Spring. I'm fairly new to web development, so I was wondering what advantages using server side page rendering would provide? Is it: Speed? Easier development and workflow? Access to existing libraries? More? All of the above?


How does Google crawl frequently updated webpages?

I'm trying to build a very small, niche search engine, using Nutch to crawl specific sites. Some of the sites are news/blog sites. If I crawl, say, techcrunch.com, and store and index their frontpage, then within hours my index for that page will be out of date. Does a large search engine such as Google have an algorithm to re-crawl frequently updated pages very frequently, hourly even? Or does it just score frequently updated pages very low so they don't get returned? Also, how can I handle this in my own index?


Are There Any Flaws With This Git Branching Model?

I am asking about this git branching model or workflow. I really like this. It strikes me as very intuitive and productive, but what I am asking for is whether there are any flaws or negatives to this approach that are not yet clear to me (coming from another world where ClearCase ruled the day). (You don't need to answer every question, whatever you can is helpful)   1. Do you use this or a similar git branching workflow?   2. Do you consider this a productive approach?   3. Do you see any flaws with this approach? Any potential downside?   4. If you have a better approach, would you mind sharing, or providing a link to an article or discussion about it?


How important is multithreading in the current software industry?

I have close to 3 years experience writing web applications in Java using MVC frameworks (like struts). I have never written multithreaded code till now though I have written code for major retail chains. I get a few questions on multithreading during interviews and I answer them usually (mostly simple questions). This left me wondering how important is Multithreading in the current industry scenario ?


Should I represent the Database in my use cases?

I am creating use cases for my web application and I was wondering if a representation of the DB should be listed as an actor. For example a user can check his profile and edit it (assuming that he is logged in). The two use cases would be:   \- User can view his profile   \- User can edit his profile   Would the use cases then be for example:   Actor: User, DB   Use case: View profile   Or can I leave out the DB as an actor? Unfortunately I haven't found any consistent way of drawing the use cases.


Is it bad practice for services to share a database in SOA?

I have recently been reading Hohpe and Woolf's Enterprise Integration Patterns, some of Thomas Erl's books on SOA and watching various videos and podcasts by Udi Dahan et al. on CQRS and Event Driven systems. Systems in my place of work suffer from high coupling. Although each system theoretically has its own database, there is a lot of joining between them. In practice this means there is one huge database that all systems use. For example, there is one table of customer data. Much of what I've read seems to suggest denormalising data so that each system uses only its database, and any updates to one system are propagated to all the others using messaging. I thought this was one of the ways of enforcing the boundaries in SOA - each service should have its own database, but then I read this: http://stackoverflow.com/questions/4019902/soa-joining-data-across-multiple- services and it suggests this is the wrong thing to do. Segregating the databases does seem like a good way of decoupling systems, but now I'm a bit confused. Is this a good route to take? Is it ever recommended that you should segregate a database on, say an SOA service, an DDD Bounded context, an application, etc?


Using a database for each module in a system

I was reading this question: > I was trying to standardize and modularize some functions (Email Management > Module, CMS Module & etc) by implementing a 3-tier architecture concept > where each module would have its own independent module database. So that in > the future all we'd need to do is just code a presentation layer, reuse the > BLL layer, DAL Layer and database. My follow-up question is whether it is a good idea to place all the database tables from each module into the same database, or whether they should be separated into entirely separate databases? I am using PostgreSQL. My worries are:   1. Problems with running data analysis if data is in many different databases   2. Problems pinning down database performance issues if we use the same database for all modules   3. In ability to join tables across modules if we some time in the future discover that our modularization is flawed for creating a certain feature


Tips for Tail Call Recursion in Python

Ok, Python doesn't have tail call optimization. But for those who think better recursively than "looply", whats the best practices to write code?? 1000 stack calls are enough for many cases, but what are the tips to conceal recursion with efficiency in Python?


Is this a valid smartphone CPU vs. desktop CPU speed comparison (Android G1 vs. old Pentium 4 desktop)?

I am trying to estimate speed differences when creating code on my desktop PC that will be ported to Android phones. I don't need to be exact, but a good estimation will help stop me from creating code that is dismally slow on an Android phone. I want to support down to the Android G1 so I am using it as my "baseline". Here is how I am currently performing my calculations using Dhrystone MIPS using an old Pentium 4 for comparison that will be the test unit for quick speed tests. According to this document, a G1 using a Qualcomm MSM72xx ARM CPU is about 1 MIPS per Mhz: http://www.techautos.com/2010/03/14/smartphone-processor-guide/ Web searches turned up user comments indicating that the G1's CPU comes stock running at around 350 Mhz and not at the 523 Mhz shown in the chip's specs so I am assigning a MIPS rating of 350 MIPS for the G1, rightly or wrongly. This Wikipedia page shows the Pentium 4 Extreme edition rated at about 9700 MIPS: http://en.wikipedia.org/wiki/Instructions_per_second This makes the Pentium 4 approximately 27 times faster than the G1. Given that multiplier, if during one of the time consuming operations my code takes 1 second on the Pentium 4, I would estimate that it would take 27 seconds on a G1. Is my logic correct? I am hoping it is not because that means I'll have to do some really painful optimizations to the code to make things livable on the G1. If my logic is not correct and there is a better algorithm for this calculation, please let me know. \-- roschler


What encryption method should I use?

I am looking for some information on encryption. Here's what I'm trying to do:   * Get unique information from our customer (an ID or something)   * Generate and encrypt some data on our side (using the clients ID)   * Send this data to customer, and allow an application to decrypt (and decrypt only) this data using the ID sent before What methods should I be looking at? Kind regards To clarify:   * We encrypt some data using our private key and our clients public key   * The client decrypts this data using their public key   * The client must not be able to encrypt valid data using their public key


Steps for moving towards continuous delivery?

Say you have a traditional dev > test > production process say on a monthly release cycle. What are some of the steps you need to take and put into place to move towards a model of continuous delivery with frequent releases per day. Please make one suggestion per response. I would be interested in using voting to indicate which steps the community feel are most important.


At what point does a company need a system engineer?

I'm 8 months into my first job as a developer at a mid-small company. The four development teams have about 7 developers each, the design team consists of about the same number, and the administration / sales / marketing / hr team is 4 people. We mostly develop web apps, a one-time deal, to run on the client's (usually existing) environment. I'm finding myself setting up development environments to match, usually things I've never used before (from C#.NET 1.1 and MS-SQL to a regionally developed WAS called JEUS), which takes a significant amount of time. Sometimes I get help from other developers but mostly I follow online tutorials until it seems to work, and then I spend more time fixing my code when it breaks because the settings aren't exactly the same as the actual environment. I'm starting to think that one guy who specializes in this stuff would make it much easier for the developers to actually do what they're paid to do. When does it make sense for a company to get a dedicated systems engineer? Or am I wrong and should just suck it up and learn to do it? I do realize that being familiar with different environments would improve my employability...


Redundant code ok?

Using C#/.Net, I have a page where the user can enter data and save these data by clicking a button. To save data, the user needs to enter a valid date, this means a date which has a certain format. The page contains amongst others two modules. The ValidateDate-Event has the responsibility two check the format of the date-field. So it checks the format and displays a message if the date is not well formed. The Save-Event has to save user entries. To successfully complete the task, a well formed date is needed. So I designed the module to check the date format. This has the advantage that the module can never crash and is not dependent of the Validation-module. But I realized that in fact I do the same thing twice, in two modules. I am just curious, how do you handle this matter? What do you think is the best way to do it? **1) ValidateDate Reponsibility: Check format of date field (, inform user)   Sub-Task: Check format of date field 2) Save Reponsibility: Save data   Sub-Task: Check format of date field**


If I drop cookies with JavaScript will it still be compliant with the EU ICO Cookie Law?

The challenge proposed to me as to create a widget to apply in other sites that makes a website compliant with the cookie law[1]. Can I do this without changing server code? I mean, if there's code on server-side that writes an affiliate cookie to the response and my JavaScript widget deletes it after on window.load event: will the site still be cookie law compliant? Then comes the Google Analytics and share buttons cookies. How would I stop those scripts and iframes from being executed in JavaScript? [1] The Information Commissioner's Office (ICO) : New ICO Cookie Law


Should I take on this very large project idea?

The last month I have had idea of a very large project to take as a software hobby/potential business project - simply because I saw some "vision" of a great tool if this would be done. The idea behind the project is really a common idea, and there is this one very big competitor (as the size of a corporation with dozens if not hundreds of programmers working on a product that might contain my "visionary" features in the future) - their product gets polished every year with their new edition. A few days ago I saw their latest edition, and it literally "shut my wind" down : Their latest edition contained about 50% of the features I dreamed about. And they implemented those in a good way. Also, those "features" that they have implemented, are part of a very large product of theirs, so they benefit from integrating those features to their big product. If I were to code my own product, those "features" will simply be a stand-alone product without any other _nice and efficient tools_. So my doubts are these : If I were to begin coding this myself, this would take perhaps a few years. Should I really take this project idea and invest my time in it, while some big corporate company might suddenly have those same features implemented in, let's say, one year from now? Should I really _think_ before entering a whole new project about my chances of success, or, simply, should I _dive and kamikaze_ on it?? What do you think? P.S. If you can, please recommend me information resources about starting up projects and eventually getting commercial. Thank you very much.


Must developers understand the business domain or should the specification be sufficient?

I work for a company for which the domain is really difficult to understand because it is high technology in electronics, but this is applicable to any software development in a complex domain. The application that I work on displays a lot of information, charts, and metrics which are difficult to understand without experience in the domain. The developer uses a specification to describe what the software must do, such as specifying that a particular chart must display this kind of metrics and this metric is the following arithmetic formula. This way, the developer doesn't really understand the business and what/why he is doing this task. This can be OK if specification is really detailed but when it isn't or when the author has forgotten a use case, this is quite hard for the developer to find a solution. At the other hand, training every developer to all the business aspects can be very long and difficult. Should we give more importance to detailed specification (but as we know, perfect specification does not exist) or should we train all the developers to understand the business domain? **EDIT: keep in mind in your answer that the company could used external developers and that a formation to all the domain can be about 2 weeks**


Designing access to file-based "database"

It happened frequently that I have to provide access to a bunch of files organized in a directory tree according to some (sometimes loosely specified) rules. My standard pattern is to provide a Database class which is initialized with the root directory. This class provides getX()-like (example: getStructure()) methods to extract data from the database. These methods normally return semantically meaningful objects (Structure) with proper methods returning data (eg. structure.getPoints()). I am not completely happy with this design, for two main reasons. The first problem is that the mapping between in-application objects and files may not be 1:1, that is, to create the Structure object I may have to open different files in the "database", and the mapping may not be perfect. In this case, I call the Structure a "Thick object". An alternative ("thin objects") is to stick to objects that _are_ fully represented in a file, even if poor in high-level domain meaning (that is, if I have two files to define a structure, one file containing points, and the other containing connections between these points, I just provide a Points object and a Connections object, and let someone else "connect the dots" outside Database). The other problem I have is the following: who should perform the actual file parsing? I envision two strategies: either the objects are able to deserialize themselves from file ("pickle-like" in python parlance), or they are just dumb data containers filled by stateless parser objects (one per file), or even by the database object itself. When you do ORM, there are clear, well defined rules on how the object is represented in the database, and the process is extremely well defined in terms of interface and behavior. This is not necessarily verified with an arbitrary bunch of files some people call "database". I would really enjoy your points on this regard. How should I perform proper deserialization in this case of "raw mapping"? Thin or thick objects ? Smart or dumb ? Note that I don't really have any control at all when it comes to the files I have to access. I get the files from external sources, and I have to convert them into some kind of domain objects, generally only for reading, but sometimes also for writing. Readonly is by far the most frequent case though.


How do remote programmers working on proprietary software go about securing their work/source code?

I was just wondering what kind of protocols a software engineer would go through if they were working at home for a company developing proprietary closed source software. Would you use a third party anti-virus or would you fear they could steal your code? Can you trust web hosting services like git- hub and bit-bucket? Would you keep your source code on an encrypted partition? Would you make any configurations to ensure windows could not steal your source code through some kind of built in feature? What other kinds of security concerns would you have and how would you deal with them?


Algorithm for matching similar content text items

I am working on a website (C#, ASP.Net MVC 3) which reads some RSS feeds from multiple sources and put feed title and summary in a database table(Sql Server). What I want to do is: Put an algorithm in place which can relate multiple feeds. For example if each feed is a news item, I would like to relate all news which says in different grammar of English "Some has won some election". Is there any standard algorithm for such kind of content matching logic? If not, what kind of custom algorithm should be used? If this logic can be written on Database side(e.g. Stored Procedure) it will be better.


Novel polymorphism - any reasons for this code?

As part of my work on a legacy C# application I've come across a novel (to me) use of an interface & concrete implementations. I can't think of any reason why you'd do the following, but I'm pretty thick, so maybe someone else can?               public interface IContract     {         ContractImplementation1 Contract { get; }         bool IsCollection { get; }         bool Touched { get; set; }     }          public class ContractImplementation1 : IContract     {         public ContractImplementation1(string propertyOne, string propertyTwo, string propertyThree, string propertyFour)         {             PropertyOne = propertyOne;             PropertyTwo = propertyTwo;             PropertyThree = propertyThree;             PropertyFour = propertyFour;         }              public ContractImplementation1 Contract { get { return this; } }         public bool IsCollection { get { return false; } }         public bool Touched { get; set; }              public string PropertyOne { get; private set; }         public string PropertyTwo { get; private set; }         public string PropertyThree { get; private set; }         public string PropertyFour { get; private set; }              public override string ToString()         {             if (string.IsNullOrEmpty(PropertyFour))                 return string.Format("{0} => {1}: {2}", PropertyOne, PropertyTwo, PropertyThree);             else                 return string.Format("{0} => {1}: {2} {3}", PropertyOne, PropertyTwo, PropertyThree, PropertyFour);         }          }          public class ContractImplementation2 : IContract     {         public ContractImplementation1 Contract { get { return null; } }         public bool IsCollection { get { return true; } }         public bool Touched { get; set; }              public List<ContractImplementation1> Contracts = new List<ContractImplementation1>();     }      I can't get my head around the super-type having a property that is a sub-type of itself.   Following Cosmin's answer: I can't get my head around why you'd have the sub- type as a property given that the property returns itself on the implementation (rather than a 'parent' of the same type i.e. a different instantiation of the super-type).


Challenges to the Agile approach on government projects

A previous Agile discussion here had good answers specifying what is **critical** to the success of implementing Agile methodology in software development. Most of the points were the typical organizational and management challenges, but one point worries me and it is that the client must be involved throughout the process. The client is the one thing that you cannot control realistically, perhaps your business model gears you to government contracted work for instance where an intensely strict contract obligates the company to:   * Provide X features exactly as requested   * Feature requests will be thrown over a wall, don't bother us we don't want to hear it.   * There is no concept of feature priority in the customer's mind, _they are all important or we wouldn't have asked for them._   * The project will cost no more and no less than Y regardless of overruns or deadlines.   * Absolute, strict, final and non-negotiable deadline for complete delivery of all work. We have never worked with such a client before but the money on the project is just too good to pass up. We need this work. I came here and worked **HARD** to change processes within to move towards Agile development and here I don't know how to reconcile where this project fits into our new process. I have never before had the luxury of open-minded hands-off management that trusted me to lead the development team and processes down this path and now that we are here I can't honestly tell myself that this project will truly be done in an Agile way. I feel like management trusted me to lead this path and that I let them down because this situation we are in now so clearly calls for Waterfall. I am afraid that I might lose their trust if I backtrack now. Other answers like the one here say Agile is impossible with this kind of client, do you agree? Have any of you been in a similar situation and made it work? What strategies did you implement to make Agile happen successfully?


Is it more advantageous to write a program to test your code (ie a client) or just use the main portion of your program?

For instance if I had a program with a bunch of methods.                       public class Dog{                           public boolean ishappy{..}                      public int weight{...}                       public static void main{             Dog Max = new Dog             Max.ishappy}}      Is it best to use the main portion of the code to test, or write a completely separate program, which would be a client of the dog class, to test my code?


How are you using CFThread in ColdFusion Applications?

I'm presenting on Concurrency in ColdFusion at CFObjective this year, and I'd like to hear how you're using CFThread in your ColdFusion applications. In addition, what problems have you had while using it, and how (if at all) have you solved them? What do you dislike about CFThread? Have you run into significant weaknesses with CFThread or other problems where it simply could not do what you wanted to do? Finally, if there's anything you'd like to add related to concurrency in CF, not specifically related to CFThread, please do tell.


Is it a good idea to use an unit test framework for another purpose than test code?

I'm about to write a simple script to test a dataset for certain conditions. I was designing it as a set of functions each one describing the condition to be tested and pass them to the test engine:               # The tester engine:     all(f(dataset) for f in conditions)      I realized that my approach was similar to unit testing. So, to avoid repeating myself, I am thinking of using my favorite unit testing framework instead.   1. What do you think about that idea?   2. Have any of you used an unit test framework for any other purpose than test code?


Ruby manager for Windows: Is Ruby's PIK alive or dying?

At first, please forgive probably offtopic and/or notconstructive question, but I truly have no idea where to ask it. At first I targetted StackOverflow there's at least some PIK-related traffic visible, but Programmers seem more relevant (although there seems to be not a three words here about PIK..). Some time ago I was looking for a quick way to predictably and repeatibly setup Ruby environments and I've found PIK to be relatively easy and usable. Note that I'm not a full time Ruby developer, I use it more as a "quick hacking console" and "lightweight Bash replacement" on Windows. For the last one or maybe even three years I was happily using PIK for isolating Ruby's ENVS from the normal windows shell environment. I've also came up with some extensions, both to windows's shell and PIK itself, and from time to time I feel the urge to publish them. They include simple things from running a script by doubleclick alike to .vbs or .bat, to more interesting ones like drag&dropping files onto a .rb script, to some fairly esotheric like emulated support for shebangs like `#!/bin/ruby-187` `#!/bin/ruby-193` so you can easily switch Ruby runtimes in the scripts lying on your desktop. Some background covered, let me then ask the awful question: ~~is it worth publishing?~~. No, obviously almost everything usable is worth that. My point is more about the feeling that I maybe I could spent that time better, there's no point in polishing dead tools, and as I search the web, I see **very** little movement in the subject :)   * Are such extensions actually needed, or maybe they do exist and I simply reinvented a wheel? Do you, Ruby users, feel "lack" of them in your "everyday use" of Windows?   * Is the PIK alive, getting popular or dying? is it known/used throughout the windows/ruby community, or should I adapt my addons to other managers?


Which design pattern is illustrated by inheriting IStructuralComparable interface?

We know that some design patterns are found so useful that they become features of the language itself. For instance, the interface `IEnumerator` which is implemented by `Array` object. This helps in separating the iterator from the collection object. The internal representation of the object is encapsulated. The pattern: Iterator Pattern I have just come across another interface `IStructuralComparable`(msdn). This is used to compare the structure of two collection types using `StructuralComparisons`(msdn) class. The intent of this interface seems to be thus: > My understanding is that it's used for collection like types, and > encapsulates the structural part of the comparison, but leaves the > comparison of the elements to a comparer passed in by the user. (link) (Got > from the comments section of the question) **Is this an implementation of any familiar design pattern? If yes, which pattern is it?**


Are there any good editors for asp.net on smartphones?

I came across coderun the other day does anyone know any better editors/ide's espeially that can be used relatively easily on some of todays smartphones for asp.net ?


Self reference using a new table vs concatenated list of ids

At my current workplace there is a common pattern in database design: they don't use foreign keys but they list all corresponding ids in a column like this:               some_table     id  name image_ids     1   a    1,2,3     2   b    4,6,7          images     id url     1  ...     2  ...     ...      They store self references in a same manner:               some_table     id  name  some_table_id     1   a     2,3     2   b     1,3     ...      They encourage me to use this pattern but it does not feel right for me. I would never design a database like that. I have some counter arguments against it:   * What if some day I would add some arbitrary data to a self reference? Using this model I would not be able to.   * It does not ensure referential integrity. I can easily add non-existent ids which will lead to problems   * Searching through strings is not fast either I need to justify my complaints so my question is: What persuasive counter- arguments can you come up with against this hacky design approach?


Why should IQueryProvider implementations throw NotSupportedExceptions?

Searching the web, we can find plentiful examples of various ORMs (nHibernate, EF, LinqToSql, etc.) that implement but don't actually support the full `IQueryable<T>` interface, throwing `NotSupportedExceptions` when they encounter something they don't like, such as LinqToSql and `SkipWhile`. My question is this: why do ORM providers opt to throw a `NotSupportedException` instead of letting certain query operators (that do not translate well or at all to the target data source) trip a query execution and then let Linq to objects handle the rest? I understand that some heavy physical resource usage could occur as a result, but if `IQueryable<T>` instances were _truly_ swappable, would we not be better off?


Standard practices for an architect

I am the architect for my group. Unfortunately I was given this position organically and there are no standards in place for how I should do my job. At different companies, how does the architect role work? I am very interested, for example, in what type of diagrams and documents an architect might provide so that they can assist a developer in doing their job.


What's the best approach to building a db schema for profile, but to track changes?

I'm working on a site where companies can create a profile then add locations for each profile. Those first two tables are simple enough. But any changes to their profiles or locations have to go through an approval process. This is where I'm torn. The end result would be an employee going through a worklist and seeing the requested changes and clicking "approve" or "deny". Approve applying the new data to the existing record, deny setting a flag on the request record(s) and sending a response. What I'm wondering is the best way to go about the change requests. I would definitely like to keep the change requests in a separate table than the profile or location table. I can't decide if it's best to just create duplicates with a few extra columns of the profile and the location tables and use those for change tracking. Or if I should just create a simple table with just the columns to capture the change target id, field, and value, plus a few extras like changeset, datetime, flag, etc. What do you think?