Do you use code names for your projects?

Pretty much every CPU has some internal code name before it is released to the public (and even after it hangs on). But what about software projects? Are those usually code named? Do you code name your projects?


Is programming experience useful to become a Business Analyst?

Is programming experience important to become a BA? I have an opportunity to switch from programming to BA in IT, but I am not sure what to do. In the future, I want to proceed as BA only. Does programming experience really matter in such a role? I have graduated in Computer Science, but have just 6 month of programming experience


Beyond Syntax Highlighting - What other code representations are possible today?

Despite GUI applications having been around for 30ish years, software is still written as lines of text instructions, for various valid reasons. But we've also found that manipulating these text instructions is mind-blowingly difficult unless we apply a layer of coloring on different words to represent their syntax, thus allowing us to quickly parse through these text files without having to read the whole words. But besides the Sublime Text minimap feature, I've yet to see any innovation in visual representation of code since colors came around on CRT monitors. I can think of one obviously essential representation that modern graphics technology allows: visual hierarchies for nested structures. If we make nested text slightly smaller than its outer context, and zoom on it when the cursor is focused on the line, then we will be able to browse huge files of nested statements very quickly. This becomes even more essential as languages based on closures and anonymous functions become filled with deep statements. Has anyone attempted to implement this in a text editor? Do you know of any otherwise useful improvements in representing code text graphically?


What should I name this helper class?

Usually when writing unit tests I create a helper class with extension methods. I use these methods exclusively for generating generic data for things that I am too lazy to type out. I usually name these classes something relevant to the class under test - for example, I'll follow a pattern like TestHelper.cs. I've read that helper classes don't promote good design; however I know SOLID principles pretty well and I don't see how using "helpers" in the way described is violating any principles. I think the issue I'm having is with the name of my "TestHelper" ... Should I simply come up with a new naming scheme or am I really violating a SOLID Principle by utilizing these helpers?


Web framework for iPad and common desktop browsers?

We are developing a web-based, commercial point-of-sale application. We'd like the same web site to work well on an Ipad as well a desktop browsers. We're looking for a web framework that makes the site look good on an iPad, but also makes the site work well in a desktop browser such as Chrome, IE, or Firefox on Windows or a Mac. I found quite a few at 18 mobile frameworks and development tools for creating iPhone Apps Most of them, such as jQTouch, help a web site look and act more like a native iPhone application but they don't emphasize the cross platform/browser experience. The exception seems to be Sproutcore, which seems to be a full-fledged JavaScript MVC application framework. I did have trouble getting some of the demos to work under Chrome, but what did work looks good. What framework(s) have you actually used to develop web sites to work on an iPad and desktop browser? If you didn't use a framework, how did you get it to work well under both environments?


Analysing Group & Individual Member Performance -RUP

I am writing a report which requires the analysis of performance of each individual team member. This is for a software development project developed using the Unified Process (UP). I was just wondering if there are any existing group & individual appraisal metrics used so I don't have to reinvent the wheel... EDIT This is by no means correct but something like: Individual Contribution (IC) = time spent (individual) / time spent (total) => Performance = ? (should use individual contribution (IC) combined with something to gain a measure of overall performance).... Maybe I am talking complete hash and I know generally its really difficult to analyse performance with numbers but any mathematicians out there that can lend a hand or know a somewhat more accurate method of analysing performance than arbitrary marking (e.g. 8 out 10)


Are there any A.I. resources that explain the concepts and present source code?

Are there any A.I. resources that explain the concepts and present source code, similarly to AI Horizon? I've read books and research papers but they generally present a conceptual approach, without really delving into the source code of it.


Learning python functions and parameters

def printMax(a, b):        if a > b:        print(a, 'is maximum')        elif a == b:        print(a, 'is equal to', b)        else:        print(b, 'is maximum')          printMax(3, 4) # directly give literal values     x = 5     y = 7     printMax(x, y) # give variables as arguments      I'm learning python via the byte of python book, and the author uses this example to introduce us to functions. When the author calls the function printMax, he does not use quotation for the numbers 3,4 i.e. he does not use printMax("3","4") which I thought was fine. However, later on he defines a function like so               def say(message, times = 1)        print(message * times)          say("hello", 3)      why does he use the quotations for the message (i.e. why does he use say("hello", 3) instead of say(hello, 3)? How does python notice the difference?


How do I evaluate if writing a book, article, or presenting at conference is worth it?

I'm trying to understand how I should evaluate writing a book, article, or conference presentation. Writing a book is a lot of work. Same for writing an article in a magazine or presenting in a conference. They need time and you may even make a mistake here and there that back fires (bad reviews, people calling you an idiot..) Also you do it for free (at least for magazine articles and conference presentations. For books you get something like a $5K deposit and you rarely get any additional sales royalties after that). So how should I evaluate the benefits? I would appreciate answers that call out if you have done this before. I may not write a book because it's way beyond what I'd like to commit time-wise, but should I bother giving conference presentations or writing shorter articles in magazines?


How to get out of supporting deadend sales pitches?

As part of being a programmer, you often are asked to provide estimates/ make slideware / do technical demos for Sales teams to present to end-clients. Sometimes we go along for the 'technical' discussions or 'strategic capability planning' or some similar mumbo-jumbo. Sometimes, you kind of know which ones are totally going to fail and are not worth pursuing but the Sales guys present fake optimism and extract 'few more slides' out of you or the 'last conference call'. These don't lead to anywhere and are just a waste of time from other tasks for the week. My question is how do you get out of these situations without coming across as non-cooperative. **Updated afterKate Gregory's answer:** The problem is related to projects we know are doomed (from the technical feedback we've received) But Sales ain't convinced since they've just had a call higher up the management chain - so it's definitely going ahead !


Preferred Scala code style for several embedded brace sets

I was wondering the correct way to format a situation such as this, where I have a def, a foreach and an if clause all nested, requiring braces. Currently I find it hard to read, and there is no obvious place to put the 'x =>' bit. Thank you.               def getAnswer(): String =     {       var sum = 0       (0 until 1000).foreach        { x =>          if (x % 3 == 0 || x % 5 == 0)         {           sum += x         }       }       sum.toString     }


How to get on the ladder - Java Development jobs

Ok so I've been out of university now for 7 years and in the same job as an application developer for a company that uses their own in house development languages/products. I've learnt a lot here but I should definitely be moving on now! In my time here I've dealt with hands on support, on site installation, training of customers, development of POC's (having to use a mix of technologies including Java and Python) and many other tasks. My main job however has NOT been Java oriented, although I'd say I do have a good deal of experience in it from my own personal projects. I am aware that this might reflect badly on my CV so I have spent a number of months adding professional certs to my resume, these include.   * Sun Certified Java Programmer 6   * Oracle Certified Expert, Java EE 6 JSP and Servlets Developer   * Oracle Certified Exper, Java EE 6 Enterprise JavaBeans Developer I also plan to take the core spring training, shortly followed by taking the springsource certified spring professional exam. I'm not entirely sure how to structure my CV? Restricting myself to two pages is quite difficult especially seeing as mentioning my career history is obviously a big part (I currently have 3/4 of a page which mentions, job title, brief description of company I work for, what my duties include and some of my achievements, Java has a brief mention). Any advice for what I should do? Ideally if I get my foot in the door for an interview I'd be looking to start on a salary of about 35k (I'm in the UK) which is only a few k more than I'm earning currently. I'm posting this as anon because I'm aware of leaving a trail for potential employers, plus I'm disappointed in myself for staying here so long. EDIT: Forgot to mention I was in the UK, so that's £35k not $35k so in USD that's closer to $55k Edit2: Not in London, Bristol


Secure cloud based code storage and syncing across multiple computers

I've been thinking recently about how and where I keep my code - I work across multiple locations, with at least three different computers and I'm considering how I manage my code across these machines. I've got a dropbox account, which I use. For non sensitive files this is fine, and I do keep some sensitive files in there, but in a TrueCrypt file - this won't work large scale as the entire TrueCrypt file would need to be uploaded for any change. I don't feel safe putting my, or my employers, code on DropBox because of several security issues and news that they can access everyones' files. I have a github account where I store my code (open and closed source), but I don't want to have to always push up to GitHub, also I work a lot on the train so I can't push as I don't have a stable data connection and chances are that I'll forget to push or grab data at some point and then I'll be stuck! So - with that in mind, I'd like a discussion about storing code in the cloud:   1. Is keeping source code in the cloud dangerous?      * I understand the implications of keeping employers code in the cloud, but are there alternatives, given that a good number of VPN/RDC solutions that I've used are slow to the point of unusable? (this may be a point against my/my employers network speeds rather than the actual programs - but it's a impediment)   2. Is there a good cloud based service with good encryption, good uptime, diff, auto sync?      * Is there one aimed solely at developers? If not, does anyone want to start one with me? (joking but at the same time, it could be a good business venture - drop me a line if interested)   3. What do you use? Does it work? how would you change it?


Why have a method that returns a bool/int and has the actual object as an output parameter?

I see the following code pattern all over the place in my company's codebase (.NET 3.5 application):               bool Foo(int barID, out Baz bazObject) {          try {                  // do stuff                 bazObject = someResponseObject;                      return true;         }         catch (Exception ex) {              // log error             return false;         }     }          // calling code     BazObject baz = new BazObject();     fooObject.Foo(barID, out baz);          if (baz != null) {          // do stuff with baz     }      I'm trying to wrap my head around why you would do this instead of having the `Foo` method simply take the ID and return a `Baz` object, instead of returning a value that isn't used and having the actual object be a ref or output parameter. Is there some hidden benefit of this coding style that I'm missing?


How to fetch commit messages from bitbucket for project manager to see

Is it possible to fetch commit messages from bitbucket via json or something so that a project manager can see what the changes are without having to look at the code. If it's possible can you give me some ideas on how to do it.


Good practices for packaging Python programs

I've been using Python for a while now, both in the context of personal and professional projects. One thing that occured to me recently is that I had never thought about a good way to deploy Python programs. Basically, since it's mostly a bunch of scripts, I usually just copy them to the machine where I want it deployed and _voila_ ! But I believe there should be some good practices as to how you should deploy Python projects. I've heard about Python Eggs but not familiar enough with it to see if it's a good choice. Or a plain old _tarball_ with a bunch of Shell scripts to run the core module scripts? Basically I'd like to be able to do a nice, elegant and self-contained deployment, and not just copying files here and there, as it doesn't allow version tracking easily and it's quite messy.


How does agile work when replacing a working system?

In an ideal Agile world, you quickly build a small, but useful subset of the desired end system, and give it to users. They're excited, because it's useful, they start using it and give feedback. You then work out what to add on to it, build that, and repeat until you run out of time. I've had a couple of projects recently that involved replacing some kind of working system. The above model just didn't work at all: until you'd built a system that included virtually all the functionality of the existing system, users had no interest at all. They wouldn't use it. How do you apply Agile when "the smallest useful subset" is "all of it"?


I have to run certain number of statements (which are executing .exe) in a loop.                ForEach(object obj in ListOfVersions)         {           Step 1: call Exe1 Args=obj.somevalues           Log Step 1 completed for obj                Step 2: call Exe2 Args=obj.somevalues           Log Step 2 completed for obj                Step 3: call Exe3 Args=obj.somevalues           Log step 3 completed for obj         }          Step 4: call Exe4      Is there any specific design pattern available to use for above situation.


Typical agreements for freelance development?

I am just starting out my programming career and I have a chance to bid on a freelance job. I have looked over the specifications for the app and believe I am capable of meeting the requirements satisfactorily. I have worked on a team developing 2 different apps for the same platform , as well as one app I wrote for a friends business (for pay but it was informal) and all of the stuff I have done for personal use/school so I believe I can estimate fairly accurately how long it will take me. However I have no clue about how these things work in the real world. I have only been finished school for less then a year and I have only had 2 short- term developer contracts. Specifically:   1. Payment: what is usual? Payment on delivery? Payment upfront? Percentage upfront?   2. Sourcecode: I understand that I would need to give them the source code but what about previous librarys which I have made. If I use those in the project would they then belong to the client as well?    3. How detailed should the initial contract be? What if the client changes their mind about details part way through.    4. I'm not really certain how to set a price (I would appreciate suggestions formulas). I assume that there must be some sort of industry standards for this sort of thing I'm just not sure what they are/ where to find them? I would really appreciate any advice on the subject, even if it is just links to other resources. If it matters both myself and the potential client are located in Canada.


Good practices to write Tags at SVN

Tags are a vital part at Version Controlling for example SVN.   * When should i write Tags at SVN?   * What information should have a Tags?


How to detect two moving shapes overlapped?

Given a list of circles with its coordinates (x and y) that are moving every second in different direction (South-East, South-West, North-East and North- West), and the circle will change direction if it hits the wall sort of like bouncing, so how do we detect if any of them collide or overlap with each other ? I am not sure if we can use some data structures like a `Binary Search Tree` because since all the coordinates vary every seconds, so the tree will have to re-build accordingly. Or can we use Vertical Sweep Line Algorithm each time ? Any ideas on how to do this in a efficient way ?


How easy is it to alter a browser fingerprint?

I am researching this question for a possible paper. Given the exploitation of user identities for risk management and market tracking, how easy is it to alter a browser enough to throw off fingerprinting techniques? My current sources are:   * EFF Panopticlick project   * Peter Eckersly's follow-up presentation at Def Con 18.


Cheat notes for telephone interview (.NET /DBs, OO)

I am preparing for a telephone interview. I am thinking that instead of trying to memorize SOLID or ACID for example I could have some cheat notes ready. So:   1. Any tips on how to organize them?   2. Where to find material for .NET, OO, DB (Both Oracle and SQL Server). It should be easy to find/read the information by looking at the paper/screen, also I need some way to look it up. (Cheat Sheets in IT context seems usually to be something else - like condensed information to keep next to you while you are working.)


Is it possible to get formal recognition of self-taught knowledge?

I like many others have spent a few of my High School years teaching myself software development and various languages.   * I'm fluent in C++/C#   * Have a fairly solid understanding of Computer Science and Computing Techniques.   * I _don't_ have any worthy projects to display because I have a bad habit of stopping them before they're presentable in pursuit of newer, more exciting projects; **But if you asked me to sit down and solve a problem I could do it easy.** * * * **Is there any way to get formal recognition of all the time I've spent watching online lectures / tutorials, actually coding, and researching?** * * * It would be nice to have something I can actually put on my college application!   _I just want to show that I havn't just been sitting around playing Video- Games all day._


Polymorphism and passing

I am writing a text based RPG, and I have three classes that inherit from a super class, they all have special attacks that they can perform, at the same time I have a class that holds the function which handles battles in my game. Now how do I get the unique special abilities functions for whatever role the player chooses into the battle function? Also I am using the vector.push_back method to handle how my sub classes are referenced.


What is a good Scrum management software for a Scrum newbie?

I want to practice Scrum on a personal project and I'm looking for Scrum management software. I've tried Jira + GreenHopper, but it has some limitations - limited nesting of user stories in particular. It's also a bug tracker at its core. I'm looking for something built for Scrum from the ground up so I don't go down too many blind alleys. As a newbie to Scrum and as a learning exercise, what software would you recommend?


Best practices when managing long running asynchronous jobs

I am in the design phase of a project where the end user will submit a request from a web page that will spawn a long running asynchronous processed job. Is there a "best practice" for this problem? Are web services and service brokers a good way to go? Is Microsoft messaging queue applicable here?


switch statement - handling default case when it can't be reached

If I'm using a switch statement to handle values from an enum (which is owned by my class) and I have a case for each possible value - is it worth adding code to handle the "default" case?               enum MyEnum     {         MyFoo,         MyBar,         MyBat     }          MyEnum myEnum = GetMyEnum();     switch (myEnum)     {         case MyFoo:             DoFoo();             break;         case MyBar:             DoBar();             break;         case MyBat:             DoBat();             break;         default:             Log("Unexpected value");             throw new ArgumentException()      }      I don't think it is because this code can never be reached (even with unit tests). My co-worker disagrees and thinks this protects us against unexpected behavior caused by new values being added to MyEnum. What say you, community?


What do you want to see in a job offer?

Which information do you want to see in a job offer for programmers? In which order? What are the most important points for you?


Is it possible to access .NET APIs with JRuby?

I know that JRuby can access COM APIs, but can it interface with .NET?


What development process encourages frequent releases (rolling code to a live site), as well as developer individuality

Some quick background - we don't have PMs or upper management breathing down our necks about status of features, etc, as we almost always deliver ahead of time and have built up a high level of trust with them. In other words, we have a huge amount of flexibility as far as process goes. We do very well with our current process, but we feel there can be some improvement. We have a small team (3 devs, 1 tester) and everyone on the team is senior level and can deliver large pieces of functionality, and usually does so on an individual basis. Sometimes two people work on the same story/task, but since we are all very familiar with the codebase(s), we typically handle things by ourselves and consult/collaborate when needed. We roll to a live site and have the ability to roll on a daily basis, which someone on our team typically does. On average, I'd say an individual developer rolls his own code 3 times a week. We have been doing scrum with 2 week sprints, but from my experience scrum was more advantageous when we needed the majority of the team to work on the same features at the same time (swarm-type stuff), and when needing to communicate out to external teams. We currently don't have either of those needs, so we're re-evaluating our process. What it seems like we're moving toward is a model where each team member exists in his/her own sprint (with optional teammates being less common), which lasts anywhere from 1-3 days. We don't have a requirement that all sprints have to end on the same days, etc, so in theory we could pull this off. My question is, is there something better than scrum that models this type of development process? Oh, I almost forgot. We're moving away from TFS to use Git, and while I have experience with Git, most of the team members don't. Since it's a paradigm shift for some on the team, I'm wondering if we can use the change to our advantage somehow process-wise. Thoughts?


Should classes from the same namespace be kept in the same assembly?

For example, `ISerializable` and the `Serializable` Attribute are both in the `System.Runtime.Serialization` namespace, but not the assembly of the same name. On the other hand, `DataContract` attributes are in the namespace/assembly `System.Runtime.Serialization`. This causes confusion when a class can have `using System.Runtime.Serialization` but still not have reference to the `System.Runtime.Serialization` assembly, meaning `DataContract` cannot be found. Should this be avoided in practice, or is it common for namespaces to be split over multiple assemblies? What other issues should one be careful of when doing this?


Application that provides unique keys to multiple threads

Thanks all for your help before. So, this is what I came up with so far, the requirements are, application has two or more threads and each thread requires a unique session/transaction ID. is the below considered thread safe? thread 1 will register itself with get_id by sending it's pid thread 2 will do the same then thread 1 & 2 will call the function to get a unique ID               function get_id(bool choice/*register thread or get id*/, pid_t pid)     {          static int pid[15][1]={0};//not sure if this work, anyway considor any it's been set to 0 by any other way than this     static int total_threads = 0;      static int i = 0;     int x=0,y=0;              if (choice) // thread registeration part          {             for(x=0;x<15;x++)             {                 if (pid[x][0]==0);                 {                 pid[x][0] = (int) pid;                 pid[x][1] = (x & pidx[x][1]) << 24;//initiate counter for this PID by shifting x to the 25th bit, it could be any other bit, it's just to set a range.                 //so the range will be between 0x0000000 and 0x0ffffff, the second one              will be 0x1000000 and 0x1ffffff,                  break;                 }             total_threads++;             }          }          //search if pid exist or not, if yes return transaction id              for(x=0;x<15;x++)             {                 if (pid[x][0]==pid);                 {                 pid[x][1]++;//put some test here to reset the number to 0 if it reaches 0x0ffffff                 return pid[x][1];                 break;                 }                  }           }


Have there been attempts to make object containers that search for valid programs by auto wiring compatible components?

I hope this post isn't too "Fringe" - I'm sure someone will just kill it if it is :) Three things made me want to reach out about this now:   1. Decoupling is so in the forefront of design.   2. TDD inspires the idea that it doesn't matter how a program comes to exist as long as it works.   3. Seeing how often the adapter pattern is applied to achieve (1). I'm almost sure this has been tried from a memory of reading about it around the year 2000 or so. If I had to guess, it was maybe about and earlier version of the Java Spring framework. At this time we were not so far from days when the belief was that computer programs could exhibit useful emergent behavior. I think the article said it didn't work, but it didn't say it was impossible. I wonder if since then it has been deemed impossible or simply an illusion due to a false assumption of similarity between a brain and a CPU. I know this illusion existed because I had an internship in 1996 where I programmed neural nets that were supposedly going to exhibit "brain damage". STILL, after all that, I'm sitting around this morning and not able to shake the idea that it _should_ be possible to have a method of programming to allow autonomous components to find each other, attempt to collaborate and their outputs evaluated against a set desired results.


On a queue, which end is the "head"?

I had always thought that the "head" of a queue as the next element to be read, and never really questioned that usage. So a linked-list library I wrote, which is used for maintaining queues, codified that terminology: we have a `list1_head` macro that retrieves the first element; when using this library in a queue, this will be the first element to be removed. But a new developer on the team was used to having queues implemented the other way around. He described a queue as behaving like a dog: you insert at the head, and remove at the tail. This is a clever enough description that I feel like his usage must be more widespread, and I don't have a similarly evocative description of my preferred usage. So, I guess, there are two related questions: 1, what does the "head" of a queue mean to you? and 2, why do we use the word "head" to describe that concept?


Any success stories about using slicing tools to help debugging

Program slicing is one of those software technologies where there is much more activity in the research community than in the industry community. Does anybody outside of the research community using slicing tools on production code to help with debugging or other tasks? If so, what tools did you use?


WPF more dynamic views and DataAnnotations

Comparing WPF and Asp.Net Razor/HtmlHelper I find WPF/Xaml to be somewhat lacking in creating views. With HtmlHelpers you could define in one place how you wan't to represent specific type of data and include elements set from the DataAnnotations of the property. In WPF you can also define DataTemplates for data but it seems much more limited then EditorTemplates. It doesn't use information from DataAnnotations. Also the layout of elements can be bothersome. I hate having to constantly add RowDefinitions and update the Grid.Row attribute of lot of elements when I add a new property somewhere in line. I understand that GUI programming can be a lot of grunt work like this but as Asp.Net MVC has shown there are ways around that. What solutions are out there to make view creation in WPF a little bit cleaner, maintainable and more dynamic?


Creating A News Feed with Relevant Data for App

I'm creating an app that currently allows users to create topics, vote in topics, follow topics, and chat in topics. Currently working on creating a News Feed like Facebook or Twitter that brings users topics that are related to what they've interacted with in the past. I understand this a complex topic, but I would appreciate any answers anyone might have to working towards a solution. Current solution: Point system where topics will be added +1 to +1000 points for user activity. For example: > If user creates topic, then add +50 points to topic. Topic is more likely to > show up on the user's news feed. Another example: > If user "follows" topic, then add +25 points to topic. Topic is more likely > to show up on the user's news feed. Another example: > If topic was created in the past 24 hours, add +24 -(number of hours since > creation) to the topic. Hoping to learn if there's a more practical approach to figuring this out.


Patterns for Versioning Relational Data in a MySQL database?

I am trying to find an approach for a project, where A user can edit records, and be able to see past versions of those records. Here is a simlified example schema, using a list:               TABLE list (       id int auto_increment primary key,       user_id int,        title varchar(255)     );          TABLE list_tasks (       id int auto_increment primary key,       list_id int,       title varchar(255),       order int,       is_complete tinyint     );      So a user may come in, and make several edits to the list, (i.e., add or remove tasks, re-order tasks, mark some complete, rename some, etc.), Then save them. At this point, I'd like to generate a 'version 2' of the list and tasks, and have them be able to view previous versions, but when they access the list, always get the latest version. Is there a common approach / design pattern for dealing with versioning data in this way in a MySQL database?


Coming from a Windows keyboard background and still using a generic keyboard, how can I transition to Mac for development?

I got a new MacMini a little while ago because I already had a monitor, keyboard, mouse, etc so I just wanted something cheap I could play with for Apple development where I could just change plugs to the computer I want to use. The biggest problem is that my keyboard is a standard (or not so standard being a DasKeyboard) keyboard in regards to the Control-Windows-Alt key setup. As all good developers should, I have trained my fingers' muscle memory to work well with common Windows-based (and Linux for that matter) keyboard shortcuts. I've actually instinctively hit `Control-Shift-B` to "compile" a Word document before (/facepalm). I tried remapping the `Command` key to be my keyboard's `Control` key, and that alone takes care of most of my problems. `End` and `Home` buttons are another issue altogether, and trying to highlight words using `Control` (aka the `Command`) causes frustration as well. I've considered just getting myself a wireless Apple keyboard just for the MacMini and forcing myself to learn things their way. Or perhaps resetting my current key mappings and trying to force learn everything in an Apple-ish way on my standard keyboard (so I just need to get used to using `Alt` instead of `Control`). Has anyone else run into this problem? How did you go about solving it?


Is it a must for every programmer to learn regular expressions?

I am new to programming, and at an interview I got a question on regular expressions; needless to say I couldn't answer. So I was wondering whether I should learn regular expression? Is it a must for every programmer of all fields? Or it is a must for programming for some particular fields? Related questions:   * Why are regular expressions so morbidly attractive?   * When you should NOT use Regular Expressions?


normal order evaluation -vs- applicative order evaluation

I am going through Abelson and Sussman (Structure and Interpretation of Computer Programs) and I am a little confused about when normal order evaluation is used and when applicative order evaluation is used. This sentence throws me off: > _**Lisp uses applicative-order evaluation_** partly because of the > additional efficiency obtained from avoiding multiple evaluations of > expressions suich as those illustrated with (+5 1) and (*5 2) above and, > more significantly, because normal-order evaluation becomes much more > complicated to deal with when we leave the realm of procedures that can be > modeled by substitution. [emphasis added] on page 17 paragraph 1. However, in exercise 1.6, the implication is that Lisp uses normal order evaluation for primitives but applicative order evaluation for complex procedures. Could someone clarify?


How should one pay for employees' publications?

Suppose a company wants to encourage employees to publish articles, blogposts, participate in community discussions. Let us not consider the pure-rhetorical ways of encouragement ("Guys, you'll be so respected!"). What could be a sensible strategy to encourage publications by money? Many things come to mind, such as "pay for word count", "pay for audience size", "pay for view count", "pay for number of reactions or citations of the publication" etc, but most of them fall apart as unfair in trivial corner cases.


Architecture of interaction modes ("paint tools") for a 3D paint program

We are developing a Qt-based application to navigate through and paint on a volume treated as a 3D pixel graphic. The layout of the app consists of three orthogonal slice views on which the user may paint stuff like dots, circles etc. and also erase already painted pixels. Think of a 3D Gimp or MS Paint. _How would you design the the architecture for the different interaction modes (i.e. paint tools)?_ My idea is:   * use the MVC pattern   * have a separate controler for every interaction mode   * install an event filter on all three slice views to collect all incoming user interaction events (mouse, keyboard)   * redirect the events to the currently active interaction controler I would appreciate critical comments on that idea.


Effective handling of variables in non-object oriented programming

What is the best method to use and share variables between functions in non object-oriented program languages? Let's say that I use 10 parameters from DB, ID and 9 other values linked to it. I need to work with all 10 parameters in many functions. I can do it next ways: **1\. call functions only with using ID and in every function get the other parameters from DB.** Advantage: local variables are clear visible, there is only one input parameter to function Disadvantage: it's slow and there are the same rows for getting parameters in every function, which makes function longer and not so clear **2\. call functions with all 10 parameters** Advantage: working with local variables, clear function code Disadvantage: many input parameters, what is not nice **3\. getting parameters as global variables once and using them everywhere** Advantage - clearer code, shorter functions, faster processing Disadvantage - global variables - loosing control of them, possibility of unwanted overwriting (Especially when some functions should change their values) Maybe there is some another way how to implement this and make program cleaner and more effective. Can you say which way is the best for solving this issue?


Something similar to Objective-C categories in other languages?

I understand Objective-C categories and how they become useful, but I always have a hard time explaining the concept to other programmers that are not familiar with Objective C. Maybe I'm just bad at explaining things, but I was thinking at another way to explain it by comparing to similar features offered by other (more popular) languages. (ex : I can explain the similarities between Objective C protocols and Java Interfaces) Any examples similar to Categories ?


Is Creative-Commons license compatible with Apache License?

For example if I have code that contains parts of code rewritten from code found here or on Stack Overflow or other Creative-Commons licensed code, can my final code be licensed with an Apache License?


Why is (Ogg) Vorbis not automatically supported by Windows?

1. Vorbis was never threatened by MPEG LA, so it is undoubtedly completely patent free.   (MPEG LA never misses a chance to spread patent FUD)   2. Windows supports mp3, so it isn’t because they want to push their crappy wma.   3. The GPL allows distribution alongside commercial products, and   4. Even if they fear to ship GPL software, they can still load it automatically, like they do with XviD So why can’t a windows customer not simply drop a ogg vorbis file into his/her music library and listen to it via WMP? PS: To counter misconceptions: They already download the GPL’d XviD codec on demand, so they already have 99% of what it takes to do the same with Vorbis. It would take me about 5 minutes to do this, if I were familiar with the WMP code base and directshow filter system. PSS: I was told to ask this here rather than on stackoverflow, so i do.


How to verify the Liskov substitution principle in an inheritance hierarchy?

Inspired by this answer: > Liskov Substitution Principle requires that > >   * Preconditions cannot be strengthened in a subtype. >   * Postconditions cannot be weakened in a subtype. >   * Invariants of the supertype must be preserved in a subtype. >   * History constraint (the "history rule"). Objects are regarded as being > modifiable only through their methods (encapsulation). Since subtypes may > introduce methods that are not present in the supertype, the introduction of > these methods may allow state changes in the subtype that are not > permissible in the supertype. The history constraint prohibits this. > I was hoping if someone would post a class hierarchy that violates these 4 points and how to solve them accordingly.   I'm looking for an elaborate explanation for educational purposes on how to identify each of the 4 points in the hierarchy and the best way to fix it. **Note:**   I was hoping to post a code sample for people to work on, but the question itself is about how to identify the faulty hierarchies :)


Is requiring attribution GPL-compatible?

Can code licensed under a clause like this:               Redistribution of this work, with or without modification, is permitted if     Bob Joe is attributed as the original author or licensor of     this work, but not in any way that suggests that Bob Joe endorses     you or your use of the work.      be used in a project using GPL, or does this make it incompatible with the GPL?


Improvements to Joshua Bloch's Builder Design Pattern?

Back in 2007, I read an article about Joshua Blochs take on the "builder pattern" and how it could be modified to improve the overuse of constructors and setters, especially when an object has a large number of properties, most of which are optional. A brief summary of this design pattern is articled here. I liked the idea, and have been using it since. The problem with it, while it is very clean and nice to use from the client perspective, implementing it can be a pain in the bum! There are so many different places in the object where a single property is reference, and thus creating the object, and adding a new property takes a lot of time. So...I had an idea. First, an example object in Joshua Bloch's style: Josh Bloch Style:               public class OptionsJoshBlochStyle {              private final String option1;         private final int option2;         // ...other options here  <<<<              public String getOption1() {             return option1;         }              public int getOption2() {             return option2;         }              public static class Builder {                  private String option1;             private int option2;             // other options here <<<<<                  public Builder option1(String option1) {                 this.option1 = option1;                 return this;             }                  public Builder option2(int option2) {                 this.option2 = option2;                 return this;             }                  public OptionsJoshBlochStyle build() {                 return new OptionsJoshBlochStyle(this);             }         }              private OptionsJoshBlochStyle(Builder builder) {             this.option1 = builder.option1;             this.option2 = builder.option2;             // other options here <<<<<<         }              public static void main(String[] args) {             OptionsJoshBlochStyle optionsVariation1 = new OptionsJoshBlochStyle.Builder().option1("firefox").option2(1).build();             OptionsJoshBlochStyle optionsVariation2 = new OptionsJoshBlochStyle.Builder().option1("chrome").option2(2).build();         }     }      Now my "improved" version:               public class Options {              // note that these are not final         private String option1;         private int option2;         // ...other options here              public String getOption1() {             return option1;         }              public int getOption2() {             return option2;         }              public static class Builder {                  private final Options options = new Options();                  public Builder option1(String option1) {                 this.options.option1 = option1;                 return this;             }                  public Builder option2(int option2) {                 this.options.option2 = option2;                 return this;             }                  public Options build() {                 return options;             }         }              private Options() {         }              public static void main(String[] args) {             Options optionsVariation1 = new Options.Builder().option1("firefox").option2(1).build();             Options optionsVariation2 = new Options.Builder().option1("chrome").option2(2).build();              }     }      As you can see in my "improved version", there are 2 less places in which we need to add code about any addition properties (or options, in this case)! The only negative that I can see is that the instance variables of the outer class are not able to be final. But, the class is still immutable without this. Is there really any downside to this improvement in maintainability? There has to be a reason which he repeated the properties within the nested class that I'm not seeing?


Charging for Open-Source

**Is it viable to charge for an open-source product?** Both legally and financially, it seems like a very strange thing to do. However, I keep hearing people say that it's possible. Are there even any real-world examples for this sort of thing?


Based on what I read in "Inside the Machine", is this approach to branches more optimal?

So I have been reading Inside the Machine by Jon Stokes. It is a FANTASTIC book, and it has got me thinking about the effects of programming on processors... Given a branch unit in a CPU and a complex conditional statement that involves a procedure call (If IsTodayAHoliday( Now ) > 0 Then), is it faster to stick the results of that procedure call in a variable just before the IF statement? In terms of static and dynamic branch prediction, it seems logical that having the decision value before the branch unit has to evaluate causes the prediction algorithms to execute flawlessly. Is this true?


Is it possible to have an effective VIM environment for both C++ and Python?

I have recently moved to a VIM environment for Python development. I learned the setup from John Anderson's outstanding web page on the subject. I am about to try and set up another VIM environment for C++. Is this even possible to do effectively? Or should I really have two accounts on my Linux box, one for Python, one for C++ development? If anyone could outline their setup, either way, I would appreciate it greatly. To further clarify the question, I am not asking "what is best way?" which is unanswerable. I am asking those VIM users who program both C++ and Python if they use one VIM environment, or two (perhaps on different accounts), and how they accomplish it either way. (For Java, I am sticking with NetBeans and am pretty sure that is the right decision due to how well the build and Swing development tools are built into it, but am open to the idea of a VIM environment for all 3 languages if anyone has had success with it.) Thanks much


What is the intention behind asking weight of plane?

I was asked this question "How would you find weight of Aeroplane" in an interview and I am not sure why this question was one of the two question asked in the interview. I tried to answer it using all possible ways but could not give the correct answer.(found the correct answer after google search) How much such questions decide your selection in the interview? Here was my approach: 1\. If measurement of plane is given then i will calculate volume and multiply by density, will consider fuel weight plus other dead weight. 2\. Using water displacement method if i can put plane in water and somehow measure how much water is displaced. But found using google search that right approach was to put place on a ship and mark the level of water on the hull, then remove plane and then ship will go up. And start putting weight on the ship till marked hull reaches the water level.


What's the best way to move to linux from windows for web development?

I am primarily a programmer developing on windows based OS using C# as my primary language. I am evaluating Ubuntu Linux as an alternate platform and would like to know the best stack for doing web development on this. I had gone through this thread but it doesn't answer my questions fully. Some of the points I am interested are:   * PHP/Ruby/Python (What would you recommend?)   * Is Mono mature enough for any large scale development? Has anyone any real experience using Mono.   * IDE (including debugging support, intellisense, source control integration,Unit testing)   * Unit testing framework based on the language recommended   * Web framework if any.    * Load Testing tools   * Web server (I know there are many webservers, but would like to know which one is primarily used by most people)


What standard superseded 830-1998?

I have been looking into how to document software projects more formally, and I have learned about IEEE 830-1998: Recommended Practice for Software Requirements Specifications. However, as you can see from that link, it has been superseded. I know that 830-1998, and probably even 830-1993, are probably just fine for use. However, if nothing else, I would like to know what standard has superseded it. In this case it may not matter, but if other standards are superseded for more technical things, I think it would be a good idea to link somewhere what standard superseded another (if it is not another one in the same line (830, in this case)). It is worth mentioning that:   1. The most recent standard when searching for "Software Requirements Specifications" or "Software Requirements" on the IEEE Standards Association website is 830-1993,   2. The 2004 (current) version of SWEBOK references 830-1993 (paragraph 2.5),   3. The document's Wikipedia article doesn't mention that the standard was superseded.  TLDR: How do you find what standard superseded another, and which one took 830-1998's place?


What causes bad performance in consumer apps?

My Comcast DVR takes at least three seconds to respond to every remote control keypress, making the simple task of watching television into a frustrating button-mashing experience. My iPhone takes at least fifteen seconds to display text messages and crashes ¼ of the times I try to bring up the iPod app; simply receiving and reading an email often takes well over a minute. Even the navcom in my car has mushy and unresponsive controls, often swallowing successive inputs if I make them less than a few seconds apart. These are all fixed-hardware end-consumer appliances for which usability should be paramount, and yet they all fail at basic responsiveness and latency. Their software is just _too slow_. What's behind this? Is it a technical problem, or a social one? Who or what is responsible? Is it because these were all written in managed, garbage-collected languages rather than native code? Is it the individual programmers who wrote the software for these devices? In all of these cases the app developers knew exactly what hardware platform they were targeting and what its capabilities were; did they not take it into account? Is it the guy who goes around repeating "optimization is the root of all evil," did he lead them astray? Was it a mentality of "oh it's just an additional 100ms" each time until all those milliseconds add up to minutes? Is it my fault, for having bought these products in the first place? This is a subjective question, with no single answer, but I'm often frustrated to see so many answers here saying "oh, don't worry about code speed, performance doesn't matter" when clearly at some point it _does_ matter for the end-user who gets stuck with a slow, unresponsive, awful experience. So, at what point did things go wrong for these products? What can we as programmers do to avoid inflicting this pain on our own customers?


Balancing full time work and personal coding projects

I am nearing the end of developing the major pieces of my website that I have been working on in my spare time for the last 3 months. My goal is to get it released by the end of next month and hopefully start making some money on it. Unfortunately the next step will be to write a lot of specific data handling and ui code that I can see becoming very tedious and boring. When I was first started the project I was able to find time for working on it easily, it was interesting and writing the back-end was new. Once I got to the start of writing stuff that I know and do at work (ui), it seemed harder and harder to make myself work on the project, sometimes the last thing I want to do when I get home from work is code again. Anyone in the same situation? Any tips on how to find time and effort for side projects without burning out? Any tips on staying on the right track? EDIT-Update Thanks for all the input, I really appreciate it. My and another friend are in on this website together, I'm doing all the coding he's doing the design, marketing etc. Obviously I don't have strict deadlines but our goal was to have it released by the end of July. I have no plans to lease the coding work to someone else. I am using a ui and back-end framework, the code is going to get tedious but the frameworks are both major time savers. My plan of action is to treat it like a job and really force myself to put hours in. Hopefully in a couple of months I'll be able to edit this and promote my website :)


pre aggregating documents mongodb

In our current setup, most of our database calls are updates where we increment a key by 1. If all one is doing is incrementing certain keys on a document (a lot) in mongodb, and there are several application servers doing so at once, does it ever make sense to somehow aggregate these increments at the application layer and then send the pre-aggregated documents to the main mongodb database every set time interval? I understand it could be risky because if you somehow lose one of these pre- aggregated documents you can potentially lose more data, but is this technique ever used? I also understand sharding is the accepted way to scale writes, but I was just curious if this technique is ever used because it seems like it could potentially help scale if done right, I could be completely wrong here though.


Can a closed-source programming language survive?

A friend has written a programming language. It has a syntax reminiscent of SGML. He has written an interpreter for it, and an IDE. He and his colleagues use it in-house as a server-side language. It can also be used to write command-line tools. He wants to make it available to the public, in the expectation that people will purchase a license to use it. He wants to keep the code expressing the language implementation to himself, as there's a fair bit of intellectual property tied up in it. I keep telling him that the day of closed-source programming languages is gone. I say, "Look at all the major languages: the vast majority are open- source. You're going to have to go open-source too if you want anyone outside the company to pay any attention to what you've built." Am I giving him good advice or is there still room for proprietary languages that you pay for? **LATER** Den asked, "... could you please also explain how a language can be closed- source?" I said, "@Den you make a good point. What my friend wants to avoid, I suppose, is the situation where Microsoft cooks up a Java-alike language, calls it J++ and then gets into litigation with Sun about its Java-ness. How do you protect a syntax and a programming methodology from being hijacked by a company whose implementation could put you out of business?"


What diagram to construct when familiarizing oneself with new code?

When I first encounter a new code base, I often find myself constructing flowchart-like-thingies-on-paper, while stepping through the code - either by reading it, or with the debugger. Another approach, that I have heard about here on SE is to add `const` everywhere and see where the compilation starts to break. I am somewhat familiar with the different families of UML diagrams and 1) don't really like them 2) feel like they are intended for design time, not system analysis time. _So, what would be a good helping tool in understanding existing code that one sees for the first time? Is creating a diagram of the execution paths a widespread practice, and which diagram exactly? Or maybe a diagram of the inheritance hierarchy (or file-contains-function for procedural programming) is a more appropriate tool. Or something else?_


How is multi-threading different in a Java based Web Application vs Stand-alone Java Application

I am fairly new to Java and my experience is limited to Web Based Applications running on a Web Container (Jboss in my case). Am I correct in saying that for Web Applications the web container takes care of multi-threading? If so, can I introduce new treads in a Web Based applications? Is there any advantage in doing so and in what scenario one would need to do that?


How to browse an open source project efficiently?

It is really frustrating to find that every other open source project's source code and documentation etc., follows slightly or hugely different directory structure and naming conventions.   1. How do I quickly orient my self to the directory/naming conventions?    2. Get to the overall architecture of the app without going through a bunch of source code files?    3. How do I make reaching to the relevant code (that I am interested in) quicker?


What are the advantages of strictly maintaining separate data | algorithm | interface layers?

I always separate the user interface from other functionality in my programs - its the way I have been taught, and it has obvious advantages since you can change the interface but keep the same functionality. However, I've come across some programmers who strictly separate data, algorithms and interface. So the data objects which hold the data in volatile memory have _only_ fields/properties and their getters and setters. Any algorithms are kept in a separate class. In my view the main disadvantage of this is that the algorithm classes usually need full access to the data in the data classes. You might want to have a more functional class which you create with lots of data but then objects from other classes can only get at that data in specialised ways.


Where is java3d used?

The idea of java3d is very interesting, but I don't see any desktop or web applications built using java3d. Where is it used and what perspectives does it have?


What is the best way to include JavaScript file using script tag?

I generally include JavaScript files using the script tag as below.               <script type="text/javascript" src="somefile.js"></script>      I have seen some people using the language attribute as well. Now-a-days I find many people omitting the type attribute. I have started to get a feeling that if JavaScript is the default scripting language then even I should omit the type attribute. Would it be good to omit the type attribute? Would it cause any problems?


How should a REST API handle PUT requests to partially-modifiable resources?

Suppose a REST API, in response to a HTTP `GET` request, returns some additional data in a sub-object `owner`:               {       id: 'xyz',       ... some other data ...       owner: {         name: 'Jo Bloggs',         role: 'Programmer'       }     }      Clearly, we don't want anyone to be able to `PUT` back               {       id: 'xyz',       ... some other data ...       owner: {         name: 'Jo Bloggs',         role: 'CEO'       }     }      and have that succeed. Indeed, we probably aren't going to even _implement_ a way for that to even potentially succeed, in this case. But this question is not just about sub-objects: what, in general, should be done with data that should not be modifiable in a PUT request? Should it be required to be missing from the PUT request? Should it be silently discarded? Should it be checked, and if it differs from the old value of that attribute, return a HTTP error code in the response? Or should we use RFC 6902 JSON patches instead of sending the whole JSON?


Is there a way to not use the Observer pattern when creating GUI systems?

In Java, the Swing library implements the Observer/Subscriber-Publisher design pattern to design the way the program responds to events on the GUI (button clicks, etc). The programmer registers `ActionListener` objects (the observers) to a GUI element (the subject/observable/publisher), and these objects get notified by the GUI element when it's state is changed, and do something accordingly. This seems a reasonable way to design a GUI system, and I can't think of any other way a framework could do this. Is there any other way to design an event-response system in a GUI? **Are there any imperative-language frameworks or libraries with a GUI event- response system not designed this way?** Does the event-response system in the most common C# GUI library implement event-response issues using Observer, or something else? What about libraries for Python, etc.


How can I use UML to model a relationship between two classes, where one has functions exposed as friend to the other?

I have a two classes:                 ------------                         ---------------          X                                       Y       ------------                         ---------------                           relation       ------------    ------------------   ---------------           A()                                   C()           B()                                        D()           E()       ------------                         ---------------      I want to inherit just these two functions from X class, where they are defined with the friend access modifier. My class will be:                ---------------           Y                                             ---------------           ---------------         C()         A()         D()      ---------------      Y class uses some functions of X class namely A and D. How can I model this relationship in a UML class diagram?


Rest Design concerning user login

To be as restful as possible, is a user login better designed using a GET or a POST on a REST webservice? And why?


How do references work in R?

I'm finding R confusing because it has such a different notion of reference than I am used to in languages like C, Java, Javascript... Ruby, Python, C++, well, pretty much any language I have ever programmed in ever. So one thing I've noticed is variable names are not irrelevant when passing them to something else. The reference can be part of the data. e.g. per this tutorial               a <- factor(c("A","A","B","A","B","B","C","A","C"))     results <- table(a)      Leads to `$a` showing up as an attribute as `$dimnames$a`. We've also witnessed that calling a function like `a <- foo(alpha=1, beta=2)` can create attributes in `a` of names `alpha` and `beta`, or it can assign or otherwise compute on 1 and 2 to properties already existing. (Not that there's a computer science distinction here - it just doesn't really happen in something like Javascript, unless you want to emulate it by passing in the object and use key=value there.) Functions like `names(...)` return lvalues that will affect the input of them. And the one that most got me is this.               x <- c(3, 5, 1, 10, 12, 6)     y = x[x <= 5]     x[y] <- 0      is different from               x <- c(3, 5, 1, 10, 12, 6)     x[x <= 5] <- 0      Color me confused. Is there a consistent theory for what's going on here?


Is it recommended to use more than one language at a startup?

I work for a mobile startup where, for historical reasons, our chosen language was C#. I was recently assigned to a small project to build a tool that would be used by us internally. When I explained my intention to use Python to build this tool I was heavily criticized for this because introducing new languages, and technologies (Debian, Apache, Python and Django) into our ecosystem would make it harder for other developers to maintain (because only two other people know more than one language besides C#). I countered that this project would take far longer to develop in C# (which I think is an inherent problem with the language/.NET framework) and that the project was small and designed to solve a very particular problem. Of course it is necessary that the ecosystem be as a homogeneous as possible but if your are developing tooling, infrastructure, and internal systems when there are better things to build them with than C# then you should consider using them. By using one language you exclude a lot of other great libraries and frameworks out there, and this case it was the difference between taking one week to build in Python as opposed to a month in C#. Do you think it is acceptable to understand and use only only one language at a startup or even a larger company? Am I perhaps being naive??


Why is programming sometimes viewed as a second-rate role?

I've been a programmer for most of my life. I recently interviewed for a management job in a company and the interviewer looked at my CV asked me "How do we know you're not just a programmer". Which in my opinion is quite a rude thing to say, but it's not an isolated incident and I've heard other similar things in other settings. It does seem that for some reason being a programmer is viewed as having a lower station, especially in settings where they have a separate IT department which is viewed as a support role. Is a career in software development doomed to being a second-rate support citizen?


Parsing mathematical expressions with two values that have parentheses and minus signs

I'm trying to parse equations like the ones below, which only have two values or the square root of a certain value, from a text file:               100+100          -100-100          -(100)+(-100)          sqrt(100)      by the minus signs, parentheses and the operator symbol in the middle and the square root, and I have no idea how to start off... I've got the file part done and the simple calculation parts except that I couldnt get my program to solve the equations in the above.               #include <stdio.h>     #include <string.h>     #include <stdlib.h>     #include <math.h>          main(){         FILE *fp;         char buff[255], sym,sym2,del1,del2,del3,del4;         double num1, num2;         int ret;         fp = fopen("input.txt","r");              while(fgets(buff,sizeof(buff),fp)!=NULL){             char *tok = buff;             sscanf(tok,"%lf%c%lf",&num1,&sym,&num2);                  switch(sym){                 case '+': printf("%lf\n", num1+num2);                         break;                 case '-': printf("%lf\n", num1-num2);                         break;                 case '*': printf("%lf\n", num1*num2);                         break;                 case '/': printf("%lf\n", num1/num2);                         break;                 default: printf("The input value is not correct\n");                         break;             }         }         fclose(fp);     }      That is what I have written for the other basic operations without parentheses and the minus sign for the second value and it works great for the simple ones. I'm using a switch statement to calculate the add, sub, mul and div operations but I'm not sure how to properly use the `sscanf` function (if I am not using it properly) or if there is another way, such as using a function like `strtok` to properly parse the parentheses and the minus signs. Any kind help?


Best practices for unit testing methods that use cache heavily?

I have a number of business logic methods that store and retrieve (with filtering) objects and lists of objects from cache. Consider               IList<TObject> AllFromCache() { ... }          TObject FetchById(guid id) { ... }          IList<TObject> FilterByPropertry(int property) { ... }      `Fetch..` and `Filter..` would call `AllFromCache` which would populate cache and return if it isn't there and just return from it if it is. I generally shy away from unit testing these. What are best practices for Unit Testing against this type of structure? I considered populating cache on TestInitialize and removing on TestCleanup but that doesn't feel right to me, (tho it could well be).


How can I plan optimization tasks in Scrum?

Recently my Scrum team has received several requests for optimizing certain parts of our code. Looking at the software with a profiler found some spots where the code could be improved. We agreed to plan mostly based on user stories to ensure that everything we do has actual benefit for an end user, but how would this story be phrased? I can't come up with a good wording for them. How would we best plan such effort? is there a good way of talking about performance optimizations in terms of user stories?


Is it a good practice to wrap collection in Java?

I came across a snippet like this, and find it's over engineering. Is it a good practice?               public class SchoolList extends ArrayList<School> {     }          public class School extends ArrayList<StudentList> {     }          public class StudentList extends ArrayList<Student> {     }          public class Student {     }      Actually I prefer a straightforward option:               List<List<List<Student>>> schoolList;


How and when should I design a simple mark-up language parser?

I want to write a simple markup language with its rendering engine. First, I am not completely sure **_when_** I should try this... I am only 12... But I am competent in C++ having learned through the Web and books. I am also good with JavaScript, PHP and HTML. I am currently learning Ruby and Haskell for a change. I understand all low-level and high-level concepts. But the only thing that had always confused me is how people design these parsers to understand and compile or interpret things like markup languages and programming languages. My question is when should I start writing a simple rendering engine for an even simpler markup language? More like the custom xml-like custom languages frameworks use for their interface (Qt uses a .ui file that is similar to XML to define their forms). Am I up to design something like that? Any good papers, articles or books to read? _Preferred Languages_ : C++, JavaScript, Haskell, Ruby


modelling staged business process

_imagine_ given a `project` business object and such (simplified) rules:   * it's lifecycle is divided into several `stages of evaluation`;   * stages flow lineary and represent an evaluation chain;   * each stage provides its own `reward value`/algorithm;   * promotion of the project is controlled by other user's decision;   * the resulting reward is assigned to the project's initiator. _too naive, probably)_ The first thought that comes to my mind is using the `decorator pattern`; because of its structure it looks somewhat applicable. But what if you need to persist additional details provided with the current 'decorated' `state` of project? _I need an extra behavior on each stage_ I've encountered an article about `jBPM`. I believe it has much in common with `WF`. It is surely has the most of what is needed and at the same time it has (overkill) large infrastructure. _but can it be designed without incorporating this much complexity?_ What would you suggest?


Why is inheritance only defined at compile-time?

I found this statement from the gang of four's "Design Patterns" particularly odd; for some context, the authors are comparing inheritance versus composition as reuse mechanisms [p. 19]: > "...you can't change the implementations inherited from parent classes at > run-time, because inheritance is defined at compile-time." They go on to say of composition: > "Object composition is defined dynamically at run-time through objects > acquiring references to other objects." I am not sure why this phase distinction is important. I am familiar with compiling and inheritance but work as a JavaScript developer, so maybe I'm missing something fundamental.


How to gauge a person's ability to write SQL queries?

If I am a Java certified programer, by seeing that certificate people can say I have good knowledge on Java in a snap. Is there any similar certification to know if a person can write good SQL queries? I am not talking about database administration. I am looking at MS SQL Server specifically.


Good practice using signals and event driven system

I am using signals (specifically Boost `signals2`) to create an event driven protocol API and model. Most elements have their own signals, and there are usually multiple of each element. Consider a basic entity, a `user`; amongst others, the user may leave the system, so I need to have a leave signal. The question is, should the user object itself be passed to the signal handler? I.e.:               class user {         signals<void(user&)> on_leave;         //...     };      If there was `std::bind` and lambda then this decision would be easier to make, but with those passing the user back seems rather redundant, i.e.:               user.connect_on_leave(         [](user& u) {             //well I could already refer to user if I wanted to         }     );      And same with binding, I could do something like this               user.connect_on_leave(std::bind(my_hander, std::ref(usr));      Also, generally speaking, is it better for each signal to just pass to the user whatever it's concerned about, or have some sort of `message` type which all signals operate with? And my final question: at what point should I stop normalising data? If several signals share the same "payload", is it better to have separate signals like,               on_change_name(str)     on_msg_sent(str)     on_leave(str)      or               on_action(action, str)


How quickly is the silent IE upgrade likely to propagate to end users? What about managed corporate IT infrastructures?

According to this article from the BBC and this post on Microsoft's Exploring IE Blog, Microsoft has planned to automatically upgrade Windows XP, Windows Vista, and Windows 7's IE to the latest version. Microsoft has stated that they will also allow people to opt-out of this update through the use of the _The Internet Explorer 8 and Internet Explorer 9 Automatic Update Blocker toolkits_ and will respect any previous declined automatic updates. I assume managed corporate IE managers can also block whatever they want. Microsoft's blog post states that the release will begin in Australia and Brazil to be "scaled up as time goes on." I'm wondering, from the perspective of a web designer, how rapidly these upgrades are likely to be propagated to average end users, but also especially those in tightly-regulated corporate IT infrastructures. Given best (or common ;) practices in the corporate world, as well as average end-user behaviour, how soon can I stop investing a significant amount of time in backwards- compatibility with IE6 and 7?


What is a value object in domain-driven design?

I have an entity and I've realised that there is a group of properties that work together. So, I moved them to a value object (together with their behavior) and now I have a reference from my entity to this value object. I've read "Domain Driven Design Quickly" (PDF) and I came across the following statement when explaining Value objects: > If Customer is an entity object, then one instance of this object, > representing a specific bank client, cannot be reused for account operations > corresponding to other clients. The outcome is that such an instance has to > be created for every client. This can result in system performance > degradation when dealing with thousands of instances. But I'm still not clear exactly what this means. Is my new object a value object or should it be an entity? I am having trouble reasoning whether it should in fact be an entity. In other words, what questions should I ask in my domain to assure me that it should be a value object?


Sharing buffer between multiple threads part 2

This is a follow up to my previous not answered question, so I try to make it more clear: last question. I have a n-size buffer that is filled up from an external source, it has 2 main methods get() and add(), get() blocks (via wait()) if buffer is empty and add() blocks if buffer is full. This buffer object reference is available to multiple consumers (threads).   Each consumer reads data from buffer independently from other consumers . All Consumers must **read ALL data** from the buffer. As someone suggested, I have created A hashmap where key is an id of the consumer and value is the index within the buffer that was read by this consumer. The problem is that every consumer continues to request data from buffer. I need somehow to block it until next dataitem get available for it in buffer. Where and how should I block it?   (I can't use wait() in consumers object, because the producer can't call notify() since producer and consumer are different objects)


Software testing for developer

I'm a software developer. What do I need to know about software testing (apart from TDD, unit-testing and stuff) to make my software work as it should? For example, there are cases when TDD is not applicable. Therefore, I need to do simple smoke testing of my code every time it is deployed/changed. In order to prevent silly mistakes, I probably should have some simple test cases and check manually if everything works properly. It's better to avoid bugs than fix them, right? And this is the time when basic software testing skills might come in handy. What are those basics that I need to know?


Emulating communication between Android and microcontroller using threads or services or... other?

I am not sure what is the best way for the tasks below: threads, AsyncTasks, Loopers, services? Why? Are there other candidates? I need threads/Tasks/Services/other for:   * Plotting data, (refreshing should be done let's after after specific amount of data has been read)   * Generating data, (must being done during whole application runtime indefinitely)   * Reading data, (as above)   * Saving data on SD card / doing some logs   * Interacting with UX **More detailed scenario** I must emulate communication between an external device and Android. External device (I don't have access to that device for some time - I am waiting for it to arrive, that's why I want to emulate the communication - which is a control and measurement system board with ARM microprocessor) generates some data packed in frames in ASCII format. Android needs to pool? (Maybe there's a way to say: "Hey I have generated data for you. Take it!"? - If yes, could you advise me?) the external device to read data.


Handling large and small changes specific to a customer

I've been going back and forth on how to handle this best. **The problem** C# project consisting of WCF services used by a Flex application. A customer may request a functionality change that requires me to alter code to work just for them. It could be a single line of code in a method or maybe a method acts in a totally different way for customer x. **My Ideas**   1. Use branches for customers that have a customization. When a release is ready, merge to customer branches and try not to break / forget what their customization was for. We use SVN. I'm not a huge fan of this as the code base is very large.   2. Use inversion of control, dependency injection, and MEF. Create an interface for the class/s that needs to be modified. Create a new class library project (that is, customerabc), add a new class that implements the class just created, override method/s as needed for customer changes. Add a MEF export. I then place this in a customization folder and point MEF there. If it finds a DLL file in the folder, it uses that instead of the export from the executing assembly. I like option 2 ... Pros   1. Easy - normal deployment install, then drop in their DLL file.    2. Obvious - it might not be overly clear wether or not a customer is running code from their branch. With this option I could just look at the customization folder.   3. Clean - only the files that need to be customized exist. There isn't any need for a full copy of trunk. d. It promotes better SOLID for future development and refactoring (this project has little OOP). Cons   1. It will be harder to manage changes in trunk out to the customer projects.   2. It doesn't necessarily solve my problem with database changes or changes on the Flex side.   3. If the change is a single line of code in a 500 line method, I don't see any other option than to override that method, copy paste the code to the customer override and make the one line change. This isn't good use of DRY to me, but is there a good way around this?   4. OK, so better use of OOP and SOLID principles could mitigate some of this, but it also means that to implement a simple customer request, I have to do some major refactoring to the whole class... potentially many classes. What should I do?


What are the disadvantages of unobtrusive script patterns in web applications?

First of all, is there a name for this as a bona-fide design pattern? Currently I've just been referring to it as "unobtrusive javascript". Here is a brief example of what I am talking about: 1.) Use HTML5 data-* attributes to define values that will be used in UX scripts. Something like this:               <input type="date" data-app-calendar="datepicker" />      2.) Use script to initialize the javscript behaviors using these data attributes               (function($) {         $.app = $.app || {};         $.app.obtruders = $.app.obtruders || {};         $.app.obtrude = function(selector) {             var obtruder, obtruders = $.app.obtruders;             for (obtruder in obtruders) {                 if (!obtruders.hasOwnProperty(obtruder)) continue;                 if (typeof obtruders[obtruder] === 'function')                     obtruders[obtruder].apply(this,                          Array.prototype.slice.call(arguments, 0, 1) || document);             }         };              $.extend($.app.obtruders, {             calendar: function (selector) {                 $(selector).find('[data-app-calendar=datepicker]').datepicker();             }         });              $(function () {             $.app.obtrude(document);         });          })(jQuery);      What you end up with, imo, is presentation markup that is very cleanly separated from behavioral scripts. The above example is simple, but you can extend it to more complex scriptable UX like google maps (I am working on this right now). You can even add new "obtruders" in separate javascript files by extending the $.app.obtruders object literal. Before we start using this pattern more widely in our app, I wanted to pick brains for opinions and try to get ideas of some potential disadvantages of an approach like this. What do you like about this pattern? What don't you like? Why would you choose not to use it?


How to balance code quality vs strong developer personalities

On code reviews at work I have been seeing code & patterns that I consider "clever" though not necessarily adding to the overall quality or maintainability of the code base. I point this out on my feedback and am unconvinced by the counterarguments. I am a bit concerned when this code makes into into the repo and later to production. I want to maintain a cohesive team, so I dont want to create tension by being too vocal about my reservations. I also want to create a great product for our customers without being too leninent. Traditionally, who has 'veto' power on what gets checked in and how? How can code that works, but its too involved/clever be removed without stepping on toes?


How to employ amatuer knowledge of software architecture and design in an agile manner?

I have a problem when designing any application that is either greenfield or a refactored brownfield due to often finding a potential flaw or an uncertainty with the design or architecture that I think up. I waste a lot of time trying to construct a design that I am confident in without a lot of time invested from the beginning. I feel that mistakes early on lead to big issues later in development (especially when refactoring brownfield apps). I want to minimize this, but am unsure how to do it without an optimal solution or bothering the senior devs or the architect. For example, there is a legacy application that needs to be refactored. I can rewrite it in a new project and reduce the lines of code from 12k to 2-3k. The application's purpose is to generate HTML pages, but is done in a console application in C#. I have not done any web development until now, but I am unsure if ASP.NET MVC would be a good choice, and even if so, if my design or architecture is a good choice. I understand when working in a team I can receive good and solid advice, but how do I become less reliant on my team's thinking and more on my own without wasting the company's time researching every technological possibility? Does this just come with time and experience? If trial and error is the true and tried way, can architecture and design really be done in an agile way with minimal time wasted?


Scheduled website testing: Searching for a lightweight, simple solution

Scheduled website testing: Searching for a simple solution. One of my clients is having some tens of sites, with webform-based landing pages. He wants to daily test 3 different use-cases pre site, in order to make sure the site is working properly. I need to test the following use-cases:   1. Sanity test - check one page per site, to verify it loads and linked fields are not broken.   2. Webform test - verify that the user is redirected to the thankyou page when a webform is submitted.   3. Lead test - verify that a lead is recorded on the external CRM system when the webform is filled (the external CRM system has a web service interface which may be called from remote). The tests have to run from a remote server (the server doesn't allow for an internal cron). What is the quickest open-source tool to record such a test and run it daily from the cloud (or from my own external server, a dedicated ubuntu machine), then report if something happened?   * Is there a simple solution, where I simply record the test from a browser, then add parameters and schedule it to run daily via cron?    * Can installing BeHat on the external server up to the job?   * What about Selenium? (saucelabs, xml2selenium)?   * Can saucelabs-like cloud services do it alone, or do I need Jenkins CI as well?


Accurate/recommended approachs to tracking play length of a video

I'm working on a flash player that needs to track how long a user plays a video for. In addition, I need to know the user. I can easily do that with a request to the server. What I've thought of so far is sending a request to the server when the user presses play and another when the player stops playing the video. The obvious problem with this approach is that the user can navigate away from the page with out pressing stop, before the video ends. Are there know approaches you have tried/seen and would recommend?


Steps required to start programming in C++ to develop native applications

I am dealing around with C# .Net for almost around a year now. I got lots of experience (I owe most of it to guys at stackoverflow). Now I am thinking to start working with C++ as well. Mainly because I would like to be able write codes resulting in applications that are not .Net dependent so they can be executed in most of environments also having cross- platform in mind. Although I have to confess, writing code in .Net with C# and Visual Studio can not be easier nowadays. Of my other reasons I can name, since I am studying electrical engineering, who knows maybe I later need to write drivers for hardwares! My questions are: 1- Am I right with the idea of learning C++ I mean is it add to my value if say I am going to work as a developer later? 2- What tools will I need to start programming in native C++ that is perhaps compilers and IDE


Interfaces, Adapters, exposing business objects via WCF design

I know there have been countless discussions about this but I think this question is slightly different and may perhaps prompt a heated discussion (lets keep it friendly). _**The scene:_**   I am developing a system as a means for me to learn various concepts and I came across a predicament which my brain is conflicting with. That is whether to keep my interfaces in a separate class library or should they live side by side my business objects. I want to expose certain objects via WCF, however refuse to expose them in its entirety. I am sure most will agree exposing properties such as IDs and other properties is not good practice but also I don't want to have my business objects decorated with attributes. _**The question:_**   Essentially, I'll be having a separate interface for each of my objects that will essentially be exposed to the outside world (could end up being quite a few) so does it make sense to create a separate class library for interfaces? This also brings up the question of whether adapters should live in a separate class library too as ideally I want a mechanism from transferring from one object to the other and vice versa?


Is this a viable approach to resolving multiple matches in a lexer?

I'm writing a lexer in JavaScript. It's pretty typical - rules are specified with regular expressions and produce a token. I am unsure of the best way to handle when multiple rules are matched. The existing lexers I've looked at handle this by picking the rule with the longest match. It also seems like a viable strategy, however, to simply use the first rule that matches. This is my current strategy. Here is an example: Input: `:=` Rules:               : -> COLON     = -> EQUALS     := -> ASSIGN      The longest-match rule would return `ASSIGN`, where the first-match rule would return `COLON` and then `EQUALS`. Obviously this is not desirable, so under my implementation I would just reorder the rules to put the `ASSIGN` rule first as follows:               := -> ASSIGN     : -> COLON     = -> EQUALS      **Is this a viable approach to just use the first matching rule? What are the advantages and disadvantages of each approach?**


Why is 2^16 a "special" number?

OK, I feel stupid asking this - but in Jeff's article: Getting the Interview Phone Screen Right and originally stated in the 5 essential phone screen questions: > They shouldn't stare blankly at you when you ask with 2^16 is. It's a > special number. They should know it. I've been a developer\software engineer\code monkey\whatever for a little while now, and I don't think I've ever come across this. I mean, I can certainly count binary values do basic operations on them, etc, etc. But I don't see what is "special" about this value.


Will I need to use AJAX for this?

Say I have a model written in php whose properties are the columns of a table in a db and each instance of the model represents a row in the table. I also have a page ('view') where I display the contents of each column one row at a time, starting with the first row (id=1). Above this display are two buttons, one which when clicked displays the contents of the next row, and the other displays the contents of the previous row. I want the change of display to occur without reloading the page or going to a new page. My question is simply would I need to use AJAX for this?


Explanation java/web (tomcat/coyote/JSP/Servlet etc..) in 'Perl-world' terms

Analyzed one web-server.   * for the `http` request i got: `apache 2.2...` what redirects to https, and   * for https got `apache-coyote 1.1`.   * and the server runs xwiki java app. Trying to understand how it is implemented. After googling a hour trying to find any **simple** page what explaining java technologies for an _java dumb person_ \- giving up - and trying to ask here. I'm mostly using Poet / Mason / Starman (PSGI) for my needs, so trying to find equivalent perlish terms. So, from Wikipedia (shortened): Tomcat: > Tomcat is an open source web server and servlet container ... Tomcat > implements the Java Servlet and the JavaServer Pages (JSP) specifications > ..., and provides a "pure Java" HTTP web server environment for Java code to > run in. Tomcat's components: Catalina, Coyote, Jasper. > Coyote is Tomcat's HTTP Connector component ... for the web server or > application container. Coyote listens for incoming connections on a specific > TCP port on the server and forwards the request to the Tomcat Engine to > process the request and send back a response to the requesting client. It > can execute JSP's and Servlets. Jasper > Jasper is Tomcat's JSP Engine. Jasper parses JSP files to compile them into > Java code as servlets (that can be handled by Catalina). At runtime, Jasper > detects changes to JSP files and recompiles them. Catalina > Catalina is Tomcat's servlet container. Catalina implements Sun > Microsystems' specifications for servlet and JavaServer Pages (JSP). So, in comparison with Poet/Mason application:   * The Mason == `Jasper` \- it compiles my `.mc` and `.mi` files to pure perl/Moose code and manage my Mason app.   * `Catalina` is the `app.psgi`. Is is my "container" for Mason application and, it implements configuration, and many other things for the Mason app and it is based on   * the `PSGI` specification (something like `Java Servlet` specification) what defines the middlewares and how to write PSGI apps and so on...   * and the `Coyot` is like Starman or plackup - a PSGI compatible web server written in pure perl, what allows for perl apps to run in. and the whole things together: `Tomcat = deplyoment of my "Starman/Poet/Mason"`. It is plus-minus right or I completly misunderstand the java buzzwords? If I'm wrong, **please** correct me in _simple perlish terms_. :) So, the server in the top of question is like:   * on the port:80 runs apache - what redirects to   * 443 - what runs like `plackup`   * in what is runs the xwiki (like my perl application) It is more or less correct?


Is it fine to make a default constructor unusable?

**Specifically asking about the default constructor** Given that the constructor initializes all the data for an object, if I create a class that can't be used without proper initialization, is it not the case that the default constructor is useless? Consider:               // A class for handling lines in a CSV file     class CSV_Entry {     private:         unsigned num_entries;         std::string string_version;         std::vector<std::string> vector_version;         ...etc     public:         CSV_Entry();         CSV_Entry(const std::string& src_line);              // returns a vector copy of the original entry         std::vector<std::string> get_vector_snapshot();     }          int main( void ) {         ...etc              CSV_Entry example = CSV_Entry();         std::vector<std::string> current_entry = example.get_vector_snapshot();              ...etc     }      That variable `current_entry` is essentially useless no? If someone tries to process it later on, they would likely get errors; then they'd create code to handle such errors... To mitigate such additional, unnecessary code: why not make the default constructor unusable? Like so,               ...etc          CSV_Entry() {         throw Verbose_Exception( "CSV_Entry: do not use the default constructor" );     }          ...etc      PS: on a side note, if it is fine to just make the default constructor unusable, is it fine to put that throw in the header, since no other implementation details are revealed anyway?


Learning to be a good developer: what parts can you skip over?

I have set myself the goal of becoming a decent developer by this time next year. By this I mean full experience of the development 'lifecycle,' a few _good_ apps/sites/webapps under my belt, and most importantly being able to work at a steady pace without getting sidelined for hours by some should-know- this-already technique. I'm not starting from scratch. I've written a lot of html/css, SQL, javascript, python and VB.net, and studied other languages like C and Java. I know _about_ things like OOP, design patterns, TDD, complexity, computational linguistics, pointers/references, functional programming, and other academic/theoretical matters. It's just I can't say I've really _done_ these things yet. So I want to get up to speed, and I want to know what things I can leave till a later date. For instance, studying algorithms and the maths behind them is interesting and all, but so far I've hardly needed to write anything but the most basic nested loops. Investigating Assembly to have a clearer picture of low-level operations would be cool... but I imagine rarely infringes on daily work. On the other hand, looking at a functional programming language might help me write programs that are more comprehensible and less prone to hidden failures (at the moment I'm finding the biggest difficulty is when the complexity of the app exceeds my capacity to understand it - for instance passing data around was fine... until I had to start doing it with AJAX, which was a painful step up). I could spend time working through case studies of design patterns, but I'm not sure how many of them get used in 'real life.' I'm a programmer with basic abilities - what skills should I focus on developing? (also my Unix skills are very weak, and also knowledge of Windows configuration... not sure how much time I should spend on that)


Is it time to use MariaDB instead of MySQL on application development? Why?

If you know MariaDB, what's your opinion about migrate applications to use MariaDB instead of MySQL? What we gain and what we lost with this change? Is it really unnecessary to change the application in any situation? Any tip to assure the application run smoothly on MariaDB?


In Java, why are nextInt() and nextDouble() instance methods of Random objects?

In Java, why are `nextInt()` and `nextDouble()` instance methods of Random objects? I feel that these methods should be static methods of the Random class. What is the purpose of having to instantiate a Random object to generate random integers or double values?


What to do with unfinished stories and tasks in SCRUM sprint?

We have unfinished tasks which are part of stories in sprint. They are not accepted by the PO. They must be included for the next planning of sprint. Obviously the stories must be moved, but what about the tasks? Shall they be reopened and moved for the next sprint within the stories or not?


Studying more than one subject

Like all the undergraduate students, who are studying in a college. They have to learn many things in one semester. For example right now I am having Java, DBMS, Operating-Systems and Computer architecture in my syllabus. I am concentrating more on Java but DBMS and OS are also important subjects. So how can one master all the subjects? Should one go for only one subject and leave others to study only in exam time or study all subjects with same interest and give all subjects the same time. If one give same time to all subjects then he/she would not be able to be master in all but if he concentrates on only one subject then he/she can be a master in that. What do you guys suggest?


.NET processing unit

Do you think we'll ever see an IL (or other bytecode) processing unit? It sounds possible and would have a major benefit, because we wouldn't need the JITter. This isn't the same as compiling .NET directly to machine code, since the bytecode here is designed to be programmed and disassembled easily, unlike the bytecode used in x86 processors which is designed to work faster. What's stopping Intel (for example) from partnering with Microsoft and making such a .NET-optimised processor?