Is there any use for layout managers beyond Java?

I am a beginning programmer and I was recently working on some primitive GUI apps in Java. That's where I encountered different layout managers. I browsed the web and it says that for advanced GUI creation there are NetBeans and Qt and a lot of other stuff. My question is: Do I really need to learn all ins and outs of layout managers and try to program without advanced layout engines to understand how they work or should I start learning NetBeans right away and skipping the whole manual layout complications? Is there any use for manual layouting beyond Java in other languages? In other words, will my road be less bumpy in the future if I go learn it in detail, or should I just forget about doing manual layouts?


Should I make my project free software?

**The story** Over the last couple month I have been working on a pretty big project. It's an enterprise-level software, I designed to be used at a local gym, but I believe it can be used in other places, where things like keeping track of clients, attendances, purchases and payments are required. **The problem** Well recently, I started to think on how to mature this project from being home-made. Not just because I want my project to grow but also because I would like to have some gain from it. **The solutions?** And here I saw 2 paths:   * License the software under some restricted license and try to sell the software to other business around. This way I can get some money for college (I am a high school junior right now)   * License the software under some free license, publish it on GitHub or something, and try to engage other developers to participate in the project. This way I get experience of working in a team and a better chance that the project will keep growing. The latter would be a good + for my resume, when I'll trying to find a job. So far both ways seem pretty exciting and beneficial to me. The first one offers a good college career, while the second one offers some additional experience and the project's growth. **The questions** Can anyone point to some other +/- of these 2 options? What would the better option in my situation and why? Or are there other options?


Comparing multiple revisions of the same C File

I just wondered if anyone had any tricks or programs they used when comparing two of the same file but different versions? I appear to have foolishly made a modification at some point today (Went a few hours without running any tests) and it has stopped the whole project working - without throwing up any errors so it must be subtle whatever I have done. I just thought that there must be a program out there that might highlight differences etc. Otherwise, a step by step search might be in order!


When to use functions vs methods?

So I know that methods are more OOP than functions. I was wondering if someone could show me an example of a function and a method and explain the differences between methods and functions to me? I have taken 3 quarters of Java programming and functions have never been mentioned, I want to know the differences, strengths and weaknesses.


Letting go of a project

I've been the sole developer of a niche product for my company for nearly 6 years. I've grown quite attached to the project and I enjoy working on it. However, it was the decision of management to take the project out of my hands and move it under the wings of another team. Unfortunately, I'm having a hard time letting go of the project. I'm sad to see it leave my hands since I've put so much time into it and enjoyed working on it, but it also allows me to work on new things. I've even caught myself being a bit hostile to the other team, which is poor on my part. How can I convince myself to just let it go?


Is it legal/ethical to collect and release some types of anonymous usage data without consent?

The type of data I'm hoping to collect is a little specific, and unfortunately I'm under NDA and the data is a core part of the business plan so I'm not at liberty to post it online. I've come up with a similar example, so please bare with me and pay no attention to the flaws of this hypothetical service. Say I make an online "school finder" service, where the user enters their address and the service finds and scrapes the tuition cost of all schools within say a 100km distance from that address. The service would display the list of schools sorted by price, and the user would select the school they are going to attend based on that information. They would also specify any other contributing factors, such as the aesthetics of the campus and the reputation of the school (things like this would be selected from a drop-down menu or something, a small set of non-personally-identifiable options). The school finder would passively collect this data (as opposed to actively seeking out every school everywhere and scraping the qualities of it from their public web page) and use it to both provide better search results, and also display a map centered on the user's region, representing that data somehow. It would point out, based on past usage, the most desired schools based on a number of factors (say, cheapest and most desired would be green, most desired for other reasons would be yellow, and seldom selected schools would be red). Most of the data is just passively collected and is otherwise publicly available, but some of it (the reason the school was picked) is somewhat personal, as well as the user's home address being personal information. The only publicly visible data would be the "rating" of each school, based on a selected region. The only saved data would be the rating and cost of each school, as well as the postal code (or city, whatever) associated with that rating. The service has no user accounts, so it's not feasible to ask every user to agree to a privacy policy for every request. Is it legal/ethical to collect and release this set of information without explicit consent?


I am trying to figure out how difficult or expensive it would be to add this feature

I am trying to figure out how difficult/time consuming it would be to add the following feature: We have a database with our subscribers and we want to send updates to paying subscribers. The catch is that we want these updates to be date dependent. Let me clarify. Joe signed up in June last year. He has been receiving monthly newsletters since June. Now Fred signed up in April, cancelled in May and resubscribed in August. We want to send an update to Joe regarding his June newsletter. Fred was no longer a subscriber in June and we **don't** want him to receive the same update for various reasons. Is this a feature that you would expect to cost 100's, 1000's, 10,000's dollars to implement? **Edit: I should've been more clear, I was looking for a magnitude not an exact cost. It's evident, I know very little about programming which is why I came here. If someone asked me what it would cost abandon a well, I could easily give them an order of magnitude. I appreciate all of the responses; this is an incredible resource.


Paper on Linux memory access techniques sought

Over on stackoverflow someone posted a link to a paper written by a Linux kernel engineer about how to use computers and RAM. He started off by explaining how RAM works (right down to the flip-flops) and then went on to discuss performance problems associated with operations on matrices (column vs row accesses), offered solutions and then dealt with some stuff MMX instructions can do. Sorry it's a bit vague but I can't find it anywhere. I _think_ the guy had a Scandinavian name, possibly Anders


Markup languages syntax

If computers are able to parse data organised in curly braces, why are we using `<foo></foo>` syntax in certain languages? Only because of legacy etc or are there further reasons behind this? I think I speak for many people if I say that that looks just redundant and it's awkward to work with. In adition it doesn't "enforce" indentation like brace-based languages do. **Update** \- I made the mistake of treating curly braces and key-value pairs (which I didn't mention until now) as the same concept. Taking into account this, I'd like to ask my question again: Is tag syntax really more convenient than a JSON-like language?


Sql Server: Compact and LocalDB Denali

Does anyone knows the differences between these ones?   1. http://www.microsoft.com/sqlserver/en/us/editions/express.aspx (Look for CTP3 LocalDB in the page)   2. http://www.microsoft.com/sqlserver/en/us/editions/compact.aspx I wonder why microsoft started Denali project (now in CTP).


Meaning of phrase: "Not your father's Visual Basic"

I have ran into the above phrase many times (especially during classic VB days) and I have been wondering what it really mean and where it originated from. Any ideas?


JIRA: Issue classification, clarification needed

In JIRA, when creating a new issue, i am presented with a number of choices, some of which look like they don't belong. For example: "New Feature". This should be a part of a story right? How can one chose when to use "New Feature" and when to use a "Story"? "New Feature" looks like a type to me or a "Story" to me. Or, take for instance "Improvement". We can start a whole project with it's own "Epic" for the sole purpose to improve a bunch of things. Should such work be filed under an "Epic" or under something else? Please clarify


How to create the architecture/design of an application in Agile?

If I am about to develop an Enterprise application, but as far as I understand from agile process, I break features into small chunks and develop them iteratively. I used to create the database and the core of the application first, then I extend these iteratively. The question is: Do I have to keep what I used to do previously (develop the core first) or I have to distribute core development over stories' development? In the later, I am not sure the code will be flexible enough for future extensions! Any idea?


Can scrum master allocate tasks?

We are following scrum in our project. I see most of the times the scrum master allocates the tasks for us. However, I read from many scrum books that scrum works the other way around (the 'pull' approach) and team members pick up tasks or features. Is scrum master assigning tasks the correct approach or does it go against the agile ideology?


How to get out of the support rut and start repaying the technical debt!

I have a "friend". Yes good start I know but honestly this isn't me! Basically he's been working on a successful project for about 4 years now, the difficulty is the technical debt has caught up and he's finding it almost impossible to stop supporting the product (tweaking this and that) and actually move on with _real_ development. I've made various suggestions, log all of your time, create tickets, don't answer emails etc etc. The problem with this is that it seems to only serve as a reminder that he's not getting anything "useful" done. The technical debt has largely occurred because in the first instance it was a big benefit to the product, to take requests and phone calls from users and just quickly implement them. What I would like to know is does anybody have any suggestions for how he might get out of this rut, a large part of which would be changing the perceptions of the users so that they don't think they can just ring and expect something to be done then and there. It's all very well saying plan better, though I understand it's very difficult to plan actual development given the requirement for support and the relative pressures from users (see above).


Effective programming of data layer management/access

**Short Version** : What is the term/concept which describes the efficient design of programming the data layer for efficient data access and what are some sources/books/articles/website which discuss this concept? **Long Version** : So I had a recent conversation with the senior developer at my small company about how and why we access data the way we do. He told me that it was the single most important aspect of the program and explained how it is the largest bottleneck in efficiency if done incorrectly. He also said he had never learned about it from the courses he took and he never read about it in any books, despite the fact that he thinks it's the first thing he chooses to teach others. I should explain that this is my first year at a job programming, that I have a degree in Electrical Engineering, but not in CS, so I wouldn't know if it was covered in school. Also, the language I work in is Java, but this question was meant to ask about any language's access to data in a general sense. So what am I talking about? I'll explain through an example. We work with a lot of data, so the data layer is a bit complicated. It uses a combination of singleton pattern and factory design pattern to achieve different access. For example, an Object, let's say Customer would be most often instantiated as follows:               Customer customer = Customer.getDefaultInstance(CustomerAccessType.LIST)       OR               Customer customer = Customer.getDefaultInstance(CustomerAccessType.ONE_RECORD)      OR               Customer customer = Customer.getDefaultInstance(CustomerAccessType.LIST_BY_ACCOUNT)      As you may have already guessed, each access type accesses the database in a different manner. The LIST access type most of the time has very few columns, so even though it's grabbing many rows of data, in some cases up to tens of thousands of records (maybe not with customers, but maybe something like orders from a website you can imagine that becoming very large), it might only contain the primary keys on the table and some other very specific information. But when you edit specific data you access using type "ONE_RECORD" and with only a single row you have all the columns of the table (and most probably joins to a lot of other tables). This is more apparent than ever when you're looking at a screen that is painting information in front of tellers and the information is changing constantly. The information shown may be from a table that has as previously mentioned, tens of thousands of records currently being worked on. A LIST type object will grab only the primary keys from the table, then only the records that require painting are accessed, one row at a time, and the information is painted to the screen. So I have two questions as a result of all this:   1. What is the term/concept which describes the efficient design of programming the data layer for efficient data access? Most large programs that have to deal with a lot of data access must have to deal with these same issues. Surely others have coined a term for it?   2. What are some good resources to learn more about what else is out there on this subject? Again, surely others have dealt with these same issues/bottlenecks we are dealing with. Surely other brilliant minds have tackled the problem and written extensively on it, no?   3. What are other ways that perhaps your personal experience has shown you in dealing with this problem, even if you've never read it anywhere else? Your help and knowledge is much appreciated, -Asaf


How do I stay compliant with GPL when forking on Github?

I've recently forked a project on Github and made some modifications to it, pushed them back to the forked repository and asked the original developer to pull the changes. (I gather this is the preferred way of contributing on Github.) The project is licensed under GPLv3. I am the author and the copyright holder of the changes I've made to the code. I am also allowed to publish the modified code (i.e. the combination of the original code and my changes -- which I've done by pushing the changes into my fork) as long as I comply with the license the original author set up. Now, I came across the following requirement in GPL. > The work must carry prominent notices stating that you modified it, and > giving a relevant date. It seems that some work beyond actual coding is required before I'm legally allowed to push my changes to Github. What does this work entail? How do I comply with the above requirement? (Do I add additional copyright notices to the modified source files? Do I create Contributors file and add myself to it? Or is the fact that the commits indicate my ownership sufficient?) Are there any additional pitfalls when forking a project protected by GPL?


How to get hardware specific ID

We have an application that we need to ensure that our APPLICATION DATA should not be used (or opened) in different computers with same users. For that we thought about getting harddisk GUID as a part of data encryption private key. In this case raid disks, virtual PCs would fail and wouldn't be able to open the data. We need some advice about how to get a proper id to strict user-per computer but not user-harddisk. Note: Both Mac and Windows supported Edit: it was about application data, but not the application itself. Sorry for wrong asking


Choosing right technology for messaging system

I'm working on a messaging system for two years now, the system was written by a long ago gone team and involves emails and document processing. The basic process is:   1. Receive an email, parse it, save attachments to samba share. Notify message processor. We have a robust Java application doing this very well.   2. Process the message, this involves getting user data from LDAP, calling file processing web-services on different platforms. The system has a sort of re-delivery service that polls database for failed or timed out messages in different states and resends them. The file processing parts are EJB web-services that basically run command line utilities. The problem lies in our orchestration solution which is based on OpenESB (almost dead now), it has a bunch of BPELs calling each other and calling remote EJBs (EJB3.0 on glassfish v2). The biggest problem is that too much logic is done in BPELs (say, all database updates are done in BPELs, there's no persistance layer), they look like the most horrifying spaghetti I've ever seen. Not to mention they make NetBeans which we're using to edit them run really slow, to the point that some files are only editable in a simple text editor as XML. Moreover the system has a number of nasty bugs that would require major refactoring to fix and I'm dreaded to even think about it. These messages are handled manually by our support stuff so there's almost no client-impact but I would like to have a real transactional system anyway. Now, for the question itself. I'm willing to spend a lot of my own free time trying to reach two goals: build a replacement for ESB and BPELs, learn new and preferably trendy technologies. I would like to keep the code in file processing EJBs since they run just fine, although I'm thinking of getting rid of SOAP as their remote interface. So I'm asking for any insight of which technology(-ies) would let me create a robust messaging solution that would:   1. Have a friendly persistence layer, there won't be anything really complex in dbs, just message meta-data.   2. Take care of balancing and polling calls to file processing web-services.   3. Wouldn't require dealing with tons of XML in different places in order to add a new interface method.   4. Would be scalable - run on a number of machines.   5. Would allow realtime monitoring, like viewing message queues, current load, statuses etc.   6. Hopefully will let me learn something new, meaning not J2EE stack. Basically I'm open to anything except BPEL and OpenESB.


Can I develop OpenGL ES iPhone simple physics app with Xcode 3 in C++ without a GUI?

Can I develop OpenGL ES iPhone simple physics app with Xcode 3 in C++ without a GUI and Objective-C? So I don't need Cocoa and I don't need Objective-C?


How to selectively update properties of an object on the server

I have a `GWT` website that displays some data onto the client in a tabular form. Some of the fields are editable, when any change is made the save button becomes active. There are multiple properties that may have changed, how would I go about updating them on the server? Additionally I'd like to provide an undo button so that the changes are reverted. What I'm thinking of right now is to use the setters and check if the current value is the same as the changed value if there is a change then a request to a process in the background will be fired. But I'm not sure this is the best approach and maybe setters with extra logic aren't the best practice. I think this is a problem that many web applications have to deal with and maybe there is a pattern that makes all of this more elegant. It would be nice if someone could explain how they would solve this.


Do immutable objects and DDD go together?

Consider a system that uses DDD (as well: any system that uses an ORM). The point of any system realistically, in nearly every use case, will be to manipulate those domain objects. Otherwise there's no real effect or purpose. Modifying an immutable object will cause it to generate a new record after the object is persisted which creates massive bloat in the datasource (unless you delete previous records after modifications). I can see the benefit of using immutable objects, but in this sense, I can't ever see a useful case for using immutable objects. Is this wrong?


A way to include SQlite into an application where the drivers aren't already installed on the system?

I'm an open source web application for use in my university. Currently professors usually have a website, but do to the fact that they're teaching multiple classes in a given term, they don't care to spend time and make an extensible, functional website. The purpose of this project is to create an OSS website that can be dropped in place and enabled by simply running an init.php file. I'm curious though as how to handle information storage for such a task. A full server database is a bit outside of the scope I'm looking for, but something like SQlite would fit very well. The problem I'm running into is that not all departments have SQlite installed on their servers, and getting them all to do so won't happen. Can anyone think of a way to include SQlite into an application where the drivers aren't already installed on the system, or a more common alternative that would provide a similar level of power/flexibility?


Should I put the datatype of a class attribute in its name?

Most of my system's class attributes are just text, but in this case it makes more sense to place this particular class's attributes into one single hash (from a "keep the source code pretty" aspect). Basically, a list of attributes is returned, and instead of writing a bunch of static attributes for each one, I just loop over them and collect them into a hash. Is it a good idea to name this particular attribute `@contents_hash`, as opposed to `@contents`? I assume that users may figure out pretty quickly that `@contents.split ' '` will return a `NoMethodError: undefined method 'split' for Hash`, but on first glance of the code, is it useful to know right away that this is a hash? Do you think it will make the implementation redundant to say `@contents_hash.keys`?


Giving presentation on git

I'm going to be giving a presentation to a group of neuroscientists on the use of git to manage their matlab/r/xppaut/etc files. Some of these folks have an extensive software engineering background, some don't know what CVS is. The main goals of the talk are as follows:   * Inform how git can increase collaboration and save everyone time (5-10 min)   * Introduce git as a concept in graph theory, a familiar topic to the crowd (5-10 min)   * Introduce the practicals of git: (rest of time)      * Download & install     * Set up new project (`add`, `difftool`, `commit`, `checkout` & `branch`, `merge`, remotes (maybe), generate & commit patches, `stash`, rollback to previous head, ...?)     * If have time, show them github, specifically how to use it to fork and submit pull requests (I hope to have them set up github accounts to share scripts in the future) I hope to have everyone bring their laptops to follow along on the tutorial. This talk is supposed to be about an hour long, max is about 1.5 hours. My question to you guys is two-fold:   1. In general, what do you think about the proposed outline?   2. Is anyone familiar with slides that I can use for this sort of talk? I want to model the intro part around Joel Spolsky's mercurial tutorial, tone-wise, but I can work with other material if necessary.


How to best organize multiple WebProjects that use similar business logic

We have the following setup > **Current Solution** : > >   * Business Logic (Class Library) > >   * Data Layer (Class Library containing EF,Web Services wrappers etc) > >   * WebProject1 > > BUT we now want to write another Web Project (Web Project2) which would be almost identical to WebProject1 except for the fact that it would alter properties and input variables to functions/voids inside the Business Logic class to provide a different set of data for another completely different user. (Needs rewording). Think of Facebook as WebProject1 and Myspace as WebProject2. Same concept, same business layer almost but different products altogether. > **Future Soltion** > >   * Business Logic (Class Library) > >   * Data Layer (Class Library containing EF,Web Services wrappers etc) > >   * WebProject1 > >   * WebProject2 (similar to WebProject1 but different authentication, > different UI, different pages etc) > >   * WebProject3 (possible) > > Without completely destroying the Business Logic (as the class would now have to allow for 2 paths per set of input variables) how can we structure this to aviod doubling up on any code? **Edit:** Explain the business logic WebProject1 provides data based on a database filter called "ByCompany" WebProject2 will provide the data based on a filter called "BySite Both projects will be consumed by different audiences which will not know that the other website exists. Eg possible future logic could include something like this:               BusinessLogic.EmployeeList employeeList = new BusinessLogic.EmployeeList();          employeeList.LoadBySite("ConstructionSiteC");          employeeList.LoadByCompany("JohnDoesTractors");      The dilemma is: Should we maintain two Business Logic class libraries? Should we add preffixes to the class names to denote their corresponding WebProject parent? Should we create base classes and inherit if there are overrides we need to make? Should we create more interface based business logic? Should we just have two separate solutions that draw from the same DAL? The projects will likely get quite large (over business logic 300 classes) and we want to minimize double ups as much as possible. What is the your method or suggestion? Thankyou!


how do you deal with a vague software proposal?

We all get them. What do you do when you are supposed to write a functional spec from a woolly proposal? You can write a ton of questions about the proposal but answers are not always forthcoming. Sometimes for political reasons you cannot make someone firm them up. How do you deal with a vague software proposal, when experience and intuition only go so far?


Phonetic programming language?

Many of us coders, programmers and developers struggle with repetitive stress injuries, carpal tunnel, etc. I've been curious about introducing voice control into my workflow in order to save myself some stress. This has led me to my current question: Would it be possible or practical to implement a programming language (or superset of an existing language) which was primarily phonetic, and hence well suited to programming by voice?


create function of object prototype

I am reading "Javascript : The good Parts" to improve my Javascript bases and knowledge. I was reading stuff about `prototype` and I encountered in this function :               var stooge = { ... }      if(typeof Object.create !== 'function'){        Object.create = function(o) {        var F = function () {};        F.prototype = o;        return new F();        };     }     var another_stooge = Object.create(stooge);      I didn't really get the meaning and the benefit of creating this function.


Can modifications to open source project be considered trade secret?

While working for an employer if one modifies, rewrites, contributes or alters open source software in what cases can it ever be considered a trade secret? A trade secret, FWIW, is defined by wikipedia as: > A trade secret is a formula, practice, process, design, instrument, pattern, > or compilation of information which is not generally known or reasonably > ascertainable, by which a business can obtain an economic advantage over > competitors or customers. In some jurisdictions, such secrets are referred > to as "confidential information", but should not be referred to as > "classified information", due to the nature of the word in the USA.


What are the steps to learn AJAX based web application development?

I am a complete starter in web development, as I know only basics of HTML and CSS, although I have a history of desktop development. What is the usual roadmap to get started in web apps, based on AJAX? We decided to use Dojo toolkit as our javascript library. Is the following a feasible map? 1-Learn basic javascript(already on it) 2-Learn what DOM is 3-Start with Dojo documentation and examples 4-Get into AJAX with Dojo Addendum: My goal is not to become a professional web developer who builds public web pages, it is not my specialty. I am trying to build an interface to an embedded product my company develops. We chose dojo mostly because it provides widgets for easy interface development. I am just trying to find out the easiest way to get this done. I got several satisfactory answers and have difficulty choosing the best.


Is Haskell/Clojure actually unsuited for dynamic systems such as particle simulation?

I've been told in previous questions that functional programming languages are unsuited for dynamic systems such as a physics engine, mainly because it's costly to mutate objects. How realistic is this statement, and why?


Why are regular expressions so morbidly attractive?

Exhibit 1, Exhibit 2, I guess you won't find it hard to recall other examples. Thing is: if there is more than one way to solve a problem, the PHP programmer (I usually browse the PHP tag on StackOverflow) will ask for help on the solution involving regular expressions. _Even when_ it will be less economic, _even when_ the php manual suggests (link) to use `str_replace` instead of any `preg_*` or `ereg_*` function when no fancy substitution rules are required. Does somebody have a clue about why this happens? Don't get me wrong, some of my best friends are regular expressions and I don't despise Perl. What I don't get is why there is no looking for alternatives whatsoever, even when the overkill is obvious (regex to switch strings) or the code complexity rises exponentially (regex for getting data from html _in PHP_ )


Own Exception or Delegation design pattern to exit a program?

I am writing an application in Java which use MVC pattern design. I have 4 major classes: Main, Controller, Model, View. Main initialize the other three and run launchMenu() in a infinite loop, a method included in Controller. This launchMenu from Controller runs a launchMenu method of another class: MenuHandler, which set up the Actions (using my own Command design pattern) and assign them to each option from my enum UserOperationsMenu.   I have several doubts on how to handle UserOperationsMenu.EXIT. My question is about what would be better and more logic:   1. Using an exception I catch up in the body of Main's loop and throw it in my ExitAction class assigned to UserOperationsMenu.EXIT?    2. Creating an object Delegate in Controller which I pass to MenuHandler and ExitAction so that I can command from ExitAction to exit the program? I've thought about using a boolean variable in my while in Main, and returning false when I want to finish the program. But I don't like the idea, though. **NOTE** : I don't want to use System.exit(0) directly because first I have to do several tasks outside my ExitAction.


How do you handle "support" on your products (inhouse)

Do you have any kind of update process? Let's assume you are an "in-house" development shop for php inside your company. You are creating an bunch of applications for other units. Do you have something like "Support ends in 2 years" ? What happens if you develop an app for php 5.3, and this app can't run with php "6", or another framework you use will no longer be maintained? Would love to hear some ideas :-)


Opensource showcase for MVC in Java Swing

I've allready created small desktop CRUD applications using Java/Swing. In hindsight I'm not quite sure if the overall design of these applications is good. I've also done some reading on MVC and looked at different Swing- tutorials. My problem is, that I've got a very theroatical knowledge of MVC and on the other hand, most Swing-resources don't implement the MVC-pattern.      Now I would like to get my hands dirty and see how MVC is implemented in Swing in a real-world-application. Are there any opensource project you could recommend? It would be also interesting to have more than one project, to see different approaches.      Best fit would be a software, that uses a relational database in the backend, to see an overall design, that I can compare to my former applications.


How to save a young and dying project?

I am posting this anonymously because I don't want to get into potential trouble.   I have a big problem.   I recently joined a team that is less than a year old. I have been here since a month in to the project started. The company structure looks like this:   * Owner (non-technical)      * Project Manager (non-technical)        * Lead Developer (Technical, but bad at it) This project is a website using ASP.Net that the Lead Developer designed a horrible architecture for. You will have to take my word at it, but basically, the way we are required to build web pages is giving us 3+ minute load times on a single web page over VPN in Debug mode. It has spiraled to the point where other coworkers agree that they spend more of their day waiting for pages to load than actual development. Now the big problem is this. Project Manager does not know technology and admits it. He has specifically stated that he trusts the Lead Developer to make the correct choices on application architecture. No one on the team knows what the Owners opinion would be, but everyone is afraid to make waves in this economy (myself especially). What would you do?


Why shouldn't classes be designed to be "open"?

When reading various Stack Overflow questions and others' code the general consensus of how to design classes is closed. This means that by default in Java and C# everything is private, fields are final, some methods are final, and sometimes classes are even final. The idea behind this is to hide implementation details, which is a very good reason. However with the existence of `protected` in most OOP languages and polymorphism, this doesn't work. Every time I wish to add or change functionality to a class I'm usually hindered by private and final placed everywhere. Here implementation details matter: you're taking the implementation and extending it, knowing full well what the consequences are. However because I can't get access to private and final fields and methods, I have three options:   * Don't extend the class, just work around the problem leading to code that's more complex   * Copy and paste the whole class, killing code reusability   * Fork the project Those aren't good options. Why isn't `protected` used in projects written in languages that support it? Why do some projects explicitly prohibit inheriting from their classes?


Approach to learning .NET?

After a few years writing good ol' straight, archaic, homely C/C++, I'm finally going to give in and learn .NET. I'm looking for the best way to become .NET-competent quickly. I use VS2005 C/C++ Express and I see there's a CLR choice in the "new project" wizard. I _think_ that must be a way into the world of managed code. Is that a reasonable entry to .NET? Do I have to learn C# or some crazy stuff instead? Or maybe [shudder] CLR is just the first baby step into .NET?


Dive into Field of Information Security?

For a fresh graduate with quite a bit of development (mainly web) background - what is the easiest way to break into the security field? Are certifications a necessity? Is it possible to get intern jobs doing this kind of stuff? Thanks


Where can I obtain the specification for Distributed Relational Database Architecture?

I'm developing a DBMS that should be able to connect to IBM DB2 via the DRDA protocol. I found a DRDA reference manual that mentions "DRDA Implementation Programmer's Guide, SC21-9529" as a publication about DRDA, and seems that this manual is exactly what I was looking for. The problem is, I am unable to find it on the net. Where can I obtain this document or another comparable document that explains implementing DRDA?


Are Subject specific programming books a good idea

I have a friend who is starting graduate studies in a psychology. Part of what he is learning is building testing apps for trials. He purchased a book that was supposed to be vb for psychologists after reading though it I found that it was not a very good programming book and espoused what I think of as bad practices. I instructed him to buy a standard learning vb.net book from a known publisher. So the question is there any good reason why standard methodologies of programming shouldn't be applied to certain disciplines.


How Client Side Programming Works

I'm not coming from web-development at all, but am looking to build a web application. So far, I've looked into all the server-side stuff (for example, I think my stack will be Linux + node.js + ExpressJS + MongoDB), and have learnt a lot! At this point, I'm comfortable setting up an HTTP server, routing requests, using RESTfull interaction with a database, and serving dynamic HTML using an HTML template engine like ejs or Jade. I even looked into Websockets as a means for establishing a TCP connection to add fast user interaction without page refreshing. Now I'm looking to do pretty stuff; add graphs, tabs, ect to my web- applications! I've looked into things like Dojo, JQuery, CanvasJS, AngularJS ect, and all them seem cool. Problem is, now that I think of it, I have no idea how client-side programming works. For example, in AngularJS I may find something like:                  <head>         <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>         <script src="components.js"></script>       </head>      What is this saying? Does my server actually replace `"components.js"` with the actual `"componennts.js"` code before transmitting the response? What's going on with the `https://ajax...` source? Does the browser, (or the server?) actually have to go to this url, and retrieve code? As I said, as far as I'm concerned, the server responds with an HTML document composed of ASCII characters. What then, is actually running on the client side, and how does it get this code? (i.e. on V8 or whatever).


Why do technical/programming phone screens focus on inheritance?

I've noticed that in most technical phone screens, programming questions tend to focus on inheritance. For instance:   * If a class is intended to be inherited, what should you do with the destructor? (Answer: make it virtual)   * What's the deal with public/private access?   * What's "protected" for?   * Etc. etc. It strikes me that there are more meaningful questions to ask these days. And, IMHO, reliance on inheritance as the primary design solution to an OO problem is a bit problematic. Am I wrong? Is knowledge of inheritance quirks the best way to assess technical skill? EDIT Commenters have asked me to explain in more detail why I think reliance on OO- based questions is problematic. Let's see... Basically, my thinking is that there are plenty of cool, non-OO questions you could ask. For instance:   * (C++) What's the difference between a map and a multimap?   * (C++) What are the two different kinds of things you can use as template arguments?   * (C#) What's an extension method?   * (Perl) What restrictions, if any, exist on the number of arguments a function can take?   * (Python) What are the different ways you can use import, and what are the consequences of those tactics? I submit that the above questions are also pretty decent weed-out questions. So my question for this forum is: Why don't phone screeners ask questions like those above?


Should I create a use case diagram for each screen?

In projects with many use cases, it's valid to create different use case diagrams, one for each screen? Or I shouldn't guide myself on the GUI of the software to make this, why? As a clarification, the software does already exist, and I'm just documenting it for my undergraduation final project.


Is it necessary to add the default case while using switch cases?

During a recent code review I was asked to put `default` cases in all the files wherever `switch` block is used, even if there is nothing to do in `default`. That means I have to put the `default` case and write nothing in it. Is this the right thing to do? What purpose would it serve?


josephus revisited - to get execution sequence

I was reading this Mathworld page on the Josephus problem: http://mathworld.wolfram.com/JosephusProblem.html from what I understood, once we get the _place in execution sequence_ we can apply _inverse permutation_ (which seems simple) to get the order of execution. But I could not make out how to compute the _place in execution sequence_ , given `n, k` i.e, for `n = 4, k = 2`, how to arrive at `{4, 1, 3, 2}` I am mostly interested in _implementing_ the solution (I've done the usual circular-list based etc), but if there are better ways, I want to try/understand.


Is the meaning and usage of the term "ROM" different in different devices?

**ROM - Read Only Memory**   Does this term mean _the memory which **should only be read** and not written to_ , **or** _the memory which **can only be read_** ?   "ROM in PC's and laptops are usually seperate chips in the motherboard where BIOS is present (Please correct me if I am wrong) . Can they be overwritten (I guess we can) ?   When we consider an android phone , it gets really confusing . What is the difference between ROM and "internal memory" in an Android phone ? It seems the same .


Advantage of monitoring file change using Windows API rather than manually

I developed a Windows software about an year ago. Part of it was to monitor few configuration files for manual changes by user and if any of these change restart a particular service. So, I used the simplest approach. I load them as a string in memory and after few seconds, I read the latest file and compare it with the one in memory. Since, the files are very small (less than 500KB), the program doesn't consume much memory. I am using that application since it is developed and have not experienced any performance problem due to that. But, few days ago I noticed that the program ranks at highest for `I/O Read Bytes` in task manager. After few hours of uptime of PC, the `I/O Read Bytes` by this program become significant higher than the rest of processes. So, My question is should I worry about high value of `I/O Read Bytes`. Is this have some downside effect (maybe on Hard Disk) that I am missing. Is implementing the functionality of monitoring file changes using Windows API have some benefits that are worth the effort required to implement it?


How to get the most out of an annoying project

I was recently assigned a task of managing a small project. The project has some technological aspects but the job is mainly doing managerial things: scheduling, making sure people do what they are suppose to, going to a lot of meetings, etc. Basically, it's not how the average programmer or even a team leader would like to spend his time. Since I am not going to sneak out of this, I have found myself wishing I could teleport myself to some point of time after the project has ended. After pondering about it some more, I reached the conclusion that **I hate working like that** and I can't allow myself to work on a project that makes me think this way. **I have to make the most out of this project.** So my goal is to make the most out of this unwanted project. How do I do that? I thought about writing every day a "What I have learned today" list, that will help me see clearly that I am learning from this and not wasting my skills. Do you have any recommendations on what can I do?


How to introduce your team to functional style of coding?

I have a situation where most people in my group come from an object oriented programming background with little to no understanding of functional programming. Not even basics like closures. Any suggestions about what might be a good way to introduce them to functional coding style? A lot of coding that we do can be shortened if we do the functional way for our specific cases. I have already given couple of presentations about functional and coding paradigms. Unfortunately we don't use a proper functional programming language like Haskell (basically legacy code is in C, C++, Java) so we have to do whatever is there with these.


<<access>> and <<use>> in UML Component diagrams

How to decide if have to take the `<<access>>` or `<<use>>` notation for "-->" arrows in Component diagrams written in UML?


New grad with my first programming job lined up: What is the advice you wish you had at this stage?

I am a new grad with what appears to be my first job lined up (1 solid offer, another place still courting me, so not sure exactly what I will be doing yet). What advice do you wish you had when you started out? In terms of making the best impression? In terms of making sure to get the best reviews? In terms of setting oneself up for the best career growth?


Constructing a Deterministic Finite State Automaton for a given Regex

I have a couple of exam questions for my compilers class and wanted to check if my solutions are correct. The first question is: > Consider a language in which numbers start with an optional minus sign, > followed by one or more decimal digits, followed by an optional decimal > point. If the number contains a decimal point it is followed by one or more > further decimal digits. Express the syntax of numbers in this language as a > regular expression. And for my answer: > ("-")? ["0"-"9"]+ ("."["0"-"9"]+)? The second question is: > Construct a deterministic ﬁnite state automaton for recognising the numbers > as described in Question 1 And my answer is: ![Diagram of finite automaton](http://i.stack.imgur.com/vfFf8.png) Where state 2,4,5 and 6 are terminals. Are these solutions correct? I am unsure of what the DFA should look like and it's differences to an NFA. Thanks !


Can IndexedDB be used in offline hybrid android apps? I have tried the [example presented in this post,1 while it is working in my laptopn on Google Chrome, it is not working inside the WebView in my android app. The HTML part of the app is loading fine inside the webview but the javaScript part containing all Indexeddb stuff is not getting executed at all. What's wrong?


Storing data offline with javascript

My question is about storing data offline and potentially whether I will need to bring in an outside programmer or could this be learned within a few weeks? The website I am working on will have an interface where users will login and go through a series of quizzes in the form of checkbox, drop down menus, and others. Each page/quiz area could have 20-100 total checkboxes in a series of 3-5 rows because of the comprehensive nature of course. This I can do - I know how to code the quiz and return a correct or incorrect answer based on each individual checkbox and present a cumulative score (ie: you got 57% correct). The issue lies in the fact that I would like to save the users results and keep them informed of their progress. When they complete all of the quizzes, I would like to have a visual output of their performance in each area. Storing the output from their results offline is where I think I may run into a problem with my lack of coding experience. I would also like to have a sidebar with their progress of each section (10-15) with a green percentage completion bar or a % correct which would draw from this. I have never had to code something that stores information like this offline - so back to my question - would it be better to learn the language needed or bring in a coder/developer for the back end stuff.


Fostering a time period where everyone can try any ideas to make software run faster?

Sometimes software performance tricks are found from a methodological and thorough search. Sometimes it requires divergent thinking and courage to try crazy ideas. Sometimes an idea is just the beginning that needs to be followed with a lot of hard work. How to foster a time period where everyone can try different ideas to improve the performance of the software we're working on? Everyone on the team has at least several months of experience with the software and are very good at it. Do you agree that divergent thinking will help find ways to improve software performance? Why? Why not? What techniques will enable us to quickly try out an optimization idea? Is fast coding speed necessary for getting good results from the try-out? Finally, how much "time" should be allocated to ensure good results without creating the possibility of slacking off? Is experimentation necessary to prove that "a faster way to do something" exists? (Added 2011-06-07) Related:   * What are your strategies to improve the level of your team in a clever way ?   * When do code hacks become bad? ( **For bounty purpose only** -2011/06/07 the team size is 2-4 developers, no dedicated QA. All code, unit test and performance test done by developers. Because of the nature of the project, profiler result is useful in showing proportional execution time even if it does not reveal a single bottleneck.)


Feasibility Study Format on SDLC

Is there a specific format for a feasibility study in SDLC? If so, do you know any sources where I can find more information about this? or can you show me at least an outline of what it should contain?


Why is there no facility to overload static properties in PHP?

## Intro PHP allows you to overload method calls and property accesses by declaring magic methods in classes. This enables code such as:               class Foo {         public function __get($name) { return 42; }     }          $foo = new Foo;     echo $foo->missingProperty; // prints "42"      Apart from overloading instance properties and methods, since PHP 5.3.0 we can also overload `static` methods calls by overriding the magic method `__callStatic`. ## Something missing What is conspicuously missing from the available functionality is the ability to overload _static properties_ , for example:               echo Foo::$missingProperty; // fatal error: access to undeclared static property      This limitation is clearly documented: > Property overloading only works in object context. These magic methods will > not be triggered in static context. Therefore these methods should not be > declared `static`. As of PHP 5.3.0, a warning is issued if one of the magic > overloading methods is declared `static`. ## But why? My questions are:   1. Is there a technical reason that this functionality is not currently supported? Or perhaps a (shudder) political reason?   2. Have there been any aborted attempts to add this functionality in the past? Most importantly, the question **is not** "how can I have dynamic static properties in userland PHP?". That said, if you know of an especially cute implementation based on `__callStatic` that you want to share then by all means do so.


SQL Query helper/builder?

We have a flex based front end, that talks via JDBC to some databases.   Part of the GUI has some forms that let the users construct Queries in SQL to pull back records from the database.   However, we get a lot of support tickets that relate to incorrect SQL being tapped in, and a general lack of SQL knowledge so that they struggle with creating queries. It would make more sense if we could have some sort of validation like a SQL Query builder.   Currently we do have a 'Test SQL' command that validates if it returns a valid result from the db, but I would like to take this further and have something that lets you build queries. Has anyone seen any good examples on how to achieve this within a Flex based front-end? (or even non-flex, just to give us some design ideas). Let me know if you need more details via comments. \--Edit--   Just for some background, here is a link to what the GUI currently looks like.   Its a wizard based forms approach, of which entering SQL is a part of: ![enter image description here](http://i.stack.imgur.com/ruHTO.jpg) Id prefer to see more options here for building the SQL with perhaps some sort of 'SQL calculator'? Or open to other suggestions - this also ties in with UX.


What Special characters should one allow for a Phone Number?

So I am designing a webpage which will be used for global users, includes users from Canada, US, India, UK etc. I need to apply validations for this phone number field, but I'm not sure the best way to go about this. Some of the valid formats I can think of are:   1. 1800123456 (India)   2. use of "-" in US phone numbers I am a bit confused about what special characters I should allow a user to enter (eg.`- / ()`). How have others solved this in the past?


Best place to learn Component Object Model

I need to learn COM for my current project. I am a noob and I haven't been able to find good starting points for COM. I have been looking into MSDN and googling... I did find some interesting articles on codeproject.com, but I am not satisfied. Why do we use COM ? Why does it exist ? In what places does it exist ? ..... and so on .. So, will you please tell me where can I find answers to these questions ?


Deferred Open Source licensing

Are there established models for releasing an initially proprietary piece of software under FLOSS conditions after a defined period or a certain point of time? The main problem here is that all parties involved must be able to trust that the Open Source licensing will actually take place at the defined time and no party can further defer or cancel this process. Clearly such a model has its problems, for example it's problematic to deal with contributions from "outside", legally and technically. Ghostscript is a prominent example where a deferred model has been used and abandoned. However, if certain parties involved will insist on keeping the software proprietary, at least for a certain period of time, then the only options are a deferred Open Source licensing model or no Open Source licensing at all. I think I read about services that serve as trusted parties who take care of Open Sourcing the software. However, I was not successful in spotting any of those.


What are some concepts people should understand before programming "big" projects?

A person new to programming may be able to make a good small program. However, when starting to work on anything bigger than a small (think 1 C source file or Python module) program, there are some general concepts which become much more important when working on "big" (think many Python modules or C files) programs; one example is modularity, another is having a set aim. Some of these may be obvious to people who went to school to learn programming; however, people like me who did not go to programming classes sometimes have to learn these things from experience, possibly creating failed projects in the meantime. ================================================== Please explain what the concept is, and why the concept becomes more important for big programs than by small programs. Please give only 1 concept per answer.


Is it a good idea to implement OpenID services in internal and/or customer applications?

I've been discussing with my colleges about logging in by using your OpenID account, Google account etc. in our customers CMS and/or the internal systems we use, as we've had a few requests regarding this from both existing customers and new. What are your approaches on this? Is this a bad idea? Especially for our customers, in their customized content management systems? I really think it can be a major security issue, but would a normal login, provided by us, in the reality, be as much of a security risk?


Getting non-programmers to understand the development process

When starting a project for a company that's not primarily a programming company, one of the expectations is that there's a finished product at the end free of all bugs and does everything needed right away. However, that's rarely the case. What are some ways to manage expectations and explain to non-programmers how software development differs from other types of product development?


Programmer student-tutor program

I know "hi's" and such are not wanted on questions, but in this case an exception may be made (IMHO). Hi! I am a 16 years old and in my 4/6th year of pre-university education. Programming, math and algorithmics is my hobby and I enjoy it so much I have no doubt I will make it my job. In fact, I enjoy it so much that I spend pretty much all my free time one it, learning fast. However, I stumble upon one big problem: I have no teacher. On my school we have what we call "Informatica" (dutch), computer science in english. The level of this class is very low though, to the point I know more than the teacher. I occasionally buy books on programming, but english is not my mother tongue and sometimes I just waste hours or a day because I'm not familiar with a word (I wasted weeks before I understood the verb "to iterate over", something we don't have in dutch). Another thing is I have to learn everything myself. I had to teach myself what compiling, linking, libraries, including, etc, etc is. That took me **a lot** of time. Thank god there is stackoverflow. When I was completely stuck on something I could ask there and it would usually be solved within an hour. But I get stuck like every hour on something small every proffesional would sigh and shake it's head and explain it within 5 seconds. Now I would love it if there exists some free student-tutor program that assigns you with a _mentor_ or someone that you occasionally can chat/email with (on IRC, MSN, I don't care) asking your questions. So my question, do you know such program? (Or perhaps if you'd like to do it, who knows?) I'm sorry for my english if you spot any mistakes, I learned it all by myself too :) (once again the level of the english class at school is really basic)


Google Apps Script pulling user information

I am trying to create a spreadsheet that pulls the following information for each of the users in our domain:   * Name   * Email Address   * Mobile Phone Number (Saved in "Mobile")   * Department   * Title   * Extension Number (saved in "Work")   * Google+ Profile Image URL I'm pretty new at scripting and JavaScript so I'm having some trouble with the special, specific fields. I'm using this Google Reference page for help, but I need help with the phone numbers and organizations information. I can pull `user.phones` and `user.organizations`, but all the data that comes together is messy. I also know that I can get the Google+ Profile Image URL by using `profile.image.url` if I define a variable for `PlusDomains`.               function listAllUsers() {         // set spreadsheet       var ss = SpreadsheetApp.getActiveSpreadsheet();            // set sheet       var sheet = ss.getSheets()[0];            // set range       var range = sheet.getRange(3, 1);            // clear range       range.clear();               var pageToken, page;       do {            page = AdminDirectory.Users.list({       domain: 'test.org',       orderBy: 'givenName',       maxResults: 500,       pageToken: pageToken       });      var users = page.users, auserInfo = new Array();           if (users) {       for (var i=0, len=users.length; i<len; i++) {         var user = users[i];         Logger.log('%s (%s)', user.name.fullName, user.primaryEmail);         auserInfo.push([user.name.fullName, user.primaryEmail, user.phones, user.organizations]);       }       } else {       Logger.log('No users found.');       }      pageToken = page.nextPageToken;      } while (pageToken);            // set values to sheet       sheet.getRange(3,1,len,4).setValues(auserInfo);            }


Why was Python's popularity so sudden?

Python first appeared in 1991, but it was somewhat unknown until 2004, if the TIOBE rankings quantify anything meaningful. What happened? What caused the interest in this 13 year old language to go through the roof? Is there a reason that Python wasn't considered a real competitor to Perl in its first decade of existence? Is there a reason that Python didn't continue in relative obscurity for another ten years? I personally think that Python is a very nice language, and I'm glad that I'm not the only one. But it doesn't have corporate backing or a killer feature that would explain a sudden rise to relevance. Does anyone know the story?


What is the general format of a Software Design Specification?

I'm trying to document a piece of software I wrote in detail. An SAS is too high level and doesn't cover the API. I found several examples of an SDS online, but I don't see a trend in their format. I'm wondering if there are some general guidelines to writing a Software Design Specification or what the best approach is?


Open Source Service Discovery

I'm trying to wrap my head around this article on OSS service discovery and I'm having a tough time seeing the forest through the trees. In that article, the author poses the main problem for service discovery: > The problem seems simple at first: How do clients determine the IP and port > for a service that exist on multiple hosts? But I'm not even sure what this means/implies. When talking about service discovery, what exactly are we talking about here? Is this like, if we want to connect to a database, we might need a host and port number defined somewhere, like:               host=mydatabase01.example.com     port=9300      ??? Is this what the author is talking about, and is what is implied by "service discovery"? If so, wouldn't the (obvious) solution be to just put a web service in front of everything? That way, clients don't care about what specific host/port they're connecting to, they just make RESTful calls to, say, `http://my-data- service.example.com`. It can't be this simple, as that article goes on to talk about things like ZooKeeper and Eureka, which seem to be very complex beasts. I'm clearly missing something; if so, can someone provide a specific, **concrete** use case of what is meant when we talk about "service discovery"?


Evaluate math expressions without a stack

How do you evaluate arbitrary math expressions using temporary variables instead of a stack? What I'm talking about is translating an expression into an array of simple operations- each that change one variable based on the second argument. An example list of operations might be:               =     +=     -=     *=     /=      Notice how each operation changes the first argument. (none of them "return" anything) Here's a simple expression: (I have postfix with depth written under it as well)               x=2+a*(b+c)     x 2 a b c + * + =     0 1 2 3 4 3 2 1 0               x=c     x+=b     x*=a     x+=2      Notice how you don't need temporary variables. Here's an expression that requires a temporary variable:               x=a*(b+c)+d*(e+f)     x a b c + * d e f + * + =     0 1 2 3 2 1 2 3 4 3 2 1 0          x=b     x+=c     x*=a     tmp=e     tmp+=f     tmp*=d     x+=tmp       I can't seem to figure out an algorithmic solution for obtaining these sets of operations. Needing temporary variables seems to have something to do with lower-precedence operators that have the result of higher-precedence operators as arguments, but I can't tell. I feel stupid... The way seems right in front of me but I can't see it. Obviously you could do it the "easy" way; AKA, make a temporary variable to store the result of each operation so no operations are destructive to anything but what you put before the `=`, but that's bad and I don't like it. How can you get the "algorithm" for an expression in simplest form? EDIT: Due to my own ambiguity, I must clarify that a stack is allowed in _translation_ , but not in the end psuedo-language I'm producing.


How do you break down a new project with an existing mega PHP site?

I've got to dive into a very large PHP site and have my first client meeting today. All they gave me so far was the URL. How do you guys go about gathering/structuring/documenting and preparing for a new project in a PHP environment? What things do you ask for up front? PS - I know there are other general questions about this but I want a PHP- flavored one, including tools (even if universal) and approaches. Thanks!! I'm excited but also scared.


How do you manage passwords in your team for db with multiple env and security constraints?

I don't want any tools, but more methods to help us manage our passwords. I know this question has been closed, but I think this one, even if it's related, is more a programmers problem than a super user problem. We are using some database schema, each with a password. These schemas exist in our 4 different environments (DEV, TEST, INTEGRATION, UAT) There are corporate rules about passwords, so we need to change them often. Wrong passwords result in locked accounts. This happens quite often and takes countless hours to be solved by dbas... The rules are also quite drastic about how to change a password. No re-use, some word forbidden... The result of this setting is a very often unusable database for our dev. And lots of frustration too. Do you know any 'deterministic' way of creating passwords that can help us to avoid total mess?


Where can I learn about how programs handle file systems like NTFS?

I'm writing a program to handle the xbox 360's STFS files. I'm encountering all sorts of problems about how to keep track of used vs unused blocks, reading non-sequential files, etc. These aren't so much problems with the structure of STFS - it's just another file structure - but I don't know how I should do certain things. I thought I would find a plethora of information on how file systems like NTFS and Fat32 are read by programs, but I'm only finding resources on how to work with the file systems using pre-made software and not so much how to make such software. Here is a reference for STFS: http://free60.org/STFS


On access scans and Visual Studio

Where I work McAfee On Access scan is enforced to be on for all our machines. Visual Studio 2010 isn't exactly the speediest program at times but combining a large website, several build configurations and mercurial repository files in a project folder results in a very large number of small files, many of which get scanned when being read or written. I'd like to try and ask our IT department to add some exceptions to help speed VS up but that will likely not be an easy task. What recommendations do you have for the minimum list of exclusions I could give that would give the most noticable improvements?


Can you make a build in one step?

From the joel test: > Can you make a build in one step? I've got to say I can't. I'm currently working on a web app that has a spreadsheet list of items that must be carried out in order to deploy. So my question is **how can I automate this**? Does it have to be organisation wide? Tips/techniques?


How do you KISS?

The KISS principle is a highly quoted design mantra. The aim of this principle is to stamp out unnecessary complexity on a project. This is a good thing, saving time, energy and money. It can lead to a relatively stress free implementation and a simple, elegant, maintainable end product. A lot of discussion on KISS provides mechanisms to simplify requirements, design and implementation. Things that spring to mind include: avoid scope creep; simple obvious design and code; minimal run-time dependencies; refactoring to maintain simplicity; etc. However there are a lot of implicit things that we do to KISS. Examples: small team sizes; minimal management layers; tidy desk; mastery of a single IDE; clear concise error messages; scripts to automate/encapsulate tasks; etc What KISS practices do you apply? How have they benefited you? I'm especially interested in non-obvious practices.


How is C/C++ more difficult to decompile than C#?

See top answer here: _Obfuscation at source-code level more effective than obfuscators?_, specifically "Code it in a language so not easy to decompile such as C/C++" I'm looking to write a new application that will be sold for $500 per license, so I'd like to prevent decompilers. Should C# be avoided, or is using an obfuscator sufficient to prevent this sort of thing?


What pitfalls and gotchas commonly occur when beginning with Parallel and Concurrent Programming with C?

It roughly three weeks I will be taking a Parallel programming class that is taught using C for the assignments. I have a fairly strong interest in the subject at present and my C skills aren't terrible but I feel like I need to brush up on C as the last class I had that actively required programming in it was 8 months ago. I took an Embedded Systems course in the spring so I understand the concept of deadlock, semaphores and the "shared data" problem. It was primarily iOS programming code wise so my C skills haven't seen loads of use from that context either. If I had to guess as to an area of especially stringent re-study I would select pointers and memory allocation as that seems to be the primary challenge. I believe the class covers MPI and OpenMP so I may take a look at those in advance. Am I on the right track or am I missing something entirely?


Introducing new topics to co-workers

I've been trying to introduce topics such as unit testing, dependency injection, inversion of control, etc... to co-workers. I've given mini lectures, demonstrations, and have suggested these topics during lunch and learns. Reception has generally been positive and people do see value in such topics. Even though they seem attracted to these topics, adoption has been very low. When I talk to them about it, the answer is generally along the lines of: > I'll try it next time. I just want to get this project out the door. I have a feeling it's because most of what they have seen are just lecture type demonstrations and they do not have any hands-on experience. What can I do to help nudge them along? I don't want to "force" them into writing code if they don't want to, because it may seem like "homework" and it may leave them with a bad impression. Our projects generally do not leave time for experimentation, so people tend to shy away from new technologies. This doesn't leave room for developers to try and incorporate new things during the development phase. Are there any fun or interesting exercises (solo or team) that allows them to have more hands-on experience with these topics? I'm hoping to find something that would peak enough interest so that they are willing to schedule an hour of their day to work on something neat, or peak enough interest so that they'll investigate on their own time.


When do you use a class instead of a record when you do not want to use mutable fields?

I'm imagining a situation where you are creating an F# module in a purely functional style. This means objects do not have mutable fields and are not modified in place. I'm assuming for simplicity that there is no need to use .NET objects or other kinds of objects. There are two possible ways of implementing an object-oriented kind of solution: the first is to use classes and the second to use records which have fields of functional type, to implement methods. I imagine you'd use classes when you want to use inheritance but that otherwise records would be adequate, if perhaps clumsier to express. Or do you find classes more convenient than records in any case?


Chromebook - is it interesting for Programmers?

Google announced the chromebook yesterday (11 May 2011). While this is surely a nice thing, I have no clue whether it was interesting to buy one for a (non- javascript)-programmer. What do you think? Will there be, for instance, a Java IDE in the cloud? A command line, even?


What is the relationship between the command line, the OS and the microprocessor?

I'm not totally clear on how using the command line differs from working through the OS' interface using an editor for example. Obviously the UI is different but I want to understand how the command line interacts with the kernel and microprocessor, and how this compares to how kernel interfaces with the OS' GUI. I know I'm missing several layers of abstraction but would be grateful for someone to explain this.


What's the best way to do a Proof of Concept shootout?

In preparation for a new release of software our company maintains, I've been working on what I believe to be a really good approach to solving our scalability issues. I have every intention of putting together a proof of concept to validate the design on paper will actually do what I want. When I briefed it to the team, the boss had a counter proposal, inspired in part by the way I described the problem areas. The boss also accepted my proposal to do two proofs of concept to evaluate the alternatives. So, what's the best way to work through the proof of concept shoot out? We have both objective and subjective criteria that we are using to evaluate the solutions. I'd like to make sure we are comparing apples to apples with these fairly different approaches.   * We have requirements for throughput and size. In short, we know we need to process a certain number of objects per second and maintain that rate for an hour.   * We need to evaluate scalability (both by adding more cores and by increasing the number of objects)   * We need to evaluate ease of development (subjective)   * We need to evaluate how easy it is to understand the algorithm (subjective) I have my theory about which way things will lean, but I don't want that to influence my results. Any input on how to maintain objectivity in this process, and things I might need to consider would be greatly appreciated.


How do I get people to contribute ideas for my .NET library?

I maintain a LGPL library for rapid development of large scale .NET applications, It's a general purpose class library containing functionalities that are used at the DAL and BLL level. So, in practice, it's a library focused towards server-side/middle-tier developers - it doesn't have any shiny or trendy stuff and as such I don't expect it to ever become majorly popular. However, I would really like to expand the library and get more ideas for possibly useful functionalities to add. Larger, more user oriented libraries have a ton of users and a ton of ideas. How do I get more people to contribute ideas for my more _niche_ library?


Using CSS classes as decorators - a good pattern?

I've been building a web-app with a fairly complex GUI - many small elements alongside eachother and within other elements that need various behaviours (dragging, clicking, but context-sensitive). My code tends to work like this: _controls start out as html tags_               <li>      _then I add classes to the tag_               <li class = 'static passive included'>      _some classes might be for css styling to affect appearance_               .static {background: blue; float: left;}      _while others are acted upon by jQuery to give behaviour for the associated DOM events_               $("#container").delegate(".passive", function {onclick : //do-stuff})      and others might be picked up by normal javascript when scanning the document, eg. collect the text values of all nodes with the 'included' class. So certain DOM elements are GUI objects which implement classes definted through a combination of css and jQuery. My question is, is this a good way to work? And also are these really 'decorators' - they certainly 'add additional responsibilities to an object dynamcially' but I'm not sure about that term. Finally, do you use this pattern in your own sites?


Why isn't anyone talking about parallel compilation for .Net?

Builds are slow and take time. We can get MSBuild to parallelize them, but only on a single machine, not across a cluster. Why hasn't anyone come up with clustered build solutions in the .Net space? I know such solutions exist in the C++ space (e.g., IncrediBuild, Electric Cloud, etc.) but we .Net developers are forced to build huge solutions on individual machines. Anyone know if there's some unsolvable technical difficulty in this? Just curious.


Handling changes to data types and entries in a database migration

I'm fully redesigning a site that indexes a number of articles with basic search functionality. The previous site was written about a decade ago, and I'm salvaging about 30,000 entries with data stored in less-than-ideal formats. While I'm moving from MSSQL to MySQL, I don't need to make any "live" changes, so this is not a production-level migration issue so much as a redesign. For instance, dates are stored the same as tags/subjects about the articles, but in strings as "YYYYMMDDd" (the lowercase d stands for "date" in the string). Essentially, before or after I move from the previous database format to a new one, I'm going to need to do a lot of replacement of individual entries. While I understand how to do operations with regular expressions in non-database issues, my database experience isn't robust enough to know the best way to handle this. What is the best (or standard) way to handle major changes like this? Is there an SQL operation I should be looking into? Please let me know if the problem isn't clear--I'm not entirely sure what kind of answer I'm looking for.


Which relationship is more natural?

Have a quick question on how to best structure something for my Java project: I'm a user. I can work at one or more places. At those workplaces, I have one or more roles. For each of these roles, I work a shift. I either came up with: My workplaces have shifts, my shifts have exactly 1 position (what position did I work when I worked my shift? It varies day to day..) or Workplaces have positions, each position has shifts I think the 2nd is more natural but keep going back and forth / unsure of what has more of an advantage both now and for the future. It's hard for me as I can argue both I guess? Thanks!


Best way of validating Class properties

## Background: I have a CSV file, which I need to ready and validate each element in each row and create a collection of a class, having valid data. i.e CSV File looks like:                  EmpID,FirstName,LastName,Salary         1,James,Help,100000         2,Jane,Scott,1000         3,Mary,Fraze,10000      Class looks like:               public class Employees     {         public int EmpID { get; set; }         public string FirstName { get; set; }         public string LastName { get; set; }         public string Salary { get; set; }         public string ErrorReason { get; set; }     }      Here are the validations required for each field:   * EmpID:     * Its a mandatory field, hence cannot be null or empty     * It should be only an integer     * It should be not more than 2 digits     * It should be present in database (query that database and check if an employee exits with this empid.   * FirstName (same validation for LastName):     * Its a mandatory field, hence cannot be null or empty     * It should be only alphabets.     * Not more than 30 characters are allowed    * Salary:     * Its a mandatory field, hence cannot be null or empty     * It should be a decimal.  To achieve this, here is my approach:   1. Read CSV file row by row   2. For each element i.e EmpId, FirstName... etc **do the required validations by calling individual methods having validation logic.** eg: public bool ValidateIsDecimal(string value) { } public bool ValidateIsEmpIdExists(string value) { } etc   3. If valid, fill corresponding property of "Employees" class.   4. If NOT VALID, fill "ErrorReason" property, with appropriate reason as to what caused the validation to fail.(eg: Required filed was missing or datatype is not decimal etc)   5. Add this Class to Employees collection (eg: List) So, my question is, is this the right approach, or is there any other better/cleaner way of validating class properties.


Front-end structure of large scale Django project

Few days ago, I started to work in new company. Before me, all front-end and backend code was written by one man (oh my...). As you know, Django app contains two main directories for front-end: /static - for static(public) files and /templates - for django templates Now, we have large application with more than 10 different modules like: home, admin, spanel, mobile etc. This is current structure of files and directories: FIRST - /static directory. As u can see, it is mixed directories with some named like modules, some contains global libs. ![static dir](http://i.stack.imgur.com/CPwzo.png) one more: ![static dir second](http://i.stack.imgur.com/LMEED.png) SECOND - /templates directory. Some directories named like module with mixed templates, some depends on new version =), some used only in module, but placed globally. ![templates dir](http://i.stack.imgur.com/pztlm.png) and more: ![templates dir 2](http://i.stack.imgur.com/XNEO6.png) I think, that this is ugly, non-maintable, put-in-stress structure! After some time spend, i suggest to use this scheme, that based on module- structure. ![enter image description here](http://i.stack.imgur.com/tSjPa.png) At first, we have version directories, used for save full project backup, includes: /DEPRECATED directory - for old, unused files and /CURRENT (Active) directory, that contains   production version of project. I think it's right, because we can access to older or newer version files fast and easy. Also, we are saved from broken or wrong dependencies between different versions. Second, in every version we have standalone modules and global module. Every module contains own /static and /templates directories. This structure used to avoid broken or wrong dependencies between different modules, because every module has own js app, css tables and local images. Global module contains all libraries, main stylesheets and images like logos or favicon. I think, this structure is much better to maintain, update, refactoring etc. My question is: How do you think, is this scheme better than current? Can this scheme live, or it is not possible to implement this in Django app?


What to do when your company doesn't encrypt passwords

**Background** I'm been contracted to help a company maintain their server. I work on some minor PHP projects but also look over performance issues and recently, scan logs for hackers. These guys have been running their server for some time and have what I would call a legacy application on its last legs. It uses magic quotes, global variables (which allows `$id` to be overwritten by `$_GET['id']`), use .htaccess as their only security in some instances, you name it. A security and programming nightmare. We have been hacked in the past, mostly with SQL injections, which would run `SLEEP(99999999)` commands and act as a DOS-attack. Luckily they didn't run "little bobby tables", ![http://xkcd.com/327/](http://i.stack.imgur.com/OSBpv.png) XKCD: http://xkcd.com/327/ So I re-wrote their vulnerable SQL statements from `mysql_query()` (not mysqli) to PDO transactions. I'm also analyzing the queries for `SLEEP` and `UNION`, which we don't use but the injections have. So far, so good. **Latest Issue** Recently we've been told records are changing in the DB for users, such as their e-mail addresses to ones presumably made by spammers. I noticed their columns didn't have a `last_modified` column, so we weren't able to even know when they were being changed, let alone by who. I added that column, but that's barely a first step. When I was looking in to this table, I noticed the passwords weren't salted nor even hashed, just saved as plaintext. **Client Communication** How can I approach them about the entire situation, as a contractor, without flailing my arms like a madman? Any advice? I was thinking a calm approach of,                   ISSUE #1             Synopsis             Why this is an issue             What can happen if this is not fixed             Suggested fix              ISSUE #2             Synopsis             Why this is an issue             What can happen if this is not fixed             Suggested fix


Webservics: Rationale behind portType and binding in wsdl

In a wsdl we define the operation name, input and output in the portType element; later on in binding we define operation, input and output again. What is the rationale behind this? why define them twice? I understand in binding we define the encodingStyle and other attributes, so what is the need of portType?


Is learning different programming languages from different categories good?

I have read some posts regarding learning different programming languages or not. Most of the answers indicate that learning more than one programming language increase our horizon as a programmer and we can learn different ways of solving similar problems. However, some also suggest that learning more than one languages of same type doesn't help much. My question is that does it then mean that we should learn different languages but of different categories as well? Should we learn one or all great languages of each category to increase our programming knowhow?


Should a method in a class be aware that the class has "loaded" a variable?

So I have the following code, which connects and then binds to an LDAP server. The question is in the first method.                 public function getUsers() // This is the method in question       {         if( $this->connect()->bind() ) {           ldap_query(self::$connection) // Here, should it be aware that class succesfully loaded              // the connection, or should the bind() method return the resource?         }       }            public function connect()       {         self::$connection = ldap_connect($this->host);         if( ! self::$connection ) {           throw new \CHttpException(503, 'No se puede establecer una conexión con el servidor '.$this->host);         }         foreach( $this->options as $option => $value ) {           ldap_set_option(self::$connection, constant($option), $value);         }         return $this;       }            public function bind()       {         $ldapbind = ldap_bind(self::$connection, $this->username.'@'.$this->domain, $this->password);         if( ! $ldapbind ) {           throw new \CHttpException(503, 'No se puede enlazar con el servidor: '.ldap_error(self::$connection));         }         return true;       }


Is there any way of getting attributes of an audio file?

Let's say you have an .mp3 file. A few of the attributes I would like to find out is like the bass, when the bass is loud, quiet, strong, soft and when it is all those things. Is there any way of doing this or is there anything similar to this? EDIT: also I'm not bothered about which code, I'm just interested in what is the easiest way to do this


How is C++ in QT different from the standard C++ libraries?

I want my app to be able to manipulate images and create watermarks and also needs to run on both windows and mac. Hence I've been investigating QT. Does QT ship with all the libraries I will need to achieve that? or will I have to get other standard C++ libraries? If so is it worth doing the project in QT?


Why declare variables close to where they are used?

I have heard people say that variables should be declared as close to their usage as possible. I don't understand this. For example, this policy would suggest I should do this:               foreach (var item in veryLongList) {       int whereShouldIBeDeclared = item.Id;       //...     }      But surely this means the overheads of creating a new `int` are incurred on every iteration. Wouldn't it be better to use:               int whereShouldIBeDeclared;     foreach (var item in veryLongList) {       whereShouldIBeDeclared = item.Id;       //...     }      Please could somebody explain?


How to talk about anonymous methods/lambdas

I realised the other day that I don't know how to talk about anonymous methods. It's easy enough to talk about named methods (`The X method takes a Y1, Y2 and Y3`) and classes (`The X class has A, B and C methods`), but it's harder with anonymous methods. **How does one go about talking (and writing) about them**? From the number of parameters they take, to the types of those parameters to the method signature? * * * For this anonymous method signature, how would you read it aloud?               int -> int -> bool -> double      I would say `"int, int, bool to double"`. What about calling it? How would you read this?               (A ,B) => A*B;      I would say `"A B goes/is to A times B"`.


Is Dijkstra's algorithm an appropriate solution to this signal routing problem?

I'm in the process of developing a signal management and routing module for an integrated audiovisual system and am designing it with the intent of being as flexible as possible across different signal distribution networks. The intent of the module is to handle routing across a number of stacked matrix switchers1 and handle necessary format conversion. The best solution I've explored at this point is to map out the network to a graph with discrete vertices for each signal type supported by the switchers and which are then joined via nodes representing the video processors that handle format conversion. ![Example graph](http://i.stack.imgur.com/TDXC9.jpg) _Colours represent signal formats._ _Round nodes are either switchers, sources or sinks._ _Square nodes are video processors which perform format conversion._ From there I can use an implementation of Dijkstra's algorithm to identify the path that has to be formed in order to get input X to output Y. This should allow the data about the input / output configuration of all the switchers and processors to be passed in and the module adapt accordingly. Is this an appropriate solution or is there an alternative approach that may be worth investigating? 1 aka 'crossbar switch', a video router with M input x N outputs that supports one-to-many connections. Each phsyical device may handle multiple signal formats and may or may not be capable of performing any format conversion. **edit:** As mentioned by Péter Török, the graph will not necessarily be a tree, the diagram is a simple example to illustrate the idea. When implemented in the 'real world' multiple paths may exist which offer varying levels of definition (DVI > VGA > component > composite) which I was planning to represent with edge weighting. **edit 2:** Here's an slightly more comprehensive example with directivity indicated and showing a network consisting of two signal types. The initial example has been modified slightly so that each input and output on a device is defined as a discrete node as this will provide the data required to control matrix routing / input selection. ![Example 2 - two signal types, stacked switchers](http://i.stack.imgur.com/zcgcs.jpg)


Fixing a push to the wrong branch

I committed and pushed some changes to the wrong branch. I found a way to fix it, but it seems overly complicated. Is this really the easiest way?   1. on the branch that you made your changes, type `hg parent`   2. run `hg diff -r <parent> -r <with_changes> > patch.diff`   3. `hg up <proper_branch>`   4. `hg import --no-commit patch.diff`   5. `hg ci -m 'committing changes to proper branch'`   6. `hg up <bad_branch>`   7. `hg parent` to find previous changeset on this branch that is good   8. `hg ci --close-branch -m 'closing bad branch'`   9. `hg up <last_good_changeset>`   10. add a space or other minor change   11. `hg ci -m 'making tip'`   12. `hg push` Something to that effect anyway. I did it in a slightly different order; I made the good changeset the tip again, and had to do a force commit because it creates a new head, then had to run               hg heads `hg branch`      To find the bad branch again, then close it. Now it still shows the bad changeset as the "tip" because I closed it _after_ I "re-tipped" the good branch, but when updating to that branch, I guess it takes the most recent non-closed head? Seems like quite a ridiculous process to fix such a simple mistake. Is there any easier way to do this? Why not?


Continuous Integration Feedback Cycle

How long should the Continuous Integration process take (i.e. compiling classes and running unit tests + integration test)? On my current project it takes about 30 minutes, is that OK? What's the ideal length of build time? Integration tests take most of that time, if the 30 min is too long what can be done here? What's the impact of having the build complete in 30 min?


Subscript binding and array categories

I am learning "Programming languages principles" and there is a lot of information about stuff which make up a programming language . Unfortunately every material I came across until now has a lot of technical jargon involved and is very difficult to understand (Atleast for a beginner sincerely trying to understand the topic on his own by reading the material) . Can anyone explain me the "Subscript binding and array categories" in general .. The classification says there are five kinds of arrays -   1.Static array   2.Fixed stack-dynamic array   3.Stack dynamic array   4.Fixed heap dynamic array   5.Heap dynamic array This is what I could understand from the definitions (almost on every article on this topic I came across) . **Static array -** subscript ranges are _statically bound_ and storage allocation is static.   I understood that the space for the array is allocated in memory at compile time (before run time) . **Fixed stack-dynamic array -** subscript ranges are _statically bound_ , but the allocation is done at _elaboration time during execution_.   Now I didn't understand anything . What is meaning of the _italicized phrases_ **Stack-dynamic array -** the subscript ranges are _dynamically bound_ , and the storage allocation is dynamic “during execution.” Once bound they remain fixed during the lifetime of the variable.   I dont understand what is meant by being 'bound' ? I should be able to understand the remaining two definitions if I understand these three . I know I am asking a lot .   Thanks :) Here's a link I recently came across which I find useful for this topic . Anyone interested in this topic , check it out . :)


Why is accessibility important?

It seems to be quite a big thing right now and experience with converting web sites to be more accessible seems to be a common criteria for jobs. My question is, why is it important? Is it a legal issue? Can I get sued if my web site does not comply with some accessibility standard? If so, what law would I be breaking? Is it a moral / ethical issue? Should all people whether they're semi blind or they're using pentium 2's to browse the internet should be entitled to access the right information? Is it a user ability issue? Are there enough users in these minority categories that it's worth investing the time to cater for these users. Is it a maintainability issue? Are applications that are more accessible generally easier to maintain? Or is it something altogether different?


Passive ways to learn new technology?

Recently, having purchased a smart phone, I discovered podcasts. It's great, cause I spend time commuting and usually that time would be a waste. Admittedly, it's fairly light stuff, mostly news and opinions. I don't think I could concentrate probably if they tried to explain through code samples etc. But I find even just knowing the existence of some new tech or maybe even just recognizing some new jargon is of benefit, at least it gives me a start if I decide to look further into it. What's more, it's enjoyable and easy. So I'm wondering, can anyone think of any other passive ways to learn or know about new technologies that doesn't take much effort and preferably can be done in your "dead" time?


Unit of work/repository pattern with dependency injection advice

I'm developing a series of repository classes and a UnitOfWork class (plus its IUnitOfWork interface of course). I'm using Castle Windsor, which injects dependencies via constructors. My business tier has classes such as "CustomerBusinessLogic", with methods like RetrieveCustomer, SaveCustomer, etc. These in turn use the UOW to perform the database operations. I'm struggling to find how/where the BLL class should get an instance of the UOW. It doesn't feel right injecting it into the ctr, as a unit of work is exactly that - a unit of work! I think an individual method (LoadCustomer, SaveCustomer) should be responsible for instantiating the UOW for the lifetime of its operation. However doing this means resorting to a service locator, which is an anti-pattern. Suggestions welcome!