How do you keep your basic skills from atrophy?

I've been programming for about 10 years, and I've started to migrate to more of a project management position. I still do coding, but less often now. One of the things that I think is holding me back in my career is that I can't "let go". I think I fear letting hard-won programming skills atrophy while I sit in meetings and annotate requirements. (Not to mention I don't trust people to write requirements who don't understand the code.) I can't just read books and magazines about coding. I'm involved in some open source projects in my free time, and stackoverflow and friends help a bit, because I get the opportunity to help people solve their programming problems without micromanaging, but neither of these are terribly structured, so it's tempting to work first on the problems I can solve easily. I guess what I'd like to find is a structured set of exercises (don't care what language or environment) that…   * …I can do periodically   * …has some kind of time requirement so I can tell if I've been goofing off   * …has some kind of scoring so I can tell if I'm making mistakes Is there such a thing? What would you do to keep your skills fresh?


Vector operations: vec1.dot(vec2) vs vec1 * vec2 vs dot(vec1, vec2)

What's your preferred way to implement/use vector operations?   * vec1.dot(vec2)      * allows to reuse vec1 but is hard to read for longer equations   * dot(vec1, vec2)      * A friend of mine prefers this as "dot" isn't a property of vector   * vec1 * vec2      * probably looks best, but not possible in all languages (e.g. Java)


Moving from PHP to Python - framework considerations

As a long time PHP developer, I am now starting to explore the Python world. I have narrowed the choice of framework down to Django and Pyramid, probably no big surprise there. I have played a bit both both frameworks. I really like Djangos admin, and the fact that everything is already integrated. My concern with Django, however, is that it appears more difficult to break out of doing things the way that they want you to. For a large complex site, that could be problematic down the road. Is this a valid concern? What really caught my eye is that the community for Django seems MUCH larger. Let alone the massive number of docs and tutorials for Django (couldnt fine much for Pyramid outside the official docs?). Of biggest concern is the sheer number of apps that have been built specifically for Django: south, tastypie, multi-tenancy, registration, etc. Am I right to assume that these apps are (mostly?) Django specific, and that they cant be used in Pyramid? Where are the Pyramid specific apps? Or, will they interoperate just fine?


CSRF Protection with codeigniter

I have very little knowledge in application security. I have often seen to protect your application from csrf attacks developers use tokens and pass these tokens with request to validate. I want to know if i just validate the request is coming from my server and rejects all requests coming from any other server how can it be unsafe?


Use of the Visitor pattern and possible over engineering

I am developing a small application in .NET and am thinking of using XML to save the object model. My first thought was to separate the model and the generation of XML by using the Visitor pattern. The class would walk the object hierarchy and create the XML. But then I thought about the Extreme Programming method and the "you ain't gonna need it" (YAGNI) principle. I don't envisage needing to create another Visitor to output the data in some other way (it's a simple app) I just want to use a human readable format to save the application's data. Should I use the Visitor pattern or am I just over engineering the solution?


Structure of a single page app

I'm looking to develop a one page app, and will likely be using node.js for my server side coding. I'm trying to get some advice regards the client-side coding. While i realise that something like backbone.js would really help me, since im very new to development the learning curve is very high for me. So i'm going to be using something like dust.js for my client side templating. Currently i'm creating some mockup screens (there are 4 in total) that are being built in just plain html/css. When i come to doing the client side and server coding, is it better for me to combine all my presentation code into one html file, or into multiple files and then call them separately, considering it's a one page app that i am creating?


How to choose between lightweight or heavyweight framework for web application

In my current role as a software developer in a **Java/Spring/Hibernate/JSF** shop, I am sometimes asked to develop large-scale web apps with many interfacing systems and/or large databases _as well as_ small-scale web apps with low traffic and/or simple databases. To accommodate this variation, I would like to have 2 technology stacks to choose from, depending on the type of application I'm asked to develop. I think this would benefit us because I think our technology stack that I mentioned above is a bit over-engineered or cumbersome for small, simple CRUD applications. If, for example, I have chosen **Spring Framework** for my large-scale apps and **Play! Framework** for my small-scale apps, how do I choose which one to use for a given application? In other words, how can I tell if a proposed web application qualifies for a heavy framework like Spring or could stand to benefit more from a lightweight, agile framework like Play? Can someone give me some rough checkpoints to help me decide which type of framework to use (heavy or light)? If you use this two-framework approach, please tell me what criteria you use to decide which framework is the best fit for a given web application.


Does the syntax of programming languages depend upon their implementation?

Although, my question may be entirely irrelevant, but I have sensed a pattern between most programming languages and their official implementations. **Interpreted** (byte-interpreted?) languages like Python , Lua etc. usually have an extremely lenient and easy syntax and are generally type-less or do not require the developer to explicitly write variable types in source code; **Compiled** languages like C , C++ , Pascal etc. usually have a strict syntax, generally have types and mostly require more code / development time Languages whose official implementations are **JIT-Compiled** like Java / C# usually are a unique compromise between the above two with some of the best features of both. Some of the more modern compiled programming languages like D and Vala (and the GNU GJC implementation of Java) are perhaps an exception to this rule and resemble the Syntax and features of JIT-Compiled languages like Java and C#. My first question is, is this really relevant? Or is this just a coincidence that most interpreted languages have easy syntax , JIT-Compiled ones have a moderate syntax and features etc. Secondly, if this is not a coincidence, then why is it so? Like, for example, can some features only be implemented in a programming language if you are, say, JIT-Compiling it?


Should I change author name in class file if I make more than 80% changes?

I am refactoring existing set of java test classes for automated UI tests. At times I end up in making massive changes in class file or completely revamping it. This makes me think that when I am rewriting entire class then should I change author name in comment section to mine? Am I being greedy? or is it going to be useful for one to see my name and ask me in case of doubts?


Are More Comments Better in High-Turnover Environments?

I was talking with a colleague today. We work on code for two different projects. In my case, I'm the only person working on my code; in her case, multiple people work on the same codebase, including co-op students who come and go fairly regularly (between every 8-12 months). She said that she is liberal with her comments, putting them all over the place. Her reasoning is that it helps her remember where things are and what things do since much of the code wasn't written by her and could be changed by someone other than her. Meanwhile, I try to minimize the comments in my code, putting them in only in places with a unobvious workaround or bug. However, I have a better understanding of my code overall, and have more direct control over it. My opinion in that comments should be minimal and the code should tell most of the story, but her reasoning makes sense too. Are there any flaws in her reasoning? It may clutter the code but it ultimately could be quite helpful if there are many people working on it in the short- to medium-run.


Which framework for HTML5 mobile web app?

I used to be an iPhone app developer. Now there are frequent enquires on cross-platform mobile app. So I look for a web based solution and find Sencha Touch. Are there more options? What's your experience and comment on these frameworks? Thanks!


Which GOF design patterns are already implemented as first-class language features in C#?

(This question was closed on Stack Overflow due to being "too broad" and "not a real question" so maybe it's more appropriate here?) Inspired by this question. We know events are a language-level implementation of the Observer pattern. Are there other design patterns implemented as language features in C#? I want to keep this question C#-specific because there are lots of design patterns implemented in other languages, and I want to keep this focused. I'm not looking for pattern implementations in the BCL (such as decorator in many WCF classes or Factory Method in `WebClient`), but _language-level_ patterns. So far I'm aware of observer (`event`) and iterator (`foreach` in combination with many BCL classes and interfaces). There are probably other obvious ones I'm missing.


front end development test - html/css/jquery/javascript

We are continually revamping our front end developer test that we do in-house after a candidate has passed an online test. The online test has questions such as:   * How does a for loop start?   * What is the correct way to write a JavaScript array?   * Write the css selector for the 3rd list item within an ordered list with the id "myList"   * For var shoppingList = ["milk", "dumplings", "bread"]; - how would you return dumplings into a variable named groceryItem?   * FizzBuzz So we cover the basics, and try to get an insight into their knowledge. But, in house, we really want to test their problem solving skills, their logic approach, etc. And I don't think we've found a good way to do that for front end developers. For UI guys, it's easier - we give them a design challenge and a white board and see if they ask for more information, how they approach the problem, etc. But we haven't found a way to replicate this approach with web developers (for the record, I am one of the web developers on the team) Thoughts on how to approach?


Light bulb for prolonged computer use

I would like a recommendation on choosing which light-bulb type (e.g. CFL) and color temperature is best for prolonged computer usage. I am also in a field where color consistency is important so if a specific lamp temperature is useful, I would like to know as well.


What are the alternatives to "overriding a method" when using composition instead of inheritance?

If we should favor composition over inheritance, the data part of it is clear, at least for me. What I don't have a clear solution to is how overwriting methods, or simply implementing them if they are defined in a pure virtual form, should be implemented. An obvious way is to wrap the instance representing the base-class into the instance representing the sub-class. But the major downsides of this are that if you have say 10 methods, and you want to override a single one, you still have to delegate every other methods anyway. And if there were several layers of inheritance, you have now several layers of wrapping, which becomes less and less efficient. Also, this only solve the problem of the object "client"; when another object calls the top wrapper, things happen like in inheritance. But when a method of the deepest instance, the base class, calls it's own methods that have been wrapped and modified, the wrapping has no effect: the call is performed by it's own method, instead of by the highest wrapper. One extreme alternative that would solve those problems would be to have one instance per method. You only wrap methods that you want to overwrite, so there is no pointless delegation. But now you end up with an incredible amount of classes and object instance, which will have a negative effect on memory usage, and this will require a lot more coding too. So, are there alternatives (preferably alternatives that can be used in _Java_ ), that:   * Do not result in many levels of pointless delegation without any changes.   * Make sure that not only the client of an object, but also all the code of the object itself, is aware of which implementation of method should be called.   * Does not result in an explosion of classes and instances.   * Ideally puts the extra memory overhead that is required at the "class"/"particular composition" level (static if you will), rather than having every object pay the memory overhead of composition. My feeling tells me that the instance representing the base class should be at the "top" of the stack/layers so it receives calls directly, and can process them directly too if they are not overwritten. But I don't know how to do it that way. [EDIT] It seems that many people reading this question think that I am debating if I should use Composition or Inheritance, and that "guiding" me to the one or the other will solve my problem. This is not the case. I always use inheritance when I can, for the simple fact that composition requires more coding, and also more memory. No need to convince me that inheritance is not evil. I have a very good reason to want to use composition. I want to create a system that model domain objects that can "change nature" over time. That is they can both gain and loose functionality/properties over time, as a result of some actions. This is a lot more natural when modeled as composition. If the components that can be dynamically added and removed where composed only of properties, it would be easy. In fact I have already found 14 different possible designs that support that case, with varying compromise on code complexity, memory usage, and speed. The real problem comes when all those components need to be aware of each other, and talk to each other. This is not required when they are just "beans" (in the Java sense). I want to know if there are any, and hopefully several, ways of allowing the components to talk to each other, and more specifically how to have several components _of the same type_ , where one serves as base- class and the others progressively override some of it's methods. I can see two ways to simulate the overriding present in inheritance. The first is to have a base component, and all overriding components are built as wrapper on top of another component of the same type. Like that, you can choose at runtime which hierarchy of components you want. This is like pipes and filters. But the problem is that with inheritance, not only can the derived class call methods of the base class, but it works the other way around too. A base class can declare a pure virtual method, which is implemented by the sub-class, and the base class can call this method. I don't see how to accomplish that using whole component wrapping. Also, if we have N inheritance/wrapping layers, then calls to method of the base component then gets N level of delegation, even if the method was not overwritten by any of the wrapping components. The other alternative, like I said in "One extreme alternative ...", is to do it like above, but forcing each component to contain _a single method_. In that case we solve the problem of the base-class not seeing/calling the methods of the derived classes, for all methods, except it's own method. So it works now correctly for all cases except for recursion. But the price we pay in memory consumption is high, at least in Java. And Java isn't "functional", so there is a lot of syntax overhead to turn every object method into an individual object. If there any better alternatives then the two mentioned above, I would like to know about it.


How broad should a computer science/engineering student go?

I have less than 2 years of college left and I still don't know what to focus on. But this is not about me, this is about being a future developer. I realize that questions like "Which language should I learn next?" are not really popular, but I think my question is broader than that. I often see people write things like "You have to learn many different things. Being a developer is not about learning one programming language / technology and then doing that for the rest of your life". Well, sure, but it's impossible to really learn everything thoroughly. Does that mean that one should just learn the basics of everything and then learn some things more thoroughly AFTER getting a particular job? I mean, the best way to learn programming is by actually programming stuff... But projects take time. Does an average developer really switch between (for example) being a web developer, doing artificial intelligence and machine learning related stuff and programming close to the hardware? I mean, I know a lot of different things, but I don't feel proficient in any of those things. If I want to find a job as a web developer (that's just an example) after I finish college, shouldn't I do some web related project (maybe using something I still don't know) rather than try to learn functional programming? So, the question is: How broad should a computer science student's field of focus be? One programming language is surely far too narrow, but what is too broad?


How to structure a trainee program?

At my company we are thinking about starting a trainee program for software developers. We are thinking about attracting people with a CS degree, but little or no experience (or people with relevant experience but no degree). I'm wondering what the trainee program should offer and how to structure it. We want the trainees to be real members of our development team, but use a higher level of supervision, peer review, pair programming etc. We should also provide some amount of lecturing/mentoring and provide some required reading. I'm thinking the program should contain a plan for two years, but I'm not sure. Trainee programs are not common for software developers in my country. So what elements would you include? How do you suggest we structure the mentoring? What principles and practices should we focus on, and how should we draw up the "curriculum"? PS: Our current team consists of four highly skilled agile developers. We mostly do .NET and practice TDD.


Minimum billable time unit - industry standard for contract programming?

We're a client that recently hired a contract programming company for some fairly focused work (essentially writing 'scripts' to extend the functionality of a third-party enterprise application). We're trying to evaluate their performance on and the value of some work they did for us, but we're a little new to using contract programmers and could use some help:   1. If you were hiring a company as a contractor to do computer program development for you, and the minimum billing time unit was not mentioned in the contract, would you expect to be billed in whole-hour increments (so that a phone call of 5 minutes is billed as 1 hour)?   2. What is industry standard practice for the minimum billable time unit in contract programming work?   3. If you hired a contracting company that had two employees, would you expect each person's time to be broken out and rounded up to the minimum billable time unit? Let's say the senior guy worked with the junior guy for 15 minutes, and the junior guy worked 4:15 that day. Would you take exception to a bill for 1 hour (senior guy) plus 5 hours (junior guy), or would you expect a bill for just 5 hours? You may find my follow-up question about key contract points interesting.


What sort of role does "language cultural history" play with a platform?

I recently stumbled accross this article from a few years ago. It argues that significant differences in the culture surrounding VB and C#, not the actual differences in the language, contribute to C# coders being generally more talented than VB coders. Obviously, that caused a lot of flame wars and the question of whether C#ers or VBers are the dumber will never be answered. That being said, the writers claim that the culture surrounding a particular platform contributes to the quality of the team could still be plausible. For example, even though Java is more efficient to develop apps with at the moment, a team of Google Go developers would seem likely to be of a higher caliber on average than a team of Java developers, since to learn Go, a developer probably has to be a super-early adopter and a frontier-hacking whiz. So, in a nutshell, **how does the culture surronding one platform or another affect the quality of the average developer on that platform, if at all?**


Writing programs without graphical IDE

I am not sure if this is even possible but I have watched a few videos with programming examples where it seems like the program is being written in some kind of command prompt rather than a nice graphical IDE. Im just curious as to what might be going on in these videos. Is it possible to write a program without an IDE? heres two examples: http://www.youtube.com/watch?v=hFSY9cWjO8o( @ 6 min) http://www.youtube.com/watch?v=tKTZoB2Vjuk (@ 5 min) Could anyone explain how this is done? Thank you all for the great feedback!


Scaling Up applications

What should I consider when taking an application (web) from a few users to hundreds or thousands? Basically, what should I be considering when thinking about escalating?


How did you become a const correctness convert?

After 15 years of C++, I've still haven't learn to love using const. I understand it's use, but I've never actually been in situation where being const correct would have avoided the problem I was facing. So how did you come to love benefits of consts?


Multi-Threaded JavaScript?

I know, I know--it isn't possible presently BUT my question is this: Would it be possible to write a browser plug in for the major browsers that _enables_ true, multi-threaded JavaScript? It just seems like this would be possible and, if so, it would take the web (not to mention JavaScript) to new heights. Thanks!


The Observer pattern using the pulling mechanism

I was wondering about the following implementation of               public void update(Observable obs, Object arg)      while i want to send to all of my observer and update using `notifyObserver()` i and passing a references to `this` the observer can use the `getters` from the subject to pull the information he wants. what is the `arg` argument on the update method meant for?


Use controller in view in MVC

I have a problem convincing my team mates why we shouldn't use (directly reference) the controller in the view when developing components in the spirit of MVC. I have invoked decoupling and natural intuition, but still those arguments didn't get through. They say, in their defense, that this is a normal compromise. What arguments are convincing? Or they are right? How can the practice of using the controller in the view could affect a project on the long run?


Does a project typically get built or designed (graphically) first?

Say you are going to build a fairly large website. Would all the pages be designed before they are built, or would all the pages be built and functional before they are graphically designed? I am a programmer and a graphic designer. When build a new website I usually have a rough outline of all the pages I am going to need and how they are going to work. I then usually start to build the pages, as I build the pages I tend to design the graphical interface at the same time. I am starting to think this is bad because each page ends up looking good, but not uniform. Or even if they _appear_ uniform they really aren't. For example, on **page A** and **page B** the heading looks the same but on **page A** it has a `50px margin` while on **page B** it has a `50px padding`. The styling for the heading on **page A** is defined in one `CSS` file and the styling for the heading on **page B** is defined in another. Over time it can become a giant mess. I need a new approach. There are many ways I have learned to keep this kind of thing from happening in code (DRY). I don't really know how to apply them in this area though. Or maybe I just don't currently have the discipline. One idea is, after the project outline is complete, create graphical designs of how all the pages will look before I build any. Then I should be able to design the styles before building the pages so I won't be introducing duplicate style definitions as I build. The problem is, before I design a page with HTML/CSS, I design it in Photoshop. However, they don't always workout exactly the way I designed them in Photoshop. Sometimes I have to make adjustments to get it to look right on the page. Sometimes the adjustments needed differ from page to page. I don't see how I can plan this ahead of time. What's the normal workflow for something like this?


Dealing with class optional dependencies

I am wondering how are you guys handling an optional class properties. Let's say I have a product that can bud doesn't have to have a `color` property. Is that really the best way of doing that? Should I use null object pattern? Should I use strategy pattern maybe? Should I maybe use a decorator pattern here so I'll have `Product` and `ProductWithColor`? What if another property will be added and become optional?               <?php          class Product     {         private $id;         private $title;              /**          * @var string|null          */         private $color;              function __construct($id, $title, array $color = null)         {             $this->id              = $id;             $this->title           = $title;             $this->color           = $color;         }     }


OpenGL FrameBufferExternal Two Different Target

Im trying to use framebuffer objects to render into textures. In my code below, I have a framebufferobject with 2 textures and one depth buffer attached to it. My aim is to render a colored cube with front and back face culled for two textures. Later I will use these as inputs into fragment shader program named in my code "shaderProgramFinal". However I could not been able to render both back culled and front culled version at the two textures. They either become back culled or front face culled version simultaneously. I want frontTex contain back culled and backTex contain front culled version. Can anyone help me where Im wrong in my code below?               #include <GL/glew.h>     #include <GLFW/glfw3.h>     #include <stdlib.h>     #include <stdio.h>     #include "Shader.hpp"     #include "ShaderProgram.hpp"     #include <math.h>     #include <glm/glm.hpp>     #include <glm/gtc/matrix_transform.hpp>     #include <glm/gtc/type_ptr.hpp>     #include <glm/gtx/euler_angles.hpp>          #define screenSizeX 500     #define screenSizeY 500          GLFWwindow* window;          static void error_callback(int error, const char* description){fputs(description, stderr);}          void glSetup(){     glfwInit();     glfwSetErrorCallback(error_callback);     glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);     glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR,4);     glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR,0);     glfwWindowHint(GLFW_OPENGL_PROFILE,GLFW_OPENGL_CORE_PROFILE);     glfwWindowHint(GLFW_RESIZABLE,GL_FALSE);     window = glfwCreateWindow(screenSizeX, screenSizeY, "Graphics World", NULL, NULL);     glfwMakeContextCurrent(window);     glewExperimental = GL_TRUE;     glewInit();     printf ("Renderer: %s\n", glGetString (GL_RENDERER));     printf ("OpenGL version supported %s\n", glGetString (GL_VERSION));     glEnable (GL_DEPTH_TEST);     glDepthFunc (GL_LESS);     }          void shaderSetup(Shader* vertexShader, Shader* fragmentShader, ShaderProgram* shaderProgram){     vertexShader->loadFromFile("myVert.S");     vertexShader->compile();     fragmentShader->loadFromFile("myFrag.S");     fragmentShader->compile();     shaderProgram->attachShader(*vertexShader);     shaderProgram->attachShader(*fragmentShader);     shaderProgram->linkProgram();     shaderProgram->addAttribute("Position");     shaderProgram->addAttribute("ColorC");     shaderProgram->addUniform("rotateMatrixX");     shaderProgram->addUniform("rotateMatrixY");     shaderProgram->addUniform("rotateMatrixZ");     }          void shaderSetupFinal(Shader* vertexShader, Shader* fragmentShader, ShaderProgram* shaderProgram){     vertexShader->loadFromFile("myVertFinal.S");     vertexShader->compile();     fragmentShader->loadFromFile("myFragFinal.S");     fragmentShader->compile();     shaderProgram->attachShader(*vertexShader);     shaderProgram->attachShader(*fragmentShader);     shaderProgram->linkProgram();     shaderProgram->addAttribute("Position");     }          int main(void)     {     glSetup();          Shader vertexShader(GL_VERTEX_SHADER);     Shader fragmentShader(GL_FRAGMENT_SHADER);     ShaderProgram* shaderProgram = new ShaderProgram();     shaderSetup(&vertexShader, &fragmentShader, shaderProgram);          Shader vertexShaderFinal(GL_VERTEX_SHADER);     Shader fragmentShaderFinal(GL_FRAGMENT_SHADER);     ShaderProgram* shaderProgramFinal = new ShaderProgram();     shaderSetupFinal(&vertexShaderFinal, &fragmentShaderFinal, shaderProgramFinal);          float vertices[] = {     -0.5f,  0.5f, -0.5f, 0.0f, 1.0f, 0.0f, //Green0     -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, 0.0f, //Black1      0.5f, -0.5f, -0.5f, 1.0f, 0.0f, 0.0f, //Red2      0.5f,  0.5f, -0.5f, 1.0f, 1.0f, 0.0f, //Yellow3     -0.5f,  0.5f, 0.5f, 0.0f, 1.0f, 1.0f, //Cyan4     -0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, //Blue5      0.5f, -0.5f, 0.5f, 1.0f, 0.0f, 1.0f, //Magenta6      0.5f,  0.5f, 0.5f, 1.0f, 1.0f, 1.0f //White7     };          GLuint elements[] = {     2,0,3,     2,1,0,     6,4,5,     6,7,4,     3,4,7,     3,0,4,     2,6,5,     2,5,1,     2,3,7,     2,7,6,     1,5,4,     1,4,0     };          float verticesFinal[] = {     -1.0f, -1.0f, 0.0f,      1.0f, -1.0f, 0.0f,      1.0f,  1.0f, 0.0f,     -1.0f,  1.0f, 0.0f     };          GLuint elementsFinal[] = {     0,1,3,     1,2,3     };          GLuint VAO, VBO, EBO, backTex, frontTex, frameBuffer, renderBuffer, VAOFinal, VBOFinal, EBOFinal;          glGenVertexArrays(1, &VAO);     glBindVertexArray(VAO);          glGenBuffers(1, &VBO);     glBindBuffer(GL_ARRAY_BUFFER, VBO);     glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);     glEnableVertexAttribArray(shaderProgram->attribute("Position"));     glVertexAttribPointer (shaderProgram->attribute("Position"), 3, GL_FLOAT, GL_FALSE, 6*sizeof(GLfloat), NULL);     glEnableVertexAttribArray(shaderProgram->attribute("ColorC"));     glVertexAttribPointer (shaderProgram->attribute("ColorC"), 3, GL_FLOAT, GL_FALSE, 6*sizeof(GLfloat),  (void*)(3 * sizeof(GLfloat)));          glGenBuffers(1, &EBO);     glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, EBO);     glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(elements), elements, GL_STATIC_DRAW);          glGenTextures(1, &backTex);     glBindTexture(GL_TEXTURE_2D, backTex);     glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);     glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, screenSizeX, screenSizeY, 0, GL_RGBA, GL_FLOAT, NULL);     glBindTexture(GL_TEXTURE_2D, 0);          glGenTextures(1, &frontTex);     glBindTexture(GL_TEXTURE_2D, frontTex);     glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);     glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, screenSizeX, screenSizeY, 0, GL_RGBA, GL_FLOAT, NULL);     glBindTexture(GL_TEXTURE_2D, 0);          glGenFramebuffersEXT(1, &frameBuffer);     glGenRenderbuffersEXT(1, &renderBuffer);     glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, frameBuffer);     glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, backTex, 0);     glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT, GL_TEXTURE_2D, frontTex, 0);          glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, renderBuffer);     glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, screenSizeX, screenSizeY);     glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, renderBuffer);     GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER_EXT);     if(status != GL_FRAMEBUFFER_COMPLETE) cout << "Frame buffer yokki!\n";     glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);          glGenVertexArrays(1, &VAOFinal);     glBindVertexArray(VAOFinal);          glGenBuffers(1, &VBOFinal);     glBindBuffer(GL_ARRAY_BUFFER, VBOFinal);     glBufferData(GL_ARRAY_BUFFER, sizeof(verticesFinal), verticesFinal, GL_STATIC_DRAW);     glEnableVertexAttribArray(shaderProgramFinal->attribute("Position"));     glVertexAttribPointer(shaderProgramFinal->attribute("Position"), 3, GL_FLOAT, GL_FALSE, 3*sizeof(GLfloat), NULL);          glGenBuffers(1, &EBOFinal);     glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, EBOFinal);     glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(elementsFinal), elementsFinal, GL_STATIC_DRAW);          while (!glfwWindowShouldClose(window))     {         double mouseX, mouseY;         glfwGetCursorPos(window, &mouseX, &mouseY);         mouseX -= screenSizeX/2;         mouseY -= screenSizeY/2;              shaderProgram->use();         glBindVertexArray(VAO);         glUniformMatrix4fv(shaderProgram->uniform("rotateMatrixX"), 1, GL_FALSE,       glm::value_ptr(glm::eulerAngleX((float)(mouseY/25.0))));         glUniformMatrix4fv(shaderProgram->uniform("rotateMatrixY"), 1, GL_FALSE, glm::value_ptr(glm::eulerAngleY((float)(-mouseX/25.0))));         glUniformMatrix4fv(shaderProgram->uniform("rotateMatrixZ"), 1, GL_FALSE, glm::value_ptr(glm::eulerAngleY((float)(0.0/50.0))));              glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, frameBuffer);         glBindTexture(GL_TEXTURE_2D, backTex);         glBindTexture(GL_TEXTURE_2D, frontTex);              glActiveTexture(GL_TEXTURE0);         glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);         glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );         glEnable(GL_CULL_FACE);         glCullFace(GL_FRONT);         glDrawElements (GL_TRIANGLES, 36, GL_UNSIGNED_INT, 0);         glDisable(GL_CULL_FACE);              glActiveTexture(GL_TEXTURE1);         glDrawBuffer(GL_COLOR_ATTACHMENT1_EXT);         glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );         glEnable(GL_CULL_FACE);         glCullFace(GL_BACK);         glDrawElements (GL_TRIANGLES, 36, GL_UNSIGNED_INT, 0);         glDisable(GL_CULL_FACE);              glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);              shaderProgram->disable();              shaderProgramFinal->use();         glBindVertexArray(VAOFinal);         glEnable(GL_CULL_FACE);         glCullFace(GL_BACK);         glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );         glDrawElements (GL_TRIANGLES, 6, GL_UNSIGNED_INT, 0);         glDisable(GL_CULL_FACE);         shaderProgramFinal->disable();              glfwSwapBuffers(window);         glfwPollEvents();     }          glfwDestroyWindow(window);     glfwTerminate();     exit(EXIT_SUCCESS);     }


Any good resources for a non-technical guy to learn software project management?

There are many resources on general project management, but are there any specifically for non-technical people for software project management, covering topics such as requirements gathering, use cases and general architecture?


Are some languages or language features better for testing?

I am, and like being, a VB.net coder. I have a couple of largish programs in c# that I must maintain and I don't really like writing C# code while developing. It isn't horrible but I much prefer the VB.net environment for development. However recently I have started writing all my tests in C#. I started doing this so I could use all the great tools, such as the mock libraries, available in C#. But even after I found Teleriks extremely capable justmock free edition for VB.net I have found I still write almost all my tests in C# (now using the C# version of JustMock BTW). Even when I don't need these testing tools I find that I just like C# better for writing tests. I think I like VB.net for general coding while solving problems as I write because: 1\. Like the sugary sweetness of things like XML Literals. Plus LINQ just seem easier and more expressive in VB. 2\. Don't need worry about the syntax nearly as much (casing, line terminators etc.) I can focus on my ideas. (The extra verbosity is handled by #3 below and coderush and other IDE tools) 3\. Think the tight integration with IDE of Visual Studio and VB.net (background compiling for example) is just the bees knees. (Though C# is getting much better.) But for tests I am not thinking about the big picture or really solving problems. Each test method is independent and the succinctness of C# just reinforces and aids this fact. I initially found this surprising because I always thought a scripting type language would be better for writing tests. But after actually writing many thousands of them I don't see any benefits in using a scripting language. In fact I find Option Strict and Explicit being true (which turns of the scripty nature of vb) even more helpful in the test projects. But maybe I am wrong and there are languages even more suited to writing tests? Would something like IronPython be good for writing test? Maybe BOO with its macros? I wouldn't think so but might a functional language bring anything to the table? More simply, are there language features that aid in writing good tests? And if so what language has the greatest numbers of these desirable features?


Why do I have to choose between "management" and "technical" tracks in my career?

I was recently laid off, and although I found a new gig I'm a bit frustrated with how career tracks work in the land of software development. I really love doing a bit of everything: coding, testing, architect(ing), leadership/management, customer contact, requirements gathering, staff development, etc. Software companies, however, want me to fit into a niche: I'm either a coder, a tester, or a manager. When I try to explain to them that I'm best when I'm doing all of those at once, they seem very confused. I'm sympathetic to their interests, but at the same time frustrated that the industry works this way. Any advice? Do I just need to get with the program, so to speak?


Getting Organizational Support in a 'Non-Programming' Position

I've been in my current position in a non-IT unit for about a year. I was hired mostly to do content management and simple web master type tasks. Due to a mix of diminishing IT support and expanded unit/productivity expectations, as well as my own motivation to acquire new skills, I have slowly taken on what I would describe as a front-end web developer role. Nothing I would describe as 'mission critical', but certainly things you wouldn't hire a non- programmer to do. I only took a few CS classes in college and although I do some freelance web designing and developing, I'm growing concerned about getting in over my head without the appropriate grounding. I would like to ideally have IT support, guidance, code review, programmer-level pay, etc. Unfortunately, I'm finding that organizational and semantic divisions really won't allow me to be a 'programmer', since I don't work for an IT-related unit. Management is roughly aware of the issue, but I don't feel they are taking it seriously, so I'm planning on addressing it with them. When I do, I want them to hear the: "I'm a motivated employee looking to take on more responsibility" instead of "I have limited and untrustworthy skills, I need IT's help!" What suggestions do you have for me to address (to management) the issue and articulate a solution?


C Language - K&R 1st vs 2nd Edition?

I'm planning to buy a book to learn C Language. Many say K&R is a must-have book for C programmers so I chose it. I see that there are two editions. What are the differences between them?


Typed search over complex model. Possible CQRS / NoSQL solution

Given the following relational model: ![database model](http://i.stack.imgur.com/Xl8nl.jpg) I need to implement a typed search for hotels, which should be able to query on name, city, country, category, hoteltype, roomprice, customtype, room custom type and roomtype or any combination of these criteria. At the moment I'm doing this though Entity Framework, dynamically constructing a query over the Hotel-entity (IQueryable). This is fine as currently there is very little data. However, this isn't very scalable and when there is a lot of data this will become very slow as it's a query over 10 tables. Note that I only need to load the hotel-data, not the entire graph. I'm thinking of ways to improve the scalability of this part. I have been looking into CQRS and maybe NoSQL solutions. One approach I had in mind is having this model on the write side (to enforce consistency) and having a different model on the read side. On write, I would then update the read-model (viewmodel). However, since this is already a more or less complex model in terms of relations, I see a few problems with that:   * Updating metadata (such as category, roomtype, hoteltype) would require me to update all of the hotels or rooms in the read-model. This could be quite slow or impossible once there's a lot of data.   * Suppose I use a document database such as MongoDB and save a hotel with all the related items denormalized, won't the query over that table still be slow as it has to search inside each document, or is still still quite fast in NoSQL? To summarize a few questions:   * Is denormalizing this model the right approach and what would be the best way?   * Will NoSQL be faster?   * Are there any better approaches I can follow or ways to break up the relationship and flatten the hierarchy while still being able to do a typed search?   * Ideally some fields should also support fuzzy search, what would be the best way to achieve that?


How are I/O port addresses and data sent?

First of all, I'd like to say this is a hardware-level question, which is very closely related to the "in" and "out" command in x86 assembly. I have searched for quite some time, but I still haven't found how they send the addresses and the data. Does the 8086 first send the address, then the data? If so, how does the receiver know if the 8086 is sending a 16-bit address or an 8-bit address? Aside from that, I'd also like to learn how the 8255 works, and how it accepts specific ports such as "port 60H". Thanks for reading! :D


How to refactor out static members of basic classes

Currently I am working on C++ project, which can be classified as "legacy" project. A lot of poor written code was committed because of lack of experience and under the pressure of deadlines. When I try to fix bugs I eventually make the new one. Recently I got some more free time and I want to make this project better. To be exact I want to begin using TDD. However, it turned out not so easy. I faced the problem that I can't write test for any class. Singletons are everywhere. Even basic classes uses static members. For instance, in project we widely use "Numeric" class (which is wrapper for decNumber C library for decimal computation). This class has static member to keep a context (precision, rounding mode, etc.). It is obvious that I need to refactor this class to avoid static fields. Immediately I thought about dependency injection and a factory pattern. The factory will keep the single context, every user class should create Numeric instances only using that factory. But the code is going to be messy because the factory should be injected in every class which wants to construct "Numeric" instance. Which pattern I can use for this case? Which one makes me sure that every instance of "Numeric" class uses single shared state? P.S.: There are significant parallels with this question - Dependency injection ; good practices to reduce boilerplate code.


Which revision control system to use for 2 semester capstone course?

For CS undergraduate students working on a 2-semester capstone course without any prior exposure to revision control systems, what would be a good one to use? Desirable qualities would be easy to use (ie this should be a tool they can use rather than spend a lot of time fighting it) and still be relevant for subsequent professional work once they graduate (doesn't have to mean it has to be the same tool later on as long as the concepts survive). Easy to install and maintain for the person who does this. Not sure if I am missing anything else important. I am aware of subversion (centralized), git (distributed) and mercurial(also distributed?) - but don't know enough about any of them to have an informed opinion. Are there others I should consider? This will be on a predominantly Windows environment. EDIT: I am really interested in the **pedagocial** aspect of teaching/learning these systems, not so much from the perspective of an already experienced software developer.


How can an amateur programmer get past their boundaries when formal educational resources are not available?

I have been programming for 5 years since middle school. I have learnt pretty much all the basics of programming and went through C/C++ and Java language. However, the college in my country is not really offering me the knowledge that will help me improve on in my programming career. Therefore, I have to self-educate myself. Lately, I have been picking up native windows api and give it a try on making window application according to what I have in mind. However, I failed constantly and found myself lacking knowledge in all directions: Low-level machine (system, arch, asm, etc.), Windows internals (kernel, system, etc.), Networking (TCP/IP etc.), Designing skills, Graphics programming, and many more of those advance topics. Therefore, right now I'm at the edge of deciding whether to continue with windows development, or to dig deep into low-level machine structure, or to dropout all of that and go for internet-oriented programming, or to do any other available options. Ideally, I would want to know all of them (I really love all of the topics in programming) and would want to deeply understand every one of them. However, I don't know where to start. So any guideline from professional programmer of how should I continue my learning path? And what would be the best resources?


what are callback frameworks?

I am reading Effective Java and it has the following sentence. > The disadvantages of wrapper classes are few. One caveat is that wrapper > classes are not suited for use in callback frameworks, wherein objects pass > selfreferences to other objects for subsequent invocations (“callbacks”). Now what is a callback framework ? Can you point me to an example of call back framework ?


Clarification about Event Producer in StreamInsight

I need a small clarification about streamInsight, I know by doc's that StreamInsight can handle multiple concurrent Events. But will the event producer be a separate function, for ex: I need to watch a folder for new Files becoz all my sensors il write readings every day in a new file in particular drive. **Method 1: FileSystemWatcher:** These is the traditional approach where we write a service using FileSystemWatcher to watch a folder for new files,etc.. Upon receiving event from FileSystemWatcher il perform some operations on these files. **How to do these using streamInsight???** I came know that using IObservable i can push events to StreamInsight. But is there anything to watch folder is sreamInsight like FileSystemWatcher. OR In order to raise events to streamInsight do we need to use FileSystemWacther? Any suggestion regarding these is highly appreciated. Thank in Advance


Is there a way to visualize an ASP.NET MVC project, ie class diagram but with the web pages too?

Maybe I'm looking for a dependency visualizer/matrix. I'm not sure. I'm just trying to wrap my head around an existing and large web app, and I like pretty pictures. I know of Autodiagrammer but I don't think it would show the master page/subpage relationships. Is such a thing even possible?


Question about Visual C++ Properties

Could someone explain this line: > In more complicated contexts, such as "+=", a **rewrite** is performed by > doing both get and put. Taken from: MSDN - Property What do they mean by rewrite?Is it a compile-time rewrite or does it induce run-time overhead?As far as I know in release mode properties are compiled to the same thing, so they must have the same performance as getters/setters, right?


Scrum Board for a distributed team

I am looking for recommendations on a digital Scrum Board which can be shared over the internet. I imagine something like a big tablet on which you can draw and which remote users can access, too. I dislike Scrum software because I think one major benefit of a Scrum Board is its physical presence. It should be hard to ignore. The best solution would be two big tablets on which you can draw and which can be synchronized. Has anyone got product recommendations for something like this? Or would you rather use a software? Kind regards, Falcon


What makes a series of machine instructions an actual process/thread in memory?

Every instruction comes from main memory/RAM. In a bootloader, at least on Intel and IBM PC firmware and designations, you have BIOS jump to a memory address to begin fetching instructions for whatever purpose, usually to load a kernel, when or where does the instance of a process begin? The hardware stacks are limited, but does using them constitute for a process or thread? My point simply is what makes something a "thread" or "process", as to opposed to just more bytes from memory? Where is the line drawn in this situation?


Return values for CRUD methods?

I'm writing a basic web API in Java that does what almost all others do: take input, validate it, then do CRUD operations on the DB. I've written several APIs before, and I've pretty much already figured out what constitutes a good response back to the client. However, like most APIs, there are several layers of objects invoked between the front-door client API object and the code that actually executes queries against the database. I've always struggled to know what those database interaction objects should return back to the functions calling them. I imagine that on errors I'll be throwing exceptions and catching them farther up the call stack. However, what do I return on successes? Here's what I've used before:   1. Create - Return a boolean telling whether the create was successful or not   2. Read - Return the object requested   3. Update - Return a boolean telling whether the update was successful or not   4. Delete - Return a boolean telling whether the delete was successful or not I feel comfortable with the Read and Delete returns, because I can't think of what else you'd return in those situations. However, I have no idea what the best practice would be for return values from create and update functions. Should I return a new object with the updated values? Should I modify the object that was passed in? Should I just return a boolean value denoting success or failure?


Index independent character comparison within text blocks

I have the following task: developing a program where there is a block of sample text which should be typed by user. Any typos the user does during the test are registered. Basically, I can compare each typed char with the sample char based on caret index position of the input, but there is one significant flaw in such a "naive" approach. If the user typed mistakenly more letters than a whole string has, or inserted more white spaces between the string than should be, then the rest of the comparisons will be wrong because of the index offsets added by the additional wrong insertions. I have thought of designing some kind of parser where each string (or even a char ) is tokenized and the comparisons are made "char-wise" and not "index- wise," but that seems to me like an overkill for such a task. I would like to get a reference to possibly existing algorithms which can be helpful in solving this kind of problem.


Framework in which views are defined in the database - design flaw or reasonable?

I'm working with a framework where the fields displayed on each web page are defined in the application database. Administrators can add new fields to pages or hide/completely delete old fields. The logic for each page is in a Java class - sometimes there's a one-to-one relationship between a page and a class, sometimes several pages use the same class. **The issue** This framework design creates a hidden dependency between the page data in the database and the logic in the Java class. If a new field is added to a page, the matching Java class must provide that field - or the page will break. The Java code has no compile-time knowledge of how the page is configured in the database (each customer database may have different configurations), which increases brittleness. A typical solution has been to SELECT * from one or more database tables, allowing a degree of configuration as to which fields can be displayed. This leads to database-centric Java code with plenty of embedded SQL and little object-oriented design or domain models. **Solution plans** We've introduced a three-tier MVC-like architecture (controller -> service -> repository) with object-oriented models to the framework. It limits the ability to add fields to the pages without changing the underlying code. However, the change makes it possible to program in an object-oriented way and create domain models. Next up, we're planning to do something about the dependency between the database and code. My long-term plan would be to move the page definitions from the database into the code (your standard HTML&JS views), limiting configurability but reducing brittleness. Any incompatibilities between the pages and Java would then become compiler errors when building the application instead of runtime errors. **Question(s)**   1. Do you consider the framework practice of defining the view in the database and the controller in the code as sound design or something that should be addressed?   2. If you think the situation should be addressed, does my long-term plan seem reasonable? **Edit:** In addition to defining the layout, the view definitions in the database define which fields are expected to exist - "get field 'foobar' from the controller and show it here". The views themselves don't really contain logic. The Java classes backing up the views typically contain thousands of rows of UI and business logic.


Technology for C#, Windows, 2D game development?

I need a nudge in the right direction from someone more experienced in windows game development. I want to write simple C# 2D windows game for fun (think something like old Sim City or Civilization). I used to write simple windows games before, but I was out of the loop from game development for a long time. What would be good technology to start quickly these days? Quick google search, shows DirectX, Managed DirectX, XNA, but I do not know enough about those to make a choice. To make this question more constructive, can someone explain what options are available, and what would be their strong and weak points?


Are classes with only a single method a problem?

I am currently working on a software project that performs compression and indexing on video surveillance footage. The compression works by splitting background and foreground objects, then saving the background as a static image, and the foreground as a sprite. Recently, I have embarked on reviewing some of the classes that I have designed for the project. I noticed that there are many classes that only have a single public method. Some of these classes are:   * VideoCompressor (with a `compress` method that takes in an input video of type `RawVideo` and returns an output video of type `CompressedVideo`).   * VideoSplitter (with a `split` method that takes in an input video of type `RawVideo` and returns a vector of 2 output videos, each of type `RawVideo`).   * VideoIndexer (with an `index` method that takes in an input video of type `RawVideo` and returns a video index of type `VideoIndex`). I find myself instantiating each class just to make calls like `VideoCompressor.compress(...)`, `VideoSplitter.split(...)`, `VideoIndexer.index(...)`. On the surface, I do think the class names are sufficiently descriptive of their intended function, and they are actually nouns. Correspondingly, their methods are also verbs. Is this actually a problem?


What development tools would you recommend for developing .NET apps in Mono that would give me the same productivity boost as Resharper?

Aside from using IDEs such as MonoDevelop, what combination of tools do you use in Mono development to give you the same productivity boost that one would normally gain by using R# in VS2010? EDIT: I'm trying to kick the R# habit and switch to Mono development in Linux, but it's hard to kick the habit of using VS2010 + R#, and I need alternative tools to break that habit.


What tools do PHP Developers use?

> **Possible Duplicate:**   >  What would you consider best practice workflow tools for web application > (PHP) development? I start my new job next week as a PHP Developer which is my dream job but it's going to be object-orientated which I've only done in Java whilst at university. My question is regarding PHP tools - what are the best IDE's (I use notepad++), what versioning packages work best and bug trackers etc, so I was just wondering what tools the PHP developers out there use in their working lives.


Does Sublime's "minimap" improve productivity?

I'm a pretty big fan of Sublime. One of my favorite features is the ability to scroll through your file by using the compressed image of your text on the upper right hand corner (minimap). My gut feeling is this does positive things for productivity: ![enter image description here](http://i.stack.imgur.com/SkFIc.png) Does having this minimap to scroll through actually improve productivity? P.S. - Side question: Did Sublime invent this idea, or did they take it from another text editor?


If you use MFC how did find it best to learn the concepts?

I'm currently working with C++ MFC applications in Visual Studio 2008. I have spent most of my time up to this point working with Java Swing development which seems to be not quite as involved as win32 or MFC are. I've noticed that there seems to be a lot of little parameters and specifications that go into creating even a simple element like a status bar or menu bar. I've spent a bit of time working through the MSDN library on the matter but it doesn't seem to explain why many of these parameters and such are needed to set up these elements. I always find that I'm able to wrap my head around things and remember them if I understand why I'm doing it. If you program using MFC (or a similar framework) what did you find helpful in the learning process? Do you recommend any website, books, or other references? Any and all advice is appreciated!


ASP.NET coding style

I am trying to improve the speed of my coding and I was wondering what tips the pros have. Currently I tend to code about 5-10 lines of code then test and repeat. Is that typical? Or is it better to code larger blocks of code then test. I am always worried of coding a lot than realizing all the code I wrote was wrong and would have to retype.


Vaadin Calendar events not shown if overnight

In my vaadin project there is the possibility to create events that are shown by the calendar. It does works, except when the event is overnight, let's say the night from 23th to 24th, and the calendar shows as only day the 24th. In this case the part of the event that belongs to the 24th is supposed to be shown, but it is not. When I switch to weekly view, the event is shown properly. Here is the function where I get the data and use a container for the calendar:               /* Fill Calendar from database */     void updateData() {          final BeanItemContainer<TypeReservationEvent> container =                 new BeanItemContainer<TypeReservationEvent>(TypeReservationEvent.class);         Map<String, Object> parameters = new HashMap<String, Object>();         parameters.put("roomParent",chosenRoom);         String query = "SELECT DISTINCT res FROM EntityReservation res, EntityRoom r, EntityTable rt WHERE res.tableId = rt.id "                 + "AND rt.roomParent =:roomParent";         reservationList = facade.list(query, parameters);         for(EntityReservation rt : reservationList) {                 container.addBean(new TypeReservationEvent(rt));         }         container.sort(new Object[]{"start"}, new boolean[]{true});         cal.setContainerDataSource(container, "caption",                 "description", "start", "end", "styleName");              // Force calendar to refresh         if(selectCalViewType.getValue() == chooseWeeklyView) {             setViewType(calViewType.DAILY);             setViewType(calViewType.WEEKLY);         } else if (selectCalViewType.getValue() == chooseDailyView) {             setViewType(calViewType.WEEKLY);             setViewType(calViewType.DAILY);         }     }      TIA


How to improve my loop logic in programming?

I know how to do simple loops but I don't know what's going on when many loops are working together. For example:               for (i=0; i <= 9; i++){          document.write(linebreak);            for (m=0; m <= 9; m++){          document.write(i);         }     }      Is there a way I can learn loops inside out?


Interface (contract), Generics (universality), and extension methods (ease of use). Is it a right design?

I'm trying to design a simple conversion framework based on these requirements:   1. All developers should follow a predefined set of rules to convert from the source entity to the target entity   2. Some overall policies should be able to be applied in a central place, without interference with developers' code   3. Both the creation of converters and usage of converter classes should be easy To solve these problems in C# language, A thought came to my mind. I'm writing it here, though it doesn't compile at all. But let's assume that C# compiles this code: I'll create a generic interface called `IConverter`               public interface IConverter<TSource, TTarget>         where TSource : class, new()         where TTarget : class, new()     {         TTarget Convert(TSource source);              List<TTarget> Convert(List<TSource> sourceItems);     }      Developers would implement this interface to create converters. For example:               public class PhoneToCommunicationChannelConverter : IConverter<Phone, CommunicationChannle>     {         public CommunicationChannel Convert(Phone phone)         {             // conversion logic         }              public List<CommunicationChannel> Convert(List<Phone> phones)         {             // conversion logic         }     }      And to make the usage of this conversion class easier, imagine that we add `static` and `this` keywords to methods to turn them into **Extension Methods** , and use them this way:               List<Phone> phones = GetPhones();     List<CommunicationChannel> channels = phones.Convert();      However, this doesn't even compile. With those requirements, I can think of some other designs, but they each lack an aspect. Either the implementation would become more difficult or chaotic and out of control, or the usage would become truly hard. Is this design right at all? What alternatives I might have to achieve those requirements?


Governance models for multi-institution open source projects

I'm working on an open source project that has full time professional developers from several universities, plus a couple of other organisations. The product has something like a dozen deployments, various variations, plugins, related components etc. Generally development so far has been driven by institutions "scratching their own itch", but with an effort to merge improvements back to a central code base. As it's starting to mature, I'm interested in possible models of open source governance to follow. (So this question isn't "what are some good things to do", it's specifically "what existing, tested models are worth looking at and possibly following") Specific aspects that such models might cover:   * How decisions about big-impact changes are made (and what happens if someone makes big changes without discussing them first)   * Who manages the product's public image (product marketing, for want of a better term)   * Who represents the product in any comparisons with "competing" products   * Whether enhancements become "core", "plugins", "related products" etc   * Whether and how roadmaps are created and published   * How variations on the product are handled (in this case, versions for different academic disciplines)   * Expectations and obligations of participants in the project   * Expectations and obligations of the institutions for which those developers work We'll be looking for something as lightweight and informal as practical.


Should I write an interface API before an implementation?

I've been delving into more "organized" programming recently and I've been learning that I should be programming to an interface, not an implementation. With that in mind, would it be better to "sketch" out a project in interfaces before writing the implementation for it where possible? And if this is the case, in the case of using 3rd party libraries (ie Lidgren), should I be wrapping those in interfaces as well and resolve them through IOC containers, or is it OK to expose them to the interfaces?


Moving back end from Parse.com to Amazon Web Services

I'm looking for insight from someone who has used at least AWS (if not also Parse.com). My iOS app currently uses Parse.com for these purposes: 1) to store user data (by translating between JSON and core data) 2) to run javascript functions to update my database with data from the web 3) for easy Facebook authentication, which is the basis for user accounts I am now eligible for a massive hosting credit from AWS, so I am trying to assess the difficulty of switching (not to mention new concerns about Parse.com's quality). From what I've read, it seems AWS offers a variety of hosting options. However, in reference to (1), I have not seen any specific mention of JSON tables, and that's the only kind of database I'm familiar with. So I'm looking for better understanding of which AWS database options would most closely approximate Parse.com's JSON-based database. And I'm also interested in any comments about (2) and (3)---what AWS features would provide the nearest substitutes. Thank you


What is Curiosity's packet structure?

For NASA's Interplanetary Network, what does a packet look like? It's obviously a form of redundant protocol, stored at the receiver and with built back up. Is there any documentation on the packet structure or the communication protocol, which has to span 14 minute communications?


Application vs middleware development in android

I have 1 year and 6 months of experience on Android. All of my experience has been into application development. Recently I have got offers from two companies. One is offering me a profile to work on application layer and other is offering a profile on Android middleware. Can you guide me which would be better? Is middleware development better than application layer development from the career perspective in terms of money and other opportunities? I am really in a big dilemma. Any help would be appreciated. Also if someone can tell me as to who will earn more-a five year application layer guy or a middleware guy? Thanks a lot in advance.


How do I introduce clean code?

My team has about 18 members and the code is generally good, using TDD and good specifications makes for working code. But I think they abuse comments in favor of writing cleaner, more readable code. I would like to introduce them to the concept and I'm wondering how can I do that on a larger scale without sitting with each and every one of them on their code and explaining how it could be improved. This is different from the suggested duplicate because I believe I already know how to write clean code. What I'm looking for is how do I introduce _my team_ to writing clean code?


best way to store data from ajax call

I am writing a web-application in which I am retrieving data's from server through `AJAX` requests and the generate `HTML` content dynamically. I have some data to load, generate HTML from it and `append` into my web page. Now I was thinking on two solutions: 1) Do AJAX call, generate HTML from response, set `display: none` to it when I need, and when I'll need it later, set `display: block;` instead and `hide()` other content I don't need to display (always dynamically generated). 2) Save AJAX response into `variables`, remove HTML generated before, re- generate from `variable` when I'll need it later. I don't know if I explained it well, but I would like to know which is best practice in terms of client/server performance.


Qt solutions have been re-licensed, can I use the src directly now

I have a commercial application that uses a Qt Solutions component. Until recently, this component was licensed under the LGPL license, so I was forced to use the component in the form of a shared library. According to this post http://qt.digia.com/Product/Qt-Add-Ons/Qt-Solutions-Archive/, the Qt solutions have been re-licensed with the BSD license reproduced below. My question is, can I mow use the source code directly in my application or do I still need to create a shared library? (the appropriate copyright notices will be reproduced regardless) BSD lisence: > * * * > > This sofware uses Qt Solutions component which is covered by the following > license: > > Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). > > Redistribution and use in source and binary forms, with or without > modification, are permitted provided that the following conditions are met: > >   * Redistributions of source code must retain the above copyright notice, > this list of conditions and the following disclaimer. > >   * Redistributions in binary form must reproduce the above copyright > notice, this list of conditions and the following disclaimer in the > documentation and/or other materials provided with the distribution. > >   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names of > its contributors may be used to endorse or promote products derived from > this software without specific prior written permission. > > > > ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS > IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, > THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR > PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR > CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, > EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, > PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; > OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, > WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR > OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF > ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > > * * *


Why is there a large discrepancy between the stackoverflow tag frequency and the TIOBE Index?

By recently looking at the TIOBE Programming Community Index (Sep 2012) I noticed the following order:   1. C   2. Java   3. Objective-C   4. C++   5. C#   6. PHP When looking at the tag frequencies of stackoverflow however, the situation is as follows:   1. C#   2. Java   3. PHP   4. JS   5. Android   6. jquery (JS)   7. iphone (Objective-C)   8. C++ (Java takes the lead when accounting for Android tagged posts w/o a Java tag). JavaScript also likely has surpassed PHP in total numbers of programmers? I realize the tag-frequencies may not be the best indicator, but it is likely a sufficient measure nonetheless. What am I missing that explains this discrepancy, especially for `ANSI C` and `JavaScript` ( #11 in the TIOBE index)? **Links** :   * Wikipedia TIOBE index   * The Transparent Language Popularity Index   * Jobs Tractor language trends   * Github top languages   * Langpop


Can/should the Single Responsibility Principle be applied to new code?

The principle is defined as modules having _one reason to change_. My question is, surely these reasons to change are not known until the code actually starts to change?? Pretty much every piece of code has numerous reasons why it _could_ possibly change but surely attempting to anticipate all of these and design your code with this in mind would end up with very poor code. Isn't it a better idea to only really start to apply SRP when requests to change the code start coming in? More specifically, when a piece of code has changed more than once for more than one reason, thus proving it has more than one reason to change. It sounds very anti-Agile to attempt to guess reasons for change. An example would be a piece of code which prints a document. A request comes in to change it to print to PDF and then a second request is made to change it to apply some different formatting to the document. At this point you have proof of more than a single reason to change (and violation of SRP) and should make the appropriate refactoring.


Why avoid Java Inheritance "Extends"

Good day! Jame Gosling said “You should avoid implementation inheritance whenever possible.” and instead, use interface inheritance. But why? How can we avoid inheriting the structure of an object using the keyword "extends", and at the same time make our code Object Oriented? Could someone please give an Object Oriented example illustrating this concept in a scenario like "ordering a book in a bookstore?" Thank you in advance.


Little and Big endian confusion

Just to make sure if I understand this correctly. Is this right that little endian processors read the memory addresses from highest to the lowest address and where as a big endian processors suppose to read them from lowest to the highest address? The confusion came when I thought that is it true that little endian processors read the data itself in the reserve order and not just the memory or anyway both? I have read enough about how the data is laid out in the memory and I just want to know how does the data is interpreted by both kinds of processors?


Are silly examples bad way to learn OOP?

Some tutorials give silly examples to teach OOP, for example: Car _class_ and myCar _object_ , etc. Is that way considered bad in learning OOP assuming that these examples not applied to real programming problems?


Is it *ever* okay to catch StackOverflowError in Java?

I used to think that it's not, but yesterday I had to do it. It's an application that uses Akka (an actor system implementation for the JVM) to process asynchronous jobs. One of the actors performs some PDF manipulation, and because the library is buggy, it dies with a `StackOverflowError` every now and then. The second aspect is that Akka is configured to shutdown its whole actor system if any JVM fatal error (e.g. StackOverflowError) is caught. The third aspect is that this actor system is embedded inside a web app (for WTF-ish, legacy, reasons), so when the actor system is shut down, the web app is not. The net effect is that on a `StackOverflowError` our job processing application becomes just an empty web app. As a quick fix I had to catch the `StackOverflowError` being thrown, so that the thread pool of the actor system isn't torn down. This lead me to think that maybe it's sometimes okay to catch such errors especially in contexts like this? When there's a thread pool processing arbitrary tasks? Unlike an `OutOfMemoryError` I can't imagine how a `StackOverflowError` can leave an application in an inconsistent state. The stack is cleared after such an error, so computation can go on normally. But maybe I'm missing something important. Also, let it be noted that I'm all for fixing the error in the first place (as a matter of fact I have already fixed an SOE in this same app a few days ago), but I really don't know when this kind of situation might arise. Why would it be better to restart the JVM process instead of catching the `StackOverflowError`, mark that job as failed, and continue with my business? Is there any compelling reason to never catch SOEs? Except "best practices", which is a vague term that tells me nothing.


What is an efficient algorithm for randomly assigning a pool of objects to a parent using specific rules

I need some expert answers to help me determine the most efficient algorithm in this scenario. Consider the following data structures:               type B { A parent; }          type A {        set<B> children;        integer minimumChildrenAllowed;        integer maximumChildrenAllowed;     }      I have a situation where I need to fetch all the orphan children (there could be hundreds of thousands of these) and assign them RANDOMLY to A type parents based on the following rules.   1. At the end of the job, there _should_ be no orphans left   2. At the end of the job, no object A should have less children than its predesignated minimum.   3. At the end of the job, no object A should have more children than its predesignated maximum.   4. If we run out of A objects then we should create a new A with default values for minimum and maximum and assign remaining orphans to these objects.   5. The distribution of children should be as evenly distributed as possible.   6. There may already be some children assigned to A before the job starts. I was toying with how to do this but I am afraid that I would just end up looping across the parents sorted from smallest to largest, and then grab an orphan for each parent. I was wondering if there is a more efficient way to handle this? **EDIT:**   * Expanding upon the criteria for even distribution of children, we should attempt to avoid a situation where any one A has 2 or more children than any other A unless they started that way. For example, if A1 has 4 children, and A2 and A3 have 1 child each and there are 2 orphans, then A2 and A3 should each be assigned an orphan making an even distribution of 4, 3, and 3 children for each A.   * Yes I understand we could end up where there is one orphan left and an A that has not met its minimum. This exception case will be handled by a separate algorithm that will try to evenly split an A into two objects and assign the remaining orphans amongst them. **EDIT: 2** Ok, I misunderstood the requirements in my situation. The data model for A shows minimum and maximum property but in fact this should be a global setting for every A. In essence it is a missed requirement that requires the data model to be refactored later. All A will have the same minimum and maximum now. This actually changes things significantly! Sorry for the confusion.


Repetitive Drawing in Javascript & Canvas

Creating an HTML5 page using canvas and javascript to draw a set number of musical staves on the page, spaced a pre-determined amount in between. What I have is re-drawn on top of the canvas 10 times, and what I really need is something that's spaced out apart every time the loop is drawn. I tried to create a JSFiddle, but it doesn't draw anything (which I'm sure is user-error), so here's the js file:               window.onload = function(){          var canvas = document.getElementById('sheetmusic');         c = canvas.getContext('2d');          c.fillStyle = 'white';     c.fillRect(0,0, canvas.width, canvas.height);          //  Draw staves     for (var i=0; i<10; i++){         c.strokeStyle = 'black';         c.beginPath();         c.moveTo(0,10);         c.lineTo(canvas.width,10);         c.stroke();         c.moveTo(0,20);         c.lineTo(canvas.width,20);         c.stroke();         c.moveTo(0,30);         c.lineTo(canvas.width,30);         c.stroke();         c.moveTo(0,40);         c.lineTo(canvas.width,40);         c.stroke();         c.moveTo(0,50);         c.lineTo(canvas.width,50);         c.stroke();         // staff whitespace         c.fillStyle = 'white';         c.fillRect(0,52, canvas.width, 50);         }     };      I'm just not certain how to append `i` from my `loop` into the `height` attribute of my `stroke`.


How do I distribute my scientific software with as few dependencies as possible?

As part of my research, I write a lot of Python and MATLAB code that never needs to be distributed to anyone else. Even if I need to distribute my software, Python and MATLAB, both being interpreted, make sharing it relatively simple. Now I am writing some software in C++ that I'd like to distribute. I have a handle on how to compile the software on my own machine, but what I don't have an understanding of is what needs to be done in order to give other people the software. First, more about my project: I'm writing some code to compute and display visualizations. The project is graph-based, and so I am using the LEMON graph library. I'm exploring VTK and OpenGL implementations for the purpose of displaying the visualization. I'd like to write Python and MATLAB bindings for users of those environments to be able to use my software, and I'd like to produce Windows and Linux versions (I haven't thought about OS X yet...). So, let's take the LEMON graph library as an example. It is a bunch of headers along with a small shared object. On my development system, I compile the library with CMake and link it with my project. Now say I want to give my software to someone running on Windows. I want them to be able to download an installer, click a button or two, and have everything taken care of. I don't want them to worry about installing the LEMON library, or OpenGL. They shouldn't have to knowingly compile anything. Is this possible? I have a feeling it is, but I come up short when searching for references. I have a vague idea that if I compile a binary on Windows I should be able to distribute that binary to anyone running a Windows OS. But what about the libraries I use? I'm guessing I need to statically link them on Windows, and that will take care of the dependency issue there. But in the back of my mind I have read that statically linking is not good practice (or is this just on Linux?) As you can tell, I'm somewhat lost. I'd appreciate a nudge in the right direction, and some references to read if you happen to know of any!


Do you encourage to keep login credential in keystore?

When developing login module for a web application, do you suggest to keep the username and password in a keystore? Lets assume the keystore was kept in a very safe place in web server.


Algorithm to pick user

I need an algorithm for picking a user. Users are identified by letter {A, B, C, ...} and are ranked by number {1, 2, 3, ...}. Rank is the degree of likelihood to be picked, so a rank 2 user is twice as likely to be picked over a rank 1 user, and rank 4 is four times as likely, etc. So let's say four users are {A, B, C, D}, with rank {1, 1, 5, 2} respectively. A user table might store rank:                  USER   RANK           A   1           B   1           C   5           D   2      How do I pick a user based on rank? My first idea for an algorithm is to add up all the ranks 1 + 1 + 5 + 2 to obtain a sum of 9. Then assign subranges from 1 to 9 to each user, where subrange size is user rank. So A has range [1, 1], B has range [2, 2], C has range [3, 7] (5 possibilities due to rank being 5), and D has range [8, 9]. The table becomes this:                  USER   RANK  RANGE           A   1     [1, 1]           B   1     [2, 2]           C   5     [3, 7]           D   2     [8, 9]      Then calculate a random value from 1 to 9, and find the user whose range contains that value. So if the random value is 4, user C is picked because 4 falls within range [3, 7]. This achieves fairness based on rank. If you repeat picking randomly this way, on the average, users will be chosen fairly, and no user will be starved. However, it feels sloppy, because to add or remove users, I have to recalculate all the ranges. Here is removing user C (recalculate range of user D):                  USER   RANK  RANGE           A   1     [1, 1]           B   1     [2, 2]           D   2     [3, 4]      And here is changing user A to have rank 2 (recalculate range of B and D):                  USER   RANK  RANGE           A   2     [1, 2]           B   1     [3, 3]           D   2     [4, 5]      What is the best algorithm to pick a user? Surely recalculating ranges for every user add, delete, or update is suboptimal. Is there a well-known function or algorithm that can help? * * * UPDATE: @rwong got me thinking about grouping people by rank, then picking rank instead of picking user. With **one** person in each rank, you turn the random-shaped ranges into a very linearly-growing ranges (one dot is one chance to be picked):               Rank 1:  *     Rank 2:  * *     Rank 3:  * * *     Rank 4:  * * * *     Rank 5:  * * * * *      Works great for exactly one person per rank, but it falls apart when you have lots of people at rank 1, where their chances should increase by the number of people within that rank, possibly overtaking the chances of higher ranks. Now we're back to an irregular shape, and must pick from it. A friend pointed me to Rejection sampling. This seems to be a great solution where you pick a random x and y coordinate, see if it falls within the shape, and if so, we now picked rank. Then pick a random person within that rank. To show this solution, here is the shape with multiple people inside each rank. For rank 2, there are 5 people, so that's 2 x 5 = 10 chances:               User count   Rank   Chances(graph)       Chances(number)     5            1      * * * * *            5     5            2      * * * * * * * * * *  10     1            3      * * *                3     0            4                           0     1            5      * * * * *            5      The algorithm is to pick a random row (like picking an x coordinate), and pick a random value from 1 to max(chances) (like picking a y coordinate). See if that is less than or equal to the number of chances at that rank. If not repeat until you have a valid rank and chance. This takes care of distribution probability. Now that you have chosen a valid rank, at that point you simply pick a random person within that rank. Done! The beauty is, to add or remove someone, you increment or decrement the user count column, and assign a new Changes(number). Two small very simple updates. The memory complexity and time complexity of add/remove/update user and also complexity to pick a user is nothing, like O(1). We grouped user by rank, and captured user count in each rank, then calculate chances for that rank, and used a simple looping algorithm to pick random rows and chance values until we get a hit, and finally pick a random person at that rank.


Java: would you use an EnumSet in this case?

I have this weird scenario in which some Java property is used to build and HQL query, and the type of the field is `Boolean`, i.e. it is boxed. I wondered why because I don't really like to think of booleans as having three possible values, `true`, `false`, and `null`. I recently found out the `null` value actually has semantics in this system. The semantics are: `true` means "only unviewed", `false` means "only viewed", and null means "all". So, if null, the field is ignored when building the HQL query, so that the end result contains both unviewed and viewed results. In my opinion this is a case where an enum should be used. Something like this:               enum ViewStatus {       VIEWED, UNVIEWED;     }      My dilemma now is what to use for the third case that should represent the union of these two constants? The two options are:   1. Introduce a third enum constant, `ALL`.              enum ViewStatus {       VIEWED, UNVIEWED, ALL;     }        2. Use an `EnumSet`. `EnumSet` pretty much exists specifically for this purpose, but... it seems like just two much overhead. Especially when reading the values in the part of the code that builds the HQL. So, what are your thoughts? Shall I go with a third enum constant and refactor to `EnumSet` when need arises? Thanks! ### Update I'll go for an `EnumSet` because I want to introduce methods on that enum that wouldn't make sense to be called on `ALL`. For example `ViewStatus.isViewed()`.


How do you avoid second-system effect?

http://en.wikipedia.org/wiki/Second-system_effect > The second-system effect refers to the tendency of small, elegant, and > successful systems to have elephantine, feature-laden monstrosities as their > successors When starting work on a follow-up project that will share the same codebase as the previous project, how do you control the second system effect? How do you stop yourself going overboard on rewriting flaky systems? How do you restrict "wouldn't it be cool if..." new features? I find one of the biggest factors is complacency from familiarity with the codebase. It can be very easy to add new features by "hacking" together systems that you know inside and out. However the short-term gains are outweighed by the spaghettification of code a few iterations of this approach can produce. How can you coerce programmers to design and implement features properly, when the "quick hack" solution is so tantilising?


Are there revision repositories which implement commenting on revisions other than a fixed single commit message?

Sangdol asked: Why can’t I edit and SVN commit message? There are good reasons to maintain individual records ‘as is’ for historical purposes. However, there is an arguably objective hazard in not limiting the spread and use of misleading, and dangerous data. Aside: Certainly, sometimes, one should just suck up they’ve made an error. That aside, er aside, it appears clearly beneficial to have some mechanism for recording and sharing the best possible information. It also seems clearly beneficial to have some mechanism for correcting ‘bad data’ and informing others of ‘hazardous data’. In the Sangdol thread l0b0, comments: > You're right. There is a fundamentally flawed design assumption in all VCSes > I've ever seen: A commit has one commit message, which is immutable. As Alex > says, we should "allow multiple versions of the commit message". To keep the question less subjective, your answers should be an objectively better practice than the ‘Moses Principle’ of, “Get it right first time, we’re carving this puppy in stone”, and address the ability to handle one or more problems along the lines of (I’m willing to update and alter this list if there are better suggestions): Suppose I discover that a commit message I entered a month ago is misleading, confusing, and downright wrong. Shouldn't I be able to added a correcting notation that will be seen by everyone who sees the incorrect message? (I agree the original message should be easily available unmodified and the change itself should be tracked and timestamped. But I disagree that this constitutes "changing history".) – David Schwartz comment from the Sangdol question.


How to price a programming consulations for IT company?

It's not very rare programming question, but it's about a work of a freelance programmer and I think you can help me so maybe it's ok to pust it here? So one dev-company asked me for doing a programming consultation. It's should be like this that the company can call me and ask questions and gets answers how to do this, how to do that and so on. I never did this kind of work and I think what is the best way to deal with this kind of cooperation. Should i charge per hour? It can be short questions, by phone or e-mail and it can be not easy to calcuate and take a grip on the time and cost. Or should I charge per consultation? And if something will be not-worth mentioning and there will be more short questions but plenty of them? Or should i charge montly? Did you do some kind of "programming consultations"? Heck i don't even know what is the right name for this kind of job. Do you know any sites or keywords that could help me get more info on the topic of this kind of cooperation ?


is there anything else like WPF can run in Linux and Mac

I am looking for anything else has the same `WPF` functionality (animation, 3D,...) but can work in other platforms (Linux, Mac,...) something powerful, fast to develop with, can create my own custom styling on the basic component


Number of combinations

How to go about getting the number of combination ( C(5,4) ) without using recursion in C? Is there any other method or inbuilt library to do this?


How to implement a distributed proxy with quotas?

I'm in the process of developing a scalable proxy (Linux/C/C++, Nginx modules or custom HTTP server) handling incoming HTTP requests, and re-routing them to others locations based on parameters included in the incoming request itself (IP, time for example) or external factors (hence the use of an Nginx module able to retrieve the external factors). However, the tricky part is regarding quotas. For example, I wish I could block proxying requests originating from an IP when it's daily allowance quota is over. Implementing quotas is not hard. However, having quotas work in a distributed environment (where ideally everything is shared-nothing) is far from trivial. Indeed, the quota state must be shared to all distributed processes so that they can know whether they should proceed or not. Having a central quota handler means using locks. This makes me think that the performances will drop very quickly. Locking the quotas status every time a proxying request is being handled doesn't look like the solution to me. Any hints ?


How to choose the right web development language for my app without much programming experience?

I have my own idea for a web application, and I am not a programmer. The application will work similar to Facebook and Twitter, profiles and feeds. I have learned some computer science theory, all the way up to OOP, but have no practical experience. Without any experience, is there a way I can evaluate the different language and platform choices available to me? What kind of things should I be looking at? Ease of setup? How many followers it has? How can I evaluate whether a language will have the capabilities I need?


What can I do to help users create self-service reports?

I work using Reporting Services 2008 and I'm constantly creating ad-hoc reports. We'd like to use PowerPivot on Sharepoint but we're stuck on Sharepoint 2007. Using easy reporting software like Tableau Server would be fantastic but we can't afford it SSRS Report Builder hasn't proved to be very helpful, unfortunately. I've been trying to think of ways to leverage Excel / PowerPivot or any other (free or inexpensive) tool. We just need to be able to provide more data to users so they can analyze on their own. This is an area our IT team as a whole needs to improve. We use SSRS 2008 and SQL Server 2008. We also don't have a data warehouse, it's in the works...


git: having separate folder for development, why?

until now I was using dropbox as my main vcs (it is not, but for a single dev does the job pretty decent). However I decided to give git a go and see if it fits my needs. Today I was reading this tutorial and at some point it says: > One of the things you should get used to is doing development in a separate > area, not where you're serving your files from, for obvious reasons I am doing development in django, and I can't find these "obvious reasons". Why can't I just use my project's folder to serve files to github? I would be happy if someone clarified this for me now that I am new to git.


Differences in If... Else... statement

When I first started to learn programming I remember having an argument with my teacher about If Else statements. I was arguing that:                if {           ...      } else if {           ...      } ...      is basically the same as:                if {           ...      else {           if {                ...           } else {                if {                     ...                } else {                     ...                }           }      }       but he said they were completely different. After a while of arguing I accepted they are different. Now, over the years I have come back to this and looked over them to see the apparent major difference but for the life of me I cannot see it. Can someone please clarify why exactly they are different (apart from the obvious nesting)


MS Sql server internals/troubleshooting courses?

We have been working with Microsoft on a ticket we opened due to one of our queries being much slower on MS Sql server 2k8 enterprise vs sql 2k5 standard. The engineers we are working with have incredible tools and knowledge of the internals of sql server. Is there any course I could take to get me this knowledge?


Any recognized convention for repository changelogs?

We use TortoiseSVN, but we have no bug tracking system. I know, lame, but beyond my control. There were times when svn wasn't in daily use. Now I've had succeeded in pressing for using it regularly, with proper merging, branching, tagging etc. As you could expect, the number of revisions increased in result, which makes browsing repository log a bit troublesome now. I thought about utilizing some convention based on keywords ("[bugfix]", "[feature]", "[refactored]", "[minor]", "[merged-from-trunk]"... :) so as to make it more searchable. It feels like reinventing the wheel, though. Is there any established convention for that? Or is my approach wrong from the beginning? Any better, alternative solution?


How can I get assembly from an EXE?

Pretty much my only question is the title. Other then that I want to see the code behind small EXEs but I know it's hard to get it to convert to something like c or c++ so why not get assembly.