Is it fair to use shortened url to mention and give links of live projects in my resume?

I have done or was part of some mobile projects that are uploaded in their respective markets and currently live, and I am already mentioning status as LIVE for respective projects. One of my friend -who is actually a web developer- has recently suggested me to put the urls of the application if the project is live. And I am taking this suggestion seriously. But i have found that some urls are really long and they desperately need to be shortened. So my question is : Is it fair to shorten all the urls of the live application? Or just shorten those which are so long. In case I shorten all the urls, can any employer take this point negatively? Thanks **EDIT** : After reading your response I think I need to clarify one thing.... The applications I have developed are mobile applications and they are uploaded in their respective markets, like Blackberry App store and android markets. It means a lot for an application accepted to be sold in market. And I want to put the url of these market sites. The links are there for a long time, so there is no threat that the link goes offline in a year or two.....


Why am I seeing more boolean naming conventions where "is" is used as the first word in the variable (eg, IsUserAdmin vs UserIsAdmin)?

I think everyone will agree that the following boolean variable/property names are standard:   * UserIsAdmin   * OrdersAreClosed The important thing to note about boolean expressions is that they are stated and then evaluated as true or false. User is admin. False. You get the point. However, lately I have seen an increase in booleans being formed this way:   * IsUserAdmin   * AreOrdersClosed Am I the only one who doesn't think this sounds absolutely ridiculous? You're not asking "Is user admin?" and then waiting for a yes or no. You're making a statement of "User is admin" and waiting for a true or false evaluation. Microsoft has been doing this a lot lately, as well as the programming behind our Telerik web controls. The thing is that I don't understand where this is coming from. It never used to be popular, leaving me to wonder if it's just me who is noticing this or if this is a trend that is actually on the rise and, if so, what's the point?


about database design

My question consists of three parts: When to be sure that your database design is perfect? * * * Is returning to the data base design to change some issues (like adding new column, delete a column or change data type or add new table or ....) considered as a bad practice or is it normal? * * * I want any web sites or books just for training on ERD and `normalization`. I want a lot of samples, practices, and case studies with recommended answers, to strengthen my skill in database design and avoid the poor database designs I've made. Note: I don't need books to explain the concepts, what I need is practices, examples, and case studies with recommended answers.


Do payment terms effect project design methodology?

When working on a software project for a client, there are two ways in which this can be billed - fixed fee project, or per hour billing. Does the choice of payment terms effect the design methodology you would choose to use? For example, one of the benefits of Agile programming is that changes can be made very quickly, and there is less emphasis on documentation, particularly with regards to design up front. This is great for per-hour billing, but when working on a fixed-fee project, you want to avoid changes as much as possible, or bill extra for the additional work created. In such a case, documentation and initial design become more important, as they form a great way of agreeing the exact scope of the project, and can be used to show deviations from design and therefore extra charges. Do you tend to use different design methodologies for fixed-fee and hourly rate projects? If so, what particular methodology do you feel works best for fixed-fee projects?


Can GPL-licensed software be resold?

My research group is developing some software for research purposes. The project leader wants the software to be open source and likes the GPL, but wants to ensure that they software cannot be sold. Are we reading the GPL correctly? The software can be freely modified, (re)distributed, and sold? If so, I see why it would be difficult to effectively sell the software; however, the GPL isn't quite strict enough for our needs. Any suggestions?


Installer or Portable

I feared programs that require installation a lot. They leave traces behind the registry even after un-installation, plus, some uninstallers are poorly- programmed (that means, some programs cannot be uninstalled). That applies to Windows. The good side of installers, they create shortcuts and file associations. However, the Komodo on Linux uses a shell script to setup and can be safely uninstalled by deleting the folder. Do you think installers should be all abolished? Do you think the effect of installations should be replaced by shell scripts? Do you think all computer games should be portable? Should the "scan the /Applications/${AppName}/Information folder and list app icons" design should be used for future desktop environments?


How can I use different versions of an evolving library in different projects?

# The problem I write a lot of exploratory code in my research. As I go along, I put functionality that I'd like to reuse in a central location. A project might look like this:               ./mylib     ./exploration         /experiment_1         /experiment_2         /experiment_3      Where each experiment uses some functionality from `mylib`. Now I come along and start my fourth experiment. In the process, I may need to change my library in some backwards-incompatible way. Now I can't re-run my first three experiments without updating their codes to be compatible with the newest library. _Note_ : As of now, I keep `mylib` in version control, and `exploration` in version control, using git. This means that all of the experiments are in the same repository. This is done so that a single `push` or `fetch` and `merge` in `experiments` syncs all of my experiments between computers. I feel that there may be a better way, but that might be for another question... # Possible solutions   * I could bite the bullet and update the old experiments manually whenever I need to run them (bad, tedious, but straightforward).   * I could "vendorize" my library by copying it whenever I make a new experiment. (Bad, bugfixes have to be inserted into each copy).   * Since I keep my library in version control, I could tag points in the library's history by whatever is required by an experiment. When I want to run experiment _n_ , I'd checkout tag _n_. (Better, but what if I want to run two experiments simultaneously? It also seems like there should be a way to automatically use a specific version of the library.)   * Whenever I start an experiment, I'll make a new branch in the library. In each experiment folder, I'll clone the library repo and checkout the correct branch. (This seems reasonable, though it is perhaps wasteful of space, since I'm duplicated all branches when I clone. Also, I might have a lot of experiments, meaning that there will be lots and lots of branches in my repository, cluttering things unnecessarily.)  Should I reconsider any of these above solutions? I have also _heard_ about git's subtrees and submodules, and while they _sound_ like they might be the answer to my problem, I want to get the input of more knowledgeable coders before sinking time into a rabbit-hole.


State-of-the art Mercurial workflows

Having solid git knowledge under my belt, I occasionally use mercurial, especially when patching a HG based project. I feel slightly uncomfortable, because my knowledge of mercurial is limited and does a lot of things differently than git. Since a lot of these things are probably just rooted in my lack of mercurial knowledge I would like to brush it up. One obstacle when learning mercurial is the abundance of plugins. It seems that not all plugins described in Tutorials are still recommended as many of them have been superseded etc. What are good, modern plugins to start with? While in Git, I work with branches heavily, I like to rebase occassionally to avoid having too many merge commits between master and feature branches back- and-forth. Can this usage be reasonably simple mapped to mercurial or would you say that I should change this approach while using mercurial for a "more native" workflow?


Are suffix trees and suffix arrays identical? What are the differences?

I have read some information through internet...i found that somehow suffix tree is quite similar to suffix array but somehow they are no the same thing.. Given a string, a suffix tree construction algorithm looks something like this (I copied the algorithm from a website)               FOR i ← 1 to n-1             FOR j ← 1 to i+1                     find the end path for S[j…i]        extend the path, if needed, to S[i+1]       suffix tree able to list down all the subtring obtained from a given string However, does the suffix array also give the same functionality to obtain the list of substrings? Or are suffix arrays just an implementation of suffix trees? Or suffix array just provide some storing function?


Should we include external systems in Class diagram?

I want to draw a class diagram that shows the following for an application:   * An external content management system that publishes some news items.   * The class that represents the news item in my application. The question is shall I include the external content management system as a class in my diagram (and maybe give it a different color or add a comment that it is an external component) ? if the answer is no, what shall I include in the class diagram ? the news item class only ? and how to show the relation between the news item class and the external content management system ?


Standard ways of revoking user access to a site

I'm in the process of building a .NET MVC website where a requirement is that admin users should be able to lock accounts to not only prevent future log-ins but to also immediately revoke access to the site for a given authenticated user. Locking the account is easy, but is there an established method of preventing access immediately in this type of scenario. Is it a case of checking on each request whether the requester's account is locked in the db and then clearing the authentication cookie if required? I'd appreciate any pointers anyone has.


How To Explain Need to Refactor Code to Non-Developer Boss

> **Possible Duplicate:**   >  How do you explain refactoring to a non-technical person?   >  How to justify code refactoring time? My supervisor is the CTO of the company that I work at, he is the jack of all trades master of none. I have inherited a codebase of about 400,000 lines of PHP from 2 previous developers. The state of the code could be compared to that of a dumpster behind an italian restaurant, a mess and full of spaghetti. I have been in my current position for about 7 months and have been trying to get approval to refactor parts of the codebase as I am given bugs/features to work on. My attempts to get permission to dedicate time to this task has been met with little more than a passing 'no' in response. What are some steps that I can take to explain to my superior why we need to clean up this spaghetti mess of a codebase and see if we can't get it refactored into a manageable, scalable, and secure state. I am looking more for how to explain the need to someone who will say they understand, but truely have no idea so they shoot it down to avoid trouble later.


How do I explain the value of refactoring to stakeholders?

How do I convince project managers, product owners, business analysts, clients and various other stakeholders that refactoring is a worthwhile and productive part of the development process? As developers we all know that requirements change or are never fully explained from the start, and therefore how we wrote a piece of code in the past doesn't make sense now and needs to change. We know that if we redesign a some code now it will save us headaches in the long run. We know that if we keep our codebase clean and tidy, it will improve maintainability and ultimately lead to better code. But however I put this to stakeholders, I just can't seem to get the value across. To them, refactoring is an unconstructive waste of time (by its very definition - the user should see no change in the application). To them it delivers no business value (or at least no immediate business value) because it delivers no new features, and they will strongly resist any refactoring. I can't be involved in a codebase where refactoring doesn't happen because I've been there before and I've seen how it ends up. So instead i sneak it in when working on a feature. I would far rather be doing it openly so the stakeholders can get a clearer idea of the development process. Any ideas on how to get this across?


How to justify code refactoring time?

Have a very large project more than 70k LOC. The project definitely needs some code refactoring in Core Framework and in other parts as well. There was NO time set in the beginning of the project for refactoring. However with time and more than 40 developers joint and left the project. From my perspective is indispensable. What would be your key points in arguing and defending a proper software development principle?


UML Class Diagram: Abstract or Interface?

I am modeling a class diagram and have spotted an opportunity to simplify it slightly. What I want to know is, would this it be better to implement an abstract class or an interface? The scenario is this, I have the classes:   * Artist   * Genre   * Album   * Song All of which share the methods getName, setName, and getCount (playcount that is). Would it be best to create an abstract 'Music' class with the aforementioned abstract methods, or should I create an interface, since the classes that implement the interface have to include all of the interface's methods (I think, correct me if I'm wrong). I hope I've given enough detail, please ask questions if I haven't. Thanks!


session persisting problem after system restart

Is there a way to prevent session id restore on startup/restart of user's system? We are using a asp.net app and I am able to login and access the site. For the first time session id is created and stored in cookies. Problem:   But if I restart my system without signing out, the session is still alive.   How can I prevent this? from server side. I can try to delete cookies but it is not practical, as each user will have different preferences.


How do I implement code obfuscation for native code?

I'm interested in doing code obfuscation **(native code, to make it clear what I mean by "native code": the actual machine code in x86/x64/arm executable files - PE, ELF, Macho and etc, not the sources)** as a part of a build process. I can think of several ways of doing it:   1. Writing a compiler plugin, that would get internal representation after all optimization phases, transform it and then send it to compiler's back-end. In this case, could you advise me some compilers that support plugins like that? Programming language doesn't really matter, but I would like to try out something other than C/C++ (I know that both GCC and Clang support plugins, but I could never get it working properly on Windows).   2. Dump internal representation after all optimization phases to file, parse and process it with my obfuscation tool and pass it back to the compiler. I couldn't find how to do it with GCC (I successfully dumped different internal representations, but I couldn't find how to make compiler generate code from it). And I know that Clang is able to generate LLVM bitcode, that can be processed and compiled with LLVM compiler, but again I couldn't make it work properly on Windows. Do you know any compiler that allows doing such things?   3. Currently I'm doing obfuscation by preprocessing sources, it works, but it takes too long to do it for a large code base. So I'm looking for alternative ways of doing it, and I want to read your opinions on what is the best way to do native code obfuscation. PS Please bear in mind that I'm asking a concrete question. **I'm not asking whether I need obfuscation on not**. Obfuscation is done for a reason and I have a reason to do it. **I'm not asking how to perform actual native code obfuscation or about algorithms of code obfuscation**. I know how to do it and how to break it. _**I'm asking about native code compilers that either have good support for plugins or can dump and recompile some low level internal representation like AST (abstract syntax tree), RTL (register transfer language), three-address code or something else_**.


ASP.net performance code behind vs app_code

I am wondering about performance of a web site/application when there is code in the code behind files rather than when the code is moved to separate files in the App_Code folder. My understanding is that the code behind gets compiled and executed every time they are requested by the user. If this is not the case, please let me know. Also, it is my understanding that the code in the App_Code file gets compiled once. With these understandings, it would seem that moving code the App_Code folder would speed up requests. I understand that there wont be any significant gains until you have lots of files and lots of requests very frequently. However, will this cause any performance value? Also, by performance I am talking about speed. Specifically speed of client side load. And I know there are other factors that can increase speed on the users end, but I am specifically asking about the above situation.


What's an incorporated software developer?

I saw a job posting asking for "incorporated software developers" and asking them to state their "incorporated rate" when applying. What's the difference between an incorporated developer and a contractor/freelancer? Google isn't helping. My best guess is that an incorporated developer is just a freelancer/contractor who sets up a corporation and works as the sole employee of that corporation, rather than freelancing under their own name. But since (I assume) you would have to pay both corporate and income taxes if you did that, rather than just income taxes, what would be the point of doing that? There would be some protection from legal liability, but that generally isn't a big risk for software developers.


Scaling of productivity as a function of the team size

Are there any kind of, even if rough, estimates how productivity scales with the number of programmers? (And, ideally, backed by numbers.) Here, by productivity I mean the _inverse of time_ that is needed to finish a project (given fixed projects, how it's time burden changes), though other measures may be as well of my interest (but other ones can be harder to be made objective). The standard wisdom is that _"Nine women can't make a baby in one month."_ , which in my language means that performance is sublinear. (The Brook's law goes even further - that the total performance declines, but AFAIK is related pumping people when there project is already ongoing). Sure, there is an overhead for: communication, coordination, common technology; and very likely latter programmers may be not as skilled and motivated as the first one. But how much? In general scenario it is called Ringelmann effect and, at least - for simple tasks like pulling rope, it is attributed to the loss of motivation. * * * Why the question? Mostly, academically and out of curiosity. Scaling laws in performance are an interesting thing. For example, for performance of scientists grow superlinearly (here: ~n^2) with team size, until the group reaches number of maximal effective collaborators. For most of cognitive tasks, group typically does better than a single person, but not n-times as good (scaling more like square root, ~n^0.5). And for institution management overhead can be directly measured, as ratio of administrative workers increase with the institution size. See references from my talk Does 2x bigger mean 2x better? - 1st Offtopicarium. A bit related to my question Performance of a group solving a cognitive task: How does it scale? - CogSci.SE. * * * Sure, it will depend on the task, and collaboration technique (e.g. two people pair-programming vs sitting at their own desks).


How would you decline to have your name put on a software patent?

Your company wants to patent something you implemented. You do not agree with the concept of patenting software. How do you proceed?   * Would it be acceptable to file the patent, but keep your name off it?   * Would you attempt to convince your company to NOT file the patent? Are there any downsides to having your name on a patent?   * Could you potentially be compelled to appear in court for a patent lawsuit?


Should a programmer use the default environment?

I see a lot of programmers (and, generally, tech people) using the old "Classic theme" in Windows instead of Aero (or Luna in Windows XP) for reasons like "it is faster" or "I don't want eye-candy". However, most non-programmer users will have the default theme enabled, so these programmers will work (and, possibly, design and debug its application) in a non-standard environment (unless they are targeting Windows Server). For example, a programmer that never uses Aero, may not even know that hovering a button gives it a "halo" effect. So, should programmers try to have their workstation configuration as closest as possible to the real world, or should they rely on something/someone else (test team, UI design team, etc.) for this "real world integration"? And what if the programmer is working as a one-man-team (being designer, coder and tester)?


Windows programming - should you leave UAC on?

What is the recommended User Account Control (UAC) setting when developing on Windows? Even on Win7 I find it annoying enough to turn it off (because it makes me more productive with it off) but sometimes I feel bad because I know I'll find more problems in my code if I leave it on.


Programmer, not a blogger

I need advice from people who might understand where I'm coming from. I'm the lead engineer on a software product. The company I'm working for recently expressed serious interest in having me blog about it (much to my dread). They even had someone set me up a blog. I have Asperger's disorder. I'm really good at taking complex software problems and finding wonderfully elegant solutions. I don't know the first thing about writing interesting and engaging text. Writing for me is a difficult problem, one that doesn't have a defined solution. I'm really struggling with this and it eats into a lot of time I could spend getting things done. I love the company I'm working for, but I'm worried what it'll mean if I tell them I can't do it. I don't know how to tell my employer that what they are asking for is something that's totally beyond me. Help or advice anyone? **Update** Thank you everyone! Wow, such great responses, lots of great advice!! It was very hard and took a long time, but I was able to do it. I'm going to stick with it a bit longer in hopes that it gets easier (the first post is probably the hardest, because it sets the tone and such). Thanks for the kind words, all the advice, and even for the kicks in the pants!! =)


Is there a unit testing framework for HTML markup?

I work at a web design shop. Our workflow is divided into two parts: frontend programmers make static html and css templates of the site design, then backend programmers tie the templates into a CMS. We have a set of common functionality for our sites, and I'm wondering if there's a unit testing framework we can use to test for this functionality. For example, one of our common functionality guidelines states that _all links to a pdf must open in a new window_. I would like to write a unit test that goes something like this               if(a.class = 'pdf_link')       assert(target='_blank)      Wikipedia's list of unit testing frameworks doesn't seem to have anything that encompasses this relatively simple functionality (checking strings against a template), and I'm leaning towards writing a bunch of bash scripts and tying them into our CI server. But is there an better way to do this?


Locking database records

What I have right now:   1. A table with lot of records.   2. About 200 users can select a record according to some rules based on the data in each record.   3. There is a high chance that 2 or more users will select the same record.   4. A user updates the record then saves it back to the db. That record won't be selected again (soft deleted).   5. Optimistic locking was tried and the performance wasn't accepted by the PO.   6. Our solution was once a user selects a records it updates a "lock" field in the record. The problems:   1. Collision is still occurring as users are still selecting the same record. I need to prevent 2 users from selecting the same record.   2. We need to release the lock manually if the user takes no action for a long time. I searched and it seems Amazon SQS was a good solution, but it had a problem that I can't search the Queue. Is there a good technology to solve my problem? I need to implement a searchable queue where messages are locked when selected and the lock expires after a certain amount of time.


Pro/con of using Angular directives for complex form validation/ GUI manipulation

I am building a new SPA front end to replace an existing enterprise's legacy hodgepodge of systems that are outdated and in need of updating. I am new to angular, and wanted to see if the community could give me some perspective. I'll state my problem, and then ask my question. I have to generate several series of check boxes based on data from a .js include, with data like this:               $scope.fieldMappings.investmentObjectiveMap = [       {'id':"CAPITAL PRESERVATION", 'name':"Capital Preservation"},       {'id':"STABLE", 'name':"Moderate"},       {'id':"BALANCED", 'name':"Moderate Growth"},        // etc       {'id':"NONE", 'name':"None"}     ];      The checkboxes are created using an ng-repeat, like this:               <div ng-repeat="investmentObjective in fieldMappings.investmentObjectiveMap">      ...     </div>      However, I needed the values represented by the checkboxes to map to a different model (not just 2-way-bound to the fieldmappings object). To accomplish this, I created a directive, which accepts a destination array destarray which is eventually mapped to the model. I also know I need to handle some very specific gui controls, such as unchecking "None" if anything else gets checked, or checking "None" if everything else gets unchecked. Also, "None" won't be an option in every group of checkboxes, so the directive needs to be generic enough to accept a validation function that can fiddle with the checked state of the checkbox group's inputs based on what's already clicked, but smart enough not to break if there is no option called "NONE". I started to do that by adding an ng-click which invoked a function in the controller, but in looking around Stack Overflow, I read people saying that its bad to put DOM manipulation code inside your controller - it should go in directives. So do I need another directive? So far: (html):               <input my-checkbox-group               type="checkbox"               fieldobj="investmentObjective"               ng-click="validationfunc()"               validationfunc="clearOnNone()"               destarray="investor.investmentObjective" />      Directive code:               .directive("myCheckboxGroup", function () {       return {         restrict: "A",         scope: {           destarray:      "=",  // the source of all the checkbox values           fieldobj:       "=",  // the array the values came from           validationfunc: "&"   // the function to be called for validation (optional)         },         link: function (scope, elem, attrs) {           if (scope.destarray.indexOf(scope.fieldobj.id) !== -1) {             elem[0].checked = true;           }           elem.bind('click', function () {             var index = scope.destarray.indexOf(scope.fieldobj.id);             if (elem[0].checked) {               if (index === -1) {                 scope.destarray.push(scope.fieldobj.id);               }             }             else {               if (index !== -1) {                 scope.destarray.splice(index, 1);               }             }           });         }       };     })      .js controller snippet:               .controller( 'SuitabilityCtrl', ['$scope', function ( $scope ) {       $scope.clearOnNone = function() {         // naughty jQuery DOM manipulation code that         // looks at checkboxes and checks/unchecks as needed       };      The above code is done and works fine, except the naughty jquery code in clearOnNone(), which is why I wrote this question. And here is my question: after ALL this, I think to myself - I could be done already if I just manually handled all this GUI logic and validation junk with jQuery written in my controller. At what point does it become foolish to write these complicated directives that future developers will have to puzzle over more than if I had just written jQuery code that 99% of us would understand with a glance? How do other developers draw the line? I see this all over Stack Overflow. For example, this question seems like it could be answered with a dozen lines of straightforward jQuery, yet he has opted to do it the angular way, with a directive and a partial... it seems like a lot of work for a simple problem. Specifically, I suppose I would like to know: how SHOULD I be writing the code that checks whether "None" has been selected (if it exists as an option in this group of checkboxes), and then check/uncheck the other boxes accordingly? A more complex directive? I can't believe I'm the only developer that is having to implement code that is more complex than needed just to satisfy an opinionated framework.


Is there any alternative to function pointers in c++?

I am a novice c++ programmer who kept an idea that function pointers are a thing of C and OOP in C++ does not recommend its usage. I know what I write here is vague/broad. But it will be great if somebody could comment whether my idea is completely wrong or something sensible. Thanks.


How to decide between using an existing eCommerce solution and building your own?

There are a number of both open and close source off the shelf solutions. For example Magento has an impressive list of sites that use them for eCommerce. There are also stories such as this (only link to last section) where an eCommerce site is developed from scratch with great success. I'm wondering if there's an objective way to approach the build vs customize decision?


ORM: Design of the service layer

I'm currently writing a medium sized web-application and find myself asking this question many times. For example, let's say there are users, which have files (one-to-many). How should the UI access the data? One "extreme" would be to let the service layer "only" take care of the lazy loading, i.e.               public interface UserService {         public User createUser(String loginName, String password);         public Set<MediaFile> getFilesOfUser(User user);     }      or, on the other hand, never return entities, only their ids               public interface UserService {         public long createUser(String loginName, String password);         public Set<Long> getFilesOfUser(long userId);     }      This implies the service would need methods for querying (and setting) all "basic" attributes, too               public interface UserService {         public long createUser(String loginName, String password);         public Set<Long> getFilesOfUser(long userId);         public String getNameOfUser(long userId);         public void setNameOfUser(long userId, String name);     }      This adds quite a bit of code (and possibly additional load to the DB), but also protects from StaleData- or LazyInitializationException. Subquestion: How - if using the first case - should updating, fetching etc. be implemented? Two methods come to mind First, I could try to manually update the original reference (because things like collection proxies, version etc. only get updated on the returned object, not the original reference). This simplifies using those entities directly in the UI               public Set<MediaFile> getFilesOfUser(User user) {         Set<MediaFile> files = user.getFiles();         if(!Hibernate.isInitialized(files)) {             user.setFiles(userDao.findOne(user.getId()).getFiles()); // findOne to re-attach to the session         return ImmutableSet.<MediaFile> copyOf(files);     }      but also               public Set<MediaFile> getFilesOfUser(User user) {         return ImmutableSet.<MediaFile> copyOf(getUser(user.getId()).getFiles());     }      The major difference in those comes to show when using versioning. In the former case, I have to update version etc. manually (`user.setVersion(attachedUser.getVersion())`) after every update, in the latter, a update call has to re-fetch the entity every time just to set the value:               public void update(User user) {         User attachedUser = getUser(user.getId());         attachedUser.setName(user.getName());         attachedUser.setPasswordHash(user.getPasswordHash());         // etc etc         userDao.save(attachedUser);     }      This does not seem very efficient / unintuitive. Which is the correct way to go? **EDIT** Just had an other idea related to the "only return id's" method: Services could expose a public "get___ById(long id)" method, which then can be used to at least read the basic values of the entity. Additionally, one could implement "get___ByIdEagerly(long id)" and return a initialized entity, but I think that's a bad idea.


How to format this line according to PEP 8?

I'm trying to adhere to PEP 8, with a 78 character limit on the length of my lines. I have the following statement:               startTime = time.strptime(request.GET.get('st', (dt.datetime.now() - dt.timedelta(days=1)).strftime("%d/%b/%Y:%H:%M:%S")), "%d/%b/%Y:%H:%M:%S")      How should I format it so that it adheres to PEP8 (where should I break it into new lines?)


Using GPL libraries without modification on a commercial website, do I need to make my source code available?

If I write a public-facing commercial website, and use a GPL javascript library and/or binaries without modifying them (such as plupload), would I be required to make the source for my website available? Is that considered distribution? That component is just an example. I know a commercial license is available, but would I need a commercial license if I wasn't modifying the source code of the component?


Does a website running modified GPL software have an obligation to release their changes?

If a non-profit organization runs software on its website that is modified GPL'ed software and it acknowledged to be such, do they have a legal obligation to release any changes? They are not offering binaries, they're just running it and providing public service. Does it make a difference if the original software was JavaScript (therefore users do acquire source at some point) or PHP? I have already read GNU's opinion, but it is somewhat ambiguous.


Definition of distribute in relation to the GPLv3

We lease an appliance to our clients (4 physical servers running 12 VMs). One of the servers exposes a website which in turn uses the other VMs. Clients have no access to the VMs or the software which runs on them. One of the reasons is that we process classified documents (and while security through obscurity is no defence, why make anything easy for an attacker?) So the appliances are owned and maintained by us but can be accessed across a network by clients. I'd like to use some functionality which is in a library licensed under the GPLv3. If needs be, I can implement the library myself without needing to refer the the library in question, but I'd obviously prefer to use the existing code (to avoid reinventing wheels). With the caveat that none of us are lawyers, can someone clarify if, in their experience, this counts as distribution under the definition of the GPLv3?


If I used GPL code in server side app, what if any of my code do I need to release?

Consider a service such as Netflix... if on the server side netflix used code with a GPL license attached, do they have to make their server side code available under the terms of the GPL? Obviously netflix being only an example, the company I worked for mostly provides 'services', we don't sell software that anyone can download to their computers, more like, computers over a network talk to our computers and stuff gets done. Can I consider using GPL code in this environment without making all my code 'open source'?


What constitutes "distributing" for LGPL v3

I am considering basing some new software on a LGPL web application. I want to utilize this new software for creating one website for my employer, and we do not intend to sell or distribute the software itself to anybody. Does publishing web pages from LGPL software constitute "distributing" in the license, so I would have to publish our changes to the LGPL code as well? I understand that none of you are lawyers so IANAL is implied. I also understand that I could contact the developers of the LGPL software and ask for a different license.


When embarking on a cloud computing project should a Chaos Monkey be the first application?

After reading Jeff Atwood's article "Working with the Chaos Monkey" and considering the implications of "Fallacies of Distributed Computing" it made me wonder if the first task of developers creating a cloud-based application should be to create a Chaos Monkey. Actually, given that even an entire data center can be lost within a cloud, the Chaos Gorilla may also be necessary to simulate a major outage. Netflix certainly seem to believe so but I was wondering if their conclusions were shared by others here. So, as the title says, when embarking on a cloud computing project should a Chaos Monkey be the first application?


In Agilefant tool for Scrum, what are "Leaf Stories"?

I'm just starting as a Scrum Master, and I am looking for a good web based tool for a story board. I am trying Agilefant, and they have something called "leaf stories". I wonder what do they mean by that. I've read about User Stories, Technical Stories, Unplanned Items, but I can't seem to find a reference to "Leaf Stories". ¿Can anyone clarify?


Which skills would you expect and appreciate in a Junior Software Engineer?

I recently finished my Master of Science in Software Engineering, and I am about to start my professional career in a few weeks. My role will be as a Junior Developer for a company which develops software using Java & related technologies (among them Spring and Hibernate). To be honest, I am really excited about what is coming, especially because I want to develop my career as a Java developer. I am also very interested in gaining experience in the field. Additionally, this is going to be my first work experience as a professional developer so I really want to do my best from the very beginning. I would like to know which skills and abilities, both soft and technical, would be most appreciated in a new professional (Junior Developer) that could be part of your team and in which skills I should focus on to achieve a successful career as a Software Engineer.


eBook editions of programming books

(I'll get my justification for why this is on topic in early: programming books tend to have fairly specific formatting needs - code samples, tables, images and graphs - which are not common to all book types and are not necessarily well handled by eBook readers. Similarly they're used in different ways - you often dip in and out rather than read cover to cover.) I've just noticed that Don't Make Me Think by Steve Krug is available as an eBook edition for the Kindle (and presumably also for other readers) which set me thinking. There are certain advantages to eBook readers for tech books - primarily that you can carry a massive library of what would be heavy physical books around very easily. The downside is that certain eBook readers allegedly aren't particularly well equipped to cope with tables, code samples and so on and a book like Don't Make Me Think presumably makes extensive use of these sorts of things. So, the question, **what are your experiences of reading and using programming books on an eBook reader and would you recommend it?** I'm specifically interested in the latest generation Kindle but happy to hear about all devices - might be useful to state which one you use in the answer.


How is same-origin policy implemented?

I was looking at cross-domain requests for a design and stumbled upon something that puzzles me. From a local site I'm firing an Ajax request to another domain (with jQuery and vanilla XMLHttpRequest). Sure, the request fails and I can only get a fail event, which seems perfectly normal du to same-origin policy. But I noticed in Fiddler that the request is actually made and succeeds! It's seems that it's just that I can't process the response. Am I missing something, or is that a security hole? Sure, you can't access data, but what's the point of allowing sending data and just preventing response access?


Multiple documentation issues in a single bug

It is clearly a bad practice to incorporate several issues in a single bug. It is not convenient, hard to maintain, difficult to keep track of what is done and what is not, etc. But does all this concern bugs associated with documentation as well? By documentation, I mean only external documents (user guides, architecture overviews, etc.). I personally find it more convenient to create a single bug for multiple issues in the same document. It's easier to keep track of the updates in the document and review the document when the changes are done. What are the cons of incorporating multiple issues of a document in a single bug?


Application settings via constructor injection or ambient context

I am developing an application containing a class which loads application settings from a configuration file. Settings class:               public sealed class MyAppSettings : IMyAppSettings     {         private IMyAppSettings DefaultSettingsInstance;              public MyAppSettings()         {             DefaultLanguage = "en";                  var config = ConfigurationManager.GetSection("MyAppSettings") as NameValueCollection;                  if (config != null)             {                 if (!string.IsNullOrEmpty(config["DefaultLanguage"]))                     DefaultLanguage = config["DefaultLanguage"];             }         }              public static IMyAppSettings Default         {             get             {                 return DefaultSettingsInstance ?? (DefaultSettingsInstance = new MyAppSettings());             }             set             {                 if (value == null)                     throw new ArgumentNullException("value");                      DefaultSettingsInstance = value;             }         }              public string DefaultLanguage { get; private set; }          }      Class which is using setting (version 1):               public sealed class SomeClass     {         public SomeFunction()         {             // Using language setting here             if(MyAppSettings.Default.DefaultLanguage == "en")             {                 ...             }         }     }      or version 2:               public sealed class SomeClass     {         private readonly string _defaultLanguage;              public SomeClass(string defaultLanguage)         {             if(string.IsNullOrEmpty(defaultLanguage))                 throw new ArgumentNullException("defaultLanguage");                  _defaultLanguage = defaultLanguage;         }              public SomeFunction()         {             // Using language setting here             if(_defaultLanguage == "en")             {                 ...             }         }     }      Both classes and interface are located in the same assembly. What approach is better for a global application settings, pass it via construction injection or use an ambient context or something else?


Queries on online project outsourcing sites

I have been looking at RentACoder, Freelancer and eLance from last few years but I always hesitated to register at these site. Hesitation includes little worry too. These questions fill me: (1) Is there a legal contract between the bidder and the coder? Just in case my delivery date extends, what happens? (2) After delivery, payment reach without trouble or not. (3) In case the customer didn't find the project useful, then? Probably he might say that it is not useful to me and you return money. He might copy the source code and return another copy to me. (4) What are further recommendations? How should I start?


How can I return generated HTML and a response too?

My web application will use AJAX calls often and so I have set up some JavaScript to handle "messages" or "responses". These responses are returned (from my ASP.NET application) as JSON objects that act as feedback once a function is complete. Suppose my responses have three basic elements.   * Type (error, warning, info, success)   * Title   * Message For example `Save unsuccessful` `Your data was not saved because of XYZ.` Sometimes, however, I want my function to generate and return some HTML. That's easy enough, but what if I still want to return a message to the user (or some other JSON)?   * Should I return the HTML as part of the JSON?   * Should I only return one or the other?   * Should I return HTML, then make another AJAX call for the response?   * Should I return HTML and store the response in data- tags? Can someone point me in the right direction?


Becoming a professional programmer, without going to college?

I was recently rejected from a college that had previously accepted me, on the grounds that I spent a year of high school in a foreign country and the college wasn't interested in recognizing education received in another nation. Because of this a very generous scholarship has dried up, and and financing an education is doubtful. I'm also hesitant to become a part of a system that has demonstrated what I consider to be blatant xenophobia. What I want to do is say "Screw college", strike out on my own, and do something amazing, wow everyone, and become a self made millionaire. The reality of the situation is that I'm two weeks out of high school, I have about the equivalent of an Intro to Programming course worth of self-taught experience (although I am driven to learn and improve), I still need to pay bills, and I have a sneaking suspicion that any employer is going to have a hard time taking me seriously. As I understand it, it's a fairly popular belief that you can make it without a degree, but how does someone like me do that? Would anyone take me seriously if I walked into their office and said "I have no formal education and a minimum of skills, but I want to work and I want to learn. Please give me a job."?


Making programming a career— without a degree. Is this smart?

I asked this before and go downvoted hard so someone said I should try posting here... Any help would be MASSIVELY helpful. I'm doing Udacity, Udemy, Codecademy, Lynda, and edX. I'm learning Java (my favorite), MySQL, Python (the hardest), Javascript, HTML, CSS, and just began to learn C. I work hard on them and I love doing it. OK, so I was visiting my bro and his family last week, and I told them I was doing online courses for programming. And they basically laughed their asses off at "free education" and told me I was living in a "fantasy". I'm 18, and while I'm not downplaying the idea of going to college. I just think it's a waste when I can have more fun learning online and save my money. However, I know a degree gets your foot in the door. However, they kinda drained what motivation I had to continue doing the courses. Anyone have any thoughts, success stories, or advice to keep me going? Is anyone else in the same boat? Also I was going to do some open source work and build my own projects to get some experience.


Conceptual difference between Git and GitHub

The last line of this answer prompted me to ask this question . I know to know at a conceptual level the difference between Git and GitHub .


What is the right HTTP method for upvoting?

From a RESTful point of view, what is the most appropriate HTTP method for the action of upvoting a forum post (like on StackExchange)? I would say POST for voting and DELETE for canceling vote, but since users are only allowed to cast one vote per message, voting can be considered an idempotent operation so PUT can also be possible.


What arguments are there against easter eggs? Are there any arguments to even support easter eggs?

I'm a bit of a jester so the idea of an easter egg still appeals to me. I have added them in my code before but my group of friends has a running joke of using CTRL-FU to trigger the egg. Now I'm also a bit paranoid about performance so I like removing excess whenever possible. This heavily contradicts with easter eggs as they are 100% superfluous code. What arguments are there against easter eggs? Also, are there any arguments to even support easter eggs?


Why should a column in a Relational Database have a single purpose?

Consider a table in which a column represents a monetary value in some cases and a link to the value of another record in other cases so that we have the following:               TABLE 1     Id Product Composite     1  Apple   False     2  Orange  False     3  Pear    True          TABLE 2     Product  Date        Price      1        2010-01-01  0.45     2        2010-01-01  0.50     3        2010-01-01  1.00     1        2010-01-02  0.46     2        2010-01-02  0.49     3        2010-01-02  2.00      The tables above represent the fact that the price for an Apple and Orange are given on each date by the corresponding Price column in Table 2 so that the price of an Apple on 2010-01-01 is 0.45 and the price of an Orange is 0.50 on that same date, however, the price for a Pear on 2010-01-01 is 0.45 and the price for a pear is 0.49 the following day by allowing the Pear's price to be determined by the price of an Apple on the first day and the price of an Orange on the second day. Please indicate the pros and cons of this approach?


How to justify efforts to make capitalization of class and property names uniform?

In this thread, an Oracle Product Manager (username "Alex Keh") refused to make Oracle's EF provider to conform with .NET's `PascalCase` coding standard for class names and property names, saying that it is only "cosmetics" without any "functional needs". > I discussed it with my team. One of the key things we want to know is why > developers are spending so much time changing the case between Oracle and > EF. Is there a compelling functional need to change from upper case to > Pascal case, not just a cosmetic one? > > On the feature request tool and this thread, people have asked for the > feature, but not offered a reason why Pascal casing is so important that > they would be willing to conduct the manual mapping changes. For me, the main reason is that I don't want to see Oracle's `UPPER_CASE` name convention mixing in my .NET code, but it seems that this is not enough. How would you justify effort to support PascalCase convention?


Do JAX WS implementation classes come as part of the Java 5/6 package or only as part of an application server libraries?

Do JAX WS implementation classes come as part of the Java5 package, as part of the Java6 package or only as part of an application server libraries like WAS? I read that it comes as part of Java EE? What does that mean? Java 5?


How to use OO for data analysis?

In which ways could object-orientation (OO) make my data analysis more efficient and let me reuse more of my code? The data analysis can be broken up into   1. get data (from db or csv or similar)   2. transform data (filter, group/pivot, ...)   3. display/plot (graph timeseries, create tables, etc.) I mostly use Python and its Pandas and Matplotlib packages for this besides some DB connectivity (SQL). Almost all of my code is a functional/procedural mix. While I have started to create a data object for a certain collection of time series, I wonder if there are OO design patterns/approaches for other parts of the process that might increase efficiency?


Graph data structures and journal format for mini-IDE

Background: I am writing a small/partial IDE. Code is internally converted/parsed into a graph data structure (for fast navigation, syntax-check etc). Functionality to undo/redo (also between sessions) and restoring from crash is implemented by writing to and reading from journal. The journal records modifications to the graph (not to the source). Question: I am hoping for advice on a decision on data-structures and journal format. For the graph I see two possible versions:   _g-a_ Graph edges are implemented in the way that one node stores references to other nodes via memory address   _g-b_ Every node has an ID. There is an ID-to-memory-address map. Graph uses IDs (instead of addresses) to connect nodes. Moving along an edge from one node to another each time requires lookup in ID-to-address map. And also for the journal:   _j-a_ There is a current node (like current working directory in a shell + file-system setting). The journal contains entries like "create new node and connect to current", "connect first child of current node" (relative IDs)   _j-b_ Journal uses absolute IDs, e.g. "delete edge 7 -> 5", "delete node 5" I could e.g. combine _g-a_ with _j-a_ or combine _g-b_ with _j-b_. In principle also g-b and j-a should be possible. [My first/original attempt was _g-a_ and a version of _j-b_ that uses addresses, but that turned out to cause severe restrictions: nodes cannot change their addresses (or journal would have to keep track of it), and using journal between two sessions is a mess (or even impossible)] I wonder if variant _a_ or variant _b_ or a combination would be a good idea, what advantages and disadvantages they would have and especially if some variant might be causing troubles later.


Who should do code reviews?

In my company mostly the architect does code reviews. He is a very experienced and smart software guy, so he is very good at it. When developers do the code reviews they don't do it half as well. We tried giving developers to do more code reviews, but the quality of the code reviews wasn't good. We use Scrum for as development methodology. However with the current system there are two problems:   1. The architect becomes a bottleneck    2. Developers don't take the responsibility for the quality of the code and the architecture (which leads to all sorts of problems). How can we address these issues? Should we change who does the code reviews?


How do we keep dependent data structures up to date?

Suppose you have a parse tree, an abstract syntax tree, and a control flow graph, each one logically derived from the one before. In principle it is easy to construct each graph given the parse tree, but how can we manage the complexity of updating the graphs when the parse tree is modified? We know exactly how the tree has been modified, but how can the change be propagated to the other trees in a way that doesn't become difficult to manage? Naturally the dependent graph can be updated by simply reconstructing it from scratch every time the first graph changes, but then there would be no way of knowing the details of the changes in the dependent graph. I currently have four ways to attempt to solve this problem, but each one has difficulties.   1. Nodes of the dependent tree each observe the relevant nodes of the original tree, updating themselves and the observer lists of original tree nodes as necessary. The conceptual complexity of this can become daunting.   2. Each node of the original tree has a list of the dependent tree nodes that specifically depend upon it, and when the node changes it sets a flag on the dependent nodes to mark them as dirty, including the parents of the dependent nodes all the way down to the root. After each change we run an algorithm that is much like the algorithm for constructing the dependent graph from scratch, but it skips over any clean node and reconstructs each dirty node, keeping track of whether the reconstructed node is actually different from the dirty node. This can also get tricky.   3. We can represent the logical connection between the original graph and the dependent graph as a data structure, like a list of constraints, perhaps designed using a declarative language. When the original graph changes we need only scan the list to discover which constraints are violated and how the dependent tree needs to change to correct the violation, all encoded as data.   4. We can reconstruct the dependent graph from scratch as though there were no existing dependent graph, and then compare the existing graph and the new graph to discover how it has changed. I'm sure this is the easiest way because I know there are algorithms available for detecting differences, but they are all quite computationally expensive and in principle it seems unnecessary so I'm deliberately avoiding this option. What is the right way to deal with these sorts of problems? Surely there must be a design pattern that makes this whole thing almost easy. It would be nice to have a good solution for every problem of this general description. Does this class of problem have a name? * * * Let me elaborate on the troubles that this problem causes. This issue pops up in various places, whenever two parts of a project operate on graphs, with each graph being a different representation of the same thing that changes while the software is running. It's like making an adapter for an interface, but instead of wrapping a single object or a fixed number of objects, we need to wrap an entire graph of arbitrary size. Every time I try this I end up with a confusing unmaintainable mess. The control flow of observers can be difficult to follow when it gets complicated, and the algorithm for converting one graph to another is usually tricky enough to follow when its laid out plainly and not spread across multiple classes. The problem is that there seems to be no way to use just a plain, straight- forward graph conversion algorithm when the original graph is changing. Naturally we can't just use an ordinary graph conversion algorithm directly because that can't respond to changes in any way other than starting from scratch, so what are the alternatives? Perhaps the algorithm could be written in a continuation-passing style where each step of the algorithm is represented as an object with a method for each type of node in the original graph, like a visitor. Then the algorithm can be assembled by composing various simple visitors together. * * * Another example: Suppose you have a GUI that is laid out like you might in Java Swing, using JPanels and layout managers. You can simplify that process by using nested JPanels in place of complex layout managers, so you end up with a tree of various containers that includes nodes that exist only for layout purposes and are otherwise meaningless. Now suppose that the same tree that is used to generate your GUI is also used in another part of your application, but instead of laying the tree out graphically it is working with a library that will generate an abstract representation tree as a system of folders. In order to use this library, we need to have a version of the tree that doesn't have the layout nodes; the layout nodes need to be flattened into their parent nodes, but the library still needs to be notified each time the tree changes as though the two versions of the tree were a single data structure. * * * _Another way to look at it:_ The very concept of working with mutable trees violates the Law of Demeter. It wouldn't really be a violation of the law if the tree were a value as parse trees and syntax trees normally are, but in that case there would be no problem since nothing would need to be kept up-to- date. So then this problem exists as a direct result of violating the Law of Demeter, but how do you avoid that in general when your domain seems to be about manipulating trees or graphs? The Composite pattern is a wonderful tool for turning a graph into a single object and obeying the Law of Demeter. Is it possible to use the Composite pattern to effectively turn one kind of tree into another? Can you make a Composite parse tree so that it acts like an abstract syntax tree and even a control flow graph? Is there a way to do it without violating the single responsibility principle? The Composite pattern tends to cause classes to absorb every responsibility that they touch, but perhaps it could be combined with the Strategy pattern somehow.


How can you demonstrate scalabity and load balancing property of a cloud application on Windows Azure?

For my project I want to develop an web application with Windows Azure as the platform using C# language. The idea is to host the website of a University on the cloud. Whenever it announces the resutls online there is a spike and the cloud will handle the peak usage with its scalabilty and load balancing properties and deploy necessary resources. However since all of this is handled by Azure internally there is no way of demonstrating it in our project. Is there a way where we can specifically implement something to demonstrate it to the evaluator? A virtual way perhaps...


Best resources to really understand run-time complexity

I'm familiar with the basics of run-time analysis such as what makes certain types of code O(n) and O(n^2). But I'm having real trouble learning, understanding, and really remembering how to analyze pieces of code that run in other complexities such as O(n log n) or O(2^n). I'm looking for resources that explain in simple terms how these other complexities work and some practice problems to really force my understanding.


Where can I find statistics on worldwide developers and software companies?

I try to find an answer of a very difficult question. The question is: > How many developers and how many software companies are there in the world? For example if I check the Statistic Austria page I can see that in Austria there are 8383 companies with 35522 employees defined as "Computer programming, consultancy and related activities" and another 4102 companies with 15171 employees defined as "Information service activities". This statistic is good, but it is only for Austria. Is there a similar for Europe, USA, Worldwide?


JavaScript (jQuery) And CSS Styling

Lets say I am building a jQuery plugin that has a number of non-configurable css attributes it needs to apply to DOM elements the plugin itself creates. Is it consider better practice to apply the css directly in the javascript code or is it better to create a css file and just include both the css and javascript files? I have always been under the impression that is would be better to have the css file just because it seems a bit cleaner and you don't really gain much from having everthing in the javascript code. I mean the size of the css + javascript files would probably be about the same as if you had applied the css through javascript so the only thing you gain is that you only need to request 1 resource file instead of 2 if you apply the css in javascript. I am just curious as I an building a number of jQuery plugins and I have noticed some other plugins that are embedding a lot of css in the javascript instead of a css file.


What is "Scalable Integrated Systems"?

I've come across a job posting that asks for experience with "Scalable Integrated Systems", but honestly that sounds like "generic buzzword," and I'm trying to figure out what the actual work behind "Scalable Integrated Systems" is. What does a "Scalable Integrated System" look like? Is it making distributed computing software? Is it writing APIs between services in a way they "scale", and if so, scale in what way? I don't understand what a Scalable Integrated System is. The company seems competent and I have competent programmer friends working there who say they are a great place to work in. If it was SpammyCoOnCraigslist@yahoo.com, I wouldn't bother asking.


concurrency semantics reading a file being written (ext)

In Ext 3/4 filesystem, if I have a log file open and being appended to, if another process tries to read it (e.g. with `cat`), what happens?   1. Can the reading process read part of / an incomplete write?   2. Is reading-during-writing safe and won't disrupt the writing process? Or is there a chance the logs can be corrupted by doing this? Where should one read more?


How to productively spend "free time" at the office

After shipping a release, once in two to three months, I get 10 to 15 days of free time. By free time, I mean no work, no one cares what you are doing etc., but you have to come to the office and go. Do you get free time like that? How do you utilize this time? I tend to read, but I feel cramming more and more information is not the best way to spend it.


Too much free time in work place

> **Possible Duplicate:**   >  How to productively spend "free time" at the office I am a Coldfusion Web Developer. I recently changed a company so that I can relocate to a different state. The current project I have is just a backup position for 3 months. I am not having much work, and the work I have also has nothing to do with programming. How do you other programmers generally make use of so much of free time? (I am going to stay here for another two months though)


Should I encrypt data in database?

I have a client, for which I'm going to do an Web application about patient care, managing patients, consults, history, calendars, everything about that basically. The problem is that this is sensitive data, patient history and such. The client insists on encrypting the data at the database level, but I think this is going to deteriorate the performance of the web app. ( But maybe I shouldn't be worried about this ) I've read the laws about data protection on health issues ( Portugal ), but isn't very specific about this ( I just questioned them about this, I'm waiting for their response ). I've read the following link, but my question is different, should I encrypt the data in the database, or not. One problem that I foresee in encrypting data, is that I'm going to need a key, this could be the user password, but we all know how user passwords are ( 12345 etc etc ), and generating a key I would have to store it somewhere, this means that the programmer, dba, whatever could have access to it, any thoughts on this? Even adding an random salt to the user password isn't going to solve the problem since I can always access it, and therefore decrypt the data.


Java class version specific naming conventions

I have to create an Adapter between two software (mech. simulation, non-cs). Assuming we have a class named `ThatThing`. I have to handle various vendor specific implementations. These versions don't have meaningful names (unlike eclipse helios, indigo etc.). **1\. How should I name a class that should express version number?** I find class like `ThatThing_3_6_Impl`, `ThatThing_3_7_Impl` quite awkward.


Google Native Client - The end of client/server side programming?

As some of you may know already, Google Native Client is going to be released with Chrome 14. Google native client is a technology that allow us to run native code(C, C++) on the web. (Cross-browser). I heard it's pretty secure as well. Is it the end of client/server side programming? The end of javascript, php, asp.net, ruby, jsp etc.??? It seems google native client has the potential to change the game. What do you think?


How do I predict the time it will take to complete a task?

There are three scenarios where I am asked to predict how long it will take: >   1. I know I can solve the problem without further consultation of anything > (that is, there is no _unknown_ in the problem. I already have all the > knowledge to solve the problem) >   2. I know the problem can be solved but I need to do a lot of > experimentation to see how things work (for example, you may know a car tire > is easy to change, but if you have never changed it, you may run into issues > that you will avoid/correct the next time around, thus making your > _prediction_ of how long it will take, better... yes, this I know is one of > the answers to my question here... experience) >   3. I am told the problem can be solved, but I have no idea where to begin > so I start breaking it down into small pieces and go to Step 2 (where I know > it can be solved, but needs experimentation) > I am generally bad at predicting how long something will take even if I have done something _similar_ before. I always run into a snag I did not foresee. My question is mostly directed towards Point 1 and somewhat toward Point 2 (in Point 3, I know my predictions will always be wrong). I know that it requires experience, which will allow me to do good predictions but there _has_ to be some basic _rules_ I can follow to at least start making somewhat accurate predictions. Right now I feel like I will never be able to make good predictions, no matter how much experience I gain. One rule that I have heard is something along the lines of `predict how long it will take, then multiply it by 2, then add two more weeks` (more of a joke... or maybe not?) Now I know that predicting how long a task will take is a general problem in the industry, but people still predict to some extent and can't always be wrong (specifically on smaller tasks). In my case, if somebody tells me `How long do you think a linked list with these features will take?` I will give a wrong prediction even though I know how to make one without consulting any body/book. > **So my request is to SO (especially veterans in the industry) is to give me > (us) pointers on how to get better at predicting how long a task will > take.** **Background** I am currently a Masters student working at a company. I am very young in terms of industry experience and experience in general. I am reading lots of books on better programming, design etc. (most of them recommended here at SO) and my knowledge of programming is ever increasing thanks to work/school and SO; but of course, there is literally _tons_ more that I need to absorb.


What performance topics should I be aware of?

When coding performance-critical portions of code (not necessarily large, but code that gets executed a lot), what topics should I be aware of/take into account. I'm already fairly familiar with caching, aliasing, branching, cost of arithmetic operations, loop unrolling (and I guess some others that don't come to mind). What else should I know? (not necessarily looking for details, just concepts I can look up on my own)


Does it make sense to create a Ruby wrapper to reference a Java object that does exactly the same thing?

I am using `JRuby`. In my `Java` code, I have a class called `Texture`, capable of doing some graphic manipulation stuff. In my `Ruby` code, I will usually need to draw things, so though I should simply call `Java`'s `Texture` class to do the drawing for me. However, I ended up making a `Ruby` class called `Texture`, **which wraps an instance of`Java`'s `Texture`**. Somehow like this (just an example, but rather accurate):               class Texture         def initialize             @reference = getMeAnInstanceOfAJavaTexture         end         def draw             @reference.draw         end         def rotate             @reference.rotate         end         def clear             @reference.clear         end     end      As you can see, all this `Texture` class does is... well, tell a `Java` `Texture` to do the job for it. Just that. Subconsciously, I think I wanted to do it this way **because it looks pretty** (lol). Now, getting a bit more technical, a possible advantage I see is that **this way I don't have to interact much with the`Java`-side of the project**. Most of the work I will do will be in `Ruby`, and maintaining a constant interaction between `Ruby` and `Java` can be confusing. If I make a `Ruby` class that handles this stuff for me, I might feel more comfortable in the future when I have to make like a hundred textures, but instead of interacting a hundred times with `Java`, I do it with `Ruby`, my main environment. Does my reasoning make sense or is it a lame excuse to do something that looks pretty? Or perhaps there is indeed a good reason to do what I just did?


How do you keep track of a requirements document on an agile team?

I understand that User Stories dominate the agile world, but how are these artifacts stored, so that new developers who join the team can come up to speed with the requirements? What if the User Story changes later, how is it updated and kept as an artifact? I've seen many teams just open a new ticket/feature request/bug report instead of keeping track of the original story.


Are we using the repository pattern right?

We are using a bunch of separate classes suffixed with `-repository` to retrieve the data from the database; for each table its own repository. We have for instance a `customerrepository` class which has all kind of methods to retrieve customers, and a `vacancyrepository` which has all kind of methods to retrieve vacancies. I have two questions about this way of doing things:   1. How about getting data which spans multiple tables? For instance I have a screen which shows all customers who have not yet created a vacancy. Can a `customerrepository` use methods from the `vacancyrespository`, or do both repositories return results and is there a class higher in the hierarchy (let's name it a `dataservice`) which gets the results from both repositories and combine them into 1 result?   2. how much logic can such a repository handle?   I think it's OK to implement the 'where active == true' in a repository to retrieve only active records, or should even that simple logic be handled by a class higher in the hierarchy (let's name it a `dataservice`)? The example I was running into now is this one: We have a questions list, which contains one or more questions.   The question can have a result, which is hold in a separate table.   So when you want to retrieve the total result of the questions list, you have to combine data from the `questionlist` table, the question table and the `questionstatus` table. Right now we have 3 different repositories for these tables. If I would ask the `questionlistrepository` what it's the total result for list number 12, it would have to get data from two other repositories and hence have some logic in it, is that allowed? Or is there a `questionlistdataservice` which knows which repositories to use? One more thing: our repositories can result an `IQueryable` so a calling service can easily combine the results, but how about when this isn't the case, I don't think it's a good idea to retrieve all the content of all three tables from the database.


Deriving an algorithm from its neural network representation

I am not sure if this question is silly or not, or even nonsensical, but can a neural network be converted to a traditional algorithmic representation ? For eg. the NN for a pattern recognition program. Is there any mathematical basis for this ? Thanks Cheers


Reusing values for segment variables when generating outbound URLs

When routes are matched to the _outbound URLs_ , the routing system will try to find values for each of the _segment variables_ in _route's URL pattern_ by also looking at the values from the _current request_. If necessary, routing system will reuse _segment variable values_ from the _incoming URL_ Excerpt is from _Pro Asp.Net MVC 4_ book: > The routing system will reuse values only for segment variables that occur > earlier in the URL pattern than any parameters that are supplied to the > Html.ActionLink method. Suppose we tried to create a link like this: > > @Html.ActionLink("Click me", "List", "Catalog", new {color="Aqua"}, null) > > We have supplied a value for color, but not for page. But color appears > before page in the URL pattern and so the routing system won’t reuse the > values from the incoming URL, and the route will not match. > > ... We strongly recommend that you do not rely on this behavior and that you > supply values for all of the segment variables in a URL pattern. By relying > on this behavior you end up making assumptions about the order in which your > users make requests Note: the route to which the excerpt is referring to is defined as :                routes.MapRoute("MyRoute", "{controller}/{action}/{color}/{page}");      a) > The routing system will reuse values only for segment variables that occur > earlier in the URL pattern than any parameters that are supplied to the > Html.ActionLink method What could go wrong if routing system also reused values for _segment variables_ that occur later in the _URL pattern_ than parameters supplied to `Html.ActionLink`? b) > We strongly recommend that you do not rely on this behavior and that you > supply values for all of the segment variables in a URL pattern. By relying > on this behavior you end up making assumptions about the order in which your > users make requests I don't understand how not supplying values for all _segment variables_ translates into making assumptions about the order in which users make _requests_?! Much appreciated


Randomness in Acceptance-Tests

I've got a simple authentication solution, where a user can log in with either email or username. Since I want to show the little feature in the acceptance tests but don't want to pollute them, I thought I'll introduce some randomness. Do you think this is bad or good?               step "Fill in my credentials" do         fill_in :user_login, with: [@user.email, @user.name].sample         fill_in :user_password, with: @user.password     end


Draw graph of a function whose characteristics are unknown

Suppose I have a function. I have code that, given an x value, produces a y value. I can assume that the function is somewhat mathematically sane, not something crazy like an everywhere-discontinuous function or the like, but beyond that, I don't know anything about it. I want to draw a graph that is likely to make sense to someone looking at it. My boundaries for x and y values are fixed. Obviously, I can put in a bunch of x values, get the corresponding y values, and play connect the dots. But that will produce misleading answers in some cases. For example, the graph of y=1/x has a discontinuity at x=0. If I play connect the dots, and zero does not happen to be one of my input x values, I'll draw a line across the discontinuity, instead of having y go up to infinity as x approaches zero from above, then reappear from minus infinity for slightly negative x. It seems that I might want to be suspicious whenever the direction of change of the y values reverses itself. In other words, mistrust apparent peaks and valleys; look at some more points to see what is really going on. But that could fail, too; consider the function y=100x+1/x. Now, unless my sample points get very close to zero, I will still miss the asymptote. Someone must have studied this problem. Is there any relevant literature? If so, where?


How do you split work on web apps?

About a year ago at my workplace we decided to get into developing a web app for internal use (as part of a more intricate system which is irrelevant to this question). No one really had experience in web development, so probably some of our decisions were wrong, but all in all we've had success with the tool we were developing. Since we did have experience developing in Python, we chose Django as our platform. My question is about "who does what". The way we split our work was: there is one team which handles all the Python code - which means all the Django urls, views and models, as well as the actual backend to handle asynchronous task execution (something a bit like Celery). A different team (more precisely, a single person in a different development group - but this is just implementation) is responsible for the templates (data binding), javascript, design, HTML, CSS, etc. We have been working like this, as I said, for about a year now. I'm starting to think that maybe the line of responsibilities between the two teams is wrong. The reason is that there's a pretty big overhead whenever we need to interact - which is a lot. For example, when we add a new table and we want to display it, we need to let the "frontend guy" know what the url would be and what it would contain. Then we need to integrate out work to see if everything's alright. Sometimes we didn't pass enough context to the template to make it work and there's a slow ping-pong of information between us. So my question is this - what is the accustomed way to split work on web apps? Who takes care of the different modules - models, views, urls, templates, design, user experience, HTML, CSS, javascript?


Bayes filtering and data storage with expansive data sets

I am looking to write a Bayes filter that will act as an indicator of topic for a number of topics with a variable number of sources. Given a really big number of RSS feeds and here really big might only be a few hundred only few percent (let's say 2%) are interesting to a given group. What I want to write (in PHP) is a filter I can train to say this is Topic X and this is not. Then I want selected users to be able to further train the filter. But I want to use only the base training for picking topics to mark as interesting for Topic X and then refine that collection based on the training the user has provided to give the most interesting results for that user by reassessing the probabilities including the user supplied training on the short list per user. Or maybe scoring the short list and picking the "best" items to show first. So over time I am going to gain a fairly large collection of data (all of the headlines and blurbs from hundreds of feeds) and I am going to have flagged the feed items "yes" and "no" on an unspecified number of topics and have had users have likewise done so. The headline and blurb will be stored for easy display later but I don't want to hold on to too many items that are "no" (up to 98% I imagine). Given I go with, say, this implementation from GitHub that I found earlier today https://github.com/benwaine/BayesPHP (or can be talked into rolling my own) what is the most efficient way to go about storing the data needed to carry out an assessment? Am I asking for trouble if simply try and store any news headlines etc flagged "yes" but store some sort of summary for the base "no" assessments and then just work it out on the fly each time storing the resultant "yes". The server I have to work with is already doing a fair amount and is not going to spare me much horse power for this. So balancing processing efficiency and storage needs what can you recommend?


Conception and design before coding: how much is this true?

I learned at school as well as I read everywhere else that a good development methodology needs conception and design before coding properly. That is not a new information even for a beginner programmer. However, I wonder if this a good advice because since I started developing in several programming languages I never succeeded to design and conceive everything since the start. I mean, I always melted design, conception and programming. Am I the worst developer in the world, or is the idea we learn at school just an old meaningless _religious_ dogma? How can we even conceive and design something we never experienced and programmed before? Is not that ridiculous? Does not programming lead the conception and design instead?


Is this an example of 'over engineered' or a good practice?

The code I've inherited has a design that I'm not familiar with (I'm still new to the world of programming). It is a .net project and there are 3 classes in question here.               public Class1     {         public void DoSomething()         {             Class2 class2 = new Class2();             string myValue = class2.GetSomeValuePlease();                 //why would I not do class2.MyClass3.GetActualValue();         }     }          public Class2     {         public Class3 MyClass3 = new Class3();         public string GetSomeValuePlease()         {             return this.MyClass3.TheActualValue();         }     }          public Class3     {         public string TheActualValue()         {             return "This is the value";         }     }      As you can see, all 3 classes are public. I don't understand why, using the example above, I would use Class2 at all? I could understand if within the `GetSomeValuePlease()` method there was some logic which affected Class2, but there isn't. Normally, I'd just go ahead and remove the Class2 method (GetSomeValuePlease) and call Class3 method (GetActualValue) direct from Class1, but, the developer I took over (who is not contactable) is wiser and more experienced than I. I have a _feeling_ this is just over engineering and this is just extra code / extra maintenance. Does any one have experience in designing this way that could explain the thought process or implications of having this "middle class" vs going direct?


Image caching when rendering the same images on different pages

I'm told to think about caching of images that will be displayed on the page. The images will be repeated throughout the website on different pages and I'm told to figure out the best way to cache these images. There could be few to dozen of images on single page. Here's few questions:   * Will browser caching work to display the same images across different web pages?   * Should I rather store images in stringified form in a memory instead, using JavaScript arrays?   * Store them on hard drive using 'localStorage'?   * What would be easiest yet best option for this?   * Are there any other alternatives?   * How to force cache? Any other information would be greatly appreciated...


Handling stylesheet from a real programming language

Lately I've been playing with CSS (and other web technologies). I'm a non-web programmer, and probably this is influencing way too much my approach. I found CSS syntax very limited, thus gave a shot to SASS and LESS (mostly the latter). These two languages are a lot more handy, but I'm still getting into several issues: it looks like these languages don't allow me to do most of the things I'd like to do. I have the feeling that these languages aim to be as unobtrusive as possible, remaining very close to CSS and having a very little understanding on what's happening; the result is a kind of weird mix between a macro processor and a declarative language. For instance, some of the things that are giving me headaches in LESS are:   * The lazyness of the language makes it quite difficult to understand the execution flow (and to foresee whether something is defined and what its value is)   * CSS properties cannot be accessed, you are forced to rely on LESS variables   * Scoping is somehow unclear (probably because of the laziness and of the way mixins are extended)   * If you don't pay a lot of attention, the result tends to be suboptimal, with a lot of dublication etc   * The syntax is not very nice: I dislike using @ for variables, @{} for variable class names,  I believe that a better solution might be to generate CSS from a real programming language (with a well known syntax and a load of functions available) that keeps track of all the properties of every selector and where my logic is executed sequentially. Here I'll try to sketch an example of what I've got in mind; I'm using JavaScript and an approach inspired by jQuery:               var x = new CSS('HTML5');     // `x` is my Style it started off from the default HTML5 CSS stylesheet.     // `x(selector)` will allow us to access the style of the `selector` CSS selector.          x.import('file.css'); // let's import some more rules          console.log( x('a').fontSize ); // Prints the default font-size property for 'a' elements          x('.myClass > p').display = 'block'; // CSS: .myClass > p { display: block; };          var c1 = x('body > div .class1'); // Just for commodity...     c1.width = x('.class2 > div').width; // Cannot be done in CSS/LESS/SASS :(     // It should fall back properly, of course, or give error if that property is not found          x('.class3').set( c1.deepCopy() ); // Bringing in nested selectors     x('.class4').set( c1.copy() ); // Only copying properties          // Introspection! F**k yeah!     c1.forEachProperty( function(property){ ... } );     c1.forEachChild( function(selector){ ... } );     c1.forEachDescendant( function(selector){ ... } );     x.forEachElement( function(selector){ ... } );          var c1Rule = c1.generate(); // Generating the CSS rule for a specific selector          x.delete('.class1'); // We no longer need/want `.class1` in our stylesheet     x.deepDelete('.class1'); // Removing also its nested selectors          // Let's now generate our final stylesheet.     // The `generate` function might take care of optimizing the stylesheet.     var stylesheet = x.generate();      * * * Tl;dr: I'd like to handle a stylesheet as if it was a database queryable from a real programming language. Now, I'm wondering:   * Is there any to generate CSS similar to this idea?   * Do you think such an approach would work?   * What disadvantages would this approach have with respect to CSS/SASS/LESS?


Algorithm to match timestamped events from two sources

I have two different physical devices (one is camera, one is other device) that observe the same scene and mark when a specified event occures. (record timestamp) So they each produce a serie of timestamps "when the event was observed". Theoretically the recorded timestamps should be very well aligned: Visualized ideal situation on two time lines "s" and "r" as recorded from the two devices: ![Visualized timestamps of events in ideal conditions](http://i.stack.imgur.com/VJALZ.png) but more likely they will not be so nicely aligned and there might be missing events from timeline s or r: ![Visualized timestamps of events in real world conditions](http://i.stack.imgur.com/PFmVQ.png) I am looking for algorithm to match events from "s" and "r" like this: ![Matched events](http://i.stack.imgur.com/PKlrR.png) So that the result will be something like: (s1,null); (s2,r1); (s3,null); (s4,r2); (s5,r3); (null,r4); (s6,r5); Or something similar. Maybe with some "confidence" rating. I have some ideas, but I feel that this might be probably a well known problem, that has some good known solutions, but I don't know the right terminology. I am a little bit out of my element here, this is not my primary area of programming.. Any helps, suggestions etc will be appreciated.


Does Jquery basically use CSS3 for animation and effects?

I originally started out this question with "what is JQuery, and how does it work", in terms of all that fancy animation, effects, slideshow plugins, etc. I was uncertain as to how JQuery does all that fancy stuff. But after reading around on the internet, I am happy to acknowledge that JQuery is basically a "javascript library", and by that, I think it means that JQuery is pure text, of javascript code, consisting of public methods, functions, constants etc, with the idea that calling these simple methods or functions can replace loads of javascript code, and that its has a nice consistent feel to it. So am I right in saying that all that fancy animation, effects etc are not "actually" achieved by javascript/Jquery? They are achieved by using CSS3? And CSS3 is a style sheet language which the browser can understand, and has the capabililites of carrying out those stylesheet instructions? Very fuzzy and ambiguous question, I know, but just trying to get my head round how you get those amazing jquery animations etc


Doing Integration Testing, what would be a good way to provide test values from external sources?

I am building an Integration Testing Solution using Selenium in VS2012, which will be run on a CI server in the near future. I need to provide some way to vary the values being used for testing. The easiest would be to provide the QA testers with a few template spreadsheets, which they can fill in to run tests with those values (for example Log-In, Create new user, Create new Booking, Update Reservation etc). At this moment I have a Test project using NUnit, and another project that contains the test execution code using Selenium, with sample values hardcoded in workflows for each test. I have done some searching, but came up with no relevant results. I am either using incorrect terminology, or this has never been done (improbable, I know). Have you done this, or heard/read about someone who has? I'd like to not reinvent this particular wheel.


C Flexible Arrays: When did they become part of the standard?

I learned to program in C many years ago, and used C steadily for about 10 years. These days, I occasionally have to look at C code, because our Informix 4GL RDS customized runners also contain C code, but it is fairly simplistic code. When I was using C a lot, I never remember hearing about of flexible arrays. I am asking this question, because I came across this SO question. Thanks.


How do I check that my tests were not removed by other developers?

I've just came across an interesting collaborative coding issue at work. I've written some unit/functional/integration tests and implemented new functionality into application that's got ~20 developers working on it. All tests passed and I checked in the code. Next day I updated my project and noticed (by chance) that some of my test methods were deleted by other developers (merging problems on their end). New application code was not touched. How can I detect such problem automatically? I mean, I write tests to automatically check that my code still works (or was not deleted), how do I do the same for tests? We're using Java, JUnit, Selenium, SVN and Hudson CI if it matters.


Teaching logical/analytical thinking

I have been trial running a club in which I teach programming for the past year and while they have progressed what they really lack is the most fundamental concept to programming, analytical thinking. As I now approach the second year of teaching to the children (aged 12 - 14) I am now realising that before I begin teaching them the syntax and how to actually program an app (or what they would rather, a game) I need to introduce them to analytical thinking first. I have already found Scratch and similar things such as Light-Bot and will most certainly be using the, to teach them how to _implement_ their logical thinking but what I really need are some tips or articles on **how to teach analytical thinking** itself to children aged 12 - 14. What I'm looking for are some ideas on how to teach the kind of thinking that these kids will need in order to get them into programming, whether that be analytical, logical or critical. **How and what should I teach them** relating to the way their minds need to be wired when programming solutions to problems?


MIT License in a referenced library: legal implications?

I'm trying to determine what my legal obligations are if I use an MIT-licensed library (JAR file) in my program. Do I need to include the library's source code when I distribute my program? Do I need to include a README explaining the licensing of the packaged JAR? If I'm simply including the unedited JAR file, do I even need to include anything additional?


How to identify a PDF classification problem?

We are crawling and downloading lots of companies' PDFs and trying to pick out the ones that are Annual Reports. Such reports can be downloaded from most companies' investor-relations pages. The PDFs are scanned and the database is populated with, among other things, the:   * Title   * Contents (full text)   * Page count   * Word count   * Orientation   * First line Using this data we are checking for the obvious phrases such as:   * Annual report   * Financial statement   * Quarterly report   * Interim report Then recording the frequency of these phrases and others. So far we have around 350,000 PDFs to scan and a training set of 4,000 documents that have been manually classified as either a report or not. We are experimenting with a number of different approaches including Bayesian classifiers and weighting the different factors available. We are building the classifier in Ruby. My question is: if you were thinking about this problem, where would you start?


Dealing with engineers that frequently leave their jobs

My friend is a project manager for a software company. The most frustrating thing for him is that his **engineers frequently leave their jobs**. The company works hard to recruit new engineers, transfer projects, and keep a stable quality product. When people leave, it drives my friend crazy. These engineers are quite young and ambitious, and they want higher salaries and better positions. The big boss only thinks about it in financial terms, and his theory is that “ _three newbies are always better than one veteran_ ” (which, as an experienced engineer, I know is wrong). My friend hates that theory. Any advice for him?