Best C# database communication technique

A few days ago, I read an answer stating that writing queries within your c# code are long gone. I'm not sure what the specific person meant with the comment but, it got me thinking. At the company where i work, we maintain an assembly containing all the queries to the database (let's call it Queries). This assembly is reference by a QueryService (Retrieve the correct queries) assembly which in turn is referenced by a UnitOfWork assembly (The database connector classes, we have different connector classes for SQL, MySQL etc.). We use these three assemblies to perform operations on our database and all queries/commands are written by C# code. Is there a better way to communicate with the database and is there a better way to communicate with different database types?


How would I go about measuring the impact an article has on the internet?

For an application of mine, I analyze the sentiment of articles, using NLTK, to display sentiment trends. But right now all articles weigh the same amount. This does not show a very accurate picture because some articles have a higher impact on the internet than others. For example, a blog post from some unknown blog should not weigh the same amount as an article from the New York Times. How can I determine their impact?


Whats the best way to determine when it is appropriate to use a database?

I began my programming career in web development using PHP and MySQL. I got quite accustomed to utilizing db for storage of most dynamic data as well as some setting/parameter data. Sometimes there would be a lot of data while other times entries in the tables would be few. To me this just seemed natural and as far as I'm aware this is more or less an acceptable approach in web development. (Please correct me if I'm wrong...) I'm delving into desktop applications now and my natural inclination is to again utilize a db to store a lot of information that will be generated through the usage of the application. ~~However, as far as I can tell I don't see applications (that I use) utilizing a db very often.~~ _[EDIT: It has since been pointed out that this was a faulty assumption in that many applications do use lightweight dbs embedded into the program itself.]_ What is the reason for this? At what point is it appropriate to utilize a db? Are there any standards on this matter? Also what are the reasons to NOT use a db to develop a desktop application?


When should I use a 2-property class over a pre-built structure like a KeyValuePair?

When should you put Key/Value type of data in it's own class instead of using a pre-built generic structure, such as a `KeyValuePair` or a `Tuple`? For example, most ComboBoxes I create contain a DisplayName and a Value. This is the kind of data I am trying to decide when to put in a new class, and when to just use a KeyValuePair. I am currently working on something that uses `iCalendar`, and the selected user's data ultimately gets combined into a `key1=value1;key2=value2;` type of string. I started out by putting the data in a `KeyValuePair<string,string>`, but now I am wondering if that should be it's own class instead. Overall, I am interested in finding out what guidelines are used when deciding to use an existing structure/class like a `KeyValuePair` over a 2-property object, and in what kind of situations you would use one over another.


AGPL - what you can do and what you can't

AGPL is a fairly new license that was meant to go GPL-over-networks. However, not being a lawyer, and actually not having read the whole license, I can't understand what exactly you can do freely and what not with AGPL. My uncertainty is fed by this post about MongoDB (which is AGPL) and even more by the comments below. If we follow the comments it turns out that you can use AGPL libraries with your closed-source, commercial server-side software, as long as you don't modify the library. Is that the case? Or you have to distribute your entire application when you use an AGPL licensed library? The case with MongoDB is that it uses Apache license for the client code, which poses another question. What happens if you use AGPL software, but deploy it as a different application that your closed-source commercial one? For example, take iText \- it is an AGPL library:   * if you use it and modify it, do you have to open-source your entire application or you have to redistribute only the changes in iText?   * if you use it and **don't** modify it, do you have to open-source your entire application?   * If you wrap iText in another application that you start as a separate process, but use it from your main application, should you open-source everything, or just the wrapper application? (The wrapper application will be HTTP-based API that will take pdf files and will return the results of using iText as JSON). Can this be used to circumvent the AGPL license? Note: The question is about AGPLv3


What are effective ways to introduce the concept of code kata into the workplace?

In your experiences, what are some effective ways to introduce code kata practice into an organization or company? To be clear, I'm not concerned with the usefulness of code kata. I'm interested in methods to introduce this concept to a development team.


Source control approach for plugins?

I'm writing an application and a set of many small plugins—where “many” means dozens and “small” means one or two sources. It's not necessarily going to be possible to divide the plugins into neat, non-overlapping categories. Which would be the best strategy for source control:   * Many repositories, one for each plugin; or   * One repository, with a directory for each plugin? Other suggestions are of course welcome. I'm using Mercurial and hosting on Bitbucket.


My customer wants me to record a video of how I develop his software product

Working as a freelancer, I often see _strange_ requests from my customers, some of which can negatively affect my daily work¹, and others trying to set some sort of control. I usually encounter those things during preliminary negotiations, so it's easy enough at this state to explain to the customer that I do care about my work and productivity and expect my customers to trust my work. Things were much harder² on a project I just accepted, since it's only after the end of the negotiations (the contract being already signed and not mentioning anything about video tracking) and after I started to work on the project that **my customer requested that I record a video of all I do on my machine when working on his project** , that is, a video which will show that I move the cursor, type a character, open a file, move a window, etc. I work in my own company, using my own PCs. I answered to this customer that such request cannot be accepted, since:   * Hundreds of hours of work on a dual-screen PC will require a large amount of disk space for the recorded videos. If I don't care about space, I do care about this customer wasting my bandwidth downloading those videos.   * Recording a video can affect the overall performance and decrease my productivity (which is not actually true, since the machine is powerful enough to record this video without performance loss, but, well, it still looks like a valid argument).   * I can't always remember to turn the video recording on before starting the work, and off at the end.   * It may be a privacy concern. What if I switch to my mails when recording the video? What if, to open the directory with the files about this customers project, I first open the parent directory containing the list of all of my customers?   * Such video cannot be a reliable source to track the cost of a project (I'm paid by the hour), since some work is done with just a pencil and a paper (which _is_ actually true, since I do lots of draft work without using the PC). Despite those points, **the customer considers that if I don't want to record the video, it's because I have something to hide** and want to lie about the real time spent on his project³. **How to explain to him that it is not an usual practice for the freelancers to record the videos of their daily work** , and that such extravagant requests must be reserved to exceptional circumstances⁴? * * * ¹ The most frequent example is to be requested to work through Remote Desktop on a more-than-slow server which uses a more-than-slow Internet connection, or to be forced to use an outdated software as Windows Me without serious reasons as legacy support. ² In fact, I already did a lot of management and system design related work, which is essential, but usually misunderstood by customers and perceived as a waste of time and money. Observing the concerned customer, I'm pretty sure that he will refuse to pay a large amount of money for what was already done, since there is actually zero lines of code. Even if legally I can easily prove that there was a lot of work on design level, I don't want to end my relation with this customer in a court. ³ Which is not as risky as it could be, since I gave to this customer the expected and the maximum cost of the project, so the customer is sure to never be asked to pay more than the maximum amount, specified in the contract, even if the real work costs more. ⁴ One case when I effectively record on my own initiative the video of actions is when I have to do some manipulations directly on a production server of a customer, especially when it comes to security issues. Recording those steps may be a good idea to know precisely what was done, and also ensure that there were no errors in my work, or see what were those errors. * * * **Update:** First of all, thank you for all your answers and comments. Since the question attracted much more attention and had much more answers than I expected, I imagine that it can be relevant to other people, so I add an update. First, to summarize the answers and the comments, it was suggested to (ordered randomly):   * Suggest other ways of tracking, as shown in Twitter Code Swarm video, or deliver a "short milestone with a simple, clear deliverable, followed by more complex milestones", etc.   * Explain that the video is not a reliable source and can be faked, and that it would be difficult to implement, especially for support.   * Explain that the video is not a reliable source since it shows only a small part of the work: a large amount of work is done without using a computer, not counting the extra hours spent thinking about a solution to a problem.   * Stick with the contract; if the customer wants to change it, he must expect new negotiations and a higher price.   * Do the video, "but require that the customer put [the] entire fee into an escrow account", require a lawyer to video tape all billable time, etc., in other words, "operate in an environment void of trust", requiring the customer to support the additional cost.   * Search for the laws which forbid this. Several people asked in what country I live. I'm in France. Such laws exist to protect the employees of a company (there is a strict regulation about security cameras etc., but I'm pretty sure nothing forbids a freelancer to sign consciously a contract which forces him to record the screen while he works on a project.   * Just do and send the videos: the customer will "watch a few ten second snippets of activity he won't understand", then throw those videos away.   * Say no. After all, it's _my_ business, and I'm the only one to decide how to conduct it. Also, the contract is already signed, and has nothing about video tracking.   * Say no. The processes and practices I employ in my company can be considered as trade secrets and are or can be classified.   * Quit. If the relation starts like this, chances are it will end badly soon or later. Also, "if he's treating you like a thief - and that is what he's suggesting - then it's just going to get worse later when XYZ feature doesn't work exactly the way he envisioned". While all those suggestions are equally valuable, I've personally chosen to say to my customer that I accept to do the videos, but in this case, **we must renegotiate the contract** , keeping in mind that there will be a **considerable cost, including the additional fee for copyright release**. The new overall cost would be in average three times the actual cost of the project. Knowing this customer, I'm completely sure that he would never accept to pay so much, so the problem is solved. * * * **Second update:** The customer effectively declined the proposal to renegotiate the original contract, taking in account the considerable additional cost.


Will you list C++/CLI on your resume?

A follow-up of Languages on a resume: Is it better to put "C/C++" or "C, C++"? Would you list `C++/CLI` on your resume? How? How would a resume reviewer initially react to it if `C++/CLI` is new to the reviewer? Will the reviewer feel that the candidate is not precise enough, just like resumes which list `C/C++` instead of `C, C++`? Will a resume parser splits them into two parts `C++`, `CLI` by using the slash as separator? Is it even a language? (Or, a _"glue language"_ )


Why the Select is before the From in a SQL Query?

This is something that bothered me a lot at school. 5 years ago, when I learned SQL, I always wondered why we specify first the fields we want and then where we want them from. According to my idea, we should write:               From Employee e     Select e.Name      So why the norm says:               Select e.Name -- Eeeeek, what e means ?     From Employee e -- Ok, now I know what e is      It took me weeks to understand SQL, and I know that a lot of that time was consumed by the wrong order of elements. It is like writing in C#:               string name = employee.Name;     var employee = this.GetEmployee();      So, I assume that it has a historical reason, anyone knows why?


How to learn/become capable of providing quality app design?

I'm interested in things a programmer should learn/know to provide extremely good application architecture design. As known any design can be regarded as good one for certain circumstances but when it comes to extending app feature set or providing some optimization and etc. it turns out that app was poorly designed or lacks some abstraction. How to be able to predict and include such stuff into app design? And from the other hand, software is here to be robust, efficient and fast. And it's main purpose from some point of view is to bring money (by saving or gaining them). So if one goes deep with abstraction and considered certain stuff that will be needed in 2 or more years, he's not going to end up with good app architecture (he's gonna have lots of unnecessary stuff). So how to understand to which extent certain stuff in app architecture is needed? Hope I made myself clear, else please comment on vague parts.


controlling 2 Windows simultaneously for a-b testing

I'm searching for an app that is cloning all my commands(mouse and keyboard) to a second window. Especially for Browsers. I'd like to test a web page and want to see the different behavior in two windows(different revisions of the page) directly. For example, in window 1 i click link3 and an a specific url opens. This should be done automatically in the second window. If i enter some formula data this should be cloned either. Is there any application for windows oder linux which serves this desire? i know that there are command line tools which clone commands in one terminal to several others.


Using lucene and sql server togheter. Newbie needs directions

Basically the whole thing can be explained simply: I need to index one or more SQL Server 2005 databases with lucene so I can search the various records. I found a lot of examples and documentation and I started to read it. The result is that I got confused and frustrated. So, as a beginner, what are the steps to implement it along with SQL server to search in the databases? I need some kind of workflow to follow so I can sort out a plan to work out the project. I don't really know where to start. -Bonus question: Is there a way to store the Lucene index directly into the SQL server database instead of a FSDirectory or RAMDirectory? -Last one: Do lucene supports similar word searchs? (I.E.: I search 'lu' and I get all the similar words show like the google suggestions, for example 'luke', 'lucene','lua' etc etc.) Please be as detailed as possible, I can program in C# and I've already wrote some SQL Server CLR assemblies to do various tasks, but Lucene mechanics are quite obscure to me. Thank you!


How to create unit/integration tests for my web app?

I am currently developing an Ajax chat application that uses PHP on the back- end. Some of the features it has right now are different types of users (admin/mod/banned), public and private rooms, commands, and announcements. I recently learned about unit/integration testing and it sounds like a good alternative to manually testing everything every time I release a new feature. How can I get started with adding testing functionality into my PHP application? BTW: The app uses long polling (where PHP holds the connection through usleep() and constantly queries the database until new information is returned) so I think that might be a problem when testing it.


How should I include jQuery in a library?

I'm writing a JavaScript graphing library using canvas which I am licensing under MIT, and I'm using jQuery, as well as a couple of other open sourced libraries, all under MIT. I'm also using bower to manage my front-end dependencies. How should I best handle these dependencies without violating the license? Preferably, the user would not have to include multiple scripts, just one `<script src = "graph.js></script>`, and it would include all of the plugins. Should I just ask the user to include jQuery and the other libraries in its own script tag, or should I concat all of the scripts together into one big file, headers included?


How do you decide if you should take a project?

I am a fairly new developer. Professionally I have programed in C# for two years as an intern and 6 months as a junior developer. A friend of my family needs help with a project that is written in VB.net. I have never used VB.net, so I am a little worried there. But, the real question comes in the fact that once I looked at the documents for the project I have a feeling that nothing really good will come from it. I have a feeling that it will cause more stress then I would like to have in my life currently. How do experienced developers make the decision of whether to take the project or just let it go? What are some good metrics to make the decision easier? **Edit** This actually seems like a very large ERP that he would like me to work on and I don't believe that he knows anything about programming so I don't think the fact that I am very junior has even crossed his mind.


What is a good design for a method that can return several logically different results?

The question title is probably too abstract, so let me provide a particular example of what I have in mind: There is a webservice that encapsulates a process of changing passwords for users of a distributed system. The webservice accepts user's login, his old password and a new password. Based on this input, it can return one of the following three results:   1. In case user was not found, or his old password does not match, it will simply return with HTTP 403 Forbidden.    2. Otherwise, it takes a new password and makes sure that it conforms to a password policy (e.g. it is long enough, contains a proper mix of letters and numbers, etc.). If it does not, it will return an XML describing why the password does not conform to the policy.   3. Otherwise, it will change the password and return an XML containing an expiration date of the new password. Now, I'd like to design a class, ideally with a single method, to encapsulate working with this webservice. My first shot was this:               public class PasswordManagementWebService     {         public ChangePasswordResult ChangePassword(string login, string oldPassword, string newPassword)         {             ChangePasswordResult result;                  // send input to websevice, it's not important how; the httpResponse             // will contain a response from webservice             var httpResponse;             if (HasAuthenticationFailed(httpResponse)             {                 throw new AuthenticationException();             }             else if (WasPasswordSuccessfullyChanged(httpResponse))             {                 result = new ChangePasswordSuccessfulResult(httpResponse);             }             else             {                 result = new ChangePasswordUnsuccessfulResult(httpResponse);             }                  return result;         }     }              public abstract class ChangePasswordResult     {         public abstract bool WasSuccessful { get; }     }          public abstract class ChangePasswordSuccessfulResult     {         public ChangePasswordSuccessfulResult(HttpResponse  httpResponse)         {             // initialize the class from the httpResponse         }              public override bool WasSuccessful { get { return true; } }         public DateTime ExpirationDate { get; private set; }     }          public abstract class ChangePasswordUnsuccessfulResult     {         public ChangePasswordUnsuccessfulResult(HttpResponse  httpResponse)         {             // initialize the class from the httpResponse         }              public override bool WasSuccessful { get { return false; } }              public bool WasPasswordLongEnough { get; private set; }                 public bool DoesPasswordHaveToContainNumbers { get; private set; }         // ... etc.              }      As you can see, I've decided to use separate classes for return cases #2 and #3 - I could have used a single class with a boolean, but it feels like a smell, the class would have no clear purpose. With two separate classes, an user of my `PasswordManagementWebService` class now has to know which classes inherit from `ChangePasswordResult` and to cast to a correct one based on the `WasSuccessful` property. While I now do have a nice, laser-focused classes, I made a life of my users more difficult than it should be. As for the case #1, I've just decided to throw an exception. I could have created a separate exception for the case #2, too, and only return something from the method when the password _was_ successfully changed. However, this doesn't feel right - I don't think that a new password being invalid is a state exceptional enough to warrant throwing an exception. I am not very sure how would I design things were there more than two un- exceptional result types from the webservice. Probably, I would change a type of `WasSuccessful` property from boolean to an enum and rename it to `ResultType`, adding a dedicated class inherited from `ChangePasswordResult` for each possible `ResultType`. Finally, to the **actual question:** Is this design approach (i.e. having one abstract class and forcing clients to cast to a correct result based on a property) a correct one when dealing with problems like this? If yes, is there a way to improve it (perhaps with a different strategy for when to throw exceptions vs. return results)? If no, what would you recommend?


Multiple Zend application code organisation

For the past year I have been working on a series of applications all based on the Zend framework and centered on a complex business logic that all applications must have access to even if they don't use all (easier than having multiple library folders for each application as they are all linked together with a common center). Without going into much detail about what the project is specifically about, I am looking for some input (as I am working on the project alone) on how I have "grouped" my code. I have tried to split it all up in such a way that it removes dependencies as much as possible. I'm trying to keep it as decoupled as I logically can, so in 12 months time when my time is up anyone else coming in can have no problem extending on what I have produced. Example structure:               applicationStorage\ (contains all applications and associated data)     applicationStorage\Applications\ (contains the applications themselves)          applicationStorage\Applications\external\ (application grouping folder) (contains all external customer access applications)     applicationStorage\Applications\external\site\ (main external customer access application)     applicationStorage\Applications\external\site\Modules\      applicationStorage\Applications\external\site\Config\     applicationStorage\Applications\external\site\Layouts\     applicationStorage\Applications\external\site\ZendExtended\ (contains extended Zend classes specific to this application example: ZendExtended_Controller_Action extends zend_controller_Action )     applicationStorage\Applications\external\mobile\ (mobile external customer access application different workflow limited capabilities compared to full site version)          applicationStorage\Applications\internal\ (application grouping folder) (contains all internal company applications)     applicationStorage\Applications\internal\site\ (main internal application)     applicationStorage\Applications\internal\mobile\ (mobile access has different flow and limited abilities compared to main site version)          applicationStorage\Tests\ (contains PHP unit tests)          applicationStorage\Library\     applicationStorage\Library\Service\ (contains all business logic, services and servicelocator; these are completely decoupled from Zend framework and rely on models' interfaces)     applicationStorage\Library\Zend\ (Zend framework)     applicationStorage\Library\Models\ (doesn't know services but is linked to Zend framework for DB operations; contains model interfaces and model datamappers for all business objects; examples include Iorder/IorderMapper, Iworksheet/IWorksheetMapper, Icustomer/IcustomerMapper)      (Note: the Modules, Config, Layouts and ZendExtended folders are duplicated in each application folder; but i have omitted them as they are not required for my purposes.) For the library this contains all "universal" code. The Zend framework is at the heart of all applications, but I wanted my business logic to be Zend- framework-independent. All model and mapper interfaces have no public references to Zend_Db but actually wrap around it in private. So my hope is that in the future I will be able to rewrite the mappers and dbtables (containing a Models_DbTable_Abstract that extends Zend_Db_Table_Abstract) in order to decouple my business logic from the Zend framework if I want to move my business logic (services) to a non-Zend framework environment (maybe some other PHP framework). Using a serviceLocator and registering the required services within the bootstrap of each application, I can use different versions of the same service depending on the request and which application is being accessed. Example: all external applications will have a service_auth_External implementing service_auth_Interface registered. Same with internal aplications with Service_Auth_Internal implementing service_auth_Interface Service_Locator::getService('Auth'). I'm concerned I may be missing some possible problems with this. One I'm half-thinking about is a config.ini file for all externals, then a separate application config.ini overriding or adding to the global external config.ini. If anyone has any suggestions I would be greatly appreciative. I have used contextswitching for AJAX functions within the individual applications, but there is a big chance both external and internal will get web services created for them. Again, these will be separated due to authorization and different available services.               \applicationstorage\Applications\internal\webservice      \applicationstorage\Applications\external\webservice


Machine Learning Web Jobs

I always see job positions for web companies for Machine Learning. For example facebook always has this type of job opening. Anyways, i was curious as to what exactly do web companies use machine learning for. Is it for giving people ads based on their site surfing history or something like that. I want to know because i have some experience with machine learning and it sounds like a fun thing to work on as long as i can convince the business guys to go ahead with it.


Data Access Layer, Business Class or Repository?

I've been having a debate within my team on what constitutes a Data Access Layer vs Data Functions vs Business Layers. My thoughts is all database access is done in a data access layer with Repository classes. The DAL contains utility classes & methods that populate a DataSet, List<>, POCO, Execute SQL, but as internal classes using your choice of Access method: ADO, EntityFramework, nHibernate, etc. The Business layer then interacts with the DAL without knowing any of SQL or data access methodology. A teammate has this approach. The stored procedure names and SQL are in the business classes. Then they are passed to the DAL which then populates and executes the SQL. Which is the best practice?


How do you deal with errors in enumeration / list processing (lowish-level API)

Ive struggled with variants of this problem many times, experimenting with different solutions, happy with none. **Abstract:** Enumerating a list of items, an error for one item does not affect the others. Potential callers have varying requirements on how to treat these errors, goal of the API is to simplyfy use and reduce complexity. A more general case in which this problem occurs would be processing a list of independent items, and partial success is acceptable / desired, i.e. it's _not_ run as a transaction. * * * **Example scenario** : I am dealing with a low level C-Style enumeration API like this:                // gets called for each "stuff" item      typedef bool (*tEnumStuffCallback)(stuff * item, void * callbackArg);           // calls "callback" for each "stuff" item.       // caller enumeration context in callbackArgs      void EnumStuff(tEnumStuffCallback callback, void * callbackArg)      {          stuff * item = 0;          for(;;)          {              int err = stuff_get_next_item(&item);              if (err == no_more_stuff)                return;                   // === TODO: handle "real" errors ===                   // pass item  to callback, stop enumeration if requested              if (!callback(item, callbackArg))                return;          }      }      For backward compatibility and "caller expectations", I want/need to preserve the pure C style without exceptions. A higher-level wrapper, built on top, might look like this:                EnumStuffs(std::vector< boost::shared_ptr<stuff> > & items);      The caller may need one of the following strategies when enumeration errors occur:   * Stop enumeration on first error, e.g. because caller will ignore the entire list and enumeration is costly. A C++ client might want to throw an exception from the callback (allowed).    * Ignore the items - e.g. when enumerating connected devices, and looking for a specific one to be available, and device not found errors are handled separately   * Ignore, but log diagnostics in a caller-specific way (i.e. caller needs to know abotu errors)   * Caller needs detailed list of errors for further analysis, e.g. items may be "retried" on certain types of errors Note that this is _the callers choice_ , I can't force a decision. * * * **Note / Context** Example idealized, in practice, I have multiple enumerators involving different types; sometimes I have to provide the enumerator, sometimes the enumerator function comes from the OS. Error information can be more complex than a single `int`. The underlying API involves dozens of rather confusing types already, I want to avoid introducing the same amount of additional/wrapper types. Bridging different development styles is actually part of my job description, opportunities for educating either end is tricky (I have to pick my battles). * * * **My ideas / solutions**   * provide a separate callback for the errors. Enables all scenarios, but bloats the interface.    * Replace the enumerator function with a stateful object. Increases number of types, does not provide backward "style" compatibility.   * pass the errors to the enumerator. that's _sometimes_ a bit better than the previous solution, but usually requires an "enumeration context" structure instead of separate arguments. Goes against the plan to avoid additional types for each enumerator   * introduce an "error type", caller can either request a "list of errors" as a result, or get the "stop/throw at first error" behavior by default. I've used that before, but in the end the detailed information is typically used only to build some diagnostics, and isn't "liked" as it makes it "complicated to deal with errors". * * * **Questions** What are your thoughts? Do you have ideas for, or have you used other approaches? Under what circumstances would you use / not use above approaches? * * *


Supplying code to people helping you debug?

I was wondering if it is wise or advisable to send over a large amount of source code of one's application for debugging and error solving purposes, I'm working on an iOS app that I hope to release to the App Store and am seeking help on Stack Overflow and I'm tempted to send over a large amount of the code so someone (they requested it) can help me. Would you recommend sending over a significant portion of your app to someone for debugging purposes?


Using a GPL game engine

I am confused. I thought I would try and use a new game engine in order to expand my abilities, and found a nice engine called springrts. I was looking through the licensing info and it is licensed under the GPL 2 licence. If I remember correctly, does that mean that anything I make with it, I have to distribute the source code to?


Are Java certifications important for an architect role?

My this question is career path related. I want to know how much Java Certifications (SCJP, SCWCD and others) are important for an architect position. If a person posses a good experience in Java development and want to pursue his career on architect level, do you guys think he need to have certification on his CV. If he has never worked on lead developer roles? If you conducting my interview for an architect position. And I have worked as a Java web developer in different teams having 5 years of exp. Never lead any. And I am having certification badges on my CV. How can a developer make his career path towards being an architect in a team?


Testing an MMO server

I'm working on a **server** for a very large (feature wise) MMO. After some bad experiences with breaking changes that caused bugs weeks down the line, we'd like to add unit/automated/regression tests to our project before we get much father (we've implemented approximately 5% of our requirements). We haven't really used "serious" tests before (we've done the tutorial check- division-by-zero testing) so I thought I'd locate some guides for developing client-server test solutions. I was not able to find anything of much relevance. How should I deal with testing the following aspects of a typical server?   * Testing the client-server communication (API can be broken down into "parsing", "handling" and "sending" stages)   * Testing changes to an SQL database   * Testing security measures   * Testing **around** security measures (ie, making sure our tests don't trip our own security code)   * Testing timed events In case it's relevant, our language is C#, .Net 4.5


Looking for suggestions on where to purchase vs.net 2010 from? which edition?

I need to purchase vs.net 2010 so I can use all the new features and entity framework. ANy suggestions on which edition I should get? Where is a good place to buy it on the cheap?


Openning an Excel File (Like it opens in MS office when double clicked) but using java

some buddy told me there is nothing impossible in programming but i dont know about this one... :) well i want to open an .xlsx file and make it appear on screen normal in MS office, but the problem is, i want to write a program in JAVA for this, which control opening and closing of that file... ???? i dont want to convert it in csv or making my own spreadsheet to show, and also dont want to read constants (like using jxl or apache poi libraries ), i want let that file execute as it is, i want to make a program that make my Excel file open automatically in MS Excel.. could you please help me...!!!!!!


In UML is it correct to have an association class with a composition or aggregation relationship?

An example of an association class is given here: http://pic.dhe.ibm.com/infocenter/rsarthlp/v9/index.jsp?topic=%2Fcom.ibm.xtools.modeler.doc%2Ftopics%2Fcassnclss.html Composition and Aggregation are also types of Associations, just with more defined semantics to what the association consists of. Can association classes also be part of a relationship by Composition or Aggregation? That is, in the case where there is a many-to-many relationship between two entities, with some additional attributes on the relationship. Or would it be more correct to model that as two separate one-to-many relationships onto a middle entity that hold the additional attributes?


My father wants to learn PHP-MySQL to port his application. What I should do to help?

My father is a doctor/physician. About 15 years ago he started writing an application to handle his patient's medical records in his clinic at home. The app has the ability to input patient's medical records (obviously), search patients by some criteria, manage medicine stocks, output receipt to printer, and some more CRUDs. He wrote it in dBase III+. A few years later he migrated to FoxPro 2.6 for DOS and finally in a few more years he rewrote his app in Visual FoxPro 9. And now (actually two years ago) he wants to rewrite it in PHP, but he doesn't know how. The Visual FoxPro version of this app is still running and has no serious problem except sometimes it performs slowly. Usually there are 1-5 concurrent users. The binary and database files are shared via windows share. He did all the coding as a hobby and for free (it is for his own clinic after all). He also use this app in two other offices he managed. Some reasons of why he wants to rewrite in PHP-MySQL:   * He wants to learn   * Easier to deploy (?)   * Easier client setup, need only a browser What should I do to help my father? How should he start? I explored some options:   1. I let my father learn PHP and MySQL (and HTML (and JavaScript?)) from scratch.   2. I create/bundle framework. I'm thinking on bundling CodeIgniter and a web UI framework (any suggestion?) especially to reduce effort on writing presentation codes. What do you think? * * * ## tl;dr My father (a doctor) wants to rewrite his Visual FoxPro app in PHP-MySQL. He knows very little of PHP and MySQL but he wants to learn. What should I do to help? How should he start? * * * Some facts:   * My father is 50 years old.   * His first encounter with a PC is in early 1980s. It was IBM PC with Intel 8088.   * He knows BASIC.   * He taught me how to use DOS and how to program with BASIC.   * The other language he knows fairly well is dBase/FoxPro.   * I got my bachelor CS degree last year.   * I know the internals of my father's app because sometime he wants me to help him writing his app. * * * Update After reading early responses, there seem to be better alternatives to PHP for this case. I'm open for other language/technology suggestions.


Teaching Myself Computer Science, what should I learn?

I've already been programming for quite some time and have a firm grasp on programming itself, OOP, and a few other programming related things. However, **I'm interested in learning the same things that would be taught to a computer science graduate, and was wondering what I need to cover?** In case it's relevant, I've programmed with PHP, Java, Python, C & C++ and I'm looking into Lisp/Scheme.


VS2010 winform designer to learn, or "bottom up" approach?

Long story short, I'm president of a programming club at my university. We're all 1st and 2nd year programming students. We have a project we're about to start working on (converting a console program to a gui program, in c#). Only two of us have any experience working with winforms and event driven programming in general. We want to balance learning with production (getting the project finished) as most of us don't have time to commit to a full on, 40 hour a week project. Our adviser is trying to steer us in the direction of not using VS2010's winform designer, he's trying to make it a requirement that we code everything in a "notepad++" type environment. So basically, I need to get some answers to a few questions that I'm having trouble researching, so when we discuss how to proceed later today and tomorrow, I'm armed with some actual knowledge. (We are all, including the adviser, generally "new" to winforms,c#, and .net) In "real world" situations with winforms, how frequent is it that the designer would not at all be used? Are we (the club officers) right in our estimation that what we have figured at a 4-6 month project (using the designer) would double, if not triple coding everything without it? What are the merits of not using the designer at all as a learning tool to "see how its done"? Is it a valid learning opportunity if we use the designer, then look at the generated code to get more familiar with how our custom controls/event handlers should be done? I'm currently at a bit of a loss, and thank you all for your responses. (Also, if possible could you list your years in field, and degrees if you respond, our adviser is huge on only taking opinions from who he considers "qualified", thanks). Edit -- Also take into account that learning is also one of our priorities, not just time constraints (We're trying to strike a balance between learning every single thing that we can, and having a project that needs so much time invested in it that it becomes unfeasible for us).


How can I reformat my condition to make it better?

I have a condition               if(exists && !isDirectory || !exists)     {}      how can I modify it, so that it may be more understandable.


Is UML a good way to shortly and simply explain a concept?

I was recently in a job interview that was mostly technical. One of the things that stood out was my difficulty explaining ideas and concepts. During the interview I decided not to use UML to explain those concepts, because I thought it can be too time consuming and I will make a mess on paper. So how can UML be used to explain ideas in a situation like an interview, where you need to be as concise as possible when explaining technical concepts and ideas? If you think UML is not a good solution for situations like this, then an alternative will be appreciated.


Custom directive or ng-show/hide

On my form I have an icon which represents whether my entity is locked (shown by a locked padlock) or unlocked (an open padlock). At the model level, this is represented by a boolean property (isLocked). The user can toggle the entity between locked and unlocked by clicking the icon. This also updates the icon tool-tip text. This calls a controller method that toggles the entity.isLocked property. It is like a fancy kind of checkbox. I can implement this in one of (at least) two ways: 1) Create a custom angular directive that changes the class of the icon element to show the correct icon and also sets the tool-tip text. The icon will then be a single DOM element in my view, decorated with the custom directive. 2) Put both the locked and unlocked icon elements in the DOM and show/hide each one using the custom ng-show directive. Option 1 involves writing custom code which feels like the wrong thing to do, whereas option 2 makes maximum use of the built in Angular features, but leaves the HTML more cluttered. In general, should I prefer the custom directive method (option 1) or the HTML method (option 2) or some other method? Which would be considered more idiomatic for Angular do you think? And, more importantly, why? I did consider putting this on StackOverflow, but it feels like it would be considered off-topic there because it is a matter of opinion in the end...


Should timeout be a public static property or a parameter to every function?

**TLDR:** Should TIMEOUT be a public property on my static class, or a parameter to every function? * * * **Background:** I am releasing a c# client-api library that facilitates communicating with our REST api. The client-api consists of an object model and one large static class with a bunch of request extension methods for various types. 10 or so `.Get()` variations, a few `.Post()`, `.Put()`, etc. This static class full of extension methods is preconfigured with our server URL, and some other static configuration constants related to the connection. Because all the functionality is exposed via extension methods, there's no need to create an instance of this class. Any configuration is done via static properties and affects all requests made by the application. **Problem:** Right now, all requests use a default timeout of 3 seconds (which seems generous to us, as our API is meant to be very responsive.) Some users with a bad connection though might want to wait longer for a response. Our quick-fix solution is to expose the DEFAULT_TIMEOUT at a public static property on the class which can be set once on initialization, but is the proper thing to do to add a new optional parameter to every single one of our dozens of methods?               .Get(int timeout = DEFAULT_TIMEOUT) { ... }     .Get(..., int timeout = DEFAULT_TIMEOUT) { ... }     .Get(..., ..., int timeout = DEFAULT_TIMEOUT) { ... }     .Get(..., ..., ..., int timeout = DEFAULT_TIMEOUT) { ... }     ...     .Post(..., int timeout = DEFAULT_TIMEOUT) { ... }     .Put(..., int timeout = DEFAULT_TIMEOUT) { ... }     .Save(..., int timeout = DEFAULT_TIMEOUT) { ... }     ...      On the one hand, we want to be flexible to whatever the consumer of our client-api library might need, but on the other hand, I won't want to get in the habit of polluting every method with every optional parameter that might impact a request (server url, authorization tokens, etc.) What I don't want, is for the user to feel the need to do this:               ClientAPI.DEFAULT_TIMEOUT = 5000;     Thing found = new Thing(){ id = "19473" }.Get();     found.count += 1;     ClientAPI.DEFAULT_TIMEOUT = 20000;     found.Put();     ClientAPI.DEFAULT_TIMEOUT = 8000;     List<Widgets> widgets = found.GetSubresource("widgets");     ...etc      Is it reasonable to assume users won't be micromanaging timeouts for individual requests like that?


Web development in a small team - best practices

Currently developing a web app in a team of two maybe three in the near future. Tech stack is at the moment : flask, mongodb, and extjs for the fontend. I currently have the project under version control using mercurial and bitbucket. Question What is exactly the best way to work as a team on a we app peoject? I ussually work on the back end while my colegue works on the frontent. Sometimes i also help out on the front end. How should we do this? Each has a repo on their system but whee is the web server started? Curentlly i have it on my computer but that means that my partner needs to commit and push for each modification and i need to pull the changes and merge for each change. And for frontend stuff there needs to be a lot of changes. We tried having a server started on each of our machines but its a pain with multiple mongodb servers. Anyway any tips, clues and advices are greatly appreciated and welcomed.


HTML5 card game

I created a card game in Silverlight a year ago, in order to learn a bit about Silverlight. I am now wanting to make a HTML5 version of the game in an effort to learn a little bit more about that. I am thinking I'd like to take advantage of stuff like Knockout.js and WebSockets and the canvas element. Now what I'm confused about is how to lay out the cards on the screen. With Silverlight I was able to make a "Hand" control, which was made up of two sub controls: the cards the player has in their hand and the ones they have on the table. They were made up of Card controls. I don't believe there is the concept on a User Control in JavaScript; so I am possibly thinking about this in entirely the wrong way. I have a client side JSON object called game, which contains an array of players; each player has a hand which is made up of an array of in-hand cards and on-table cards. Ideally I would like to bind these to something using Knockout.js, but I don't know what I could bind to. How could I lay out some cards on the table, and perhaps make reuse of something for each player? Would I simply position images (of cards) on a canvas? Is there a way to make some kind of hand object that each player could have and that I could bind to?


Can I brand my open-source application?

Is it possible for the author to register a logo or the name of his/her application when it is open-source because it uses a gpl library (for example)? The application uses the library but it has its own features, that is it's not a modification of the library. So everyone can see the source code, downloading an "anonymous" non-branded version from Sourceforge, but none can use the logo or the name and so the author can sell it from his/her web-site (for example) to non-expert users, only after payment. Is he/she obliged to give directly the source code, or it is enough that there is the non-branded version available on Sourceforge or other official repository?


Do you keep intermediate files under version control?

Here's an example with a Flash project, but I'm sure a lot of projects are like this. Suppose I create an image with Photoshop. I then export this image as a jpeg for integration in Flash. I compile the fla as an asset library, which is then used in my Flash Builder project to produce the final swf. So it goes like :               psd => jpg -> fla => swc -> Flash Builder project => swf.          => : produce     -> : is used in      The psd, fla, and Flash Builder Project are source files : they are **not** the result of some process. The jpg and swc are what I would call "intermediate" files. They are the product of one (or more) source file(s) that are used as input in another tool or process. The swf is the final result. So, would you keep those intermediate files under version control? How do you deal with them?


Optimum Number of Parallel Processes

I just finished coding a (basic) ray tracer in C# for fun and for the learning experience. Now I want to further that learning experience. It seems to me that ray tracing is a prime candidate for parallel processing, which is something I have very little experience in. My question is this: how do I know the optimum number of concurrent processes to run? My first instinct tells me: it depends on how many cores my processor has, but like I said I'm new to this and I may be neglecting something.


Big source tree refactor ahead - what tool to use?

We are doing a major refactor of the layout of our source tree. Masses of files are being moved, folders are being renamed, etc. etc. We currently have everything in SVN. We're going to move to either GIT or HG in the future. However, now we're thinking that maybe we should move to GIT or HG first and then do the refactor. We're worried that work in progress on svn branches aren't going to be able to merge the refactoring changes into their branch NOR are they going to be able to merge any changes to files that have been moved and/or renamed back into the trunk.   1. Which between GIT and HG would better handle this type of refactoring?    2. If we do move to GIT/HG and then do the refactor, what will be merging be like for the work in progress branches once they move to GIT/HG?


OpenID implementation - PHP, Javascript, MySQL

I've started doing some research on the technologies that I will need for my website. I'm trying to implement a really simple website with OpenID user registration. The website will store a block of text for each user. I imagine this means that I will need a database with:   * User ID   * Open ID url   * Data Having said that, I'm still having trouble deciding what I really need to do this. I know that I will need the following for the actual site:   * Javascript   * JQuery   * CSS But on the back end, I'm kind of lost at the moment. I've been looking at the OpenID-Selector, which is coded in Javascript. It seems like it's exactly what is used on this site. Will I actually need PHP? MySQL for the data and user registration?


How to tell if a license is compatible with your program?

I'm using a code sample from MSDN in my project. Accompanying the sample is this license: http://pastebin.com/K46NYf69 I've modified the code sample slightly to better suit my needs and I now want to release my program as open source. However, I'm not sure which licenses are compatible with this license because I cannot find it on Google. The license claims it is a Microsoft _Permissive_ License but I can only find Microsoft _Public_ License. Also, I'm not completely sure what this license allows. Can I modify the sample? Can I package it in my project under another license like the GPL or the Apache/BSD license? Thanks for reading.


Form Follows Function in Programming?

Does the saying, " **form follows function** " hold true in programming or language-design? Why or why not?


Why do languages such as C and C++ not have garbage collection, while Java does?

Well, I know that there are things like malloc/free for C, and new/using-a- destructor for memory management in C++, but I was wondering why there aren't "new updates" to these languages that allow the user to have the option to manually manage memory, or for the system to do it automatically (garbage collection)? Somewhat of a newb-ish question, but only been in CS for about a year.


What is the name for this variation to Adapter Pattern?

### Introduction An Adapter normally wraps another object, so that it can be used in an interface it wasn't designed for, e.g., when you want to use               interface Node {         Node parent();         Iterable<Node> children();     }      together with               class TreeModel {         private Node root;         // example method (stupid)         Node grandparent(Node node) {             return node.parent().parent();         }     }      and you're given a class like               class File {         File getParent() {...}         File[] listFiles() {...}     }      you need to write some `FileToNodeAdapter`. Unfortunately, it means that you need to wrap each single object and you also need both a way to get from `FileToNodeAdapter` to `File` (which is trivial, since it's embedded), but also from `File` to `FileToNodeAdapter`, which leads either to creating a new object each time or to using some `Map`, which must be either globally accessible or referenced in each `FileToNodeAdapter`. ### The Pattern Replace the interface `Node` by               interface NodeWorker<T> {         T parentOf(T node);         Iterable<T> childrenOf(T node);     }      and modify the `TreeModel` like               class TreeModel<T> {         private NodeWorker<T> nodeWorker;         private T root;         // example method (stupid)         T grandparent(T node) {             return nodeWorker.parentOf(nodeWorker.parentOf(node));         }         ...     }      Does this pattern have a name? Are there any disadvantages, besides the fact that it is little bit more verbose and only applicable when you are in charge of the `TreeModel` code?


Hobbyist programmer releasing software with a donate button

I'd like to start this with a disclaimer that I realize that a full, clear-cut answer should be sought out by a lawyer. I am more so curious about what other users of this community have done * * * Say that I had a small program that I had developed for fun, that I wished to release to the public. I'll drop it out there with one of the various open- source licenses, and probably put it up on SourceForge or Git in case if anybody should ever want to fork/maintain/check out code. Also say that I wanted to accept donations for the project, with absolutely 0 expectation that people will send any money. However, if somebody donated in order to buy me a beer or a pizza for the work that they liked, I would accept gladly. The question, then, is what are the general requirements of accepting donations? Can it go into a personal account with no questions asked as a "gift," or do I need to setup an LLC to avoid any taxation issues? (US citizen here). Again, yes this should be lawyer discussed, but I also know that many projects that I see have the ability to donate, and assume that the community probably has a decent amount of experience in this regard.


How not to suffer from ideologists when you're a pragmatic person?

I'm a pragmatic person (I think I am. But then again, Jon here has an interesting point ). Sometimes, the most simple solution to a problem to get the job done is the one that fits best for me, if it's not an utter blasphemy and reproach to any design principles. Check out my answer to this question on Stack Overflow. Simple. Works. Was accepted. Could be improved. Is clearly not perfect and not very elaborate. And along comes this guy. He downvotes me, comments on the question how his answer is better, more accurate etc and when I ask him why he downvoted me, he calls me _plain wrong_ in his comments. Reminds me of this comic strip. Just to get this straight: His answer is clearly better. But that's not the point! While on Stack Overflow I can laugh and not really care about these things because those people are far away, in the real world I'm suffering from ideologies every now and then. Heck, I'm not creating a miracle piece of software, I need to keep that huge legacy thing running, and it's an adventure to me every day. I'm good at some things and bad at other things. I'm eager to learn stuff. But I can accept one or two flaws in a system as what they are: flaws. Tomorrow, we're going to refactor all of them, but first let's do what the customer wants, and then have a beer. My questions are:   * How do you deal with ideologies / ideologists, when you're a pragmatic person?   * How do you deal with pragmatism / pragmatists, when you're an ideologic person? I'm interested in both point of views.


Is it possible to be good at both programming and graphic design?

The stereotypical view of a programmer can't do graphics very well, from what I've read and seen. However, I love programming (preferably OOP, PHP, C++, Objective-C) and can't deny the fact I have a unique taste in web design and others have said I am doing well at it (CSS). I thought to myself "Hey, wait, I'm a programmer - how can I design well?". Question is: is it possible to be good at programming and designing? Does anyone here feel the same? For the record: actual images I have created have been called programmer art several times before by friends


Search algorithm

I would like to create a site where users can post articles with the following optional parts:   * A title   * Contents (text)   * Categories   * Keywords Articles will be stored in mongodb and the site will be built in node.js. Users can search the site using a normal search text box. I'm thinking about creating the following collections:   * Users   * Articles   * Keywords I will then create an entry for each keyword used in the Keywords collection with an array containing all the articles that use it. If a user conducts a search, the search is broken up into keywords and each keyword is looked up in the Keywords collection. Each article is then retrieved from the db and ranked based on relevance. My questions are:   1. Would it be efficient to use a Keywords collection like this, should I just use the Articles collection (Using full-text search or something) or should I structure it in some other way?   2. How would I incorporate the ability to search the title, contents or categories for articles instead of just the keywords?   3. Would it be better to use something like Apache Lucene than to build this functionality myself?


How do I test my validation without being too much perfectionist, yet to leave most part of logic tested?

For example I would like to validate that name is letters only and is between 4 and 14 letters length. I have the following code in model:               validates: name, :format => { :with => /^[a-zA-Z]+$/,                                   :message => 'Name should be letters only. },                      :length => { :minimum => 4, :maximum => 14 }      So it clearly lets me do what I want. But as for unit tests, I have a bit too much perfectionism so I set something like               invalid_names = ['1234',                      'qwe',                      '1%#$#$',                      'Sam1',                      '%',                      random_string(15)] #I also have a test method to create random string with parametrized length          valid_names = %w['test',                      'Travis',                      'John',                      random_string(5),                      random_string(14),                      random_string(4)]      and test each of them in a loop with asserts, like               invalid_names.each do |name|         user = User.new(:name => name)         user.save         assert user.errors[:name].any?, "#{name} is valid."     end      So it definitely works great. But it is too verbose (because of valid/invalid names arrays, and added `random_string` method), also I can't be sure my test actually tests all symbols and their combinations possible and all lengths and stuff, even though I am definitely sure it works as expected. So what is acceptable way to test my validation without being too much perfectionist, yet to leave most part of logic tested? Am I just set in a mind trick of trying to write a perfect code just to write a perfect code and forgetting about main finish goal: working product?


My proposed design is usually worse than my colleague's - how do I get better?

I have been programming for couple of years and am generally good when it comes to fixing problems and creating small-to-medium scripts, however, I'm generally not good at designing large scale programs in object oriented way. Few questions   1. Recently, a colleague _who has same number of years of experience as me_ and I were working on a problem. I was working on a problem longer than him, however, he came up with a better solution and in the end we're going to use his design. This really affected me. I admit his design is better, but I wanted to come up with a design as good as his. I'm even contemplating quitting the job. Not sure why but suddenly I feel under some pressure e.g. what would juniors think of me and etc? Is it normal? Or I'm thinking a little too much into this?   2. My job involves programming in Python. I try to read source code but how do you think I can improve me design skills? Are there any good books or software that I should study?  Please enlighten me. I will really appreciate your help.


Seeking advice on design of application protocol

**UPDATE 1** as requested by Brendan. We are developing a Unix batch application for storing millions of customer records into a relational database. In order to allow multiple batch jobs to run in parallel, and to achieve a certain amount of concurrency while processing an input record, we've distributed the work across nine server daemons, all within the same LAN as the client, each of which is responsible for an isolated task (e.g. store the name in the name table, store the address in the address table, etc.). Each daemon will be able to accept connections and requests (concurrently) from multiple clients. Finally, whatever communication protocol we design (or adopt) must be extensible to accommodate different _kinds_ of connections - for instance, we'd like for a monitor tool to be able to connect to a daemon, over the same port as the clients, and request statistics or send commands. There will also eventually be different kinds of clients that require different functions to be performed by the daemons. In other words, a client connecting to a daemon will have to be able to declare "I want to post customer records," or "I want to apply a batch of changes-of-address to the database" or "I want to send you a few commands." I think it's a foregone conclusion that the underlying transport of these connections be TCP. Finally, apart from the "command session", these will be multi-million record batch jobs, and performance is critical. The processing is iterative, and every record has the same layout (so wrapping each one in XML, say, would be unnecessary and highly wasteful). I've no idea if this is enough information for someone to suggest some formats and protocols to use, but I'll gladly try to clarify or supply additional details if asked. **END OF UPDATE 1** * * * (Below is the original post, which may or may not be of any value.) * * * I'm in charge of designing an application protocol for a set of in-house, batch-oriented, client-server applications. I'm familiar with IBM LU 6.2 (a.k.a. "Advanced Program-to-Program Communication"), and for the past 15 years have worked in Unix environments. The client is a batch job that connects to a server process — which, in turn, connects to nine other "sub-server" processes. The client passes a customer transaction record to the server, which distributes different portions of the record to the sub-servers. Each sub-server processes its portion independently and concurrently, and passes some results back to the server which then passes them back to the client. These are TCP connections, and we decided that, first of all, we'd use newline-terminated ASCII strings (we call these **lines** ) as our Protocol Data Unit. A **record** is a line that is subdivided into tab-separated **fields** , and since each process will have its own data requirements, field#1 of every record will contain a **record type**. This is used as a key into a metadata store to find the **field names** , in the order they’re expected to appear in the record, in order to know how to interpret the record. For example:               Metadata: NAME=(prefix, first_name, middle_name, last_name, personal_suffix, professional_suffix)     Record:   NAME||CHAP||HARRISON|JR|CTO#      (Here I use '|' to represent the tab character, and '#' to represent newline character) Very straightforward so far, I think. But then, new twists arose. The first was that, instead of sending all the data about one transaction in a single [large] record, we'd like to possibly use several records: a NAME record, an ADDRESS record, an EMAIL record, etc. So we invented the **block** \- a series of records, preceded by a “special” **BB** record and followed by an **EB** record. The BB record’s first field is, of course, 'BB', and the second field holds the **block type**. Block type, like record type, is a key into metadata listing the record types (required, or optional) in this block type. Understandably, each of these ten or so processes, having its own unique data requirements, has led to its own set of record types, enclosed in their own set of block types. That's a lot of metadata, but it isn't really a showstopper. The next thing requirement that emerged was a special "context-setting" message, to transmit certain configuration variables that would remain constant from transaction to transaction. This gave rise to a new record and block type, as well as a new column in the block metadata that indicated this kind of block was somehow "special". Then, envisioning circumstances where the "context" could _change_ during the runtime of the client, we lifted the rule that stipulated there could be only one "context" message, at the beginning of a connection. At the same time, we realized there was still a need for a true "initialization" message that could only come once, at the beginning, conveying "session-global" parameters. Thus the INIT block was born, and now there were three flavors of block: session- initialization, context-switching, and normal application data. Then, how about a connection that isn't for transaction-posting at all, but rather a control session for querying the health of the server, retrieving statistics, changing operational settings? The INIT block’s role became more general, declaring the "mode" of the session, which could now be either "posting", or "control." We've been trying to wedge all of this into a single-layered application protocol, and it's getting out of hand. Just defining a "special" BB record should have raised a red flag - it's constructed from application-level objects and metadata, but it is not application data - rather, it _frames_ the application data. * * * I think what has evolved is a 2-layer architecture atop TCP: one layer that simply provides typed containers (blocks and records), and a higher layer that uses those containers for a specific purpose, be it posting, or control, or something else - the true application protocols. However, I'm not well-versed enough in the design of protocols to recognize "patterns" that might be obvious to the pros. I'd appreciate any feedback on how to approach this. It also seems possible that someone may have written a guide to designing protocols, that addresses these very concerns. I just haven't found it. And my apologies for the length of this post. I hope none of it was immaterial. My deep thanks for your patience! Chap


Coding Style for Visually Impaired Programmer

I am visually impaired. With glasses I see well enough to drive, but at the font size I'm comfortable working at I can only see about 15 lines of 100 characters at a time. This has affected my coding style. One thing I do is write shorter functions. My code tends to get good reviews because these short functions with good names make the higher level functions very readable, but in high performance situations some folks make comments about how much space I'm taking up on the stack by passing variables down several layers for processing. A second thing I do is divide classes up between files to make shorter files. This reduces the scrolling distance to get to relevant functions and depending on organization may allow me to put the files up on different monitors to look at them together. Both of these practices make for more documentable units that most coding styles require I document, which further aggravates the issue by extending the length of my file and the distance between related functions. I'm currently using Visual Studio, which allows code folding at the function and comment block level (which I use frequently) but does not fold at the bracket level like Notepad++ does. The editor that offers better code folding doesn't have all the intellisense features of VS. I could use regions in VS, but this looks very cluttered if used every 10 lines. Folding is occasionally helpful to get completed code out of view while I'm working on a different feature of the code. Can anyone recommend better coding practices to help with limited visibility of the code?


Do you have to include a license notice with every source file?

I've been looking for various licenses that I can use for an open-source project of mine, but all of the projects that I've seen, with all kinds of licenses, appear to have a giant, obnoxious (in my opinion) notice in each source file that states that the file is listed under a certain license. I don't think that I've found a single source project that isn't public domain that _doesn't_ have a notice like that. This just seems like a waste of time and file space. I plan on putting `@license` and `@author` tags in my projects, but I don't see why I need to list such a giant notice in each individual file if I don't want to make my code public domain. Is there any reason why I would want to include such a notice in my projects, or would simply including a notice in the `README` and a `@license` tag be good enough? Does this affect the "clearly stated" rule of most licenses, or is it just overkill so that people won't argue?


Copyright in all files or just a license file?

Does it have any legal merit to put a copyright comment on each class. Example:               //     // MyClass.h     // Companyname     // Created by DeveloperName on MM/DD/YY     // Copyright YYYY Companyname. All rights reserved.     //     public class MyClass { ... }      Or does it have the same effect as putting a license file in the root of the source code, like many do on github.


How much design happens in your implementation phase?

For those of you who work in big-design-up-front/waterfall groups: how much critical thinking and design is skipped in your design phase and left to your implementation phase? How complete and detailed are your functional and technical specifications delivered at the end of the design phase? It seems to me that there's a lot of room for interpretation in the level of detail that needs to be provided at the end of the Design phase, and it irks me when the design phase is rushed and then managers get angry that the build phase doesn't progress like we're churning out widgets on an assembly line. On the other hand, a design phase that's complete enough to make the build phase operate like an assembly line practically includes the implementation phase with it - all that would be left in "build" is to type stuff into the editor. Of course, it also means your design phase is gigantic. **I realize that this is a shortcoming of the waterfall model** , but if there's anyone out there that can provide some constructive advice: Where does one draw the line? What should the expectations for the design and build phases be, and what kinds of design shortcomings or mistakes should/shouldn't be tolerated in the build phase?


Need advice on designing interactions between various parts of my application

I'm trying to design the "main" classe(s) of a Rich Desktop Application based on NetBeans Platform 7. This application will consume HTTP services and, through a "push system" over TCP, will receive messages.   * We are 3 developpers and we want to develop modules in parallel   * Application will be layered (Data, Business, Presentation)   * We'll use Presentation Model in order to separate responsibilites   * Some granular data (a bean Person for example) will be shared by several screens (and possibly displayed on several screens at the same time)   * ... We are able to develop individual screens, but We don't know exactly how to organize the whole application and define each module content.   1. So, have you any advice (a pattern / best practice / book / sample app) to coordinate/manage interactions inside of the whole application?   2. Any advice about how to define modules content? Thanks! * * * Small example to illustrate what I want to build: **A Foo User Management Application**   1. Launch the application   2. At the left [explorer] we have a list of platforms (list is stored in a local file)   3. At the top we have button to add a new Platform (also available with right click)   4. By double-clicking on a platform, the app calls a HTTP service a retrieve a complete list of users. This list is displayed in the [editor] (in a JTable)   5. A background process is started: through a TCP connection we receive messages   6. It is possible to Add new user thanks to a button in a Toolbar If the application is launched on another PC, and if the user is connected to the same platform, its User List will be updated dynamically (add/remove/status:{offline/online}) (thanks to messages) In the future it a Chat Module will be provided. My question is (in other words): any advice/best practice to decide on content of each module? If PM (Presentation Model) is a good way to separate view/business and data and create screens, what is the best way to link several screens based on PM? Imagine we develop the Chat Module, how to add an entry "Discuss with..." to the Context menu available with right click on User List?


How can I properly manage commits, prevent feature conflicts, and manage dependencies with a VCS?

It’s become an annoying factor of working with large teams: how do you manage checkins and prevent feature conflicts and manage dependencies with source control properly? Currently at my workplace we use TFS 2008 and we're migrating to TFS 2010 in early December. Firstly any source control is better than none but what approach has anyone found useful to prevent multiple checkins and rollback all over source control history? Is a volatile trunk the best way to go or branch off when your implementing a new feature and once you're happy merge back into the trunk? I'd really like to hear other people experiences and perhaps some best practices to managing source control.


Tdd on a datadriven webapp

How would one go about to use tdd/bdd on a mostly data driven webapp? For example a blog or a forum?


Is it reasonable to assume/require the .NET framework these days?

**Background:** I have a project where I need to provide the user a download package with some sensitive data in it. The data needs to be encrypted. After they download it, they need to be able to view it (no editing required). For this question, let's approximate the data as a series of static html files. Because the data is sensitive, it needs to be encrypted any time it is on disk. We are thinking of providing the user with a download option that would give them a zip file containing two files:   * A data file (we'd probably use an encrypted zip file behind the scenes) with the data they asked for   * An application to view the data that would appropriately prompt for a passphrase and handle decrypting the data and displaying it via an embedded web browser. Additional details:   * Users are not under our control. They are consumers.   * We are not worried about cross platform in this question. This is just about Windows. We will have a separate download for Mac users. **Get to the question already:** For that application we need to create, we're internally debating if it is reasonable for that app to be a .NET winforms application. We want a single .exe, and we want the download to be reasonably small (e.g. 100k).   * Dare we use the .NET framework (we don't need to use a particularly recent version of .NET--2.0 would be fine)?    * Is it reasonable to assume that most consumers have .NET on their machines now due to Windows Update?    * Is it reasonable to ask the ones that don't have it to install it? We know that 100% of users will not have .NET. The real question is if it is _reasonable_ to ask them to have it in this day and age. P.S. Does anyone know of any reliable statistics of what percentage of people actually do have .NET installed already?


What is a job in programming really like?

More specifically: **Is a job in programming really as bad as it sounds?** I'm still in high school, but I love programming. I take all of the programming classes that my school offers (which are actually quite a lot), and program in my free time. In college, I intend to do something related to programming, and then I eventually hope to get a job in programming something. However, from what I've read on the internet, a job in programming sounds really terrifying and intimidating, and I'm wondering what it's like, and if it's really as bad as it sounds.


Controller layer and 3-tier architecture

What is controller layer and where we put this in our 3-tier architecture?               1)UI     2)Business Logic Layer     3)Data Access Layer      I search in net but unable to get exact ans.Any links or sample example helps to understand better.Thanks.


If you had to go back and re-learn your skill set, how would you do it?

My younger brother is looking to start programming. He's 14, and technically- inclined, but no real experience programming. He's looking to me for guidance, and I don't feel as if my experience is enough, so I figured I'd ask here. He's more interested in web programming, but also has an interest in desktop/mobile/server applications. What would be a good learning path for him to take? I'm going to buy him a bunch of books for Christmas to get him started; the question is, what should he learn, and in which order? The way I see it, he needs to learn theory and code. I'd like to start him off with Python or Ruby or PHP. If he wants to get in to web, he's also going to need to learn HTML, CSS, Javascript, etc. Out of those three domains (Languages, Theory, Markup/Etc.), what is the best order do you think to learn in? Also, am I missing anything? Thanks!


'import module' vs. 'from module import function'

I have always been using this method:               from sys import argv      and use `argv` with just **argv**. But there is a convention of using this:               import sys      and using the argv by `sys.argv` The second method makes the code self documented and I _(really)_ adhere to it. But the reason I prefer first method is it is fast because we are importing only the function that is needed rather than import the whole module (which contains more useless functions which python will waste time importing them). Note that I need just argv and all other functions from sys are useless to me. So my questions are. Does the first method really makes the script fast? Which method is preferred most? Why?


Database Design for Web based RSS Feed Agreegator

I am working on an open source application which can allow users to add RSS feeds. All users of the site can read the content of those RSS feeds. It's not just for user's own feeds. Using PHP and SimplePie library I have created a simple app. I am trying to implement category based listing. I have a list of RSS/Atom feeds in a database. Each post in the feed can have a category/label associated to it and a single feed can have multiple posts falling under multiple categories. **Question:** I want to get only the posts of category "Science". In worst case, if I have 1000 RSS feeds, should I read posts from each feed and check the category of each post? Storing all posts of each feeds and its categories is not a good solution. How best can we have a database design for this? Database schema is provided below. Nothing is fixed and I am free to change any schema or design. http://sqlfiddle.com/#!2/2b519/1 NOTE: The fiddle is just for reference and does not need to worry. Its optional as I thought it might help to make others understand.


Which programming language is the best to start learning/teaching about programming

As this question is closed, let me do an attempt that actually meets all 6 requirements. At our faculty, there's for the moment a big change in the classes "informatics". We used to teach Java, but this is going to be replaced with Matlab (and the class will be called "Scientific Computing"). Personally, I'm not in favor of that idea, because :   * Matlab is not freeware, hampering the possibilities for the students to get hands-on experience. They can on campus or via VPN, but not on their own computers.   * ~~Matlab isn't even a real programming language, but a mathematical environment that excells in that but fails in anything else.~~   * ~~Matlab isn't suited for general concepts of programming.~~ edit: these last two points seemed a bit strongly formulated. Matlab has progressed quite a bit since I last encountered it. Now I also had a problem with Java, as that turned out to be a real pain in the proverbial behind for many students, mainly because of the verbosity. As it's for a general course in programming, I think these points are important :   * all basic concepts of programming   * rather easy syntax without too much verbosity    * the possibility to easily program both procedurally and object oriented   * a short feedback loop on your programming    * a proven usefulness in many applications, especially in the scientific world (bioPerl, bioConductor, bioPython, bioJava, ...) so they can be used for practical work during their studies. **What's your idea about the best teaching language on a serious level (hence not the pseudo languages used in primary or secondary school, I'm talking bachelor level at university/college)?** * * * edited to keep the question more general. Originally I mentioned R, Python or Perl, and : R is maybe less of a good choice as that one is a vectorized language. This is far from general, so it might be too specific. **edit:** I consider it a blessing, but the argument here was that a vectorized language is not general enough for teaching purposes as people would get into trouble when moving to Perl and Python. I'm also not talking statistics education, we're talking students of level 1st bachelor. Any direction, any kind. I just added the personal experience.


How should I document a multi-tier application?

I have to create a documentation structure for a legacy application, and I'm not sure of how to organize it. **Documentation goals** :   * List of use-Cases   * Program flow for each of the use cases. ( _Flow-chart of all the logical steps the code does for a particular use-case_ ).   * As far as possible explanations of _why_ a certain business/code logic is followed.   * Documentation format if possible should not require installing a new tool, and at best be readable in Word or PDF Format (so that the business types can check it easily).   * Some questions that should be answerable using the documentation: "What business logic does the code execute for a given use case?";"Is this code redundant elsewhere in the application?"; "If I change this code, what Use-Cases are affected?"; **Application characteristics** : (it's generally a bit messy, with presentation and business logic slightly mixed in almost every layer)   * Presentation in .NET Web Forms using WebControls (GridViews, ObjectDataSource, Reports) and JavaScript(jQuery, jQuery-ui) in *.aspx pages   * Server-Side Code in C# in the *.aspx.cs to handle post-back events.   * C# Code-Pages and a Seperate Project integrated into the WebApplication supplying Business Logic as part of the Web-Application   * SQL Server for data persistence (Master-Data DB, Data Staging DB)   * Views including some data from others Servers   * C# CLR assemblies for business logic deployed on the SQL Server, and some minor SQL Stored Procedures/Triggers   * A File structure on the same server as the SQL DB that handles archiving, data-import from files.   * File interface to SAP (that I don't fully understand yet). **So far...** I've started documenting in Word. I have a separate Word file for the Front-End and the Database/File Structure. I begin each File with Use- Cases (user-initiated are in the front-end, scheduled jobs in the Database file), followed by the code structure. Each use case has a hyperlink to a flowchart/explanation of the code that first gets executed, which has a hyperlink to the flowchart/explanation of the code that next gets executed, etc... I do this so that each part of code is documented only once, and that other parts of code documentation can link to it if they execute it in the application. **Problems** :   * I can't navigate backwards from hyperlinks ( _i.e. I can't answer the question: "If I change this code, what Use-Cases are affected." I can only go from Use-Case to Code, not the other way around._ )   * The word document already feels clunky and messy after I've barely started to write stuff into it. **Question** : How can I document this multi-tier application without making a great mess?


How to effectively telecommute when working for a small firm?

I'd like to know what experiences others have had telecommuting full time? What software tools and processes helped maintain cohesion and maximized collaboration & productivity?


Can we guarantee a program will never go wrong?

We have a system here. Recently there is a wrong calculation in one of the number in the report generated by the system. Through out our experience, we've never encounter any problem/error in this system for some years. Because the writer of this system had already gone, we can hardly trace the programs. But we've verify the input data, the setting and they are right. Now my question is, will a computer program suddenly go wrong without any logical reason? If I slam on the server machine, will one of the number which the computer is calculating, become another number and make the calculation wrong? I agree my idea there is quite mad, but I just want to know, how can we know the problem is not caused by the program and the input, but some other factors? P.S. This mad system has no log.


Can I remove all-caps and shorten the disclaimer on my License?

I am using the MIT License for a particular piece of code. Now, this license has a big disclaimer in all-caps:               THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY     OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT     LIMITED TO THE WARRANTIES OF...     ...      I've seen a normally capitalised disclaimer on the zlib license (notice that it is above the license text), and even software with no disclaimer at all (which implies, i take it, that there is indeed a guarantee?), but i'd like some sourced advice by a trusted party. I just haven't found any. GNU's _License notice for other files_ comes with this disclaimer: > This file is offered as-is, without any warranty. Short and simple. My question therefore: Are there any trusted sources indicating that a short rather than long, and a normally spelled rather than capitalised disclaimer (or even one or the other) are safely usable in all of the jurisdictions I should be concerned with? For the purposes of this question, the software is released in the European Union, should it make any difference.


What is the difference between a Future and a Promise?

What is the difference between a Future and a promise? (In Akka and Gpars.) They look the same to me as both block and return the value of the future when get is called and a promise is to get the result of a future.


Technology choice for cross platform development (desktop and phone)?

I'm a Microsoft developer mainly, but there are a couple of small-ish projects I'd like to fiddle with which would benefit from being cross platform. The platforms I want to target are: Windows, Linux, Mac, Android and preferably iPhone, web (running in a browser). I need 3D (Around the level of support seen in something like Minecraft (I'm not writing Minecraft)), some networking. I'm pretty certain Java would work on all except iPhone. Looking at the "related questions" above it's offered up QT (no browser or phone afaik) and also HTML/CSS/Javascript (3D? package for desktop?) The other alternative is to have seperate versions for seperate platforms, developed with some common code where possible. That option isn't something I know anything about. Does anyone have experience of this sort of conundrum? I figured here was better than SO, because I imagine there are compromises which extend beyond technical choice. Finally, this is not a commercial operation, so some of the very expensive cross platform tools are out of the question unless they offer some sort of community edition.


What mistakes in managing software products must be avoided to keep people from hating the vendor?

A previous question about why people hate Microsoft was closed. This is an attempt at a somewhat more constructive question along the same general line. This one is both broader and narrower though. It's more general by being about software vendors in general, not just Microsoft. It's narrower by dealing only with management of software products. So, what steps should be taken (and/or avoided) in managing individual software products to assure that not only the individual products, but the company as a whole is respected/liked/seen in a positive light?


Is the Product Owner also a developer on your team?

I'm confused about the PO's responsibility here. I was a developer on a Game Feature Team, but also a PO. The daily work of the developer is almost full time, so I have to work over time to take care my PO duty, and the responsibility of PO seems to be against developer's thoughts. As a PO, I will chose more features next sprint. Otherwise, I will tell myself not to do so, because I'm a team member to develop those features. This situation makes me confused, so I want to hear some ideas from you guys. I'm a new to Scrum and Game Dev (about 1 and half year), and also new to here and English.


Leadership does not see value in standard process for machine configuration and new developer orientation

About 3 months ago our lead web developer and designer(same person) left the company, greener pastures was the reason for leaving. Good for them I say. My problem is that his department was completely undocumented. Things have been tough since the lead left, there is a lot of knowledge both theoretical knowledge we use to quote new projects and technical/implementation knowledge of our existing products that we have lost as a result of his departure. My normal role is as a product manager (for our products themselves) and as a business analyst for some of our project based consulting work. I've taught myself to code over the past year and in an effort to continue moving forward I've taken on the task of setting my laptop up as a development machine with hopes of implementing some of the easier feature requests and fixing some of the no brainer bugs that get submitted into our ticketing system. But, no one knows how to take a fresh Windows machine and configure it to work seamlessly with our production apps. I have requested my boss, who is still in contact with the developer who left, ask them to document and create a process to onboard a new developer, software installation, required packages, process to deploy to the productions application servers, etc. None of this exists, and I'm spinning my wheels trying to get my computer working as a functional development machine. But she does not seem to understand the need for such a process to exist. Apparently the new developer who replaced the one who left has been using a machine that was pre-configured for our environment, so even the new developer could not set up a new machine if we added another developer. My question is two part:   1. Am I wrong in assuming a process to on-board and configure a new computer to be part of our development eco-system should exist?   2. Am I being a whinny baby and should I figure the process out and create a document on my own?


How is transparency defined in context of the broker architecture?

I would like to know how transparency is defined, and what is the measurement for this in the context of a broker architecture. For example : from a developer point of view, [in the broker architecture] distribution is transparent. you talk to a broker one way or the other and it introduces an object model in which distribute services are encapsulated within objects.


Is there any way to get faster at solving bugs? I've just had a warning from my boss

I've just been told by my boss that I will receive a negative performance review on Monday. He wants to talk to me about why I am so slow and why my bug fix rate is so low. I love programming and solving problems but I actually do find my job really really hard. I've actually been a programmer for about 10 years. But this is my first multithreading embedded linux job - I've been here 2 years and it's obvious to everyone that I'm still struggling. And I think I've become so demoralised and feel so marginalised that I've lost a lot of the fire that I had at the start of the job. Has anyone ever been in a similar situation and how do you go about increasing your bug fix rate? * * * Update: I had the review. I have been put on a 3 month 'employee development program' (of the type mentioned by Dunk ). Not sure whether I can turn this around. But even if I do have to move on, I've learned a lot from this experience. ## Another Update It's now about 6 weeks since the first review. My advice to anyone facing the same situation is to be humble enough to take criticism and learn from your mistakes. And to not be afraid to look dumb. Ask loads and loads of questions. Let people know you're trying to learn and keep asking until you understand. But be prepared for it not to work out. I'm constructing a portfolio of code ... as well as giving it my best shot. ## Yet another update I am hesitant to put this on here, since I'm concerned that I will not be able to refer future employers to my stackoverflow profile... But anyway, it might be of interest for someone reading this question, but I actually lost my job a few weeks ago. I'm in the midst of brushing up on all the skills I need to - I've taken a lot from the advice given here.