Is this Job Smell?

Went for an interview and from what I could gather from the interviewer:   * Development is done to a 'wire-frame' specification where users get constant feedback and can change their mind at will   * I could be expected to 'set up new computers' and 'configure servers'   * Occasionally I will have to do unpaid overtime - particularly towards the end of a project   * They use visual source safe   * The company has chopped and changed quite a bit recently (name, management)   * I will be doing an extra hours work per day as compared to my current position and taking 1 less days holiday   * They want me to complete a test which is some development for their in house system (perhaps they want free work done?) Now I understand all these points by themselves might not mean much, and I would be happy to do a few of them as part of my job. But all together its making me wonder. I've yet to get salary details but I'm thinking it would have to be quite a bit higher for me to consider jumping ship. How does this position sound to you? Depending on the answers I'm tempted to link to company here - so I'm giving them a fair chance and they can defend themselves. Its possible that there are some misunderstandings due to short- ish hour-long interview.


Do you prefix variable names with an abbreviation of the variable types? (Hungarian Notation)

In my current job, there are no coding guidelines. Everyone pretty much codes the way he wants. Which is fine, since the company is small. However, one new guy recently proposed to always use Hungarian Notation. Until now, some of us used some sort of Hungarian Notation, some of us didn't. You know, it's an engineering company, so coding styles do not really matter as long as the algorithms are sound. Personally, I feel that these little type abbreviations are kind of redundant. A well thought-out name usually delivers the same message. (Furthermore, most of our code has to run on some weirdo DSPs, where a concept like `bool` or `float` doesn't exist anyway). So, how do you feel about Hungarian Notation? Do you use it? Why?


How to ensure that all the customers have the latest version of web application deployed on intranet?

How to update web application deployed on intranet? There is a Java Spring application that will be deployed on intranet of multiple customers. In case when there is a major update what should the developer do in order to ensure that all the customers have the latest version of his software? There is an option that an update module is implemented in the application and it will automatically query the central web repository for updates. This option doesn't work if there is the server where the application is installed doesn't have internet connection. Another possibility that comes to mind is to manually send a .war file to the IT personnel of all the customers for them to install the latest version. How to deal with updates in this situation?


Generating a Nakagami Random Variable

Assuming the only tool for generating random numbers I have available is generating a uniformly distributed variable `u` on U(0,1). I want to generate a Nakagami Random Variable from it. I know I could just plug `u` into the inverse CDF of the Nakagami distribution, but unfortunately, the inverse CDF isn't trivial to compute.


ArrayList in Java

I was implementing a program to remove the duplicates from the 2 character array. I implemented these 2 solutions, Solution 1 worked fine, but Solution 2 given me UnSupportedoperationException. I am wonderring why i sthat so? The two solutions are given below;               public void getDiffernce(Character[] inp1, Character[] inp2){      // Solution 1:                   // **********************************************************************************              List<Character> list1 = new ArrayList<Character>(Arrays.asList(inp1));         List<Character> list2 = new ArrayList<Character>(Arrays.asList(inp2));         list1.removeAll(list2);              System.out.println(list1);         System.out.println("*********************************************************************************");      // Solution 2:                   Character a[] = {'f', 'x', 'l', 'b', 'y'};         Character b[] = {'x', 'b','d'};              List<Character> al1 = new ArrayList<Character>();          List<Character> al2 = new ArrayList<Character>();          al1 = (Arrays.asList(a)); System.out.println(al1);         al2 = (Arrays.asList(b)); System.out.println(al2);           al1.removeAll(al2);         // retainAll(al2);               System.out.println(al1);                   }


What did network programs use to communicate before sockets was invented (around 1983?)

Sockets were invented in Berkeley around 1983, but how did networked computer programs work before this? These days, pretty much everything uses sockets, so it's hard for me to imagine how else programs could communicate and Google turned up nothing.


Is conditional return type ever a good idea?

So I have a method that's something like this:               -(BOOL)isSingleValueRecord      And another method like this:               -(Type)typeOfSingleValueRecord      And it occurred to me that I could combine them into something like this:               -(id)isSingleValueRecord      And have the implementation be something like this:               -(id)isSingleValueRecord {         //If it is single value         if(self.recordValue = 0) {                  //Do some stuff to determine type, then return it             return typeOfSingleValueRecord;                  }         //If its not single value          else {             //Return "NO"             return [NSNumber numberWithBool:NO];         }     }      So combining the two methods makes it more efficient but makes the readability go down. In my gut, I feel like I should go with the two-method version, but is that really right? Is there any case that I should go with the combined version?


Does TDD really work for complex projects?

I’m asking this question regarding problems I have experienced during TDD projects. I have noticed the following challenges when creating unit tests.   * **Generating and maintaining mock data** It’s hard and unrealistic to maintain large mock data. It’s is even harder when database structure undergoes changes.   * **Testing GUI** Even with MVVM and ability to test GUI, it takes a lot of code to reproduce the GUI scenario.   * **Testing the business** I have experience that TDD works well if you limit it to simple business logic. However complex business logic is hard to test since the number of combinations of tests (test space) is very large.   * **Contradiction in requirements** In reality it’s hard to capture all requirements under analysis and design. Many times one note requirements lead to contradiction because the project is complex. The contradiction is found late under implementation phase. TDD requires that requirements are 100% correct. In such cases one could expect that conflicting requirements would be captured during creating of tests. But the problem is that this isn’t the case in complex scenarios. I have read this question: Why does TDD work? **Does TDD really work for complex enterprise projects, or is it practically limit to project type?**


Managers X Motivation

As a programmer what do you think that is the thing that your manager does that mostly decreases your motivation? My manager insists in blocking web content (this week was msdn content and Microsoft domain sites) This is so stupid, make me think I am not a reliable professional or that I am stealing his internet. And not, it is not a small business. It is a huge enterprise where such dinossaurs should not exist anymore.


What should I consider before creating a Silverlight website?

I have opted to use silverlight for a website. This runs in all major browsers. The application could be highly graphically intensive. What have I missed? Edit: It runs on Android and other mobile platforms? I have since written about this here: http://carnotaurus.tumblr.com/post/4921541502/old-school-game-to-be-written- in-silverlight


Windows 7 Phone -- what version of Visual Studio to use?

I am an iOS developer just getting started with Windows Phone. At the moment, I have the free product Visual Studio 2010 Express for Windows Phone. I see that Microsoft has several higher-end IDEs, and some of them have some very fancy price tags. My question is -- will upgrading get me significant advantages? One thing I find very annoying is that unlike with Xcode, Visual Studio Express does not let me edit my source code while my app is running. (I don't need fix and continue; but it sure would be nice to be able to make changes while it is running, and have those changes applied the next time I run my app.)


Why must directories be empty before being deleted?

As far as I know, deleting a non empty directory could work the same way as deleting an empty directory: by removing the pointer to the directory's metadata there would be no pointers to the items it contained, effectively deleting all its children recursively. If that's true, then why must directories be empty before being deleted? Is it just a safeguard to prevent erasing many files at once, or a technical limitation of some (possibly ancient) file system?


Can WinRT really be used at just the boundaries?

Microsoft (chiefly, Herb Sutter) recommends when using WinRT with C++/CX to keep WinRT at the boundaries of the application and keep the core of the application written in standard ISO C++. I've been writing an application which I would like to leave portable, so my core functionality was written in standard C++, and I am now attempting to write a Metro-style front end for it using C++/CX. I've had a bit of a problem with this approach, however. For example, if I want to push a vector of user- defined C++ types to a XAML ListView control, I have to wrap my user-defined type in a WinRT ref/value type for it to be stored in a `Vector^`. With this approach, I'm inevitably left with wrapping a large portion of my C++ classes with WinRT classes. This is the first time I've tried to write a portable native application in C++. Is it really practical to keep WinRT along the boundaries like this? How else could this type of portable core with a platform-specific boundary be handled?


Are VB.NET and C#.NET projects created from Microsoft Visual Studio "Open Source" safe?

I'm developing software in VB.NET and C#.NET and planning to release their source codes as fully open source. Are these projects "open-source" safe? **My doubts are:**   1. VB.NET and C#.NET are using the .NET framework which is not open source.   2. The source codes depends on the compiler and the IDE, although there's 100% open source and compatible alternatives provided, it is confirmed to be buggy and incompatible with my project.   3. My projects were using the Jet 4.0 OLE DB, which is not open source either.    4. Files like .Designer.vb, Microsoft ResX Schema, the Solution file, or the .vbproj etc that are generated by the Visual Studio Maybe I didn't have enough knowledge on open-source in the field where the codes released can be mixed with non open-source, or the codes can be released as open source even though developed and generated on a non open-source IDE. Am I still eligible to hold the "open-source project" title? Can the codes be released as open-source? If so, what kind of open source license that are compatible based on the criteria above?


Are mutexes assigned to specific regions of memory?

I'm currently reading _C++ Concurrency in Action_ by Anthony Williams and I'm facing an obstacle in thought. First he describes deadlocks as when two threads lock simultaneously (at least, that's how I understood it), which makes sense. However, he goes on to explain how you can lock two mutexes at the same time. Obviously this has a function, but with the above (assumingly wrong) understanding that would instantly deadlock both threads. From that obstacle arises a new one; obviously it won't deadlock, which means the mutexes must have a more advanced use than just allowing a single thread to do work in a process. In the book, mutexes are given to particular objects. This leads me to my overall question(s): _Are mutexes assigned to specific memory regions_ , such as objects? If so, how? The book does a great job at explaining how mutexes can be used but never really describes what mutexes are at a low level. I realize they're implementation specific but I never really grasped what exactly they do or how the locking functions use them.


Is there a better term than "smoothness" or "granularity" to describe this language feature?

One of the best things about programming is the abundance of different languages. There are general purpose languages like C++ and Java, as well as little languages like XSLT and AWK. When comparing languages, people often use things like speed, power, expressiveness, and portability as the important distinguishing features. There is one characteristic of languages I consider to be important that, so far, I haven't heard [or been able to come up with] a good term for: **how well a language scales from writing tiny programs to writing huge programs**. Some languages make it easy and painless to write programs that only require a few lines of code, e.g. task automation. But those languages often don't have enough power to solve large problems, e.g. GUI programming. Conversely, languages that are powerful enough for big problems often require far too much overhead for small problems. This characteristic is important because problems that look small at first frequently grow in scope in unexpected ways. If a programmer chooses a language appropriate only for small tasks, scope changes can require rewriting code from scratch in a new language. And if the programmer chooses a language with lots of overhead and friction to solve a problem that stays small, it will be harder for other people to use and understand than necessary. Rewriting code that works fine is the single most wasteful thing a programmer can do with their time, but using a bazooka to kill a mosquito instead of a flyswatter isn't good either. Here are some of the ways this characteristic presents itself.   * **Can be used interactively** \- there is some environment where programmers can enter commands one by one   * **Requires no more than one file** \- neither project files nor makefiles are required for running in batch mode   * **Can easily split code across multiple files** \- files can refeence each other, or there is some support for modules   * **Has good support for data structures** \- supports structures like arrays, lists, and especially classes   * **Supports a wide variety of features** \- features like networking, serialization, XML, and database connectivity are supported by standard libraries Here's my take on how C#, Python, and shell scripting measure up. Python scores highest.               Feature           C#          Python      shell scripting     ---------------   ---------   ---------   ---------------     Interactive       poor        strong      strong     One file          poor        strong      strong     Multiple files    strong      strong      moderate     Data structures   strong      strong      poor     Features          strong      strong      strong      Is there a term that captures this idea? If not, what term should I use? Here are some candidates.   * **Scalability** \- already used to decribe language performance, so it's not a good idea to overload it in the context of language syntax    * **Granularity** \- expresses the idea of being good just for big tasks versus being good for big and small tasks, but doesn't express anything about data structures   * **Smoothness** \- expresses the idea of low friction, but doesn't express anything about strength of data structures or features Note: Some of these properties are more correctly described as belonging to a compiler or IDE than the language itself. Please consider these tools collectively as the language environment. My question is about how easy or difficult languages are to use, which depends on the environment as well as the language.


Do you still panic when you see a stack dump? Why?

A question for seasoned developers. Do you still get a sinking feeling when you see a stack dump? Any feelings of agitation, alarm, cold feet, confusion, consternation, dismay, dread, fear, trepidation? Why? For me it usually means that I'm not 100% sure about my design or I have not done enough testing of my code.


ASP.NET AJAX and my axe!

So, I'm seriously considering axing ASP.NET AJAX from my future projects as I honestly feel it's too bloated, and at times convoluted. I'm also starting to feel it is a dying library in the .NET framework as I hardly see any quality components from the open-source community. All the kick-ass components are usually equally bloated commercial components... It was cool at first, but now I tend to get annoyed with it more than anything else. I'm planning on switching over to the jQuery library as just about everything in ASP.NET AJAX is often easily achievable with jQuery, and, more often than not, more graceful of a solution that ASP.NET AJAX and it has a much stronger open-source community. Perhaps, it's just me, but do you feel the same way about ASP.NET AJAX? How was/is your experience working with ASP.NET AJAX?


What is the state of TWAIN on the Macintosh today?

I'm currently working on a project where we want to interface with TWAIN scanners on both the PC (Windows) and the Macintosh. On Windows, we basically have everything squared away and the code works successfully with the vast majority of scanners. On Mac OS X, we also basically have everything working and with the main scanner we used to develop the application with works perfectly, but we're not having a ton of luck with other scanners. As a byproduct of development on this project, we have a fair number of scanners from various manufacturers on- hand to test with. The results vary wildly:   * The scanner we used to develop with works perfectly on Mac OS X as it does in Windows. Ironically this scanner is the cheapest and crappiest scanner (speed-wise) we've ever encountered but it's been a dream to work with.   * Another scanner works great - until the second or third scan, at which point the application crashes with no clear indication of what happened (we get an EXEC_BAD_ACCESS from the debugger)   * Another scanner apparently has no TWAIN support on Mac OS X (no data sources in the "Image Capture/TWAIN Data Sources" folder), although it does have TWAIN support in Windows.   * Another scanner has a generic data source that I'm thinking is supposed to cover all the possible scanners from this manufacturer but when we try to initiate a native scan (which is a requirement for all TWAIN data sources) we get no results. Also, trying to install a second scanner from this manufacturer gums everything up and requires a manual uninstall for everything from this company.   * Another scanner has a TWAIN data source that appears to be specific to the manufacturer, but it also fails to initiate a native scan (but a scan using the native GUI - which is incompatible with our project - works) So I'm not sure where to go with this. I'm still digging into the code to figure out what, if anything, we're doing wrong but in checking against the TWAIN standard it really does look like we're doing everything right, but we're getting very hit-or-miss results on most of the scanners we're testing against. Also, as part of the new Cocoa/Carbon Events model there's this additional consideration of a "callback" function that Mac OS X TWAIN data sources are supposed to implement and I'm not seeing it called from most of these data source/drivers. So all of this leads me to wonder - is it that we're just doing something wrong or is TWAIN just not supported properly by and large on the Macintosh? I'm really not seeing a lot of information on TWAIN on the Macintosh online - the occasional sporadic inquiry on twainforum.org tends to go unanswered. Windows also has a thing called WIA - Windows Image Acquisition - and on the Windows side we also include this as an option. Is there something else on the Mac we should be exploring instead of or in addition to TWAIN? **NOTE:** I've posted this same question on StackOverflow but got no responses and after consulting meta, I've decided to re-post it here (since it's more discussion than specific). If this is a big no-no feel free to delete this thing.


What are my options for using a C++11 library in a C# WPF application?

I am writing a cross-platform (OS X and Windows) desktop application in C++11. I intend to use the same C++11 core on both platforms, utilizing native frameworks for the UI (Cocoa and Objective-C on OS X and WPF and C# on Windows) as I believe the best UX experience is a native one. Currently the application runs as a console app on both platforms. The application performs some CPU-intensive work and provides callbacks for progress reporting and, when complete, instantiates a collection of Items (`std::vector<std::unique_ptr<Item>>`) representing the results of the processing. My goal is for the C++11 library to act as a model for the UI in a manner compatible with the MVC and MVVM patterns. The UI must:   * Allow the user to choose a file to process (open a file dialog and send the file path to the C++ library)   * Display progress (handle callbacks from the C++ library to update a progress bar)   * Display the results in a WPF form (access the Item class and display information it provides)  I've looked at WinRT and it seems there isn't a lot of information out there for use in desktop applications. I'm also not fond of the idea of creating the UI itself in C++. My goal is to get data in and out of the C++ app and use C# to handle the UI as I believe that's a more efficient way of working with WPF. I'm aware of P/Invoke but my understanding is that it only works with a C interface. Creating such an interface around the C++11 seems cumbersome. I'm also aware of C++/CLI but I'm not sure if that will meet my needs or if it is compatible with C++11. I took a look at CppSharp but it seems to be a work-in-progress and I doubt I'd know how to work around any issues that may arise. I have a lot of experience with C++ and a little with C# but I'm not sure if I'm missing better options or which of the above is a sound approach.


How to put lessons learned, good practices, etc into the "work flow"

As the title states it, I would like to get some suggestions about putting knowledge into action. We have many additional requirements that concern: coding practices feature development (all of them or only a subset), process, etc. The problem is that we have problems with introducing those practices into new projects and I want to help developers and reviewers to remember about it, but I don't want them to have everything just in theirs heads, but rather in some kind of a database that they can use easily. The list of practices is already defined in Excel. I would like all team members to apply these practices in their work but I don't know how make those information easy to find. When developer starts working on a feature he should be able to easily find all practices that he should use in these feature. To be clear with what I mean, I'm showing some examples of information we have to apply:   * (new design request) every feature must output logs (and it must not contain any sensitive data);   * (new design request) every feature has to have a flag in the configuration that allows to disable it;   * (good practice) always update docs when feature is ready;   * (retrospective feedback) QA must test only on release package (not in debug mode);   * (retrospective feedback) make stress tests for every new feature implemented;   * (lead's task) write release notes after each sprint that includes tasks completed and open bugs;   * (design usage) every event from "ABCStoreManager" must be disconnected after being invoked;   * (design usage) try-catch every event.Invoke() call; I thought for a while about a wiki, but it's no good, because it doesn't support tagging/categories or querying and I'm afraid that everybody would ignore it (people must know exactly where to look). My question can be summed up as how can I improve communication to our developers about the required development methodologies and practices listed above in an easy way? Remarks:   * this question is not about security issues or code smells per-se;   * I'm not looking for any heavy process (like RUP) or any process for that matter, which forces you to go step by step. Preferably I am looking for an agile approach   * Daniel Figueroa has suggested adding additional requirements to the "definition of done". And it seems like a good way. But the problem is that some features have, for instance, 20 additional requirements ("all GUI features"), some 10 ("all server requests"), etc. I would like to have this stuff aggregated in a one place and just use links ("see: 'GUI feature' ");


How to set up something like an integration server that measures the quality of code and reject the code if the score is below a certain number?

Even if I don't like enforcing people to do things (and I believe that it may decline the productivity and cause anger), I really want to enforce good coding style. Is there a way to set up something like an integration server that measures the quality of code (for example it runs `resharper` or some other static checker) and reject the code if the score is below a certain number? Also, do you think this is a good approach?


Choosing name for open-source project -- how to view existing trademarks/names used for other programs?

I'm trying to choose a good name for a new open-source project. The problem is, there is already so much software in the world that Google search reveals one or more existing programs with every good name I can think of (and there have been several already). Obviously, names like "Linux" or "Windows" or "Java" or "Excel" are off- limits. But what about names which may have been used by some little-known program? Does it make a difference if the name is trademarked in one or more countries? In one case, I found that there is a commercial software package marketed by a Canadian company, using a name which I wanted to use. The same name is trademarked in the US, but by a different company. I couldn't find any evidence that the holder of the trademark is actually marketing software under that name. In Canada, the name is not trademarked. In other cases, I found several programs all using the same name, some commercial, some university-student research projects. So maybe this is normal in the software industry? What if I use a name which is not trademarked, and someone else trademarks it later? Could I face legal pressure to stop using it? Would it help to avoid legal problems if I prefix the name? For example, say I want to call my project "Broomflip", but other software is already being marketed under that name. If, assuming I am associated with an organization called "Hoplock", I call it "Hoplock Broomflip", would that be better? I'm hoping someone with a good understanding of IP law can shed some light on some or all of the above questions. Of course, personal opinions from those without special legal knowledge are also welcome, but please try to back them up with evidence or relevant references. Anecdotal evidence is welcome.


Is it necessary to science of DSP for a c++ programmer?

I am a C++ programmer. I would like to use DSP algorithms in C++. Is understanding the science behind Digital Signal Processing a prerequisite to implementing DSP algorithms?


Creating a platform agnostic development team hegemony

I work at a company where we have a lot of different skillsets in the development team. We do all of the following (generally geared towards web):   * .NET (MVC, Umbraco, ASP.NET, Surface)   * Java (Spring, Hibernate, Android)    * PHP (Zend, Code igniter)    * Actionscript 3   * AIR   * Objective-C   * Html/Javascript (obviously) We're trying to streamline our development process. We currently have a TeamCity server that builds and deploys .NET projects with msbuild/msdeploy/nant. What I want is something like maven that will give us a standard project template structure that works for most projects to allow people from different teams to move between projects easily. Currently this works on one platform because we tend to do things in a standard way for that platform (as long as certain people have been involved) however I want to use something like maven to standardise how a project is laid out and built. Has anyone tried anything like this before? Experiences? Books?


How is the Decorator Pattern actually used in practice?

I understand completely how to implement the Decorator pattern, and I also understand what it's intent is. The Decorator is used in one of two cases: **As an alternative to subclassing** \- when there are multiple characteristics that an object can have, one could use inheritance in order to create subclasses for all the possible combinations. For example, three characteristics A, B and C will results in lots of classes: A, B, C, ABC, AB, AC, BC. This results in a 'class explosion'. With Decorator, one would have three decorators A, B and C, and a class D to 'decorate' - and that's it. **As a way to expand an object's functionality during runtime** \- we can decide which decorators to 'wrap' an object with during runtime, thus 'customizing' an object dynamically. This was just to show that I do understand what Decorator is (I also totally understand how it's implemented). **Now my question:** I'm familiar with theoretical examples of when and how to use Decorator. And as you can see I know what is it's intent. But I'm still not sure when to actually use this in practice, in an actual application. Telling me "it's used as an alternative to subclassing", or "it's used to dynamically add functionality to an object" won't be helpful since I'm familiar with it's intent. Also telling me "think of a UI window for example. It can have a border, or not, and can be resizable, or not" isn't helpful, I'm already familiar with these theoretical examples. **So what I'm asking for is a concrete _real world_ example of Decorator, in a practical, real-world scenario,** with a brief explanation of the benefits of using a Decorator pattern there over other techniques. * * * Just to clarify, I'm not looking for a list of applications where Decorator was utilized. I'm looking for an example of where and how Decorator was used in a design, why it was a good design choice **and the concrete problem that it solved.** When I'll see **concrete problem** solved with Decorator hopefully I'll understand it better.


How to initialize all your references?

I have recently taken a project with another developer, and he has a certain way of initializing his references.               class Player     {         private:             Console &console;             Armor &armor1, &armor2;             Debugger &debugger;             sf::RenderWindow &window;             sf::Event &event;             public:            Player(Console &console, Armor &armor1, ...) : console(console), armor1(armor1), ... {};     }      And it's perfectly fine with me, but what if we add new stuff? Our constructor is massive, and so messy, I would like to know if there are better ways of initializing your references if you have a large project, because if we keep up with this, eventually our constructor will have more lines of code than what it actually does.


What would one call this architecture?

I have developed a distributed test automation system which consists of two different entities. One entity is responsible for triggering tests runs and monitoring/displaying their progress. The other is responsible for carrying out tests on that host. Both of these entities retrieve data from a central DB. Now, my first thought is that this is clearly a server-client architecture. After all, you have exactly one organizing entity and many entities that communicate with said entity. However, while the supposed clients to communicate to the server via RPC, they are not actually requesting services or information, rather they are simply reporting back test progress, in fact, once the test run has been triggered they can complete their tasks without connection to the server. The request for a service is actually made by the supposed server which triggers the clients to carry out tests. So would this still be considered a server-client architecture or is this something different?


What are the difference between server-side and client-side programming?

> I've seen questions (mainly on Stack Overflow), which lack this basic > knowledge. The point of this question is to provide good information for > those seeking it, and those referencing to it. In the context of web programming, what are the differences between Server- side programming and Client-side programming? Which languages belong to which, and when do you use each of them?


What does programming a server exactly mean?

I searched around a lot, but couldn't find it. I know what server-side programming is and I've done it myself-- getting user's data, storing it in a database etc. using a server-side programming language. My question is: is this what we call "programming a server"? Or it's some other, more complicated task? Thanks. :) EDIT: This is NOT a duplicate of the other question. This question seeks a different answer than what is given in the question claimed to contain the answer. Okay, crystal-clear question: (it's getting kindda funny now :D ) Is there a difference between "server-side programming" (from my understanding: handling user input got via POST, GET, databases and all) and "programming a server"?


A simple definition of client-server

I'm looking for a simple definition of the concept of “client-server” I'd like something similar to this definition of **_state_**. > ... That "thing/information" that you need to remember is called "state". Edit - This isn't a homework question (nor am I a student). My goal is to come up with a compact way of explaining REST to average developers. I didn't want to prejudice the response though.


Are VB.NET to C# converters actually compilers?

Whenever I see programs or scripts that convert between high-level programming languages they are always labelled as converters. "VB.NET to C# converter" on Google results in expected, useful hits. However "VB.NET to C# compiler" on Google results in things like comparisons between the C# and VB.NET compilers and other hits that are not quite what you'd be looking for. Webopedia defines Compiler as > A program that translates source code into object code Eric Lipper in an answer to: "How do I create my own programming language and a compiler for it" suggests: > One of the best ways to get started writing a compiler is by writing a high- > level-language-to-high-level-language compiler. Is a VB.NET to C# _converter_ really just a _compiler_? If not, What separates the converter from also being a compiler?


Why should one want to disable compiler warnings?

This answer and the comments added to it show a way to disable several compiler warnings using `#pragma` directives. Why would one want to do that? Usually the warnings are there for a reason, and I've always felt that they're good reasons. Is there any "valid case" where warnings should be disabled? Right now I can't think of any, but maybe that's just me.


A better alternative to incompatible implementations for the same interface?

I am working on a piece of code which performs a set task in several parallel environments where the behaviour of the different components in the task are similar but quite different. This means that my implementations are quite different but they are all based on the relationships between the same interfaces, something like this:               IDataReader        -> ContinuousDataReader        -> ChunkedDataReader     IDataProcessor        -> ContinuousDataProcessor        -> ChunkedDataProcessor     IDataWriter        -> ContinuousDataWriter        -> ChunkedDataWriter      So that in either environment we have an IDataReader, IDataProcessor and IDataWriter and then we can use Dependency Injection to ensure that we have the correct one of each for the current environment, so if we are working with data in chunks we use the `ChunkedDataReader`, `ChunkedDataProcessor` and `ChunkedDataWriter` and if we have continuous data we have the continuous versions. However the behaviour of these classes is quite different internally and one could certainly not go from a `ContinuousDataReader` to the `ChunkedDataReader` even though they are both `IDataProcessors`. This feels to me as though it is incorrect ( possibly an LSP violation? ) and certainly not a theoretically correct way of working. It is almost as though the "real" interface here is the combination of all three classes. Unfortunately in the project I am working on with the deadlines we are working to, we're pretty much stuck with this design, but if we had a little more elbow room, what would be a better design approach in this kind of scenario?


Importance of data structures in modern S/W development

During 1990s when there were no advanced frameworks/paradigms available for S/W development , knowledge on data structures was critical... which I can comprehend. But nowadays, for most of the problems (at least from Java/Android development) we can rely on an existing class to provide solution. As such I believe, an in depth knowledge of data structures is not needed for someone who is stepping into programming now. Is my belief right ?.


How to refactor when all your development is on branches?

At my company, all of our development (bug fixes and new features) is done on separate branches. When it's complete, we send it off to QA who tests it on that branch, and when they give us the green light, we merge it into our main branch. This could take anywhere between a day and a year. If we try to squeeze any refactoring in on a branch, we don't know how long it will be "out" for, so it can cause many conflicts when it's merged back in. For example, let's say I want to rename a function because the feature I'm working on is making heavy use of this function, and I found that it's name doesn't really fit its purpose (again, this is just an example). So I go around and find every usage of this function, and rename them all to its new name, and everything works perfectly, so I send it off to QA. Meanwhile, new development is happening, and my renamed function doesn't exist on any of the branches that are being forked off main. When my issue gets merged back in, they're all going to break. Is there any way of dealing with this? It's not like management will ever approve a refactor-only issue so it has to be squeezed in with other work. It can't be developed directly on main because all changes have to go through QA and no one wants to be the jerk that broke main so that he could do a little bit of non-essential refactoring.


Is it realistic to use designers for complex UI

When I created my first web application few years ago, I remember trying to use the designer in VS 2008. Before I can even remember I abandoned it to the favor of actual debug to understand how my UI will actually look like. Since then, I gave it few more shoots but I was never convinced that it's even possible to build an complex UI with it. How much progress designers have made in the recent few years? Are there any designers that can enable real-time view of highly complex UI? is it programming language/framework dependent? Thanks.


I don't know how to understand the Wildcard type in Java

I am reading the Core Java (9th edition) by Cay S. Horstmann and Gary Cornell. After making an effort, I cannot still understand the **? super Manager**. Here are some materials relating to this question.               public class Pair<T> {         private T first;         private T second;              public Pair(T first, T second) {             this.first = first;             this.second = second;         }              public void setFirst(T first) {             this.first = first;         }              public void setSecond(T second) {             this.second = second;         }              public T getFrist() {             return this.first;         }              public T getSecond() {             return this.second;         }     }      The **Manager** inherits from **Employee** , and **Executive** inherites from **Manager**. _Pair_ has methods as follows:               void setFirst(? super Manager)     ? super Manager getFirst()      Since _? super Manager_ denotes any supertype of **Manager** , why I cannot call _setFirst_ method with **Employee** (it is obvious that Employee is the supertype of Manager), but only with type **Manager** or a subtype such as **Executive** (but Executive is the subtype of Manager, not a supertype of Manager)?


Why do people use markdown wysiwyg editors in web applications?

I understand the advantages of using markdown in local text files, and then taking those files and generating HTML. This is great for documentation, readme's in git repositories and posts for static site generators. It is very simple to create markdown syntax in any text editor, it's human readable, and you can create HTML from markdown relatively easily. What I don't understand, is the advantages of using a wysiwyg editor for markdown in web applications, especially those that use a database server. (non-flat-file). I thought the whole point of using markdown was to remove the need for a wysiwyg editor. What is the advantage of using a markdown wysiwyg editor over an editor that just outputs HTML (avoiding the overhead of converting markdown to HTML in the process)? **clarification:** basically I'm looking for technical advantages to having a WYSIWYG editor output markdown instead of HTML. To the end user the text form will look the same, so it's only dealing with markdown/html in the backend of an application. Anchor CMS sorta does this, and I'm wondering if there is an advantage over just plain HTML output.


What are the best practices and pitfalls of doing a JS app powered purely by RESTful API?

We are starting to build a new app and I would like to explore the idea of doing a thick JS client (backbone / angular) with only RESTful API exposed by our application layer. What are some of the best practices and potential pitfalls for doing this kind of web app?


Need to provide an interface (for plugins) for taking input Type A, and returning output Type B

public interface IMyInputProviderPlugin     {         IMyOutput Provide(IMyInput data);     }      This is an interface I need to provide so that I can dynamically load the dlls and not have them bound to my implementation. However, upon reading this, it seems like this is an anti-pattern? http://blog.ploeh.dk/2011/04/27/Providerisnotapattern/ I'm confused, how does one do this if not this way?


How to create a scoring system with time and correct answers for a game?

o create a scoring system with time and correct answers for a game? up vote 0 down vote favorite I have a small mobile quiz game, which consists of 30 questions, and a timer which starts from 0 seconds, and goes all the way up to 1 hour. Below you can see that my timer starts from 0, and it is displayed in the format of MM:SS.               var timestamp = new Date(0, 0, 0, 0, 0, 0);          function pad(n) { return ("0" + n).slice(-2); }          Number.prototype.pad = function (len) {         return (new Array(len+1).join("0") + this).slice(-len);     }      So, what I actually need is, some kind of formula, or system in order to receive a final score. So the more correct answers a user has, and the faster finishes the quiz, the more points gets. I know that this is kind of unrelated question for this forum, but I'm kind of stuck. I would like to hear your opinions, about the scoring system. So the smallest score should be 0, and the highest, well no limit.


Why Groovy(Java)?

I am looking on a new language to pick up and found out about Groovy. According to the website, the language is 'agile dynamic' language.   1. How is it Agile?    2. How shorter are the syntax compared to Java's?   3. Can I use existing Java libs out there?   4. Lastly, can anyone share their experience on this lingo? What you love and hate


Stopping spiders or unauthorised users from viewing files

I am stumped at this problem. Users authenticate at my client's website. Then the users see their profile page on my client's website. My client now wants me to provide a URL on their profile page, for his users, to download information from an external website. (This external website is not controlled by my client). That is to say, upon clicking this URL, it links out to an external website and gets a personalized file. As the information is considered sensitive (not critical), the external website should not allow anyone to download the personalized file. I'm stumped at figuring out how to allow only one authentication (on my client's website) instead of having the end users authenticating twice (once on my client's website and separately on the external website) Any ideas?


How to create a lightweight WPF application including .NET Framework 4.5?

I want to create an application which is dependent on .NET Framework 4.5. If I am binding the framework with application setup the size of application increases to much but I need to bind the .NET Framework 4.5 with my setup. Is there any other option to bind the framework with application setup besides downloading it from the website during installation?


Is there a practical use from learning Brainfuck?

Brainfuck is an esoteric programming language created in 1993 by Urban Müller. It was designed to challenge and amuse programmers, and was not made to be suitable for practical use. But still, it exists and some really cool stuff is written with it. My question is - will learning/practicing Brainfuck increase the depth of my knowledge of programming? For example: as a high-level programmer (using high- level languages) will it improve understanding of low-level methods and operations? Or is it really just a joke used to spend some time and amuse by showing code that really looks like "code" in a sense that's it's hard to read/understand.


Casual projects on Github omit error checking, logging, etc., for the sake of clarity?

I just started using GitHub to socialize some projects for simple chat and peer-to-peer apps. With respect to coding, is it customary to omit exception handling, error checking, logging, etc., to promote easy-to-understand and 'clean'-looking code, if those additions are not completely necessary to actually run the code? For instance, here's two extreme examples:                  if( msg != null){           NodeEvent event = NodeEvent.valueOf(msg.getAction());           switch (event) {              case NODE_CONNECTING:               if( nodeName.isInvalid())                  Utils.log("Invalid node name, ignoring...");               else{                  String existingNodeAddress = _nodeNameAddressMap.get(nodeName);                  if( existingNodeAddress != null)                     Utils.log("Node address for '" + nodeName + "' updated");                  else                     Utils.log("New node '" + nodeName + "' connected");                        _nodeNameAddressMap.put(nodeName, nodeAddress);               }         }      Here's the same snippet minus the fluff, although this version can easily crash if fed bad data, but otherwise it will compile and run fine:                  NodeEvent event = NodeEvent.valueOf(msg.getAction());        switch (event) {             case NODE_CONNECTING:             _nodeNameAddressMap.put(nodeName, nodeAddress);      The clean version is easier to read, obviously, but is brittle. The verbose version is safer, it just looks cluttered. I'm just curious to know if it's more effective for a social projects to go for the cleaner look at the expense of fragility, allowing those who fork the project to fill in the blanks. A quick survey of github projects and it's clear most go for the clean look.


Microeconomical simulation: coordination/planning between self-interested trading agents

In a typical perfect-information strategy game like Chess, an agent can calculate its best move by searching the state tree for the best possible move, while assuming that the opponent will also make the best possible move (i.e. Mini-max). I would like to use this approach in a "game" modeling economic activity, where the possible "moves" would be to buy or sell for a given price, and the goal, rather than a specific class of states (e.g. Checkmate), would be to maximize some function F of the agent's state (e.g. F(money, widget) = 10*money + widget). How to handle buy/sell actions that require coordination between both parties, at the very least agreement upon a price? The cheap way out would be to set the price beforehand, maybe based upon the current supply -- but the idea of this simulation is to examine how prices emerge when freely determined by "perfectly rational" agents. A great example of what I do _not_ want is the trading algorithm in SugarScape -- paraphrasing from _Growing Artificial Societies_ p101-102: > when a pair of agents interact to trade, they each compute their internal > valuations of the goods, then a bargaining process is conducted and a price > is agreed to. If this price makes both agents better off, they complete the > transaction The protocol itself is beautiful, but what it cannot capture (as far as I can tell) is the ability for an agent to pay more than it might otherwise for a good, because it knows that it can sell it for even more at a later date -- what appears to be called "strategic thinking" in this pape at Google Books Multi-Agent-Based Simulation III: 4th International Workshop, MABS 2003... to get realistic behavior like that, it seems one would either (1) have to build an outrageously-complex internal valuation system which could at best only cover situations that were planned for at compile-time, or otherwise (2) have some mechanism to search the state tree... which would require some way of planning future trades. Note: The chess analogy only works as far as the state-space search goes; the simulation isn't intended to be "zero sum", so a literal mini-max search wouldn't be appropriate -- and ideally, it should work with more than two agents.


How do I alter an open source library for my own use?

I'm programming in Objective-C. I want to include a camera library, DLCImagePicker, in my project. There is a variable I need to change, but it is private and I have no access to it. I've thought of a few way to get around this, but am not sure on the best practice way to do it.   1. I can just copy the code into my own class and alter the variable.   2. I can alter it directly in the original class. However, I have included this code as a git submodule and I'm thinking that touching the source code is a bad idea in this case, and in general.   3. Subclassing. I can't imagine how this would work, as the variable is private.   4. I can perform some action with git that would create my own fork/branch of the project, and alter it there. I have never done this and am very primitive with git.


Something like LinqPad for C/C++?

I love the LinqPad not just for the Linq, but also for the various types of simple compile options it provides like single expression, statements and programs for C# and VB. Anyone knows something similar to this for C/C++?


calling an abstract method in abstract class

Suppose i have an abstract base class Parent which defines an abstract Method A(some parameter) taking a parameter, also it defines an instance Method B which calls method A(parameter) inside its body and passing some parameter.Then we have an concrete child class B which extends the base class and provide its own implementation of Method A using the parameter passes. I have seen many implementation of this practice in frameworks. I want to know how it works and does it provide any benefits. Here is some code written in Android               public abstract class ParentActivity extends Activity {         public abstract void onResume(LoginToken token);              @Override             protected void onCreate(Bundle savedInstanceState) {                    super.onCreate(savedInstanceState);                    Some implementation code             }              @Override             public void onResume() {                   super.onResume();                   Some implementation code                   onResume(token);             }     }          public class ChildActivity extends ParentActivity{             LoginToken token;         @Override             protected void onCreate(Bundle savedInstanceState) {                    super.onCreate(savedInstanceState);                    Some implementation code             }              @Override             public void onResume() {                   Some implementation code                   super.onResume();             }              @Override             public void onResume(LoginToken token) {                  this.token=token;             }     }


When to import names into the global namespace? (using x::y, from x import y etc.)

I've been programming in various languages for about 10 years now. And I still haven't figured out when it is a good idea to import something into the global namespace (`using x::y` in C++, `from x import y` in Python etc.), so I hardly ever do it. It almost always seems like a bad idea to me, if only because it limits the set of variable names I can use. For example: Where I to use `using namespace std;` or `using std::string;`in C++, I couldn't use `string`as a variable name anymore, which I occasionally do (e.g. for string utility functions). But I'm wondering: Are there some situations where importing a name into the global namespace really makes sense? Any rules of thumb?


Is it bad to place "include directive" within main function?

It is always said that the `include directive`s should be placed at the beginning of a script. The main reason is to make the functions available throughout the script. Regardless of this fact, is it bad to place an `include directive` within the main function where it is needed? For example,               #include <stdio.h>     int main() {     #include <mysql.h>     }      Instead of               #include <mysql.h>     #include <stdio.h>     int main() {     }      I was unable to find any different in performance or compiled file size, but it is difficult to judge about this fact based on simple scripts. I wonder if it has any effect or drawback, or any reason to avoid this non-standard approach.


What is global mutable variable behaviour in dynamically-linked libraries?

When a dynamically linked library includes a global mutable variable, such as a container for state initialised when loading the library, how do references to that variable behave when running an application that links against it? Obviously the application cannot alter memory allocated to the dynamically- linked library by the OS, as that would have implications on the other applications using it, so one must assume references to the global mutable variables are rewritten to refer to some R/W memory space owned by the application. But exactly how do the compiler and linker collude to accomplish this?


What are the characteristics or features of production-quality code?

This is the first time I will be delivering code for a freelance project (web- app), and, since I don't have much experience shipping code, I am having a hard time deciding whether my program is ready for deployment or not. My understanding is that a production-level code must have the following characteristics:   * **Fault tolerance** : ability to survive uncaught exceptions    * **Data redundancy** : never lose user data   * **Scalability** : Handling extra load should not require re-writing the app   * **Test Coverage** : a "decent" amount of code tested Some of these characteristics are specific to the program itself, while others are more environment-related (whether using multiple clusters). However, even the environment-dependent characteristics do affect the way the program is designed. My question then is: What are the other characteristics that make production- code so different than code not meant for production? Just to reduce the scope of the question, please focus only on **web apps**. **Edit** : I will try to narrow down the scope by asking for characteristics specific to my situation. As a freelance, I was responsible of everything from purchasing a VPS, to configuring it, to writing the code, to deploying it. Although the project and its setup is well documented, the customer will not be able to maintain it. The app is not complex, but depends on a lot of external components, which makes it really prone to break if these components change/disappear. The goal is to set up a service that would be able to last as long as possible without the customer's maintenance.


If competition is using 'lingua obscura' for development (why) should I be worried?

I was reading Paul Graham's essay - Beating The Averages (2003) and here's what he had to say: > The more of an IT flavor the job descriptions had, the less dangerous the > company was. The safest kind were the ones that wanted Oracle experience. > You never had to worry about those. You were also safe if they said they > wanted C++ or Java developers. If they wanted Perl or Python programmers, > that would be a bit frightening-- that's starting to sound like a company > where the technical side, at least, is run by real hackers Now, this is a dated essay. However, I fail to see how using a non-commonplace language (C/C++/Java, C#) would be _'less dangerous'_. If the programmers of an organization are very fluent with the development language they should be equally adept at cranking out code at a decent pace. In fact if you do use a non-commonplace language won't maintenance/enhancement problems hit you in the face since not too many programmers would be available, in the long run? For making quick-n-dirty systems I agree, that some languages allow you to take off relatively sooner than others. But does Paul Graham's essay/comment make sense in 2012 and beyond? If a startup were to use _typical IT_ languages for development, why should it's competition be less worried? I fail to see how the language itself makes a difference. IMHO it's the developers experience with the language that matters and the availability of frameworks so that you DRY (do not repeat yourself) not just coding in a particular language. What is it that I'm missing? Does it imply that startups better choose non IT- flavored languages (even if the developers may be extremely adept at them)? What are the (programming) economic/market-forces behind this claim? PS: 'lingua obscura' is not meant to hurt anyone's feelings :)


Developing Razor Web Pages - Visual Studio and/or WebMatrix?

When I started learning about Web Pages I followed several of the Microsoft tutorials, all of which utilized WebMatrix. I did this until I realized that WebMatrix offered no debugging. Wait? What?? No way. And I quickly moved my Web Pages development to Visual Studio. While there were some things that I thought were nicely done in WebMatrix, I have found nothing that I cannot do in in Visual Studio. Also, unless someone who knows better than me enlightens me, I am vehemently against developing the same project with two different IDEs; It just seems like an unnecessary risk to me. Nevertheless, I would like to ask for your thoughts/insights about this. I am very curious to know if any of you use them in tandem and, if so, what aspects of each do you utilize the most? And, of course, does it cause problems?


Cloud computing platforms only have one CPU. Does this mean I shouldn't use Parallel Programming?

Almost every cloud instance I can find only offers one CPU. Why is this only one CPU now, and should I expect this to increase in the future? Does this design impact my code design so that I exclude technologies like Task Parallel Library? This is on topic to Programmers.SE because it impacts the long-term scalability of muti-threaded code on cloud platforms.


Questions for Architecture with Ruby and Java

I am in the research phase of a project that needs to make use of 3rd party libraries that are in Java so I am stuck using Java to at least a small degree. I am considering implementing Ruby as the front-end layer. That would leave me with the option of calling the Java classes as a web service by hitting a certain URL, is that correct? Is that generally a solid approach to things? Also, how would it affect my build environment when I create the .war file using Ant? should I have src/java and src/ruby code, or do the ruby files go somewhere else? Any tips and pitfalls on this? I am a little bit new to Ruby so advice would be appreciated. Also, I considered JRuby, but it seemed like a less mature tool that just has a JVM for a smoother calling of Java classes, correct? I am concerned with the maturity of that tool and its bein neither Java nor Ruby.


MVC4 : How to create model at run time?

In my project I am dynamically creating table by giving table name (ex. student) and adding fields to that table and then save table. Now, my table is created in SQL Server database. Assume table has data and I want to show the data of table (ex student) on WebGrid. But, the problem is I have no model for that table (ex. student). So, how I can create model for newly created table or how I can show the the data on WebGrid?


How do you educate your teammates without seeming condescending or superior?

I work with three other guys; I'll call them Adam, Brian, and Chris. Adam and Brian are bright guys. Give them a problem; they will figure out a way to solve it. When it comes to OOP, though, they know very little about it and aren't particularly interested in learning. Pure procedural code is their MO. Chris, on the other hand, is an OOP guy all the way -- and a cocky, condescending one at that. He is constantly criticizing the work Adam and Brian do and talking to me as if I must share his disdain for the two of them. When I say that Adam and Brian aren't interested in learning about OOP, I suspect Chris is the primary reason. This hasn't bothered me too much for the most part, but there have been times when, looking at some code Adam or Brian wrote, it has pained me to think about how a problem could have been solved so simply using inheritance or some other OOP concept instead of the unmaintainable mess of 1,000 lines of code that ended up being written instead. And now that the company is starting a rather ambitious new project, with Adam assigned to the task of getting the core functionality in place, I fear the result. Really, I just want to help these guys out. But I know that if I come across as just another holier-than-thou developer like Chris, it's going to be massively counterproductive. I've considered:   1. Team code reviews -- everybody reviews _everybody's_ code. This way no one person is really in a position to look down on anyone else; besides, I know I could learn plenty from the other members on the team as well. But this would be time-consuming, and with such a small team, I have trouble picturing it gaining much traction as a team practice.   2. Periodic e-mails to the team -- this would entail me sending out an e-mail every now and then discussing some concept that, based on my observation, at least one team member would benefit from learning about. The downside to this approach is I do think it could easily make me come across as a self-appointed expert.   3. Keeping a blog -- I already do this, actually; but so far my blog has been more about esoteric little programming tidbits than straightforward practical advice. And anyway, I suspect it would get old pretty fast if I were constantly telling my coworkers, "Hey guys, remember to check out my new blog post!" This question doesn't need to be specifically about OOP or any particular programming paradigm or technology. I just want to know: **how have you found success in teaching new concepts to your coworkers without seeming like a condescending know-it-all?** It's pretty clear to me there isn't going to be a sure-fire answer, but any helpful advice (including methods that have worked as well as those that have proved ineffective or even backfired) would be greatly appreciated. * * * **UPDATE** : I am **not** the Team Lead on this team. Chris is. * * * **UPDATE 2** : Made community wiki to accord with the general sentiment of the community (fancy that).


Is allocating objects from a memory-pool a security anti-pattern?

In the wake of the heartbleed bug, OpenSSL has been rightly critizised for using its own freelist. With plain-old `malloc`, the bug would have almost certainly been found long ago. However, some kind of malloc wrapping is actually very common. For example when I have a big object that owns many small, fixed sized objects, I often allocate them from an array.               /* BigObj is allocated with `malloc`, but LittleObj using `alloc_little`. */     typedef struct {              /* bigObj stuff here */              int nlittle;         LittleObj littles[MAX_LITTLE];     } BigObj;           LittleObj *alloc_little(BigObj *big)     {         if(big->nlittle == MAX_LITTLE)             return NULL;         return = big->littles + big->nlittle++;     }      `alloc_little` is faster than `malloc()`, but the main reason is simplicity. There is no `free_little` to call, because the `LittleObjs` just remain valid until the `BigObj` is destroyed. So is this an anti-pattern? If so, can I mitigate the risks, or should I just abandon it? Similar questions go for any kind of memory pool, such as GNU Obstacks and the `talloc` used in Samba.


Can I use EPL licensed libraries and not Give out the Source code of my Application?

If I use EPL licensed software ( namely Eclipse jars ) in an application, do I have to give the users the source code and the right to redistribute? If that is not the case, what rules should I follow if I use EPL licensed software libraries in an application that I wish to distribute?


Why should ViewModel route actions to Controller when using the MVCVM pattern?

When reading examples across the Internet (including the MSDN reference) I have found that code examples are all doing the following type of thing:               public class FooViewModel : BaseViewModel {         public FooViewModel(FooController controller) {             Controller = controller;         }         protected FooController Controller { get; private set; }              public void PerformSuperAction() {             // This just routes action to controller...             Controller.SuperAction();         }              ...     }      and then for the view:               public class FooView : BaseView {         ...              private void OnSuperButtonClicked() {             ViewModel.PerformSuperAction();         }     }      Why do we not just do the following?               public class FooView : BaseView {         ...              private void OnSuperButtonClicked() {             ViewModel.Controller.SuperAction();                  // or, even just use a shortcut property:             Controller.SuperAction();         }     }


Can Agile and ISO 9001 interact well?

There are few academic papers addressing the relationship between lean software development and the practices covered by ISO 9001. Most articles says that _the divergence between these approaches is big_ , but some also point that _these concepts can be complementary and gains are much higher when using both approaches_. Academically it is very beautiful, but in practice is it anyway? So here's the question: do you work or worked at companies applying both Agile as ISO 9001? What is your perception? What is really good and what is inappropriate?


Object Initializer in C# problem with readability

I wonder if object initializing have some performance gain in ASP.NET website. I have an office mate that told me that object initialization is much readable and faster than constructor. But one of my office mate disagree with that and said that it always depends. For example I am doing this:               using (var dataAccess = new DatabaseAccess { ConnectionString = ConfigurationManager.ConnectionStrings["test"].ConnectionString, Query = query, IsStoredProc = true })     {         //some code here     }      Is it better if I will do this way?               using (var dataAccess = new DatabaseAccess())     {         dataAccess.ConnectionString = ConfigurationManager.ConnectionStrings["test"].ConnectionString;         dataAccess.Query = query;         dataAccess.IsStoredProc = true;     }      Thanks in advance guys! \--- **EDIT** \---- is this somehow much better:               using (         var dataAccess = new DatabaseAccess          {             ConnectionString = ConfigurationManager.ConnectionStrings["test"].ConnectionString,             Query = query,             IsStoredProc = true         }     )     {         //some code here     }


Similar references to themselves in two classes

How can I make 1 class (base, generic or something else) from these two classes?               class A     {       A Link { get; set; }     }          class B     {       B Link { get; set; }     }      **UPD:** This is what I have now:               class BSTree     {       public BSTNode Root { get; set; }     }          class AVLTree     {       public AVLNode Root { get; set; }     }          class BSTNode     {       public BSTNode Parent { get; set; }       public BSTNode Left { get; set; }       public BSTNode Right{ get; set; }       public int Key{ get; set; }     }          class AVLNode     {       public AVLNode Parent { get; set; }       public AVLNode Left { get; set; }       public AVLNode Right{ get; set; }       public int Key{ get; set; }       public int Height { get; set;}     }      And finally I want to get something like BaseNode and BaseTree.


What's a good notation for showing MVC interactions?

I'm developing various websites and functionality to cater to various different use-cases up in Django. Is there a good notation for showing what behaviour is at each stage, e.g., swimlanes. I use BPMN 2 notation for everything, but feel that I am overusing this, and probably abusing the notation :P Example: ![BPMN 2.0 diagram](http://i.stack.imgur.com/PMCzW.png) Please recommend a suitable **notation for showing the interactions between model, view and controller, as well as some of the inner business-logic in each stage**.


How to deal with potential enterpreneur developer in a IT startup

In a software startup, how can we deal with the main developers/programmers of the company who are good at design and communication, and also have entrepreneurial skills? How do we get them work for us and avoid any kind of competition from them to our business? How can we convince the lead programmer that our startup is the place for him?


Mahout's Flexibility for generating recommendations

I am currently working on a system that will generate product recommendations like those on Amazon: _"People who bought this also bought this.."_ **This is how I plan to do it** :   * Process the data using Apache Mahout and generate recommendations(data is stored in MySQL), currently item based only.   * Apply a clustering algorithm to make cluster of users and then apply the association rules subjective to each cluster. **My questions are:**   * Will Mahout provide me enough flexibility to tweak the existing algorithms according to my needs. If yes, how?    * Is there a better alternative like R?


Why is better to use external  JavaScript or libraries ; and is it prefered to use jquery meaning more security?

I read this article Unobtrusive JavaScript with jQuery and I noticed these points in the slide page **11**   * some companies strip JavaScript at the firewall   * some run the NoScript Firefox extension to protect themselves from common XSS and CSRF attacks   * many mobile devices ignore JavaScript entirely   * screen readers **do** execute JavaScript but accessibility issues mean you may not want them to I did not understand the fourth point. What does it mean? I need your comment and responses on these points. Is not using JavaScript and switching to libraries like jQuery worth it? **UPDATE 1 :** whats the meaning of **Unobtrusive JavaScript with jQuery** ? and yes it does not say we should use libraries but we should have them on external files for that reason i asked my question.


How easy is it to change languages/frameworks professionally?

Forgive me for asking a career related question - I know that they can be frowned upon here, but I think that this one is general enough to be useful to many people. My question is: How easy/difficult is it to get a job using language/frameowork B, when your current job uses language/framework A? e.g. If you use C#/ASP.NET in your current job, how difficult would it be to get a job using python/django, or PHP/Zend, or whatever (the specifics of the example don't matter). Relatedly, if you work in client side scripting, but perhaps work on server- side projects in your own time, how difficult would it be to switch to server- side professionally? So, to sum up, does the choice of which languages/frameworks use at work tend to box you in professionally?


Is Project Titan (Facebook email app) going to be a game changer from a programmers perspective? Although some details are still scarce, the internet is slowly learning more about this new software. From the perspective of a programmer, what if any functionality do you think this will bring to the mass communications sector of internet use? Will it in anyway be a "game changer" from the existing layer of highly successful web based email clients (such as hotmail, gmail, yahoo mail, etc) I'm interested if anyone thinks email fundamentally needs to change other than to add more "connectedness" to other sources of data such as social media profiles.


Why not Green Threads?

Whilst I know questions on this have been covered already (e.g. http://stackoverflow.com/questions/5713142/green-threads-vs-non-green- threads), I don't feel like I've got a satisfactory answer. The question is: _why don't JVM's support green threads anymore?_ It says this on the code-style Java FAQ: > A green thread refers to a mode of operation for the Java Virtual Machine > (JVM) in which all code is executed in a single operating system thread. And this over on java.sun.com: > The downside is that using green threads means system threads on Linux are > not taken advantage of and so the Java virtual machine is not scalable when > additional CPUs are added. It seems to me that the JVM could have a pool of system processes equal to the number of cores, and then run green threads on top of that. This could offer some big advantages when you have a very large number of threads which block often (mostly because current JVM's cap the number of threads). Thoughts?


Why would a video game need  main(String[] args) in its own class?

My teacher just told me that whenever I create a class to run something for a video game company that uses Eclipse, I should make a run class with the main and any outputs. He says any arithmetic should then be put in its own class. Here's the example he gave us.               //triangle          import java.util.Scanner;     import java.lang.Math.*;     import java.lang.String;     public class Lab03a  //this class is used to test Triangle     {     public static void main( String[] args )     {         Scanner keyboard = new Scanner(System.in);              //ask for user input         System.out.print("Enter side A ::  ");         int a = keyboard.nextInt();              System.out.print("Enter side B ::  ");         int b = keyboard.nextInt();              System.out.print("Enter side C ::  ");         int c = keyboard.nextInt();                   Triangle test = new Triangle(a, b, c);         test.calcPerimeter();         test.calcArea();         test.toString();         System.out.println("Area "+test.toString());              //ask for user input         System.out.print("Enter side A ::  ");         a = keyboard.nextInt();              System.out.print("Enter side B ::  ");         b = keyboard.nextInt();              System.out.print("Enter side C ::  ");         c = keyboard.nextInt();                   test.setSides(a,b,c);         test.calcPerimeter();         test.calcArea();         test.toString();         System.out.printf("%.3f\n",(test.toString()));              //add one more input section                         }     }      The other class:               import java.util.Scanner;     import java.lang.Math.*;          public class Triangle     {     private int sideA, sideB, sideC;     private double perimeter;     private double theArea;     private double s;     public Triangle()     {        setSides(0,0,0);        perimeter=0;        theArea=0;        s=0;     }          public Triangle(int a, int b, int c)     {         sideA=a;         sideB=b;         sideC=c;     }               public void setSides(int a, int b, int c)     {         sideA=a;         sideB=b;         sideC=c;          }          public void calcPerimeter( )     {         perimeter=sideA+sideB+sideC;          }          public void calcArea()     {         s=perimeter/2;         theArea=(Math.sqrt(s*(s-sideA)*(s-sideB)*(s-sideC)));     }          public String toString()     {         String output = ""+theArea+"\n\n";         return output;     }      } Is this universally true for gaming companys? True for some? Or would most accept this?


What, if anything, to do about bow-shaped burndowns?

I've started to notice a recurring pattern to our team's burndown charts, which I call a "bowstring" pattern. The ideal line is the "string" and the actual line starts out relatively flat, then curves down to meet the target like a bow. My theory on why they look like this is that toward the beginning of the story, we are doing a lot of debugging or exploratory work that is difficult to estimate remaining work for. Sometimes it even goes up a little as we discover a task is more difficult once we get into it. Then we get into implementation and test which is more predictable, hence the curving down graph. Note I'm not talking about a big scale like BDUF, just the natural short-term constraint that you have to find the bug before you can fix it, coupled with the fact that stories are most likely to start toward the beginning of a two-week iteration. Is this a common occurrence among scrum teams? Do people see it as a problem? If so, what is the root cause and some techniques to deal with it?


How loyal should I be to my present employer?

I come from a "3rd world country", moved a year ago to a "first world country", got a job doing customer support (networking/ management company) and web dev for my current employer. I started to cover for the main support engineer that was going for holidays; then my boss wanted an iPhone + iPad + server app for managing the employees (app on testing ground now); and gave the project to me. As I started in a new country, I got offered a very low salary, and was told it would be reviewed in a couple months, then it became "when the app is ready", and now that the app is ready, is at the end of this year (I started August last year). I was ok with the low salary as I was mostly learning (Objective-C) I come from microcontroller C and Linux background. Now my boss is in Europe for holidays and left everything (and everyone) for some weeks... I got now the need to make an average salary for a developer (mid level), and have been looking for jobs now that my boss is away. If I get a job before he comes back, I feel a bit guilty that he gave me a chance to learn and I pay him by leaving (and leave him with some web portals, and iOS apps)... But I really need to make more money for my family too, so I have clear I need to improve my conditions, but still feel thankful with the guy. But more important is my family! So how to proceed?


Redmine - Database Structure/Normalization

I am using redmine for project management and issue tracking. I was looking at the database tables and the underlying structure and was wondering if anyone who is experienced with database architecture can comment on the structure. I am concerned that once there are many users and hundreds (or thousands) of projects (each project containing many issues, with each issue containing many messages, etc.), the database structure could possibly turn out to be a weak point. How is the performance impacted by this design? I would like to hear about the Pros/cons of how the tables are laid out and how the data is separated or normalized, and whether or not it might be worth re-structuring. What would be the benefits of separating the data out to more tables (with less columns per table)


Types of unit tests based on usefulness

From value point of view I see two groups of unit tests in my practice:   1. Tests that test some non-trivial logic. Writing them (either before implementation or after) reveals some problems/potential bugs and helps to be confident in case logic is changed in the future.   2. Tests that test some very trivial logic. Those tests more like document code (typically with mocks) than test it. The maintenance workflow of those tests is not "some logic changed, test became red - thanks God I wrote this test" but "some trivial code changed, test became false negative - I have to maintain (rewrite) the test without gaining any profit". Most of the time those tests are not worth maintaining (except religious reasons). And according to my experience in many systems those tests are like 80% of all tests. I am trying to find out what other guys think on the topic of unit tests separation by value and how it corresponds to my separation. But what I mostly see is either fulltime TDD propaganda or tests-are-useless-just-write-the-code propaganda. I'm interested in something in the middle. Your own thoughts or references to articles/papers/books are welcome.


Simple search from an image list to bring up a specific logo

The current way i have my form is a user selects a drop down menu of a particular folder and it displays the current logos in that folder in a row below. These images are grabbed on page load all at once. The problem is, as of right now, i have around 700 logos totaling around 10mb, and every time the user reaches the form, it has to load all 700 images before the page loads, unless the images are already in the browser's cache. My problem isn't so much now, but later if I end up having 1500 logos, or more. I thought about 2 different ways to isolate this issue.   1. To have the drop down selected folder load the images AFTER selected. I asked how to get this accomplished in stack overflow with no success.   2. My second idea now is to create a simple search engine bar that will just show the logo they are searching for it on the fly instead of loading the images.  I know this is possible, i've seen it on a number of image search sites. my question is, does this type of search engine script already exist? if so .. could you point me in the right direction.


How is MTU determined and can it be changed

I'm developing a multi-part solution that consists of an iOS application and OS X application which communicate over Bluetooth Low Energy. Everything works fine and I can send moderate amounts of text between the iPhone and my MacBook. I would like to be able to send larger amounts of data, such as an image, from the iPhone to the MacBook. I'm able to do this but it takes about 50 minutes for the transfer of 1 image, compressed as a JPEG with a 0.2 quality (on a scale of 0-1). Part of the problem is that in the iOS application when the central connects, it reports an maximum packet length of 20 bytes (plus 3 bytes for header). In iOS 7, the changed the MTU so it's not a hardcoded 23 bytes. I cannot find anywhere that would allow me to specify a higher MTU on my MacBook or in the IOBluetooth framework. I found a constant value in one of the bluetooth header files in the framework that specifies the MTU as 23 (20 + 3 for header), which leads me to believe this is just something hard coded into the framework that should be able to be changed somehow. An alternative would be to use BLE to negotiate some other form of transfer between the systems. Ultimately, the transfer shouldn't be required to go over the Internet (the way Bump does it) but if a direct WIFI or Bluetooth connection could be used without requiring any user configuration, that would work.


Initializing a variable as undefined

Doing some refactoring, I noticed an unusual pattern I'm not familiar with. Properties and variables that do not yet have a value are initiated with `undefined` declared explicitly, despite the fact that value-less variables and object properties would evaluate to `undefined` anyways:               var foo = undefined;     this.prop = undefined;      **Is there a reason to do this?**


What kind of problems is an Android beginner likely to encounter in using Scala?

I am a hobbyist programmer who makes and maintains one production system, largely coded in Python, which now has to be ported to Android. I don't know Java at all. However, SL4A in Android makes Python a bit of a second class citizen re APIs, such as Google Cloud Messaging etc. However, for me, Java appears intimidating with its verbose syntax and strict typing. Scala's syntax is more appealing and seems like a possible compromise. From this question and this one on Stack Overflow it seems that Scala development on Android is feasible. However, as a 'beginner', I would like to know what problems I might encounter by using Scala instead of Java. The available information that I can find on the 'Net (including the question from this site cited above) is from early 2012, at the latest, and I imagine the situation has changed since then.


Should I use my own public API on my site (via JS)?

First of all, this question is far more different other 'public api questions' like this: Should a website use its own public API?, second, sorry for my English. **You can find the question summarized at the bottom of this question.** What I want to achieve is a big website with a public api, so who like programming (like me) and likes my website, can replicate my website's data with a much better approach (of course with some restrictions). Almost everything could be used by the public API. Because of this, I was thinking about making the whole website AJAX driven. There would be parts of the API which would be limited only to my website (domain), like login, registering. There would be only an INTERFACE on the client side, which would use the public and private API to make this interface working. The website would be ONLY CLIENT SIDE, well, I mean, the website would only use AJAX to use the api. * * * How do I imagine this? The website would be like a mobile application, the application only sending a request to a webserver, which returns a json, the application parses it, and uses it to advance in the application. (e.g.: login) My thoughts: **Pros** :   * The whole website is built up by javascript, this means I don't need to transfer the html to the client, saving bandwidth. (I hope so)   * Anyone can use up the data of my website to make their own cool things. (Is this a con or pro? O_O)   * The public API is always in use, so I can see if there are any error. **Cons** :   * Without Javascript the website is unusable.   * The bad guys easily can load the server with requesting too much data (like Request Per Second > 10000), but this can be countered via limiting this with some PHP code and logging.   * Probably much more work So the question in some words is: Should I build my website around my own api? Is it good to work only on the client side? Is this good for a big website? (e.x.: facebook, yeah facebook is a different story, but could it run with an 'architecture' like this?)


Best practice to collect information from child objects

I'm regularly facing following pattern:               public abstract class BaseItem     {         BaseItem[] children;              // ...              public void DoSomethingWithStuff()         {             StuffCollection collection = new StuffCollection();             foreach(child c : children) c.AddRequiredStuff(collection);             // do something with the collection ...         }              public abstract void AddRequiredStuff(StuffCollection collection);     }          public class ConcreteItem : BaseItem     {         // ...              public override void AddRequiredStuff(StuffCollection collection)         {             Stuff stuff;             // ...             collection.Add(stuff);         }     }      Where I would prefer something like this, for better information hiding:               public abstract class BaseItem     {         BaseItem[] children;              // ...              public void DoSomethingWithStuff()         {             StuffCollection collection = new StuffCollection();             foreach(child c : children) collection.AddRange(c.RequiredStuff());             // do something with the collection ...         }              public abstract StuffCollection RequiredStuff();     }          public class ConcreteItem : BaseItem     {         // ...              public override StuffCollection RequiredStuff()         {             StuffCollection stuffCollection;                  Stuff stuff;             // ...             stuffCollection.Add(stuff);                  return stuffCollection;         }     }      What are pros and cons of each solution? For me, giving the implementation access to parent's information is some how disconcerting. On the other hand, initializing a new list, just to collect the items is a useless overhead ... What is the better design? How would it change, if `DoSomethingWithStuff` wouldn't be part of `BaseItem` but a third class? PS: there might be missing semicolons, or typos; sorry for that! The above code is not meant to be executed, but just for illustration.


I feel unprepared to start my first job out of college... how can I improve?

I just graduated from university with a degree in Computer Science/Engineering and was fortunate enough to land a job working in the pharmaceutical industry as a developer. My title is System Developer I, which will require the following skills: 0-3 years development experience with C# .NET and SQL Server Experience writing T-SQL and stored procedures XML Javascript I learned of the company at a job fair and was not aware that I would need those skills for the job until after they wanted to set up an interview with me. The interview consisted of talking about my background, an almost-too- simple logic test, and a couple SQL questions that anyone with any experience should be able to answer. I was honest with them and indicated that I had absolutely no experience with SQL Server, .NET, XML, or Javascript, but they offered me the position anyway. Of course, I accepted it, but I am now extremely worried that my skills will not be up to snuff. I fully realize from reading lots of Coding Horror, Stack Overflow, and The Daily WTF that a degree in Comp Sci in no way prepares me to be a software developer; I further realize that I will be a monumental noob in the presence of people who have been doing this for years. I feel like the only thing that makes up for my lack of development experience and programming knowledge are my social skills, innate writing ability, and humility (at least compared with some of my co-graduates who fancied themselves to be the next Steve Jobs... _barf_ ) You will never find me being the prima donna constantly complaining about the system, the language, etc... I just want to do my job like I'm told, work 9 - 5, and go home with my paycheck feeling like I'm competent. If that requires home-study, I'm more than willing because I do love programming and computer science. So far, I've familiarized myself a bit on using SQL Server Management Studio, gave myself a refresher on basic SQL, and started learning more about C# and .NET using Introducing Visual C# 2010 by Adam Freeman from Apress. Can anyone recommend anything else I can do in the meantime to: A. Chill the _*_ * out and enjoy my new job without worrying so much about getting canned for incompetence B. Improve my understanding of design patterns and OOP C. Get the low-down on writing T-SQL in the most efficient way possible Thanks everyone.


I might be starting to do Arduino development and I would like some advice

So, today I looked at Arduino; seems very interesting. I still don't want to shell out the money just yet, as I have some questions, namely:   1. Should I learn something about electronics? What and with what resources?   2. What stuff should I buy? I have a limited, but not _that_ small budget (probably up to 200€, but preferably _less_ ). I'm interested in getting a screen (mustn't be complex, but I would prefer one like that), some speaker, some way for it to move and a way to remotely control it. I would also want a battery. I also wan't to be able to use my board for many things in the future, so it shouldn't be too basic, I guess. I think I will go with the MEGA, is that smart?   3. What resources do you recommend? Any books? Good tutorials besides what you find on their site?   4. What are really cool extensions (e.g. screens) which I would be adviced to get/try? Help greatly appreciated. Also, I have _never_ developed for any embedded device, but I know C and computer architecture to some degree; I'm somewhat familiar with low level stuff.


Scrum overestimation and replanning

We are in the middle of our first Sprint and something dawn on us: we over estimated! We had planned 114 ideal hours for this 2 weeks iteration and at the end of the first week we finished the whole Sprint. What do we do now? The "book" says we should, and we will, get the next high priority items from the backlog. Though, how do we add them to the burn down chart? Do we re-write it to account for those stories as if they were there from the begining? Or simply add their estimates to the y axis in the day we start working on them (showing a 90o angle jump)? Any feedback is welcome!


How do you name sprints in your projects?

Some Scrum software management tools give you this option to explicitly name your sprints. Do you have a preferred way of naming your sprints or do you just use a simple scheme like 1, 2, 3, ...?


Permissions and MVC

I’m in the progress of developing a web application. This web application is mostly a CRUD interface, although some users are only allowed to perform some actions and see only some parts of views. What would be a reasonable way to handle user permissions, given that some parts of views are not available to users? I was thinking of having a function `hasPermission(permission)` that returns `true` iff the current user has the given permission, although it would require conditionals around all parts of views that are only visible to some users. For example:               {% if has_permission('view_location') %}         {{ product.location }}     {% endif %}      I’m fearing this will become an ugly and unreadable mess, especially since these permissions can get kind of complicated. How is this problem commonly solved in web applications? I’m considering using Haskell with Happstack or Python with Django.


The balance between client and server functionality

I want to bring the discussion that started in our teams and get your opinion about it. Assume we have an user account which could have different credentials for authentication and associated email to recover. An user has possibility to do signup with an email or use his social profile to complete signup process. As an Rest API from the backend to client looks like:   1. Create account   2. Authorise   3. Update user data   4. Link social account   5. Register email   6. Verify email In addition our BE is distributed and divided between several services/servers/clusters. So different calls are related to different end points. As well we have different client - mobile native applications, web application. The usual registration flow looks for the client like this:   1. Ask user for email   2. Create account (Rest)   3. Authorise (Rest)   4. Ask user for his display name   5. Update data (Rest)   6. Register email (Rest) And future possible calls:   1. Verify email   2. Link social account to user With the Facebook signup:   1. Ask user to login to FB   2. Create account (Rest)   3. Authorise (Rest)   4. Link FB (Rest)   5. Register and verify FB user email (Rest)   6. Update user name based on FB data (Rest) But all these steps are possible to do on backend. So we proposed to have another end point which will hide/combine different calls on BE and return whole process result to the clients:   1. Ask user for FB login   2. New user with FB (proposed Rest)   3. BE is doing register/link verified email/update user data/authorise The pros for this approach:   1. No more duplication of functionality between clients   2. Speed up the networking and user experience The cons for this approach:   1. Additional work for backend   2. Probably most complex scenarios in future updates I would like to get your opinion or experience with this situation. Especially if you already experienced point "Probably most complex scenarios in future updates" from against reasons.