How do you deal with discovering bad and false code in your team?

Every year in january we process a big task with our system. While the performance during the task was above average the maintaince follow up is currently having a lot of trouble with jobs running too long and out of their respective time schedule. Therefore I am tasked with the optimization of those maintaince jobs and I am doing thusly the most thorough code review the system has ever seen. As I am good with analysing code I am also doing a lot of bug fixes. This means I see lots and lots of bad or completely wrong code and implementations. My question is: How can I deal with that in front of my coworkers? I hate it if I cause a bug (which I guess happens to everyone sometimes) and someone else fixes it without telling me about it. Because then I cannot learn from my mistake. On the other hand I do not want to be the guy on the team who is constantly nagging about how everyone else has to do his or her work. Also I am a bit wary of my own hubris. I do not want to find myself in the position that I start looking down on coworkers just because my biased mind thinks my code is superior. Currently I am not checking who has caused a bug I just fix it. I am not sure whether this is the best way to go. I am a Junior level developer and English is not my mother tongue. Any advice (and grammar edits) are highly appreciated. The team follows the Rational Unified Process framework.


How do I deal with a slow and undedicated colleague in the team?

I have been working on a new project. The project works like this: The end user can access a webapp using a link and he can add multiple systems on his network and manage that particular systems details. My part involves the front end and the webserver, which is done in python. My python actually communicates with another project which is entirely done in c & c++. The c/c++ project is the main app which does all the functionality. My python sends the user request to it and displays the response from it to the user. I am very familiar with my work and I will finish it soon. Since that's not much work in it. And I am a person who loves to work. I spends most of the time in office and only go home when I feel sleepy. The c/c++ app is managed by another colleague who has 5+ year experience and can do things much faster than me, but he never does it. May be he doesn't like to do it. His app crashes often when my python communicate with it or returns wrong values. It's full of bugs. Since my app depends on it, I am having a hard time building it. Instead of fixing the bugs, he asks me to slow down my work. He asks me to tell manager that my work needs a lot of time. He is asking me to fool the manager and even forcing me to work slowly like him. During project meeting, when manager asks him about the bugs he says that he fixed everything and it works fine. Since he is my colleague, I couldn't tell anything to the manager. I obviously need to have a good relationship with my colleagues more than my manager, since most of the time we will be with our colleagues, not with the manager. I am not able to tell the manager anything regarding this, since if manager asks him why, then he may think I complained about him to the manager. And he keeps on lying in the meeting. And since he fixes the bug slowly, it even slows down my work. Now I thought of working on the front-end part of my app and finishing it off so that in the mean time he can make his project stable. Now he is asking me to tell the manager that my front end part require a lot of work and I may need more and more time, simply so that he can drag the project down. And the sad thing is our actual manager has gone to the US, so we have a temporary manager and this guy doesn't know about the project much, so the c,c++ just fools him. Can anyone suggest me how I deal with this? I wanted to finish off the project soon. How can I make him work even by maintaining a good relationship with him? ### Responses to comments: > If he's really deliberately misleading the company, you should report him to > management. I am new to this company and the other guy has been there for many years. And I have just started knowing my colleagues. If I directly go and complaint him, I don't think so I can make good relationship with my other colleagues. Even he has the power to mislead them. I am not telling he is a bad guy, he can do the work, but he is not doing it. > Doesn't your company have any kind of bug tracking system ? Here actual bug tracking system isn't there. The company tries to finish off the project as soon as possible and gives it to the QA. And then fixes the bugs reported by QA. > This is why companies should give employees stock / options or some sort of > ownership. That way you can literally tell the guy "You are costing me > monetary growth... don't you want to make money also?". The company has the stock options they have given me a 2500 share, mostly he too would have got some more. > Seniority does deserve some benefit of a doubt. You really need to speak to > him first and try to understand the problem. He may be out of his depth, you > may be able to help him, there could easily be variables you are unaware of. > It may be hard now, but you could easily make the situation a lot worse by > jumping the gun. I even does it, first his app wasn't handling multiple requests at a time, he was using a queue to handle the requests I sent to him. I even suggested to him some of my ideas on it. He said he already had these ideas, and will be executing them. His explanations was: "Everything require certain time to do and this is a project which may need two years to complete and we are asked to finish it in two months". I used to have a hard time coding during first few weeks because of this bug. But now he fixed it. But he is using a single queue for a user requests and that is now slowing down the app, since it processes one request at a time. > What is QA doing this whole time? Why aren't they reporting/confirming the > status of the project(s)? The manager is the person who decides when to give to the QA. As of now it has not yet given to QA. He said we should give it by this month end.


complex numbers in programming?

Are complex numbers used in programming? If they are what is their significance? What IDEs and languages use them? And would it be recommended to learn how to implement them for a programming job (if so please specify what job)? I've been working in Eclipse and just studied the importance of complex numbers in math and wondered if it correlated.


Is there a name for CSS code smell that can be seen in class names like "float" or "white"?

I noticed some code in our projects using CSS class names such as `red`, `black` or `float`.   I want to provide some information for people so they know to avoid it. Is there a common name for that code smell so I can reference it?


Broadcast receiver Or Services

I am creating an "Alarm Clock" app in Android. I learned that we can implement `OnReciever()` method and write those things which we want the alarm to do after an intent is fired. But I have now come across the "Services" of android which is (might) be useful in the app. Which one should I prefer, keeping in mind the simplicity of using either of them.


gcc -S seems a bit misshapen with shifting and ANDing bits

Example:               int c = 4;     int p = 5;          if (p & (1 << c))        printf("ok\n");     else        printf("nop\n");      gcc -S:               movl    -4(%rbp), %eax   /* eax holds the variable c  */     movl    -8(%rbp), %edx   /* and edx holds p  */     movl    %eax, %ecx       /* tmp(ecx) = c  */     sarl    %cl, %edx        /* edx(p) >>= c  */     movl    %edx, %eax       /* eax = p shifted right by c */     andl    $1, %eax         /* eax(p shifted right by c) &= 1  */     testl   %eax, %eax       /* test if p is 0  */     ... jumps and such ...      As you can see, GCC for some reason converted my code to:               p >>= c;     p &= 1     if (p != 0)         ...     else         ...      Something fishy is going on here or I am missing something... It kinda made the operation backwards, although I had brackets around the `1 << c` so it should've done it separately then AND it with `p` correct? Can someone explain why did GCC do this? Is it some sort of optimization (I had no optimization enabled when I compiled this, so doubt it) Or is it how it should be done in assembly?


Is the GPL dangerous to the organisation in terms of exposure of its intellectual property?

GNU General Public License is a ‘Viral License”. If an organisation is using Linux and MySQL which come under this license, is it dangerous to the organisation in terms of exposure of its intellectual property? As this license will demand the software that is linked to or that incorporates a GPL program to also be made available in source form under the same license when it is “distributed.”


How much can you talk about your job experience during an interview

I recently saw a comment here, that the signs of a bad hire is when he says "I worked with this and that", but then doesn't elaborate when asked. And the question is why? Hypothetical scenario: Say you work for company X that develops rockets for space trips, then you walk to an interview for position Z in company Y. Interviewer sees your CV, asks a question - What technologies have you used? You respond, oh, I have used boost library to control the rocket navigation systems. Employer decides that you are a bad hire and doesn't offer you a job. Next he walks home, cross references your previous company X, finds documented bug in boost library and brings the rocket down. BOOM! From one point of view, you didn't said anything of interest, from another point of view, libraries, patterns, and algorithms can come a very long way towards letting malicious people reverse the heck out of the competitors product. Do you have right to talk about previous products, even in abstract way. And does the interviewer has rights to ask you anything about things you've coded for some commercial entity at all?


Which languages use "paired" header/implementation files?

C is ubiquitous, and C++ nearly as much, but I'm curious which other languages follow a similar model of header files. Specifically, in which other languages is it idiomatic to edit pairs or groups of "header" and "implementation" files? (A group as in multiple headers with one corresponding implementation file or a single header with multiple implementation files, as also seen in C.) For example, the pair "blah.h" and "blah.c". C's header files are tied into the C preprocessor, but that's not the detail I'm focusing on here. For example, PHP has various include mechanisms, but you don't have a pair/group of "blah-header.php" plus "blah-notheader.php". Some languages generate a file from source in a one-to-one mapping, such as Java, but that's not what I'm talking about either. I'm interested in cases where the programmer _directly edits_ both/all files in the pair/group. Perhaps to put it another way: which languages have a declaration file ("header") and definition file ("implementation") such that a person would generally edit both files in tandem?


Example of an agreement with the client

I've started my company in UK. Used to work as a freelancer, therefore legal issues didn't use to be a big headache. Now, I'd like to see an example of the document a company would sign with a client when starting to build them a website. This should include a project quote, project overview, agreed upon things, deadlines, etc. Anyone is so kind to share such a document?


Logging Exception in multi-tier application

I'm building a multi-tier enterprise application using Spring. I have different layers: Controller, Business and Provider. Within the application I've built a custom error handling mini-framework that is based on a single RuntimeException which has an error code to discriminate different kind of errors. Error codes are enums implementing this interface:               public interface ErrorCode {         public int getNumber();         public String getDeveloperMessage();         public String getHelpURL();         public boolean isSystemError();     }      So for example I have:               public enum SystemErrorCode implements ErrorCode{         E_UNKNOWN_ERROR(10000, "Unkwown internal error", true),         E_MISSING_ARGUMENT(10001, "Missing argument", true),         E_INVALID_ARGUMENT(10002, "Invalid argument", true),         E_CONTEXT_NO_TENANT(10003, "No tenant in context", true),         E_CONTEXT_TENANT_CHANGE(10004, "Tenant change attempt", true),         E_CONTEXT_ALREADY_INITIALIZED(10005, "Tenant already initialized", true),         E_NOT_IMPLEMENTED(10005, "Feature not implemented", true),         ...     }      The exception class itself look like this (getters, constructors, and utility methods are stripped out for brevity):               public class EngineRuntimeException extends RuntimeException {         private static final long serialVersionUID = 1L;              private final String incidentReportId;         private final ErrorCode code;         private final Map<String, Object> additionalInfo;              ...              public static EngineRuntimeException wrap(Throwable exception, ErrorCode errorCode) {             if(exception instanceof EngineRuntimeException) {                 EngineRuntimeException se = (EngineRuntimeException)exception;                 if(errorCode != null && errorCode != se.getCode()) {                     return new EngineRuntimeException(exception.getMessage(), exception, errorCode);                 }                 return se;             } else {                 return new EngineRuntimeException(exception.getMessage(), exception, errorCode);             }         }                   public static EngineRuntimeException wrap(Throwable exception) {             return wrap(exception, SystemErrorCode.E_UNKNOWN_ERROR);         }      Using the wrap utility method I can easily encapsulate exceptions in the different layers without loosing the original stack and without having it dirty by rethrowing or incapsulating exception more than once.               try {       if(a == null) {         throw new EngineRuntimeException(SystemErrorCode.E_UNKNOWN_ERROR, "blah, blah, blah");       }            // Some other code that can throw exceptions (checked or unchecked),       // these exceptions will be wrapped inside EngineRuntimeException if they       // are not already of that type.          } catch (Exception ex) {         throw EngineRuntimeException.wrap(ex);     }          To recap, each layer has a safety boundary try-catch that wraps Exceptions into EngineRuntimeException, just rethrowing what is already an EngineRuntimeException. The question is: where should I log the exception? I want to log the exception only once so I was thinking about do the logging stuff inside the constructor of EngineRuntimeException class itself. Is that a bad idea? Is it better to do the logging stuff only in the catch blocks of the layer boundaries? Also I don't want to simply log using a log4j but I want to use a service (@Service) injected by spring so that I can decide to do something more than just logging on file system. How can I do that since I can't make spring inject something in a class I have created with the "new" instruction.


Developing professionally for iOS, Android and web - an insight

This is not really a question on how to develop all three, I know various cross platform ways and so on. But I more want to know from developer standpoint how hard it is to basically develop iOS, Android and web apps? I am currently in my first job as a mobile/web developer. I have already developed my first iPhone/iPad app and now I have to develop the app for android because the web version I tried just didn't perform as well as needed and web databases just did not seem to make the cut. But I am not sure it's possible to be good at developing all 3 in terms of remembering all the api's etc. I wouldn't say I have an issue with the programming languages just how to use the api's for the various platforms. Also, all the other languages I look at, in my spare time, just feel like I am spreading myself to thin. Is it feasible for one person to be developing ios, android and web apps? Should I think about reducing it to iOS and web based apps? I develop everything by myself, so I have no one to discuss what the best solutions are for everything and I am just trying to workout as I go along. So any cross platform developers out there? Do companies have different teams for different platforms? Any insight would just help me get my head together. Hopefully this question makes sense.


Examples of general purpose algorithms that have benefited from running on a GPU?

I am looking for examples of general purpose algorithms (meaning non-graphics related) that have been proven to run an order of magnitude faster on a GPU than on a CPU. I will use these examples to think creatively about other algorithms that I could implement on a GPU.


Any advice from self-taught programmers on competing with more conventional types?

As a self-taught programmer myself competing in an industry dominated by CS majors, I often find myself intimidated. I have a BA in liberal arts but have found that many "trained" programmers tend to look down and assume I have huge holes in my understanding of fundamentals. I tend to not tell anyone, unless I have to, that I learned this way to avoid the stigma. Would it be better to embrace how I learned or would it be more prudent to continue to deliver while being less than open about my background? Edit: I guess I did not mention this, but I actually have taken many CS classes, but I never had the time to get the actual paper with the random requirements attached. I have all the core stuff like data structures and algorithms, etc. I've found that I learned more on my own, however, I was primarily concerned with how this approach was viewed by employers and whatnot. Thanks for all of the great advice though!


Numerous Unexpected Obstacles Ruining any Project Plans

I am working as software developer and struggling with this problem time and time again for almost thirteen years. There seems not to be any way out of the following problem. And it happens with small projects as well. For example, I plan to write an extension for Microsoft Visual Studio. I dowload learning materials, get some book on the topic and allocate time for learning and development. However, during the development, many seemingly trivial problems arise, for example:   * Why the script refuses to delete the file?   * Why Visual Studio does not register the extension?   * (after two days) OK, it registers it, but now it got broken. How to fix it? each of these "small" obstacles usually take 1-5 days to resolve and the project finally consumes several times more man-hours than planned. Maybe it happens only because I am working on Microsoft platform and many of their Frameworks and architectures are bit confusing and badly documented. I would like to have most problems resolved by finding answer in a book or official documentation (MSDN), but the only answer I usually find is on some weird forum or personal blog googled after desperately searching for any relevant information on the topic. Do you have the same struggles? Do you have techniques on how to prevent these problems? I was thinking of simply multiplying projected time for a given project by some factor, but this does not help. Some projects get done briskly and some take months and the guiding factor here are these small "glitches" which take programmers whole weeks to resolve. I have to admit that lots of these obstacles demoralizes me and drains me of focus and joy of work (who likes to get back to work when he have to resolve some stupid registry problem or weird framework bug instead of doing creative work?) After the project is finally done, I am feeling like dying from thousand cuts.


When are Getters and Setters Justified

Getters and setters are often criticized as being not proper OO. On the other hand most OO code I've seen has extensive getters and setters. When are getters and setters justified? Do you try to avoid using them? Are they overused in general? If your favorite language has properties (mine does) then such things are also considered getters and setters for this question. They are same thing from an OO methodology perspective. They just have nicer syntax. Sources for Getter/Setter Criticism (some taken from comments to give them better visibility):   * http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html   * http://typicalprogrammer.com/?p=23   * http://c2.com/cgi/wiki?AccessorsAreEvil   * http://www.darronschall.com/weblog/2005/03/no-brain-getter-and-setters.cfm   * http://www.adam-bien.com/roller/abien/entry/encapsulation_violation_with_getters_and To state the criticism simply: Getters and Setters allow you to manipulate the internal state of objects from outside of the object. This violates encapsulation. Only the object itself should care about its internal state. And an example Procedural version of code.               struct Fridge     {         int cheese;     }          void go_shopping(Fridge fridge)     {          fridge.cheese += 5;     }      Mutator version of code:               class Fridge     {          int cheese;               void set_cheese(int _cheese) { cheese = _cheese; }          int get_cheese() { return cheese; }      }          void go_shopping(Fridge fridge)     {          fridge.set_cheese(fridge.get_cheese() + 5);             }      The getters and setters made the code much more complicated without affording proper encapsulation. Because the internal state is accessible to other objects we don't gain a whole lot by adding these getters and setters. The question has been previously discussed on Stack Overflow:   * http://stackoverflow.com/questions/565095/java-are-getters-and-setters-evil   * http://stackoverflow.com/questions/996179


Why are public and private accessors considered good practice?

> **Possible Duplicate:**   >  When are Getters and Setters Justified Why exactly is having public and private accessors like these:               private string foo;          public string Foo     {         get         {             return foo;         }         set         {             foo = value;         }     }      considered better than just having public ones like this:               public string Foo;      The end result seems to be the same.


How to design member access for an Article-type class?

I am doing a final project in a C++ class writing a _very_ simple usenet-like client/server. I figure that since it's usenet-like I'll have a `NewsGroup` class and an `Article` class, I'm now working on my `Article` class. I can't really decide on a good design, though (this class is not about design patterns and I haven't taken any). This is what I have:               class Article {     public:         const std::string author;         std::string title;         std::string text;         const uint32_t id;         system_clock::time_point timestamp;              Article(const std::string auth&,                 const std::string tit&,                 const std::string txt&,                 const system_clock::time_point&);          private:         Article(const Article&);         void operator=(const Article&);         static uint32_t id_pool;     };      My motivation is this: `author` should never change -> `const` `title` could change if edited -> `non-const` `text` could change if edited -> `non-const` `id` should never change -> `const` `timestamp` could change but probably shouldn't, I'm not sure what to do with it yet. `id_pool` is just where I get IDs from. One specification is that IDs should never be reused so I just increment `id_pool` in the Article constructor. Coming from Java with all the getters and setters that I really don't like, and then some Python with it's "Everything public" and properties, that I do like, I'm getting a bit confused here. I mean, I could make the members private and have getters and setters (I can't think of any natural "verb-methods" that an Article can "do"), but it feels like I would gain very little. I would be thankful for some pointers on good design in this case.


> **Possible Duplicate:**   >  When are Getters and Setters Justified Is it a good programming practice to not use getters and setters in trivial parts of code?


What is the benefit of using getters and setters on properties in C#?

> **Possible Duplicate:**   >  When are Getters and Setters Justified Why do we use get and set method in C#? And why do we use public and private method property? For example:               public class Date     {         private int month = 7;           public int Month         {             get             {                 return month;             }             set             {                 if ((value > 0) && (value < 13))                 {                     month = value;                 }             }         }     }


Are Get-Set methods a violation of Encapsulation?

> **Possible Duplicate:**   >  When are Getters and Setters Justified In an Object oriented framework, one believes there must be strict encapsulation. Hence, internal variables are _not to be exposed_ to outside applications. But in many codebases, we see _tons_ of get/set methods which essentially open a formal window to modify internal variables that were originally intended to be strictly prohibited. Isn't it a clear violation of encapsulation? How broadly such a practice is seen and what to do about it? EDIT: I have seen some discussions where there are two opinions in extreme: on one hand people believe that because get/set interface is used to modify any parameter, it does qualifies not be violating encapsulation. On the other hand, there are people who believe it is does violate. Here is my point. Take a case of UDP server, with methods - get_URL(), set_URL(). The URL (to listen to) property is quite a parameter that application needs to be supplied and modified. However, in the same case, if the property like get_byte_buffer_length() and set_byte_buffer_length(), clearly points to values which are quite internal. Won't it imply that it _does_ violate the encapsulation? In fact, even get_byte_buffer_length() which otherwise doesn't modify the object, still misses the point of encapsulation, because, certainly there is an App which _knows_ i have an internal buffer! Tomorrow, if the internal buffer is replaced by something like a *packet_list* the method goes dysfunctional. Is there a universal yes/no towards get set method? Is there any strong guideline that tell programmers (specially the junior ones) as to _when_ does it violate encapsulation and when does it not?


How important is encapsulation?

As a student in programming, I learned that encapsulation is one of the most important principles of object-oriented programming. However, I only follow that principle when I feel like it suits my purpose. I sometimes leave internal class variables public if they are intended to be directly read at some time, and only use things like setters and getters when there are actual calculations (and assignments of other variables) involved in the assignment/evaluation of a variable (say, a `getDegrees()` of an `Angle` class that only stores radians internally). If I find that some procedure done with a class involves a lot of modification of internal variables and is easily groupable into a single operation, I will put it into a function of the class rather than having the outside code call multiple smaller functions. However, I will not always _enforce_ this in the interface by making the affected variables private instead. Am I violating any principles by doing this? If so, how severely? The code that does this usually doesn't face outward, as I pay a lot of attention to how out-of-program input is processed.


which style of member-access is preferable

the purpose of oop using classes is to encapsulate members from the `outer space`. i always read that accessing members should be done by methods. for example:               template<typename T>     class foo_1 {       T state_;     public:       // following below     };      the most common doing that by my professor was to have a get and set method.                 // variant 1       T const& getState() { return state_; }       void setState(T const& v) { state_ = v; }      or like this:                 // variant 2       // in my opinion it is easier to read       T const& state() { return state_; }       void state(T const& v) { state_ = v; }      assume the `state_` is a variable, which is checked periodically and there is no need to ensure the value (state) is consistent. Is there any disadvantage of accessing the state by reference? for example:                 // variant 3       // do it by reference       T& state() { return state_; }      or even directly, if I declare the variable as public.               template<typename T>     class foo {     public:       // variant 4       T state;     };      In variant 4 I could even ensure consistence by using c++11 atomic. So my question is, which one should I prefer?, Is there any coding standard which would decline one of these pattern? for some code see here


The New Programming Language & BCL for the Cloud

Let's say you need to implement a new programming language and BCL designed specifically for operating in the cloud (it won't be used on client machines ever). It should be optimized for cloud computing; easy to learn, fast, efficient, powerful, modern. What it would look like? What would be it's major differences from C#, Java, Ruby, Python, JavaScript? How would it's BCL (base class library) differ from let's say the one in .NET Framework 4.0? .. The same way Silverlight BCL was built for in-browser/multi-platform use, a totally new BCL should be build for a cloud, don't you think so? .. As Jörg W Mittag mentioned, a programming language created exclusively for a cloud can have it's own advantages over traditional programming languages. For example this language may evolve without breaking existing applications, let's say you rename a method / change it's signature / or move it to another namespace, all the applications in the cloud will be automatically updated to reflect that change. .. Theoretically C# 5.0 could become such a language with it's complier as a service feature. But that still won't eliminate a need for a dedicated BCL for the cloud.


Registration: Email hash and verifying only one account per email

I'm using a registration function that hashes the email in PBKDF2 with a random and unique Salt each time. The hashes email and his salt are saved in the DB. No problem with that. The problem is that now I want to make sure that users only create one single account per email. Obviously to verify that I need to check my DB and that's where the problem starts. I either lose in security or in time. Because as I see it I have 2 choices: 1 - I change my hash method and use a common Salt for all emails. Which make me lose a bit of security. Or 2 - I hash the email with all the Salts from the DB and check for matches. My guess is that this will be horribly slow. So my question are:   * What should I do? Optimize security or "time"?   * Maybe hashing emails with unique and random salts in PBKDF2 is too much? If yes, what hashing method should I use?   * Is there any other solution? PS: I didn't post any code because I think this is more of a theory discussion but if code is needed let me know, I will add it.


Which open-source license is right for my project?

I am trying to choose the right license for a project that I would like to release as open-source later this year but I am unsure as to what the most appropriate license would be. I was originally thinking of the GPLv2 license, but I don't think that it is what I am after. I have been working on this project for over a year now (on and off) for my company. I figured that it would be great to give something back to the community and would like to release the project as open-source, but I want to retain full custody of the project. My company will be providing both free, commercial and community contributed content (perhaps with GitHub). Here is basically what I am after:   * Original source can be distributed and re-distributed (verbatim) both commercially and non-commercially as long as the original copyright information, website link and license is maintained.   * License of original source cannot be changed.   * Original source can be modified and distributed (commercially & non-commercially) for a specific application, but cannot be re-distributed without written consent from the original author (me). For example, a developer could change the source for their client, but they cannot redistribute that change. The developer may, however, choose to submit their modifications for integration into the original source.   * Themes and extensions must be covered by an open-source license. It must be possible for any developer to modify, distribute and re-distribute all themes and extensions (commercially & non-commercially) should they choose to do so. I am aware that it is unlikely that there is a license that will cover all of these points, but something along those lines would be fantastic. I have put a lot of hard work into this project and whilst I am happy to share it, I do not want to loose it to a big company who has loads of money to splash at it.


What are the recommended resources for learning about the Actor model of concurrent systems?

The Actor concurrency model is clearly gaining favor. Is there a good book that presents the patterns and pitfalls of the model? I am thinking about something that would discuss, for instance, the problems of consistency and correctness in the context of hundreds or thousands of independent Actors. It would be okay if it were associated with a specific language (Erlang, I would imagine, since that seems universally regarded as the proven implementation of Actors), but I am hoping for something more than an introductory chapter or two. I'm actually most interested in Actors as they are implemented in Scala, if there are any such resources available.


Learning C++ properly (not C with classes)

The typical reason I hear to why people bash C++ is that they don't actually know C++, they just know "C with classes", which apparently is different. I am just beginning to learn C++, however, I want to actually learn C++ and not simply "C with classes". How can I ensure I learn C++ properly? Some examples would be wonderful.


How can I make sure I'm writing C++ like it's meant to be written?

> **Possible Duplicate:**   >  How can I learn to write idiomatic C++? Besides the obvious answers of "use g++ instead of gcc, and cout instead of printf", how can I ensure that my toy project is teaching me proper C++ paradigms and patterns? Backstory: I've never written a line of C++ beyond Hello World, and I've chosen what should be a straightforward (albeit somewhat complicated) sample project to help me learn the language. I've decided that the goal I want to end at is a CLI Huffman encoder. It doesn't have to compete with modern compressors in speed or efficiency, it just seemed like a project that would help me touch many aspects of the language at once. So, before I dive into this project, what are some things I should keep in mind? A lot of what I'm going to be doing is research online, and I have a fear that a lot of tutorials are C-in-C++. I'm looking for answers like: "if you're using malloc, you're probably doing something wrong" or "you should probably be using `boost` or something similar". I'm also looking for suggestions like "if I were writing this, I'd use a template around x".


Find pattern in a string

How would one approach the following question: We have two strings: a normal alphanumeric string and a pattern string. the pattern string can be composed by alphanumeric chars plus the char "?" and "*" We want to check if the first string match the pattern, where the ? means that every char (alphanumeric) is permitted in that position, while * allows to have a sequence of alphanumeric chars.


Do I need to return error: null in JSON response?

When designing a RESTful API that uses JSON to respond to requests, I usually return an object like this when an error happens:               {       "error": "Something bad happened",       "error_code": "XXX"     }      Do I need to have a `"error": ""` or `"error": null` in my object when there is no error?


Validating User Stories: How much change is too much?

While the core of requirements development and acceptance criteria would ideally take place during the planning meeting in order to create a better estimate, Scrum encourages continuous interaction with the product owner throughout the sprint to validate and refine user stories.   * What kind of criteria is used to judge if there is too much change being imposed on a user story mid-sprint?   * When is it appropriate to change the requirements of the user story?   * When is it appropriate to cancel the user story / sprint in order to re-evaluate and re-estimate a user story in question?


Would Single Page Apps(thin server-thick client architectures) kill server side languages like Java, C++

Single Page Apps strips server down to a REST api. If SPAs are the modern and better way of developing web apps, then would someday JavaScript rule the world and server-side languages like Java, C++ etc would not be the prominent skill companies look for? Or are there still parts of huge and prominent web apps like youtube, amazon.com which just can't be all ported to client side JavaScript and would continue to depend upon server-side languages.


Sessions in cloud applications dangerous?

We have a django app hosted on heroku. I had a situation:   1. A user entered an email in a form on page1. If the email existed in the database he was redirected to Login page otherwise to register page.    2. In the register page the form was filled with the same email entered on page1 using request.session that was populated previously. **I was told it was dangerous as using sessions is not recommended in cloud applications. Is this notion correct both generally, and under above scenario?**


The Written Roles of Software Development Manager

We all know what a software development manager does, but I'm afraid that we only know it _vaguely_. We think we know what he is doing, but to exactly list down what is the job scope is a bit hard. In your opinion, what are the roles of a software development manager?


With AMD style modules in JavaScript is there any benefit to namespaces?

Coming from C++ originally and seeing lots of Java programmers doing the same we brought namespaces to JavaScript. See Google's closure library as an example where they have a main namespace, `goog` and under that many more namespaces like goog.async, goog.graphics But now, having learned the AMD style of requiring modules it seems like namespaces are kind of pointless in JavaScript. Not only pointless but even arguably an anti-pattern. What is AMD? It's a way of defining and including modules that removes all direct dependencies. Effectively you do this               // some/module.js     define([         'name/of/needed/module',         'name/of/someother/needed/module',       ], function(          RefToNeededModule,          RefToSomeOtherNeededModule) {            ...code...            return object or function     });      This format lets the AMD support code know that this module needs `name/of/needed/module.js` and `name/of/someother/needed/module.js` loaded. The AMD code can load all the modules and then, assuming no circular dependencies, call the `define` function on each module in the correct order, record the object/function returned by the module as it calls them, and then call any other modules' `define` function with references to those modules. This seems to remove any need for namespaces. In your own code you can call the reference to any other module anything you want. For example if you had 2 string libraries, even if they define similar functions, as long as they follow the AMD pattern you can easily use both in the same module. No need for namespaces to solve that. It also means there's no hard coded dependencies. For example in Google's closure any module could directly reference another module with something like `var value = goog.math.someMathFunc(otherValue)` and if you're unlucky it will magically work where as with AMD style you'd have to explicitly include the math library otherwise the module wouldn't have a reference to it since there are no globals with AMD. On top of that dependency injection for testing becomes easy. None of the code in the AMD module references things by namespace so there is no hardcoded namespace paths, you can easily mock classes at testing time. Is there any other point to namespaces or is that something that C++ / Java programmers are bringing to JavaScript that arguably doesn't really belong?


What can I do about multiple coworkers who constantly question my knowledge?

At my current job, I have coworkers who still throw interview questions at me even though I've been working there for 6 months. I though it would end after I got hired but then it continued on and on. What is appalling is that it is precisely the ones who are poor programmers (the manager and couple other guys) who do this most. How should I handle this situation? P.S. I have certainly seen this at other worksites in the past, but usually there is just one jerk with a chip on his should who does it. Here, it is many people.


Do I need an equivalent for MAMP to work as a Ruby Server?

I am just starting to learn Ruby, and I want to do something that required a DB but I'm unsure whether MAMP would work or do I need something else?


Is it appropriate to make a User Story for removing small pieces of existing functionality?

For an area of an application that has been developed, the request has come in to remove an item from a menu. I know this is a small thing, but how do you treat it in Scrum? I'm used to using User Stories to add functionality, not to remove it. So my question is, should I create a user story for this, somehow phrased to do with removing the button? Or is there a better way or dealing with this? Thanks, Paul.


Is it safe in Haskell to save a data structure to a file using "show", and retrieve it using "read"?

Say I have the following types:               type EndsTup = (Int,Int)         -- (0-based index from start or end, Frequency)     type FreqTup = (Char, [EndsTup], [EndsTup])         -- (Character, Freqs from start, Freqs from end)     type FreqData = [FreqTup]         -- 1 entry in the list for each letter      Which I'm using to store data regarding the frequency of a character's position in a word. If I want to then save this to file, is it safe (as in guaranteed not to corrupt if it's written without error) to convert the structure to a string using show, and then read it using something like:               readData <- readFile filePath     let reconstructed = read readData :: FreqData      I'm just asking because that seems "too easy". Is this how it's typically done?


How to obtain an affordable electronic paper programmable kit or similar?

I'm really interested in playing around with the electronic paper technology, but I don't really want to program any commercial device (kindle or whatever). I have some ideas and I want to start. How do I get a screen of electronic paper, a chip and how to start programming for it (language, interface)


Where we should put validation for domain model

I still looking best practice for domain model validation. Is that good to put the validation in constructor of domain model ? my domain model validation example as follows:               public class Order      {         private readonly List<OrderLine> _lineItems;              public virtual Customer Customer { get; private set; }         public virtual DateTime OrderDate { get; private set; }         public virtual decimal OrderTotal { get; private set; }              public Order (Customer customer)         {             if (customer == null)                 throw new  ArgumentException("Customer name must be defined");                  Customer = customer;             OrderDate = DateTime.Now;             _lineItems = new List<LineItem>();         }              public void AddOderLine //....         public IEnumerable<OrderLine> AddOderLine { get {return _lineItems;} }     }               public class OrderLine     {         public virtual Order Order { get; set; }         public virtual Product Product { get; set; }         public virtual int Quantity { get; set; }         public virtual decimal UnitPrice { get; set; }              public OrderLine(Order order, int quantity, Product product)         {             if (order == null)                 throw new  ArgumentException("Order name must be defined");             if (quantity <= 0)                 throw new  ArgumentException("Quantity must be greater than zero");             if (product == null)                 throw new  ArgumentException("Product name must be defined");                  Order = order;             Quantity = quantity;             Product = product;         }     }      Thanks for all of your suggestion.


Legal Applications of Metamorphic Code

Firstly, I would like to state that I already understand the 'vx' applications for Metamorphic code. I am not here to ask a question related to any of those topics as that would be inappropriate in this context. I would like to know if anyone has ever used 'Metamorphic' code in practice, for purposes other than those previously stated, if so, what was the reasoning for using said concept. In essence I am trying to discover a purpose for this concept, if any, other than circumventing anti-virus scanners and the like.


Do developers on a team ever have a "personal" version control?

I'm assuming that after a while, many developers come to know/love a particular VCS. What happens if you find yourself on a team using an incompatible system - do you learn the new system and adapt your workflow to the team's, or do you keep your old system, and try to get both working in tandem? It strikes me that this is either a very common strategy, or a serious faux pas. I'm new to software development, so this question is strictly hypothetical for me so far. While my gut tells me that the decentralized structure and branch- happy nature of git/Mercurial would appeal to me more than the very centralized Vault set up my group uses, I do not know nearly enough about working with version control in general yet to prefer any one system to another, so I will be sticking with whatever the team is running for the foreseeable future. But it does lead me to wonder how common it is for developers faced with learning a new VCS to roll a kind of "hybrid" of both systems - using their preferred system locally to manage what they're working on, and really only using the team wide system to commit/update. This of course leads to other questions - is there a set pattern for working with two systems at once? How do you deal with the fact that your local repo doesn't have access to the full history of the project? Etc...


which is best technology to develop UI for Desktop application in java

I want to develop a Desktop Application using Java. I want to know which are the best technologies to develop User Interface like (swing, swt, etc.)?


Optimising news fetching

I have a web scraper for scraping news from different sources in wp7. My current appraoch for doing this is:   * load newspapers information from xml file.   * go to the specified sections and fetch the urls of the news items.    * go to each url and fetch headline, image, publisher.    * display using a MVVM architecture of windows phone. The whole thing takes place asynchronously...meaning as soon as url from a section of a newspaper is fetched it is added to the queue, and the second stage consisting of fetching headline, image etc starts... and as soon this is fetched even for one article, it is displayed. Later on as more articles are fetched, they are added on to the list. For the fetching purpose I am using a SmartThreadPool(http://www.codeproject.com/Articles/7933/Smart-Thread-Pool) for windows phone. My problem is that...even for fetching around 80 items (in total) from 9 publications, it is taking more than a minute. How can i speed up the procedure? Note: I have a two stage approach because many times the images are not available with headlines, and are only found in the article.


Should I choose C or C++ for an interview?

I know a bit of both C and C++. I am assuming that many people who know C++ also know C. I am wondering what language I should pick to code in during an interview. C, because it's faster to make a working program in C, because you don't have to worry about thinking what objects your system should have, etc, as in C++ (though many experienced C++ programmers can code their solution in C++ in just the same amount of time)? Or C++, because then you don't worry much about passing parameter by parameter and you can just pass around the object etc and you can leverage on existing string library, etc.?


Are frameworks necessary In PHP?

Are frameworks really necessary in PHP? What are the advantages and disadvantages of using one?


What to do as a new team lead on a project with maintainability problems?

I have just been put in charge of a code project with maintainability problems. What things can I do to get the project on a stable footing? I find myself in a place where we are working with a very large multi-tiered .NET system that is missing a lot of the important things such as unit tests, IOC, MEF, too many static classes, pure datasets etc. I'm only 24 but I've been here for almost three years (this app has been in development for 5) and mostly due to time constraints we've been just adding in more crap to fit the other crap. After doing a number of projects in my free time I have begun to understand just how important all those concepts are. Also due to employee shifting I find myself to now be the team lead on this project and I really want to come up with some smart ways to improve this app. Ways where the value can be explained to management. I have ideas of what I would like to do but they all seem so overwhelming without much upfront gain. Any stories of how people have or would have dealt with this would be a very interesting read. Thanks.


A Newbie .NET Developer Desperately Seeking for Advice

I am becoming a little desperate. I am 23 and for the last three months I've been working as a software developer for a British Company who develop a leisure management system. Prior this job, I was never a developer and just did some minor university projects and one ASP.NET project which I didn't complete. I was programming in C# but now I have moved to VB.NET, since most of the project in this company are VB-Based. I know my knowledge is very limited, in software design, development, databases and all. The responsibility here is quiet heavy for a newbie, I am the only developer who is developing the whole package (7 programs, all desktop applications) and the thing is while I am getting better at fixing bugs and adding tasks now I need to add a whole component to two of their systems and now I feel I am hopeless (We did a new release while I was working in this three months). I think I have weakness in Data Binding which is causing me the slow progress of adding that component! While I love coding and I wouldn't get tired of it at all (When I go home I have my home coding for fun too), it came to my mind maybe I am not intelligent enough for this job. Can experienced Developers help me on this issue and provide me some advise for getting better and better? What did youselves do at your first carrer in development? What were the problems?


How to make people new to programming stop asking me questions and distracting me?

I am at secondary school right now and I'm the only one in my class who is experienced with programming. Because of that, people are constantly distracting me while I'm writing code to ask me to solve a problem. Usually I reply with something like 'I don't know, I never use that' but I don't want to lie to people. Another problem is that I became so well known for this that even students from other classes are asking me questions. I find this damn annoying. Thirdly, if I solve a problem for them they don't learn anything from it. How can I stop people from asking me programming-related questions in a kind way?


What is the best idea to put available OS (linux) and Web application to client?

After a year programming a web based business management system, I got my idea divided into two differents ways to do what I'm doing... I will try to explain in follow lines: **First I will describe my enviroment:**   * Webserver: _apache, ngynx_   * Programming Language: _PHP, Shell Script, Java Script, SQL_   * Database: _Mysql_   * Operating System: _Linux, UNIX (All Distros) (If manually configured works on windows)_   * Authentication Server: _FreeRadius_ **First situation** I have my application running on this enviroment that I had just described before, as my application is a SaaS app, then I have my own server to run it all and customers pay to use it as a service accessed by webbrowser. **Second Situation** The same as before but with one big difference, everything (environment) is installed in the customer, then I need to cryptography all my codes (It includes PHP and Shell Scripts). I think this situation is most difficulty, but I would like to hear it from different points of view.


Examples of non open source projects on Bitbucket or Github

Need examples to show management that these are used for source control and effectively backup of projects. They will be concerned about having their source code off-site. If there are good examples I think that it may help in convincing them to consider this as an option.


PHP Riak in place update

From what I can see, when using Riak to update an object, I first need to load the object into PHP, then edit the object, then store the object back to the Riak database. I was wondering if there is a way to update a bucket without pulling it into PHP first. That way, it would save on the network I/O and latency of pulling it into the PHP script. Can objects be edited directly on the Riak side of things? Edit: Is there away to push data to the end of a raik object, so if i have an object that is numeric array can i make a push to add subject that i know its not there or no in place updates what so ever


Is a big name computer science degree worth the cost?

> **Possible Duplicate:**   >  Do I need to go to a big-name university? I'm currently in High School and trying to look into what I want to do after I graduate. I know that I will be going to college, and that I want a degree in Computer Science, however, I'm not entirely sure where I want to go (I haven't started the application process yet). I already have built up a decent amount of experience in programming (over the summers I have been hired to program at a local university), and I'm pretty capable of teaching myself most of the material I've come across through either books or web documentation. I'm interested in whether it is worth it to get a degree from a major, big- name computer science university for $50,000 each year, as opposed to going to a local state school for only $20,000. For my Bachelor's degree alone, this would be $120,000 _more_ than the state school. I've also heard that where you get your Bachelor's doesn't matter much if you plan to get a Master's degree. Many people recommend going somewhere like a state school for your Bachelor's, and then try to get into a more major school for your Master's. Has anybody found any truth in this? Basically, is going to a big name computer science school for a Bachelor's degree really worth the added expense?


Do I need to go to a big-name university?

As a soon-to-be graduating high school senior in the U.S., I'm going to be facing a tough decision in a few months: which college should I go to? Will it be worth it to go to Cornell or Stanford or Carnegie Mellon (assuming I get in, of course) to get a big-name computer science degree, internships, and connections with professors, while taking on massive debt; or am I better off going to SUNY Binghamton (probably the best state school in New York) and still get a pretty decent education while saving myself from over a hundred- thousand dollars worth of debt? Yes, I know questions like this has been asked before (namely here and here), but please bear with me because I haven't found an answer that fits my particular situation. I've read the two linked questions above in depth, but they haven't answered what I want to know:   1. Yes, I understand that going to a big-name college can potentially get me connected with some wonderful professors and leaders in the field, but on average, how does that translate financially? I mean, will good connections pay off so well that I'd be easily getting rid of over a hundred-thousand dollars of debt?    2. And how does the fact that I can get a fifth-years master's degree at Carnegie Mellon play into the equation? Will the higher degree right off the bat help me get a better-paying job just out of college, or will the extra year only put me further into debt? Not having to go to graduate school to get a comparable degree will, of course, be a great financial relief, but will getting it so early give it any greater worth?   3. And if I go to SUNY Binghamton, which is far lesser-known than what I've considered (although if there are any alumni out there who want to share their experience, I would greatly appreciate it), would I be closing off doors that would potentially offset my short-term economic gain with long-term benefits? Essentially, is the short-term benefit overweighed by a potential long-term loss? The answers to these questions all tie in to my final college decision (again, permitting I make it to these schools), so I hope that asking the skilled and knowledgeable people of the field will help me make the right choice (if there is such a thing). * * * **Also, please note:** I'm in a rather peculiar situation where I can't pay for college without taking out a bunch of loans, but will be getting little to no financial aid (likely federal or otherwise). I don't want to elaborate on this too much (so take it at face value), but this is mainly the reason I'm asking the question. * * * Thanks a lot! It means a lot to me. * * * **Edit:** Thanks to everyone for your wonderful responses! All thought-out and well-written, and I wish I had the time to write comments on all of them. Hopefully, I'll be able to when I get home from school and work later tonight... * * * **Edit 2:** Wow! Unbelievable that I've gotten this many helpful responses in such a short amount of time! I haven't had the time to properly sit down and respond to many of these, but I really appreciate the effort, and I will do so tomorrow. Big thanks to everyone who posted! * * * **Edit 3:** For those who are interested, I got into CMU, Cornell, and Binghamton, and decided on Binghamton. CMU and Cornell gave me no financial aid whatsoever, while Binghamton, being a state school costs less than $20,000 a year including room and board. When I got the admission letters, the decision was hard, but after visiting Binghamton and realizing just how good of a school it is (state schools are severely underrated in the United States; it's a terrible problem—for what it's worth, it turns out that Binghamton was even more selective than many of the private schools I applied to, not that that inherently means much, but just as a metric), I couldn't pass up. Besides, I visited on a terrible, rainy day, and was still impressed, so I knew it was the one. ;) Doing some actual financial analysis, I realized I would never be able to pay off the $60,000 a year required for CMU or Cornell, only making choosing Binghamton feel even better. While this question is specific to my case, I hope this can help someone else in my position. * * * **Edit 4:** I've recently been made aware that students in a similar position have been stumbling across this question, and I wanted to give a short update. I'm incredibly happy here at Binghamton, and if I had to go through the college process all over again, I wouldn't have chosen any other school. I think most students tend to be happy regardless of where they go, but for me, Binghamton has been a great experience. What I want to tell students is this: I know that it's hard to judge schools without paying attention to their names and reputations — I doubt Carnegie Mellon will ever be considered a _bad_ school for studying Computer Science — but don't ignore schools just because you've never heard of them! Don't be afraid to make **practical** choices. I know that Binghamton isn't a world- famous university, but from what I've seen, our curriculum is more rigorous, and lays down a better foundation than many top schools that I've heard of, and for much cheaper. We focus a lot on getting students internship, job, and research opportunities, and we have very strong connections to companies like Microsoft, Bloomberg, IBM, Lockheed Martin, and several others. We're a very _practical_ school — we might not be famous, but if you come here, you're going to get an excellent foundation for your career, and almost certainly an internship or a job. Plus, we're small enough that students can get to know their professors well (I have several friends who are first-name basis with their professors), which certainly helps if they're interested in doing research, which we do a _lot_ of at Binghamton. I didn't know any of this when I chose Binghamton, and it's one of those things you can only learn about a school once you go there — details like this won't be stressed on brochures and magazines, and you learn about it through experience. So, what I want to say is, don't go picking schools solely on whether you've heard of them or not, and consider state schools. The better ones, like Binghamton, are very good choices. Take this with a grain of salt: of course, if you're motivated, skilled, and hard-working, and if you push yourself to succeed, where you go doesn't matter as much because you'll be noticed wherever you are. I got very lucky with my internships and job opportunities, and my experiences have definitely been flukes, but if you are constantly improving your skills and apply yourself, you can further yourself much more than your school will ever be able to. If you're a student, and you have any questions about this topic, please don't hesitate to email me. I'd love to help answer your questions: itai@itaiferber.net


Resources for a New Programmer with a Math Background

I'm almost brand new to programming, but have a fairly strong background in mathematics (primarily algebra and logic -- e.g. universal algebra). I've always heard that there is a strong relationship between math and programming, but the intro programming books I've looked at don't seem to emphasise it. For reference, I started with Java, since that's what I need to be able to use for a job I'm at this summer. I imagine that most authors of these resources assume that if you don't don't have a programming background, then you won't have a math background. It makes sense to me though to use the background in math that I have to help the learning process. All that being said, are there any resources out there for a new programmer (hopefully related to Java) that also reference the mathematical concepts that are being introduced? Perhaps explaining things with analogies to math? Apologies if this question isn't appropriate. I tried searching for such a resource, or an answer to this question on this site already, but have had no luck.


How does public API designer come to the conclusion what shall be provided for future and what not?

Often working with various jars and exploring the features specially in corner cases, I often realize and think that how is that they thought that it might be a useful scenario somewhere in future that it might be used and an API is made handy. So, how do they come to the conclusion what shall be provided and what not? Other problem I faced once was that I was in need of a certain feature and it was missing from the list which struck me with immense drawback of using API's. Shouldn't it be that if some feature is missing then programmer should be able to program it himself rather than depending entirely on APIs all the time?


Zen Coding for Java?

I just saw a demonstration of Zen Coding. I think it's a great investment on productivity, however my work is 99% backend data processing via Java. So far I only know templates in Eclipse like sysout and foreach (then hit CTRL+SPACE in MS). Is there more Zen Coding for Java?


Why is it so hard to get employees to update the issue tracker?

I've always had this struggle to get folks to update their issues, both at my company and at work. I've had a few cases when people actually do it from the goodness of their heart, but ~70% of the time I have to be chasing people down. Being the one that generally does some or other form of management (I am firstmost a developer), the main reason I try to give is that I don't want to be chasing people down and interrupting to query on progress, but I don't think in the end people mind that much being asked. In some rare and extreme cases I end up updating their tickets (when I need to create reports). So, have you ran into this problem?, how have you encouraged developers to update the issue tracker frequently?, what degree of success have you had?


Can working with bad code erode your programming skills?


How to move away from hardcoded paths in our build processes

We have a set of Java tools that are built and run locally. Whenever one of the devs commits a change, everyone else (including non-developers) need to do an update and build the tools. Everyone uses windows machines so whoever designed the build processes decided to place everything in a folder called `C:\build` and dump all of the class files in the appropriate folders. For example, the folder might look something like               C:\build\firstTool\     C:\build\secondTool\     C:\build\settings.ini      We also have a huge library folder where all the jars go, and it's placed here               C:\lib\      As a result, many classes are simply assuming this is where the files are going to be stored and have hardcoded paths everywhere. What can I do to clean things up? I don't want users to have to build tools, nor do I want them to have to update any checked out repos on their end. Personally, I think developers should be the ones maintaining releases.


How can I feel more confident about my programming skills?

Programming isn't alien to me. I first starting doing markup (HTML, now please don't laugh at me) when I was 12 and a little bit of BASIC when I was 13 (I knew much about Flowcharts, Pseudocodes at this point), but then I was admonished into Biology in high school and hence missed out on "real" programming knowledge of languages such as C, Java, etcetera. I took up CS for my UG B.E. (similar to BS, but way more theoretical). I learnt C & C++ (to a lesser extent) on my own (my prof was a total pain and the class was filled with code-jocks (who had already learnt it in school, and hence paid no attention to class and didn't let lesser mortals like me to pay any attention to class either)) and could whip up an awesome addition or multiplication program (ones which now even kinder-gardeners' whip up with way more finesse) and a piss-poor knowledge of Java (which has even grown rusty in recent times). My main problem is that I've always felt inadequate and strangled by my limited programming skills and belittled by the code-jocks (believe me, I've come across this site ages ago, but could just now build up the courage to actually post a question) and have been at times even depressed over said inability. Most people say that Programming isn't necessarily about the language but the state of mind that the person has and the techniques they employ to solve problems/issues. I agree with such sentiments, but can I ever acquire such a "state of mind", and if such how should I approach "Programming/Coding", and if there are any set ways and steps one most go through to attain the "Zen of Coding". How do I do so? Also, it wouldn't hurt if some Saint wanted to mentor this downtrodden piece of $#!^. P.S. I would forever be grateful to any person who considers me worth their time, and as a bonus would name my first piece of Software I ship after them. (If I ever get to ship one, i.e.,) TL;DR: Never really learnt "Programming/Coding", can't solve problems even if I try to. Help me!


Who should define, assign, implement, and follow the tasks in Scrum?

Roles in scrum are Product Owner, Scrum Master, and Scrum Team. A user story should also break down into smaller pieces called tasks. A task seems to have four phases, namely, definition, assignment, implementation, and following. Who should do what in Scrum about tasks? Is it the responsibility of scrum master to update remaining hours of a task, or is it the responsibility of the developer (scrum team)? Should developers assign tasks to themselves or is it the responsibility of scrum master accompanied by product owner?


Why do we need different JS for different browsers

What exactly are different things we need to take care when writing different JS files, like arrays, variables etc., Is there a book or website explaining differences between different JS engines used for browsers? I was working on something in our application and bumped into a JS issue and was looking for solution and found out that we might need 2 different JS for different browsers to get my exact functionality. Why is that? Is that the browsers use different JS engines so they understand my JS in different ways?


Large teams with layered application

I work in a fairly large team (~15 developers) which is currently discussing our working methodology. The software we work on is quite feature-rich and expanding rapidly in terms of scope so the number of developers has increased lately and will continue to increase. At the moment the different developers have different focus areas which they happen to be good at. Some focus on user interface, some on business logic and some on backend. But a UI developer may add something to the backend if he feels like doing it. As the number of developers grow, we can no longer work in the same team (it's kind of hard to try to follow what 20 other people are doing). Multiple teams working in the same code base could get messy if people are changing "other peoples' code". We are discussing some alternative ways to divide our tasks, and different people argues for different ways:   * Some think that the current way of doing things is good enough. Sure, a guy who focuses on the UI could make changes to the backend business logic and potentially mess things up. But at the same time we trust him not to mess up too much. Reviews of changes could be enough to make sure that the quality stays good.   * Some prefer that a team is assigned to a specific layer. For example, a team (2-3 developers) could be assigned to work only business logic implementation in backend, while another team could be assigned to work on frontend and a third could focus on the persistence stuff. This would encourage people to be experts in their layer. The down side is that if a UI developer needs something in the backend, there's an overhead with planning if the person doing the backend is in another team.   * A third suggested way is to have teams with members knowing all layers. So one team would focus on a specific type of functionality, and then include members knowing about UI, business logic, backend, etc. This would give the benefit that a team won't need to wait for another team to finish to implement a new feature affecting all layers. The downside people see here is that this could lead to more split-focus between the developers, which could lead to lower quality. I'm not sure what I'm asking here, but if someone has experience, or know any about any good reading material about this subject it would be appreciated.


What classes to put exactly in a class diagram?

What classes must I put in a class diagram? Only classes used in Business Layer and associations between them? Or also other classes in the Data Access Layer, Service Layer, etc.?


Visual Studio DBProjects and problem with it running post-build SQL (file too big)

What I am doing is creating a DBProject.. importing a DB.. then creating scripts in the PostBuild that are DATA scripts for each table (so that the post build can populate the tables after the schema is generated.. Then problem is some of these tables containg 50,000 rows and when you put a 50,000 row insert into ONE .sql file for the post build it fails because it is too big.. so.   1. Is there a better way to achieve this ? (getting a schema and data of a DB created as part of a DBprojects Build/Publish)   2. If this way is valid.. Is the only thing to do is create another post build process that manually breaks the one big .sql file into smaller .sql files ? (so it can build/publish)


FFmpeg: Can I replace libx264 with OpenH264 in order to go LGPL?

I have some video processing to run and FFmpeg already contains much of what I need. However my videos are all compressed with H.264 video codec and libx264 is a GPL part of FFmpeg. On the other hand, the Constrained Baseline Profile is pretty enough for my application what means I could perfectly use OpenH264. So would it be possible both in theory and in practice to make this replacement?


Login on every page requires SSL on all pages

Our website has a login form that shows up in the header on every page on the website. This is what my boss wants however we need to get PCI compliant and it says any sensitive form (login/password) requires SSL. So does that mean the entire website has to be running under SSL while a user is not logged in? Another question related to that, we have third party security software scanning and testing our site and it sends HTTP post to the login form on all the pages and reports it is unsecured because it submit's it under HTTP. I am wondering how a company like say Godaddy does it because they have a login/password on their homepage yet I can access it via HTTP and submit my login information just fine. By that logic they are not secure because it allows me to do that right? I feel like I am missing something but not sure what. -EDIT- Some information that came from the security site: _**Description_** A vulnerability exists that allows an attacker to harvest sensitive information (login credentials, etc) that are thought to be SSLsecured. Specifically, a form was found on an HTTP (unencrypted) page that sends information to an HTTPS (encrypted) page. An attacker could leverage cache poisoning (DNS/DHCP/ARP/etc) or another vulnerability (e.g. XSS) to cause the HTTP page to send information to an attacker-controlled website instead of the legitimate HTTPS site. Furthermore, toolkits exist to automate the process of harvesting such credentials, connecting to the legitimate HTTPS site and establishing the attacker as a transparent proxy between the victim and the legitimate host where the attacker sees all information in cleartext (including login credentials, etc). Victim<\---------HTTP--------->Attacker<\---------HTTPS--------->Legitimate Site CVSS Score 2.1 _**Solution_** Do not allow any information you want SSL secured to originate from an unsecured page.


How to convince a client to switch to a framework *now*; also examples of great, large-scale php applications

I'm about to start working on a very ambitious project that, in my opinion, has some great potential for what concerns the basic concept and the implementation ideas ( _implementation_ as in _how this ideas will be implemented_ , not as in programming). The state of the code right now is unluckily subpar. It's vanilla php, no framework, no separation between application and visualization logic. It's been done mostly by amateur students (I know great amateur/student programmers, don't get me wrong: this was not the case though). The clients are really great, and they know the system won't scale and needs a redesign. The problem is, they would like to launch a beta ASAP and then think of rebuilding. Since just the basic functionalities are present now, I suggested it would be a great idea if we (we're a three-people shop, all very proficient) ported that code to some framework (we like CodeIgniter) before launching. We would reasonably be able to do that in < 10 days. Problem is, they don't think php would be a valid long-term solution anyway, so they would prefer to just let it be and fix the bugs for now (there's quite a bit) and then directly switch to some ruby/python based system. Porting to CI now will make future improvements incredibly easier, the current code more secure, changing the style - still being discussed with the designers - a breeze (reminder: there are database calls in template files right now); the biggest obstacle is the lack of trust in php as a valid, scalable technology. So well, I need some examples of great php applications (apart from facebook) and some suggestions on how to try to convince them to port soon. Again, they're great people - it's not like they would like ruby cause it's so hot right now; they just don't trust php since us cool programmers like bashing it, I suppose, but I'm sure going on like this for even one more day would be a mistake. Also, we have some weight in the decision process.


How do I find fun companies?

When looking for jobs, I'm not sure how to determine whether the company is fun to work for or not. I want to work in companies that are open, innovative, and make a good contribution to the world of computer science. For example, Dropbox looks like a very fun company and its existence is very important. How do I spot this in job advertisements? EDIT: I should note that I live in Australia, so many of the fun companies that I know does not have any office here. I know only a handful of fun companies in Australia – including Google in Sydney. But I don't know that many.


How can I display a diff result in a single file or document?

I'm reviewing my peer's code. I use SourceGear DiffMerge as my diff program, on a Windows environment. While I'm using the diff program, I can clearly see the code changes, etc. Is it possible to save the diff display somehow, with all its colorful rendering and strike-throughs so that I can send my comments by mail? In other words, is it possible to export the diff display to a single file (which includes all the relevant data) to be displayed without the actual need to save the two files separately? (Perhaps HTML is fit for this job). Can you recommend on a diff program that can export the diff as a single file? Thanks in advance!


How to find classes that use certain DB tables

**Problem:**   I'm asked to prepare a document where all our DB tables are listed and I'm supposed to list all Controllers that uses these DB tables for read and another list for Controllers that do write operations. Ex:                    +------------------------------------------+------------+          |            DB table                      | tbl_Orders |          +------------------------------------------+------------+          |Controllers that perform read operations  |    ??      |          +------------------------------------------+------------+          |Controllers that perform write operations |    ??      |          +------------------------------------------+------------+      We are trying to write some documentation for a **legacy** system built using Zend framework. The code is scattered everywhere. There is code in the Controllers, in the models and even in the views.   The application uses PROPEL as an ORM. What makes this really difficult is that the Controller may not be directly calling the table, but it may be instantiating a model class that calls that table. Is there an educated way to approach this crazy task? Note: Searching for the table name won't provide a solution because if a model uses that table I wouldn't know which Controller is using that model.


What is meant by "Repeat Business"?

Repeat Business obviously happens because the company has a great product or a great service. In the software industry, do companies make the code base complex enough so that the maintenance comes back to them? I have heard of cases where companies say "ya this code base has minor errors, let's ship them anyway, and let the customers come back for another change request on these". Then they would sometimes charge the customer for that. This question is specific to the software services industry. Do these things happen in the real world? I am trying to understand the business process.


Forking a dual licensed app: How to license on my end?

I forked a project that was dual licensed under the GPL and a commercial license. Since my code was open source and the GPL being what it is, I started by releasing my app under the GPL. But now I'm thinking about dual licensing the project and can't figure out what to do. Since I have copyright on a majority of the code (most of the code was either rewritten or new), can I just pick a commercial license or do I have to buy the upstream commercial license since I'm technically a "derivative" of the project?


Listener, logger, plotter - what threading arcitecture to choose for this?

I am constructing a program that does several things.   * **Listens** to a port. Every second a string is received   * When new data is received, it has to be **logged**. No errors or skipped entries are allowed   * When data is received, a **plot** on the screen has to be updated. This is an expensive computation. Missing some updates is not critical.   * Once a month, an **archiving** function shall be called, to backup the logs. This might take unknown amount of time. I am new to threading and would like to ask for _advice on the threading infrastructure_. On one hand, it seems that I need at least 1 additional thread besides the main thread, for the port listener. On the other hand, I am afraid that if I spawn too many a thread:   * Sync problems may occur   * The app may become resource-hungry Here is some proposed code for the listener. * The complexity of the code might rocket up


Using Facebook to find friends of friends in a way similar to Tripadvisor

I am looking at implementing similar functionality as Tripadvisor has when it comes to browsing hotels. However my site sells classified items. I would like for the the following scenario to take place. Let's assume all users have agreed to share basic information with the classified site. A user John lists an item and user Ann browses to that item. They have a common friend Paul. Ann then sees "Paul is a friend of this seller" when she browses to the items page. This assumes John has also linked his site account with Facebook and we have his FB ID. One way would be to store all of John's friends and update that list when ever he visits the site. You would then run a query on this table each time a user visits that listings page to look for matches. Any thoughts on the best way to do this?


How can I comply with Open Source licenses, and yet protect my own work + App Store

I recently developed an application for an organization (and I'm not charging them). I want to maintain total ownership of the source code and there are various Open Source Project that I've used. I want/need to comply by the rules of the licenses that they use and still keep the project within a few guidelines: >   1. If I ever give the source code out to the organization, It cannot be > modified, redistributed, or shared in any form without my written permission > (which needs to be re-obtained every version). >   2. It should always attribute credits to the developer. >   3. I retain all rights to redistribute/reuse the source code, _since well, > I made it_ >   4. It needs to comply with the App Store's rules (which aren't too open- > source friendly) > The organization has retained the copyright for the compiled application (if that matters) The licenses include: >   1. liberal BSD >   2. Apache License, Version 2.0 >   3. royalty free >   4. public domain (same as 3) >   5. Small amount of artwork from an MIT licensed project > So my question is how can I comply with these licenses but also create a license for my own project that allows me to retain ownership of the source code.


Static / Shared Helper Functions vs Built-In Methods

This is a simple question but a design consideration that I often run across in my day to day development work. Lets say that you have a class that represents some kinds of collection.               Public Class ModifiedCustomerOrders          Public Property Orders as List(Of ModifiedOrders)     End Class      Within this class you do all kinds of important work, such as combining many different information sources and, eventually, build the Modified Customer Orders. Now, you have different processes that consume this class, each of which needs a slightly different slice of the ModifiedCustomerOrders items. To enable this, you want to add filtering functionality. How do you go about this? Do you:   1. Add Filtering calls to the ModifiedCustomerOrders class so that you can say: MyOrdersClass.RemoveCanceledOrders()   2. Create a Static / Shared "tooling" class that allows you to call: OrdersFilters.RemoveCanceledOrders(MyOrders)   3. Create an extension method to accomplish the same feat as #2 but with less typing: MyOrders.RemoveCanceledOrders()   4. Create a "Service" method that handles the getting of Orders as appropriate to the calling function, while using one of the previous approaches "under the hood". OrdersService.GetOrdersForProcessA()   5. Others? I tend to prefer the tooling / extension method approaches as they make testing a little bit simpler. Although I dependency inject all my sourcing data into the ModifiedCustomerOrders, having it as part of the class makes it a little bit more complicated to test. Typically, I choose to use extension methods where I am doing parameterless transformations / filters. As they get more complex, I will move it into a static class instead. Thoughts on this approach? How would you approach it?


Is there a point in using closures for non-fully functional programming languages?

Maybe I don't understand closures fully but take for example C#, why would I use closures when I can use classes? Am I missing something? Note that I read this one already but my question is specific to closure: Introducing functional programming constructs in non-functional programming languages


Is a lambda expression something more than an anonymous inner class with a single method?

There is a new hype with the long awaited lambda expressions in Java 8; every 3 day another article appears with them about how cool they are. As far as I have understood they a lambda expression is nothing more than an anonymous inner class with a single method (at least at the byte-code level). Besides this it comes with another nice feature - type inference but I believe the equivalent of this can be achieved with generics on some level (of course not in such a neat way as with lambda expressions). Knowing this, are lambda expressions going to bring something more than just a syntactic sugaring in Java? Can I create more powerful and flexible classes or other object-oriented constructs with lambda expressions that aren't possible to be built with current language features?


How to show levels of User Roles in ERD?

I felt this is the best place to ask this, rather than Stackoverflow as it is not related to programming.   Ok. The thing is I need to draw an ERD of a leave management system. Suppose there are three level of user roles there - Level A, B and C.   Where A can manage both B and C; B can manage only C and C is normal users.. Now I've specified an entity named USER in the ERD and thus have to maintain only one table in my database for all type of users and set a role flag and code according to that. But how exactly do I represent this three levels of users in an ERD, as the ERD has only one entity for USER? and role is just an attribute there?   Do I have to make three entities for three types of users and hence create three tables and continue like that? But I can manage all the functionalities with just one table and one flag.   Am a bit confused. Please do guide me. :)


Token based autorization for a web game

I am lead developer for a multiplayer game in a small startup company. I would like to present here my solution for token based authentication and hear your opinions about possible weak spots. I am not a security expert, far from it actually. I don't expect that I have made something bullet proof. Just want to minimize some obvious risky paths. Game is written entirely in Javascript and HTML5 and it's running NodeJS backend. Game account is authenticated by one the providers (usually OAuth2). This is simple step of clicking on the button, being transferred to provider website where user confirms access. When it gets back to us, I use provided ID of the user and lookup account in our database. New accounts are created right away here. Now having the account detail, I am using JWT to create token that is encrypted by secret key and contains internal account ID and also identity provided from authentication process. This token is then transmitted to the client browser and stored in localStorage. Most of the communication with the game server is over WebSocket. XHR is used sparsely. I am using Socket.IO library as the wrapper, but I have completely bypassed any handshaking process here. What I do is to let client connect with the server and then I am expecting from him token to be sent over WebSocket within small timeframe. If it fails, client is disconnected. Once I receive the token, it's pretty straightforward, just decrypt the token, read the identity information, fetch the account and compare with account ID with the one stored in the token. That's pretty much it so far. I realize one weak spot when someone can perhaps steal the token and store it in it's localStorage. However since content of the localStorage is not transmitted with every request as it happens with cookies, it makes it somewhat harder. Communication through WebSocket is secured by SSL of course putting another big obstacle in the way. Another way would be XSS attack which would allow someone to access localStorage directly. I would like to prevent this by using CSP header. I am also planning to introduce some kind of expiration of the tokens, but I am not yet sure how to approach it. Do you have other ideas what could be a weak spot for this ?


Would Someone explain me this Random Walk Algorithm for Onion Routing?

The Algorithm below is written in pseudocode and for simplicity the storage of the actual route in the Data structure is not included.                LengthFromSrc   = 0;      LengthFromDest  = 0;      TotalNumberHops = 0;           X = SRC;  /*Last Node Visited from Random walk starting at SRC;*/      Y = DEST; /*Last Node Visited from Random walk starting at DEST;*/           /* Randomly select a route length */      do {         Length = rand( ) % Max;      while( Length < Min );                while( TotalNumberHops < Length ) {                           Next = Toss Coin to Pick Random Walk from Src or from Dest;            if( Next == RandWalkFromSrc ) {           Z = Randomly select an adjacent node to X;           TotalNumberHops = 1 + LengthFromSrc + LengthFromDest                                 + shortest-path from Z to Y;            if( TotalNumberHops > Length )                 break;           X = Z;            /*include the node in the route*/                   Store X in the route data structure                LengthFromSrc++;       }       else {  /* Next = RandWalkFromDest */           Z = Randomly select an adjacent node to Y;           TotalNumberHops = 1 + LengthFromSrc + LengthFromDest                                 + shortest-path from Z to X;            if( TotalNumberHops > Length )                 break;           Y = Z;                               Store Y in the route data structure                LengthFromDest++;       }      }      I would kindly ask if someone could give me a brief analysis of the Graph as i would like to understand it better. My main problem is understanding the first part from do to while (TotalNumberHopse < Length). The if else part is clear to me :) Thank you very much in advance for your help! PS:http://www.onion-router.net/Archives/Route/ \--> My Source


What is meaning of a HINT when used in software engineering?

I've seen this now in a number of places and a number of contexts, for example in SQL. I cannot define the meaning of a "Hint" which it seems clear has some application as or part of a larger design pattern/technique. What exactly is a Hint when used in software engineering?


What frequency of updates is acceptable for a mobile application?

It's possible to publish daily updates for your application on Google's Android Market, but I have an assumption that users don't like to get frequent updates. How can I determine when I should publish updates? Is there an optimum interval to balance between delivering new features and bug fixes while not upsetting my user base?


Could someone explain HaXe enums?

I have AS3/PHP background and some basic understaning of enums from C++. Saying shortly: I read this: > http://haxe.org/ref/enums > > http://haxe.org/doc/cross/more_on_enum And though - good heavens! What the sorcery is this??? Enum Constructors Parameters? Enum Type Parameters?? Could someone explain with working examples (preferable on http://try.haxe.org/ ) the concept of enums in HaXe for someone coming from languages like PHP and AS3? What I tried? Firstly I wrote this:               enum Color3 {         Red;         Green;         Blue;         Grey( v : Int );         Rgb( r : Int, g : Int, b : Int );         Alpha( a : Int, col : Color3 );     }      Then this:               Color3.Grey(5);      And I don't know what to do with this further, and don't know where to search.


Free private git hosting

_Certanly it has been, it must've been, but I just don't seem to be able to find it answered already._ What are some good /or mediocre for that matter/ free private git hosting sites out there for storing some private projects? I would use Dropbox but I've heard bad things about how it can screw up the repo on sync.


Are there Negative Impact of opensource on commercial environment?

My company has a very broad range of products and there are a few that are not strategic to us so I wanted to open source them (so we can focus on what makes us unique and open source the products that every firm has). Our industry(hedgefund) does not open source(we would be the first firm to try this) and the feedback I'm getting from my management team is either 1) we'll destroy the industry or 2) all competitive commercial firms will unite against us and we'll be wiped out either way. It's a big battle in my firm right now between the IT people who have seen the positive effects of sharing and the business people who think we'll be giving up everything (they prefer we sell parts we want to opensource, but in their defense this is standard when divesting something). So what are your thoughts? Does open sourcing apply generally or is it only really applicable to software? Is it overall good for people in the industry and outside? I'm actually more interested in the negativeness effects(although positive are welcomed as well) **Update:** Long story short, although code is involved this is not so much about code as it is more about the idea of open sourcing. We are a mid sized quant hedge fund. We have some unique strategies but also have the standard long/short, arbitrage, global macro, etc.. funds. We are keeping the unique funds we have but the other stuff that everyone else has we are considering open sourcing (We have put in years of work & millions of dollars into. Our funds is pretty popular and our performance is either in first or second quartile so I suspect there will be interest from firms in or thinking of getting into the industry but I don't know to what extent). The goal is not to get a community to work for us, the goal is to let anyone who wants to tinker with it do so and create anything they want (it will not be part of our product line although I may unofficially allocate some our of staff's time to assist any community that grows). Although the code base is quite large, the value in this is the industry knowledge and approaches we have acquired (there are many books on artificial intelligence and quant trading but they are often years behind what's really going on as most firms forbid their staff from discussing what they are doing). Long story short, there maybe value here for people or not but I'm approaching open sourcing as a way to benefit the general public while we divest a product line up. But the flip side, is this is a core product to many other firms and they won't be happy(I think about linux/windows, wikipedia/britannica, google maps/commercial map firms, and so on). I'm fine with people disliking me but I'd rather it not be for unindented consequences and this question is to try to understand what those consequences generally are on industries that get core areas open sourced. For example, its hard to judge what part of the OS market grew because of Linux or was naturally growing on its own and so on. Technology has such fast grow and I'm struggling to understand how open sourced impacted it(and if it was positive or not. I.e. one of our large competitors has very large grants to top universities which obviously helps the schools, would open source limit the need for things like that?). I understand this can seem very specific to me but I'm trying to understand general impact of open sourcing and software seemed like a good place to learn.


Is a new build required everytime I make a change to the code?

I am working on a project that has around a hundred different files (.cpp & .h), and it requires around an hour to build the entire project on MSVC 2008, suppose that I now make a change to any one file, do I need to build the entire project once again, right from the beginning, or is there a way out ? I know it is very very noob like, but I am wasting a lot of time, hence I was wondering