title: what to make of a Microsoft Most-Valued-Professional who believes that .NET types are either primitive or complex?

text: I thought that in .NET types are either value types or reference types. But this guy, when asked about .NET types, talked about "primitive types" and "complex types". I understand that people sometimes use different names to refer to the same concepts, but isn't it strange that a Microsoft certified professional would use this kind of terminology?


title: How do you research while pair programming?

text: I've recently started at a new job and pairing has helped me become effective there very quickly. I am, however, having a hard time when we must do brief joint research during our workflow, covering API features, code examples, or command options. My team lead urges us to do all research on our pairing station, rather than our individual laptops, and to synchronize our research by verbally negotiating the steps between different web resources. I research, read, and absorb information differently from my pairing partner, and I feel much more productive when I can follow a thread of research to the next web page exactly when I want to, rather than trying to keep exact pace and place with what my partner's reading. We're both smart and fast, but we can't help moving in different ways and instantaneous velocities when we're figuring stuff out. It seems so much easier to poke around individually for a minute until one of us says "I've got it," then get back together and code. When you pair program, how do you handle short research tasks? What works best for you, and how to you keep in sync with your partner?


title: What to use for code design?

text: What do you use when designing how everything in a program will work together? Do you use a program? Pencil and paper? A whiteboard? Your mind? And how do you represent these designs? UML? UML2? Something else? And if this isn't too broad, what do you usually define in your designs?


title: What are common pitfalls of Cloud Development that you have run into?

text: I'm looking at beginning some work on a cloud based application and I'd be interested to hear of anybody's experiences of pitfalls they have run into particularly from a design/architectural standpoint when working with cloud platforms. Are there any expectations that might change significantly from regular web development practice? Things that you wish you had been aware of before you got started or that might have influenced your choice of platform had you been aware of them? I realise there are significant differences between the different options out there, but I feel there are significant enough similarities to warrant asking this as a general question. Any experiences with particular platforms would also good- it would be interesting to see whether others have found similar things happening on other platforms too...


title: Conceptually, how does one make a rules/constraints (not graphics/physics) engine for a game

text: I want to make a simple game similar to the choose-your-own-adventure books. The player is presented with a narrative text and gets to choose his action from a list of possibilities. This, in turn, leads to a new narrative text, ad infinitum. The only catch is that depending on some previous decisions, the list of possibilities might differ. At first glance, this sounds like a load of if-else statements, thus implying a rule engine would be in place. But, it also sounds like a finite state machine to me. I am about to write this in Java or maybe Groovy. I'm currently more interested in the conceptual issues, i.e. how should this be done on a broad level (how do people implement chess or card games, anyway?), but some advice on a specific library in also welcome. Obviously, the "game engine" from the title does not refer to collision detection or other physics/graphics mechanics, but the logic deciding what options does a player have given the situation and his current state.


title: Just got an initial job offer. How do I ask for more without any real justification?

text: I just got an initial programming job offer for $75k + benefits. It's an initial offer, so I feel like I should give a counter offer to avoid unnecessarily leaving any money on the table, but I've never negotiated a salary before and I don't have any real reason for requesting more money other than, "I shouldn't just take the initial offer." Questions...   1. If I'm happy with the initial offer, would it be smart to give a counter offer and ask for more money and risk losing the job offer?   2. If so, how should I approach asking for more without any real justification? I should mention that I already have a job (at a very prominent software company), but it pays $16k/year less with no benefits. As such, I don't feel already having a job improves my position any. Thanks so much in advance for your wisdom!


title: What is needed for a self-taught developer to be able to move into senior-level and leadership positions?

text: I'm a self-taught developer that currently has more than enough experience to hold up against my colleagues waving their degrees. Still, I feel that I'm lacking some important skills to advance into being a senior-level professional in a leading role, specifically in the engineering, planning and designing aspects of software. I've touched the surface of UML, ERM/ERD, have experienced projects managed using waterfall and Scrum. I feel there is something missing, as every time I start on a new project, I don't know where to begin. Should I start diagramming and how? Should I start writing a document describing the project on a technical level first, or should I dive head first into writing the initial tests and code, or pseudo-code? I would like to know what, in my case, would be the best way forward, to learn how I can tackle this problem in the future and get better at leading and starting a project. There is not much I don't know about my technical tools and languages, but when it gets abstract I'm in trouble.


title: Making the switch from MySQL to PostgreSQL?

text: I've spent the last year becoming really comfortable with MySQL, but due to its increasing trendiness and my desire to homogenize my web-apps with Heroku, I'd like to start using PostgreSQL for my web apps instead. There are a resources out there for learning PostgreSQL, but I don't really want to have database concepts explained to me from scratch again, and I don't want to have to re-learn all the stuff that's pretty much the same. What are the critical differences that I need to understand - syntactical and conceptual - between MySQL and PostgreSQL that will affect me on a day-to-day basis?


title: What are some techniques to teach programmers design patterns?

text: I'm in a position where my developers are asking to learn design patterns. So far we have done a book club reading Heads First Design Patterns. During this we worked through examples and talked about how to apply this to areas of our own products. The problem is that these exercises didn't stick and they continue to ask to learn them. This post has some great example of books we could use, but I'm also looking for techniques on how to teach the information. So what have you done to teach other developers design patterns?


title: What are good practices to perform software based optimization?

text: On a project that I am working on we encountered some performance problems. We decided to drop hibernate in favor of plain Jdbc to gain database performance. By converting our code to Jdbc we achieved the performance that we aimed for but the code quality seems to have deteriorated. And it took us three months to implement the system, which has me wondering if throwing in more hardware would've been less expensive. **What would you do to optimize your application in a manner that limits side affects on architecture and complexity?** (Mainly interested in answers from perspective of web applications but other perspective are welcome)


title: How do you decide how much business requirements documentation you need and how to structure it?

text: In the past couple of years, I've worked on two projects. The first one, we used a very agile methodology. It was very much developer driven. As such, changes were very quick and rapid. Code quality was high becuase it was a new system. There was an emphasis on group ownership of the project and knowledge sharing. Most knowledge transfer with new staff etc. was conducted just by walking someone through the code or system and most staff members on the project knew enough of the project to do that. The project I thought was successful but one of the regrets I have is the amount of documentation was probably inadequate long term. We had a bunch of user stories which were short term specs only relevant for the sprint, and a a bunch of master specs outlining the business processes that was long term which we would keep up to date. We had no tech specs other than a oneNote page with user logins and links to test envrionments/servers etc. The problem was keeping a balance between putting enough in there so that it would be helpful and not so much that no one will want to read it and be a burden to maintain. I don't think we ever found that balance. The master specs were probably too generic to be useful to someone that wants to understand the system. The second project is completely opposite. It's an old system and it's very big. We use a waterfall methodology. This project is very much tester driven. As such we have probably too much documentation - there are thousands of pages in hundreds of word documents and there is duplication everywhere. (eg. documents with the same or very similar introduction texts) There is a big emphasis on keeping this mammoth of documentation perfect. Creating a simple change to the system requires identifying which documents is affected and making minor changes to all of them. We document things to levels that's probably not neccessary (eg. I found a doco the other day where the File Save dialog in IE was documented) and there is an emphasis on being correct over being readable. In short, we have half a dozen Business Analysts and their job consists more of keeping the documentation up to date than of actual analysis. I think both of these projects have bad practices and what would be optimal is somewhere in between the two. This balance probably depends on the system as well, so how do you decide how much documentation you need and also how to structure it so that maintaining doesn't become more cost than benefit. EDIT - Hi, sorry should've mentioned it before all the answers came along (I only was just able to check). I'm primarily focused on non-technical business requirements here - those that can be consumed not just by developers (audiences may include BAs, managers, testers, stakeholders etc.)


title: BSD-2 Licence Code modifying

text: I'm using a BSD-2 Licence code in my project and with author permission, I modify the code. Now, I am using this code in my project. I know, I should mention Author's name and copyright information. Should, I mention What I modify in this code??


title: Want to learn C++, and have prior web programming knowledge

text: I am actually considering learning C++. I want to become a quantitative financial analyst, and going to pursue my CFQ soon. Java is not heavily used in this field, but C++ is for its complexity. For someone who already has knowledge in HTML, CSS, JavaScript (intermediate), and PHP (intermediate), how hard would the switch be to pick up C++ over the course of a year? How long would it take to get certified in C++? And how hard is it to learn? I have built CMS websites, and some decent applications for the web. I took a college course of beginning programming in Java as well. Basically switching positions as a web designer to a C++ programmer and use Matlab. I have heard the language is very complex, but easier to program than languages like Java.


title: How to license a script/package if it uses multiple 3rd-party components with different licenses?

text: I have already searched but didn't managed to find a suitable answer. My problem is this: I use different software packages with different licenses to develop a free and open-source (not commercial) piece of software (a simple data visualization web app that reads data from a specific mysql db and draws graphs and stuff) that I want to release to the public as well. It all started with me writing some simple PHP code using a chart drawing library which is under the GPL. That was the initial version that I simply released through by blog without any license notice. On the next stage I integrated the results (chart images etc) within a free web template from os-templates.com which comes under a license of their own (they simply say that they allow usage for non-commercial and commercial projects with proper attribution to them, fine by me), in order to have a nice looking presentation/interface for them. I released that updated version without any license as well. Next, I expanded the script by using a google visualization api library which is under the BSD license to draw some additional google maps/charts. Still no license notice on my new release. I now want to continue working on this project but I think it's time to license it under an open-source license because it's getting bigger and bigger. Do you have any ideas at all of how can I do this? My work is the php code I wrote and all the other changes I have made to the template (html/css). Must I license it as a whole? Or can I just say that so-and-so libraries and other stuff included have their so-and-so respective licenses, while I release my code and only that under a license of my choice? Any suggestions would be nice. **Edit:** By the way, I know that "discuss it with a lawyer" can be a common answer, but we're talking about a small personal/hobby project that due to its nature (application-specific) no more than ~50 people will download/use (ever I guess). So I'm mostly looking for an easy solution, not something complicated like consulting a professional (and pay for it). **Edit 2:** Something else I want to note so there won't be any confusion is that apart from the template which I altered for obvious reasons, I just use the libraries' API by calling their specific functions etc. I haven't build upon them or altered them in any way. I'm saying this because as I understand it, building upon and extending an existing open source project is considered making a derivative and you should follow specific licensing guidelines (eg release the new code under the same license). In my case I just use the libraries as-is, nothing more.


title: Is Flash an Appropriate Platform for Enterprise Level MLS Systems?

text: I am a Realtor in a large metro area. Our MLS provider is building the next generation of its MLS software on Flash. Many in the beta test group are against this, citing numerous reasons including lack of native iPad compatibility, buggy behavior, and the general assertion that Flash is simply the "wrong" platform upon which to build an enterprise level system such as this. Ultimately, as a Realtor, I continue to be dismayed at the poor quality of software products provided to our industry's software providers while at the same time wondering why sites like Redfin, Trulia, Realtor.com, Zillow are so far ahead of us in user interface and functionality, at least from the end user standpoint. Any thoughts or opinions?


title: communication, realistic approach

text: I work for a mid sized Architecture and Engineering firm, our sub group focuses on developing tech solutions for engineers, mappers and technical managers. So we're heavy on desktop based apps for GIS and Civil/Env Engineering (some web). The company sells the services that our Engineers and mappers produce and our team develops tools that aids in them being more productive, efficient and help in adding value to their decisions and products, we DO NOT sell the technology. We are going through growing pains where initially we used to be extremely responsive and could rapidly prototype apps for engineers which immediately brought budgetary savings. That mindset has worked for us in the past. But this year we won a huge contract and our client base has basically quintupled (5 times?). What we are finding is that this rapid prototyping culture is hurting us, where project managers have started to expect short response times for tool development and robust production ready tools for all our engineers and GIS analysts. We've grown organically and now it seems that we are running into these issues were it appears we have to scale back our speed for more stability. Is this a legitimate tradeoff? Is there a win-win? How does one push back the engineer, project manager and analyst when they are our clients, they fund us and yet we need to be able to push back and tell them that if they want stability they have to be realistic about time frames? This isn't Microsoft Word, these are specialized GIS software and Engineering models with a ton of interop components for other industry standard models, they aren't idiot proof tools, they need informed inputs and we can only test things so much. Has anyone dealt with similar growing pains? Recommendations/advice on a communication stance, books, blogs?


title: Is loose coupling w/o use cases an anti-pattern?

text: Loose coupling is, to some developers, the holy grail of well-engineered software. It's certainly a good thing when it makes code more flexible in the face of changes that are likely to occur in the foreseeable future, or avoids code duplication. On the other hand, efforts to loosely couple components increase the amount of indirection in a program, thus increasing its complexity, often making it more difficult to understand and often making it less efficient. Do you consider a focus on loose coupling without any use cases for the loose coupling (such as avoiding code duplication or planning for changes that are likely to occur in the foreseeable future) to be an anti-pattern? Can loose coupling fall under the umbrella of YAGNI?


title: How much time do you devote to the design document(s) for your software?

text: Obviously the size of the project you're working on will be a huge factor in how long you spend writing the design document/specification. But do you go through everything, picking out every tiny detail? Or do you take a more agile approach and start writing the software quite early on and solve the problems as they come to you? I've always found that there's only so far you can go with designing. There will inevitably be some things that are missed, and at that point how well you can adapt to the situation means more than the specification itself. Am I taking the right viewpoint on this? Is it actually an opinion, or is a perfect design spec always the best route to go?


title: How do I convince my employer to hire an additional developer without selling myself short?

text: I'm the only developer at a small company. I've slowly moved into development here; until ~4 months ago 50-75% of my time was spent on operations. Now, 50-75% of my time is spent on development, with the rest split between operations and various IT stuff. I regularly end up working 50+ hours a week. I inherited some rather poorly-written applications (they were previously maintained by two people) that much of the business relies upon. Keeping these up and running, working on new, smaller applications, and my other responsibilities already take up all my time. In order to be scalable, the existing software needs significant refactoring and additional functionality. I haven't had the pleasure to work on properly written or architected software before. The complexity of this task is well beyond anything I've done before (this is my first job out of college.) I know there's a feverish devotion to self-learning/learning by doing among many here, but this is so beyond my expertise that I wouldn't be doing my employer or myself any favors trying to tackle it alone. I've been very direct about my inexperience, and in the past have mentioned that hiring another, more experienced developer will probably be necessary...if anything, just for the amount of time required for anyone to do the work as we grow and have more software to develop and maintain. I know that I would greatly benefit from hiring another developer; having someone to learn from and bounce ideas off of would be great. StackOverflow is great for determining approaches to individual coding problems or concepts, but is no replacement for discussions on a wider or more significant scale specific to a certain business domain. When mentioning hiring another developer in casual conversation recently, they didn't seem to think it was that important or necessary. **tl;dr** : Current patch jobs and other responsibilities already take up all my time at work, work on existing applications that needs to be done is beyond my skillset, little chance of me having any time to work on new products that are being planned. Employer initially seems reluctant about hiring another developer. How can I "sell" hiring another developer without sounding like I'm lazy or incompetent (I'd like to think I'm neither!)? **edit** : Just wanted to clarify that I'm in no way interested in taking any kind of hostile action to prove a point (i.e. taking a vacation to show them they'd be screwed if I wasn't around.) I'm pretty content working here and consider myself to be fairly compensated, even figuring in the overtime, which is why I'm nowhere near considering a new job yet. That said, I accepted the 'no more overtime' answer - even if I don't mind working over too much I'm not doing anyone any favors by doing so (prone to more errors, wear myself out) and it's not really tenable in the short term much less the long term. I'll be stressing this when discussing the matter with my supervisor, and will probably suggest hiring a contractor part-time as an initial approach that's more financially palatable. Thanks for all the great answers.


title: What metrics do you use on your Scrum project?

text: We are starting a new project and the board/stakeholders are asking for metrics to check the team performance. As a junior ScrumMaster I told them:   * about the Velocity and BurndownChart   * that we can chose any type of metrics as long as they are team based and not individual, they do not push people to act awkwardly / counter productive (as you get what you reward) Is there any other thing I can provide them in this regards? Have you got metrics other than velocity?


title: Is dependency injection essential for unit testing?

text: Is using dependency injection (DI) essential for unit testing? I can't think of another alternative for isolating code so it can be tested. Also, all the examples I have ever seen use this pattern. Is that because it is the only viable option or are there other alternatives?


title: Pattern or idea to communicate with async hardware

text: This is more like a theory question than a practical one. And although I am using Arduino and Labview, it should work independently of the platform. I have an Arduino board controlling a set of pumps (they use standard nema motors). This arduino reads gcode like commands through usb serial port, and actuates the pumps and valves. This part is working, and I can move the pumps around using Arduino serial port. This firmware (in arduino) is async, so it accepts non blocking calls. Basically, while a pump is working, you can send a command and some other pump will execute. Or you can execute several of them at the same time. Each command has an ID, and this ID is sent back to the serial port once the work has been done. This is coded using simply a FSM where every pump represents a state. Before my firmware was blocking, every physical action had a big wait between Nema steps, it's not the case anymore. Also, I have a Labview VI working, which accepts some parameters from the user (pump id, speed, and so), creates the commands, sends it, and actuates the pump. This also works. It's my first VI. Problem, it blocks. It stays there until the pump is finished. I cannot execute other actions while it's actuating the hardware. My question is, as a labview novice (although this is a general software pattern question in general), how can I fix it? Which pattern or template can I use to not block my VI while the pumps are working?


title: Which notification pattern is preferable?

text: I'm working on a view model for a view that presents a dialog with export options. The user selects options then clicks Export. When the view model completes the Export, the calling view model receives notification. I'm curious which is the better practice for implementing the notification: a traditional event or an `Action` callback that gets passed in when the dialog is opened. **Traditional Event**               public class ExportDialogViewModel : ViewModelBase     {         private readonly ICommand _exportCommand;         private readonly ICommand _cancelCommand;              public event EventHandler Finished;              public ICommand ExportCommand         {             get { return _exportCommand; }         }               public ICommand CancelCommand         {             get { return _cancelCommand; }         }              public ExportDialogViewModel()         {             _exportCommand = new RelayCommand(Export);             _cancelCommand = new RelayCommand(Cancel);         }              public void Initialize()         {             //set the initial conditions         }              public void Export()         {             //perform export             OnFinished();         }              public void Cancel()         {             OnFinished();         }              private void OnFinished()         {             if (Finished != null) Finished(this, EventArgs.Empty);         }     }      **Callback**               public class ExportDialogViewModel2 : ViewModelBase     {         private readonly ICommand _exportCommand;         private readonly ICommand _cancelCommand;              private Action _callback;              public ICommand ExportCommand         {             get { return _exportCommand; }         }              public ICommand CancelCommand         {             get { return _cancelCommand; }         }              public ExportDialogViewModel2()         {             _exportCommand = new RelayCommand(Export);             _cancelCommand = new RelayCommand(Cancel);         }              public void Initialize(Action callback)         {             _callback = callback;             //set the initial conditions         }              public void Export()         {             //perform export             _callback();         }              public void Cancel()         {             _callback();         }     }      My initial thoughts are that the traditional event is a little more flexible: it allows more than one subscriber to be notified, and it also allows zero subscribers to be notified. The callback, on the other hand, enforces a particular way of interacting with the dialog--the callback must be passed in during initialization. The callback is also simpler to implement and use, though perhaps less familiar than events. Which of the two notification patterns do you recommend and why?


title: what exactly is hypertext?

text: http://en.wikipedia.org/wiki/Hypertext: > Hypertext is text displayed on a computer or other electronic device with > references (hyperlinks) to other text that the reader can immediately > access, usually by a mouse click or keypress sequence. Apart from running > text, hypertext may contain tables, images and other presentational devices. > Hypertext is the underlying concept defining the structure of the World Wide > Web.[1] It is an easy-to-use and flexible format to share information over > the Internet. So any webpage that does not have hyper links is NOT hypertext? second question: http://en.wikipedia.org/wiki/Hypertext_markup_language: > HTML, which stands for HyperText Markup Language, is the predominant markup > language for web pages. So HTML is not hypertext because it is not displayed on an electronic device, but HTML that is displayed on an electronic device like this:               <b></b>      is considered hypertext? (I was debating whether to post this here or in English.StackExchange but thought probably here is a more appropriate channel)


title: Does "open source" ever become "my source"?

text: If I were to download some open source code that does some neat thing that I am needing, but doesn't have nearly as many options or bells and whistles that I need... and I make a TON of changes to where some of the base code is still there from the open source project, but a lot has changed and a lot has been added... will that code ever become "my source" as opposed to "open source"? EDIT: BTW, I don't actually have a project in mind, this is just in general terms - so I wouldn't know the license. This question just crosses my mind from time to time when I see a project that I could improve on...


I want to explain why the specification must not be changed during development period to the new planning department employee. Is there any cool document that does this?


title: Should I contract someone to help me with an existing project?

text: I have a paid Android app that I made by myself this past summer and I've been working on it throughout the year. The app is geared toward a professional niche market (but there are people all around the world who would buy it,) so it's priced highly. It is   * Mostly C++, some Java   * Built heavily on Qt (in the C++ code)   * 15,000+ lines of code   * Well commented in some places but not others I enjoy working on it, but find I no longer have time to slog through the more "menial" coding work of maintaining it, and instead want to focus on building new components and taking it to the next level, where I think I would really get bigger returns. In order to do that, I'm looking at contracting out some programming work to someone else. My app makes some money, but not enough to hire anyone steadily - instead I'll have to just give them smaller jobs to do at a time. I might have to hire someone in a lower economic status country as well, because I expect that rates, say, here in the U.S. won't be affordable to me. My knee-jerk reaction is to go to vWorker.com (formerly RentACoder) where I did a lot of work several years ago. Is this going to help me or cause more headache than help? Here are some more specific questions I have - feel free to answer any that you have thoughts on. Also, please let me know how I can improve this question. Thanks in advance.   1. How can I find a person with the **right skill set**? Is asking for **Qt** and **Android SDK** experience going to increase the price a lot?   2. How can I protect my **copyright**? Is this enforceable in less economically developed countries? Or can someone easily get away with stealing my code and selling it themselves?   3. Are there any other issues you foresee in hiring this person, and how might I address those?


title: Is The CPOL compatible with the MS-PL

text: My question is very simple: Can I use a CPOL project within a MS-PL project? I would like to add a CPOL project to my MS-PL solution, modify it and use it as a tool which helps me compiling my project. I found this: ![enter image description here](http://i.stack.imgur.com/hGqHO.png) I personally would say, that the CPOL should be compatible with the MS-PL. But I've got nearly no experience with licenses and I am no layer. So I would be really thankful if anyone could tell me whether I am right that the CPOL is compatible with the MS-PL.


title: Design Patterns for Coordinating Change Event Listeners

text: I've been working with the Observer pattern in JavaScript using various popular libraries for a number of years (YUI & jQuery). It's often that I need to observe a set of property value changes (e.g. respond only when 2 or more specific values change). Is there a elegant way to 'subscribe' the handler so that it is only called one time? Is there something I'm missing or doing wrong in my design?


title: Mutating Programming Language?

text: For fun I was thinking about how a programming paradigm could differ from OOP and came up with this concept. I don't have a strong foundation in computer science so it might be common place without me knowing it (more likely it's just a stupid idea :) I apologize in advance for this somewhat rambling question, anyways here goes: In normal OOP methods and classes are variant only upon parameters, meaning if two different classes/methods call the same method they get the same output. My, perhaps crazy idea, is that the calling method and class could be an "invisible" part of it's signature and the response could vary depending on who call's an method. Say that we have a Window object with a Break() method, now anyone (who has access) could call this method on Window with the same result. Now say that we have two different objects, Hammer and SledgeHammer. If Break need to produce different results based on these we'd pass them as parameters Break(IBluntObject bluntObject) With a mutating programming language (mpl) the operating objects on the method would be visible to the Break Method without begin explicitly defined and it could adopt itself based on them). So if SledgeHammer calls Window.Break() it would generate vastly different results than if Hammer did so. **If classes are black boxes then mutating classes are black boxes that knows who's (trying) to push it's buttons and can adapt their behavior accordingly.** You could also have different permission sets on methods depending who's calling them rather than having absolute permissions like public and private. Does this have any advantage over OOP? Or perhaps I should say, would it add anything to it since you should be able to simply add this aspect to methods (just give access to a CallingMethod and CallingClass variable in context) I'm not sure, might be to hard to wrap one's head around, it would be kinda interesting to have classes that adopted themselves to who uses them though. Still it's an interesting concept, what do you think, is it viable? Here's some potential dummy code from a game where a player has is damaged by something. In normal OOP most things would instead be passed as parameters to the method whereas here Damage "pulls" the properties it uses. Different? yes, better? perhaps not :)               Class Player     {         [AccessableBy:Terrain,Player]         void Damage         {             if (#CallingClass has property HitPoints)             {                 this.health -= #CallingClass.HitPoints;             }                  if (this.health < 0 && #CallingClass is Terrain)             {                 ShowMessage("was killed by the environment");             }             else if (health < 0 && #CallingClass is Player &&  #CallingMethod is RocketLauncher)             {                 ShowMessage("was killed with a rocketlauncher by player" + #CallingClass.PlayerName);             }              }     }      To reduce if-else statements you could have method overrides based on caller methods and classes


title: Do I have to be skilled in advanced theoretical problem solving to become a good programmer?

text: I have been doing programming for about a couple of years. I am currently in University 2nd year. In most universities here, the problem solving from sites like uva.onlinejudge.org and projecteuler.net are highly valued. Even in some job interviews, a decent number of UVa solutions is considered a good quality. But for some reason, I find these boring. These seem to have more mathematics rather than programming. When the students around me are busy in solving UVa problems, I find myself trying to make a real program with file manipulation etc. When they are trying to calculate the complexity etc of an algorithm in the algorithm course, I try to directly code them rather spend time in boring mathematical analysis. A few days ago, I got selected to be part of an university team for an inter- university programming contest. But I got so bored by the 4-5 preparation and selection mock contests, I decided not to participate and my teachers got a bit displeased with me, one even got a bit furious I guess. So am I going the wrong way? I mean I like solving problems, but not that much. I am more interested in practical problems rather than efficiency-hungry simplicity-eater theoretical problems. Is very advanced skill in theoretical problem solving really needed to become a good programmer? And I mean a good programmer, not a good computer scientist. Thanks.


title: View model structuring best practise

text: What is the preferred convention for structuring view model properties? It is better to use generic or more specific property names? Let's have a user, the page where this user will be displayed should be altered by user's permission. The view model could be written in two different ways:               {         userName,         userEmail,         isAdmin // show/hide controls according the value of this property     }      or               {         userName,         userEmail,         enableDeleteBtn,          showLogData,         // many more show/enable properties which are set according user's permissions     }      The first approach seems to smaller and easier to write, but it's less generic and the logic of displaying/hiding controls have to be changed if for example new type of user role will be introduced.


title: Is there already a commonly known name for the 'ensure pattern'?

text: I use a pattern that I call "ensure" extensively in my repository layer. In short, it does the following when I call an `Ensure(...)` method:   1. It uses the arguments in the method to attempt to populate an entity of a specified type (ultimately from the database),   2. If it finds one then it returns it; f it does not, it saves the entity to the database and return it. So, my Ensure method ensures that there is always a populated entity with specified properties, irrespective of whether one existed before the call was made. Is there already a more commonly known name for this pattern?


title: Which Python GUI library is easiest to use?

text: Among the GUI libraries for Python, which is more easier to work with: PyQt4, wxPython or any other? I just wrote few lines of PyQt4 code, it seems things are not that easy with Qt. Are there any performance pros and cons also among these GUI libraries?


title: Additional actions in setup.py for install

text: **Background** So, I'm developing a project, and I'm writing setup.py script for it, using distutils. I'm using CPython3.3. I use some libraries that have invalid distributions in PyPI, so they have to be installed by cloning repo and running setup.py manually (I've tried many things, both libraries help said I just need to use git instead of PyPI, so why I need to do that this way is not a question here). So, I've used some subprocess magic, and created script that clones repos and runs "setup.py install" in them. It also runs apps setup.py, after ensuring that broken libs are already installed other way. It is easy to convert to several methods, and will be enhanced in few moments. At the moment my app may be installed by running this script (I called it build.py). **Question** How do I create a hook in my setup.py script (for my app) that will run methods installing things from github when (and ONLY when) "install" argument was passed to apps setup.py? **What I've tried** I tried googling phrases like "how do I hook setup.py" - more or less general, I tried several queries. Nothing has been found. Also, I tried to analyze distutils source, to find some way, but that also got me nowhere. Haven't tried it yet, but I know it is doable - at the beginning of setup.py script checking whether conditions like "it is ran as main script" and "'install' keyword is in sys.argv" are true, and if so - running my git- related methods, but this is ugly as hell.


title: Suggestions for Summer Intern Application Assignments

text: As part of our application process we want prospective college interns to complete an assignment on their own - either programming or analytical - to give us something tangible to evaluate such as code or a flowchart. I have two ideas for these assignments, one programming and one analytical, I am interested in gathering feedback about these. # Programming Assignment Generate an a month's calendar for a given date. The first row should indicate the days of the week (e.g. Sunday - Saturday). Each subsequent row should contain a week's days. The date supplied should be highlighted (e.g. bolded). I am thinking we'll probably proscribe the output format even more strictly - probably down to what the HTML source should look like including CSS classes. Thinking is this forces answerers to actually do some work if they merely copy a solution from the internet. # Analytical Assignment Diagram or describe in prose a system for managing a set of traffic lights for traffic at a four way intersection. Each direction (i.e. North, South, East and West) has two lanes (i.e. right and left). The left lane is turn only and has green arrow light to indicate right of way. The system is able to detect if lanes have cars in them and change the lights accordingly. I would expect a flow chart or some prose describing a finite state machine that deals with each contingency. This would hopefully provide some indication of the applicant's ability to reason through a logic problem of sorts and articulate an approach for solving. # Areas Seeking Feedback   1. Is it unreasonable to ask this of applicants? If not, is it better to request before or after a phone screen?   2. Are these questions too hard or easy for a collegiate audience?    3. Any suggestions for alternate questions?    4. Do these seem like good tools for analyzing people who would part of a software development life cycle?    5. Programming language suggestions - I'm thinking Java, Python and/or C# (we're actually a ColdFusion shop).


title: Function only returns unchanged parameter, useless?

text: I just found this function in the project I'm working at:                 -- Just returns the text unchanged.       -- Note: <text> may be nil, function must return nil in that case!       function Widget:wtr(text)           return text       end      Too sad, the coder does not work in the company anymore. Why would one make a function that does nothing, but returns the parameter it's called with? Is there any use to such a function, not specified to this example, but overall in any case? Due to               function aFunction(parameter)         return parameter     end      Ends in               aFunction(parameter) == parameter      Why would I write something like               aFunction(parameter) == whatIWantToCheck      instead of               parameter == whatIWantToCheck      ?


title: How should I go about bringing this code under test?

text: I'm working on an open-source test framework. 90% of my codebase has good test coverage. My main problem area is the command-line entry point. This module began life as a very short script for calling into the domain model (see the call to `_run_impl()`) and exit with code 1 if the test run failed. It didn't feel necessary to test that script at the time that I wrote it, but as the project has sprouted features, a number of small changes to the logic in this file have led it to become quite long:               import argparse     import os     import sys     from . import _run_impl  # a function, in __init__.py, which calls into the domain model     from . import reporting  # a sub-package concerned with writing output to the console          import colorama; colorama.init()          def cmd():         parser = argparse.ArgumentParser()         parser.add_argument('-s', '--no-capture',             action='store_false',             dest='capture',             default=True,             help="Disable capturing of stdout during tests.")         parser.add_argument('-v', '--verbose',             action='store_true',             dest='verbose',             default=False,             help="Enable verbose progress reporting.")         parser.add_argument('--teamcity',             action='store_true',             dest='teamcity',             default=False,             help="Enable teamcity test reporting.")         parser.add_argument('--no-random',             action='store_false',             dest='shuffle',             default=True,             help="Disable test order randomisation.")         parser.add_argument('path',             action='store',             nargs='?',             default=os.getcwd(),             help="Path to the test file or directory to run. (default current directory)")         args = parser.parse_args()              if args.teamcity or "TEAMCITY_VERSION" in os.environ:             reporters = (reporting.teamcity.TeamCityReporter(sys.stdout),)         elif args.verbose:             reporters = (reporting.cli.ColouredReporter(sys.stdout),)         elif args.capture:             reporters = (                 reporting.cli.DotsReporter(sys.stdout),                 type("ColouredCapturingReporter", (reporting.cli.ColouredReporter, reporting.cli.StdOutCapturingReporter), {})(sys.stdout),                 reporting.cli.TimedReporter(sys.stdout)             )         else:             reporters = (                 reporting.cli.DotsReporter(sys.stdout),                 type("ColouredCapturingReporter", (reporting.cli.ColouredReporter, reporting.cli.SummarisingReporter), {})(sys.stdout),                 reporting.cli.TimedReporter(sys.stdout)             )              reporter = reporting.shared.ReporterManager(*reporters)              _run_impl(os.path.realpath(args.path), reporter, args.shuffle)              if reporter.failed:             sys.exit(1)         sys.exit(0)               if __name__ == "__main__":         cmd()      I know that this code has bugs (for example, it should be possible to capture stdout from tests when running in verbose mode), and I've lost confidence in my ability to change this module without breaking something. So I want to write some tests for it - but I only really have experience with test-first development, so I don't really know where to start. Should the tests be at the unit or integration level? Should I mock the `ArgumentParser`? Should I mock the `reporting` module? Should I mock `_run_impl`? Should I try to bring the whole module under test at the start, or just add tests as I add features? Do I need to refactor to make this method more testable? _Addendum_ : I think a part of my confusion is due to the fact that this is a relatively thin layer on top of the business logic - it's just there to make it possible to kick-off the test runner from the command line. So I'm feeling confused about what constitutes the service boundary here - in particular, what I should and shouldn't mock.


title: How exactly does a program (executable image) and library (pre-compiled image) "link" together?

text: I know very well of the difference of static versus dynamic linking. What I want to know is, when linking statically (with a library like Winmm.lib on Windows), how does the linker "link" the pre-compiled format with the just compiled binary of the executable? It does not have to pertain to any specific platform, OS, etc. I just want to know the process of which the linking takes place, and how that static "linking" binds an executable binary together that, when executed, forms a branch with the necessary system calls, routines, and low-level API access. Basically, how does the compiled file get "put together" statically with the pre-compiled data, especially if they're coded differently? I mean I know the library "exposes" routines, but where is the certainty that the called routines always work, and how can this be assured in a linking process? EXAMPLE: I compile "Hello world.exe", and it is statically linked, and launched from the OS loader. Does something within the binary that the program itself linked with have all the necessary "instructions", "magic number", "checksum", etc. to perform the correct procedures, or the does the OS loader, on the fly, find what's needed to access, i.e. system calls, type of program header, other magic numbers, etc.? I just want to thoroughly understand my linker's job, and how that linking makes the bonafide binary that the OS can handle, and get to my screen, as opposed to just plain instructions that the OS can't "branch" to any other process with.


title: Constructor Injection, Single Responsibility and List initialisation

text: Given the class:               public class Foo : IFoo     {       private IBarRepository repository            public Foo(IBarRepository repository)       {          this.repository = repository       }            public IList<IBar> Bars { get; private set; }     }      My long standing instinct is to initialise the list of IBar in the constructor: `this.Bars = new List<IBar>();` but using _Constructor Injection_ , the _Single Responsibility_ of the constructor is for it to set the dependancies for the class. What is the best way to handle this? Should I have a collection initialiser that I call in any method before using the collection?               private void InitialiseCollection()     {       if (this.Bars == null)       {          this.Bars = new List<IBar>();       }     }          public void Add(IBar bar)     {         this.InitialiseCollection();         this.Bars.Add(bar)     }


title: ASP.NET MVC Controller separation best practices

text: I am very new in ASP.NET MVC and Web stuff. I want to know how I should separate my page logic into different controllers. Like for example should I use `Home\BuyProduct` or `Product\Buy`. When there is a sign to move logic to the new separate controller? Should it be one Controller per page? What is the basic rules?


title: Python flavor of regular expressions - related to which?

text: So my copy of the classic book, Mastering Regular Expressions, just arrived, and I'm scanning through it. The cover (third edition) says, "for Perl, PHP, Java, .NET, Ruby, and More!" Well, it does have a full chapter for each of Perl, PHP, Java, and .NET - but no chapter on Ruby, or, more importantly to me, on Python. Although the index lists a few points of Python's differences (such as how it handles newlines), there's not even a table of them, much less an entire chapter. Which of the four covered languages, is Python's regex engine most similar to? More importantly, _how_ similar, and what are the major differences? Note - I don't mean how regexes are _used_ in Python (versus, say Perl) - I know and use the `re` module. I'm only interested in the syntax differences of the _actual_ regexes.


title: There is a (social) network / website for developers share ideas and find a team for development?

text: Supposing I want to do some kind of project, but I want to find more people interested in that area that can develop some project with me, there is some website focused on this? Example: "I want to develop action games for mobiles" or "Want to find web developers for a new social network focused on blah blah blah". This already exists?


title: How to find the running time of an algorithm that involves heuristics

text: I am working with A* algorithm, in which I have a 2D grid and given two points, find the shortest distance between them, while not running into any obstruction. Now, for each cell, I find the distance from the source, and calculate the distance from destination. Add the two quantities, and the one that has the minimum value, that cell is considered next. Now, How do I calculate the running time of such an algorithm, since I'll never know how many times this process will be repeated. i.e how many cells will I have to work, with, before I reach my destination. Kindly help. I am looking for the upper bound of running time. In terms of the length of side of grid, i.e. N. Thanks.


title: Designing a function with many optional components

text: I'm trying to figure out a good practice for designing a function with (many) optional components. For a specific example, say I am interested in designing a _feature extractor_ function that takes as input a document and returns a list of features extracted from the document. ### Question If there are many optional components, what kind of approach would be considered good practice and scalable? Below are a couple options I have been able to think of, though there may be other approaches that I have not considered. ### Approach 1: class based               class FeatureExtractor(object):         """Extract features from text for use in classification."""         def __init__(self, term_frequency=False, consider_negation=False,                      pos_tags=False):             self.term_frequency = term_frequency             self.consider_negation = consider_negation             self.pos_tags = pos_tags             # Could be many more ...              def extract(self, document):             """Extract features from a document."""             features = []             if self.term_frequency:                 features.extend(self.extract_term_frequency(document))             if self.consider_negation:                 features.extend(self.extract_negation(document))             if self.pos_tags:                 features.extend(self.extract_pos_tags(document))             return features              def extract_term_frequency(self, document):             pass              def extract_negation(self, document):             pass              def extract_pos_tags(self, document):             pass          extractor = FeatureExtractor(term_frequency=True, consider_negation=True,                                  pos_tags=True)     extractor.extract(document)      ### Approach 2: function arguments               def extract(document, *functions):         """Extract features from a document."""         features = []         for function in functions:                 features.extend(function(document))         return features          def extract_term_frequency(document):         pass          def extract_negation(document):         pass          def extract_pos_tags(document):         pass          extract(document, extract_term_frequency, extract_negation, extract_pos_tags)      ### Approach 3: class with mixins or multiple inheritance Something of a combination of the first and second approach, though I'm not sure how this would be done. Any ideas on a direction to head would be greatly appreciated!


title: Why do most java classes end with "ers"?

text: * ...Provider   * ...Searcher   * ...Resolver   * ...Builder   * ...Manager   * ...Importer   * ...Descriptor   * ...Helper   * ...Indexer Is it a global convention to refer a thing with "..ers" or "..ors". In contrast, a "thing" that composes with behaviors (habits) or attributes (properties) doesn't go with such naming convention. It is fun to think that we named the classes based on their behaviors. The "Manager" classes are always resembles my Project Manager.


title: Affero GPL (AGPL3) Quick Question

text: Our project is fully open source - it is a web service, we are using the AGPL3 license. Using this license, does that mean we can never offer it as a paid service?


title: Named arguments (parameters) as a readability aid

text: A long time ago I programmed a lot in ADA, and it was normal to name arguments when invoking a function - SomeObject.DoSomething(SomeParameterName => someValue); Now that C# supports named arguments, I'm thinking about reverting to this habit in situations where it might not be obvious what an argument means. You might argue that it should always be obvious what an argument means, but if you have a boolean argument, and callers are passing in "true" or "false" then qualifying the value with the name makes the call site more readable. contentFetcher.DownloadNote(note, manual : true); I guess I could create Enums instead of using true or false (Manual, Automatic in this case). What do you think about occasionally using named arguments to make code easier to read?


title: can subcontractors claim contractors work?

text: If I am subcontracting from a company. Am I able to claim the work as if I were doing for the client themselves. In other words.... if Client A ask Company A to do some web development. and Company A sub contracts out to Company B. Can Company B claim they did work for Client A. Or must they say they did work for Company A ? I am building my site and I want to release all the work I did for 1 company who subcontracted me. but I dont want to get into any legal issues.


title: Learning to implement dynamically typed language compiler

text: I'm interested in learning how to create a compiler for a dynamically typed language. Most compiler books, college courses and articles/tutorials I've come across are specifically for statically typed languages. I've thought of a few ways to do it, but I'd like to know how it's usually done. I know type inferencing is a pretty common strategy, but what about others? Where can I find out more about how to create a dynamically typed language? Edit 1: I meant dynamically typed. Sorry about the confusion. I've written toy compilers for statically typed languages and written some interpreters for dynamically typed languages. Now, I'm interested in learning more about creating compilers for a dynamically typed language. I'm specifically experimenting with LLVM and since I need to specify the type of every method and argument, I'm thinking of ways to implement a dynamically typed language on something like LLVM.


title: How do I write a good talk proposal for a FOSS programming conference?

text: I'm hoping to give a talk at RubyKaigi this year, and I'd like to know what makes a good talk proposal. RubyKaigi is a conference run by Ruby enthusiasts (as opposed to it being a trade conference, or an academic conference). The proposal form can be seen here. So far, my draft proposal about a program I'm working on mentions:   1. What the program is useful for and why it is relevant.   2. How it works.   3. What topics it touches upon (such as metaprogramming and testing) Is there anything that I should mention in my proposal? Also, how thorough should I be in my "Details of your talk" section? Should I be exhaustive, or only have a couple of short paragraphs?


title: What is the best way to allow a non-coding designer to design intranet web pages?

text: We have an intranet site which was done in .net with plenty of functionality but management wants it to look more visually attractive and get the graphic designer involved. The graphic designer is NOT a programmer nor has any desire to learn how to code. She would be updating the main page only. I was trying to figure out how to make it easy for her to update the site. I was looking into Joomla but it requires PHP, MySQL, and Apache. Our box is .net/iis/sql. Does anyone have experience with this? Just a bit concerned about compatibility issues. or maybe there is an easier way. I'm more of a back end guy than a graphics guy.


title: Is it legal to use icons from some other application while developing?

text: On my machine _while developing_ I'm using icons from other application (in particular MS Paint and Paint.NET) as sign for the user that if he chooses to open that file (with our own internal command) it would open in those applications. Is it legal to extract the icons from those applications and use them? Commit them to repository and then use on all developers' machines (even those that do not have Paint.NET installed)? Let me make it clear once more. I'm not talking about including those icons in release version. Providing proper icons is up to graphics/skin designer. I'm talking just about the developing process. Would extracting the icons in run-time either directly or based on file types change anything? * * * Recently there was a similar question: Can I legally use the icon of a different software? Yet mine differs in that I do not want to release those icons along my application. * * * **EDIT** Let me emphasis an issue which (judging by answers so far) was missed. If using the icons in above described circumstances was against the license/law (again judging from answers) then how about asking operating system for an icon of the application or an icon associated with the file. This will likely end in showing the very same icon... How about file browsing apps for which showing those icons is crucial part of their working rather than a nice but minor feature? How (from license/law point of view) is operating system/file browser/... different from my own developed application that they are (as I assume they are) allowed to query those icons and show them while I'm not. After all one could claim that looking at his beautiful icons in file browser aided my development like unit tests do and so I should pay extra like I do for using those unit tests... _(Also if icon would be queried at run-time from operating system it might be irrelevant whether it is on my development machine or on a released version at client machine...)_


title: Naming conventions for the only envisioned implementation of an interface

text: If you decide "Program to An Interface" trumps YAGNI and decide to create a supertype where you don't envision anything other than one obvious implementation - is there a convention for naming the obvious concrete type? E.g. this morning I wrote a a class called PlainOldConversionReport and I wonder if that name betrays ignorance of convention. Would there a more normal name, in Object Oriented development generally or .Net or C# specifically, to give to a non specialized subtype of IConversionReport?


title: Security of logging people in automatically from another app?

text: I have 2 apps. They both have accounts, and each account has users. These apps are going to share the same users and accounts and they will always be in sync. I want to be able to login automatically from one app to the other. So my solution is to generate a login_key, for example: `2sa7439e-a570-ac21-a2ao-z1qia9ca6g25` once a day. And provide a automated login link to the other app... for example if the user clicks on: `https://account_name.securityhole.io/login/2sa7439e-a570-ac21-a2ao-z1qia9ca6g25/user/123` They are logged in automatically, session created. So here we have 3 things that a intruder has to get right in order to gain access; account name, login key, and the user id. Bad idea? Or should I can down the path of making one app an oauth provider? Or is there a better way?


title: Micro-economics for CS students

text: I recently went through the article on "Advice for Computer Science College Students", by Joel Spolsky - http://www.joelonsoftware.com/articles/CollegeAdvice.html . In that Joel says that a programmer who understands the fundamentals of business is going to be a more valuable programmer, to a business, than a programmer who doesn't. Many ideas do make sense in code, but not in business. I'd like to know if there are some quick reference manuals for CS students to learn micro-economics. I'd like to know the ebooks that would help one to understand the basics of it.


title: MVC : Does Code to save data in cache or session belongs in controller?

text: I'm a bit confused if saving the information to session code below, belongs in the controller action as shown below or should it be part of my Model? I would add that I have other controller methods that will read this session value later.                 public ActionResult AddFriend(FriendsContext viewModel)       {             if (!ModelState.IsValid)             {                                 return View(viewModel);             }                  // Start - Confused if the code block below belongs in Controller?                  Friend friend = new Friend();             friend.FirstName = viewModel.FirstName;             friend.LastName = viewModel.LastName;             friend.Email = viewModel.UserEmail;                              httpContext.Session["latest-friend"] = friend;                  // End Confusion                  return RedirectToAction("Home");         }      I thought about adding a static utility class in my Model which does something like below, but it just seems stupid to add 2 lines of code in another file.               public static void SaveLatestFriend(Friend friend, HttpContextBase httpContext)     {         httpContext.Session["latest-friend"] = friend;     }               public static Friend GetLatestFriend(HttpContextBase httpContext)     {         return httpContext.Session["latest-friend"] as Friend;     }


title: Styling/formatting file for programmers, has it been done?

text: has there ever been a proposal for establishing a formatting style file for programmers? In web programming, we have CSS files that help separate style from 'code', so two people can see the same code while each can see it in his/her preferred way. I was thinking something like this could theoretically be achieved for programming. How many times have you read code from another programmer with a formatting that you can't stomach? If you change the formatting, you're changing the source file, so whoever comes after you to read the same file could have the same issue against your formatting that you had. You could say "define coding standards" but this is usually not done in small or individual teams before the company grows. Why not separate formatting from code? You could define how you like code formatted (brackets here, new line after this, etc) and the IDE would take the source code and auto-format it to your liking (without changing the source code). I guess it wouldn't be a trivial thing, but I'm curious if there are languages or IDEs in which this has been done. Has something like this been done or attempted ever? Is it doable? Could something like this be incorporated in, say, Visual Studio?


title: How did the term "hypervisor" come into use?

text: I've read about the "hypervisor" in hardware virtualization. VMs are not my area, so I can't quite see where the term came from. THe wikipedia article talks about how "the hardware's supervisor state was virtualized as well, allowing multiple operating systems to run concurrently in separate virtual machine contexts" This implies that a _supervisor_ process was virtualized.. which then probably originated a 'hyper'-visor. Is this true?


title: What's wrong with JavaScript

text: There is a lot of buzz around Dart recently, often questioning Google motivations and utility of Dart as replacement for JavaScript. I was searching for rationale of creating Dart rather than investing more effort in ECMAScript. In well known leaked mail its author is saying that > Javascript has historical baggage that cannot be solved without a clean > break. But there is only one concrete example given (apart of performance concerns) of "fundamental language problems", which is an > existence of a single Number primitive So, my questions are:   1. How an existence of a single Number primitive can be a "fundamental problem"?   2. Are there other known "fundamental problems" in JavaScript?


title: What are the most common problems with recruiting developers?

text: This question was inspired by this closed one. Please only answer if you have experience of recruiting developers, and stick to broad issues, not Daily WTF style stories. Basically, what are the main issues that make it hard to find good developers - either making it hard to get people to apply in the first place, or leading to large numbers of applicants being rejected or refusing an offer. General technical ability, specific technical skills, interpersonal skills, salary demands vs. budget constraints, work too dull, whatever - what are the top development recruitment problems?


title: Comparing two software versions in C#

text: I´m working on a mod update checker for minecraft, but there is a big problem: The modders and online database that I´m using for update checks has no standard software versions e.g.:               Local: rv0-stable-10 Online: rv1-alpha-13     Local: R1.1-83 Online: r1.1-81     Local: 1.7.10-0.2.250 (1.7.10 is indicating the Minecraft version) Online: 0.2.274     Local: 1.1.0c Online: 1.1.0e     Local: 2.2.526 Online: 2.2.526-experimental      Is there an algorithm or something like that, that is able to compare such different versions?


title: If I learn ASP.NET with C#, will that help me learn to build Windows .Net non-web programs in C#?

text: If I learn to build web applications with the .NET stack in C#, say MVC, entity framework, linq, etc., will that be of any benefit to me in developing native Windows program executables? I see benefits for using Visual Studio, the language, such as C#, just general experience in programming. But I don't know if there is any direct relationship between asp.net and native programming.


title: Should I as a junior-programmer pursuit a course in C#, even though I did Java?

text: I'm a junior-programmer, and at present I am pursuing a course in I.T. which involves getting to know Java and JavaScript. Should I pursuit a course in C# also? I really like programming, but I had a lousy lecturer, at the beginning... But now I've changed lecturer, and beginning to see the light, but he's confined to teaching only Java. I would like to become a much better programmer, should I do it (C#)?


title: What's the relationship between Java EE and Glassfish?

text: I'm confused. Does Glassfish come as part of the Java EE platform? Can you get Glassfish but not Java EE?


title: Dissidence between program leader and me, what should I do?

text: > **Possible Duplicate:**   >  How to tackle a boss who thinks everybody in this world is wrong except > him? I've been an MMORPG programmer for two years. I have some experiences on limited platforms like cell phones, so I've got a strong awareness of memory optimization. But the programs of my current company eat a lot of memory, neither server side fellows nor client side ones do not care about this matter, maybe spoiled by the memory industry growth. I've reported this issue to our program leader but he had nothing but scorn of my ideas, and he told me that we should do the client memory optimization when the project is almost releasing, and the server side memory occupation is not a problem at all, memory chips are cheap thus we could plug more if it's not enough. I'm really distressed about this parlance. We may waste memory everywhere if the leader don't advocate this optimization. This problem is a problem indeed in our released project that it caused low server FPS and client lag. My project is a still developing one. What should I do? Any suggestions is appreciated.


title: How to estimate cost with very little information?

text: I have a client who wants a web app that will let him do the following (as he told me word for word):   * User registration   * Recurring payments for users   * Online conference room reservation I am supposed to give him a cost estimate very fast and I don't have any time to do any deeper requirements analysis! How would you deal with that kind of situation? Should I just give a very broad estimate and work out the exact requirements once he has accepted the estimate? At which point do you usually gather requirements, after or before getting a contract?


title: Python interview questions

text: I am going to interview within two weeks for an internship that would involve Python programming. Can anyone suggest what possible areas should I polish? I am looking for commonly asked stuff in interviews for Python openings. Apart from the fact that I have already been doing the language for over a year now, I fail to perceive what they can ask me. Like for a C or C++ interview, there are lots of questions ranging from reversing of strings to building linked lists, but for a Python interview, I am clueless. Personal experiences and/ or suggestions are welcomed.


title: Does the use of mongodb enhance extending/changing database driven applications?

text: When an application is created which need to store data, an SQL database is used very often. So did I in a lot of asp.net applications. The resulting applications have often an ORM like the entity framework and maybe a business layer. So when such an application needs to be extended(let's say you have to add a comment property to an object), you have to change/extend the database, then the ORM and the business layer and so on. To deploy the changes you have to update the target database and the application. I know that things like code first and fluent can make this approach easier. I tried mongodb, I only used the standard driver and I had to extend some objects and all I had to do was changing the code. So it feels that such approaches are much easier to realize when using mongodb. I don't have much experience with larger applications an mongodb. I know that a SQL database or mongodb doesn't fit for all needs and both have their pros and cons. I want to know if my feeling is right, if yes I would choose rather choose mongodb than SQL database.


title: Importance of hobby projects

text: I want to know, how important is it to program in your spare time? Is it necessary to work your 9-5 as a programmer and then get home and work on your hobby to become a better programmer? This said, I know you only get better at programming by, well, programming. Do prospective employers take hobby programming into account in an interview or do they ask this just out of curiosity? I feel guilty for not having a hobby project, but everything I can think of doing has already been done. So I am kind of in two minds about this, start something that has already been done or leave it until I come up with something original?


title: Do server-side sessions violate REST?

text: According to Roy Fielding (one of the principle authors of the HTTP specification) in his seminal thesis _Architectural Styles_ when discussing REST, he mentions: > [E]ach request from client to server must contain all of the information > necessary to understand the request, and cannot take advantage of any stored > context on the server. By "stored context" he's referring to _application state_ e.g. what the page number for the next page is vs. _resource state_ e.g. any data store, image etc. - which is arguably the _whole point_ of REST. Is it fair to say that most attempts at _pure_ rest (hereby defined as an implementation that conforms to the above thesis) must fail due to their reliance on storing session data on the **server** (persistent or otherwise)? The concept of a session is common - in particular to Web developers - but is it RESTful according to the above definition?


title: Acceptable memory usage as a function of input size

text: I know that if a computation takes linear or linearithmic time based on the size of the input, that's good, and if it takes quadratic time, then that's not so good. However, what about memory usage? Suppose a program takes a file as input and does something with that file. Is it okay for the memory usage to be linear in the size of the file or should it be constant?


title: Constraints while designing the Java generics

text: Java generics look quite different from those available in Scala, although both were designed by Martin Odersky. From my point of view, the design of generics in Java is worse, for instance:   * there is no possibility to specify variance   * one can get around the previous limitation by using wildcards, but this means the burden of specifying variance goes on the caller instead of the library designer   * one cannot use a type constructor in generics What were the constraints in Java that forced Odersky to design this mechanism for generics instead of the more flexible one he devised for Scala? Was he just savvier a few years later or there were actual limitations due to Java?


title: finding patterns into logs

text: I am trying to put together a way to figure out if incidents occurred based on log content. Typically, on log (or db table) would contain a list of transactions composed as follow: {Timestamp} {TransactionID} {Message} As an example problem I have run into, I used this to detect if "incidents" occured by running some very basic queries such as:               SELECT Timestamp, count(*)     FROM table     GROUP BY Timestamp     HAVING COUNT(*) > 5     ORDER BY Timestamp      This works OK but has very strong caveats:   * In times of high activity it will return records for nothing (and raising the bar will hide rows that should get returned)   * Let say I have 4 events at timestamp t and 2 events at timestamp (t+1), my query will not return anything even if they should be considered. Unfortunately, aggregating timestamps by time ranges will lead me to the previous point about high activity time. Would someone have some insights on how to tackle the broader problem of incident detection within logs?


title: Will loop constructs become obsolete?

text: By loop constructs I mean for… and while… constructs with nested statements. Currently I am coding a tool in Python and decided out of curiosity not to use the regular loops - and rely on filter/map/reduce instead. E.g. now I have code like:               fields = filter(None, map(parse_field, struct_decl.get_children()))      So far it works out fairly well and I like the way I am now designing the code - I have a clean-cut functions (though sometimes I need to use a lambda) and I do think that the resulting code might be more efficient (e.g. the iterations are more naturally independent making them more parallelizable). And I only have to increase indentation for conditionals (though I am thinking about avoiding them as well) These new functions are not unique to Python - e.g. C++ had std::foreach for ages. I wonder if traditional loops will eventually be frown upon in mainstream languages, similar to `goto`?


title: Is it better to use preprocessor directive or if(constant) statement?

text: Let's say we have a codebase that is used for many different costumer, and we have some code in it that relevant only for costumers of type X. Is it better to use preprocessor directives to include this code only in costumer of type X, or to use if statement, to be more clear:               // some code     #if TYPE_X_COSTUMER  = 1     // do some things     #endif     // rest of the code      or               if(TYPE_X_COSTUMER) {         // do some things     }      The arguments I can think about are:   * Preprocessor directive results in smaller code footprint and less branches (on non-optimizing compilers)   * If statements results with code that always compiles, e.g. if someone will make a mistake that will harm the irrelevant code for the project he works on, the error will still appear, and he will not corrupt the code base. Otherwise he will not be aware of the corruption.   * I was always been told to prefer the usage of the processor over the usage of the preprocessor (If this is an argument at all...) What is preferable - when talking about a code base for many different costumers?


title: Where is the best place to teach myself a language, and which one?

text: I do not know any programming languages at all. I will self teach myself and need to know the best place to do so where I can learn from a most basic level. Where is a great place to begin learning a language? What language is best to learn first? Is it silly to learn Ruby first? Here, I came across someone saying that learning some of the higher languages can make you 'lazy' if you learn them first. Like Ruby amongst others. For my first language, my husband is advising me to learn Ruby (for his own personal interests). However, I need some independent advice of how to get started and what language I should learn first. I will eventually learn Ruby and then Rails. Four months ago, my husband ordered a text of objective C because he thought he would take it on. I flipped through and it was clearly starting at a place more advanced than where I am coming from. I have dabbled with a Ruby tutorial and I don't get it. I get what I am putting in is what I get, but I don't understand what is leading up to that. I need to know ALL the rules first. I then looked up computer languages and stared researching binary code which helped a lot, but not where I want to start. I don't have a lot of time right now in my life (with four kids) to go back that far. If I were going to school, that would be different. Any advice you could give is most welcomed.


title: Looking for good books about the theory behind search engines

text: I am working on a project that requires that I understand different techniques used by search engines for the web. I have a strong scientific and development background, so I am not afraid of highly technical information. I am looking for all forms of technical information including information on web crawlers, other techniques for acquiring data, methods of data storage and how to query it, etc., etc. I am completely new to the subject and I'm looking for useful resource and books on the subject. Any suggestions are appreciated.


title: How to determine the source of a request in a distributed service system?

text: Map/Reduce is a great concept for sorting large quantities of data at once. What to do if you have small parts of data and you need to reduce it all the time? Simple example - choosing a service for request. Imagine we have `10` services. Each provides services host with sets of request `headers` and post/get arguments. Each service declares it has `30` unique keys - `10` per set.               service A:     name     id     ...      Now imagine we have a distributed services host. We have `200` machines with `10` services on each. Each service has `30` unique keys in there sets. but now to find to which service to map the incoming request we make our services post unique values that map to that sets. We can have up to or more than `10 000` such values sets on each machine per each service.               service A machine 1     name = Sam     id = 13245     ...     service A machine 1     name = Ben     id = 33232     ...     ...     service A machine 100     name = Ron     id = 777888     ...      So we get `200 * 10 * 30 * 30 * 10 000 == 18 000 000 000` and we get `500` requests per second on our gateway each containing `45` items `15` of which are just `noise`. And our task is to find a service for request (at least a machine it is running on). On all machines all over cluster for same services we have same rules. We can first select to which service came our request via rules filter `10 * 30`. and we will have `200 * 30 * 10 000 == 60 000 000`. So... `60` mil is definitely a problem... I hope to get on idea of mapping `30 * 10 000` onto some artificial neural network alike Perceptron that outputs `1` if `30` words (some hashes from words) from the request are correct or if less than Perceptron should return 0. And I’ll send each such Perceptron for each service from each machine to gateway. So I would have a map `Perceptron <-> machine` for each service. Can any one tall me if my Perceptron idea is at least “sane”? Or normal people do it some other way? Or if there are better ANNs for such purposes?


title: Source code metrics for measuring code stability?

text: Considering how software is developed during a release cycle (implementation, testing, bug fixing, release) I was thinking that one should be able to see some pattern in the lines of code that are changed in the code base; e.g. towards the end of a project, if the code becomes more stable, one should see that fewer lines of code are modified per unit of time. For example, one could see that during the first six months of the project, the average was 200 lines of code per day while during the last month it was 50 lines of code per day, and during the last week (just before the product DVD's were shipped), no lines of code were changed at all (code freeze). This is just an example, and different patterns could emerge according to the development process adopted by a particular team. Anyway, are there any code metrics (any literature on them?) that use the number of modified lines of code per unit of time to measure the stability of a code base? Are they useful to get a feeling if a project is getting somewhere or if it is still far from being ready to release? Are there any tools that can extract this information from a version control system and produce statistics?


title: Why isn't SSL/TLS built into modern Operating Systems?

text: A lot of the basic network protocols that make up the infrastructure of the Internet are built in to most major Operating Systems. For example, TCP, UDP, and DNS are all built into Linux, UNIX and Windows, and are made available to the programmer through low-level system APIs. But when it comes to SSL or TLS, one has to turn to a third-party library such as OpenSSL or Mozilla NSS. SSL is a relatively old protocol, and it's basically an industry standard as ubiquitous as TCP/IP, so why isn't it built into most Operating Systems?


title: Understanding the problem when things break in production

text: **Scenario:**   * You push to production   * The push broke multiple things   * That same build did not break qa or dev   * As a developer, you don't have prod access.    * There is lots of pressure from _above_ to get things working agian. **Specifics:**   * PHP/MVC application that is API-driven in Zend.   * Deployed to a few servers. **My question:** While investigating, lets say I have a hunch that something is wrong. But, I don't know for sure. And, of course, I can't test things in production. If I have a suggested fix based on that hunch, would it be wise to try and apply it and see if it works, before understanding what the problem is?


title: How can I deal with a team member who dislikes making comments in code?

text: One of my team members consistently avoids making comments in his code. His code is not self-documenting, and other programmers have a difficult time understanding his code. I have asked him several times to comment his code, however he just gives excuses or claims that he will do it later. His concern is that adding comments will take too much time and delay the projects. What argument can I present to him to convince him to properly document his code? On that note, am I wrong to focus on the code comments or is this indicative of a larger problem which should be addressed?


title: What the right pattern to Use here

text: scenario: I have an entity called `Member`. Members fall into multiple types. Some types are below.   * `Supporter`   * `Volunteer`   * `Sponsor`   * `Player` I can create class for each type and inherit from the base `Member` entity. But when a `Member` has more than 1 type in a given time, it is not the right way. can I use **decorator pattern** to achieve this intent? Or what the best pattern to get this work? **EDIT :** Language I use is C# Also different Member types can have additional methods, for example, `Sponsor` can have its own methods as `Donate()`, Or the `Volunteer` can have a method `Subscribe()` and so on. these thing have to be considered.


title: A word for storing pre calculated-constructed data

text: I precalculate data and store it in a static table and call this process 'caching' but that doesn't seem correct based on a quick dictionary search (hiding, concealing) I'm just saving the data statically to avoid the process time to make the calculation. Is there a more appropriate term/word? I think the key words here are 'static' and 'calculated' ## Probable Answers: ## As a noun (the actual output from such a process): Lookup Table ## As a verb (the process of getting there): Tabling


title: How can a developer test himself for starting a development company on his own?

text: Ya !! you can say "out of work" people have these thoughts, but then, what can one do :-P . My question is somewhat deep thought. How can someone evaluate himself as a developer and manager to understand whether or not, he is fit for starting a commercial venture on his own. Starting a development company doesn't need too much of an investment and neither it requires a big team. If one is capable developer, then he can definitely get the ball rolling on day one. And may be that's the reason why there are so many freelancers around the world. Doubts are severe thing and once they creep-in, they make travel tough. So, can there be some things or self-assessment kinda test that one must evaluate and pass to boost his idea of development venture.


title: Using Fonts in your Applications

text: When writing applications for software, specifically mobile devices, will there be a problem with using any specific type of fonts (copyright/patent issues)? If so, how can we avoid this possible problems? Will it then make a difference if the app was a paid version or a free version?


This seems an extreme question probably but I'm wondering anyhow: Can all business logic be decomposed as a (declarative) state diagram on simple crud operations and conditionals? Already a _lot_ of lower-level domain logic _can_ , and ofen _is_ declaratively defined with ORM-mappings for instance, handling things like:   * domain-model schema   * validation   * uniqueness constraints   * ACL/ Role-based authorization, etc Of course higher-level domain logic exists that often involves coordinating between multiple Domain Objects. However, it seems ultimately:   * This high level business logic really is just a workflow that can be modeled as a state-machine (or probably more extensive as a extended petrinet)    * in which all branching is based on conditional logic on some state (i.e: domain object attributes)    * the outcome would be a statechange, i.e: a change to domain object attributes (simple crud operations).  If this is the case, could all domain logic be declaratively defined, given a DSL that would support the above workflow, conditional, and CRUD constructs? If you dismiss this braindump please be insightful while doing so :)


title: Writing low latency Java

text: Are there any Java-specific techniques (things which wouldnt apply to C++) for writing low latency code, in Java? I often see Java low latency roles and they ask for experience writing low latency Java- which sometimes seems a little bit of an oxymoron. The only think I could think of is experience with JNI, outsourcing I/O calls to native code. Also possibly using the disruptor pattern, but thats not an actual technology. Are there any Java specific tips for writing low latency code? I am aware there is a Real Time Java Spec, but I have been warned real-time is not the same as low latency....


title: How does one store a website's holding/maintenance page in Git?

text: I'm trying to tidy up the Git repositories for the few sites that I maintain. For each site, I usually create a separate branch in the repo that holds a "maintenance page" or "holding page", which I checkout if I need to take the site down for any reason. This branch is usually called `maintenance_page`. Normal development is done against `master` and the live site is also deployed from there. Whilst the site code in the `maintenance_page` branch has the same styling as the main (live) site in `master`, it doesn't really share any _history_ with the master branch - think of it like a mini version of the live site, but with it's own basically unrelated codebase. From time to time, changes that I make to the styling, images, etc. in `master` would be useful to have in the `maintenance_page` branch and in these situations, I usually `git cherry-pick` from `master` to `maintenance_page`. I've been working with this setup for a while now, however, I'm conscious that the whole idea of having the two branches (`master` and `maintenance_page`) coexisting in the same repository, but not having anything _really_ in common with each other is not really the "Git way of doing things". I've thought of storing the `maintenance_page` branch in it's own repo (as it has very little in common with the master branch), however this just seems to complicate the administration of the repositories and also detracts from the simplicity of being able to simply checkout the `maintenance_page` branch, when I need to take the site down elegantly. I've had a good read around (see here) (and here) to try to find out how other people handle this kind of thing, but I'm strangely unable to come up with any pointers on how other achieve this. Does anyone have any suggestions on better ways to achieve this?


title: Frame Pointer Explanation

text: In MIPS assembly, there is a register for the stack pointer, and another register for the frame pointer. What is the frame ponter and what is its purpose. How does it differ from the stack pointer?


title: Why sequential cohesion for operations in a method is not a good idea?

text: I read from the seminal Code Complete book that method statements that require to be executed in order passing parameter from one to the next is a code smell and is an example of a _sequential cohesion_. Why is this not a good idea? A contrived example of a sequential cohesion:               public Part createPart(input) {             PartOne partOne = computePartOne(input);             PartTwo partTwo = computePartTwo(partOne);             PartThree partThree = computePartThree(partTwo);             PartsBuilder partsBuilder = new PartsBuilder();             return partsBuilder.add(partOne).add(partTwo).add(partThree).build();         }      Here is the exert: > Several other kinds of cohesion are normally considered to be less than > ideal: > > _Sequential cohesion_ exists when a routine contains operations that must be > performed in a specific order, that share data from step to step, and that > don't make up a complete function when done together. > > An example of sequential cohesion is a routine that, given a birth date, > calculates an employee's age and time to retirement. If the routine > calculates the age and then uses that result to calculate the employee's > time to retirement, it has sequential cohesion. If the routine calculates > the age and then calculates the time to retirement in a completely separate > computation that happens to use the same birth-date data, it has only > communicational cohesion. > > How would you make the routine functionally cohesive? You'd create separate > routines to compute an employee's age given a birth date and compute time to > retirement given a birth date. The time-to-retirement routine could call the > age routine. They'd both have functional cohesion. Other routines could call > either routine or both routines.


title: What if my nested class extends another class from another package?

text: I'm in doubts this design is OK, it may be there is a way to do it better? The case is that I need a class which would be used in one and only class and that's it. But, this class needs to inherit from another one, which is in another package. This doesn't sound right as for me.               public class User {          private class SpecificParser extends BaseParser {} // BaseParser.java is in another package          }      I would simply create `SpecificParser` as a separate class, but don't want to do that also because the only consumer of it is a `User` class.


title: Adding complexity by generalising: how far should you go?

text: Reference question: http://stackoverflow.com/questions/4303813/help-with- interview-question The above question asked to solve a problem for an NxN matrix. While there was an easy solution, I gave a more general solution to solve the more general problem for an NxM matrix. A handful of people commented that this generalisation was bad because it made the solution more complex. One such comment is voted +8. Putting aside the hard-to-explain voting effects on SO, there are two types of complexity to be considered here:   1. Runtime complexity, i.e. how fast does the code run   2. Code complexity, i.e. how difficult is the code to read and understand The question of runtime complexity is something that requires a better understanding of the input data today and what it might look like in the future, taking the various growth factors into account where necessary. The question of code complexity is the one I'm interested in here. By generalising the solution, we avoid having to rewrite it in the event that the constraints change. However, at the same time it can often result in complicating the code. In the reference question, the code for NxN is easy to understand for any competent programmer, but the NxM case (unless documented well) could easily confuse someone coming across the code for the first time. So, my question is this: Where should you draw the line between generalising and keeping the code easy to understand?


title: External sqlite db file from sdcard in android

text: I just searched for the same but didn't get the answers. What I have is a `db` file which is around `100MB`. I have saved the `db` file in `sdcard` . Through this `db` file I'm going to populate the contents for the android app. I can read the db file using like below.               File dbfile = new File("/sdcard/Your_db_File.db" );      SQLiteDatabase  db = SQLiteDatabase.openOrCreateDatabase(dbfile, null);      What I'm concerned is about the memory. I have read like in `assets` it has some memory limitations. I'm just worried like will `100MB` of db file in sdcard or external memory is a harm or is it OK to have `100MB` db file? Or is there any limitations for sqlite db file in external storage as well? Suggestions are appreciated.


title: Are programmers who read programming-related books still rare?

text: Both in _Code Complete_ by Steve McConnell and _The Pragmatic Programmer_ by Andrew Hunt & David Thomas, they allege that most programmers don't read programming-related books as a habit, or at least not often enough. Does this still hold? Are programmers who do read such books still rare? I must admit that only quite recently did I start reading (and now I can't stop; it's burning a whole in my wallet!). Before I was actually against it and argued that it's better to write programs than to waste time reading about it. Now I realize that the best outcome, for me at least, is to do both. **EDIT:** I actually meant _any_ kind of books that on way or another was related to programming; be it either on a particular language, technology, pattern, paradigm - _anything_ as long as it may benefit you as a programmer. I was just referring to _Code Complete_ and _The Pragmatic Programmer_ because that's where I read that programmers don't usually read such books. It would have looked stranged if the title just read "Are programmers who read books still rare?"