title: How much math do you learn in computer science?

text: How much do you need to know for computer science? When you get out of a PhD program in computer science at most schools how much math do you come out knowing? I'm guessing beyong the high school precalc stuff, you have to know what's called discrete math that there's usually one course for at most schools and it covers all the concepts required for compiuter science (combinatorics, probability & statistics, number theory, proofs, formal languages, etc.) And I'm guessing you need to know linear algebra, and calculus (both single and multivariable). I don't think you need to know differential equations, abstract algebra, higher analysis, non-euclidean geometry, and stuff like that - typically, a math major learns those.


title: I'm so jealous of middle-aged developers. Are we unlucky?

text: First of all, I couldn't decide the right words for title after reading How old is "too old"? question. I still can't decide with old, middle-aged, expert or professional. As you know, there are a lot of developers over 35-40 years old in StackExchange. They are helping to beginners and having less experience people. They are so valuable users. And mostly, their some answers are awesome becauase of good analyzing and adding their experience to answers. When I see this kind of users, they all started programming with kind of Lisp, Pascal, Cobol or Basic type programming language. These are the first modern programming languages. And I think these people are so lucky learning programming with them first because of they are close to machine language. Maybe they learn the basics of programming better. Now it looks they are working easly with object orianted programming. I'm graduated from computer engineering a year ago . First year, we superficial learned C programming language. Second year, there are C# and Java course. But when I try to learn this languages in colluage, I always feel like I missed something. Learning languages, structures, libraries.. if fine but teachers never teach us "How the codes working in machine?". They teach us the programming language which is popular in software market. So kind of they prepare us for companies. They think If we learn assembly or fortran, we can't easly find a job according to Java or C#. Unfortunately, at these days, this is kind of true. Could be better learning first Assembly, Fortran, Cobol instead of Java and C#? Are we unlucky?


title: How to prevent my executable being treated from AV like bad or virus?

text: I'm creating a piece of software, that will run on windows and will act like launcher for the game, to serve as an auto-updater and file verifier in client siede PC. One thing I don't understand, why my antivirus software (Avast) is considering my exe file as dangerous and won't start it without asking to put it into sandbox, for safe use. Is there any rules that my software should obey, to be treated as good, or should I pay hundreds of dollars for some sort of digital signing and other stuff? I'm using C# with MS Visual Studio 2010. VirusTotal report. No DLL injections, working as remote file downloader, using WebClient() class. It is not like it warns about virus, but it "suggests" to sandbox it. Look at screenshot:![enter image description here](http://i.stack.imgur.com/Cp85Z.png)


title: Application architecture for subscriber based system

text: I am planning on building a system where users "subscribe" to "records". Records are updated on a schedule, several times a day. When records are updated, the user should be notified that these records have been added/updated. I don't want each user to have their own copy of the records due to storage space and the overhead of inserting many records, one for each subscriber, each time the schedule runs. However, each user will need to add metadata against each record they are subscribed to. Such as notes and flags that the record has been read etc. Can anyone give me any advice or how to structure such a system or where I can learn more about this sort of application architecture? Is this the correct place to ask? At the moment, I'm not even sure what to Google for ;)


title: How to manage my private key for signing .NET assemblies?

text: I write open source .NET class libraries as a hobby and thought about signing them. I can get Visual Studio to generate me a password protected public/private key pair and save it as a .pfx file, but I don't think I should do this for _each and every_ project. One key pair should be enough, right? Obviously I'm not going to put my .pfx file with the source code in my online public repository: only the assemblies I release should be signed with my key pair. Other people can use their own keys if they want. So I'm left with some .pfx file that supposedly contains my public/private key pair.   * How do I manage my key pair effectively?   * Where do I store it?   * Do I have to import it somewhere?   * How can I use it on both my PC and my laptop?   * How do I prevent the key pair hell when switching from PC to laptop?


title: Is wikipedia a valuable resource for studying data structures? (can we call it complete?)

text: Can I depend on wikipedia to learn data structures fully using the list of data structures http://en.wikipedia.org/wiki/List_of_data_structures and the links they refer to? The same question for algorithms http://en.wikipedia.org/wiki/List_of_algorithm_general_topics ?... What's after learning algorithms and data structures? Specializing in a certain field of algorithms such as computer graohics, memory management...etc? or what could be the plan for mastering programming after knowing the language syntax and the background about program design and programming logic? I asked about wikipedia because i would like to find a complete resource or are least a resource which would be enough for the field of data structures instead of searching for separate articles in different places in other words an alternative to books which may even be more complete.


title: Semi-securely storing data in a remote key-value store, ensuring minimal data corruption/tampering

text: I'm bashing around a few ideas for storing usage data (similar to google analytics) for some Javascript products that we are working on. Unfortunately as yet we don't quite know 100% what data we want to store and only have a basic idea of the metrics we want to glean from it. My thinking is that basically we want to store a set of key-value pairs grouped by a unique instance_id (there may well be flaws in this logic:)). With that in mind I knocked up a (very) quick prototype in monkrb, the grand total of which is below:                 get "/store" do         key = params[:key]         value = params[:value]         instance_id = params[:instance_id]         Ohm.redis.hset instance_id, key, value       end      While this should work, I'm somewhat worried that an inquiring mind could easily pollute our data with random sets and key-values, doubled by the fact that this is all going to be called in Javascript so anything we do to secure or encrypt it is going to be pretty transparent to anyone who cares to view source. A lot of it should be easily filtered out, as come reporting time we'll have an idea which keys we are interested in (and know which ones we've created) so we can just junk any sets that contain keys which we know nothing about (though again there's the risk that additional keys have been added to an otherwise valid set..) Following down this path here are my questions:   1. What steps can I take to make it as hard as possible to add completely false data? (handshaking, obfuscation, signing, etc)    2. What can I do to try and detect any junk data? (bonus for a rough idea of how to implement too)   3. What sort of checks should I have in place to stop an existing instance_id being guessed and messed about with? (so any historical data can't get polluted) It should be noticed that this is mostly academic at the present stage, as I know 6 lines of ruby does not an application make, I'm just interested in the scenario and would like to hear others approaches and thoughts on where one could go with this.


title: Storing 'sensitive' data in settings file

text: I'm writing a small utility in AutoIt that connects to Twitter. I would like to store the username and password in the programs setting file, but I know that it needs to be encrypted obviously. Previously when I've done this for personal use I've just adopted an `ini`format - written to a temporary file and then encrypted it using a rediculously long password and 256 bit AES encryption, just calling the file "settings.eini". However, I'm going to be offering this utility to the public. I don't expect a large amount of people to use it or for it to become a target, but I thought that it's best not to take chances. I've been reading about creating custom file extensions and it seems like something I want to avoid for now, so is there a standard/acceptable way of doing this?


title: Why isn't the ‘format’ method more widely used in Python?

text: I'm probably missing something here, after searching I couldn't find an answer. I've explored quite a few Python projects and one thing I keep noticing is the fact that the majority of them continue to use the **`%`** operator for formatting strings rather than the newer, recommended **`.format()`** method. Is there a reason for this? it seems like a trivial change, unless I'm missing something entirely. For example:               # count how many times the % operator technique is used     find . -name "*.py" -exec grep -HE "\"[^\"]+\"\s\%\s\w+|'[^']+'\s\%\s\w+" {} \; | wc -l          # and the same for format()     find . -name "*.py" -exec grep -HE "\w+\.format\(" {} \; | wc -l          # Results:     #     #               % operator        format()     # iPython          670               63     # Django           977               8     # Tornado          91                0     # requests         25                1      No real reason for this question, just curious. Cheers guys!


title: What is the advantage of choosing ASCII encoding over UTF-8?

text: All characters in ASCII can be encoded using UTF-8 without an increase in storage (both requires a byte of storage). UTF-8 has the added benefit of character support beyond "ASCII-characters". If that's the case, why will we _ever_ choose ASCII encoding over UTF-8? Is there a use-case when we will choose ASCII instead of UTF-8?


title: What would be the optimal way to solve a problem like this?

text: I have a problem where I have to change all the Xs in a 2D array into 0s, and I have to calculate the minimum steps (where a single step consists of changing an entire row or column) required to do so. For example, in an array like-               [[X, X, X],          [X, 0, 0],          [X, 0, 0]]      The minimum number of steps required here is 2. I thought of a brute force approach (where I am checking row-wise once and column-wise thence and then comparing them to check which takes minimum number of steps) but that would give me an answer of 3, which is not the desired output. Any help, or clue, regarding how I should approach this problem would be appreciated, thanks!


title: History of vendor css prefix

text: When and how did this process of prefixing css with vendor specific prefix begin. Which browser/org start this and why was this started. I searched the web but found no details on this.


title: Whats the logic behind making ViewBag a dynamic object in ASP.NET MVC 3

text: Last time I checked C# was loved by many because it's a statically typed language but the introduction of ViewBag in ASP.NET MVC 3 brings the same problem that is there with strings: in a controller you type one thing and in the view you can by mistake type something else. What's the reason for making ViewBag dynamic? How is it better?


title: Searching integer sequences

text: I have a fairly complex search problem that I've managed to reduce to the following description. I've been googling but haven't been able to find an algorithm that seems to fit my problem cleanly. In particular the need to skip arbitrary integers. Maybe someone here can point me to something? Take a sequence of integers A, for example (1 2 3 4) Take various sequences of integers and test if any of them match A such that.   1. A contains all of the integers in the tested sequence    2. The ordering of the integers in the tested sequence are the same in A   3. We don't care about any integers in A that are not in the test sequence   4. We want all matching test sequences, not just the first. An example               A = (1 2 3 4)     B = (1 3)     C = (1 3 4)     D = (3 1)     E = (1 2 5)      B matches A C matches A D does not match A as the ordering is different E does not match A as it contains an integer not in A I hope that this explanation is clear enough. The best I've managed to do is to contruct a tree of the test sequences and iterate over A. The need to be able to skip integers leads to a lot of unsuccessful search paths. Thanks Reading some suggestions I feel that I have to clarify a couple of points that I left too vague.   1. Repeated numbers are allowed, in fact this is quite important as it allows a single test sequence to match A is multiple ways A = (1234356), B = (236), matches could be either -23---6 or -2--3-6   2. I expect there to be a very large number of test sequences, in the thousands at least and sequence A will tend to have a max length of maybe 20. Thus simply trying to match each test sequence one by one by iterating becomes extremely inefficient. Sorry if this wasn't clear.


title: How much should I pay to Microsoft when I am selling a desktop & Web base software built on VB.NET using MS SQL 2005 Express Edition?

text: Can I distribute the MS SQL 2005 Express edition along with my application to the customer?


title: Why are some files in programming projects named "commons"?

text: I have seen numerous projects have a file named `commons` for example:               commomns.go      I was wondering, why was this convention adopted and what did the meaning of naming a file or a package or something as commons?


title: How do I dissuade users from using the same password with similar systems?

text: I'm building a web application that connects to other web services (using strictly anonymous binding, so no user passwords are being used). However the web application maintains its own users itself, and is required to ask certain details such as e-mail addresses and public linking information to these other web services (for example, a username but not a password). I want to deter or prevent users from reusing passwords in my application that they have also used in the applications I'm linking to. For example, if I ask for their e-mail and provide me with their gmail address, I don't want them using their gmail password for my system. Another example would be reusing a password to a linked system in which they also gave me their username. One idea I had was to simply try using the information they gave me, along with the password they are trying to store and log in to these external web applications to test the password - then immediately unbind if I was successful and ask the user to use a different password. However I suspect there is a host of morale and legal issues there. The reason this is a big deal to me is accountability. My application is simply not funded enough to invest properly in security around user passwords. A salted, hashed password in a public SQL-like database is as secure as it gets. So if passwords and linked usernames or e-mails get out, I don't want my userbase compromised.


title: Writing/discussions about the aesthetics of code?

text: I'm looking for considerations of the questions "Can code be beautiful?" and "What makes code beautiful?" Examples would include:   * This academic paper: Obfuscation, Weird Languages, and Code Aesthetics   * This blog post: Hamon or the Skin Deep Beauty of Code Please note that I'm not trying to start a discussion here, or asking for opinions about what makes code beautiful, or for code you think is beautiful; I'm trying to find stuff that has already been published. Thanks for your help.


title: Does professionalism in job postings matter?

text: I came across this job posting: http://www.justin.tv/jobs/jobs. The page contains some bad language ("No bulls--t"). I personally find this vaguely offensive, and it would certainly put me off applying to work there: It made me wonder what kind/personality of people work at this company. At least where I'm from (EU), the language would be considered bad form, and it would be seen as badly representing the company. Some job postings seem to go to the other extreme, filled with vacuous people skill descriptions and irrelevant details. It's tempting to dream up pictures of each company based on their job posting. So, does professionalism in job postings matter? Are you inclined to see through bad language, irrelevant corporate speak and so on, or do these affect interest in a job?


title: Document Versioning

text: I have been tasked by my boss to look at a system where we create Python scripts and upload them to a server and store details in the DB. He also wants me to implement versioning, so that if any changes are made to a script then the updated version has an incremented version number. This is the area where I am not so sure about. How would you go about implementing a versioning tool? Is it simply a case of incrementing a field in the Database with the new version number? Or is it more complex than what it initially seems?


title: How to explain why multi-threading is difficult

text: I am a fairly good programmer, my boss is also a fairly good programmer. Though he seems to underestimate some tasks such as multi-threading and how difficult it can be (I find it very difficult for anything more than running a few threads, waiting for all to finish, then return results). The moment you start having to worry about deadlocks and race conditions, I find it very difficult, but the boss doesn't seem to appreciate this - I don't think he has ever come across this. Just slap a lock on it is pretty much the attitude. So how can I introduce him, or explain why he might be underestimating the complexities of concurrency, parallelism, and multi-threading? Or maybe I am wrong? Edit: Just a bit on what he has done - loop through a list, for each item in that list create a thread that executes a database update command based on the information in that item. I'm not sure how he controlled how many threads executed at once, I guess he must have added them to a queue if there were too many running (he wouldn't have used a semaphore).


title: Storing different algorithms and using them for demonstration

text: I have an app for creating simple graphs (the kind with vertices and edges) and then using different algorithms on them (BFS, DFS, topsort, Prim's etc) for demonstrating how they work. I'm now working on porting it into a Rails app and deploying so it can be used by my university (hopefully). Currently the graphs are stored in a SQLite db and I am planning to do some D3 magic on them. Then to the real problem, how should I implement and store the algorithms? I want to be able to "step" through the algorithm, showing step by step how it works on the graph. In my previous implementation, written in Java, I had an abstract Algorithm class with abstract methods like init, step and reset. But, now that we are out of the Java world and using wonderful Ruby, I have a feeling that there's a really clever and elegant way achieving the same. I am planning to pack it into a Rails engine, just for kicks. Here is the mentioned Java implementation: https://github.com/7SLEVIN/visualgraphalgs


title: Dataset with coordinates of borders of countries

text: I am creating an application that visually displays world regions, e.g. to place markers within an administrative region. Does a dataset exist with geometrical or geographical (long/lat) descriptions of the world's current country borders (and possibly other administrative divisions)? Ideally the dataset would be in a format that I could easily generate border images of the size that I require.


title: Is it possible to use the Intel C/C++ compiler on Linux to create object files to be linked on Windows?

text: **Why?** Depending on your source the Intel compiler is likely or most definitely the compiler generating the fastest executables for the x86 architecture (5 to 100 % execution time improvement). Intel offers its compilers for Linux under a non-commercial license for free (I think I read it is free somewhere on their page: Intel - Non-Commercial Software Development). There is also a free non-commercial license for students, but this license is not applicable although tools are offered for all three major operating systems (link dropped due to reputation restriction). **Goal** I (as a non-student) would like to be able to use the Intel compilers for possible execution speed improvements under the non-commercial license to compile object files that can be linked to create executables and dynamic link libraries for Windows (and possibly OS X) **More Details:** What I inferred from this document is that the Intel compilers create object files that are compatible to the dominant compilers of the platform. **Sub-questions:**   1. What are the object file formats of gcc, g++, cl, mingw32, icc, icpc, and icl on Windows and Linux (current versions)?   2. _Could parts of the mingw32 cross-compiler toolchain be used to accomplish the goal?_   3. Am I right that the metadata in the generated object files is the main issue? ad 2:   mingw32-objcopy seems to be able to convert the Intel compiler output on Linux (presumably ELF) to Microsoft-compatible COFF (with the possible exception of relocateable object files). Could someone confirm that this actually works (for non-trivial applications), please?


title: What is the best way to build a static page web site from a JSON API?

text: I have a JSON API that includes some discusssions. I want to build a static html site on another server, pages that are built from data on that API. I am more comfortable using Rails than Node. The API is done in Node. The idea is that I periodically call the JSON api to get the data, and dynamically build the html pages on the Rails server. This way the web pages would be super fast, wouldn't have to call the JSON API. One technology that looks like it would do the job is http://middlemanapp.com/, but I haven't used it before. Anybody done this before and have any suggestions? My preference is to use Rails, and Heroku.


title: How does one become a big contributor to an opensource project?

text: I know that the default advice for open source projects, and getting started, is to start fixing bugs. But I have a feeling that its the path that one would want to take if they wanted to be a tester/fixer of bugs in the project. How does one become an active contributor of an opensource project? [I.e. on the level of architecture]


title: How does one write a book on a new framework?

text: How are authors able to write a book on a framework that is just released? A framework like spring is updated, and a book is released in the next day. Is this typically by people who are direct contributors? Are they basing it off of beta/alpha versions? I find this rather difficult to understand as that documentation is rarely up to snuff by the time the framework is updated.


title: Rails - Does using partials slow views rendering?

text: I'm having performance issues on a Rails `3.1.0` application, now I've done dome changes on my queries with AR and so but views still takes too many time to render, I've divided the views, loops and so, on many partials that are rendered dynamically inside views and inside other partials. So it's a bad practice to have a large number of partials? Should I reduce the number of partials to improve the views rendering time? Thanks


title: Is there something wrong with how we're doing version control?

text: I work with a team of programmers as the business analyst. We just released version 2.0 of our product and are working on the next version to be released in 3 months (it's an internal software product). Unfortunately version 2.0 has some issues that they have had to fix and we're going to deploy those fixes in a couple weeks. The problem is that we also don't want to deploy the changes that are still being worked on and are not slated to be released for another 3 months. The programmers decided that the way to manage this was that only the code for the defects will be checked in, and the code for the new enhancements will be kept on the developer's local machines until they are done. I will have to get local builds from their machines to test because if they check in the code and we have to push out another patch to fix defects we don't want to include those enhancements just yet. There is also the problem where the same code file contains both defect fixes and enhancements, so they have to copy the code file locally, then make a change to fix a bug and check that one in, then resume work on the enhancements by taking the local copy they made. It seems quite convoluted - is there a better way to handle this type of scenario? We're using Team Foundation Server and Visual Studio 2010.


title: Is there a technical reason why you can't develop iOS apps on a Linux computer?

text: I understand why you can't develop OS X apps on a Linux computer, but is there a good technical reason why you can't develop iPhone and iPad apps on Linux? Why isn't it possible to compile iOS source code into an iOS executable and run it in an iOS simulator on Linux or install it on a development iOS device? Is it just because the XCode IDE is a Cocoa application? You can develop Android apps on any kind of platform, it seems. I don't see why the same can't be true of iOS.


title: AGPL Question about Linking and Derivative Works

text: I'm thinking of selling a collection of Django apps I've written which provide the basic functionality of a Facebook game, but I'm also thinking of releasing it under a GNU Affero GPL. I read the Affero GPL, and the extra clause specified that modified versions of a covered work have to be distributed under the same license. What I'm wondering is, do derivative works have to be distributed under the GNU Affero License, even if they don't modify the original? The scenario is someone could use my project and add a few features of their own contained in separate Django apps; would those new apps they've written which depend on my software have to be released under an Affero license as well?


title: Is it a good idea to read compiler source code?

text: I'm a junior in college majoring in Computer Science. Apart from writing lots of code, I want to start reading source code written by others to improve my coding skills and learn better/different ways of doing stuff. I was thinking I should start reading some of the key parts of the code in C++ compilers. I think this would help me do two things:   * Learn elegant coding practices because compilers are hard and the code represents solutions to this hard problem.   * This would also help me learn about how my most used language is compiled, the details, how each error is generated, how code is parsed, and become really good with the specifications of the language. Do you think this is a good idea?


title: Do most programmers copy and paste code?

text: I learned very early on that cutting & pasting somebody else's code takes longer in the long run that writing it yourself. In my opinion unless you really understand it, cut & paste code will probably have issues which will be a nightmare to resolve. Don't get me wrong, I mean finding other peoples code and learning from it is essential, but we don't just paste it into our app. We _rewrite_ the _concepts_ into our app. But I'm constantly hearing about people who cut & paste, and they talk about it like it's common practice. I also see comments by others which indicate it's common practice. So, do most programmers cut & paste code?


title: How can I send data without POSTFIELDS in PHP curl?

text: I'm using a REST API through PHP and I'm a bit confused on the CURL_POSTFIELDS behavior, which implies that I must send a querystring or array, but what I'm seeking to do is just to send a string of JSON text. In the API I'm using there is no such thing as a field: https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Edit+issues So, how can I just send data that doesn't get interpreted as a query string, and without having to use a file?


title: Lost Interest in Programming

text: I am a computer science student currently in my 2nd year of bachelors. My problem is pretty straight forward yet still so far has not been self- resolvable. It is simply is that I am tired of programming. I don't know why but it just happened. When I started my first course in c++ I was very excited. So excited that I finished two heavy c++ books within 2 months and was way ahead of my class and my own expectations. It was like I can easily develop algorithms and code them. I explored C++ a lot, > but for the past 2 semesters I am pretty much not into coding and I have > lost a great amount of interest or passion for it. I love programming as well my CS degree.But even with that i am not able to set things up. Kindly tell me what to do? I have started C# and XNA Game development on my own but still it's like I am pushing myself. Can anyone give give suggestions to wake up the coder inside of me?


title: Interviews: How far to go on DVCS experience?

text: I've been interviewing some potential interns for a project I'm working on. We use git, so I'm looking for someone familiar with DVCS (or SVN/CVS or a desire to learn). A response that threw me off was "I've worked with github" with no further information, so it forced me to consider what to expect from a programmer working with version control. I actually led a VCS conversion, so I got more intimately involved with Git/DVCS administration than I thought I ever would be, so I don't think it is fair to hold a student to that standard. My question is, what should a junior programmer be comfortable doing when working with a DVCS? Should it be simple adds, commits, merges, remotes, or would you expect something more? If you've been asked good questions in interviews, I'd appreciate them being shared. I don't really want to hire the developer that pushes a backwards merge! Edit: I really should have mentioned before this got rolling that our distribution model relies heavily on Git and our self-hosted repository (I'm a web developer), and that's why I feel it's important to know (at the very least) the consequences of serious actions like remote pushes; these actions triggers a few different processes in our environment. My fault! The answers have still been very helpful.


title: Why does Eclipse need to be restarted after installing a plugin?

text: As Eclipse uses OSGi to handle modules and bundles, and therefore should be able to hot-deploy them, why does it suggest to restart after installing a plugin "for changes to take effect"? Has Eclipse hit some OSGi limitation, or is its architecture such that even with hot-deploy, it cannot guarantee that deployments went smoothly and hence takes the safest route by offering a restart?


title: Isn't MVC anti OOP?

text: The main idea behind OOP is to unify data and behavior in a single entity - the object. In procedural programming there is data and separately algorithms modifying the data. In the Model-View-Controller pattern the data and the logic/algorithms are placed in distinct entities, the model and the controller respectively. In an equivalent OOP approach shouldn't the model and the controller be placed in the same logical entity?


title: Backbone.js app pulling large data sets with fetch()

text: I'm currently making some improvements for a client on a backbone.js app. The app is a web store and inventory management system. One thing that bothers me about this app (and other backbone.js apps I've encountered) is that it loads the entire collection of inventory items into memory from the server on every initial page load. After about a year and a half in production, this data set (not including image assets) is around 2.7 MB. So for every visitor to the web site, the javascript front-end pulls 2.7 MB data over the wire on initial page load. Of course this results in serious lag (around 8-12 seconds to load over most consumer-class broadband connections in my area). To me this load time is unacceptable. Of course once the data is loaded, the rest of the website is super snappy and responsive. Is loading an entire collection really the best-practice way of developing backbone.js apps? I'm trying to figure it out because the books and tutorials I've come across seem to teach this. Is there another pattern to follow? Trying to keep it backbone.js specific --- but how does one manage large datasets in this framework?


title: Where is the best place to get off my feet in Python programming?

text: I have tried to learn C++ and Java before, but the syntax confused me. I definitely will be learning them after, but for now, where is the best place for a guy who has programmed before to learn python? Do you concur with me learning Python? Should I stick with Java or C++ before?


title: Service layer vs DAO -- Why both?

text: I have been working with SpringMVC, Hibernate, and some databases in a java web application example. There are a few different ones that do this, but this Spring 3 and hibernate integration tutorial with example has a model class, view (in jsp), and a service and dao classes for the controller. My question is, don't both the service and DAO classes do the same thing? Why would you need them both? EDIT: This was the tutorial I was actually using (not that it matters) http://fruzenshtein.com/spring-mvc-security-mysql-hibernate/


title: Tracking feature requests for small-scale components

text: I'm curious how other development teams (especially those that work in moderate to large development groups) track "future" features/wishlists for functionality for internally developed frameworks or components. I know the standard advice is that a development team should find one good tool for tracking bugs/features and use that for everything and I agree with that if the future requests are for the product itself. In my company we have an engineering department, which is broken up into multiple groups and within each there can be one to several agile teams. The bug tracking product we use has been "a leader since 1997" (their UI/usability seems to also be evaluated against that year even today) but my agile team or even group doesn't really control what is being used by the whole department. What we are looking to track is not necessarily product features but expansion/nice to have functionality for internal components that go into our product. So to name a few for example...   * framework/utility library on top of CppUnit which our developers share   * low-level IPC communications framework   * Common development SDK that myself and several other team leads started to help share some common code/tools at the department-wide level (this SDK is released as internal "product" to each of the groups). Is the standard practice to use the one bug tracking tool? Or would it make more sense to setup something more localized specifically for our needs and maintain it ourselves? It's also unclear how management will feel if developers start performing "IT" roles of maintaining software and servers. At the same time, right now, we use excel files, internal wiki and MS OneNote for this kind of stuff and that just doesn't feel right. (I'm afraid to ask for actual software recommendations, since that might make this question more localized or something. Also developers needs this way more than management, so it would be nice to find something either free or no more than the cost of a happy hour).


title: Learning the basics

text: I am a Linux server administrator first and foremost... Having said that, I have been asked by a former high school teacher of mine to teach students a bit about programming. Like any Linux administrator, I know my fair share of Python and Bash. The problem is that I know NOTHING about the lower level stuff like "machine code" and compilation. The main purpose of this series is to teach programming, not computer science, so I don't need a graduate degree's level of knowledge for this, they will be learning Python first and foremost. However, I would like to learn enough to at least broach the subject with them, any ideas where I can learn that kind of stuff relatively quickly?


title: What Technology can Render Medium Scale 3d Environments in a Web-Browser

text: I intend to make a web application that displays 3d environments that can be navigated by dragging(with a finger or mouse depending on the platform). The web app will render 3d environments of development sites including contours, water pipeline locations, buildings etc. I am trying to decide what technology/libraries to use that will create a web- app that will work on Android-Web-Browser, iOS-Safari, IE9, Safari, Firefox and Chrome. And also what technology will provide speed in development. I understand that this is _'asking for my cake and eating it too'/'asking for the moon'_ but I don't know all the technologies out there - so there may be advanced libraries that can render 3d environments across many web-browsers including the main smart phone ones and I dont know of them. The 3d rendering would not be highly detailed buildings or water with effects, but rather simple 3d representations of these objects. The environment would be navigable by dragging around and you could view the landscape in layers(view only contour lines, view only underground pipelines, view only sewerage pipes, etc.). **Are there any 3d libraries for web-browsers out there? Is there a way to run OpenGL(or OpenGL ES) through a webbrowser?** **What technology would you use if you were making this kind of app/web app that should work on desktop Windows, Android, iOS and WindowsPhone?** **Is there any technology I have failed to mention that would be good for this kind of project?** I am tending towards a Browser Driven Web App because I get that cross platform ability(where it even works on linux and MacOS by using compatible web-browsers). Also I know of CSS3 transforms that can create cubes that can rotate in 3d space(NOTE only works for WebKit browsers - so no IE :( ). _But I don't know if CSS3 is robust enough to render whole 3d environments? Do you think it could? Maybe I could use HTML5 canvas's for this? Can Google maps create custom 3d maps?_


title: Is it useful to keep 'definition' entities in a database vs using an enum?

text: In a project that I have started working on, the database has a lot of `FooDefinition` tables which act like an enum. It's a C# project using Entity Framework although that is not central to the question. The entities have an ID, a string Name field and an int Type field that is converted to an enum. For example:               public class FooDefinition     {         public int Id { get; set; }         public string Name { get; set; }         public FooType FooType { get; set; } // this is an enum that defines the entity     }      The FooDefinition table is populated with an entity for each defined enum value, and does not change unless there is a new enum value added. I am struggling to see the use in this pattern over just using the enum directly as opposed to joining on this Definition table. What are the possible benefits of this approach?


title: Greenspun's Tenth Rule, does every large project include a Lisp interpreter?

text: Greenspun's tenth rule (actually the only rule) states that: `Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp.` My memory is that there are some papers on the topic, perhaps for Borland's Quattro (spreadsheet) project and possibly others. Google is unhelpful, maybe the right search terms are not coming to mind. I am looking for papers or articles supporting this claim, if any.


title: How can I inspire my group to start using an online collaborative tool more?

text: I'm in a project with 4 other people, and I've been willing to fully adopt a collaborative tool in order to make it possible to share information and store data (PDFs, DOCs, etc.) in an online tool, rather than doing it by e-mail. The problem is that I'm the only one enforcing it; actually I'm the only one using it. The others only use it when I ask them to do so. How would you handle this? Have you experienced something similar, if so, what have you done?


title: How can you measure your own daily contributions?

text: I've recently finished the _The Three Signs of a Miserable Job_ by Patrick Lencioni and one of his core ideas is that you need to have _some_ form of measurement. I have a pretty standard internal developer job where I work on new tools and do some support/bug fixes for past tools I have written. For purely personal fulfillment reasons, what things would you measure on a daily basis? (This is not a report to managers and not something to game, just something to help me mark progress). The goal is to find things that measure not just productivity, but how good of a job you are doing (so a customer service person might record positive interactions in addition to number of calls taken). My stab at this would be to measure two things every day: support requests opened/closed and number of checkins to source control. I understand if this gets closed, but once again this isn't a question about management, its about personal development as a programmer/software developer.


title: Is it reasonable to run processes with CI tools?

text: At my company, we have a quagmire of disparate cron jobs (on multiple systems) and manually kicked off processes which keep our business functioning that is a result of years of expedient development and subsequent neglect. Someday, we will need to come up with a more centralized solution for obvious reasons. One thought that we have been kicking around is to use our Continuous Integration software (Jenkins) to run these processes, which seems logical. **My question is whether or not other companies are doing this? Is this a generally accepted practice? Doesn't this conflict with the definition of a CI tool implicit in its name? Are there any other options?** Note: https://wiki.jenkins-ci.org/display/JENKINS/Meet+Jenkins Jenkins claims that it focuses on "Monitoring executions of externally-run jobs, such as cron jobs and procmail jobs". I'm not sure if this is exactly what I am talking about.


title: PHP web application architecture/design

text: I've been thrown head-first into a new job developing web applications in PHP. I'm by no means new to PHP, but I haven't developed large-scale applications before. I'm wondering how to structure my development to avoid setting myself up for problems in the future. How do I design and architect my applications in a sound way that allows them to scale over time in terms of functionality and performance. I'm thinking of things like:   * Separating back end from front end   * Directory structures I would appreciate pointers to architectural and application design patterns, frameworks and methods that allow me to approach large-scale PHP web application development in a sustainable way.


title: Estimating Cost of modifying someone elses code

text: I am relatively new to web development and haven't had to provide estimates for many large projects yet (my last large project was just paid for by the hour without a strict deadline or budget). A client is asking me to provide a cost and time estimate for providing a myriad of changes to another developers code for a website (php/mysql backend). Can anyone provide some advice or links on how to go about analyzing and estimating this? The code is horrible (the website was originally outsourced to india years and years ago) and it's hard to know if I'm going to suddenly hit hurdles and blow my estimates out of the water.


title: Is there a language between C and C++?

text: I really like the simple and transparent nature of C: when I write C code I feel unencumbered by "leaky abstractions" and can almost always make a shrewd guess as to the assembly I'm producing. I also like the simple, familiar syntax for C. However, C doesn't have these simple, helpful doodads that C++ offers like classes, simplified non-cstring handling, etc. I know that it's all possible to implement in C using jump tables and the like, but that's a bit wordy at times, and not very type-safe for various reasons. I'm not a fan of the over-emphasis on objects in C++, though, and I'm gun shy of the 'new' operator and the like. C++ seems to have just a few too many hiccups to, for instance, be used as a system programming language. Does there exist a language that sits between C and C++ on the scale of widgets and doodads? Disclaimer: I mean this as purely a factual question. I do not intend to anger you because I don't share your view that C{,++} is good enough to do whatever I'm planning.


title: What do programmers want in a web API?

text: I'm currently building a web API for popular piece of forum software (XenForo). What kind of things do developers find important in a web API? Are there certain architectures (REST, SOAP, etc.) that are much better than just doing my own thing? The API I have the most experience with is MediaWiki's API, but that doesn't seem to follow any sort of standard. What should I be planning to include (e.g. output formats, OAuth) and what are some good examples to follow?


title: How to comfortably monitor 5 daemons while developing them?

text: This is the scenario: I'm on this project for which I wrote 4 Node.js scripts that act as "servers" for some service (they have to be separated). I also use Redis, that is another service to keep an eye on. The system is not yet in production (the reliability of it will raise another set of problems, but not now). While developing, those services spits a lot of interesting console.log() messages that I care of. I'm actually using a big terminal window split in 4 with GNU screen, but every time I have to start screen, ctrl+a+c, ctrl+a+c, ctrl+a+c and so on then manually start the services. How would you comfortably automate this operation? Or are there some tools to better enhance MY user experience as the shepherd of those little monsters? :) I'm on my way using ANOTHER service that will publish those logs via HTTP. The logs (mostly debug messages) will be published by the other 4 guys in a Redis channel that the log2http server will subscribe to...


title: What does artifact mean?

text: The dictionary defines artifact as: > artefact, artifact [ˈɑːtɪˌfækt] n > >   1. something made or given shape by man, such as a tool or a work of art, > esp an object of archaeological interest > >   2. anything man-made, such as a spurious experimental result > >   3. (Life Sciences & Allied Applications / Biology) Cytology a structure > seen in tissue after death, fixation, staining, etc., that is not normally > present in the living tissue > > The word `artifact` often appears in software development, software development cycles, effort estimation, etc. But the above definition doesn't make sense to me in that context. Could someone please explain this word by giving some specific examples from software industry?


title: What standards does your team use for your specification documents headers and footers?

text: ## TL;DR: What header/footer do you put on your Functional&Technical specifications to avoid people having different versions at meetings? ## Story: We're have a lot of documents, being changed by everyone. Functional specifications, technical specifications, addendums, etcetera. Problem is offcourse that during a meeting, after an hour someone notices their printed version differs from someone else's. I thought this could be solved by forcing everyone to use the same header/footer on each document: ### Header   * Project concerned   * Document title (center aligned)   * Document author (right aligned) ### Footer   * Last modification date   * Date on which document was printed   * Full document path and name (which always include the version number)   * Page X of Y This way, we could all easily check the filename and last modification date before starting the meeting, and make sure everyone has the same copy and is talking about the same document. Would this work? Am I missing something? What do you guys use for your specifications to avoid versioning problems?


title: In pair programming, what is each role named, and why?

text: I've heard the person at the keyboard named the "driver", and the other person named the "navigator". I've imagined rally car racers, where the person at the wheel just _cannot_ keep up with _everything_ that's happening, and they _must_ have the help of the "navigator", who's shouting volumes and volumes of directions at them to, literally, keep them "out of the weeds", much like a person at the keyboard is kept "on course" by the person in the second chair. What are the more/most commonly accepted terms for the two roles in pair programming, and (if it's not obvious) are they borrowed from any earlier professions?


title: Team Git workflow working with a multi-project Sitecore solution using TDS

text: We are a team of 8-10 developers working on different parts of a Sitecore instance. In the past we've used SVN and more recently (and successfully) Hg, but are moving to using Git as our primary source control. We're working with Sitecore 7, and using the latest TDS from Hedgehog. In case it matters we're also using the Glass.Mapper.sc lib from Mike Edwards. The problem we're running into, especially compared to how easy it was with Hg, is that merges are a nightmare. It doesn't help that most of our team is new to Git, but most of us have at least used Hg so it's not a huge leap. We've had so many problems that we moved to a merge-master setup, where the team leads are handling all the merges. My question is this: From people using these tools, what would you suggest is the best workflow and supporting configuration? A team member suggested rebasing to reduce conflicts, but that doesn't seem to matter. Our Hg workflow, which worked very well was: 1) Commit local changes as many times as needed. 2) Pull changes from the server, and update to the remote branch after any merge. 3) Sync TDS. We do this after the pull so that we're not overwriting the .scproj file in the merge 4) Commit the merge and TDS sync 5) Push the results back to remote We didn't have merge nightmares and tds was kept very clean. We tried to adapt something similar with Git and have wasted a lot of time each week to resolve issues. We currently have each dev working in their own branch because of the merge errors working with everyone in master. The type of merge issues I'm seeing seem to mostly come from what Git merges automatically. I definitely don't want to merge everything by hand every time, but I wouldn't mind doing project file merges by hand. We're using Sourcetree and I have BeyondCompare Pro. Any suggestions, especially coming from successful implementations, would be greatly appreciated. If there are simply config changes that can be made or a change to our workflow to make the process more reliable I'd love to learn about them.


title: declaration and definition

text: People say definition is used when the declared stuff has some memory allocated. If I declare a class               class fish     {       char* name;       int type;       //someting i dont know about fish     };      int main()     {         fish a;        return 0;     }      Should it mean this is a declared fish or a defined fish ? Let me try first! it is called a defined fish! I now leave a breapoint at //something..... (that is a valid declaration of something I just dont know) Do you know what is there that at //someting the debugger may never reach ? Does that also mean there is no memory allocation for it. I'll be deeply sad to hear a no.


title: How best to learn OOP concepts/principles practically?

text: I wanted to learn object oriented programming language, I dont want it for any purpose just to know the whole concept of OOP. So can anyone tell me which language I should start learning?


title: What is the "PHP Way"?

text: I see constant references to the " Way," such as descriptions of a particular framework or application as "Pythonic," a certain person as a "Perl hacker," or "true Ruby code," but where are the "PHP hackers," the "PHP-ic" applications, the "true PHP style"? This made me think - does PHP even have a definite style? Saying PHP is easily "changeable" to other styles doesn't count, as the same goes for any reasonable language. Any input much appreciated.


title: Distributed SVN?

text: I work for a large bureaucratic (and security paranoid) organisation that provides SVN for its development teams to use. I am working with a 3rd party vendor (at their site) and we currently share code via SVN export and patch files. The only way I have for transferring files is by a FTP drop box or email. I would like a better way to work. I am currently lobbying to get some kind of DCVS system setup, ideally cloud hosted. Failing that I want a better way to manage keeping SVN repositories in sync. In the meantime (or if I fail to get DCVS) how do I keep two SVN repositories in sync? How do I best manage exporting the repository? How do I manage incoming changes?


title: Is it poor technique to have functions within a class depend on one another in a "cascade" type fashion?

text: I am fairly new to PHP and OOP. Having said that, I wanted to know how independent functions should be within a class. I know that each function should be responsible for doing just one thing. However, as you can see in my class below, I occasionally find myself creating functions that build upon one another in a "cascade" type fashion. Is this good practice? Is there a different way I should be structuring this class/these types of functions? I want to make sure I am developing good habits. Thanks in advance for your help.               class PubMedQuery {          private $query;     private $searchParameters;     private $searchURL;     private $fetchParameters;     private $fetchURL;     private $searchResults;     private $fetchResults;     private $matches;     private $matchRegex;     private $emailAddresses;          public function __construct($query) {         $this->query = $query;     }          public function setSearchParameters() {         $this->searchParameters = array(             'db'         => 'pubmed',             'term'       => $this->query,             'retmode'    => 'xml',             'retstart'   => '0',             'retmax'     => '1000',             'usehistory' => 'y'         );     }          public function getSearchParameters() {         return $this->searchParameters;      }           public function setFetchParameters() {         $this->fetchParameters = array(             'db'        => 'pubmed',             'retmax'    => '1000',             'query_key' => (string) $this->searchResults->QueryKey,             'WebEnv'    => (string) $this->searchResults->WebEnv         );     }          public function getFetchParameters() {         return $this->fetchParameters;      }           public function setSearchURL() {         $this->baseSearchURL = 'http://eutils.ncbi.nlm.nih.gov/entrez/eutils /esearch.fcgi?';         $this->searchURL = $this->baseSearchURL . http_build_query($this->getSearchParameters());     }          public function getSearchURL() {         return $this->searchURL;      }          public function setFetchURL() {         $this->baseFetchURL = 'http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?';         $this->fetchURL = $this->baseFetchURL . http_build_query($this->getFetchParameters());     }          public function getFetchURL() {         return $this->fetchURL;      }          public function setSearchResults() {         $this->setSearchParameters();           $this->setSearchURL();         $this->searchResults = simplexml_load_file($this->getSearchURL());     }          public function getSearchResults() {         $this->setFetchParameters();         $this->setFetchURL();         return file_get_contents($this->getFetchURL());      }          public function setEmailAddresses() {         $this->matches = array();         $this->matchRegex = '/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}/';          preg_match_all($this->matchRegex, $this->getSearchResults(), $this->matches);         $this->emailAddresses = array_unique(array_values($this->matches[0]));     }          public function getEmailAddresses() {         $this->setSearchResults();         $this->getSearchResults();         $this->setEmailAddresses();         return $this->emailAddresses;     }     }          //Example using search term "psoriasis"     $query  = new PubMedQuery('psoriasis');     echo implode('<br />', $query->getEmailAddresses());


title: How can I justify software testing to management?

text: I work for a small company (less than 200 employees) whose software group only makes up a small part of our staff (4 employees, occasionally with a few contractors). The four of us have been making strides in transitioning to better practices, and one of the next logical steps is to improve our testing. As anyone who has done any meaningful tests knows, testing takes a lot of time - and at my company, it takes too much time to justify to management, so we generally do what little we do on the sly. I don't think this is serving us well, as we keep coming up against otherwise avoidable problems when we ship under-tested software. I would like to be able to come to management with a justification for hiring a dedicated software test engineer (someone who can both write automated tests and perform manual ones). Are there any good published studies that show the benefits of adding such a position to a small company? Where can I find information about costs associated with the position? I plan on doing a little number crunching on our own history, but having some external sources to point to would help bolster my case.


title: async+await == sync?

text: Stumbled upon this post that talks about making async web requests. Now simplicity aside, if in real world, all you do is make an async request and wait for it in the very next line, isn't that the same as making a sync call in the first place?


title: What design pattern matches this problem the closest?

text: I have two objects, one is a User object and the other is a Content object. The User object has properties like 'reads_articles' or 'reads_books'. The Content object has properties like 'is_article' or 'is_book'. If the two properties match up (i.e. the User reads_articles and the Content is_article), then the User can see the Content. Basically, I am looking for the best solution to approach this without using a switch() statement. I am also wondering if maybe I'm making this too difficult and/or a design pattern is overkill here. Preliminary research has suggested that the Strategy pattern may be the most appropriate, but I'm having a hard time modeling this problem to that pattern. I don't want to hard code the tests - I would really like to come up with a general solution that examines the properties of both classes, and determines whether the Content can be viewed by that User. Clarification: My end goal is an algorithm that will examine the properties of the User and the properties of the Content, and see if they match. Basically, I want to see if the two objects have matching properties (without hardcoding the properties themselves into the algorithm) and do some actions. Not sure if what I want is a pipe dream, so I thought I would ask. Thanks for the help!


title: Did I answer this correctly and concisely?

text: By email I just answered my brother who is learning computer programming that C++ and Java are more similar than C and C++ even though C++ is nearly a superset of C. Do you agree? AFAIK Stanley Lippman wrote the "canonical work" (C++ Primer) on C++ and Dennis Ritchie and Brian Kernighan wrote the "canonical work" (The C Programming Language) on C but I'm no C++ expert so I ask you the question. Here is the conversation translated to English: > ---------- Forwarded message ----------   >  From: Niklas   >  Date: 1 May 2013 07:22 > > It is rather that one knows Java if one knows C++. > > There is more difference between C and C++ than between Java and C++ example > C + + features, but does not use, pointers, rather than using C + + so- > called references which also are used in Java instead of pointers. In C > dynamic memory is allocated with malloc and in C++, this is done with the > keyword new and in C is dynamic memory is released using the keyword free > which in C++ is called called delete. > > Operating systems get programmed in C and assembly language, and > applications such as GUI programming are done with more object-oriented > languages e.g. C++, Java, Visual Basic, Flash...so it depends on what > problem you want to solve, CPU scheduling or widgets. There are different > paradigms. > > On 1 May 2013 07:16 wrote Holger: > > I'm reading a book on C++. So far it seems to be identical to java, except > for a few minor syntactical variations (include instead of import, etc.), > but I assume that the differences will subsequently. Is it possible to > automatically C if it can C + +? > > On May 1, 2013 6:45 AM, "Niklas" wrote: > > Hello! Here is the pdf of programming in C. It's fine to ask me if you have > any questions. Sincerely, Niklas


title: How to generate random numbers without making new Random objects?

text: I'm using this as part of a game, but it's not really a game development question, so I'm putting it on this more general Stack Exchange. The goal is to generate "random" outputs for a fixed integer input, but (and this is the clincher) to generate the _same_ random output every time the _same_ random input is put in. The idea here is that the function will generate the world the same way every time, so we don't need to store anything; the function itself is the storage. Unfortunately access speed is a little slow, because the only way I can find to generate random numbers is to create a new Random() object with a seed based on the input, which is surprisingly slow. Is there a better way? I'm not worried about crypto-safe generation; in fact I'm just going to pick a random seed in advance and expose it quite publicly. The current code looks like this:               private const int seed;          public MapCell GetMapCell(int x, int y)     {         Random ran = new Random(seed + (x ^ y));         return new MapCell(ran.NextInt(0, 4));     }      Where the `MapCell` is one of four types (in fact it's more complicated than this, but not a whole lot). The point is that this could be called for any parameters, at any time, in no particular order, but it needs to return the same answer every time, if x and y are the same every time. That's why I can't fix a certain Random object and use it repeatedly. I also don't want to store anything, because I want to keep the RAM usage quite low, but allow the player to wander freely to the edges of `Int.MaxValue`


title: Naming methods that perform HTTP GET/POST calls?

text: In the application I am currently working on, there are generally 3 types of HTTP calls:   * pure GETs   * pure POSTs (updating the model with new data)   * "GET" POSTs (posting down an object to get some data back, no updates to the model) In the integration service, generally we name methods that post "postSomething()", and methods that get, "getSomething()". So my question is, if we have a "GET" POST, should the method be called:   * getSomething - seeing as the purpose is to obtain data   * postSomething - since we are technically using POST   * performSomeAction - arbitrary name that's more relevant to the action What are everyone's thoughts?


title: What is meant by, "A user shouldn't decide whether it is an Admin or not. The Privileges or Security system should."

text: The example used in the question pass bare minimum data to a function touches on the best way to determine whether the user is an administrator or not. One common answer was:               user.isAdmin()      This prompted a comment which was repeated several times and up-voted many times: > A user shouldn't decide whether it is an Admin or not. The Privileges or > Security system should. Something being tightly coupled to a class doesn't > mean it is a good idea to make it part of that class. I replied, > The user isn't deciding anything. The User object/table stores data about > each user. Actual users don't get to change everything about themselves. But this was not productive. Clearly there is an underlying difference of perspective which is making communication difficult. Can someone explain to me why user.isAdmin() is bad, and paint a brief sketch of what it looks like done "right"? Really, I fail to see the advantage of separating security from the system that it protects. Any security text will say that security needs to be designed into a system from the beginning and considered at every stage of development, deployment, maintenance, and even end-of-life. It is not something that can be bolted on the side. But 17 up-votes so far on this comment says that I'm missing something important.


title: SOA, Java EE and data organization

text: At the company I work for, we're currently splitting up our monolith solution into a number of small services (SOA). The purpose of this is to make the developers working on each chunk of code (service) more independent, and on the whole to make the code base more manageable. When a change in code is introduced, only one part (i.e. a whole service) needs to be deployed, instead of having to deploy _everything_. This also helps with testing, there's less of a need to test everything when something is deployed. Many of the services are small, so we'd like to deploy a number of these services on the same application server, JBoss 7.1 in this case. As per the SOA philosophy, the independence of each service and the teams working on them is very important. What would be the best way to organize the data?   * Use one schema per service      * Would you use one datasource per schema in the application server?     * Or use one datasource, prefixing all DB object names with the schema name in some transparent manner?   * Use a shared schema, but evading any naming collisions by requiring each service to use a distinct prefix for all DB objects   * Other options? Am I maybe thinking this completely wrong here? :) Edit: Explained _why_ the code base is being split up from a monolith to smaller services.


title: Why are good programmers referred to as Ninjas?

text: How is a Ninja programmer defined? If it is just an experienced developer, then is there really no better way to describe that? Ninja sounds like a childish marketing ploy designed to attract developers with delusions of self- grandeur. Or am I missing something? In particular I want to know what qualities of a Ninja are desired in programmers that makes the comparison valid (besides the coolness factor)? I did find this article which makes some good comparisons between Ninja characteristics and Agile development. However, I would like to hear from people who have used the word Ninja for hiring purposes and what their motivation was behind it. **Update:** There were several good points raised on both sides of the argument. I've tried to summarize these in my blog post. I've chosen JB's answer as the accepted one because it summarizes all the valid reasons for making the comparison.


title: Does tweeting 9 to 5 hurt job applicants?

text: If you were looking into a job applicant's background and discovered that he or she has 1200 followers on Twitter and averages 50 tweets per day (more than half of which are during business hours), would it affect your hiring decision? How and why? Personally, I'd be a little worried about the candidate's ability to focus on the job at hand if they're constantly checking in with their 'tweeps' thoughout the day. In non-tech jobs, a lot of companies simply block Twitter as an irrelevant distraction. But it _can_ be a useful resource---to programmers in particular. I just wonder how much is too much. At what point does it become a red flag?


title: Is there any reason to Dual-License a permissive License with a copyleft one?

text: My understanding of permissive licenses (MIT, BSD) is that they allow a user to re-license the software, provided that they attribute moderate portions to the original author. Is there a reason why anybody would dual-license with something like MIT and GPL, if the MIT license would allow any person to take the code and license it as GPL? I know JQuery does this, but I don't understand why. Am I misunderstanding the MIT license or is it just redundant?


title: Should integration test be included in continues integration (CI)?

text: Assume that we are developing a web application, and Hudson does typical jobs such as compile, unit test and static code analysis. But the tricky part is: Hudson **deploys and starts up application server to do integration tests** , once the previous jobs done. That means some difficult things, such as database connection, 3rd part application connection, socket port listening, environment variables, server start up failure handing, etc. We have to set up and tear down these things correctly each time, it’s hard thing. Worse, the integration tests can break the integration test easily. Do you think if integration test should be included in continues integration (CI)? Can it be manually? Or simplify integration test?


title: Are database schema migrations a problem in production environments?

text: In discussions about NoSQL vs SQL databases, I sometimes hear that companies prefer to use schemaless NoSQL databases because it is problematic to migrate the schema to a new version. But is that really a big problem when doing upgrades? Are relational databases bad for such operations? I read this blog post on the MongoDB blog: Why Schemaless?


title: Passing data between two windows forms using visual c++ 2010

text: 1. So, i have a simple forms application : i have a form 1 ( **Form1.h** ) and a second form ( **Form2.h** ). Form1 consists of a simple _Add User button_ (which at this stage does nothing but _opens the form2 and hides form1_ ).(Till this point , everything works).    But when I _add a button "Done" to the Form2_ which is supposed to _open form1_ again , there are following **errors** :   left of ->Show must point to class/struct/union/generic type   f1: undeclared identifier   Form1: undeclared identifier   Please help!   2. the code is :              //Project Name: MultipleForms     //Form1.h     #ifndef FORM1_H     #define FORM1_H     #pragma once     #include "Form2.h"     namespace MultipleForms {              using namespace System;         using namespace System::ComponentModel;         using namespace System::Collections;         using namespace System::Windows::Forms;         using namespace System::Data;         using namespace System::Drawing;              /// <summary>         /// Summary for Form1         /// </summary>         public ref class Form1 : public System::Windows::Forms::Form         {         public:             Form1(void)             {                 InitializeComponent();                 //                 //TODO: Add the constructor code here                 //             }              protected:             /// <summary>             /// Clean up any resources being used.             /// </summary>             ~Form1()             {                 if (components)                 {                     delete components;                 }             }         private: System::Windows::Forms::Button^  btnAddUser;         private: System::Windows::Forms::Button^  btnExit;         protected:               private:             /// <summary>             /// Required designer variable.             /// </summary>             System::ComponentModel::Container ^components;          #pragma region Windows Form Designer generated code             /// <summary>             /// Required method for Designer support - do not modify             /// the contents of this method with the code editor.             /// </summary>             void InitializeComponent(void)             {                 this->btnAddUser = (gcnew System::Windows::Forms::Button());                 this->btnExit = (gcnew System::Windows::Forms::Button());                 this->SuspendLayout();                 //                  // btnAddUser                 //                  this->btnAddUser->Location = System::Drawing::Point(78, 44);                 this->btnAddUser->Name = L"btnAddUser";                 this->btnAddUser->Size = System::Drawing::Size(75, 23);                 this->btnAddUser->TabIndex = 0;                 this->btnAddUser->Text = L"Add User";                 this->btnAddUser->UseVisualStyleBackColor = true;                 this->btnAddUser->Click += gcnew System::EventHandler(this, &Form1::btnAddUser_Click);                 //                  // btnExit                 //                  this->btnExit->Location = System::Drawing::Point(263, 136);                 this->btnExit->Name = L"btnExit";                 this->btnExit->Size = System::Drawing::Size(75, 23);                 this->btnExit->TabIndex = 1;                 this->btnExit->Text = L"Exit";                 this->btnExit->UseVisualStyleBackColor = true;                 this->btnExit->Click += gcnew System::EventHandler(this, &Form1::btnExit_Click);                 //                  // Form1                 //                  this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);                 this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;                 this->ClientSize = System::Drawing::Size(410, 200);                 this->Controls->Add(this->btnExit);                 this->Controls->Add(this->btnAddUser);                 this->Name = L"Form1";                 this->Text = L"Form1";                 this->ResumeLayout(false);                  }     #pragma endregion         private: System::Void btnAddUser_Click(System::Object^  sender, System::EventArgs^  e) {                      Form2^ f2 = gcnew Form2();                      f2->Show();                      this->Hide();                  }         private: System::Void btnExit_Click(System::Object^  sender, System::EventArgs^  e) {                      exit(1);                  }         };     }          #endif          //Form2.h          #include "Form1.h"     #ifndef FORM2_H     #define FORM2_H     #pragma once          #include<stdlib.h>          namespace MultipleForms {              using namespace System;         using namespace System::ComponentModel;         using namespace System::Collections;         using namespace System::Windows::Forms;         using namespace System::Data;         using namespace System::Drawing;              /// <summary>         /// Summary for Form2         /// </summary>         public ref class Form2 : public System::Windows::Forms::Form         {         public:             Form2(void)             {                 InitializeComponent();                 //                 //TODO: Add the constructor code here                 //             }              protected:             /// <summary>             /// Clean up any resources being used.             /// </summary>             ~Form2()             {                 if (components)                 {                     delete components;                 }             }         private: System::Windows::Forms::Button^  btnDone;         protected:               protected:               private:             /// <summary>             /// Required designer variable.             /// </summary>             System::ComponentModel::Container ^components;          #pragma region Windows Form Designer generated code             /// <summary>             /// Required method for Designer support - do not modify             /// the contents of this method with the code editor.             /// </summary>             void InitializeComponent(void)             {                 this->btnDone = (gcnew System::Windows::Forms::Button());                 this->SuspendLayout();                 //                  // btnDone                 //                  this->btnDone->Location = System::Drawing::Point(98, 110);                 this->btnDone->Name = L"btnDone";                 this->btnDone->Size = System::Drawing::Size(75, 23);                 this->btnDone->TabIndex = 0;                 this->btnDone->Text = L"Done";                 this->btnDone->UseVisualStyleBackColor = true;                 this->btnDone->Click += gcnew System::EventHandler(this, &Form2::btnDone_Click);                 //                  // Form2                 //                  this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);                 this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;                 this->ClientSize = System::Drawing::Size(292, 273);                 this->Controls->Add(this->btnDone);                 this->Name = L"Form2";                 this->Text = L"Form2";                 this->ResumeLayout(false);                  }     #pragma endregion         private: System::Void btnDone_Click(System::Object^  sender, System::EventArgs^  e) {                      Form1^ f1 = gcnew Form1();                      f1->Show();                      this->Hide();                  }         };     }     #endif


title: TFS - web sites based under IIS - how to handle branching

text: I'm just looking for some advice/best practice for this situation: We have a solution with a couple of web sites in it (one is a web site project, the other is a web application project). We have both of these sites set up to use our installed IIS (v7), as we have other projects that we need to access these via localhost whilst debugging. We've just moved to TFS (from GIT) - when we switch branches, I have to go and 'repoint' my virtual directories under IIS to point at the new branch, which is a bit of a nuisance. Does anybody have any advice/guidance as to what is the best way to approach this? I would note that I don't think that switching to using Cassini will suit our situation.


title: How do you test database abstraction in PHP?

text: I apologise in advance if this question is too subjective but I'm struggling to find a good answer, probably as there is not really a correct answer to give. I'm currently writing a database abstraction layer to unify the use of a single API throughout my applications. Possibly re-inventing the wheel but I'm mainly doing it for my specific need of certain Oracle functionality that will eventually be migrated away from Oracle. For the Oracle driver I'm finding it difficult to test the object due to the lack of an OO API in PHP, so to test I need to touch the database. There seems to be two schools of thought on testing database functionality.   1. Don't touch the database, mock it all away (obviously impossible without an OO API).   2. Allow the functionality to run and therefore feature test rather than unit test. My question is two fold, has anyone done this before and how did you handle testing? If you haven't had cause to do this before, what are your thoughts on how you would handle it and why?


title: atlassian confluence as source for bdd stories

text: I want to start using BDD in our company. The best place to keep stories from my point of view is the Atlassian Wiki pages. Obviously I expected some existing techniques for retrieving stories from pages, but found only an advice to use `pageUrl?decorator=printable` to get the page in printable form and parse it afterwards. And that is it, no plugins nothing... **Question** : What is the best way to retrieve stories from Atlassian Wiki? Are there any well known alternatives? I can definitely keep them in the SVN folder where business analysts could have access to, but this is far much less comfortable for them. All other technical documentation is kept on wiki and I do not want to split it.


title: Purpose of `return self` from a class method?

text: I came across something like this in an open-source project. Methods that modify instance attributes return a reference to the instance. Would you trust code that is written like this?               class Foo(object):            def __init__(self):         self.myattr = 0            def bar(self):         self.myattr += 1         return self


title: Being the only developer and its consequences

text: I am the only developer in my company. I do programming (in ASP.NET 4.0, jQuery and SQL Server 2008) and maintain the database and web server (win 2008 r2). I enjoy the freedom of implementing what I like at the same time I feel I could be doing everything in a bad way. I don’t use any SDLC diagrams not any kind of methods like Agile etc. I handle multiple small projects. I use my free time in keeping up with latest technologies and learning and testing new stuff. I have been doing this for the past 7 years.   1. My concern is how difficult will it be for me to adjust when I switch my job to a company wherein more developers are involved in a project?   2. Since I don’t follow any design pattern would it play against me when I look for job or get adjusted with new job?   3. Any other pros/cons you can think of?


title: Packaging F#/C# Application

text: There is a .NET application built using F# (the core part, as a DLL) and C# (the GUI part, using WPF). What is the best way to package it and to make an installer package and what are the most appropriate tools to use, commercial or free? It needs to include F# redistributable package in my application package and to check/download .NET framework needed. As you guessed, I'm completely new to this Windows world. Thanks in advance. Kh


title: What's so great about Clojure?

text: I've been taking a look at Clojure lately and I stumbled upon this post on Stackoverflow that indicates some projects following best practices, and overall good Clojure code. I wanted to get my head around the language after reading some basic tutorials so I took a look at some "real-world" projects. After looking at ClojureScript and Compojure (two the the aforementioned "good" projects), I just feel like Clojure is a joke. I don't understand why someone would pick Clojure over say, Ruby or Python, two languages that I love and have such a clean syntax and are very easy to pick up whereas Clojure uses _so much_ parenthesis and symbols everywhere that it ruins the readability for me. I think that Ruby and Python are beautiful, readable and elegant. They are easy to read even for someone who does not know the language inside out. However, Clojure is opaque to me and I feel like I must know every tiny detail about the language implementation in order to be able to understand any code. So please, enlighten me!   * What is so good about Clojure?   * What is the absolute minimum that I should know about the language in order to appreciate it?


title: UML modeling tool for Linux

text: I am starting a new project using Eclipse under Linux and I am looking for a UML 2.x **modeling tool** not just a diagramming tool.   * Do anyone has experience with UML plugin for Eclipse? Does it support all UML diagrams?   * Do you recommend another modeling tool?   * If you have been in a similar situation, what did you end up doing anyway?


title: Why do different java collections have different default capacity?

text: Looking at different collection constructors the question comes to mind. Why does ArrayList() construct an empty list with an initial capacity of ten and ArrayDeque() constructs an empty array deque with an initial capacity sufficient to hold 16 elements.


title: Windows Server or Linux for final project

text: A few weeks ago I came up with an idea to develop a mobile app which will direct students in my university to the nearest printer availiable. The whole thing is part of my final project.   The Android based app will need to perform the following tasks:   1. The user's location in the campus is sent to the server. Assume this part works just fine.   2. The server sends an SNMP request to the printers in the user's vicinity. I'll probably use PHP or Python for that part.   3. The data requested by SNMP is processed and sent back to the client My question concerns the server. The university's IT manager offered me a designated server for development, which sounds great. Now I need to choose which OS I want installed on the server - Windows server or Linux (don't know which versions). I don't have any server programming/operating experince, but generally speaking I feel more comfortable in Windows enviroment (just because that has always been my OS). I don't have much time for learning a new OS, but when does it make sense generally to host or develop server side applications on a Windows environment versus a Linux environment?


title: Automated architecture validation

text: I am aware of the fact that TFS 2010 ultimate edition can create and validate architecture diagrams. For example, I can create a new modeling project > add Layer Diagram > Add Layer called View > Add BL Layer > Add DL layer. Then I can validate this architecture as part of the build process when someone tries to check code into TFS. In other words, if the View references the DL then the compilation process will fail and the checkin will not be allowed. For those without an MSDN ultimate license, can FxCop or some 3rd party utility be used to validate architecture in an automated fashion? I prefer a TFS install-able plugin, but a local VS plugin will do.


title: Why was F# created?

text: For my current class, I have to pick and research a Programming Language (or popular scripting language) and answer quite a few questions about it, write a paper, and do some example programs displaying it's strengths and weaknesses compared to other languages. I'm currently looking into F# as a possible candidate, my problem is I can't find any information stating (at least explicitly) why F# was created. I've found many strengths and a few weaknesses of F# but do these necessarily imply reasons as to why it was created? Does anyone know any links or reads that would explicitly state why F# was created and/or the history of F# (particularly things like, what the creator was thinking, and stuff like that)? And yes, I've been searching and will continue to, I just can only find implicit reasons, and I was hoping to find something stating explicitly reasons why F# was created.


title: Is it considered Pythonic to have multiple classes defined in the same file?

text: In working with python for the first time, I've found that I end up writing multiple classes in the same file, which is opposed to other languages like Java, which uses one file per class. Usually, these classes are made up of 1 abstract base class, with 1-2 concrete implementations who's use varies slightly. I've posted one such file below:               class Logger(object):              def __init__(self, path, fileName):             self.logFile = open(path + '/' + filename, 'w+')             self.logFile.seek(0, 2)              def log(self, stringtoLog):             self.logFile.write(stringToLog)              def __del__(self):             self.logFile.close()          class TestLogger(Logger):                 def __init__(self, serialNumber):             Logger.__init__('/tests/ModuleName', serialNumber):              def readStatusLine(self):             self.logFile.seek(0,0)             statusLine = self.logFile.readLine()             self.logFile.seek(0,2)             return StatusLine              def modifyStatusLine(self, newStatusLine):             self.logFile.seek(0,0)             self.logFile.write(newStatusLine)             self.logFile.seek(0,2)          class GenericLogger(Logger):              def __init__(self, fileName):             Logger.__init__('/tests/GPIO', fileName):              def logGPIOError(self, errorCode):             self.logFile.write(str(errorCode))      As seen above, I have a Logger base class, with a couple of implementation differences below that. **The Question:** Is this standard for python, or for any language? What problems could arise from using this implementation if any? **EDIT:** I'm not really looking for guidance on this _specific_ file, but in a more general sense. What if the classes ended up being 3-5 moderately complex methods? Would it make sense to split them then? Where is the cutoff for saying you should split a file up?


title: Best way to process a queue in C# (PDF treatment)

text: First of all let me expose what I would like to do : I already dispose of a long-time running webapp developed in ASP.NET (C#) 2.0. In this app, users can upload standard PDF files (text+pics). The app is running in production on a Windows Server 2003 and has a dedicated database server (SQL server 2008) also running Windows Server 2003. I myself am a quite experienced web developer, but never actually programmed anything non-web (or at least nothing serious). I plan on adding a functionality to the webapp for which I would need a jpg snapshot of each page of the PDF. Creating these "thumbnails" isn't the big deal as such, I already do it inside my webapp using ghostscript. I've only done it on 1 page documents for now though, and the new functionality will need to process bigger documents. In order for this process to be transparent aswell for the admins as the final users, I would like to implement some kind of queue to delay the processing of the thumbnails. There again, no problem to create the queue, it will consist of records in a table, with enough info to find the pdf document back. Then I will need to process this queue, and that's were my interrogations start. Obviously the best solution to process it isn't an ASP script or so, so I will have to get out of my known environment. No problem, but I have no idea which direction to go. Therefore, a few questions :   * What should I develop ? I presumably need something that is "standby" on the server, runs when needed, then returns to idle state until further notice.Should I be looking into Windows service ? Is there another more appropriate type of project ?    * Depending on the first answer, what will be the approach ? Should I have somehow SQL server "tell" the program/service/... to process the queue, or should I have that program/service/... periodically check the state of the queue and treat new items. In both case, which functionality can I use ?   * we're not talking about hundreds of PDF a day (max 50 maybe), I can totally afford to treat the queue 1 item at a time. Can you confirm I don't have to look much further on threads and so ? (I found a lot of answers talking about threads in queue treatment, but it looks quite overkill for my needs)   * Maybe linked to the previous question : what about concurrent call to the program, whatever it is ? Let's suppose it is currently running, and a new record comes in the queue, what should be the behaviour ? I don't need much detailed answers and would already be happy with answers like "You can do the processing with a service, and yes it's possible to have sqlserver on machine A trigger a service start on machine B" or "You have to develop xxx and then use the scheduler to run it every xxx minutes". I don't mind reading articles and so, but I can hardly afford to spend too much time learning stuff to finally realize I went the wrong way for this project, so basically I'm trying to narrow down the scope of matters I need to investigate. Thanks for reading me, I hope I'll find some helping hands on here :-)


title: How would I structure my code into an MVC format?

text: I want to have the home page (root of the website), check if a cookie exists for a user being logged in, and then based off of that determining whether or not to load the sign up page (landing page) or the feed of the user logged in. Where would I have this check occur? I've kept it in the controller for now, but based on some articles I've read (such as Skinny Controller, Fat Model, I'm not sure that's the right place to keep it in.


title: Is there any way without looking at the source code to know how modular the code is

text: I've been working with TDD, most patterns, mostly OO code and still not found a way of knowing if a particular piece of code confirms to modularity , without the need reviewing the code. On a recent project which had split up everything into jars specifying a "module" which still wasn't modular code. So is there any way of actually knowing or measuring if code is modular or not? Modularity is away of minimizing the ripple effect when doing changes to a system. I've been doing a post mortem on a large system and one of the biggest issues have been the inability of containing changes to a minimum. There are several reasons for this, one where the code is actually not modularized despite following best practices. As a result the belief have been that the system is actually resilient for changes but in practice it isn't. A distinct pattern have emerged and shows why the system fails being modularized and that might be a a way of actually provide metrics for how modularized you code is.


title: How to 'reproduce copyright` in an app?

text: >   * Redistributions in binary form must reproduce the above copyright   >  notice, this list of conditions and the following disclaimer in the   >  documentation and/or other materials provided with the distribution. > The above is quoted from a BSD licensed COPYING file. How can I "reproduce the above copyright" when I distribute my app in binary form? Should I put the COPYING file content in some `Credit`/`About` screen of my app or what? Thanks!


title: How do I communicate concepts and design for a web application?

text: Iam not sure if this topic is ok to ask, but we are talking about this since years in our Developer-"Shop". How to write concepts for Web- Applications? We are using Zend Framework (MVC), OOP Based, Databases, LDAP and such stuff. But no one ive ever meet can show me an good example for some kind of "technical conception". Goal: Write an document, hand it our to an 2nd person with "some" knowledge about our systems and good PHP 5/Zend Framework skills. Now he must be able to code without many questions to the architect. Is it possible that this is not common in the "web scene"? Does everyone is just hacking code till the application works? If someone knows some good papers, examples .. Some keywords to think about:   * ERM   * UML


title: Any real use of pointers in C#?

text: What is a situation while coding in C# where using pointers is a good or necessary option? I'm talking about _unsafe_ pointers.


title: Can writing mobile apps be a full time job?

text: As an aspiring android developer, reading this today gave me a distinct feeling of a rug being pulled under my feet. While the research discussed, is about the Apple apps store, I believe it safe to say that everything is also true for the multitude of Android apps markets (or Plays as they are called these days). If it's true, then what does it mean for developers considering up to mobile development as their chosen career? Do any of you makes a living out of apps development? Can it be done as a full-time job able to pay the bills and put food on the table?


title: How do I keep controversy in check?

text: This is probably OT but it's less OT here than on any other SO site, so please bear with me. I'm working on a new project votEm. The goal is to give independent candidates a platform to introduce themselves to get elected for a political office. My main reason is that today, it's too expensive to run for an office. Some politicians in the US spend as much as 30 million dollars (!) for a single campaign. That money is better spent elsewhere. In a similar fashion, people who want to change countries like Egypt, could use such a platform to present themselves. Now I expect a lot of emotions and pressure on my site. People with a lot of money (and a lot to lose) will try to game it (political parties, secret services of ... errr ... "not 100% democratic countries", big companies, ...) To avoid as many mistakes as possible, I need a list of resources, ideas and tips how to keep such a site out of too much trouble. PS: I'd make this CW but the option seems to be gone...


title: Why isn't DSM for unstructured memory done today?

text: Edit: Comments suggested, that DSM just faded out by being not used recently. What were the reasons for this, what are DSMs drawbacks? Literature lists many positive aspects like easy to port programms to, no marshalling and therefore faster and so on but also negative aspects like only usable in homogenous environments due to endianess and word size issues. So why is all data synchronizing done by databases and not DSM anymore? Has there been a historic comparison or study at the time when both ways existed concurrently? Old text: Ages ago, Djikstra invented IPC through mutexes which then somehow led to shared memory (SHM) in multics (which afaik had the necessary mmap first). Then computer networks came up and DSM (distributed SHM) was invented for IPC between computers. So DSM is basically a not prestructured memory region (like a SHM) that _magically_ get's synchronized between computers without the applications programmer taking action. Implementations include Treadmarks (inofficially dead now) and CRL. But then someone thought this is not the right way to do it and invented Linda & tuplespaces. Current implementations include JavaSpaces and GigaSpaces. Here, you have to structure your data into tuples. Other ways to achieve similar effects may be the use of a relational database or a key-value-store like RIAK. Although someone might argue, I don't consider them as DSM since there is no coherent memory region where you can put data structures in as you like but have to structure your data which can be hard if it is continuous and administration like locking can not be done for hard coded parts (=tuples, ...). Why is there no DSM implementation today or am I just unable to find one?