title: Draw a checkerboard in Java

text: I'm reading through a programming book and am having trouble understanding a few parts of this code. The program draws a checkerboard, and colors the odd squares black.               import acm.graphics.*;     import acm.program.*;          public class CheckerBoard extends GraphicsProgram   {          public void run()   {         double squareSize = (double) getHeight() / numRows;         for(int i = 0; i <= numRows; i++){             for(int j = 0; j <= numColumns; j++)    {                 double x = j * squareSize;                 double y = i * squareSize;                 GRect square = new GRect(x,y,squareSize,squareSize);                 square.setFilled((i + j) % 2 != 0);                 add(square);             }         }     }          private static final int numRows = 8;     private static final int numColumns = 8;      I understand most of the code, but I am still a little confused. My first question is: How exactly does the program go through the for loops? They are nested, so would it create all of the columns (the j for loop) first? Or does it increment both i and j after the block of code finishes? Secondly, why do I set x = j, and y = i? x is horizontal and j is vertical, shouldn't I set x = i and y = j? Both seem to yield the same results. Mostly, I would just like to know how the for loop runs each time around. a basic run or two through the program. Any help would be appreciated, thanks!


title: Is application written from scratch in programming language has to be license?

text: There are so many programming language like PHP, Perl, Python, Java, C, C++ and many other. These programming language has some open source license. If i develop application from scratch which is not related the source modification of these languages. Is my application has to be open source license?? There are billions of applications written in these language? All application has be open source? I don't understand that, is there language issue ever existed? I think there should not programming language licensing issue just like spoken language..either i speak in english, french or any other. I can write a book in any language without my book to be open source, is that right???


title: How do I implement the OpsDB from Release It! by Michael T Nygard

text: I have recently been reading the Release It! book by Michael T Nygard.In the book he talks about Implementing an OpsDB to manage and record performance statistics of applications. Has anyone implemented any of the concepts in OpsDB? I've been trying to find some examples but am struggling and I really would like to implement something like this. This page gives a little background to the the details http://screamingtiger.blogspot.co.uk/2010/05/release-it-176-standards-de-jure- and-de.html at the Operations database section Looking at the above I am not really sure what a Feature would be - would a client application count. Also, what would be some of the common things to capture for a web application. Any help would be most appreciated


title: How to minimize merge conflicts when using non-lock VCS like git?

text: I have been using git for about four months now. While I like most of its features, I find it rather inconvenient that multiple developers can make concurrent changes to the same file and then a need for merging ensues. In fact, I would prefer waiting for a file to get unlocked over tedious and brain hurting merges. I was wondering if there was a team etiquette or workflow to circumvent this terrible predicament. In my ideal world of development, there would never be a need to merge. E.g. is there a combination of hooks, commands, and workflows for git in order to have a remote repository notified when a local repository changes a file so that other developers get a git notification if they themselves try to modify the same file concurrently (e.g. when they run `git status` or something like that)?


title: Using a texture as an integer array (OpenGL 3.3, shader version 3.3)

text: I'm trying to have something like an integer array uniform for my fragment shader (I only need read access). Since it's a fairly large chunk of data (not so large that uploading it in every frame would be impossible, but enough to make me want to rather not do it). Essentially I want to just pass it a uniform telling the shader where this "array" is. I believe I can use a 1D texture for this, but I don't know how (actually, I don't know how to do many things because I just can't seem to find a reference for GLSL 3.3, I only ever find references for the C API). This sounds like a rather basic question and I'm sure it's been answered already somewhere, but I keep searching and can't quite find what I'm looking for.


title: Has anyone used RemObjects' Hydra to mix a large Delphi project with new C# additions?

text: _(Hopefully this is deemed suitable for Programmers, not StackOverflow - I could imagine it getting closed at SO because there's no obvious 'right' answer.)_ We have a large Delphi 2007 VCL project that uses things like DBXpress, Report Builder, DevExpress and TMS components (both visual and non-visual) etc. For reasons I won't bore you with, the company would like to start adding new modules to the program using .Net (via C# in particular). Rewriting from scratch isn't an option and given the heavy use of Report Builder and various other bits of Delphi-specific 3rd party code, I suspect that using something like TurnSharp to regenerate a C# project wouldn't work well either. **Ideally we want to keep our Win32 VCL Delphi code but add new modules (plug- ins, sections of contained functionality like wizards etc) via C#.** So we're considering RemObjects' Hydra, and in the next few weeks will probably have a go at evaluating it on a smaller-but-representative project first. I wondered if anyone had experience of doing this kind of thing with Hydra...?


title: Is imperative style programming (say with Java/C) more error prone than something more declarative

text: I know programmers tend to get defensive with their paradigms and tools that they use. But in your experience, with the most generic, typical pieces of code that you see with Java or C++ or C, is the code more error prone than a similar piece of code in an declarative or functional programming language. For example, with Java there can be a lot of boilerplate and setup code need to call your target routine. Usually developers may need to look at the implementation details to really understand what happens if they do or do not provide the correct dependencies. Normally the developer never does that so you end up with NullPointerException bugs and other logic errors.


title: Porting Software

text: I would like to know what would be needed to study and understand in terms of computing platforms and OS (Linux, Mac OS X and Windows) to become a software porting engineer.


title: How to test and optimize when you can't reproduce the environment?

text: In the past, I've worked in a variety of environments. Desktop apps, games, embedded stuff, web services, command line jobs, web sites, database reporting, and so on. All of these environments shared the same trait: no matter their complexity, no matter their size, I could always have a subset or slice of the application on my machine or in a dev environment to test. Today I do not. Today I find myself in an environment whose primary focus is on scalability. Reproducing the environment is prohibitively costly. Taking a slice of the environment, while plausible (some of the pieces would need to be simulated, or used in a single-instance mode that they're not made to do), kinda defeats the purpose since it obscures the concurrency and loading that the real system encounters. Even a small "test" system has its flaws. Things will behave differently when you've got 2 nodes and when you have 64 nodes. My usual approach to optimization (measure, try something, verify correctness, measure differences, repeat) doesn't really work here since I can't effectively do steps 2 and 3 for the parts of the problem that matter (concurrency robustness and performance under load). This scenario doesn't seem unique though. What is the common approach to doing this sort of task in this sort of environment? There are some related questions:   * this question has to do with hardware (like spectrum analyzers) being unavailable, which can be (relatively) easily emulated.    * this question is about tracking down bugs that only exist in production environments, which is helpful - but a different sort of activity.


title: Are expensive operations for a user bad for other users?

text: Let's say user A does something expensive (regarding CPU and/or memory), which takes a few seconds. Concurrently, user B needs a very small amount of computing time. In this case, will the computing for user A significantly slow down that of user B (even block maybe?), or are these situations handled in most systems? (I use ASP.NET MVC, but I wouldn't mind a more general answer either)


title: MySQL Database design - Opinions

text: Im working on a web Application for our bussiness with my brother. Our application its pretty simple, will be develop with php and mysql.   * Clients and providers ABMs   * Articles Inventory (we do not manage stock, because we resell from our providers)   * Purchases   * Account balance for our clients and providers Im stuck on accounting tables... Here is my model: ![database design](http://i.stack.imgur.com/jvRmR.jpg) Im in doubt with account table, im thinking about use a Trigger when purchases change Status (delivered to client) then I update Account balance but i dont know if this model its good for manage Accounts for my Clients. Im looking for opinions about my mistakes!! Thank you.


title: Are there alternatives to using an optional type in a multithreaded environment?

text: I'm making an MPMC queue in C++, and I would like to find out what the best interface for a `try_dequeue` method would be (I'm **not** concerned about its implementation). I'd like to provide a method which does not block if the queue is empty (like my `dequeue()` method does), but somehow notifies this to the caller. While I provide a `bool empty() const` method as well, this unfortunately does no good because for a multithreaded queue doing something along the lines of `if(!queue.empty()) queue.dequeue();` provides no guarantees. What I currently have is `T try_dequeue()`, which throws an exception if the queue is empty. This seems to offer the most intuitive interface, but an empty queue is hardly an exceptional situation, and that seems an awful lot like using exceptions for control flow. Another option would be `bool try_dequeue(T* t)`, which would write to `t` only if the queue was not empty and return if `t` was written to. After using the exception method above, this seems probably least intrusive, but it would require that `T` is both default-constructible (or in some manner trivially constructible, so the caller can do `T t; queue.try_dequeue(&t);`) and assignable. I wouldn't want to force those requirements on `T`, though, so perhaps a Java- like approach such as `optional<T> try_dequeue()` is in order. One of the minor issues with this is that I'd have to implement my own (can't use boost). Perhaps more importantly, it makes the interface seem bloated, in the sense that now I'm now dragging another type in where it would (hopefully) be avoidable, and, much like the situation with STL's `set::insert` requires us to copy a pair, then "unfold" its arguments, it forces the user into clumsy, long ritual that has to be repeated every time he or she uses the function. Perhaps I'm worrying too much about `optional<T>`'s usability, given that it doesn't have any of the more serious problems that the other two approaches do, but I'm wondering, what would be the best approach here? Is it the `optional` one? _Edit_ : It occurred to me that there's also a bit of an outlandish `bool try_dequeue(std::function<void(T&)>)` option which actually seems pretty nice (in fact this one will actually have the most minimal interface you can have, where there's no need for any external logic setting a local `T` to the returned value). Unfortunately I'd prefer to avoid the overhead incurred by calling an actual `std::function`, and using a template function `template<class F> bool try_deque(const F&)` isn't an option either since this is a derived class (from a generic `queue` interface).


title: If you should only have one assertion per test; how to test multiple inputs?

text: I'm trying to build up some test cases, and have read that you should try and limit the number of assertions per test case. So my question is, what is the best way to go about testing a function w/ multiple inputs. For example, I have a function that parses a string from the user and returns the number of minutes. The string can be in the form `"5w6h2d1m"`, where `w, h, d, m` correspond to the number of weeks, hours, days, and minutes. If I wanted to follow the '1 assertion per test rule' I'd have to make multiple tests for each variation of input? That seems silly so instead I just have something like:               self.assertEqual(parse_date('5m'), 5)     self.assertEqual(parse_date('5h'), 300)     self.assertEqual(parse_date('5d') ,7200)     self.assertEqual(parse_date('1d4h20m'), 1700)      In the one test case. Is there a better way?


title: Keeping a domain model consistent with actual data

text: Recently domain driven design got my attention, and while thinking about how this approach could help us I came across the following problem. In DDD the common approach is to retrieve entities (or better, aggregate roots) from a repository which acts as a in-memory collection of these entities. After these entities have been retrieved, they can be updated or deleted by the user, however after retrieval they are essentially disconnected from the data source and one must actively inform the repository to update the data source and make is consistent again with our in-memory representation. What is the DDD approach to retrieving entities that should remain connected to the data source? For example, in our situation we retrieve a series of sensors that have a specific measurement during retrieval. Over time, these measurement values may change and our business logic in the domain model should respond to these changes properly. E.g., domain events may be raised if a sensor value exceeds a predefined threshold. However, using the repository approach, these sensor values are just snapshots, and are disconnected from the data source. Does any of you have an idea on how to solve this following the DDD approach?


title: Is there a math theory or a model behind programming languages design

text: I'm trying to understand if a programming languages design is built on some a theoretical model.   I came across few links that was describing Programming Language Theory, Lambda Calculus, Formal Languages and Turing machine. I got lost in all that theory, what I understood from all that is that (any ..?) programming language is built on lambda calculus, that boils down to few language constructs.   1. is my understanding correct?   2. are there any models other than lambda calculus?   3. if the languages shares the same model, can we use that to convert a source code from one language to the other?


title: How do I properly design a many-to-many (charges/payments) accounting system?

text: This is just as much a db/programming question as an accounting/math question, so I'm actually posting to all relevant boards. I appreciate your patience in advance. Basically I'm having trouble wrapping my head around a payments ledger. My system has three tables: CHARGES, PAYMENTS and a PAYMENTS_TO_CHARGES. The issue is that part of the system requirement calls for both the ability to directly associate a payment with a CHARGE as well as allow members to post overpayments (or credits) to their account. So there's the need to track credits then apply them as needed to future CHARGES. Perhaps I'm thinking about things from the wrong standpoint, but I'm picturing CHARGES as a DEBIT and PAYMENTS as a CREDIT. However, it would appear that they can both have DEBIT/CREDIT depending on your accounting approach. So, my question -- officially -- is what is the best way to go about tracking/reconciling payments, and charges, while still allowing for overpayments, etc. I'm trying to work out the DB tables and business logic but every time I solve one problem, a reverse (or converse) item presents itself. Do I allow the many-to-many relationship to track positive and negative numbers per transaction? Do I create a fake universal charge that all credits apply to? Do I create a completely separate CREDITS table? As you can tell, I'm likely overthinking this, but I'm certainly befuddled. If all transactions were guaranteed 1-to-1, it would obviously be much simpler. Unfortunately they're not Best.


title: Linear probing hashing collision resolution

text: So I have a quick question about the linear probing method of collision resolution in hash tables. So by definition a linear probing method would look like:               while (hashTable[hash] != null)         hash = (hash(key) + step) % tableSize;      But in my case I know exactly what the table size will be, I know all the keys, so I'm wondering if this is a valid alternative implementation:               while (hashTable[hash] != null) {         if (++hash == hashTable.length)             hash = 0;     }      I'm sorry if I made it too confusing, but I'm a little confused myself... If you can't get what I'm asking, a simple explanation of how linear probing would be implemented would be very helpful, and ps: I'm working in java. Thanks alot


title: What do you use macros in your editor for?

text: My editor of choice is Notepad++. It has macro capabilities, but as much as I think, I don't see how can I use it for anything. Do you use macros in your editor that have made your work easier? (for general use I mean)


title: Programming Language? - To create a application (eLearning course) that will work on PC, Mac, iPhone, iPad, Touch etc?

text: Currently at work I'm helping put together and create eLearning courses within Flash. Our senior programmers have knowledge of how to do this, Although - I would like to know how you could go from converting a eLearning course from Flash into a application for Mac and PC, looking similar to Garageband's music lessons?   * What programming language was used to create Garageband on Mac?     * What is the best way to create a application that will work on PC, Mac, iPhone, iPad, Touch etc, Rather then using flash and Actionscript to create online based applications, that will only work in a browser on Mac and PC?   * Any further tips? Thanks Josh


title: What is the Ken Thompson Hack?

text: I read some stuff like cm bell labs but i couldn't get it all. How does it work really? What is the logic in that?


title: How should I describe the process of learning someone else's code? (In an invoicing situation.)

text: **Edit:** Justin Cave made a good point that this sort of communication should be up front in my quoting / estimations. Is this case, I'm still interested to know what sort of language people use to describe the 'existing code learning' activities. Especially to a company who haven't dealt with software contractors before. **End edit** I have a contract to upgrade some in-house software for a large company. The company has requested multiple feature additions and a few bug fixes. This is my first freelance style job. First, I needed to become familiar with how the application worked - I learnt it as if I was a user. Next, I had to learn how the software worked. I started with broad concepts, and then narrowed down into necessary detail before working on each bug fix and feature. At least at the start of the project, it took me a lot longer to learn the existing code than it did to write the additional features. How can I describe the process of learning the existing code on the invoice? (This part of the company usually does things in-house, so doesn't have much experience dealing with software contractors like me, and I fear they may not understand the overhead of learning someone else's code). I don't want to just tack the learning time onto the actual feature upgrade, because in some cases this would make a 'simple task' look like it took me way too long. I want break the invoice into relevant steps, and communicate that I'm charging for the large overhead of learning someone else's code before being able to add my own to it. Is there a standard way of describing this sort of activity when billing for a job?


title: In python, is it considered better to define a module with functions or a module with a class that contains functions?

text: In my code either of the above two options would work equally well but I am interested in finding out the pros and cons of both approaches.


title: In a web application, is it ok to group multiple pages in one view class or one class per page?

text: If you are building a web application, and you have a user management component, is it recommended to do:               class UserAdminView extends View {          }      or               class UserAdminUpdateView extends View {          }      What about controllers? Thoughts?


title: Programming "everything" using HTML5?

text: HTML 5 applications in the browser really seem to be taking off. I've been using src:kit within Google Chrome for a few weeks and love it. I'm an ASP.Net (C#/MVC 3) developer by trade, and in the past did several pieces of WebForms programming. With Windows 8 app development moving into the trade of local HTML5 apps, and the major smartphone browsers supporting HTML5 installation, as well as many platforms supporting it (PhoneGap and Titanium, for example), are we already/will we soon be at the point that I could create an app that would be fully "installable" to run as a _standalone_ on _every_ platform? I do realise that a database (or instert-your-data-store-here) would also be necessary, so adding another language in there for middleware would be necessary. C# on Mac/Linux with Mono is possible, but Mono generally only creates a GTK+ Application, so I would likely need to create another wrapper to house the application... I think. Any suggestions of a better language to use as middleware? I.e. for ease of transportation - I've got far more experience with C# than anything else so would like something from that family if I'll need to do something different. Basically, how far away are we from this? What still needs to change? Most importantly, if it is possible (which I believe, theoretically it is), what is the big jump between where we are now and when we will be there? This will eventually turn into a program, so it is a completely practical problem that I'm working my way through (I'll start development after Christmas). EDIT: To clarify, by 'every' platform, I include at least the following: Windows XP+/Mac OS X/Linux: any distro pretty much in the last 2 years/iOS/Android/Blackberry 5+/Windows Phone 7+


title: How to create a donation software

text: I have a requirement to create a donation software for a project. Does anyone know how KickStarter designed theirs? What are the security elements involved? How do I create the credit card transactions-processing part? Is there some common library/service used for that? I am still in research phases for this, so any ideas appreciated!! The site I am trying to do this for is http://www.problemio.com


title: How do i speedily traverse a file system while extracting/extrapolating various data and provide user feedback?

text: I'm working on a system file scanner that reveals info about various files (e.g. size, last used, duplicates, etc). Currently I'm traversing the file system once just to get a good measure of the files I'll be processing, I then loop through doing the actual processing (size info, hash info, etc). Obviously that immediately creates an entire layer of "extra" processing, but it allows me to use the previously acquired info to provide the user with some "progress data". I've been looking for a good mechanism to use in order to speed up the process while still showing progress data for end users. I thought about creating separate threads (one for appending files to a stack, and the other for reading from the stack as they became available), but that might get out of hand programmatically quickly. In the interest of speeding up the initial scan, I currently perform a "find path" (or the equivalent depending on what OS is being used) and grab all of the output. This, however, prevents me from negating entire subfolders (if the user desires) as it simply recursively lists everything. Certain OSes do have command line options for negating directories, etc, but I need a cross- platform solution. So, aaaaaaall that said, does anyone have any algorithmic suggestions for being speedy while providing quality progress? I'm not fundamentally tied to any specific language. I'm looking more for a higher level view of what needs to occur. Best.


title: Optimal way to store 18 billion key, value pairs

text: I have around 200 million new objects coming in, and a 90 day retention policy, so that leaves me with 18 billion records to be stored in the form of key-value pairs. Key and value both will be a string. It is basically a mapping between a unique identifier for the object in the application to the unique identifier for the object in the actual object storage. There is an application which loads objects into a Web OS. For each object it loads, it creates a 16 character string key, say DataID. The Web OS itself creates a 40 character string key, say ObjectID. So what I'm trying to do is create a mapping between DataID -> ObjectID for 18 billion objects. I'm don't know the mechanism being used to create the IDs. I will have to deal with:               write(key,value)     read(key)     delete(key,value)      I am looking for ideas for an optimal way to implement this. It should be optimized for reads & writes. Space optimization is secondary. I know Hadoop/NoSQL is one way to go, and probably another solution would be distributed Hash tables, but a few more options would help me decide which is the best solution. A relational database is not an option as we don't have an existing RDBMS in the current environment.


title: Should images be stored in a git repository?

text: For a distributed team that uses Git and Github as version control, should images also be stored in the git repository? For the most part, the images won't be changed. The folder containing them will only grow in size as images are added. A concern is that the image folder may grow to a large size over time by combination of large images, or just a lot of them. Is this considered a best practice? What other alternatives are there to sharing binary files needed in projects that a distributed team can easily access?


title: Is COBOL still worth learning?

text: Does learning COBOL still make sense?


title: Why JSP over Servlets for view?

text: Although servlets does the task of sending the HTML code to the client programmers weight JSP over servlets for that. Even a JSP code is compiled into servlet before giving the response to the browser then why is JSP preferred? If servlet is used then a lot of computation work can be saved.


title: Does iCloud use windows Azure?

text: I just read this article on iCloud's use of Azure: http://www.zdnet.com/blog/microsoft/is-apple-really-using-windows-azure-to- power-icloud/9687 Anyone know if there is any truth in it?


title: Library Organization in .NET

text: I've written a .NET bitwise operations library as part of my projects (stuff ranging from `get MSB set` to some more complicated bitwise transformations) and I mean to release it as free software. I'm a bit confused about a design aspect of the library, though. Many of the methods/transformations in the library come with different endianness. A simple example is a `getBitAt` method that regards index `0` as the least significant bit, or the most significant bit, depending on the version used. In practice, I've found that using separate functions for different endianness results in much more comprehensible and reusable code than assuming all operations are `little-endian` or something. I'm really stumped regarding how best to package the library.   * Should I have methods that have LE and BE versions take an enum parameter in their signature, e.g. `Endianness.Little, Endianness.Big`?   * Should I have different static classes with identically named methods? such as `MSB.GetBit` and `LSB.GetBit` On a much wider note, is there a standard I could use in cases like this? Some guide? Is my design issue trivial? I have a perfectionist bent, and I sometimes get stuck on tricky design issues like this... **Note:** I've sort of realized I'm using `endianness` somewhat colloquially to refer to the order/place value of digital component parts (be they bits, bytes, or words) in a larger whole, in any setting. I'm not talking about machine-level `endianness` or serial transmission endianness. Just about place-value semantics in general. So there isn't a context of targeting different machines/transmission techniques or something.


title: what is difference in section and subreport, where to use multiple sections?

text: Please share your knowledge about these Crystal Reports concepts.   1. I want to know what is difference in section and sub report? I know about default sections and we can add new sections into report.   2. What is purpose of a subreport? when should we use a subreport instead of a section?   3. Where should we use multiple detail sections in report?   4. Are sections used to carry a "Can grow" field that will be bringing data dynamically?


title: Formal definition for term "pure OO language"?

text: I can't think of a better place among SO siblings to pose such a question. Originally I wanted to ask "Is python a pure OO language?" but considering troubles and some sort of discomfort people experience while trying to define the term I decided to start with obtaining a clear definition for the term itself. It would be rather fair to start with correspondence by Dr. Alan Kay, who has coined the term (note the inspiration in biological analogy to cells or other living objects). There are following ways to approach the task:   1. Give a comparative analysis by listing programming languages that can exhibit (or fail to do so) certain properties unique and sufficient to define the term (although Smalltalk, Scala, ~~Java~~ , and so on - are possible examples but IMO this way seems neither really complete nor fruitful)   2. Give a formal definition (or close to it, e.g. in more academic or mathematical style).   3. Give a philosophical definition that would totally rely on semantical context of concrete language or a priori programming experience (there must be some chance of successful explanation by the community).  My current version: _"If a certain programming (formal) language that can (grammatically) differentiate between operations and operands as well as infer about the type of each operand whether this type is an object (in sense of OOP) or not then we call such a language an OO-language as long as there is at least one type in this language which is an object. Finally, if all types of the language are also objects we define such language to be pure (strong) OO- language."_ Would appreciate any possible improvement of it. As you can see I just made the definition dependent on the term "object" (often fully referenced as class of objects). [EDIT] In addition, I use (luckily well understood) notion of a _type_ as in typed languages. Data type programming or type oriented programing is not only a syntactical interpretation (of the program text, i.e. how to treat certain values of literals and data variables - something that evolves into type safety) but can be attributed to language grammar and studied in formal way (using mathematical logic) as so called type systems. Notice that requiring particular type system to have a so called _universal type_ is one of the ways defining purity of OO language (there are ways to expand this semantically). _NB_ _**how to answer_** :   * it helps if you specify a book or a reference that supports/explains your understanding of terminology and concepts (usually a good definition covers or references all depended concepts except elementary).   * if possible indicate an indented category of your answer/definition if it is not clear otherwise (see above: 1 - by language example, 2 - mathematical logic, 3 - technical description and programming philosophy)   * _classification is important_ (and also because term pure-OO is included into term OO) while answering try to unmix elements of OO paradigm from other well known methodologies (and by no means confuse/overlap them, e.g. typically elements of modular programming can be covered/embodied with OO programming): try to distinguish OOP from (including or being a part of) Functional programming, Logical programming (especially strongly specialized ), Abstarct Data Types (ADT), Modular, Metaprogramming (generics and LISP's macroexpansion-time), Contracts (e.g. Eiffel), Aspect-oriented (AO), (difference between declarative and functional classification as well as _historical_ definitions of Dijkstra's structured are clear) _**on difficulty of giving a formal definition_** : surprisingly enough it is very easy to give a mathematical description of OOP in form of a certain logical (formal) system (most likely type based) and defining one concept after another. One can even try to do something more practical by applying that formalism to type safety checking or new language design aspects than merely abstract entertainment or exercise (also lookup formulation of OOP in Intuitionistic Type Theory, Dependent types, independently, in FOL formalisms as lambda calculus and just by using category theory). A main point here is that _unsurprisingly_ such formulations IMO are strongly biased (flawed) by most likely initially incomplete understanding of OOP (in computer engineering) and end up being almost inaccessible afterwards (thus hardly contributing backwards to programming world - maybe except certain percentage finds applications back from formal world by being integrated into popular languages). So yes, it is difficult to give exactly a "good" definition, not just definition. But I am positive of asking this here because of your experience and direct involvement, guys.


title: How can I avoid the engineering mistakes of PDT?

text: As a developer with enough experience to evaluate a tool, I may say that PDT is very huge in size and slow in performance for a PHP IDE. It gets bigger by release and exponentially slower by the size of the projects. Add some extra syntax coloring rules and it literally crawls, code completion works randomly and building workspace takes like forever. Java black magic (-Xmx etc) eases the pain a little but that's it. So my questions are:   1. Why is PDT like this? What design or engineering factors led to its poor performance?    2. How can I avoid making these same mistakes in my own products?


title: How to break up Yocto layers for continuous integration?

text: We are building embedded software using a Linux setup based on the Yocto project. We have a couple different configurations that we are building for different purposes (but the same target). I have been struggling with the best way to set up continuous integration for this project. Ideally, I would like to be able to reuse most of the artifacts, so that someone working on a specific layer can get rapid feedback. However, I haven't found any good suggestions on a way to break these builds apart. Is there a way to separate the various layers we are working on into multiple builds with shared artifacts so that it takes a couple hours for developers to get feedback from each build?


title: Start by Teaching Classes

text: In every class, and every book I have seen regarding programming, classes are held off. They are thought to be confusing and strange. I certainly had issues with them. But in object orient programing, classes are so important, looking back at my education, it's almost illogical that I was allowed to go so long without knowing objects. I am helping to develop a course to teach python to people who have never coded before. Is it possible to teach programming by starting first and foremost with classes? Is it not possible to say, "This is a class. We will fill it with nouns and verbs so that it can serve our particular/specified needs"?


title: When to decide to introduce interfaces (pure abstract base classes) in C++?

text: Assume that you are developing a functionality and are 90% sure that the implementation class will stay alone. If I was in this position in Java I would probably not use the interface right now to keep the things simple. In Java it is easy to refactor the code and extract the interface later. In C++ the refactoring is not always so easy. It may require replacing values with smart pointers (because of the introduction of polymorphism) and other non-trivial tasks. On the other hand I don't much like the idea of introducing virtual calls when I am 90% sure they won't be needed. After all speed is one of the reasons to prefer C++ over simpler languages.


title: What is the difference between CSDA and CSDP?

text: This question is in reference to the IEEE's CSDA and CSDP certifications. I've already taken the CSDA course, which covered all of the knowledge areas in the Software Engineering Body of Knowledge (SWEBOK). I'm thinking about doing the CSDP certification as well, but I can't find anywhere that tells me how it differs from the CSDA. I know that it's aimed more at professionals rather than recent graduates, and I'd imagine that it covers the same areas as the CSDA, but in greater detail. Unfortunately I can't find much evidence to back that up. This is making it difficult to justify to my boss that he should spend several hundred pounds of the group's training budget on it. So the question is: **What does the CSDP offer that the CSDA doesn't?**


title: Drawbacks of code kata

text: Code kata is a concept that proposes to hone programmer's skill by doing small problems many times trying to improve the code at each iteration. The name comes from an analogy to martial art kata where forms (aka kata) are practices done over and over leading to improvements. From the reaction I got to my last question on the topic, I wish to know what are the draw backs of this approach?


title: Working with data and meta data that are separated on different servers

text: While developing a product, I've come across a situation where my group wants to store meta data for data entry forms (questions, layout, etc) in a different database then the database where the collected data is stored. This is mostly for security because we want to be able to have our meta data public facing, while keeping collected data as secure as possible. I was thinking about writing a web service that provides the meta information that the data collection program could access. The only issue I see with this approach is the front end is going to have to match the meta data with the collected data, which would be more efficient as a join on the back end. Currently, this system is slated to run on .NET and MSSQL. I haven't played around with .NET libraries running in SQL, but I'm considering trying to create logic that would pull from the web service, convert the meta data into a table that SQL can join on, and return the combined data and meta data that way. Is this solution the wrong way to approach the problem? Is there a pattern or "industry standard" way of bringing together two datasets that don't live in the same database?


title: Make a flowchart to demonstrate closure behavior

text: I saw below test question the other day in which the authors used a flowchart to represent the logic of loops, and I got to thinking it would be interesting to do this with some more complex logic. For example, the closure in this immediately-invoked function expression (IIFE) sort of boggles me:               while (i <= qty_of_gets) {         // needs an IIFE         (function(i) {             promise = promise.then(function(){                 return $.get("queries/html/" + product_id + i + ".php");             });         }(i++));                            }      I wonder if seeing a flowchart representation of what happens in it could be more elucidating. Could such a thing be done? Would it be helpful, or just messy? I haven't the foggiest clue where to start, but thought maybe someone would like to take a stab. Probably all the ajax could go and it could just be a simple return within the IIFE. ![logic test](http://i.stack.imgur.com/qicvE.png)


title: Is a single config object a bad idea?

text: In most of my applications, I have a singleton or static "config" object, in charge of reading various settings from disk. Almost all classes use it, for various purposes. Essentially it's just a hash table of name/value pairs. It's read-only, so I haven't been too concerned with the fact that I have so much global state. But now that I'm getting started with unit testing, it's starting to become an issue. One problem is that you don't usually want to test with the same configuration that you run with. There are a couple of solutions to this:   * Give the config object a setter that's ONLY used for testing, so you can pass in different settings.   * Continue using a single config object, but change it from a singleton to an instance that you pass around everywhere it's needed. Then you can construct it once in your application, and once in your tests, with different settings. But either way, you're still left with a second problem: almost any class can use the config object. So in a test, you need to set up the configuration for the class being tested, but also ALL of its dependencies. This can make your testing code ugly. I'm starting to come to the conclusion that this kind of config object is a bad idea. What do you think? What are some alternatives? And how do you start refactoring an application that uses configuration everywhere?


title: What's the name for a bug that suddenly breaks things but has always been present?

text: We had a failure in our software today and after investigating discovered that the failure should have been occurring for weeks, but it waited until this morning to rear its ugly head. Is there an accepted name for such a bug that I can use when referring to it with other programmers? The closest I could find was a Schrödinbug, but I'm don't think it applies, since nobody was inspecting any code. The bug was just lying in wait.


title: What can be done against language inertia?

text: Often, projects use programming language X, but would use programming language Y if they were started from scratch. For example, big numerical models may be written entirely in Fortran. Whereas this might be a reasonable choice for the components that need to run fast (alternative would be C or C++), it might be a poor choice for components that either do not need to run fast (such as things dealing with human input or simple visualisations), or where runtime is not the limiting factor (such as I/O, particularly when from the network). Another example may be when a project is built using a propriety language (such as Matlab; no, FOSS clones are not good enough) and was started at a time when FOSS alternatives were not viable, but ten years later, they are; and it would be beneficial to migrate. However, due to _language inertia_ , a migration does not happen. Code that works should not be touched, porting code is a time-consuming, expensive process, and programmers are familiar in language X but not necessarily in language Y. Still, in the long term, a migration would likely be beneficial. Can anything be done to mitigate the problems associated with language inertia? Are there any notable examples of big projects that have successfully overcome this problem? Or is a project bound to stick forever with the initial choices?


title: IOC and stateless services. Short-lived or single-instance?

text: Given a garbage-collected framework, when using an IOC container to inject purely stateless services, is it generally better to use the container's single-instance lifespan or to recreate the object each time it is used and throw it, and all its dependencies, away as soon as you're done with them?


title: Writing an application prototype - best practices?

text: For a project I am working I want to implement a small prototype to try things out, demonstrate some functionality to the client and learn some frameworks used in the project. Do you have any suggestions or do you know of best practices for implementing such a prototype? Some more details:   * The application will be a complex web app   * I have to implement a mechanism where the server pushes data to subscribed clients (the data will be generated by some events)   * I want to write a prototype which implements exactly this behaviour but nothing more


title: Lone Programmer vs. Everything Else

text: I guess you could call me a "MicroISV" because it's basically just me doing the work to create a product to be sold commercially. I'm sure there are many out there like me, so here's my question: Besides the programming/coding aspect to get your code out the door, **_do you DIY or vendor-out everything else_**? For example, web site creation, internet marketing, accounting/taxes, company minutes, customer support, setting up ecommerce/banking, server management, procurement, etc. All of those activities seem to be out of the realm of what I'm good at or have the patience/time for, but I don't know if the alternative is too untrustworthy or too expensive to make it worthwhile to try to farm out these tasks to someone else (like a local company, vendors on oDesk, etc.). I can certainly understand wanting to keep all these tasks "in-house" (i.e. me) to protect strategy, plans, code, private things like bank account numbers, but is it really that much of a risk to outsource these tasks? What is your experience?


title: Executive trying to understand Web 2.0 Development - Which language is best?

text: I am writing a business plan for developers in the 2.0 environment; my utmost respect is given to the people doing the work, but my ignorance is preventing me from articulating who I will need to complete it. What is the best way to describe the developer needs of a Web 2.0 Social/Gaming company as an open position for hire?


title: What are your strategies to improve the level of your team in a clever way?

text: I'm looking for innovatives ways to improve the whole team & raise the global level in every aspects, not just technicals ones. My actual solutions :   * **programming challenge** vith votes, notes etc    * **teaching each others** : each month, a member might present a new api,strategy, whatever that help to build better sofwares. It will end up with votes. If it is approved, the team will commit to use it for a month. Then feedback.Then use it or leave it.    * **annual review to reduce you blind spot** of your Johari window. Personnaly, i really find instructive the _farewell feview_ , done each time i leave definitively a group of people.  Because of social conditioning, they need a warming up. So i really tell them to not filter their words & almost badmouth about me. No matter what they would say i will stay quiet. It works great with women, especially if they can answer with an email and you far away (double safety net) _**And what about yours ?_**


title: Does it make sense to use tag without version numbers?

text: In our working group we had a discussion on using git tags in our projects. Some people argumented pro tags and some argumented against using tags. The crux is that we are talking about Magento projects which aren't really using version numbers, hence the tags only consist of `20140624` date references. The pro side was that it is easier to revert to a tag than a normal commit hash and it is part of gitflow, the contra side was that it only creates overhead. What do you think on using git tags only for reverting history?


title: What's the best way to organize JavaFX 2.0 code?

text: In every example I have seen yet almost all of the GUI code is written in the `start(Stage stage)` method of the main class. Is this the best approach, or is it OK to subclass the Stage class and make your own thing? If the latter is OK, wouldn't the performance suffer because of lot of Stages?


title: Why is Perl's smart-match operator considered broken?

text: I've seen a number of comments across the web Perl's smart-match operator is broken. I know it originally was part of Perl 6, then was implemented in Perl 5.10 off of an old version of the spec, and was then corrected in 5.10.1 to match the current Perl 6 spec. Is the problem fixed in 5.10.1+, or are there other problems with the smart- match operator that make it troublesome in practice? What are the problems? Is there a yet-more-updated version (Perl 6, perhaps) that fixes the problems? **Edit:** To clarify, I'm not asking about bugs, but rather the opinion that the intended behavior of `~~` is bad.


title: How can I convince cowboy programmers to use source control?

text: **UPDATE**   I work on a small team of devs, 4 guys. They have all used source control. Most of them can't stand source control and instead choose not to use it. I strongly believe source control is a necessary part of professional development. Several issues make it very difficult to convince them to use source control:   * The team is not used to using TFS. I've had 2 training sessions, but was only allotted 1 hour which is insufficient.   * Team members directly modify code on the server. This keeps code out of sync. Requiring comparison just to be sure you are working with the latest code. And complex merge problems arise   * Time estimates offered by developers exclude time required to fix any of these problems. So, if I say nono it will take 10x longer...I have to constantly explain these issues and risk myself because now management may perceive me as "slow".   * The physical files on the server differ in unknown ways over ~100 files. Merging requires knowledge of the project at hand and, therefore, developer cooperation which I am not able to obtain.   * Other projects are falling out of sync. Developers continue to have a distrust of source control and therefore compound the issue by not using source control.   * Developers argue that using source control is wasteful because merging is error prone and difficult. This is a difficult point to argue, because when source control is being so badly mis-used and source control continually bypassed, it is error prone indeed. Therefore, the evidence "speaks for itself" in their view.   * Developers argue that directly modifying server code, bypassing TFS saves time. This is also difficult to argue. Because the merge required to synchronize the code **to start with** is time consuming. Multiply this by the 10+ projects we manage.    * Permanent files are often stored in the same directory as the web project. So publishing (full publish) erases these files that are not in source control. This also drives distrust for source control. Because "publishing breaks the project". Fixing this (moving stored files out of the solution subfolders) takes a great deal of time and debugging as these locations are not set in web.config and often exist across multiple code points. So, the culture persists itself. Bad practice begets more bad practice. Bad solutions drive new hacks to "fix" much deeper, much more time consuming problems. Servers, hard drive space are extremely difficult to come by. Yet, user expectations are rising. What can be done in this situation?


title: Method visibility for testing partial mocks

text: I'm currently writing unit tests to test behavior of a method and would like to partially mock the methods calling injected properties. For example:               public void doSomething() {       int complicatedInt = 1 + 1;       if(getProperty().someBooleanReturn()) {         ... etc. ...        }     }      So obviously I want to mock the `getProperty()` method in order to expect the `someBooleanReturn()`. My question is, since I don't want the getter to be visible to other classes, but visible to unit tests, I've currently been making these methods package-private (default scope). Is there a standard for these types of operations? Thanks!


title: Copyright on own implementation of Standard C Library

text: I am busy writing a bare-bones Standard C Library for my hobby OS. I am only including the functions I really need for now but the library is still referenced as 'libc' in my source and I plan to expand it to a fully featured C Library. My OS is going to be released as open-source so I would like to know what kind of copyright notice I should put on the source files for my 'C Library' because the coding is mine but it is still based on the source of other C libraries such as GNU C. I have seen this copyright notice on a C Library implementation for AVR               00001 /* Copyright (c) 2002, Marek Michalkiewicz     00002    Copyright (c) 2004,2007 Joerg Wunsch     00003      00004    Portions of documentation Copyright (c) 1990, 1991, 1993, 1994     00005    The Regents of the University of California.     00006      00007    All rights reserved.     00008      00009    Redistribution and use in source and binary forms, with or without     00010    modification, are permitted provided that the following conditions are met:     00011      00012    * Redistributions of source code must retain the above copyright     00013      notice, this list of conditions and the following disclaimer.     00014      00015    * Redistributions in binary form must reproduce the above copyright     00016      notice, this list of conditions and the following disclaimer in     00017      the documentation and/or other materials provided with the     00018      distribution.     00019      00020    * Neither the name of the copyright holders nor the names of     00021      contributors may be used to endorse or promote products derived     00022      from this software without specific prior written permission.     00023      00024   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"     00025   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE     00026   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE     00027   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE     00028   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR     00029   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF     00030   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS     00031   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN     00032   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)     00033   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE     00034   POSSIBILITY OF SUCH DAMAGE.     00035      00036   $Id: stdlib_8h_source.html,v 1.1.1.4 2012/01/03 16:04:22 joerg_wunsch Exp $     00037 */


title: Java continuous integration with extras

text: I am very new to continuous integration, but I decided to give it a shot. Unfortunately I found there to be huge quantities of different tools, and each one is sizable and seems to be difficult (I am new so of course it intimidates me). What I am looking for however is a tool that can   * run my junit tests   * execute my builds   * create the jars   * deploy specific jars to specific remote servers What are the key steps and approaches to filling these requirements?


title: CSS naming guildlines with elements with multiple classes

text: Its seems like there are 2 ways someone can handle naming classes for elements that are designed to have multiple classes. One way would be:                     This is something that twitter bootstrap uses. Another possibility I would think would be:                     It seems like the zurb foundation uses this method. Now the benefits of the first that I can see is that there less chance of outside css interfering with styling as the class name btn-success would not be as common as the class name success. The benefit of the second as I can see is that there is less typing and potential better style reuse. Are there any other benefits/disadvantages of either option and is one of them more popular than the other?


title: What is a good alternative to the name variable for a language that only has immutable references or labels?

text: For example, in functional languages, **variables** are single assignment and their values are immutable once assigned. So they have two states **unbound** and **bound** , once bound they can't be changed. Is there some mathematical term or other computer science term that is most appropriate for such as thing? Something that **semantically** doesn't imply variance or mutability. If not there doesn't exist such as term and if you were designing a language that had such constructs, what other than the word **variable** would you use to for these? I am **not** really looking to **poll** for ideas, I am trying to figure out if there is already an accepted industry ( any industry ) term for such a thing.


title: Generic params table design

text: We have a generic parameter table whose important attributes are :               id number auto increment not null     domain varchar (200) not null     classification varchar (200) not null     param_name varchar (200) not null     value CLOB/text     created_by, created_date, updated etc      Here the id is unique for the table plus at the functional level there is a unique index on domain, classification, param_name The value is text of any length in UTF-8. We want to add BLOB, binary data support. Choices are :   1. add a new column : blob_value BLOB OR    2. add a field 'type' of varchar2 in this table that can be null or 'B', default null. Null or blank means is not - text If B means its a blob. In that case the value will hold an id of a blob table row. The blob table will look like : id number auto increment data BLOB   3. Leave existing table alone and in a new table that references this one: parameter_id number primary key, data blob, with constraint FOREIGN KEY (parameter_id) REFERENCES Parameter(id) (suggestion FrankieTheKneeMan thank you) Advantage of first is that a param can have both a text and a blob or either. Advantage of second - not sure -> do not need to keep null columns? Current table has 30,000 rows and we expect it to grow to 70,000 out of which 10% will need blob data. Question: which of these would you choose and why or do you have an alternate ?


title: Website for Local Programmers User Group

text: Looking for suggestions/requirements for a website for a local programmer user group, and the resulting feedback of other commenting on answers. Examples of an existing site would be nice, but not required.


title: Construct an array from an existing array

text: > Given an array of integers A[1...n-1] where 'N' is the length of array A[ ]. > Construct an array B such that B[i] = min(A[i], A[i+1], ..., A[i+K-1]), > where K will be given. Array B will have N-K+1 elements. We can solve the problem using min-heaps Construct min-heap for k elements - O(k) For every next element delete the first element and insert the new element and heapify Hence Worst Case Time - O( (n-k+1)*k ) + O(k) Space - O(k) Can we do it better?


title: Using oAuth as a complement to an existing authentication system?

text: I am hoping this is the correct stack exchange to be asking this, here goes. I am building a new website whereby it implements its own custom login system. You simply register your username, email password etc. Then you're free to log in with the option of clicking "remember me" to save the hassle of logging in every time. For simplicity, let's call this the **Custom Login System** and an account a **Custom Account**. However, I am very interested in integrating some 3rd party login systems via oAuth that are offered by the likes of Facebook, Google and Twitter. My question is, is it feasible to have a mechanism whereby:   * you log in via Google, for example   * my script confirms the tokens and all that good stuff to ensure you authorised the login   * I then ask you to either link your Google account to:      * an existing **Custom Account** or     * a new **Custom Account** by asking to register one after logging in with Google   * once you've logged in to your **Custom Account** , I treat you like any other user except I assume the "remember me" option was ticked and set a cookie that logs you in from here on as if you were using a normal **Custom Account** the whole time. This could essentially mean that I don't need to constantly query Google's servers, only during login. Then from there on, as long as they have a valid cookie they will stay logged in. Is this possible? Are there any obvious flaws that I am missing out?


title: Suggested setup for angularJS development in Visual Studio 2013

text: I am starting with AngularJS. The back end will be Web API (which is new to me as well) and I'd like to use just one IDE, so I'm trying to figure out how to setup a project in Visual Studio 2013 for AngularJS. I'd like to keep it as a separate project, to keep it loosely coupled to the API (or keep the UI decoupled from the Web API). I'm having a hard time figuring out how to get this setup. So....   * What project type is best for a pure AngularJS (pure HTML 5) project?   * Is is suggested to use Grunt? Or is MS Build better to handle build tasks? I thinking here linting, minify, concatenating files into a single distribution file, maybe copying to a web server.   * How do you run tests? Is there a plugin to run Jasmin tests? Do you just run Karma separately?    * Are there any good templates for AngularJS? Any that use ngBoilerplate? Any help would be appreciated.


title: How are the size of the stack and heap limited by the OS?

text: **Note** : if you need to consider a specific OS to be able to answer, please consider Linux. Whenever I run a program, it will be given a virtual memory space to run in, with an area for its stack and one for its heap. **Question 1** : do the stack and the heap have a static size limit (e.g., 2 gigabytes each), or is this limit dynamic, changing according to the memory allocations during the execution of the program (i.e., 4 gigabytes total to be used by both, so if a program only uses the stack, it will be able to have a stack with 4 gigabytes)? **Question 2** : How is the limit defined? Is it the total available RAM memory? **Question 3** : What about the text (code) and data sections, how are they limited?


title: Is using Singleton correct for Jtree & DefaultTreeModel?

text: Basically I have one Tree view which uses a single DefaultTreeModel. Is it okay to use singleton for Tree extending JTree and another singleton for TreeModel extending DefaultTreeModel? If not, what is the reason to avoid using singleton for each object?


title: Text Adventure language

text: I was thinking of creating a text adventure game and after a small google search, I found out that quite a few (simple) text adventure games are created in Prolog. Why is that?


title: What technology/algorithm should be used to abstract meaning or keywords from a passage of text?

text: Hi and thanks for looking! ## Background I have a project wherein I need to abstract meaning from a passage of text to determine what the text is seeking and then match that text to a list of search results. Now, I have some context with this and the following scenario is very close, but doesn't violate my NDA with the client: Let's say I have a software developer job description from a posting on Craig's List. I want to somehow parse that description and make a guess as to whether the posting is seeking a C# developer, a DBA, a SDET, a C++ dev, etc. Even better, it would be good to distill certain parameters such as years/level of experience and experience with any particular stacks (.NET, Java, etc). Once I have abstracted the requisition, I then need to reference a database of resumes (CVs) to find a ranked set of matches, probably using the same algorithm or at least a system of tags. ## Question How best do I attain this goal? Should I be looking into building an index of keywords? Natural Language Processing? Evolutionary Algorithms? We have to assume that human interaction will be very minimal. ## Example Job Posting Here is an example Job Posting that I have pulled at random from Craig's List: > We invite you to bring your career to an environment where talent is > rewarded and new ideas are encouraged. At Seattle Children's, the Pacific > Northwest’s premier pediatric care center, we offer more than just state-of- > the-art facilities and open career growth potential. You will also find a > true commitment to our patients and families that reach far beyond the > bounds of clinical expertise. The Applications Development Senior position > in the Center for Developmental Therapeutics will develop, test, standardize > and implement software for high throughput data analysis. This includes > system analysis, design, application support, research into standards, and > customer/vendor relations management in support of production operations. > For example, supporting the integration of different computational > approaches into an end-to-end workflow for high throughput data analysis, > including applications for proteomics and metabolomics. Participate in all > phases of the project lifecycle, including architecture, design, > development, alpha, beta, release and production support. The ideal > candidate will have a Bachelor's degree in the field and a minimum of three > years of experience with software development; working knowledge of JAVA, > Spring, AJAX, JSF, Hibernate, JQuery, and JUnit; and solid experience with > SQL tuning and understanding the execution plan will be key to this role. > Please ensure to complete the job assessment questions right after you > submit your application for this opening. Required: \- Bachelor's Degree in > Computer Science, Math, Business, or related field \- Three (3) years > software development experience \- Working knowledge of JAVA, Spring, AJAX, > JSF, Hibernate, JQuery, and JUnit \- Solid experience with SQL tuning and > understanding the execution plans \- Strong understanding of multi-tiered > web applications and scalability challenges Preferred: \- Five (5) or more > years software development experience \- Experience developing large > software systems \- Experience with web services (HTTP, JSON, SOAP, XML), > Unix/Linux environments, and distributed systems (HADOOP) \- Experience in > software and algorithmic development for molecular biology, biotechnology, > microarrays or proteomics. We offer competitive pay, generous paid time off, > transportation discounts, and employee reward and recognition programs. Thanks! Matt


title: Use verbs with functions, nouns with classes - what about interfaces?

text: Ok, I understand the normal conventions of using verbs with functions and nouns with classes. What about interfaces? Is there any methodology when coming up with interface names that may not be that obvious? Just to make it clear, I'm not talking about whether to put an "I" in front of the name or if to use camelCase or PascalCase. I'm wondering about the method of figuring out a clear, semantic name for an interface. **EDIT** I'm obsessing on how to name an interface in the clearest way. I guess it just needs to be a noun too because when I think of naming classes I think of the closest "real" world object it can relate to. I suppose real world interfaces are things like a keyboard, mouse, remote control, ATM screen. Those are all nouns. Anyhow, any additional insight on a good way to formulate interface names would be appreciated.


title: What issues do I need to consider when setting up a User Support group for a large enterprise system?

text: I have been tasked with becoming the Administrator for a large enterprise software system that consists of several shrink wrapped applications and some home grown 'glue' and has a couple of hundered users across three continents. What do you think are the aspects / points I need to address? At the moment the best I can come up with is a quote from Kathy Sierra's Creating Passionate Users blog post: > How does this help the users kick ass? which seems helpful as a mantra, but not very concrete.


title: Which part of the source base should users be testing?

text: I'm using SVN and I'm wondering about which part of the code base the users should test. The trunk (after the new feature branch has been merged in) or the branch? If using the branch, how do you deal with the scenario where two developers are working on two different feature sets (so two branches), and need to release for testing to the users? We've had a scenario where users are testing the wrong version (branch) and obviously cannot see their fixes. I'd appreciate some experience / advice about dealing with this. Update: Branches are used for new features / bug fixing and eventually merged back into the trunk. Testing involves testing the entire application (for site- effects) but will realistically users will have only tested their feature.


title: Should we always unit test bugs when correcting them?

text: When correcting bugs, it is encouraged where I work to first write a test that fails with the given bug, and then to fix the code until the test passes. This follows TDD practices, and is supposed to be good practice, but I noticed it tends to produce cryptic tests that come really close to the implementation. For instance, we had a problem when a job was sent, reached a certain state, was aborted, and retried. To reproduce this bug, a massive test was written with thread synchronization in it, lots of mocking and stuff... It did the job, but now that I am refactoring the code, I find it very tempting to just remove this mammoth, since it would really require a lot of work (again) to fit the new design. And it's just testing one small feature in a single specific case. Hence my question : how do you test for bugs that are tricky to reproduce ? How do you avoid creating things that test the implementation, and hurt refactoring and readability ?


title: Javascript, Text Annotations and Ideas

text: I am very curious to hear input from others on a problem I've been contemplating for some time now. Essentially I would like to present a user with a text document and allow him/her to make selections of text and annotate it. Specific to the annotations i aim to achieve the following:   1. Allow users to make a text selection, annotate it, then save the selection and annotation for reference later   2. (UI) Support representing overlapped annotations. For example if the string where: "This is the test sentence for my example test sentence", user1 might have an annotation on "is the test sentence for my example" and user2 might have an annotation on "for my example".   3. Account for a situations where the document's text changes. The annotations would to be updated, if possible. How would you tackle this from a technical perspective? Some ideas I've had are:   * Use javascript ranges and store an annotation as a pair of integers something like: (document_start_char, document_end_char). Save this pair in the db.   * Alternatively, using JS get the text selected and actually save the full text in the db. (not sure how i would then do overlapping annotations)   * Represent overlapped annotations by applying a css style to highlight the text then darken the "stack" of annotations where they overlap. Smallest annotation would always have to be on the top of the "stack". What are your thoughts or areas of improvement? How the _heck_ could I support a document's text being updated without breaking all the annotations?


title: Closing tag (?>) on PHP files?

text: Some people swear by closing their PHP files with `?>`, some say it's more optimized to leave it off. I know that it's not essential to have it on there, I'm just wondering what the pros and cons are of doing this, and what best practice is.


title: Why do people use programming books?

text: I find that when someone asks what is the best way to learn how to program, people usually provide them with references to a bunch texts written by various authors. However I don't believe many people at all learn to program from books. I find that they are usually faced with a challenge and then use programming as a tool to overcome it. For example I 'got into' programming because I wanted to start a server for a game I was playing, so I googled and read through the support for that particular server and now I am a employed software engineer, using only the skills I developed (and then further developed) by coding C# scripts for a not very popular server package. So my question is, do people generally find it easier to learn from these books? I know I have looked at a few of them and found them far too 'dry' to encourage me to finish it.


title: Creating a remote management interface

text: I'm looking for info on creating a remote management interface for our software. This is not anything illicit. Our software is for live TV production and once they go on-air we can't access the PC (usually through LogMeIn). I would like to be able to upload/download files and issue commands to our software. The commands would be software specific like "load this file" or "run this script" or "return this value" etc. A socket connection is preferred but the problem is most of our PCs are behind firewalls and NAT servers. I'm not sure where to start. I think HTTP tunneling is the way to go but am wondering if there are other options or recommendations. Also, assume our clients are not willing to open up ports for security reasons. Thanks.


title: Development of a bot/web crawler detection system

text: I am trying to build a system for my company which wants to check for unusual/abusive pattern of users (mainly web scrapers). Currently the logic I have implemented parses the http access logs and takes into account the following parameters to calculate the potential of a user being a scraper or bot:   1. It checks v/s HTTP 'POST/GET' requests ratio for each IP   2. It calculates the ratio of unique URLs and total number of hits (sparsity) by each IP Based on the above two parameters, we try to block any IP showing unusual behaviour, but these two parameters alone have not been sufficient for bot detection. Thus I would like to know:   1. Are there any other parameters which can be included to improve the detection?   2. I found a paper published in ACM library which follows the Bayesian approach to detect a crawler. Has anyone used this? How effective is this?   3. Stack Overflow and other high traffic sites have such kind of systems deployed, what logic do they follow to keep unwanted spammers/crawlers away in real time?


title: Implications of handles between forms

text: I was developing a WindowsForm application in C#, with 2 forms. Regardless of what they both did specifically I needed to access values in `form2` and send them to `form1` and vice versa. For this to happen I found someone talking about constructor overload and it worked for me as I explain in the code. Form1:               namespace miniDldMngr     {         public partial class Main : Form         {             miniDldMngr.SettingsForm settingsForm; //Instantiate settingsForm                  private void settingsToolStripButton_Click(object sender, EventArgs e)             {                 settingsForm = new miniDldMngr.SettingsForm(this); //Create handle for Form1                 settingsForm.ShowDialog(); //Form properties were changed to act like a dialog             }      Form2:               namespace miniDldMngr     {         public partial class SettingsForm : Form         {             private Main HandleToForm1; //local variable to store handle to Form1                  public SettingsForm()             {                 InitializeComponent();             }                  public SettingsForm(Main frm1Handle) //overloaded constructor with handle to Form1             {                 InitializeComponent();                 HandleToForm1 = frm1Handle;                 txtIni.Text = HandleToForm1.comboLoad.Text; //here's how i access controls on form1 for example, as long as modifiers are public             }      I came across this answer on Stack Overflow and user codesparkle commented: > It's neither scalable nor OOP-like. Which lead me to believe that it might not have been the best choice to solve my initial issue. (S)He further added: > One approach is to create an event in the class that knows the information > which needs to be shown. The form can then register one of its methods as an > event handler. Once the information becomes available, the class notifies > the Form by calling that handler with an argument containing the displayable > information. The beauty of this approach is that the class is decoupled (not > dependent on) the implementation of Form. The MVC and MVVM design patterns > are other robust ways of doing it. Now I'm left with some questions:   1. What are the implications of the procedure I used?   2. Why isn't it an object-oriented approach?   3. What would be the best practice to send information back and forth between classes/forms?   4. How would you go about creating the event mentioned by codesparkle?   5. I don't know anything about MVC or MVVM design patterns, so some links to a structured explanation would be appreciated. Please consider that I'm very new to programming and I won't understand you if you talk like I know what I am doing. Code examples work wonders with me, since I can test them.


title: How to handle a vendor who asks for the solution of an issue they could not solve

text: Being a small department of developers, it's not uncommon for us to outsource projects. We have a set of companies that we really like to work with, very reliable and good local people who appreciate the work. This has happened a couple times, most recently today: **We receive a project, set it up in our environment, and notice an issue. Due to them not being able to provide a solution in time, we're forced to find a solve internally. Then the vendor, who we pay very well, will sometimes ask how we solved the problem.** Again, this is a rarity, and we have a great relationship with these guys, but I do have some inkling that I should not be handing out the answers to a resource which we're paying. How should I handle this? Do I set aside my ego and just say "Thanks for doing a great job, here's your $30k and we finished the project for you by doing this one thing your company was unable to do but now can charge us more to do next time"? Is it appropriate to tell them I can't give them "company" code/etc? Would this tarnish our relationship?


title: Does SCRUM lend itself to multi-project environments?

text: I will be moving workplace in the near future and I believe they will be very interested in my experience of Scrum and how it may relate to their business. I am trying to understand if it will work in their environment. My current place of work we have a 2 products/2 backlogs/2 separate teams. These backlogs are obviously prioritised based on what the business thinks it most needs for a platform that we develop. The place I will be moving to however has many projects on the go all at the same time with (2/3 individuals working on each), small bits of work come in and are fixed on a daily basis and I imagine all the customer deliverables are roughly equally as important. So I'm wondering if anyone has experience of Scrum in a similar environment, what real examples have you got of things that worked? What didn't work? What considerations need to there for Scrum to work in this situation? There are a few aspects that I'm not sure how would work out well:   1. I believe people in teams will work across projects, and therefore potentially across scrum teams if broken down.   2. How do you go about handling priority on so many moving parts which are probably changing frequently and have their own timescales?   3. If you have a scrum team that works on several projects (some many only require 1 Dev) then how do you understand the context of the stand-up?


title: Writing my own voice recognition code

text: **Problem Description** I am wanting to use voice recognition as part of a hardware project, which I would like to be completely self containing (I'm using small low power, low speed devices such as Arduino's and Raspberry Pi's, Kinects etc, no running traditional computer with an OS is involved. So a closed / self containing project). Voice recognition can be very complicated depending on the level of sophistication you desire. I have what I believe a comparatively simple set of requirements. I only want to recognise my own voice, and I have a small dictionary of 20 or so words I'd like to recognise. Thus I don't require complex speech-to-text and voice recognition libraries or any of the excellent 3rd party software I find via Internet search engines (there is no shortage of these!). I believe my requirements are "simple enough" (within reason) that I can code my own solution. **I am wondering if anyone has written their own process like this, and is my method is massively flawed? Is there a better way to do this without requiring a high level of mathematics or having to write a complex algorithm?** That is the solution I have tried to think up below. **Solution Description** I will be writing this in C but I wish to discuss a language agnostic process, focussing on the process its self. So lets ignore that if we can. **1 .** I will pre-record my dictionary of words to match those being spoken. We can imagine I have 20 recordings of my 20 different words, or perhaps short phrases or sentences of two or three words. I believe this makes the process of comparing two recording files easier than actually converting the audio to text and comparing two strings. **2 .** A microphone is connected to my hardware device running my code. [1]. The code is continuously taking fixed length samples, say 10msec in length for example, and storing 10 consecutive samples for example, in a circular logging style. [2]. (I'm inventing these figures off the top of my head so they are only examples to describe the process). _[1] This would likely be connected through a band-pass filter and op-amp, as would the dictionary recordings be made, to keep the stored and collected audio samples smaller._ _[2] I'm not sure exactly how I will take a sample, I need to work out a method though were I produce a numerical figure (integer/float/double) that represents the audio of a 10msec sample (perhaps a CRC value or MD5 sum etc of the audio sample), or a stream of figures (a stream of audio readings of frequencies perhaps). Ultimately a "sample" will be a numerical figure or figures. This part is going to be much more hardware involved so not really for discussion here._ **3 .** The code looks at it's stored 10 consecutive samples and looks for a volume increase to indicate a word or phrase is being said (a break from silence) and then increases is consecutive sample collecting to say 500 samples for example. That would mean it captures 5 seconds of audio in 10 msec samples. It is these samples or "slices" that are compared between the stored sound and captured sound. If a high enough percentage of samples captured matched the equivalent stored ones, the code assumes its the same word.               The start of a store recording of the world "hello" for example,     stored words are split into 10 msec samples also          Stored Sample No           | 1| 2| 3| 4| 5| 6| 7|  8|     Stored Sample Value        |27|38|41|16|59|77|200|78|          Incoming audio (me saying "hello") with some "blank" samples     at the start to symbolise silence          Incoming Sample No         | 1| 2| 3| 4| 5| 6| 7| 8| 9|10| 11|12|     Incoming Sample Value      |  |  |  |20|27|38|46|16|59|77|200|78|      **4 .** Once the code has collected a full sample stream, it then chops off the blanks samples at the start to produce the following audio recording. It could also move the sample set backwards and forwards a few places to better align with the stored sample. This produces a sample set like the below:               Stored Sample No           | 1| 2| 3| 4| 5| 6|  7| 8|     Stored Sample Value        |27|38|41|16|59|77|200|78|          Incoming Sample No      |-1| 1| 2| 3| 4| 5| 6|  7| 8|     Incoming Sample Value   |20|27|38|46|16|59|81|201|78|      **5 .** I believe that by having a percentage value for how close each sample must be, so sample 7 differs by a value of 1 which is less than %1, and a percentage value for the total number of samples which must be within their sample matching percentage, the code has an easily tunable level of accuracy. I have never done anything like this with audio before, it could be a lot of work. This is why I am asking this question, if you perhaps already know the answer to this question to be obvious (what ever that answer may be). I am hoping this won't be a computationally massive tasks as some of the hardware I will be using will be low sec stuff. In the hundreds of Megahertz (Maybe 1Ghz using an over-clocked Rasp Pi). So this is a rather crude way to match audio samples using lower computational power. I'm not aiming for instant results, but less than 30 seconds for a decent proof of concept. **PS** I don't have the rep to tag this with a new tag like "audio", "audio recognition", "voice", "voice recognition" etc.


title: Handling or preventing conflicts in a multi-user system

text: I have a web application that is accessed by multiple users from different locations worldwide. Let's say I have an "edit" form for a specific document and two (or more) users are editing the document at the same time. I know that both of the users can edit the document and submit it, but user1 will not see that user2 made changes to the document and might submit an older version of it. I was thinking about adding some kind of a lock, but then, if user1 only opened the document for edit, but never changed anything (and kept it open) user2 will never be able to edit it. Therefore, I was thinking to add a Timeout for the editor, but then user1 might time out before he finished doing his changes to the document (let's say, went out for launch). The question is, how would one prevent the document from being edited from one user while the other changes it? Note: if this question does not belong here, please explain why and where could I ask such a question.


title: Status update & news feed database design / architecture

text: Imagine a application similar to Facebook, where you have status updates and a news feed. The names and profile pictures can be changed. There are also several different types of updates requiring a different layout template for each type. I hate my implementation and would like some feedback on how to improve it. When I store the status update in the database, I basically store the HTML template in the database with some of the update specific information in it as well. Since the profile pic and poster name can change, I'm keeping placeholders in the HTML stored in the database like '{USER_PROFILE_PIC}' and replacing that with the most current value when the record is pulled & displayed. I hate doing it this way because if we want to do a design change down the road, we are stuck with this HTML in the database. I'm doing this all in SQL Server. I'm open to other databases if needed, I just am looking for a good way to pull dynamic status updates from a database and display them with up to the moment info. TIA


title: Feature boundaries in functional programming

text: I very much enjoy the functional programming paradigm, but I am still not sure how to go about designing a small/medium project with it. When using OO, I have a set of labelled entities (classes) with clearly defined boundaries. I can reason about stuff like:   * what is this class doing?   * should I put this code _inside_ or _outside_ a class?   * should I split this class in two?   * how would a client like to use this class? So one big benefit of classes is that they provide **boundaries** for a piece of functionality. I find that this helps a lot when designing an application. In functional programming, everything seems to be about composing and abstracting functions and data structures. Type classes in haskell are mainly there to offer polymorphism. Same for prototypes in clojure. When designing an application written in a functional style, what is a good "unit of feature" one can define, label, and reason about?


title: Is There Any Benefit To Participating On Sites Like TopCoder And Or GoogleCode?

text: Apart from the obvious reasons, like financial, employment and recognition, what are the practical/real benefits to using programming competition sites? It seems quite algorithmic and maths heavy, but how does that map to something practical, in your everyday programming?


title: Is it possible to represent mutation of object-graph efficiently with immutable states?

text: I am practicing using of immutable object in C++. My personal goal is representing generic object graph (in heap) with sequence of immutable graphs. Building the multi-version graph itself isn't that much hard. The problem is performance. Brute-force versioning needs full copy of graph, and this was not acceptable. I tried to share unchanged nodes. But in this case, I got a new problem; references. Reference to other object must be updated in whole graph. This needs visiting all nodes for each time I derive a new graph version. And this mutates the nodes with references, so they also should be derived (by copying). Performance won't be better much than brute-force copying. As far as I can imagine, there's no real efficient way to represent mutation of object graph with immutable states. So I am asking for some idea on this. Is it possible to represent mutation of object graph efficiently with immutable state?


title: Reverse engineering: what is it really good for?

text: I have some innocent/beginner questions:   * What is reverse engineering good for?   * As a programmer, should I learn the art of reverse engineering?   * What are the benefits to a programmer who is experienced with it?


title: DAO Design with Child Objects

text: If I have objects that represent a hierarchy of relationships. For example: Person     Spouse       Spouse Contact       Spouse Address     Person Contact     Person Address Each of the items listed has a database table related to an object. Each object/table has an ID, Parent ID (Spouse ID for Spouse Address records) and Base ID (Person in the example). Given that hierarchies can be arbitrarily deep and wide, how would you design the objects and data access layer?


title: Solution with multiple projects and (GitHub) single issue tracker and repository

text: I have a Visual Studio solution with multiple projects:   * `Acme.Core`   * `Acme.Core.Tests`   * `Acme.UI.MvcSite1`   * `Acme.UI.MvcSite2`   * `Acme.UI.WinformsApp1`   * `Acme.UI.WinformsApp2`   * ... The entire solution is checked-in in a single GitHub (private) repo. `Acme.Core` contains our business logic and all `UI` projects are deployables. UI projects have different requirements and features, but some of them are implemented in more than one project. All issues are opened in a single issue tracker and classified using labels (`[MvcSite1]`, `[WinformsApp1]`, etc) but I'm thinking it's starting to get messy. Is it ok to use a single repository and issue tracker to track multiple projects in one solution?


How are effort estimations and duration estimations distinct? At present my understanding is that effort is related to the amount of work required for one person to complete a task, and duration is the total amount of time required to complete the task, irrespective of resources. Is this the commonly accepted definition?


title: How do the Application and Database Interface Layers interact at their boundary?

text: I was watching one of Uncle Bob's videos and he brought up the Database Interface Layer. He had this diagram showing it: ![High level view](http://i.stack.imgur.com/TKb0b.png) These arrows show that the DB Interface Layer is aware of and calls the Application and Database layer, but not vice versa. The DB Interface Layer has "data records" in it. These are "classes" that have the name of the table and the fields of the columns. These are what I usually call DTOs. But these data records have all public fields and no/few methods. The DB Interface layer is responsible for grabbing the data from the database, populating the "data records" and implementing an interface in the Application Layer like so: ![Picture of the boundry](http://i.stack.imgur.com/PxFzN.png) I'm a little confused because I've never heard about this separation before. Every project I've worked on uses the DTOs in the view which is apparently wrong (at least according to Uncle Bob's video). Also, I've never worked on a project where the DB Interface Layer calls the Application Layer. It's always the Application layer asking the DB Interface Layer for information. For example, by using a DAO. But this is starting to make sense. Whenever I use hibernate I'm always pulling my hair out because I try to make the DTOs more OO and the library always fights me. So, I guess what I'm trying to ask is, what does the code look like on/at the boundary between the Application and the Database Interface Layer? For example, how does the Application get the implementation of the Order Gateway Implementation? Is the Order Gateway Implementation a DAO? I don't have a clear picture of how the POS can use the Order Gateway vs how/when the Order Gateway gets populated with data.


title: whole project of consuming web services with php

text: We are in the middle of a strange situation. We and a partner firm have to put up a web portal. They have a lot of functionality already done on their other portal and we are the managing firm on the project. But there are also some new development needed on their side which is designed by us. Strange thing is, we are going to do the GUI on the project and they will provide us some web services to gather data. They are using .NET and we will be using PHP for the frontend project. So what do you think that the best approach is to avoid communication and integration problems? For example   1. We provide them with just the view files and they do the rest all by themselves?   2. We develop a PHP project where we gather the required data using SOAP/REST web services?  Thanks in advance guys.


title: Is this a correct way to use nested classes to keep track of data?

text: I have some instruments. Each instrument should have a name (string) and description (string). Each instrument can have some setups, which these setups are each a series of commands(string[] or List). I want this class to be flexible so I can easily add or remove a whole instrument, or add or remove setups for any instrument that is existing in the class. At the end, I want to save this class in properties of my assembly so each time the program starts it can be loaded. I am also thinking about serializing it and save it on disk for moving to another copy of the software. So please let me know what you think about this approach and if you think this can be improved or even I should consider going with another way please let me know!               namespace MeasurementSuite     {         /// <summary>         /// Setups for all instruments         /// </summary>         public class Setups         {             /// <summary>             /// An instrument             /// </summary>             public class Instrument             {                 /// <summary>                 /// Name of the instrument                 /// </summary>                 public string Name { get; set; }                 /// <summary>                 /// Info about the instrument                 /// </summary>                 public string Info { get; set; }                 /// <summary>                 /// List of existing setups                 /// </summary>                 public List<Setup> SetupList { get; set; }                      /// <summary>                 /// Adds a setup to the instrument                 /// </summary>                 /// <param name="name"></param>                 /// <param name="commands"></param>                 private void AddSetup(string name, string[] commands)                 {                     this.SetupList.Add(new Setup(name, commands));                 }                      /// <summary>                 /// Removes a setup from the instrument                 /// </summary>                 /// <param name="name">Name of the setup</param>                 public void RemoveSetup(string name)                 {                     foreach (Setup setup in SetupList)                     {                         if (setup.Name == name)                         {                             SetupList.Remove(setup);                         }                     }                 }                     }                  /// <summary>             /// Setup for a instrument             /// </summary>             public class Setup             {                 /// <summary>                 /// Name of the setup                 /// </summary>                 public string Name { get; set; }                 /// <summary>                 /// Command sets for setup                 /// </summary>                 public string[] CommandSet { get; set; }                      /// <summary>                 /// Constructor                 /// </summary>                 /// <param name="name">Setup Name</param>                 /// <param name="commands">Setup Command sets</param>                 public Setup(string name, string[] commands)                 {                     this.Name = name;                     this.CommandSet = commands;                 }             }          }     }


title: Is it practical to abandon STL in C++ development?

text: I know in some areas (game industry, for example), STL is not recommended. So my question is: is it really a good practice not to use STL in some cases? If so, what's the biggest reasons of not using the modern C++'s STL?