title: Trademark question: naming an app after a common noun when an app from another store uses it

text: Here's my scenario with made-up names: A big company called Supersoft have announced that in about 3 months they're going to release an Android app called "Supersoft Metronome" (where Metronome is a fairly common noun). I want to call my new iPhone app (notice the other app is on Android) "Metronome" and I'm ready to release in a week. Should I rename my app? Will I get in legal trouble otherwise? Both apps are in the same category of program. I've already bought a related domain name, paid for artwork and styled my app around the name so I really don't want to change it now. I've considered extending the name to something like "Metronome Music Editor". Would this protect me?


title: CA1819: Properties should not return arrays. Does this happen only with arrays? If yes, why?

text: I have a question about CA1819 msdn performance warning. The rule is: Arrays returned by properties are not write-protected, even if the property is read-only. To keep the array tamper-proof, the property must return a copy of the array. Typically, users will not understand the adverse performance implications of calling such a property. Specifically, they might use the property as an indexed property. I understand the rule. I want to know if this happens only with arrays? If yes, why?


title: can I use XML for AJAX in a website created using HTML5

text: I am new to web programming and just started learning XML and AJAX. I am creating a social gaming website for my college project. I am confused at the point of using XML for AJAX in HTML5. As XHTML is replaced by HTML5 so is it ok to use XML or i should choose JSON (i know nothing about JSON but it is what I found in answers on web to the question related to choice between JSON and XML). My preference is XML because it is in my syllabus but I want to make sure that XML and HTML5 will not conflict.


title: Is context-driven testing suitable for all projects?

text: One thing I cannot find anywhere is: is this approach limited to non-critical software? Because in critical (or just when customer wants us to follow his rules) we have no freedom in testing and just follow the procedures. Am I right?


title: Method to test/reproduce Heisenbug possibly relating to Multimedia Class Scheduler Service?

text: ## The Problem I am hunting down a bug in a web application related to multi-uploads using a Flash movie/applet. Sometimes, the progress bar that is used in the Flash applet to indicate file upload progress will read over 100% for a progress and causes the entire upload system to halt. Aside from the logic errors associated with the rest of that code, attempting to reproduce this bug to trace execution and debug is a feat in itself. It's a Heisenbug, and I have seen it just once in about two days of trying. Other developers' machines can reproduce it with more regularity. The only time I reproduced it was rebooting after changing my registry key for `SystemResponsiveness`, as my machine uses Windows Server 2008 R2. That registry key controls CPU priority for multimedia applications. Windows Server 2008 R2 sets this key to `100` (giving multimedia applications very low priority), whereas I set mine to `20` as it is what a desktop Windows 7 install sets it to. All other developer machines that can reproduce this issue have `SystemResponsiveness` set to a default 100. When I set my `SystemResponsiveness` back to `100`, I immediately saw this issue. However, reproducing the issue is still spotty. ## My Theory So I am going on the assumption that this bug, as it involves Flash, is related to the `SystemResponsiveness` registry key as described in Microsoft's documentation for Multimedia Class Scheduler Service, which is the multimedia subsystem of Windows 7 and Windows 2008 R2. By setting the responsiveness to 100, multimedia like Flash 'movies' (which this uploader is) may encounter problems, and this becomes a timing/interruption issue for the uploader, which then causes other bugs to manifest themselves. ## How to test? Now I'm trying to come up with a way to test this theory. I think I need to have a background process peg the CPU usage at 100% (across 4 cores), and then attempt to use the uploader. The background/non-multimedia services should cause stuff like Flash to perform worse and I should run into problems. **edit** I decided to run a CPU stress test to peg my system's CPU utilization at 100% - other than make my machine slow to a crawl, the bug did not manifest itself. This Heisenbug is really eluding reproduction. ## My Inquiry However, I'm not sure if that is the correct approach to test my theory, so I'm wondering if anyone has any insight into tracking down MMCSS-related issues?


title: How to name nested function?

text: When you have a function that wraps another one in Scala. What do you call the nested function? I found this :               def factorial(i: Int): Int = {            def fact(i: Int, accumulator: Int): Int = {          if (i <= 1)             accumulator          else             fact(i - 1, i * accumulator)       }            fact(i, 1)          }      I usually use just _do_ because it is shorter, generic, and explicit. But is there a better way or a naming convention for nested functions?               def myFunction() = {            def do(i: Int) = {         ...       }       do(1)          }


title: Is there any difference between Custom Control and User Control in .NET

text: As stated in the question, is there any difference in the meaning of the two as applied to the Controls of .NET. Or are they alias of one another?


title: What do you think of the F# language?

text: What do you think of the F# language? I would like to learn it's positive and negative points. What is your experience with this language? When should or shouldn't someone use F#? See also: F# at Microsoft Research


title: Should I bother learning about small or niche languages?

text: If you browse the code golf questions on StackExchange, you notice a ton of non-standard but real world (Eg not brain-f*ck) languages like F#, Scala, R, J and Clojure. Visiting their websites, some of the languages look interesting solving problems in whatever language your already using. However there is coding in spare time, and coding for money. The closest thing we have to the truth on who uses a language is the TIOBE Index, which lists none of the above languages in the top 10-15. Which makes me wonder if I'll ever use them. Should I even bother learning some of the small niche languages? It doesn't seem I would be making money, and some will probably fail anyway.


title: How forgiving do you need to be on new employees?

text: Recently we have a new developer in our team. We are getting him up to speed and he is picking it all up quite fast, but a new developer means new (foreign) coding styles and ways to solve things. It feels kinda petty to start whining about coding styles at the first three classes he codes, but how forgiving are you guys when dealing with new developers? Do you let them muddle on, and point it out later? Or do you wield the scepter of intolerance immediately? When do you draw the line, or if not, why not? _P.S. New guy, if you read this: you are doing great, keep up the good work ;)_ **Edit:** I've accepted the most up-voted answer, as most answers share the same message: Be nice, but tell them asap!


title: How to do thread management in C++?

text: We use `pthread` for thread management in C based systems. pthread is in general compilable by C++ compiler (like g++). However, what are the better ways of abstractions for threads in C++? Also, for making any system to be working in a multi-threaded system, it is also important to make thread safe. What are the standard libraries that requires alternative (installs) to be thread safe or are they unsafe for multi-threaded environments? Is smart pointers, templates require special measures to make it safe? What are the best practices for the thread managements in C++?


title: Where to find common database abbreviations in Spanish

text: I'm doing a little pro bono work for an organization in Central America. I'm ok at Spanish and my contacts are perfectly fluent but are not techincal people. Even if _they_ don't care what I call some fields in a database _I_ still want to make as clean a schema as possible, and I'd like to know what some typical abbreviations are for field / variable names in Spanish. I understand abbreviations and naming conventions are entirely personal. I'm **not** asking for the "correct" or "best" way to abbreviate database object names. I'm just looking for references to lists of typical abbreviations that would be easily recognizable to a techincally competent native Spanish speaker. I believe I am a decent googler but I've had no luck on this one. For example, in my company (where English is the primary language) 'Date' is always shortened to 'DT', 'Code' to 'CD', 'Item' to 'IT', etc. It's easy for the crowds of IT temp workers who revolve through on various projects to figure out that 'DT' stands for 'Date', 'YR' for 'Year', or 'TN' for 'Transaction' without even having to consult the official abbreviations list.


title: MS Certifications for Non-IT students

text: It may seem like a silly question, but it's important at least for me and I'm interesting to hear from you. I'm a .NET developer 4 years ago, even before I went to university, I'm currently earning an MCTS in web development, and some of them told me that it's invaluable for my position, I'm not and wouldn't be an IT student anyway, just because I believe that in IT field, knowledge could be gained from experience and self-teaching (via books and videos) , I know lot of IT students (in my region at least) fight just for the sake of having a degree and to get a job, no more... I'm currently looking forward to complete my path in MS Certifications and hold the MCPD, is it really that you should be an IT guy in order to be certified? does it make sense for you that non IT students never need those certifications?


title: When to stop inheritance?

text: Once upon time ago I asked a question on Stack Overflow about inheritance. I have said I design chess engine in OOP fashion. So I inherit all my pieces from Piece abstract class but inheritance still goes. Let me show by code               public abstract class Piece     {         public void MakeMove();         public void TakeBackMove();     }          public abstract class Pawn: Piece {}          public class WhitePawn :Pawn {}          public class BlackPawn:Pawn {}      Programmers has been found my design a little bit over engineering and suggested to remove colored piece classes and hold piece color as a property member like below.               public abstract class Piece     {         public Color Color { get; set; }         public abstract void MakeMove();         public abstract void TakeBackMove();     }      In this way Piece can know his color. After implementation i have seen my implementation goes like below.               public abstract class Pawn: Piece     {         public override void MakeMove()         {             if (this.Color == Color.White)             {                  }             else             {                  }         }              public override void TakeBackMove()         {             if (this.Color == Color.White)             {                  }             else             {                  }         }     }      Now I see that keep color property causing if statements in implementations. It makes me feel we need specific color pieces in inheritance hierarchy. In such a case would you have classes like WhitePawn, BlackPawn or would you go to design by keeping Color property? Without seen such a problem how would you want to start design? Keep Color property or having inheritance solution ? **Edit:** I want to specify that my example may not completely match real life example. So before try to guess implementation details just concentrate the question. I actually simply asking if using Color property will cause if statements better to use inheritance ?


title: design for a parser to handle very large files

text: I have written a program which records protocol messages between an application and a hardware device which matches each application request with each hardware response. This is so that I can later remove the hardware, connect a 'replay' application to the main application and wait for an application request and reply with a matched copy of the requisite hardware reply message. My replay application saves the matched request/response in a list (using C++ std::list). This works fine on a small interaction session. My problem now is that I need to be able to use the replay over a long long session. With my current implementation, the replay program eventually uses up all available memory on my computer and crashes. So I need some sort of lookahead - and not parse the whole session in one go. Can anyone make any suggestions on how to get started?


title: HTML, CSS, and some JavaScript... what's next?

text: I just completed a front-end web development course. I now have a rudimentary understanding of what it takes to make a website sorta pretty and minimally functional. I also now know (barely) how to link up to an api via AJAX. I don't know what's next. I know I want to learn what it takes to make real- time collaborative web apps. node.JS? An online course? What should a beginner learn to jump into development of real-time collaborative software?


title: @Deprecated as of version x.y in JavaDoc

text: This question & its answers are useful but not sufficient for my problem. My Question is if I want to add a javadoc as _@Deprecated As of version x.y, replaced by {@link SomeClass}_ in my current file's javadoc then what should be the version no. in place of x.y ?? Let my current version is 1.2 & after CVS checkin it will be 1.3


title: Why are weakly-typed languages still being actively developed?

text: I wonder why are weakly-typed languages still being actively developed. For example, what benefit can one draw from being able to write               $someVar = 1;     (...)  // Some piece of code     $someVar = 'SomeText';      instead of using the much different, stongly-typed version               int someInt = 1;     (...)     string SomeString = 'SomeText';      It is true that you need to declare an aditional variable in the second example, but does that really hurt? Shouldn't all languages strive to be strongly-typed since it enforces type-safety at compile time, thus avoiding some pitfalls in type-casting?


title: Why don't we use a class and its static members to do what a singleton does?

text: In Java,C++,Objective C, C#, and all other similar OOP languages, Why don't we use a class with static methods and vars instead of going through a singleton syntax having to deal with various scenarios ?


title: Which user-story estimation technique is better?

text: I found two techniques for estimating user stories:   1. by the size of the story, which is unit-less   2. by the time estimate, which is measured by days The first uses relative comparison between stories to infer time, and it should be independent on developer experience, while the second depends on developer experience. I tried the first which is good, but I believe the second is more developer- friendly, and I want to see the pros and cons of each of them from practical experience. Any idea?


title: How can a developer evaluate the effectiveness of his workflow?

text: This question has been on my mind for probably 10 years. Ever since I've started programming for a living. And I've seen multiple discussions about good fit, distractions, being in the zone, etc. But I haven't seen links to some information/research that could give an objective self evaluation measure/tool to understand how you're really doing. What constantly bugs me, is that I think I'm not spending enough time on coding, and the effective work hours are not 8 out of 8, but less, with some days being even super ineffective, exactly like in this article. There are some metrics expressed as lines of code per day, with some sources quoting 1.5 being good and some sources indicating 500 per day being normal, but this again, is completely invalid metric as far as I can see. So at the end of the day, you have an assignment, you do it, but part of the time evaporates in sort of like "wth I was doing" kind of way. Emails, just staring at the code, thinking, painting a mental picture of the code in your head, floating somewhere, rethinking how things could have done more effectively, etc. And because of that, I'm never sure if I need to do something ASAP, to keep the raises coming, or am I paranoid, or is it just normal. The only half-good measure I've found so far, is seeing the amount of code other developers produce-vs-code I produce. And that usually floats around same number. But when I look at my code, or others code I still always get a feeling it could be done 10x faster. Then again, code crunching doesn't seem to work, or does seem to cause a burnout if not handled properly. So do you know of a good self evaluation approach to see if you're ineffective/effective? How do you weight the work you've done?


title: How to deal with variables when extracting methods in to smaller methods?

text: This is an abstract question to clarify a refactoring concept in the ruby language. Assume in the real world that there would be many more variables and method in the Furniture Class and Refinish method. I have a Class called Furniture. It has a method called '`refurnish(VarnishToUse, TimeToTake)`'. This method has               varnish_cost = Varnish(VarnishToUse).price * TimeToTake      I want to extract out the cost calculation into               def VarnishCost       price * TimeToTake     end      then the Furniture class can just have:               def Refurnish(VarnishToUse)       varnish_cost = VarnishCost(VarnishToUse)     end      How do I pass in the VarnishToUse into VarnishCost? Should the method be               def VarnishCost(Varnish)     ...     end      or should I be setting an instance variable `@varnish = VarnishToUse` in the Refinish class and then just expect that instance variable to be available in the VarnishCost method as I showed above? Does it make a difference if the other method is private? protected? I am looking to minimize the use of variables and multiple responsibilities for a class (SRP).


title: Suitable vocabulary when helping novice programmers

text: I find myself aiding novice programmers relatively often; explaining why their code won't work when they ask, suggesting solutions and the like. The people I'm helping do have a formal education in programming from a first-year degree-level module, in Java, but I feel like I can't communicate with them very well. For example: one might write a function but not understand why it isn't executed, not realising they forgot to call it. If I use phrases like `"(make a) call (to) the function/it"` and `"pass it the.."` I get blank looks. My normal process then would be to find some place in their code where they call a function from the language, and tell them they can call their own functions in the same way as they called this other function. Sometimes even that gets blank looks. **Are there other pieces of vocabulary that are more suited to (better for?) helping novice programmers? Or is this not an issue of communication?**


title: Why would a language let programmer to handle divison by zero

text: This happens in Javascript, for example, that division by zero is not handled by the language itself. Is there's a valid reason for this? I see this as a very basic exception that a language should be able to handle (they even handle 0/0 as NaN NaN). > or take the square root of a negative number or use arithmetic operators > with non-numeric operands that cannot be converted to numbers.


title: Best way of Javascript web development in Netbeans (Hot deployment)

text: I'm beginning Javascript development and as a beginner in JavaScript I make a lot of mistakes. The way I'm developing is very counter-productive because every mistake I fix I have to shutdown Glassfish, re-build the app and re- deploy it. My app is a Java back-end with REST services and the Html, JavaScript, CSS for the frontend. Everything is packed in a .ear file. As of right now, I'm just working with the frontend but I do have to make this whole process to update the files. My question is ... is there a better way of doing this? Can somebody tell how do you guys work in a similar setup to do the everyday development?


title: Is it possible to efficiently store all possible phone numbers in memory?

text: Given the standard North American phone number format: (Area Code) Exchange - Subscriber, the set of possible numbers is about 6 billion. However, efficiently breaking down the nodes into the sections listed above would yield less than 12000 distinct nodes that can be arranged in groupings to get all the possible numbers. This seems like a problem already solved. Would it done via a graph or tree?


title: What would Business Intelligence (BI) developers look for in code reviews?

text: Let me preface this with saying I am **_not_** a Business Intelligence (BI) developer. I'm a .NET developer, and I have only a vague notion of what BI is, and encompasses. I've been an evangelist for a secure development lifecycle in our company, and recently convinced the rest of the development team that we should be doing peer reviews including...   * Requirements Reviews   * Code Reviews   * Architecture/design reviews   * Documentation Reviews The .NET team does code reviews and we look for various things - general overview:   * Maintainability (clear design, adequately documented, etc.)   * Code clarity (standard .NET coding/naming guidelines)   * Security (scanning for failures to sanitize input, prevent SQL injection, etc)   * Functionality (does it do what it's supposed to)   * Usability   * Performance At any rate, our Business Intelligence developers don't really do the same type of coding/development that we do for websites, windows apps, etc. Our templates/checklists don't really apply to them. Since I've been the one trying to evangelize and get everyone do start doing peer reviews, they asked me for advice on what types of things they should be looking for. I could probably guide them and help them to develop their own checklists by asking questions about what can go wrong, what is important to them, etc., but I thought I'd ask and see if anyone is aware of established guidelines for doing "code reviews" for BI developers. I'll also take, from BI people "What would you look for in evaluating another BI developer's work?".


title: Coding a web browser on Windows using a layout engine?

text: I've never attempted anything like this before but what I want to do is code a browser for Windows. I know that I can use the web-browser control that Microsoft has released, but I'm interested in seeing how the problem is solved from a lower level. So I want to know what layout engine I should be looking at? Or is a layout engine the best way to go? I've been looking at WebKit, but it seems rather Mac-centric, so I'm wondering if there are any more practical one's for windows? Has Microsoft released the source code for their webbrowser winforms control in the .Net framework? That would be dependent on the CLR anyway, I suppose? Any suggestions?


title: Git: Pushing to a remote repo from a remote repo?

text: I have a destination repo that is remote and I have a source repo that is also remote. I would like my local machine to act as a proxy to allow me to push to the destination from the source without ever download the repo to my machine. Is this possible?


title: Why are threads called threads?

text: I understand that a process a unit of resource ownership and executable instructions. Threads allow a process to share its resources with multiple executions, and it's easier for an OS to schedule threads because of all the overhead associated with whole processes. But why the name _thread_? Does it have some reference to _string_ or the interleaving of execution? Even so, this isn't an intuitive term in my opinion.


title: Is database based chat room bad idea?

text: Most of simple "group chat" systems are based on local file storage logs (e.g. _log.txt_ ). I'm developing a simple group chat (under 20 users simultaneity ) with jQuery/AJAX. So basically, client-side code loads log from server **every second**. It needs to be fast. In database system (PHP/MySQL) that would mean MySQL query every second. Is that overload for server (shared hosting)?


title: Managing child worker thread list

text: After so much research, I thought I should ask the experts. I am working on a project for my corporate employer, we have android and iPhone mobile apps that make request to a web service, the request is logged in pending state for processing. A windows service retrieves the pending requests and spins a new thread for every request. This is because the request could be directed to different providers who process request in different manners. One could immediately process the request and return feedback, others could receive the request and take up to 30 seconds to return a feedback which you have to poll for the status. The mobile app will also be polling for the status of the request. Now my challenge is: I am thinking of creating a list of threads say 100 and assign each thread to execute a request, once finished the thread will be recreated and assigned a new request. It is a high response based platform so I am thinking of not using ThreadPool. Is it advisable to spin new threads in a fire and forget sequence or manage these list of threads and if it is to managed, then what is the best approach to manage these list of threads and ensure high performance in C# as the mobile apps will be polling for a response.


title: How to handle editing a large file for a non-technical user

text: I have a client who is given a tab delimited .txt file containing hundreds of thousands of rows. I have a user story as follows: > As a user I want to take the text file and add a new value at the end of > each line which contains the concatenated value of two of the columns. for example if the file read               text_one    text_two      I need to output the following (preferably to a .txt file)               text_one    text_two    text_onetext_two      My first approach was to ask the vendor supplying the file to do the concatenation before providing the file, the easiest way to solve a problem is to eliminate it right? however they are very uncooperative and have point blank refused. I've looked at building a simple javascript application that does this client side so a non-technical user could select the file using a file selector. This approach has a few problems   * The file could be over a GB in size and so can't be loaded straight into memory, I've tried and the browser crashes   * There is no means to write a file in javascript so I'd need to output the content to the screen and have the user save it (somehow) I was thinking if I could get around the filesize limitations I could just output the edited content to the page and have the user save the page as a .txt file, however I think there is a better way than using javascript that will still accommodate the users lack of technical know-how. Please consider this question to be stack agnostic, but bear in mind that a nice little shell script or python script would be deemed unsuitable for a non technical user unless there is a way of "packaging" it nicely for a non- technical user. ## Updates The file is too large to open in excel. The process needs to be run weekly, but it doesn't require scheduling or automation...(yet)


title: Is Java's ElementCollection Considered a Bad Practice?

text: From my understanding, an ElementCollection has no primary key, is embedded with the class, and cannot be queried. This sounds pretty hefty, but it allows me the comfort of writing an enum class which also helps with internationalization (using the enum key for lookup in my ResourceBundle). **Example:** We have a user on a media site and he can choose in which format he downloads the files ![](http://s9.postimg.org/9y69wyfin/Database.png)               @Entity     @Table(name = "user")     public class User {             /* snip other fields */              @Enumerated         @ElementCollection(                 targetClass = DownloadFilePreference.class,                 fetch = FetchType.EAGER         )         @CollectionTable(name = "download_file_preference",             joinColumns = @JoinColumn(name = "user_id")         )         @Column(name = "name")         private Set<DownloadFilePreference> downloadFilePreferences = new HashSet<>();     }          public enum DownloadFilePreference {         MP3, WAV, AIF, OGG;     }      This seems pretty great to me, and I suppose it comes down to "it depends on your use case", but I also know that I'm quite frankly only an initiate when it comes to Database design. Some best practices suggest to never have a class without a primary key- even in this case? It also doesn't seem very extensible- should I use this and gamble on the chance I will never need to query on the FilePreferences?


title: What functionality should a (basic) mock framework have?

text: If i would start on writing a simple Mock framework, then what are the things that a basic mock framework MUST have? Obviously mocking any object, but what about assertions and perhaps other things? When I think of how I would write my own mock framework then I realise how much I really know (or don't know) and what I would trip up on. So this is more for educational purposes. Of course I did research and this is what i've come up with that a minimal mocking framework should be able to do. Now my question in this whole thing is, am I missing some important details in my ideas? * * * # Mocking   * **Mocking a class:** Should be able to mock any class. The Mock should preserve the properties and their original values as they were set in the original class. All method implementations are empty.   * **Calls to methods of Mock:** The Mock framework must be able to define what a mocked method must return. IE: `$MockObj->CallTo('SomeMethod')->Returns('some value');` # Assertions To my understanding mocking frameworks also have a set of assertions. These are the ones I think are most important (taken from SimpleTest).               expect($method, $args)             Arguments must match if called     expectAt($timing, $method, $args)    Arguments must match when called on the $timing'th time     expectCallCount($method, $count)       The method must be called exactly this many times     expectMaximumCallCount($method, $count)     Call this method no more than $count times     expectMinimumCallCount($method, $count)     Must be called at least $count times     expectNever($method)           Must never be called     expectOnce($method, $args)  Must be called once and with the expected arguments if supplied     expectAtLeastOnce($method, $args)  Must be called at least once, and always with any expected arguments      * * * And that's basically, as far as I understand, what a mock framework should be able to do. But is this really everything? Because it currently doesn't seem like a big deal to build something like this. But that's also the reason why I have the feeling that i'm missing some important details about such a framework. So is my understanding right about a mock framework? Or am i missing alot of details?


title: Design pattern for client/server sessions?

text: Are there any common patterns or general guidance I can learn from for how to design a client/server system where the both the client and server must maintain some kind per-client session state? I've found any number of libraries that can help with some of the plumbing, but it's the overall design I'm wondering about. Open issues in my mind:   * How to structure the client/server communication so that bidirectional synchronous and asynchronous requests are possible?   * The server side needs to spawn a couple of per-connected-client session-long helper process. How to manage that?   * How to manage the mapping from a given client (and any of it's requests) to server state and helper process instances in the face of multiple clients and intermittent network connectivity.   * Most communication can be simple blocking request/reply, but some will be long running processing tasks that the client will want to keep tabs on. To the extent that it matters, the platform is Linux/C/C++. Not web based. Just an existing thick-client software app being modified to talk to backend servers for some tasks.


title: Licensing a collaborative research project

text: I am involved with an international research project which involves many different universities, national labs, and companies. The project is developed by national grants and in-kind support. One task in the project is to develop code to streamline workflow in our domain (energy simulation) by scripting common pre- and post-processing tasks for different tools. We want this code to be freely distributable to the simulation community. How can we ensure that this effort is digestible by the legal departments of these different parties such that the people involved can freely code?


title: Unit testing time-bound code

text: I'm currently working on an application that does a lot of time-bound operations. That is, based on `long now = System.currentTimeMillis();`, and combined with an scheduler, it will calculate periods of time that parametrize the execution of some operations. e.g.:               public void execute(...) { // executed by an scheduler each x minutes         final int now = (int) TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis());         final int alignedTime = now - now % getFrequency() ;         final int startTime = alignedTime - 2 * getFrequency();          final int endTimeSecs = alignedTime - getFrequency();          uploadData(target, startTime, endTimeSecs);     }      Most parts of the application are unit-tested independently of time (in this case, `uploadData` has a natural unit test), but I was wondering about best practices for testing time-bound parts that rely on `System.currentTimeMillis()` ?


title: Is 'Protection' an acceptable Java class name

text: This comes from a closed thread at stack overflow, where there are already some useful answers, though a commenter suggested I post here. I hope this is ok! I'm trying my best to write good readable, code, but often have doubts in my work! I'm creating some code to check the status of some protected software, and have created a class which has methods to check whether the software in use is licensed (there is a separate Licensing class). I've named the class 'Protection', which is currently accessed, via the creation of an appProtect object. The methods in the class allow to check a number of things about the application, in order to confirm that it is in fact licensed for use. Is 'Protection' an acceptable name for such a class? I read somewhere that if you have to think to long in names of methods, classes, objects etc, then perhaps you may not be coding in an Object Oriented way. I've spent a lot of time thinking about this before making this post, which has lead me to doubt the suitability of the name! In creating (and proof reading) this post, I'm starting to seriously doubt my work so far. I'm also thinking I should probably rename the object to applicationProtection rather than appProtect (though am open to any comments on this too?). I'm posting non the less, in the hope that I'll learn something from others views/opinions, even if they're simply confirming I've "done it wrong"! EDIT: Thanks for all the responses, which have been all been helpful. I think 'Protector' fits the bill perfectly, as the class checks the license, and acts accordingly.


title: Automated tests for differencing algorithm

text: We are designing a differencing algorithm (based on Longest Common Subsequence) that compares a source text and a modified copy to extract the new content (i.e. content that is only in the modified copy). I'm currently compiling a library of test case data. We need to be able to run automated tests that verify the test cases, but we don't want to verify strict accuracy. Given the heuristic nature of our algorithm, we need our test pass/failures to be fuzzy. We want to specify a threshold of overlap between the desired result and the actual result (i.e. the content that is extracted). I have a few sketches in my mind as to how to solve this, but has anyone done this before? Does anyone have guidance or ideas about how to do this effectively?


title: Simulating a projector in openGL

text: I wish to simulate a projector screen in OpenGL, where an image is truly being projected onto the wall in real time. By this I mean if an object were to get in between the projector and the wall, that portion of the image will appear on the obstructing object. Is this functionality possible in OpenGL? And what technolgies/libraries can I implement to facilitate this development?


title: COM INTEROP Support - which is better? C# or VB

text: I keep hearing that c# is "better" than vb... but as far as I can see, aside from syntactical differences, both compile down to the same IL. I've found some good articles by googling that explain what the differences are between the two and so I feel comfortable in "diffusing" conversations between developers arguing over vb / c#. =) But I did read an article that said vb.net 2005 had better support for com interop stuff. But i'm wondering if this is still the case? This is of interest to me because we are in the middle of redesigning an old vb6 app that communicates with some older COM components. Does anyone have recent experience with .NET and COM interop? Thanks.


title: definition of Acme Developers for iPhone

text: I have heard the term acme developer of iPhone. I was just wondering, what it stands for? I think I know the meaning, it is when a developer goes to a client and present's his/her ideas for the app. Thanks for your help.


title: One Login amongst multiple ASP.NET MVC applications Questions

text: I have been working on an ASP.NET MVC 4 application that uses forms based authentication. Users are validated against a membership provider based on a provider selection on the login form. For example, at this moment there are two providers: active directory and a custom provider that calls an external web service. If the user is valid then we update information in our local users table, like last logon date, etc. If the user is valid and doesn’t exist in the local users table, we add them. Once all of this is done we set a cookie and move on to the main content. All of the controllers check **User.Identity.IsAuthenticated** and return to the login page if the test fails. Now I am told that this application is going from a single web application to a multiple application solution. Each application should exist independently from the others, share the same look and feel, and use the same login functionality. Each application can require a new membership provider to be added. We will also add data for limiting access to the applications. One user may only have access to one of the applications while another user has access to all of them. Setting up the data storage is not a problem. Sharing the layout from one application to be used in the others is not a problem either. What I am having trouble with is deciding how to “refactor” the login functionality such that adding a new membership provider and application “down the road” will not require us to republish existing applications. Right now they would also not want a single sign-on launch page for the applications. They would like for the users to go straight to an application, login, and do what they came there to do. Thus, I may go to http://site1.mysites.com, login and do my work while the guy next to me goes to http://site2.mysites.com, logs in and does his work. I am having trouble wrapping my head around the best way to do this. My first thought was a WCF web service for the login. I would have a controller action call the webservice passing the login credentials. If the login was successful, then I could get a list of applications for the user from the local storage. Adding more applications would not require us to republish existing apps due to no changes in the web service for those apps. I also keep hearing about this ASP.NET Web API stuff. Should I go that route instead? I may want to build a site around administering the local user database so having a site that hosted the web api could be an option. Is the Web API stuff wrong for this situation? If not, does it hold advantages over the WCF web service? Are there alternative methods of achieving my end result?


title: Design of input files reading when it comes to defaults/transformations

text: Suppose you have an application that reads an input file, on a language that does not support the concept of None. The input is read, parsed, and the contents are stored on a structure for later use. Now, in general you want to keep into account transformation of the data from the input, such as adding default values when not specified, or adding full path information to relative path specified in the input. There are two different strategies to achieve this. The first strategy is to perform these transformations at input file reading time. In practice, you put all the intelligence into the input parser, and your application has no logic to deal with unexpected circumstances, such as an unspecified value. You lose the information of what was specified and what wasn't, but you gain in black-boxing the details. Your "running code" needs that information in any case and in a proper form, and is not concerned if it's the default or a user-specified information. The second strategy is to have the file reader a real one-to-one mapper from the file to a memory-stored object, with no intelligent behavior. unspecified values are not filled (which may however be a problem in languages not supporting None) and data is stored verbatim from the file. The intelligence for recovery must now go into the "running code", which must check what was specified in the file, eventually fall back to a default, or modify the input properly before using it. I would like to know your opinion on these two approaches, and in particular which one you found the most frequently implemented.


title: User selection and object creation

text: I'm writing a GUI application. The user selects item from a comboBox (non editable). The suitable input data control is then enabled and user enters data. Then the appropriate object according to the comboBox selected item is created.   1. I've thought of using String[] array to display the list of choices and then using conditional statements to create the object.   2. Or create all the objects before user selects and set each object's properties accordingly after user data input. I can't think of any better way to do this so I'd like to ask if there is one. If no, the first or the second way listed above is better? Thank you.


title: Should a developer have fast-typing skill?

text: > **Possible Duplicate:**   >  How important is the ability to touch-type? We're going to hire new programmers and we just wondered should we include typing skill in our employment filters? Someone has already applied for the the vacant position, and is qualified for it. The only thing that is under doubt, is his poor typing skill (using 2 fingers and slowly). Should we consider this as a highly negative point? Or in general, should developers know how to type fast? Also I want to know how fast a touch-typist can type? Mine is 69 wpm with 95% accuracy (690 lpm)


title: Programming as fast as you can touch-type... How to get to that stage?

text: I took a test recently and found that I could touch type comfortably at around 100 wpm... and if given some sort of autocorrect/intellisense then that would be even faster (who knows maybe 150 wpm?)... I definitely do not program anywhere near that speed... This led me to wonder how exactly does one become faster at programming? Once I look at a problem and design the algorithm to solve it (the problem is solved... I know what i'm going after give or take some debug runs) why does it take so much longer for me to actually type up the program? What I found was that in general when I'm coding, until I am done typing a word... even if it is just the letter a or number 1, I cannot simultaneously think and type. What that means is that I can come up with stuff as I'm typing but I don't have the ability to look ahead. Its either one or the other... For example in writing this, I might have a feel for where this goes, but until my fingers hit the keyboard, I don't really know what I'm going to say next. How do I change this? How do I get the ability to think ahead while typing so that I can take advantage of my typing speed? Also just in general how does one become a faster problem solver? I know the usual list of practice (which I have no problem with) but is there any particular excercise one should emphasize to train their mind? For example is playing various logic games (sudoku etc...) carry much help in improving your sense of logic in other areas of programming? Sorry its a bunch of questions at once but they are all sort of related... P.S. Is it possible to use a stenograph to program? I've heard that users of stenographs can achieve blistering speeds like 200 - 300 wpm. Assuming I can somehow think faster... that would be pretty cool. Obviously fast programming != good programming. But if your always training to become a better programmer, it doesn't hurt to be able to do it fast.


title: Allowing client to select data to return via REST interface

text: I have a rest service that is essentially a proxy to a variety of other services. So if I call `GET /users/{id}` It will get their user profile, as well as order history, and contact info, etc... all from various services, and aggregates them into one nice object. My problem is that each call to a different service has the potential to add time to the original request, so we would rather not get ALL the data ALL of the time if a particular client does not care about all of the pieces. A solution I have arrived at is to do something like this: `GET /users/{id}?includeOrders=true&includeX=true&includeY=true...` That works, and it allow me to do only what I need to, but it is cumbersome. We have added enough different data sources that there are too many parameters for that style to be useful. I could do something similar with a single integer and a bitmask or something, but that only makes it harder to read, and it does not feel very Restful. I could break it down into multiple calls so they would need to call `/users/{id}/orders` and `/users/{id}/profile` separately, but that sort of defeats the purpose of an aggregating proxy, who's purpose is to make clients jobs easier. Are there any good patterns that can help me return just enough data for each client, without making it too difficult for them to filter and select what they want?


title: Can HTML injection be a security issue?

text:
I recently came across a website that generates a random adjective, surrounded by a prefix and suffix entered by the user. For example, if the user enters "123" for prefix, and "789" for suffix, it might generate "123Productive789". I've been screwing around with it, and I thought I might try something out. I entered this into the prefix field:               Click
      And, sure enough, I was given the link, then an `<hr>`, then a random adjective. What I'm wondering is, could this be dangerous? There must be many more websites out there that have this issue, are all of them vulnerable to some sort of php injection?


title: What is the best way to comment a deprecated class in Java?

text: I would like to know the best way to add a comment to identify a deprecated class in Java. Should I remove the previous comment added to the top of the class that helps another programmer to know what was that class for, or should I add it below the comment?


title: Sets Data Structure in Golang

text: I really like google golang but could some one explain what the rationale is for the implementors having left out a basic data structure such as sets from the standard library?


title: What's the purpose of 'so that' clause in user story definition?

text: A user story can be defined in a sentence like:               As a <type of user> I want <some goal> so that <some reason>      Just Google for 'user story formula' and first links all propose this formula. My question is, what is the purpose of **so that** clause? Is it there for managers? Is it there so that project managers and stakeholders can understand the priority of the item better? Why is it there? Note: I've worked with `as a <type of user> I want <some goal>` formula, and it works just well. I haven't noticed any problem in my work by implementing this format which is more brief.


title: Is it beneficial to have a long-term experience in a specific technology rather than short-term multiple ones?

text: I am currently working in asp.net and having almost 1 year of experience. Now my company wants to change my technology and wants to put me in mobile development (might be other than .net mobile development). Would this be harmful for my career? As I have heard that it is beneficial to have a long experience in a specific technology than multiple ones.


title: When did the standard for packaging Linux source code become .tar.gz?

text: When browsing open-source projects that are primarily developed for Linux systems and downloading the latest packages, the source code is always stored in a .tar.gz or .tar.bz2 file. Is there any reason for using .tar.gz or .tar.bz2 rather than something like .zip or .rar or some other compression algorithm (or even leaving it uncompressed if the project is small enough)?


title: What happened to Alan Cooper's Unified File Model?

text: For a long time Alan Cooper (in the 3 versions of his book "About Face") has been promoting a "unified file model" to, among other things, dispense with what he calls the most idiotic message box ever invented - the one the pops up when hit the close button on an app or form saying "Do you want to discard your changes?" I like the idea and his arguments, but also have the knee-jerk reaction against it that most seasoned programmers and users have. While Cooper's book seems quite popular and respected, there is remarkably little discussion of this particular issue on the Web that I can find. Petter Hesselberg, the author of "Programming Industrial Strength Windows" mentions it but that seems about it. I have an opportunity to implement this in the (desktop) project I am working on, but face resistance by customers and co-workers, who are of course familiar with the MS Word and Excel way of doing things. I'm in a position to override their objections, but am not sure if I should. My questions are: Are there any good discussions of this that I have failed to find? Is anyone doing this in their apps? Is it a good idea that it is unfortunately not practical to implement until, say, Microsoft does it?


title: Quality Assurance (Testing) in Scrum

text: I just had a Release Retrospective for my scrum team. We talked a lot about our release process. I pointed out that because our company is not able to tolerate bugs in our production environment we are not be able to adhere to the traditional scrum mantra of releasing often. In short, we are a medical company. Bugs in production can cause issues with patient care. (A rapid fix release does not help the patient that was negatively impacted by the bug.) I pointed out that scrum does not have a formal quality assurance process. (It is assumed that testing will be done during development.) I then stated that scrum has an implied expectation of bugs in production. (Based on the process of releasing early and often.) The Scrum Process people in the room said that scrum is not that way. They said that properly done scrum can be bug free in production. So here is my question: **How does testing and quality assurance work for scrum? (So that there is very low occurrence of bugs in production.)** OR **Is there documentation that bugs are expected to a small degree in Scrum (along with quick follow up releases)?** NOTE: This is for full enterprise level development. We have 6+ WCF services, several Service Buses, 4 databases, a WPF front end application and a Web Interface all written by two separate scrum teams of about 6-8 people each. _This means answers that include just coding it right the first time are not realistic._ NOTE II: I know that no software product is going to be bug free. But our release process (non-agile) catches the few that get past our development process and brings our software fairly close to the "No Bugs" level.


title: Is INT_MIN-1 an underflow or overflow?

text: I seem to remember that I was reading that   * `underflow` means you have a too small _magnitude_ that cannot be presented anymore in a type   * `overflow` means you have a too large _magnitude_ that cannot be presented anymore in a type However, in practice I perceive that the terms are used such that   * `underflow` means you have a too small _value_ that cannot be presented anymore in a type   * `overflow` means you have a too large _value_ that cannot be presented anymore in a type What is the correct meaning to use here? Are the terms defined differently for integer and floating point types?


title: Methods to encourage good behaviour when using shared servers?

text: This question was prompted by a comment left on another question pointing to this article. What Is Clean Code? I was thinking about how that sentiment can be applied to shared resources (servers, etc). What are some of the ways you've found that work to ensure that when others use a shared server they clean up after themselves?   * Delete files / folders after one time use (after a fix or upgrade)   * Leave the desktop clean of crap   * Dont install software that they can use on their desktop    * Dont create filesystem shares not needed for the solution Oh Yes, the applies mostly to a windows server environment, in a team of developers + support staff of about 25. I know there are a few ways to tackle the problem, so what have you guys found that works?


title: Distributing Contestant Entries Between Multiple Bins, Is this Knapsack?

text: I am an algorithm novice and am faced with a rather difficult problem. I am working with contests. There are   * **contestant** - individual player   * **entry** - contestants can have multiple entries into a tournament   * **contests** - abstract - has a max number of entries property   * **contests instances** - contains entries My requirements are:   1. all contestant's entries must only be grouped into one instance (they cannot span instances)   2. minimize the number of instances created.   3. If multiple instances are required, distribute the contestants among them to get as close to equal entry distributions as possible (if there are 120 entries and 2 instances selected should be distributed as close to 60 / 60 as possible while keeping each contestant's entries in only 1 instance, whoa)   4. If all entries cannot be fit into the number of instances allotted alert user.   5. There is a hard limit on the number of instances. An example end user scenario is:   * client selects a contest that has 100 max entries   * the client then selects they will pay for up to 200 entries (2 instances)   * the client registers contestants and grants entries   * suppose the client has 22 registered contestants and grants them each 9 entries (198 total entries)   * then the client registers another contestant and grants them 2 entries.   * In the above scenario the contestant/entry combination will not fit into exactly 2 instances, so we must detect that. The difficulty is fitting these blocks of contest entries into only 1 instance while respecting the hard limit on the number of instances. My current solution is extremely lackluster, right now (from what I've read I'm solving it as more of a bin packing style) I am putting the blocks of entries into the a first instance and spilling over into the remaining available instances. If there is no available space in either instance I remove single entries and merge the instances. This was working because we would only need to generate 1 instance maybe 2 every now and then and there were quite a few single entries, But now that we need to generate many instances, this completely fails. Is this an example of a multiple knapsack problem? It certainly seems like it, but I want to make absolutely sure before I start diving into solutions like http://www.or.deis.unibo.it/kp/Chapter6.pdf , because papers like that are a struggle for me and it is going to take a very large time investment to work through something like that.


title: How do you call the discipline which consist of making the right choice of language/paradigm/class diagrams?

text: As a physicist, I've learnt programming on my own. But I would like to know the name of the discipline (like algorithmics is the discipline of designing algorithms) which consists of :   * making the right choice of language/paradigm   * designing a class diagram   * organizing the different parts of a code and how they will interact between each other


title: Python - assert vs if & return

text: I am writing a script that does something to a text file (what it does is irrelevant for my question though). So before I do something to the file I want to check if the file exists. I can do this no problem, the issue is more that of aesthetics. Here is my code, I have two ways of doing the same thing.               def modify_file(filename):         assert os.path.isfile(filename), 'file does NOT exist.'               Traceback (most recent call last):       File "clean_files.py", line 15, in <module>         print(clean_file('tes3t.txt'))       File "clean_files.py", line 8, in clean_file         assert os.path.isfile(filename), 'file does NOT exist.'     AssertionError: file does NOT exist.      or:               def modify_file(filename):         if not os.path.isfile(filename):             return 'file does NOT exist.'               file does NOT exist.      The first method produces an output that is mostly trivial, the only thing I care about is that the file does not exist. The second method return a string, it is simple. My questions is: which method is better for letting the user know that the file does not exist? Using the `assert` method seems somehow more pythonic.


title: FPGA device + networking + software kit

text: Sorry for the very abstract and uncertain question, but I guess if I could ask it better I would have answered it myself. Here is the thing. I am getting more and more interested in FPGA. However, it is hard to tell where I should start off. What I want to do is to write a simple application that listens to UDP packets and sends TCP/IP packets. So I think something like Xinix Virtex®-7 FPGA will work for me as FPGA. How does that sound? I will also need a PCI card that will host it with Ethernet card on it. Obviously I am not that good in hardware on that level and won't make it myself. Are there any out of the box solutions? Also, I guess there must be a core for working with Ethernet adapter already. Am I right on that? Where should I look? Is there anything with interface close to POSIX sockets? What is the best software kit I will need to achieve that? Thank you!


title: In Visual Studio 2010, which is better to use: VS Installer or the InstallShield LE?

text: I built a VS Installer project in Visual Studio 2008. I see in VS 2010 they have InstallShield LE available as an alternative. I used InstallShield long ago as part of Borland Delphi, but haven't really looked at the latest version. I am time constrained and don't want to spend a lot of time digging into it if it's not worth it. Can anyone provide the pros and cons of using it vs. the VS Installer tool? I don't want want to have re-make my installer unless there's a really compelling reason to do so. Thanks, Michael


title: How do you design programs in Haskell or other functional programming languages?

text: I have some experience in object oriented programming languages like c# or ruby. I know how to design a program in object oriented style, how to create classes and objects, and how to define relations between them. I also know some design patterns. How do people write functional programs? How do they start? Are there design patterns for functional languages? Are methodologies like extreme programming or agile development applicable for functional languages?


title: Can Agile software development be used in projects defined by a contract?

text: I recently had a conversation with a fellow developer about Agile Software Development. While I understand the principle, it seems that continuously changing requirements creates the potential for the project to go on forever. But, at least where I work, projects need to reach completion because it's a contract. That is, the first iteration could take months, because for some projects the customer cannot use an incomplete application. For some projects, I think you need to define finished first, then you can break it into iterations and refine your definition after each iteration. But you _must always_ have this definition. If Agile Software Development embraces changing requirements how do you know where it ends? How can you budget for a project when the end result is always changing? Is Agile Software Development more about an agile process, than an agile product?


title: Relationship between "Task Parallel Library" and "Task-based Asynchronous Pattern"?

text: In the context of C#, .NET 4/4.5 used for an application running on a web- server, what is the relationship between "Task Parallel Library" and "Task- based Asynchronous Pattern"? I understand one is a library and the other is a pattern. But to dig deeper, is it like "The library is used by the pattern to enforce good practices". I'm also not clear if both are supported in .NET 4.0 (with `await` and `async` keywords) Edit: Seems that `await` and `async` are only in .NET 4.5 ...


title: Help me understand a part of Java Language Specification

text: I'm reading part 17.2.1 of Java language specification: http://docs.oracle.com/javase/specs/jls/se7/html/jls-17.html#jls-17.2.1 I won't copy a text, it's too long, but I would like to know, why for third step of sequence they're saying that `If thread t was removed from m's wait set in step 2 due to an interrupt` Thread couldn't get to step 2 it wasn't removed from wait set, because it written for the step 1: `Thread t does not execute any further instructions until it has been removed from m's wait set` Thus thread can't be removed from wait set in step 2 whatever it's due to, because it was already removed. Please help me understand this.


title: What is a Ruby on Rails way to save images?

text: I develop on iOS, and I'm switching from a PHP backend to Ruby on Rails. The interchange format is JSON. A quick Google search for 'save images in Rails' has nearly every result talking about saving image data as blobs to the database. I might be mistaken, but I'm under the impression that saving image data in a database is a huge waste of time and space (as opposed to saving a link to the file location ('/img/subcat/4656.png'). In PHP, it's pretty standard to receive the data, generate a filename, save that file to disk, and update the database with the image's location on disk. Is this the same for Ruby on Rails, or is there some built-in ActiveRecord image functionality I'm not aware of?


title: Counting product releases if you work on the backend/online services?

text: I am trying to update my resume, and I would like to count the number of "product releases" that I was directly involved in with a company. It would seem to serve as a performance metric. The problem is that I was working on the backend of a very large distributed system, like along the lines of Hadoop or other huge database. We had regular 6-month major releases and other minor releases. My manager kept saying that we "shipped" these releases, but "shipping" a product to me sounds like releasing single pieces of software, like Microsoft would ship Office 11 or something. Any ideas on "product releases" for backend service engineers, or any other type of performance metric?


title: Programmer VS Commercial Systems (ERP)

text: My question here is relative to jobs for programmers. Why does employer still contract programmers if today we have a lot of good commercial system avaliable on the market? I want to be very clear at this point, this question is relative only to a system, more specially to ERP systems. Maybe this question looks a little bit useless, but right now I'm working and this doubt arose to me and my boss. I have a few answers to my own question, but I really would like to speculate this subject a bit more. Also I know, every good company needs a customized system, but ... the question is here. :-) Any answer will make me feel better. Thanks.


title: Best Practices: Database app programming patterns

text: I have written many database (MySQL) web apps so far but I always think my structure is kinda clumsy. I want to improve the programming/design pattern I use, hoping for some advice here. Particularly, I cannot find a structure that complements an OOP approach that encapsulates the implementation of the database (schema). I Think my question can be best explained by example. There are 2 approaches I use now say I have an Invoice object/class: first is to use static member functions               class Invoice     {        int id;        string ref;        int customer_id;        date created;        date due;             static id create();        static bool update(id, field1, field2, ...);        static bool delete(id);        static bool get(id);     };      The second approach is to put every thing in a database object:               class Database extends ProprietaryDBConnecter, Singleton     {        id createInvoice();        bool updateInvoice(id, field1, field2, ...);        bool deleteInvoice(id);        bool getInvoice(id);             id createCustomer();        bool updateCustomer(id, field1, field2, ...);        bool deleteCustomer(id);        bool getCustomer(id);             // etc...     }      I find that both ways the (SQL) member functions are very much unseparable from the "view", in that the "view" determines what the classes needs to have and hence seems to break the document/view architecture. Also, it seems kind of inefficient for example a SELECT statement should only select what is needed, but the presence of member variables in Invoice seems to imply "guaranteed data". Don't know if I explained the question clearly, What are some other best approaches to this architecture/design pattern/what-it-is-known-as? Thanks for advices


title: How to quantify benefits from a programming training?

text: I'm conducting a programming training for 3 months. Details in this link - Programming Training Details. My question is "How do we quantify benefits from such training?". I think the two important factors to focus on are   - Quality of Code   - Productivity  My current thinking is on the lines of having the group solve a problem on day 1 of the training and compare it with how the group solves a similar problem on the last day of the training. **Edit 1 :** Thanks for the feedback. This is a program which I have plans to extend to other teams if it is successful. And there by the thoughts on how to quantify benefits. I agree that all the replies saying "Its difficult to quantify!" and I had further discussions outside which helped me understand that measuring might even be counter productive.


title: Why OOP is enforced in Java and C#?

text: In many other languages like C++ and Javascript, OOP is optional. Procedural code is ok. But in languages like Java and C#, OOP is somewhat enforced. Everything is to be a part of a class or an object. What are the benefits?


title: Types in Lisp and Scheme

text: I see now that Racket has types. At first glance it seems to be almost identical to Haskell typing. But is Lisp's CLOS covering some of the space Haskell types cover? Creating a very strict Haskell type and an object in any OO language seems vaguely similar. It's just that I've drunk some of the Haskell kool-aid and I'm totally paranoid that if I go down the Lisp road, I'll be screwed due to dynamic typing.


title: Is currying too complex a tool to actually use?

text: Today I feel like I finally grokked currying (in Javascript), and of course, like any programmer who has learned a new trick, my mind immediately began racing over how to improve my current codebase using it. And again, like any programmer, the little voice shouting "[new trick] all the things!" was silenced by another saying, "[new trick] is really complex. maybe you shouldn't use it." Curry is sugar, essentially, after all. I understand that there's nothing wrong with using a feature in moderation, especially one as mind-bending as currying, but for the sake of simplicity should I avoid using it if something equally as efficient is sufficient?


title: Conways Game of Life C#

text: Not sure if this is the correct place for this question or SO - mods please move if necessary. I am going to have a go at creating GoL over the weekend as a little test project : http://en.wikipedia.org/wiki/Conway's_Game_of_Life I understand the algorithm, however I just wanted to check regarding the implementation, from maybe somebody that has tried it. Essentially, my first (basic) implementation, will be a static grid at a set speed. If I understand correctly, these are the steps I will need:   1. Initial seed   2. Create 2d array with initial set up   3. Foreach iteration, create temporary array, calculating each cells new state based on the Game of Life algorithm   4. Assign temp array to proper array.   5. Redraw grid from proper array. My concerns are over speed. When I am populating the grid from the array, would it simply be a case of looping through the array, assigning on or off to each grid cell and then redraw the grid? Am I on the correct path?


title: Is there a downside to using Access as a database?

text: I have inherited an application that stores data in multiple tables in Microsoft Access; the Access DB is only used for storage, all data processing is handled by the app (VB.net). Is this good practice? I need to build a similar app from scratch and am unsure of what is 'normal' practice. I have tried Googling the question in various formats and checked through numerous results (including many on this forum) but all questions seem to relate to where you are programming within Access rather than simply using it for data storage. I guess I could be more specific and say would SQL Server Express or similar be a better option and if so why? If you are reading this post due to having a similar question then check out this link provided by @DanielB below - http://stackoverflow.com/questions/694921/ms-access-mdb-concurrency


title: Reporting and handling asynchronous process errors to a client

text: I have a product with two separate applications. The core of the product lives in the database (oracle) and runs according to a schedule. The other is a client application (currently ASP.NET MVC3) used to manage the database application. There are three levels of validation going on; client, server- side, and database before the client data is saved to the database. However, there are cases where pieces of the data set are currently valid but could become invalid at some point in the future. In these cases rather than abort the entire (lengthy) data input process, we just place the process for the data set on hold until the data either becomes valid, or is updated to a valid value. The error might be something like, "Hey, you scheduled the copy process of data Foo to location X, and then grant access to user Bob. The Bob user account you originally selected is no longer valid, what would you like to do? 'Cancel the Copy Request' 'Change the User' or 'Wait'". Is there a best practice for storing and reporting error conditions (fixable by the user) and exceptions (not fatal and not fixable by the user) back to the client from the database? For example:   - Database starts process A   - Database selects data set Foo   - During process an error or exception is encountered   - Database stores the error or exception   - Database handles the abort for process A with data set Foo   - Database continues process A with next data set until all data sets are processed   - Database completes process A  Then some time later:   - User logs in to client application at a later time (after the weekend?)   - User receives notification that an error or exception occurred  My first thought is some sort of db table storing various fields (event_ time_stamp, process, event, object_type, object_pk, event_code, additional_details, status, last_updated). Then setting up client-side templates (i.e. hard coded with parameters) for each error code and presenting those to the user...but there has to be a better way? Ideally I am looking for a solution that will allow the client to provide helpful UI options that will aid the user in possibly resolving the errors. What solutions have you found to this problem? Would something like NServiceBus or MassTransit work? EDIT: There are two different requirements here. The first to store the exceptions, and the second to report (and possibly take action on) them.


title: Is using xml + xsl to create a weekly html email a good or bad idea?

text: The guy who is in charge of our html emails is leaving and I have been asked to take over. We are an online retailer and send out an email once a week. An email will consist of a main image, a bit of an opening paragraph and then rows of product offers. As everyone knows html emails are painful to work with due to the archaic html and css you need to deal with. When something needs changing last minute it's a real pain to wade through the spaghetti of td's to get to the link that needs it's url and tracking code changing and the opportunities to make a mistake are plentiful. So I've decided to create an `xml` file consisting of all the data that needs to go in the email. For example, the products would be recorded like this:               <products>         <product id="1">             <title>My Product</title>             <image width="160px" height="160px">                 <alt>My Product</alt>                 <url>http://somedomain.com/emails/image1.jpg</url>             </image>             <link>                 <term>my_term_for_google_analytics</term>                 <url>http://somedomain.com/products/1</url>             </link>         </product>         <product id="2">             <title>My Second Product</title>                  ... etc ...         </product>     </products>      I could then use an `xslt` template to create the email. The advantage of this is that when a product goes out of stock the morning the email is due to go out I can just change a bit of text in the `xml` file, generate the html and we're good to go again. I can also use the same `xml` to create a microsite for the email. The trouble is I've had a good ol' Google about this and I can't find anyone else who has really tried this. So I'm either a visionary genius or an idiot. It usually turns out I'm an idiot so has anyone else had any experience of creating html emails from `xml` using `xslt` or can anyone see any major pitfalls with this approach. Is it a good idea? Disclaimer - I don't really think I'm a potential visionary genius.


title: How would you practice concurrency and multi-threading?

text: I've been reading about concurrency, multi-threading, and how "the free lunch is over". But I've not yet had the possibility to use MT in my job. I'm thus looking for suggestions about what I could do to get some practice of CPU heavy MT through exercises or participation in some open-source projects. Thanks. Edit: I'm more interested in open-source projects that use MT for CPU-bound tasks, or simply algorithms that are interesting to implement using MT, rather than books or papers that only describe the tools like threads, mutexes and locks, or how MT can be used to have responsive GUIs...


title: Is a single object to be preferred over multiple variables?

text: It was quite hard to put what I meant into a title, but it's easy to put into code. **C++** Is this               int offset_x = 10;     int offset_y = 40;     ...     element.move(offset_x, offset_y);      To be preferred over this?               Vector<int> offset(10, 40);     ...     element.move(offset.x, offset.y);      (Note that Vector is not like `std::vector`, it's a 2D vector. This class has lots of methods I don't need here, like `normalize()` and `scale()`. Should I have a more basic `Point` class for this?) **JavaScript** Is this               var offsetX = 10;     var offsetY = 40;     ...     element.move(offsetX, offsetY);      To be preferred over this?               var offset = {x: 10, y: 40};     ...     element.move(offset.x, offset.y);


title: What's the benefit of avoiding the use of a debugger?

text: Over the course of my career, I've noticed that some developers don't use debugging tools, but do spot checking on erroneous code to figure out what the problem is. While many times being able to quickly find errors in code without a debugger is a good skill to have, it seems it's less productive to spend a lot of time looking for issues when a debugger would easily find little mistakes like typos. Is it possible to manage a complex without a debugger? Is it advisable? What benefits are there to be had by using "psychic debugging?"


title: How do you use Roundup issue tracker?

text: Roundup issue tracker is pretty minimalistic by default, and it does not bring any specific workflow with itself. It was once called ‘so configurable that it’s probably better described as a lightweight tracker-oriented framework.’ Have you ever used Roundup extensively or seen some interesting use cases? If so, please share an example. (If you don’t consider your workflow special enough, at least tell how do you understand & utilize `superseder` field in the default ‘classic’ template, which alone could be interpreted differently—see _old.nabble.com/Superseder- td13792131.html_ )


title: What's the proper way of dealing with a global file path?

text: I don't have compilable code, because the code in question depends on a large function that's irrelevant to the question, but say I have the following scenario:               savePath = "C:\\..."          changePath1, changePath2 :: String -> String          changePath1 passedPath =         'Do something with passedPath'          changePath2 =         'Do something with savePath'          let newPath1 = changePath1 savePath in ...     let newPath2 = changePath2 in ...      Is it more proper to set up functions like changePath1 (where the global path is passed in), or changePath2 (where it just internally uses the global path) If the functions had a chance of processing more then 1 path, obviously I'd use changePath1, but in my current program, there is only 1 path to deal with, so it seems simpler to just have all the functions internally know the global path instead of constantly passing it in. Thank you


title: Is it worth cross-browser testing in GWT applications?

text: as **GWT** is supposed to abstract all the browsers implementations (for widgets, etc) is it worth doing cross-browser testing? I was just thinking to test only the styling related stuff (CSS related) in different browsers. Any opinion on that?


title: How much of original code is left in modern software products?

text: Many of you out there work for large companies that ship well-known software. I was wondering, how much of original code (basically, code that was "v1.0" release) is left in modern massive applications, such as, say, Firefox, Photoshop, Windows, Linux, etc? I'd really prefer first-hand experience and real-world war stories. Thanks for satisfying my curiosity. **EDIT** Turns out there's a degree of misunderstanding. What I'm after is basically as follows: when you blame/annotate source code, are there any parts or even whole files untouched since the initial 1.0 release.


title: Advice and resources on collaborative environments

text: I need some advice on collaborative software environments. More specifically, I am looking for books and reference materials that can aid me in understanding team and code structures and the interactions thereof. In other words books, blogs or white papers explaining:   * Different strategies for structuring teams that share common code between each other but have distinct individual functions?  To summarise my question I would like to know what would be a good source of knowledge if I were to set up teams in an organisation that shared code but each unit still remained autonomous. I have done some research on this subject and explored:   * code review tools,   * distributed VCS,   * continuous integration tools,   * Unit testing automation. The tough part about implementing these tools are to determine where a good place would be to start, which tools are low hanging fruit, which tools or methods provide higher success rates. If someone asks me about code quality reference I point them to Code Complete. I am looking for an equivalent guide on software team structures and tools to make this equation work better. I realise that this question is quite vague but it arose as "we need to share code between teams without breaking each others stuff and causing management headaches and reams of red tape" The answer is definitely not simple and requires changes on many levels, hence the question. If the question is too vague please vote to close or delete. I would accept any good starting point as an answer.


title: Find the peak of each islands in sparse matrix

text: I have a sparse matrix that contains several islands of unknown size. I would like to find the highest peak of each islands. Consider this matrix as an example:               0 0 1 0 0 0 0     0 0 1 2 1 0 0     0 0 0 3 2 1 0     0 1 0 0 0 0 0     0 2 3 4 0 1 0     0 0 1 1 0 1 0     0 0 0 0 0 1 0      In this case I would like to get the position of 3 at (3, 2), the position of 4 at (3, 4) and the position of 1 at (5, 4), (5, 5) or (5, 6). Note: I consider 4-connected neighbours. Until now I came up with the solution that scans each pixel and if it is not zero it starts a flood fill from that pixel. The flood fill paints the pixels to zero keeping track the maximum value visited. This algorithm works well but I was wondering if there are any faster solution? In my target platform (iOS) I have access to different vector processing frameworks like BLAS, LAPACK, vDSP that provide some functions for fast finding the maximum value in a vector (or matrix). Maybe one could implement a faster solution with the help of these functions?


title: Why are the version / build numbers different for Mylyn?

text: At projects.eclipse.org Mylyn Build 1.1.0 is slated for June 2013. At www.eclipse.org/mylyn The "news" says Mylyn 3.8.3 was released on March 1st. Why is there little or no correlation between the two?


title: What aspects of "maintainability" can influence choice of IS implementation technology?

text: **Background** : I'm an apprentice and am handling the project of developing a particular IS-System. Currently I'm only managing the requirements analysis and the information-processes design, but as a Software Developer, I would also like to implement the concept as an actual Web-Portal. When it comes to choice of technology, I personally would like to build my front-end based on JavaScript Frameworks(jQuery, Bootstrap, DataTables.Net, ...) which offer high front-end implementation flexibility and nice out-of-box modern design, and wire these to .NET MVC in the code-behind. The people around me, who haven't written a line of code in what seems like decades, all fret about difficulty to maintain such a system, in comparison to using .NET Controls and sticking to the MS Web-Site development Package. So whenever I try to bring up, that I could build a nice-looking, user-friendly, modern portal, once we're done with the first concept-phase, I just get concerned looks and a mumble about "maintainability" and "we'd prefer trying to use Sharepoint Analysis Services connected to our DB". **Question** : what aspects of " _maintainability_ " can influence choice of System implementation technology? **Goal** : I would like to sit down and "prove" that my approach is just as maintainable as what they are suggesting, and if it isn't I would like to identify ways to improve it. * * * Questions I found interesting:   * JavaScript codes complexity and maintainability   * How does one meaningfully measure maintainability?   * How to have a maintainable and manageable Javascript code base   * What characteristics or features make code maintainable? (!)    * What hurts maintainability? (!) Some abstract aspects of maintainability:   * readability   * coupling   * consistency   * the reasoning behind code is documented


title: Does anyone have any idea how Java decides the names of the converters?

text: Making reference to this link In particular, what made them decide to pick 'tl' as the converter symbol for hour... It seems so random. I understand why they've decided on 'te' (it's because 'e' comes after 'd' in 'td' and d is the first letter of 'day'). Edit: Oh come on, why the downvote? I'm asking something that might not be important but it does nag on me


title: Problems with Facades and then evolution in software

text: I initially started a project with Facades and Polymorphism as a way to create simple extensible design following SOLID Principles. Here is a sample code:               public interface IInterface     {         void FillList(List<InputPocoObject> listOfInputObjects, out List<OutputPocoObject> ListOfOutputObjects);     }          public class SampleClass : IInterface     {              public void FillList(List<InputPocoObject> listOfInputObjects, out List<OutputPocoObject> ListOfOutputObjects)         {             //some data layer code              //and a for loop to fill OutputPocoObject object and add it to list         }     }      I have number of classes such as above which are created in runtime with the help of factory( not shown here for the sake of simplicity) Recently after couple of months I see that there are different requirements emerging in my project, which I attempted to solve by the help of Polymorphism and I see that I am stuck with violating DRY principles. Here is a sample code of this situation:               public class SampleClass2 : IInterface     {              public void FillList(List<InputPocoObject> listOfInputObjects, out List<OutputPocoObject> ListOfOutputObjects)         {             //some data layer code              //and a for loop to fill OutputPocoObject object and add it to list             // there is a property in OutputPocoObject which is set to 1         }     }               public class SampleClass3 : IInterface     {              public void FillList(List<InputPocoObject> listOfInputObjects, out List<OutputPocoObject> ListOfOutputObjects)         {             //same code as above              //with only one difference that  property in OutputPocoObject is set to 5 here         }     }      One Simple solution will be to add a control parameter to interface such as:               public interface IInterface     {         void FillList(List<InputPocoObject> listOfInputObjects, out List<OutputPocoObject> ListOfOutputObjects, int controlParameter);     }      but I don't know whether this is such a better idea? Or whether it might introduce some complexity in my design?


title: Creating a System Sequence Diagram from an [extended] use case

text: As I have been taught - one controller = one use case. But I have:   * OutsiderController   * SupplierController (which extends OutsiderController)   * SubContractorController (which also extentds OutsiderController) And I want to do the SSD for `SupplierController` and `SubContractorController`. What do I do? Do I write in both SSDs the methods from `OutsiderController`?


title: How to categorise information in end-user documentation?

text: One of the greatest piece of documentation I ever read is _the TeXbook_ by Donald Knuth—the manual of the _TeX_ typesetting system, and I used it in my first analysis. As far as I can tell, the type of information conveyed by documentation falls in three categories: _recipe,_ _reference_ and _expert knowledge_ that I describe hereafter. Which categories am I missing? ## Recipe A recipe answers a question like “how do I solve that problem with this software?” and binds the _problem world_ with _software features._ Chapters 3, 7 and 8 in the _TeXbook_ answer questions like “How do I run TeX?” or “How do I type text?” and provide the user with recipes. Other software packages often contain installation or backup procedures that fall in this category. ## Reference A _reference_ documents all the needed details on some piece of software. It is useful for the user knowing that “this feature is useful to solve that problem” and wanting to know if it can parametrise “this feature” to solve a close problem. It is also useful for troubleshooting the software when it gives unexpected results. Chapter 14 “How TeX Breaks Paragraphs into Lines” in the _TeXbook_ is an example of a reference text. UNIX manual pages almost always belong to this category. ## Expert knowledge Expert knowledge pertaining to the problem solved by the software also belong to the software documentation. Reasons for this are at least:   1. Users are not experts in the area where the software is useful.   2. Experts use varying terminology and methodologies to describe or solve problems. For 1. mathematicians reading the _TeXbook_ also learn the _basics_ of design and layout: they get aware that there is a structured knowledge in this area and learn the names of the basic concepts involved, so that they can phrase out problems and get help. For 2. it is useful to “fix the notation” in the software documentation and this is best done by providing some high-level or background information. Hence expert knowledge contained in the user documentation binds the conceptual organisation of the problem as it is known to the software designers to the conceptual organisation of the problem as it is known to the software users.


title: what do programmers dealing with data driven/machine learning related programming need?

text: Given the increasing amount of data generated through different web services ( social network, etc), there are must be more and more programmers who are familiar with machine learning and/or statistics needed to write programs to deal with those data. I wonder if any one working in related jobs could briefly describe what are the possible daily activities. Is it more like a traditional software engineering or is it more like working as a statistician? I am personally interested in machine learning and programming. If I want to work in jobs like this, should I spend more time learning statistics or more time in the traditional software engineering side?


title: Saving mobile application data when no service?

text: Say I have a mobile application that allows users to enter information which is then uploaded to a central location. I had planned on building this using only HTML5 and javascript (non-native app), but I'm assuming if someone is in an area where there is no service they simply will not be able to use the app. As a work around would it be possible to write a native app that saves the information on the device and then uploads it whenever service returns? If so, is it possible to write a native app entirely in HTML5 and Javascript that does this?


title: What should I look for in a school when trying to obtain a Software Engineering degree?

text: My goal is to be as employable as possible and to have enough knowledge not to look foolish when interviewed. However, that's probably everyone's goal and it's not achieved simply by taking classes in the University -- you have to put in some of your own time as well (which I do). I'm in process of obtaining my Associates degree in Computer Programming through a local community college. There are several options for me to choose from in the area, such as Cal Poly Pomona, CSU San Bernardino, UC Riverside, and a few other schools in that general area (one of them is CalTech Pasadena, but I hear it's very hard to get in...even with my 4.0 GPA). Of course, there is plenty of information ranking schools, but nothing really explains on what to look for in a school when choosing a particular area of study. I'm interested in Software Engineering. I might branch of into AI, but that's up in the air as of right now. I think for Bachelor's I'd just go with general Software Engineering, unless I find a specific area I want to commit to. I'm definitely aware that student-to-teacher ratio is a huge point to consider when choosing a school. But what other things should I take into account? Should I choose a school that's more focused on theory, such as UCR, or a school that takes a hands-on approach such as CalPoly Pomona? What have you seen in the industry that would point as one being superior over the other? What is your own experience? Education is not cheap and I have a family to support (I work full time and go to school), so, I want to make sure that my investment is justified. That being said, I make a decent salary, so I can afford to invest into education, as long as it's not wasteful. I'm reaching out to those of you who have first- hand experience in these matters to assist me with some tips and answers to the above questions. I hope I am being clear with my goals and what I'm trying to find out; if clarification is needed, please let me know (I just got done with a 12-hour shift, so I'm a bit drowsy, heh).


title: Is the architecture of my project a common one? What's its name?

text: I am responsible for a software project for a few years now (a Java desktop application, which is mostly event-driven). I started it from scratch, and at the beginning of this project I made some strong choices on the architecture of the software. ## My architecture I introduced the `Module` class, which represents a functionnal part of the application, with a well-defined responsability. The only thing a `Module` exposes to the world is a set of "communication handles". There are 4 types of communication handles :   * an `Emitter<T>` can emit a message of type `T`.   * a `Handler<T>` can receive a message of type `T`   * a `Puller<R, Q>` can make a query represented by a message of type `Q`, and will receive a response message of type `R`   * a `PullServer<R, Q>` can receive a query represented by a message of type `Q` and will send back a response message of type `R`. Then, at the beginning of the execution of the application, I instanciate all the modules that compose the application, and I set up all the connections between them. An `Emitter` can be linked to one or many `Handlers`, and a `PullServer` can serve one or many `Pullers` (the types of these two endpoints must be compatible, of course). All the classes used to represent a message are immutable, and are defined in one subproject. Every `Module` depends on that subproject, and nothing more. This makes the `Modules` very decoupled (a `Module` knows nothing about the other `Modules`, and their input/output to the outside world very clear). Also, the dynamic aspect of the application (the dataflow) is defined in a unique place, in the `main` function. Also, it is super easy to test a `Module`, we just have to provide fake `Emitters` and `PullServers`, and plug it to the `Module`'s `Handlers` and `Pullers`. ## My thoughts on this architecture So, this is the first "big" software project I work on, and I made up this design because it felt like the right thing to do. Now, the project is working just fine, with a total of 57 `Modules` working together. One of my co-worker, who joined the project recently, asked me if this was a common architecture, if there was a name for such a design. I don't have an answer, since I am not really familiar with other real-world software architectures. It seems to me that this design is close the the concept of Actors, that we can find in languages such as Scala (and maybe Erlang). However, Actors do not provide the decoupling provided by my design. And Actors have an additional capability : each Actor has its own message queue, and its own thread of execution (kind of). Also, I think my design is somewhat related to the Dependency Injection pattern, in the sense that dependencies between the `Modules` are defined in a central place. However, this pattern deals with interfaces, not with messages. It does not define how the modules communicate (notification, request/response). ## The question (finally !) Do you know of a software project that's architecture is similar to mine? Is there a name for that? ### Edit @Doc Brown suggests that this design is similar to the Flow Design. I cannot agree more. Here is a one to one comparision between those two designs :   * My _Module_ is the same thing as a _Functionnal Unit_.   * My _Emitter/Handler_ are the same as the _Output-pin/Input-pin_ , except mine don't have a name. In my design, the "communication handles" are only identified by their types.   * The connections between my Modules is the equivalent of their _wires_.   * My _Puller/PullServer_ is similar to their _Dependency relations_. However, they say there is an explicit dependency from the caller to the callee. In my design they are decoupled.   * They define the concept of _Boards_. That's interesting, I think I'll borrow this idea !   * They define the concept of _Configuration_. I do have the need for configuring a Module in my program, and for that I define a configuration Handler on some of my Modules.   * Both solutions are synchronous.   * I don't have the concept of _map_ and _join_. But I don't feel the need for it. Well found, Doc !