title: Looking for the fastest way to collect form data

text: I am developing an application in Flex. There are 20+ 'pages', each with its own form. I need to collect all the entered data and pass it to an API method. What I am wondering is when I should begin to pass the data and what the best way to collect it might be. I was thinking of instantiating a class               public class myCollectorClass      The API method has 10 parameters, 4 of which are not determined by the forms. Of the 6 remaining parameters, 5 are simple strings with few options. Those are not the difficult part. It is the last parameter that is the most difficult to work with:               public var myDataSet:DataSet[]; //DataSet is a data type from the API      The forms fall into two categories: Geographical Data which controls the geographical area of the API return values. And Search Data which controls the type of data returned within the geographical parameters. For instance, if you are looking for an IT company in the US Zip code 93003. As you can see, the geo and search parameters are arrays not simple strings and a typical collection will contain multiple zip coes, area codes SCBA codes etc., as well as hundreds of search parameters. Would it be better for me to pass each selected value to the array each time a value is entered?               btnAddParameter.addEventListener(Event.CLICK, dataHandler)      Or pass all of the values at the end right before an order is placed?               for each dataContainer in myClass     {         var dataObj:Object;         dataContainer.value = dataObj;         myParamArray.addItem(dataObject)     }


title: Name for this antipattern? Fields as local variables

text: In some code I'm reviewing, I'm seeing stuff that's the moral equivalent of the following:               public class Foo     {         private Bar bar;              public MethodA()         {             bar = new Bar();             bar.A();             bar = null;         }              public MethodB()         {             bar = new Bar();             bar.B();             bar = null;         }     }      The field `bar` here is _logically_ a local variable, as its value is never intended to persist across method calls. However, since many of the methods in `Foo` need an object of type `Bar`, the original code author has just made a field of type `Bar`.   1. This is obviously bad, right?   2. Is there a name for this antipattern?


title: Importance of certifications for Java programmer without BS degree?

text: I've read some posts here and other places about how a lot of people don't put much value in certifications but I am beginning to think it may be necessary for me at this point to be able to move to a bigger company, etc. I currently work as a Java programmer with a startup and worked with a small company before that. Now that I'm applying with larger companies the hr people / recruiters have been asking a lot about certifications and some have directly suggested that someone in my position should probably get a few (they were trying to be helpful) since I haven't completed a BS degree yet (I bounced around a bit in college and ended up not finishing but have enough units to finish eventually, just its not something I can do nearly as easily as getting certifications). Anyways, just curious about what people think for someone in my situation where I do have an interested in working for large companies and do not currently have a BS degree (but do have experience already in the field). Any advice on which certifications beyond the SCJP would be appreciated as well


title: What are some good small-scale refactoring tests?

text: I'm looking to test potential candidates on their ability to develop concise, reusable code. I feel like a good test of that skill would be to give them a very small scale application or class hierarchy with problems ranging from obvious to complex, and have them take a shot at re-factoring it (or at least verbally explaining some things they would change). I would be looking for things like application of object-oriented design principles, use of design patterns, re-usability, showing clear intent, etc. Before I try making this myself, I'm wondering if anyone could suggest some existing template programs that people have created for the same purpose. I don't care too much about the language, but C# or Java would be preferred because of their wide use. Thanks in advance!


title: Performance of concurrent software on multicore processors

text: Recently I have often read that, since the trend is to build processors with multiple cores, it will be increasingly important to have programming languages that support concurrent and parallel programming in order to better exploit the parallelism offered by these processors (see e.g. this video for some background.). In this respect, certain programming paradigms or models are considered well- suited for writing robust concurrent software:   * Functional programming languages, e.g. Haskell, Scala, etc.   * The actor model: Erlang, but also available for Scala / Java (Akka), C++ (Theron, Casablanca, ...), and other programming languages. My questions:   * What is the state of the art regarding the development of concurrent applications (e.g. using multi-threading) using the above languages / models? Is this area still being explored or are there well-established practices already?   * Will it be more complex to program applications with a higher level of concurrency, or is it just a matter of learning new paradigms and practices?   * How does the performance of highly concurrent software compare to the performance of more traditional software when executed on multiple core processors?   * For example, has anyone implemented a desktop application using C++ / Theron, or Java / Akka? Was there a boost in performance on a multiple core processor due to higher parallelism? **EDIT** NOTE that I am not asking for your opinions or for debate but for concrete experiences or information. For example, has anyone written a Scala or Haskell program, compiled it with existing state-of-the-art compilers, and   1. Run it on an Intel Core i3 and measured a certain performance (e.g. 10 seconds on certain input data).   2. Run **the same** bytecode or binary on an Intel Core i5 and observed a performance boost (e.g. 6 seconds running time) due to the parallel computation of sub-expressions which is possible in functional code? **EDIT 2** SUMMARIZING. Up to now making faster processors meant increasing the clock speed, and no changes in programming paradigm were needed. In the last few years making faster processor has meant adding more cores but this requires we write software differently. My question is whether software developers are starting to switch to new programming paradigms and whether this is bringing the expected performance boost on multiple-core processors.


title: What is the best unit test framework for .NET and why?

text: It seems to me that everyone uses **NUnit** without even considering the other options. I think this is because:   * Everyone is familiar with it already so they won't have to learn a new API.   * It is already set up with their continuous integration server to work with NUnit. Am I wrong about this? I decided to use **xUnit** on one of my own projects recently and I love it! It makes so much more sense to me and conceptually it seems like a definite step forward from NUnit. I'd like to hear opinions on which framework is actually the best - not taking into consideration having to learn it or reconfigure your automated testing.


title: Oracle has some very helpful and free code...I think

text: I found that some of the code that Oracle uses is very useful so I don't have to re-invent the wheel. Given this is at the top of the file where the code in question is:               /*     * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.     * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.     *     * This code is free software; you can redistribute it and/or modify it     * under the terms of the GNU General Public License version 2 only, as     * published by the Free Software Foundation.  Oracle designates this     * particular file as subject to the "Classpath" exception as provided     * by Oracle in the LICENSE file that accompanied this code.     *     * This code is distributed in the hope that it will be useful, but WITHOUT     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or     * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License     * version 2 for more details (a copy is included in the LICENSE file that     * accompanied this code).     *     * You should have received a copy of the GNU General Public License version     * 2 along with this work; if not, write to the Free Software Foundation,     * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.     *     * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA     * or visit www.oracle.com if you need additional information or have any     * questions.     */      If I leave the text intact, put it in my C++ header, and credit oracle for each method, and package the source into a static library...is it still a no- no?


title: How to improve testing your own code

text: Today I checked in a change on some code which turned out to be not working at all due to something rather stupid yet very crucial. I feel really bad about it and I hope I finally learn something from it. The stupid thing is, I've done these things before and I always tell myself, next time I won't be so stupid... Then it happens again and I feel even worse about it. I know you should keep your chin up and learn from your mistakes but here's the thing: I try to improve myself, I just don't see how I can prevent these things from happening. So, now I'm asking you guys: Do you have certain groundrules when testing your code?


title: Assessing Relative Maintainability

text: We (a contractor, actually) are implementing an off the shelf system to replace a legacy homegrown system for the core domain of the company (designing widgets). Unfortunately both systems will have to run concurrently for some time, as the product just isn't ready yet. Also, the decision was made to only migrate some of the widgets from the legacy system, based on date of last sale activity. Later on a new requirement came down: certain people in the company, most of them outside of the widget development context, want to search _all_ widgets. The search results screen has 3 pieces of data: a GUID, a human readable id that is searchable, and a brief description (may need to be searchable in the future). In the widget details, there will be multiple screens. These screens align very well along SOA / bounded context lines - a screen for marketing data, a screen for sales history, etc. UML ahead! I am probably using the wrong kind of arrows here so please forgive me. The current solution - which is not in production yet - is something like the following: ![Current Solution](http://yuml.me/9c61dafe) Both systems will be queried and the controller will merge the results. The new system has its own proprietary query language (we've alleviated this a bit with a LINQ provider). It also puts a _lot_ of data on the wire. 15 search results typically run about 60k of unintelligible SOAP-wrapped xml. So I would prefer to avoid querying this system directly. These two systems publish events to help us integrate with other systems, mainly an ERP system. One of these events contains all the data necessary for the search screen. I proposed the following alternative: ![Proposed Solution](http://yuml.me/e3678913) However I am being told that 'adding another database' will create more maintenance down the road. However, I believe this to be false, as I had to add a relatively simple feature that took several hours longer than anticipated because of this merging code. I want to get a feel for which system is more maintainable in the long run. I personally have not had the burden of maintaining any large system. I want something more than my gut. Specifically I'd like to know if having more, specialized physical databases is more or less maintainable than having less larger physical databases.


title: Design pattern for modifying state and notifying the other modifiers without a loop

text: The idea is that I have a set of properties that represent possible options in the app. These options can be modified through a variety of different ways, such as from the UI, remotely, third party, etc... Each time one of these modifiers alters the state, the other modifiers need to be notified. E.g.: If the user marks a checkbox in the UI, the remote modifier and the third party need to be notified, so that they update their internal state. There is no priority involved, and the state changes cannot be rejected. The only concern is to prevent the third party from receiving a notification when itself modifies the state. Is there a good design pattern to solve these requirments?


title: Designing and refactoring of payment logic

text: Im currently working on an application that helps users to coordinate dinner clubs and all related accounting. (A dinner club is where people in a group, take turns to cook for the rest and then you pay a small amount to participate. This is pretty normal in dorms and colleges where im from). However there is some different models that all have a price and the accounting aspect is therefore a little spread. We both have DinnerClub, ShoppingItem and are about to implement the third Payment when users pay their debts (or get refunded for expenses). Each of these have a "price" attribute and a users expense (that he or she needs refunded) is calculated by the total of these "prices" minus what other users have bought and he or she have used/participated in. My question is then if someone have some hints to refactor this bring all this behavior together in one place? For now have i thought about a Transaction class that are responsible for this behaviour, but I'm a little worried about the performance impact on having to query for another polymorphic record each time i want to show the price on dinner clubs and shopping items (i have a standard index page with a list for both so it's a lot of extra records being queried)...


title: To use, or not to use, commons-io in a Java applet

text: I am building a Java applet for a client. Yes, we have gone over all the options, and for the client's requirements and environment, this is the Right Choice. I am a big believer in using Apache Commons whenever possible to simplify my code and avoid reinventing the wheel. One part of the functionality I need for this applet is implemented in the Commons IO library, which is 160kb in size. Or I could create a custom build of Commons IO with just the classes I want. Less easily maintained, but minimizes the overhead of the applet. I could also write the needed functions; they would be far smaller than 160kb. I've probably spent more time pondering the Right Thing To Do than it would take me to write the code by hand. As an additional consideration, I will be doing a code review with the client, and would like to take any opportunities I have to teach them best practices like using Apache Commons. Any strong opinions, and justifications, for which option I should choose?


title: C# Minimal SQL Database

text: I'm working on a small project (not production) where I'm needing to store enough data that something like a CSV would be inefficient to process and an SQL/MySQL server would be too much. Does .Net have any way to efficiently store several entries of data with the ability to query without having to manage and connect to a server rather loading and processing a single file.


title: Just jumped into database testing in PHPUnit - not really sure what the purpose of it is

text: I've been reading about database testing in PHPUnit. I'm not exactly sure what it's purpose is. Should I use this to test schema? E.g. if I have a UNIQUE email column then ensure that I'm not allow duplicate email addresses? (I shouldn't put this in my class tests then?) Is there anything else? I've been reading through documentation, blog posts etc trying to get my head round it .. it's also 2am, perhaps I need to sleep on it too :) Would appreciate if someone could explain in simple terms what this type of testing sets out to do.


title: How to save appointments in database?

text: There are 2 entities. One is **admin**. The task of admin is to define slots for appointments which will be taken by **applicants**. The admin will choose a default time for the appointments like 10am to 2pm and then 3pm to 5pm. Now the confusion how to save this information in database.   1. In a single row which contains start date and time and end date and time and number of applicants allowed for that time slot.    2. Create multiple rows with each date and time slot. Like if there are 2 slots for 15 days then  day 1 10a - 2p day 1 3p - 5p day 2 10a - 2p day 2 3p - 5p ..... Which will be a better way to save the appointments? The second way offers flexibility to edit the appointments but will take multiple rows. The first way saves rows but is complicated when editing and adding or deleting special slots.


title: Is reference to bug/issue in commit message considered good practice?

text: I'm working on a project where we have the source control set up to automatically write notes in the bug tracker. We simply write the bug issue ID in the commit message and the commit message is added as a note to the bug tracker. I can see only a few downsides for this practice. If sometime in the future the source code gets separated from the bug tracking software (or the reported bugs/issues are somehow lost). Or when someone is looking in the history of commits but doesn't have access to our bug tracker. My question is if having a bug/issue reference in the commit message is considered good practice? Are there some other downsides?


title: How many tiers should my models have in a DB driven web app?

text: In my experience, the "Model" in MVC is often not really a single layer. I would regularly have "backend" models and "frontend" models, where the backend ones would have properties that I want to hide from the UI code, and the frontend ones have derived or composite properties which are more meaningful in the context of the UI. Recently, I have started to introduce a third layer in between when database normalization created tables that did not really match the conceptual domain objects anymore. In those projects I have model classes that are equivalent with the DB structure, these become components of objects that represent the domain model, and finally these are filtered and amended for displaying information to the user. Are there patterns or guidelines for how, when and why to organize the data model across application layers?


title: looking for a User Guide to write a JIRA Issue

text: I'm looking for a User Guide how to write a JIRA Issue. I'm aware of http://confluence.atlassian.com/display/JIRA/Creating+an+Issue The problem I have is that this documentation is targeted at people having no problem creating Issues and does not explain how to write good Issues and how to decide for example which Priority to use? I'm looking for something like a common sense approach what belongs in an Issue (or any kind of Ticket) in general. I don't need a "definitive" Guide, just something to get the ball rolling and there are common circumstances that apply to (mostly) all development environments "provide context" "provide all necessary Information / don't refer to Information that might not be available / accessible later" that kind of stuff.


title: Is it correct to refer to OSGi as a Dependency Injection mechanism?

text: I read the Wikipedia articles on both, and both are not mentioned together. Also, the purpose of OSGi is not Dependency Injection. Yet, what an OSGi container like Felix does matches the description for DI.


title: Can I distribute a software with the following permission notice

text: I've recently written a piece of software (without any other contributors) for a company which I part own. I was wondering if I could distribute it with the following permission notice, which is a modified version of the MIT License. Are there any obvious risks if I do distribute with this licence and does it give me the right to reuse the code in other projects? > Permission is hereby granted, to any person within **CompanyName** (the > "Company") obtaining a copy of this software and associated documentation > files, excluding any third party libraries (the "Software"), to deal with > the Software, with limitations restricted to use, copy, modify and merge, > the Software may not be published, distributed, sublicensed and/or sold > without the explicit permission from **AuthorName** (the "Author"). This > notice doesn't apply to sections of the Software where copyright is held by > any persons other than the Author. > > The Author remains the owner of the Software and may deal in the Software > without restriction, including without limitation the rights to use, copy, > modify, merge, publish, distribute, sublicense, and/or sell copies of the > Software. > > The above copyright notice and this permission notice shall be included in > all copies or substantial portions of the Software. > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS > IN THE SOFTWARE.


title: Is there a way communicate or measure levels of abstraction?

text: I'll be the first to say that this question is a bit... out there. But here are a couple questions I bear in mind : **Is abstraction continuous or discrete?** **Is there a single unit of abstraction?** But I'm not sure those questions are truly answerable or even really makes sence. My naive answer would be something along the lines of _abitrarily discrete_ but not necescarily having a single unit measure. Here's what I mean... Take a Black Labrador; an abstraction that could be made is that a Black Lab is a type of animal. `[Animal]<--[Black Lab]` A Black Lab is also a type of Dog. `[Dog]<--[Black Lab]` One way to establish a degree of abstraction is by comparing the two the abstractions. We could say that `[Animal]` is more abstract than `[Dog]` in respect to a Black Lab. It just so happens `[Animal]` can also be used as an abstraction of `[Dog]` So, we might end up with something like `[Animal]<--[Dog]<--[Black Lab]` With the model above, one might be inclined to say that there's two hops of abstraction to get from `[Black Lab]` to `[Animal]`. But you can't exactly tell somebody they need one level abstraction and reasonalby expect they will come up with `[Dog]` given they aren't explicity given the options above. **If I needed to tell someobody in a single email that they needed an abstract class with out knowing what that abstract class is, is there a way to communaticate a degree of abstraction such that they _might_ end up on Dog instead of Animal?** As a side note, what area of study might this type of analysis fall under?


title: How should Object Model wrapper classes behave when underlying objects are deleted?

text: I'm currently building an object model library for use in a project. It wraps our internal concepts - Servers, Folders, Items - in an object hierarchy (IFolder, IItem, etc), and we have several implementations of these abstract objects, using a database or an Exchange server as a back-end, so that an `IFolder` object in our code maps (for instance) to a physical public folder on Exchange. Now I've been wondering how these wrapper/proxy objects should react when their underlying storage is modified. The main usecase is when a folder is deleted, either through my API or directly in the storage layer. Naturally, the object is now orphaned and shouldn't be used, but I still might have instances of it being held in the system. How should it now behave?   * Right now most of its properties are cached in the object itself to avoid repeated calls to the storage layer. Should these property accessors ping the underlying object to ensure it's still alive?   * Should I look into a polling mechanism to update the properties, or even see if my physical layer supplied OnChanged events?    * If my wrapper object finds out that its unerlying storage has been deleted (e.g. because of access to an uncached property returned an error), should it now mark itself as Deleted (so that all access to properties and methods return some sort of ObjectDeletedException) or should it just clear all caches and allow future calls to fail naturally. In short, I'm looking for good tips and best practices for developing an object model wrapper layer. I'll be looking at other similar implementations (Sharepoint Object Model, Managed Exchange Web Services), but any solid guidelines would be appreciated.


title: Design for reusable java module which uses DB connections

text: I'm tasked with changing some procedural Java code into Object Oriented re- usable module. It's an XML generator utility which uses velocity for XML generation. There are also business rule enrichments, all of which is configurable in Database tables. I have already removed huge if-else statements for rules and made them into Rule Objects with Abstract classes and interfaces which other Applications can extend and implement. However I'm facing difficulty with re-designing the overall class - XMLGeneratorUtil, which takes a JDBC connection , Logger and Properties in its constructor and does a hell lot of things in the constructor like building different Data structures(containing static data) from database. Now, I know its not good to connect to Database from Constructor, but if I change to some thing like below:               XMlGeneratorUtil xmlUtil = new XMLGeneratorUtil();     xmlUtil.initialize(Conenriches conn, Properties prop , Logger logger) // Do DB Connections and all initializations here     xmlUtil.generateXML(data); // Data is a HashMap containing busines data that goes into the XML        1. How can I be sure that the users of my utility call initialize before they call generateXML? Should I create some Wrapper that internally creates a lightweight object and then initializes it without the user knowing it?   2. Also , is it good for my re-usable library to accept Connection as a parameter? Idea is that the calling Application of my utility may choose to manage their own Connection , so they just pass it to my API   3. Against the SRP (Single Responsibility principle) the XMLGeneratorUtil manipulates business data(which ultimately goes into XML data) as well as generates XML. Should the data enrichment be exposed as different API? (And then the user calls XMLGeneratorUtil)


title: Optimization ended up in casting an object at each method call

text: I've been doing some optimization for the following piece of code :               public void DrawLine(int x1, int y1, int x2, int y2, int color)     {         _bitmap.DrawLineBresenham(x1, y1, x2, y2, color);     }      After profiling it about 70% of the time spent was in getting a _context_ for drawing and disposing it. I ended up sketching the following overload :               public void DrawLine(int x1, int y1, int x2, int y2, int color, BitmapContext bitmapContext)     {         _bitmap.DrawLineBresenham(x1, y1, x2, y2, color, bitmapContext);     }      Until here no problems, all the user has to do is to pass a _context_ and performance is really great as a _context_ is created/disposed one time only (previously it was a thousand times per second). The next step was to make it _generic_ in the sense it doesn't depend on a particular framework for rendering (besides .NET obvisouly). So I wrote this method :               public void DrawLine(int x1, int y1, int x2, int y2, int color, IDisposable bitmapContext)     {         _bitmap.DrawLineBresenham(x1, y1, x2, y2, color, (BitmapContext)bitmapContext);     }      Now every time a line is drawn the _generic_ context is casted, this was unexpected for me. Are there any approaches for fixing this design issue ? Note :   * `_bitmap` is a WriteableBitmap from WPF   * `BitmapContext` is from WriteableBitmapEx library   * `DrawLineBresenham` is an extension method from WriteableBitmapEx


title: Windows Phone 8 development on Windows 7 - is it or will be possible?

text: I was trying to install Windows Phone 8 SDK on my Windows 7 machine and it hit me with the 'supported only on Windows 8' message. I actually wanted to develop Phone 7.5 apps on Visual Studio 2012, impossible thing with the 7.1 SDK, so I thought 8 SDK will do the job. As if it was not enough that the 8 SDK was controversial upon release, now that it's generally available, to me it seems like a horrible decision to make it available only for Windows 8, because in my humble opinion, no serious and sane developer will install Windows 8 ever, or at least in the near future, just because of the Metro UI. So, anyone knows any workarounds for developing Windows Phone 8 on Windows 7, or at least develop for 7.5 but using Visual Studio 2012?


title: How about a development job with no code to write?

text: I am curious about my work, where I have to work with configurations of servers, linux, databases, some SQLs but there is no line of code for my favorite programming language: Java. Is it normal that developers should have such roles to work so that they can better comprehend? My question is related to career perspective. I was hired for programming but moved to different project where there is NO CODE at all. I am missing to code.


title: How to create a dynamic online Windows Installer with a key?

text: I'm creating an application which needs to have a key file based product activation. If a user purchases the application, the key file may have to be attached to the application EXE file dynamically (may be online) and package it to an MSI installer. The user downloads the application from a server or repository. How can I do this?


title: Search on multiple values

text: I have a database having around 15 tables.Currently I am working on a report generation page, which is having 16 criteria.The values are distributed among multiple tables.User can select any number of search criteria. The problem is, if the user is entering 2-3 values, it is better to filter first by certain value and then apply the next level of filtration on remaining values and this order of filtration depends on the user input always. That means, I have to check all the possible ways of input permutation and give execution path for each, which will be horrible.Is there any way by which I can reduce the execution paths. I am not able to come up with an efficient algorithm. Suppose I have 3 parameters: `name`, `skill`, `programExp` If `name` is given, then I should filter based on `name` first. If `skill` is given, then I should filter using `skill`, `programExp` and then `name`.


title: NoSQL and BIG DATA

text: I am doing an internship on Big Data technologies so I am new to this area. My question is about the use of NoSQL in the Big Data architecture. Do we need always to use a distributed storage (like HDFS in the case of Hadoop) then to put on top a NoSQL databases (like Hbase )? I find it difficult to understand the typical BIG Data architecture specially for unstructured data . If you can help me to see better I will be so thankful.


title: Referring to freelance marketplaces as evidence of the experience for a potential full-time employer

text: I am currently a freelancer (JavaScript) developer, and now I am striving to work more on freelance marketplaces. Some time I want to move from Russia to Canada and find full-time work there. So: How I might provide evidence of expertise in this case? I can not just say in my resume/CV "I was super JavaScript Developer in the MacroHard from 2011 to 2017". Are my accounts (and 4,5/5 star rating) on these marketplaces will be relevant and adequate to show to the potential new employer (urls in the CV, for example)? Or maybe I should just add description of most interesting projects? I have found this article: http://gettingtozen.com/2010/10/how-to-list-your- freelancing-and-self-employment-experience-on-your-resume/ Author gives advice to not include many references to the freelance projects, but his field is not an IT (freelance corporate trainer). In my point of view, it is not very applicable for a Software Developer, since as Software Developer you can explicitly point to the application you worked with. Also, an option here is to refer yourself as "individual entrepreneur" instead of "freelance contractor". My experience in North American employment traditions is zero, so I hope to get advice from colleagues and HRs.


title: Could the creation of many methods in Java affect performance?

text: I was told by a colleague that in Java, the performance may be worse if we create more methods, stacking many methods calling over them in JVM, specially in a Java EE environment. This seems to somewhat defeat the concept of object oriented programming. Like if we write long methods - what isn't good for code readability - we can achieve more performance due to less methods in JVM stack. This is a correct affirmation?


title: ASP.NET MVC Web Site & WCF Web Service - Sharing functionalities

text: I have the following situation: I have to create a website and a web service that will _`share a part of the functionalities`_. This is why I do not want to write code twice. I have thought of the following architecture: **MyApp.BusinessLogic** \--> here we save the DataModels to the database **MyApp.DataAccess** -> DataModels & Entity & mapping * * * **MyApp.UI.Models** -> ViewModels **MyApp.UI.ServiceLayer** -> Acceses the Business Logic, creates the UI ViewModels for the website, and transforms the ViewModels back into DataModels for saving with the help of the BusinessLogic Layer **MyApp.WebSite** * * * **MyApp.WS.Models** \- >Ws Models, these will be the objects passed between the client and the WS **MyApp.WS.ServiceLayer** -> Accesses the business Logic, creates the WS Models for the web service, and transfoms the WS.Models back into DataModels for saving with the help of the BusinessLogic Layer **MyApp.WebService** * * *   * Is the architecture overkill ?    * What problems will I encounter ?    * Will I have problems with the controllers in the ASP.NET MVC website ?


title: Statistics for and Details About Open Source Swing Projects

text: I'm looking for process-relative information on open-source Swing projects:   * how the task was described   * how many developers were involved   * how much time the solution was taken   * etc. Are there any open source (online) chronicles in that direction? I strongly prefer projects that include the authors' names. I watched this project and it seems fine but still I couldn't find any information concerning some current project task(s), its developers group, some chronicles (tips, milestones, feedbacks etc) For example if I see this swing component I'd like to know the above information.


title: string.format with variables vs inline variables

text: What are the pros/cons (if any) to using               string output;      int i = 10;     output = string.Format("the int is {0}", i);      versus               string output;      int i = 10;     output = "the int is " + i;      I have always used the latter example, but it seems as though a good majority of online tutorials use the string.format example. I don't think that there are any real differences in terms of efficiency, my initial thought is so a coder doesn't have to keep breaking the string to insert variables.


title: How can I share my python scripts with my less python-savvy business person partner?

text: I'm taking financial mathematics as an elective, and I'm working with real life finance industry worker type people. It's actually kind of fun. When I pulled out a macbook at one of our meetings, I had four lifelong windows users look at me like I had three heads. Anyway, I'm helping with design and simulation of our trading strategy, and I wrote a little thing using matplotlib to visualize historical stock data. However, these guys don't know how to use git, or install python, or deal with path-related package management things. I need to be able to send my scripts to them to use, and I need to do it with absolutely minimal effort on their part. I was thinking something on the lines of py2exe, but I'd like to hear some advice before I go ahead.


title: Does studying other people's programs help in self growth?

text: _Should_ I be _studying_ big softwares written by other people in our company? My work may be a small sub module on the top of that software, and I may not be required to know what goes beneath the hood, _but_ **Does understanding other people's code grow my knowledge about programming methods or anything else?**


title: how to combine logs coming from multiple virtual machines for processing?

text: Scenario: Two virtual machines produce logs. I want these logs to be sent to a central server for processing (as soon as a line of these logs is generated-->streaming ). The condition here is that I want the server to know from which virtual machine the log line came from. In the server, we should observe a file containing something like: action 1 happended in VM1 action 2 happended in VM1 action 1 happended in VM2 action 3 happended in VM1 action 2 happended in VM2 Question: How can such a thing be implemented in an efficient way? How can streaming to a central server be done? I hope the question is clear..


title: What's the list of how to precisely talk about problems in C++ code within the spec?

text: The C++ specification leaves a lot of leeway such that when you write bad code, compiler authors are not responsible for defining a specific mode of failure. We know of course that is Undefined Behavior. _(For those unaware, once there was a cutesy stunt to launch Tetris if you used a #pragma in GCC, which is actuallyimplementation-defined behavior, but it ties into the whole shebang.)_ This made me wonder about what the full coverage list of "erroring" conditions are: (1) That code will not compile. (2) That code has undefined behavior. (3) That code will throw an exception. **CAUTION: [JOKE]** (4) That code will not terminate. I'm working on a compiler, and I'm almost finished with the part that checks #4 _(the solution is too long to post in this forum)_. But in the meantime... **END CAUTION [/JOKE]** My question is: what can you and can't you say? The motivation is from someone declaring that you cannot use the phrase _"that code should crash"_. I said "will crash" and "should crash" are different; but that aside, I started wondering if the only thing the specifications have defined are 1, 2, 3.


title: Why does "charset" really mean "encoding" in common usage?

text: Something that has long confused me is that so much software uses the terms "charset" and "encoding" as synonyms. When people refer to a unicode "encoding", they always mean a ruleset for representing unicode characters as a sequence of bytes - like ASCII, or UTF-8. This seems reasonable and intuitive; the idea is that you are "encoding" those characters as bytes using the specified ruleset. Since those rulesets sometimes only provide the ability to "encode" some subset of all unicode characters, you _might imagine_ that a "charset" - short for 'set of characters' - would simply mean a set of unicode characters - without any regard for how those characters are encoded. An encoding would thus imply a charset (an encoding like ASCII, which only has rules for encoding 128 characters, would be associated with the charset of those 128 characters) but a charset need not imply an encoding (for example, UTF-8, UTF-16 and UTF-32 are all different encodings but can encode the same set of characters). Yet - and here is the crux of my question - real-world usage of the word "charset" does not match what the construction of the word would imply. It is almost always used to mean "encoding". For example:   * The `charset` attribute in HTML is used to specify an encoding   * `Charset`s in Java are encodings   * `charset`s and `character sets` in MySQL are, once again, encodings How old is this curious (ab)use of language, and how did this counter- intuitive definition of 'charset' come to exist? Does it perhaps originate from a time when there truly _was_ , in practice, a one-to-one mapping between encodings in use and sets of characters they supported? Or was there some particularly influential standard or specification that dictated this definition of the word?


title: Which part of the Memory is used for the Garbage Collector?

text: I understand the Heap memory divisions such as Young, tenured and Perm Gen. But I'm just curious from where is the memory used for performing the Garbage Collector itself? Is it from any of these memory spaces or in the thread stacks ?


title: Branding/Restricting a Software by License/Serial

text: I have made a POS System for a client of mine using MS Access Server-Client approach. He asked me to brand his software to allow only a certain "number" of users (cashiers) to access the POS System, and must be determined to the license his client will buy. EX: 10 User License = 10 Cashiers ( not necessarily 10 users, it can be 30 users, shifting) = it means 10 PCs will be installed with the client software I made. How and where do I put the logic that will determine if it is licensed or not. What I have done: I have created a serial key generator using Name. Problem is it can be duplicated once you give than name+serial combination, it would still work. I am counting the number of users logged at a time. This could be problematic as I am using MSAccess and not MSSQL. I have scrapped this idea, He also asked me if I could just put serial+mac address combination. That I could do but he will have a hard time implementing it and selling it if he needs the mac address of every computers to be installed with my POS. I am at lost on what can I do. Would like to ask for tips and suggestions. Thank you.


title: Dealing with code that has been written but isn't yet needed

text: I wrote a class to do something, but then realised that it wasn't needed, as I could optimize existing code to get the speed of execution I needed, rather than integrating the new class in with existing code (which would have been more complicated). However, I'm unsure if my current solution will be fast enough when I've written the rest of the program, so I'd like to keep the unused class around somewhere. I don't want to just keep it in the main version of the source code, as it would just be unnecessary clutter, but I think there must be a neater solution than putting it in its own file away from the rest of the project and coming back to it if I later need it. I'm new to using source control, so I'm not sure what to do there. Could I create a side branch with the class, and merge it into the main branch without later?


title: What kind of language is better for beginners: static or dynamic?

text: Once again, I'm not certain this question fits this site but I can't think of a place online that fits it better. What do you think is a better starting point for an absolute beginner to programming: a statically typed, or a dynamically typed language? On one hand, it's easier and "more forgiving" for beginners to use a dynamic language. On the other hand, I feel starting with a static language will grant the beginner much better habits, forcing him/her to think more strictly about types, and which type goes where (as opposed to the duck-typed approach of "send here something that has a `do()`" method). My main concern is what's better _as a starting point_ : i.e. what kind of language would allow the beginner to gain better habits in the beginning and be able to later move on to other languages more easily.


title: Identifier for the “completed” stage of a process: 0, 99, something else?

text: Say, that you are handling a multi-step process (like a complex registration form, with a number of steps the user has go through in order). You need to be able to save the current state of the process (e.g. so the user can come back to that registration form later and continue form the step where they were left off). Obviously, you’ll probably want to give each “step” an identifier you can refer to: 1, 2, 3, 4, etc. Your logic will check for this `step_id` (or whatever you call it) to render the appropriate data. The question: how would you identify the stage after the final step, like the completed registration state (say, that you **have** to give that last “step” its own id, that’s how your logic is structured). Would it be a `0`, `999`, a non-integer value, something else entirely?


title: How do I do TDD on embedded devices?

text: I'm not new to programming and I've even worked with some low level C and ASM on AVR, but I really can't get my head around a larger-scale embedded C project. Being degenerated by the Ruby's philosophy of TDD/BDD, I'm unable to understand how people write and test code like this. I'm not saying it's a bad code, I just don't understand how this can work. I wanted to get more into some low level programming, but I really have no idea how to approach this, since it looks like a completely different mindset that I'm used to. I don't have trouble understanding pointer arithmetics, or how allocating memory works, but when I see how complex C/C++ code looks compared to Ruby, it just seems impossibly hard. Since I already ordered myself an Arduino board, I'd love to get more into some low level C and really understand how to do things properly, but it seems like none of the rules of high level languages apply. Is it even possible to do TDD on embedded devices or when developing drivers or things like custom bootloader, etc.?


title: Are bloom filters actually faster than hashes, even taking in account cache?

text: Bloom filters look really great when you consider you can determine if an Int is in a set with 99% certainty in constant time. But so can hashes, with the only difference that, in a hash, most of the time you are accessing the memory only once. With bloom filters, you need to access them ~7 times per request in **completely distant places** , so you'd have several cache misses per request. Am I missing something?


title: Career Advice: Should I relearn XHTML and CSS for my career?

text: Currently, I am a Ruby/Rails developers. Before I was .NET developer and got MCTS in Windows Client Development. But of the time I don't touch any HTML or CSS and I don't have any experience in doing layout at all. And I feel boring doing those tasks, but for sure every web apps has to have them. To be a professional do I need to learn them again?


title: Ideas to talk about during "expectation setting talk" with my new software team lead?

text: I'm moving to a new company, with a new team lead. I find that this is a great time to set our mutual expectations from each other, to help us both start the role on the right foot. Do you have ideas what expectations I should set from him? In what areas should I determine his expectations from me?


title: Is it common for developer to not have an administrator account?

text: Not having it means using only those tools that everybody uses (that comes with the same image for every PC). I can see the benefit of this - less worries that somebody's machine may get infected after downloading a corrupted file. But isn't this a bit of an overkill? What if I need a tool that could make my daily work much more efficient and there is no alternative? I know that it depends A LOT on the exact company and it's policies but having worked only in two companies so far (healthcare - no restrictions; finance - lots of restrictions), I'm wondering how common is it and if there are any other reasons besides security.


title: Dummy float values to force floating-point operations

text: It is common to use idioms such as:               x/60.0      to force a floating-point division when `x` is an integer in languages which do not have distinct operators for integer and decimal division. Is this an accepted idiom or is it preferrable to cast `x` to a floating-point type? I believe it is a concise and clear idiom- it might be show intent less clearly than an explicit cast, but it is more concise and easier to read. I think that it's less hack-ish than `x + ""` to convert to string or `x+0.0` to convert to floating point (as there's no unnecessary "NOOP"). Thoughts? Álex


title: A phone that supports any mobile OS

text: What is preventing hardware manufacturers from creating a device that will allow the user to select their OS? A phone similar to a PC or a mac that can have linux, windows or mac OS installed. Are there any regulations preventing this?


title: Need help with directory structure in porting codebase to SVN

text: Currently we've got a directory structure that looks like this               +Inhouse App A     +Inhouse App B     +Core files for inhouse app B     +Inhouse App C     +Something that never came to fruition     +Forgotten Server Project A     +Forgotten Common Files A     +Authentication Server     +Update Server     +Main product Version 5.5     --+[DLL1]     --+[DLL2]       ...     --+[DLLN-1]     --+[Controls]     -----+[Our Awesome Controls]     -----+[3rd party control 1]     -----+[3rd party control 2]     -----+[3rd party control 3]     --+[DLLN]     --+[Utils]     -----+[Util 1]     -----+[Util 2]        ...     -----+[Util N-1]     -----+[Util N]     +Main product Version 6.1     +Main product Version 6.2     +Fingerprint SDK           Obviously, I am covering up some ugliness of this beauty. I've got an install of VisualSVN to replace Visual 'shall not be named' and I get to the point where it says, trunk, branch and something else. and from some other posts here and on SO, I know vaguely what those are for. My question is what do I do to translate my existing file structure to the source control structure. We've give up hope of doing any meaningful import. I've tried just going head first into this already, but I feel I'm missing some key concept. For instance, should all these things be in the same repo? If they're not in the same repository, how are they going to find the files shared between the projects?


title: Have you ever found yourself using a specific tool in favor of another just because it looks better?

text: I found that this was the case with Eclipse. When I first started learning Java a lot of people told me to start with NetBeans because it's easier, comes with a lot of predefined functionality and most of the configuration is done by default. Indeed it seemed like an easy IDE but I just hated the way it looked. The UI to me was horrible. Then I downloaded Eclipse. I was pretty impressed with it. Everything looked shiny, fonts looked awesome and the UI in general was amazing compared to NetBeans'. So I stayed with Eclipse. Has something like this ever happen to you? Should the UI be of such a relevance to a programmer, is this bad ? The problem of the UI extends to everything for me, not only IDE's (e.g. even on linux I have to customize the WM the way I want before starting working with it).


title: How much should I worry about the edge cases?

text: How much should one worry about the "edge cases" in an application, especially when creating the UI?


title: Beginning with smartphone app development

text: I have a job from a client that needs a iPhone/iPad app. I'm new to the smartphone development so where do I begin with? Do you have some nice in depth beginning tutorials of some kind? JS libraries I need to look into? Is there a startup boilerplate for iPhone/Android out there with a beneficial starting setup kit or something like that? In general, is there something I really need to know before I start? My coding background is:   * HTML/CSS   * jQuery/Javascript (rookie)   * C#    * AS 3.0


title: In-house versus Software-development Environment

text: In the industry, there is a distinction made between an 'in-house development' environment where the software developers are writing code which will be used by the company itself and a proper 'software development' environment where software is built to be sold/distributed to the public. Among others, one obvious difference between the two is that a software- development-oriented company will typically adhere to some sort of software development life cycle such as spec-writing, testing, building etc. whereas the in-house-oriented shop will usually do things in a more casual way since they themselves are the end-users and can always fix something that wasn't done right. As a student (like most other students), I kind of expected myself to wind up working in a software development environment, but I ended up getting my first position at a firm which operates in more of an in-house fashion. At times, I wonder whether I am missing out on the full-fledged software development experience. Is there a basis for this feeling? Should I seek to join a proper software development environment?


title: Do most companies not know how to write software?

text: If you're an active reader here, try to think about how many times you've heard (and even agreed) when someone here has told someone else to start looking for a new job. Personally, I've seen it a lot more than I expected: it's almost starting to sound cliche. I get that there are bound to be a number of companies that are bad at developing software or managing a software project, but it almost seems like it's getting worse and more frequent, maybe we're just hearing from them and not all of the places that have decent work atmospheres/conditions. So I ask: In your experience, and through your developer friends do you find that it is common that companies have bad development environments and if so:   * Why do you think it's common?   * What do you think could be done to fix it as a developer, as a manager, as an industry?   * Do you think it's improving?


title: How should I introduce a coding standard to my team?

text: First a bit of background: My current development manager is taking another opportunity the end of this week, leaving our team with four fulltime developers, a part-time intern and a web designer (who is technically part of Marketing, not AppDev). At this time we aren't promoting or hiring a new manager. The previous manager never would take the time to come up with a set of coding standards to adhere to (to put this in perspective: My one-year anniversary at this job is in two weeks and I've been talking to him about standards since I started). Due to this, all of us four developers write code our own way: Some of us follow the Microsoft naming conventions for .NET, some use Hungarian notation, some use a mix (e.g. mixing `PascalCase` and `camelCase` for parameter names), and it's entirely random when you open a code file what standard it will follow - about the only thing consistent is that braces are on separate lines. Two out of my three co-workers have approached me to create a standard coding document that we can use and enforce moving forward (although I am technically not the most senior developer, the fourth developer having been here for several years, two co-workers and the intern look to me for advice/guidance but we do not have a team lead). I have been meaning to do this for a while but the now-departing manager would always put it on the backburner; his departure now gives us a chance to take some time and configure things correctly to facilitate a proper software environment and not the rushed hodgepodge we currently have. How should I go about doing this and introducing this standard to my team without causing friction? I don't want to make it look like I'm "taking over", although were I offered the manager position I would accept it. As I said two out of three other developers are on board with me creating one, but the fourth (the true "senior" in length of time) may or may not accept it. I plan to start with the .Net conventions from Microsoft (e.g. do not use Hungarian Notation), add some personal preference (e.g. `_camelcase` for fields) and specifically call out certain strange practices we use here as not to be used (e.g. naming a class with an underscore at the start), but what else should I include? I don't want to get into architectural guidelines as that _will_ cause friction and we have a very large, and smelly, existing codebase that wouldn't adhere to it, and we're nowhere near at the point of coming up with a refactoring strategy. To summarize: Beyond basic naming conventions what, if anything, should I include in a coding standards document (examples would be great - I haven't managed to find any concrete examples of what such a document should look like), and how should I present it to my team without sounding like the new dictator.


title: Macro guard in Objective-C

text: I have noticed that many famous libraries written in Objective-C (eg. AFNetworking) use the macro guard inside their header files. Im aware that the #import directive, which works exactly like #include, includes each file only once, obviating the need for #include guards. For what reason are still used?


title: Should test fixtures be added to code repositories?

text: I'm unit testing some code that processes data from an external API. That external API serves up a large pile of JSON data. The right thing to do here, of course, is to use fixtures in the unit tests, so that I don't do a real API call every time the test runs. Those fixtures can be quite large though - many thousands of lines, even. I'm not sure whether I should put them into git. It seems like a bad idea, since they seem like static files. On the other hand, writing the unit tests really requires specific fixtures, so I do want them shared with anybody working on the project (and shared with our build machinery). Should large fixtures be committed into a repo?


title: How do I sell my software on the Internet?

text: I'd like to sell my software on the 'net but am not sure how to do the whole Merchant setup. I have access to Commerce Server 2009, and I want to seem professional so a plain old PayPal account is out. What do I need to know/do to sell a few things using ASP.NET, accept credit cards, and what not?


title: What traits do the best testers you've worked with have in common?

text: Tester and blogger Lanette Creamer recently posted this question on Twitter: > If you are a professional software developer who works with testers, think > of the best testers you know. What traits do they have in common? I thought it would make an excellent question for here. My thoughts are:   * They want to remove ambiguity from requirements even if it means asking awkward questions.   * They create new features by seeing the way software "should" work, rather than just how it's documented.   * They demonstrate honesty and integrity and encourage but not demand it from those around them. In other words, they model behavior. What are the traits of the best testers you've worked with?


title: What's the equivalent name of "procedure" in OOP?

text: In several of my programming courses in the University, my teachers always told me the following: > A function and a procedure are basically the same thing: the only difference > is that a function returns a value, and the procedure doesn't. That means that this:               function sum($a, $b) {         return $a + $b;     }      ... is a **function** , and this:               function sum($a, $b) {         echo $a + $b;     }      ... is a **procedure**. In the same train of thought, I've seen that a **method** is the equivalent of a **function** in the OOP world. That means that this:               class Example {         function sum($a, $b) {             return $a + $b;         }     }      Is a **method** -- but how do you call this?               class Example {         function sum($a, $b) {             echo $a + $b;         }     }      What's the equivalent name, or how do you call a method that **doesn't returns anything**?


title: Styling the HTML tag in a web document

text: is it good Coding Practice to add style to the `<html>` tag of a web document? why should you not style the `<html>` tag of a web document? I ask this because of this answer on a StackOverflow question.   Personally I don't think this is good coding practice. is there a WC3 standard that says this is good/bad?


title: What are `Developmental Milestones` for programming skills?

text: I studied in the field of Computer Science for 6 years, bachelor's degree and master's degree. I have studied all the basic programming like C, Java, VB, C#, Python, and etc. When I have free times, I will learn new programming languages and follow new programming trends by myself , such as PHP, HTML5, CSS5, LESS, Bootstrap, Symfony2, and GitHub. So, if someone wants me to write some instructions using these languages, I'm certain that I can do it, not so good but I can get a job done. However, I don't have any favorite programming language. Moreover, I also have studied about algorithms, database, and etc. Everything I just wrote so far seems that I know a lot in this field. In fact, I feel I am very stupid. I cannot answer 80% of the questions on SO. In spite of those languages, I have studied. Perhaps it is because I have never worked before. * * * As there is the `Developmental Milestones` for children, which refers to how a child becomes able to do more complex things as they get older, I would like to evaluate the same thing but for programming skills. What are the set of functional skills or age-specific tasks that most programmers can do at a certain age range? In order to evaluate myself, I would like to ask your opinions that all of the skills I mentioned above, are they enough for programmers to know when they are 25 years old? What are your suggestions in order to improve the skills in this field?


title: When there's no TCO, when to worry about blowing the stack?

text: Every single time there's a discussion about a new programming language targetting the JVM, there are inevitably people saying things like: _"The JVM doesn't support tail-call optimization, so I predict lots of exploding stacks"_ There are thousands of variations on that theme. Now I know that some language, like Clojure for example, have a special _recur_ construct that you can use. What I don't understand is: how serious is the lack of tail-call optimization? When should I worry about it? My main source of confusion probably comes from the fact that Java is one of the most succesful languages ever and quite a few of the JVM languages seems to be doing fairly well. How is that possible if the lack of TCO is really of _any_ concern?


title: Randomly and uniquely iterating over a range

text: Say you have a range of values (or anything else) and you want to iterate over the range and stop at some indeterminate point. Because the stopping value could be anywhere in the range, iterating sequentially is no good because it causes the early values to be accessed more often than later values (which is bad for things that wear out), and also because it reduces performance since it must traverse extra values. Randomly iterating is better because it will (on average) increase the hit- rate so that fewer values have to be accessed before finding the right one, and also distribute the accesses more evenly (again, on average). The problem is that the standard method of randomly jumping around will result in values being accessed multiple times, and has no automatic way of determining when each value has been checked and thus the whole range has been exhausted. One simplified and contrived solution could be to make a list of each value, pick one at random, then remove it. Each time through the loop, you pick one fromt he set of remaining items. Unfortunately this only works for small lists. As a (forced) example, say you are creating a game where the program tries to guess what number you picked and shows how many guess it took. The range is between 0-255 and instead of asking _Is it 0? Is it 1? Is it 2?…_ , you have it guess randomly. You could create a list of 255 numbers, pick randomly and remove it. But what if the range was between 0-232? You can’t really create a 4-billion item list. I’ve seen a couple of implementations RNGs that are supposed to provide a uniform distribution, but none that area also supposed to be unique, i.e., no repeated values. So is there a practical way to randomly, and uniquely iterate over a range?


title: Are there good techniques or tests for naming types?

text: An awkward, open question, but it's a problem I'm always bumping against: Software that's easy to maintain and work with is software designed well. Trying to make a design intuitive means naming your components in such a way that the next developer should be able to infer the function of the component. This is why we don't name our classes "Type1", "Type2", etc. When you're modelling a real-world concept (e.g. customer) this is generally as simple as naming your type after the real-world concept being modelled. But when you're building abstract things, which are more system-oriented, it's very easy to run out of names which are both easy to read and simple to digest. It gets worse (for me) when trying to name families of types, with a base-type or interface which describes what the components have to do, but not how they work. This naturally leads to each derived type trying to describe the flavour of the implementation (e.g. `IDataConnection` and `SqlConnection` in the .NET Framework), but how do you express something complicated like "works by reflection and looking for a specific set of attributes"? Then, when you've finally picked a name for the type you think describes what it's trying to do, your colleague asks "WTF does this `DomainSecurityMetadataProvider` actually _do?_ " Are there any good techniques for choosing a well-meaning name for a component, or how to build a family of components without getting muddled names? Are there any simple tests that I can apply to a name to get a better feel for whether the name is "good", and should be more intuitive to others?


title: Generalise variable usage inside code

text: I would like to know if it is a good practice to generalize variables (use single variable to store all the values).   Consider simple example                Strings querycre,queryins,queryup,querydel;          querycre = 'Create table XYZ ...';         execute querycre ;         queryins = 'Insert into XYZ ...';         execute queryins ;         queryup  = 'Update  XYZ set ...';         execute queryup;         querydel = 'Delete from XYZ ...';         execute querydel ;      and                Strings query;          query= 'Create table XYZ ... ';         execute query ;         query= 'Insert into XYZ ...';         execute query ;         query= 'Update  XYZ set ...';         execute query ;         query= 'Delete from XYZ ...';         execute query ;      In first case I use 4 strings each storing data to perform the actions mentioned in their suffixes.   In second case just 1 variable to store all kinds the data.   Having different variables makes it easier for someone else to read and understand it better. But having too many of them makes it difficult to manage. Also does having too many variables hamper my performance? P.S: please don't answer w.r.t the code in example it was just to convey what I really mean.


title: Why isn't TDD part of programming lessons at school

text: My daughter and my son are learning Java with BlueJ. I really don't understand why the first thing they learn isn't to write code to bring a testcase to green light.


title: Is dependency injection by hand a better alternative to composition and polymorphism?

text: First, I'm an entry level programmer; In fact, I'm finishing an A.S. degree with a final capstone project over the summer. In my new job, when there isn't some project for me to do (they're waiting to fill the team with more new hires), I've been given books to read and learn from while I wait - some textbooks, others not so much (like Code Complete). After going through these books, I've turned to the internet to learn as much as possible, and started learning about SOLID and DI (we talked some about Liskov's substitution principle, but not much else SOLID ideas). So as I've learned, I sat down to do to learn better, and began writing some code to utilize DI by hand (there are no DI frameworks on the development computers). Thing is, as I do it, I notice it feels familiar... and it seems like it is very much like work I've done in the past using composition of abstract classes using polymorphism. Am I missing a bigger picture here? Is there something about DI (at least by hand) that goes beyond that? I understand the possibility of having configurations not in code of some DI frameworks having some great benefits as far as changing things without having to recompile, but when doing it by hand, I'm not sure if it's any different than stated above... Some insight into this would be very helpful!


title: Does MVC pattern negate other design patterns?

text: So usually when working with the MVC you have a controller that controls the input a model that process it and makes it ready for the user and a view that display the "result" to the user. Now when creating this pattern you seperate the code into their relevant place. for instance the controller code goes into the controller, the gui code goes into the view and so on. Now my question is if we look at all of the design patterns out there for instance the observer pattern. How would you apply such pattern to a code structure that already implements the MVC pattern? for that case many of the other patterns aswell such as composite, factory and command pattern? Doesnt the structure of the MVC pattern make it harder to implement other good pratice design patterns?


title: What is the difference between a Program Manager and a Project Manager?

text: Is a Program Manager a person who manages mutiple projects (under a single program) which are in turn managed by Project Managers? Or is a Program Manager a person as defined by Joel Spolsky here. **NOTE:** I am not referring to this.


title: NetBeans IDE and various alternatives?

text: I mainly like to use NetBeans as my IDE for Java,which i really enjoy using. Currently just learning Java and was advised this would be a great program, which it is. I would just like to ask the experienced guys here what software you mainly use for Java / Python etc. As said, I am just in the process of getting my degree in SE so never been exposed to the business world of software and what is mostly used.


title: Dataflow Diagrams - are they used in the real world?

text: So, last semester I had an Information Systems course where we were supposed to create a typical CRUD site. We were given a couple of Use Cases and from then on we created Dataflow Diagrams that were used to design our database. I've been looking around on the net, but I'm having the impression that people nowadays rarely use DFD's - at least so it seems. Is it just an impression of mine, or are they actually used?


title: What were the reasons why Windows never had a decent shell?

text: I was reading a topic on SO: Why are scripting languages (e.g. ...) not suitable as shell languages?. Especially I liked the answer by Jörg W Mittag, from which I learned interesting things about `Windows PowerShell`. So after more than 20 years Windows finally has a well designed shell (Windows 1.0 - 1985, PowerShell stable release - 2009). On other hand Unix systems has a bunch of various shells since 1978 Bourne Shell. I've read some articles about MS job interviewing and I have an impression of very "geekish" company. I am wondering why didn't they had a need for command-line tools compared to Unix people who do all their work with those tools.


title: Security vulnerability and nda's

text: I want to propose a situation and gain insight from the communities thoughts. A customer, call them Customer X has a contract with a vendor, Vendor Y to provide an application and services. Customer X discovers a serious authentication vulnerability in Vendor Y's software. Vendor Y and Customer X has a discussion.   * Vendor Y acknowledges/confirms flaw.   * Vendor Y confirms they will put effort to fix.    * Customer X requests Vendor Y to inform all customers impacted by this. Vendor agrees.  Fast forward 2 months, and the flaw has not been fixed. Patches were applied to mitigate but the flaw still exists. However, no customers were informed of issue. At this point customer X contacts Vendor Y to determine the status and understand why customer's were not informed. The vendor nicely reminds the customer they are under an NDA and are still working on the issue. A few questions/discussion pieces out of this.   * **By discussing a software flaw with a vendor, does this imply you have agreed to any type of NDA disclosure? Additionally, what rights as does Customer X have to inform other customers of this vulnerability if vendor does not appear willing to comply?**   * _I (the op) am under the impression that when this situation occurs, you are supposed to notify vendor of issue, provide them with ample time to respond and if no response you are able to do what you wish with the information._   * _I am thinking back to the MIT/subway incident where they contacted transit authorities, transit authorities didn't respond in a timely fashion so the students disclosed the information publicly on their own._   * _Few things to note about this: I am not the customer in above situation, also lets assume for purposes of keeping discussion inline that customer X has no intentions of disclosing information, they are merely concerned and interested in making sure other customers are aware until it is fixed so they do not expierence a major security breach._ (More information can be supplied if needed to add context to question. )


title: Reading a character from a file stream in c++ (AKA: Why no C++ standard equivalent of old conio.h)?

text: I don't have an actual problem I'm working on, this is more a question of design decisions. I find that there are so many different things I work on where reading a `_kbhit()` is amazingly useful but I can't find (read: there isn't) any functionality like that in the C++ standard.   * Example: Have a camera continuously running (and updating an on-screen window) until you hit the "escape" character.   * Example: Pressing F11 in firefox to maximize the window.   * Example: Pressing the W key in any FPS game to move forwards All of these read the keyboard without pressing [enter] between each read. How the devil is that accomplished? Under windows I use `getch()` in a continuous loop running in its own thread. I'm not sure if that's a good idea performance-wise, but most of the software I write that runs in an OS isn't very time critical (It's mostly command-line UIs that interface with the embedded systems that I develop). The reason I'm asking is because a friend has asked me to help him write a UI for a system - and the UI has to run under Linux. I have no idea where to start and rather than turn him down, I thought I'd instead ask you guys: How do you read a keyboard hit without calling a conio.h function?


title: WCF/SOA - Why should I create parameter objects for simple requests

text: Our company is starting a fairly large SOA initiative. We're doing a lot of stuff right: there's good communication; money for tools where appropriate; and we have brought on some good expertise to help us with the transition. We're trying to develop standards that we can follow as a group, and one of the proposed standards is bothering me quite a bit: We have standardized on the pattern where every operation takes a request object and returns a response object. I realize that this is more or less a standard approach for a lot of folks, but I am asking _why should I bother?_ (I'm not so good with received wisdom, I need some why). Most of the services that I will be providing are simple organizational metadata retrieval. For example, find the security policy for a particular user. This needs a user id and nothing else. The standard tells me that I should wrap this request in an object and wrap the returned policy in a response object. My unease is amplified by a look at the WSDL that is generated from our contracts. WCF generates request and response messages automatically and wraps even the request/response object. I fully understand that if you're making a complex request then a complex input object is warranted. That's what you would do even if services wren't involved. My question is why should I automatically wrap requests and responses when:   * It makes simple services less expressive    * You would do it anyway for a complex service   * WCF creates a request/response message anyway I have found the following arguments in favor of this approach: **It supports versioning by allowing optional parameters to be slipped into the request object.** Back in the day, I did a fair bit of COM, and I would consider this almost an anti-pattern for versioning. For some things, I suppose it would help, but I expect that where it would help, you already have a parameter object anyway. **It allows common data and behavior to be isolated to a base class** This one carries some weight with me. **It steers people away from an RPC style behavior and towards a messaging behavior** I've read this on Microsoft's site and heard it from our guru, but I still don't have a clear idea what they mean or why it's valuable. Is it that natural looking interfaces make people tend to forget that they are calling a remote service? I am looking at refactoring the signatures of perhaps 300 methods, so this is a non-trivial amount of pain. I'm a huge fan of consistency in implementations, so I'm willing to take on the pain, it will just help to know that it will all be worth it in the end.


title: Recomendations for Front-End to Programming Transition

text: I am a front-end developer seeking to add programming to my skillset. As with all things, I'm sure that practice and practical application will aid me most, but I am currently having trouble wrapping my head around the transition from a very linear type of development (HMTL/CSS) to the more "3-dimensional" or non-linear concepts of programming, e.g., object-oriented programming. I'm just feeling overwhelmed that there's so much to know! Where to start, where to start. I'm especially interested in learning Javascript, PHP, and RoR. But I'd prefer to really get intimate with PHP as I like tinkering with WordPress. Does anyone have any suggestions for resources relevant to my study, or hands- on example projects that would yield the most practical experience for me? I've tinkered for years, but am just anxious for that ah-ha moment for things to start clicking. Thanks!


title: Locating playback position of audio track

text: I want to find the playback position of a known audio track by listening with another device. Ideally the listening device wouldn't need a full copy of the audio, but some kind of hash of it, as the target audio might be long (this is for displaying the position while watching a film). I've had a small look into acoustic fingerprinting tools - though I'm searching for the position rather than from a set of songs and I'd like the recognition to be active so would rather not be polling a service. My initial thoughts are to sample a few frequencies (so that the entire audio track isn't required), and use Dynamic Time Warping to search for a matching region of the track. I've not got huge experience with audio processing, so I was wondering if there was a more efficient/robust approach to this.


title: What would be the market life of a JVM based software framework?

text: I saw how Struts 1 lasted from 2000 to 2013. I hear that people are moving from Struts 2 to Spring. But for a project that may need to be maintained for a decade or two, would it be advisable to opt for a framework or directly code with `servlets` and `jquery`? Can a system architecture really be designed keeping in mind a particular framework? **What really is the market life of a framework? Do the creators of the framework create it with the assumption that it would become obsolete in a decade?**


title: Reference vs dereference pointers in arguments C++/C

text: OK, I'm facing this all the time in many functions I write, which should I use?               void sth(int* a)     void sth(int& a)      Which one is faster, regarding two separate occasions: a is a small variable or a is a large data struct. I would like a deep answers with pertinence to the actual hardware and stack process.


title: What's the best place for a high school programmer to get his work noticed?

text: I'm a 16 year old high school student, with a passion for computer programming. I'm in grade 11, and I've been learning it as part of the school syllabus for about 8 months. I've gone beyond what's being taught at school, and witten a few (reasonably good) applications. The language that I program in is C++, on the windows platform. Eventually I'd like to major in CS at a good college and then work as a programmer. The specific questions that I have are:   * What is a good place for me to get my work noticed ?    * Are there any journals, or publications specifically for young programmers ?   * If not publications, then are there any good blogs, or is it just better to start your own ?   * Is there anything else, that would help me get noticed as a programmer ? I've tried to be as objective as possible. If all this was tl;dr: What's the best way to get noticed as a young programmer ? Edit: I am not looking to get hired straight out of high school The aim is not to impress the community as a professional programmer. This is with intent towards college applications where having your work seen and critiqued by other people will improve your application. I am not looking to earn money from what I've written (so far).


title: How can you be certain that a controversial change made to your software really is best for users?

text: **Background:** we have recently made a significant change to the UI of our software. All previous versions used a MDI interface (windows floating around inside a parent window.) The new version uses a docked interface (windows snap next to each other, fill all available space, and can be tabbed on top of each other, and can be dragged out to another screen.) We thought - and still think - this is a great improvement. However, feedback from our alpha testers is wildly varying. Some love it, some say they find it hard to use and want to use the old system. Many of our users have been using the software for well over a decade and are very used to its old UI behaviour. **Generic situation:** I'm sure other software houses have encountered similar problems, ie I think this is a widely applicable problem we will probably all encounter at some point: you make a change (especially a significant change) that you think will be greatly beneficial for the users of your software, and you don't receive universal acclaim.   * How can you be certain that your change really is better _for the user_ , instead of just a change you happen to like?   * In my experience, change is usually liked more when it's voluntary or sought out, not forced. How do you enthuse your users so that it is voluntary? Should you even try? How do you handle this situation? _I have tagged this question 'delphi' because there is an interesting specific parallel: a decade or so ago the Delphi & C++Builder IDE (which we use!) changed from floating windows to a docked UI - exactly the same as us. A small, very vocal group of people complained loudly and some still do to this day. As far as I know, the majority think it was a great change. If there happen to be any Borland / Embarcadero staff reading who feel like chiming in with a historical tale, I'd love to hear your input!_


title: When is type coercion a good idea?

text: When do you want (on purpose) to coerce type in JavaScript? I mean, beyond comparing strings and numbers, when does it benefit something you're building? Examples of type coercion:               "The answer is " + 42      //=> "The answer is 42"          "37" - 7      //=> 30          "37" + 7      //=> "377"          var foo = [0];     console.log(foo == foo);     //=> true          console.log(foo == !foo);     //=> true


title: When is applications a preferred context over web?

text: My experience has been that we now see more of a discussion about apps than just a discussion about websites that was before. Do you agree? When is it more appriopriate to speak about apps as compared to web and websites? In general I'm much in favor of leaning towards to perspective of apps rather than web/sites/domains since the latter depends so much on name and you couldn't make a thing such as a whitelabel project as a website - it has to be an app. So I seem to arrive at the conclusion that apps is the wider context and therefore is preferred, especially if the project is a whitelabel software development that a client should be able to take and "brand" for instance such as taking the stackoverflow project and banding it to a new forum which is the way I supposse things work when we get a new forum.


title: Handling "unspecified" values in software

text: So I'm working on a software product where we have a number of fields that the customer can leave blank, some of which are numeric. To persist these in the database we use nullable columns. Easy peasy. I'm considering the utility of an object oriented domain model and one thing that bugs me is the issue of nullable fields. The reason is, in the world of Java and C# one often finds advice against having null values and indeed writing code with null checks all over the place sucks. And then you get null reference exceptions when you forget to check for null. And it's a mess. So a "good" approach is to initialize everything when you declare it. Now, the idea of null actually makes sense for these fields... the customer did not enter a value thus it has "no" value (not 0, not -1, etc). But application programmers and programming languages seem to be configured for binary rather than ternary logic, and also for variables just darn well having a value rather than maybe having a value but also maybe not. With object oriented design I presume one could come up with some clever system of representing cases where there is "no" value but I personally haven't done the analysis yet and the reason is I find incremental change more successfully sells to people than radical change does, so proposing an object oriented domain model that's "too object oriented" might kill the idea and thus my hopes of improving the structure of our software. I'd rather propose a "version 0" domain model that works and is easy to sell internally... and so this whole thing about null values weighs heavy on my mind. Since we are using C# I could just define nullable numbers, its very easy one just adds a question mark. But I'm not convinced that just because it's possible it's also the best approach. So, with all this background junk out of the way my question is: how have you/your company handled "nonexistent" values in an object oriented domain model, in what ways did you find it effective and in what ways did you find it ineffective? My selection criteria for the "answer" will be the one that seems most "sellable" as defined in the background junk. But really I'd like to see what people come up with and learn some new things so any answer with some thought behind it will receive an upvote from me. Note: I've seen other discussions about null values in other threads but nothing that quite lines up with what I want to talk about, hence a new question. EDIT: My question's scope includes value typed properties like numbers. So in C# one way to allow for representation of a null purchase price would be to declare "PurchasePrice" as "decimal?" which is the nullable decimal type. I just see a number of disadvantages to numbers (for example) that can also be null, so I'm looking for an alternative. EDIT 2: The Null Object Pattern makes sense for references, and using a nullable type for values appears as if it may be tractable with coalescing. What bothers me about coalescing null types is "what if someone forgets to coalesce and we're exposed to a null reference exception?"... and I suppose I could maybe use a static analysis tool which ensures that coalescing is used where expected to allay that worry. EDIT 2': In a sense, if someone has made a conscious decision to make a field nullable they are adding the ability to represent an extra piece of information that would otherwise need another field to represent it such as a boolean HasValue. Does that mean the "anti-null" zealots I've met in the past were perhaps incorrect, and measured use of nullity can in fact improve a design?


title: How can a self-taught programmer learn more about Computer Science?

text: I'm a self taught iOS (iPhone/iPad) programmer but didn't study CS in school. Are there any books or site I can study that will teach more about CS, in general. For example some common practices and how different languages work together etc. I don't need full details but simply just an overview of common CS stuff. I know this is a broad question but any info would be good.


title: Open Source Friendly IP Contracts for Freelancers

text: I am about to enter the world of consulting for the first time and am having to write my first contract. One problem I have is regarding open source work and intellectual property. I love working on open source projects, whether it's an existing project or a project that I start on my own. The question is: how can I write my contract to accommodate the following situations:   1. In the course of working on the client's project, I want to open source part of the code to the community under my own name.   2. In the course of working on the client's project, I am making use of some of my existing open source projects, and am making improvements to them.   3. In the course of working on the client's projects, I make improvements to third party open source projects and contribute them back.   4. In the course of working on the client's project, we decide to open source part of the code under the client's name. What are the precedents to this if any? _Update: I added a item in the list above(item #3)._


title: using GNU GPL v2 software as pointers to solution to problem

text: I am coding a PHP serial access class and have been taking pointers from the PHP-serial class on Google Code (here). That class is based on PHP 4 and I'm creating a PHP 5 class that allows more functionality and is specific to some business demands I have. There is no code copied and I have done all the coding. Does the class I'm writing fall under the Google Code's GPL or am I free to select a license that I feel is appropriate? I'm not sure of the standard that applies to licensing when you are only looking to another work for pointers.


title: How would somebody uphold a license on "illegal" code?

text: First off, I want to say that this is **purely hypothetical** ; it's just a scenario that came to mind. I am not looking for personal legal advice, but rather, I'm trying to gain a better understanding of software licensing in general. Suppose somebody open-sources code relating to a botnet (either the code to infect a zombie, control the zombies, or both) under some license, let's say GPL. A few questions.   * First off, are botnets illegal? I don't know if it differs from country to country. I ask because if it isn't, then my question would make no sense whatsoever.   * Can a software license be applied to "illegal" software?   * If a person decides to take that code and violates the license terms, could the original creator take action against said person?   * Even if they could, _should they_? What happens if somebody openly admits they are the creator of code that does illegal things?


title: Improving performance for grepping over a huge file

text: I have FILE_A which has over 300,000 lines and FILE_B which has over 30 million lines. I created a Bash script that greps each line in FILE_A over in FILE_B and writes the result of the grep to a new file. This whole process is taking over 5 hours. How can I improve the performance of my script? I'm using `grep -F -m 1` as the grep command. FILE_A looks like this:               123456789      123455321      and FILE_B is like this:               123456789,123456789,730025400149993,     123455321,123455321,730025400126097,      So with Bash I have a `while` loop that picks the next line in FILE_A and greps it over in FILE_B. When the pattern is found in FILE_B, I write it to file result.txt.               while read -r line; do        grep -F -m1 $line 30MFile     done < 300KFile


title: Generic Repositories with DI & Data Intensive Controllers

text: Usually, I consider a large number of parameters as an alarm bell that there may be a design problem somewhere. I am using a Generic Repository for an ASP.NET application and have a Controller with a growing number of parameters.               public class GenericRepository<T> : IRepository<T> where T : class     {         protected DbContext Context { get; set; }         protected DbSet<T> DbSet { get; set; }              public GenericRepository(DbContext context)         {             Context = context;             DbSet = context.Set<T>();         }         ...//methods excluded to keep the question readable          }      I am using a DI container to pass in the DbContext to the generic repository. So far, this has met my needs and there are no other concrete implmentations of `IRepository<T>`. However, I had to create a dashboard which uses data from many Entities. There was also a form containing a couple of dropdown lists. Now using the generic repository this makes the parameter requirments grow quickly. The Controller will end up being something like               public HomeController(IRepository<EntityOne> entityOneRepository,                           IRepository<EntityTwo> entityTwoRepository,                           IRepository<EntityThree> entityThreeRepository,                           IRepository<EntityFour> entityFourRepository,                           ILogError logError,                           ICurrentUser currentUser)     {     }      It has about 6 IRepositories plus a few others to include the required data and the dropdown list options. In my mind this is too many parameters. From a performance point of view, there is only 1 DBContext per request and the DI container will serve the same DbContext to all of the Repositories. From a code standards/readability point of view it's ugly. Is there a better way to handle this situation? Its a real world project with real world time constraints so I will not dwell on it too long, but from a learning perspective it would be good to see how such situations are handled by others.


title: types of encoding in xml

text: How the encodings work? Which encodings can be used in XML?               To avoid errors      XML encoding while using PHP I heard about               Character Encodings:     Source Encodings:     Target Encodings:      May i know what is the Difference between them?


title: How can a beginning programmer begin to learn and apply testing best practices when developing software?

text: While learning to develop in PHP it has been easy enough that my short, one page, 20 line little scripts I could add "testing code" directly to my functions to figure out where I am or get close to the area in the code where the issue is found (for example, "print_r($var)," "var_dump($var)," "print 'you are here') type stuff. Now that my code bases are growing lines and lines deep and accross multiple files, it's becoming a pain to go through and uncomment out all of my test code, and then go back and recomment it out again once an issue is resolved. Recently I have discovered git in managing my larger applications. I've latched onto branches, and I have a testing branch and production branch I jump between when debugging. The testing branch of course has all my 'print this or that' testing code. However, this still doesn't feel right. As code grows, what are ways I can test and debug it? What are best practices for testing and debugging code as applications get larger and more complex? The phrase "Unit testing" catches my eye now and then, but it's still unfamiliar to me. Is this something I should be paying attention more to? Do large projects have different testing and production code bases and is a version control system the correct way to approach managing it?