Functional programming compared to OOP with classes

I have been interested in some of the concepts of functional programming lately. I have used OOP for some time now. I can see how I would build a fairly complex app in OOP. Each object would know how to do things that object does. Or anything it's parents class does as well. So I can simply tell `Person().speak()` to make the person talk. But how do I do similar things in functional programming? I see how functions are first class items. But that function only does one specific thing. Would I simply have a `say()` method floating around and call it with an equivalent of `Person()` argument so I know what kind of thing is saying something? So I can see the simple things, just how would I do the comparable of OOP and objects in functional programming, so I can modularize and organize my code base? For reference, my primary experience with OOP is Python, PHP, and some C#. The languages that I am looking at that have functional features are Scala and Haskell. Though I am leaning towards Scala. Basic Example (Python):               Animal(object):         def say(self, what):             print(what)          Dog(Animal):         def say(self, what):             super().say('dog barks: {0}'.format(what))          Cat(Animal):         def say(self, what):             super().say('cat meows: {0}'.format(what))          dog = Dog()     cat = Cat()     dog.say('ruff')     cat.say('purr')


Guidance for a C# developer to become better UI developer

I am a C# developer and had developed simple websites in regular asp.net(with asp.net controls) and a wpf application. Nowadays, I am trying to learn Asp.net MVC3 and I have been exposed to HTML with the Razor view Engine. To be honest, my knowledge of HTML and CSS is limited. Therefore, I keep posting questions now and then on SO for very simple tasks. This has made me very tired of the this Q&A development process. So, now i am thinking of learning the basics of HTML, CSS and maybe some Javascript. Therefore i would request you to guide me to become an efficient enough developer for these technologies. Something that won't take much time and get me up and running fast.


Is it Ok to change estimates in the middle of an iteration?

We have started using Agile/Scrum in a team of 4 developers. We did our story estimations and ordered the stories Primed stories in the product backlog. We started with the point based estimation on the complexity from 1 to 5, instead of usual 1,2,3,5,8,13.... and so on After working on a couple of the stories we felt that some of the stories that was estimated at 4 point should only be 2 while the other which were estimated at 2 are a lot more complex and should have been estimated as 5. I would like to know:   * Is it Ok to change our story estimates in the middle of the iteration?    * Is it Ok to use the current estimation points from 1 to 5, instead of usual 1,2,3,5,8,13.... and so on Although I personally feel that it should be no for both the cases but I need to back myself up as my own understanding is not very clear.(Any good ref material would be good though!)


DB technology for efficient search in tabular data?

We have a repository of tables. Around 200 tables, each table can be thousands of rows, all tables are originally in Excel sheets. Each table has a different scheme. All data is text or numbers. We would like to create an application that allows free text search on all tables (we define which columns will be searched in each table) efficiently - speed is important. **The main dilemma is which DB technology we should choose.** We created a mock up by importing all tables to MS SQL Server, and creating a full text index over them. The search is done using the CONTAINS keyword. This solution works well for a small number of tables, but it doesn't scale. We thought about a NoSQL solution, but we don't yet have any experience in it. Our limitations (which unfortunately I can not effect): Windows servers only. But we can install on them whatever we want.


Using Quadratic Bezier Curves to generate a cave that stays within certain bounds

I'm working on a project that generates a series of quadratic bezier curves and connects them together, maintaining slope from the end of one segment to the beginning of the next to make the transition smooth. The problem is that while the path is smooth, it tends to go off screen frequently. The way this is done currently:               P0 = new Point(0, gapStart);       P2 = new Point(wallWidth, gapEnd);       P1 = getAnchorPoint();      where:   GapStart is the P2.y of the previous curve   wallWidth is a constant   gapEnd is the one and only random aspect of the cave generation It's the Y value that the curve will end at. The getAnchorPoint function takes points 0 and 2 and generates an anchor point so that the slope at the beginning of this segment is the same as the end of the previous segment. So the main question is, what values can gapEnd be to ensure that the next curve has a gapEnd that won't send the curve off the screen? In other words, how do I determine the min and max values of gapEnd so that the next curve is safe? In addition, it's important that these values don't box the following curve in to being impossible: i.e. they cannot allow for the next curve to not have a possible solution that would allow for continued curve generation. Image of cave generation process


In what situation do Entity Framework enums become useful?

I am working on a project where there will be plenty of static options being stored in the database. I looked at using Enums for this, but do not see how they could be useful. They do not create any kind of look-up table, just reference a number in the table which can be used in code as an enum option. The number is meaningless to anyone creating SSRS reports and if you need to add an extra option, you need to recompile. Is there a situation where these have a genuine purpose and are a better fit than an entity. Or are they generally a bad practice for the above reasons?


Is it better to use pre-existing bad practices, or good practices that don't fit well with old code?

I was thinking of this because I was trying to write an extension for an existing 3rd party software, and their database is horribly denormalized. I needed to use their existing tables and add a bunch of new fields. I had the option of either creating new tables in their design style (which consists of almost all the propeties being in one big table), or creating a new set of tables alltogether and using something extra such as Triggers to synchronize data between the new and old tables. I ended up going with the first option of using the existing poor design style, but I was left with this question: **Is it better to go with pre- existing bad practices, or to implement good practices that do not play nicely with existing code? Is there some situations where I should choose one over the other?** NOTE: Many answers so far have to do with slowly refactoring the bad code, however I am unable to do that. The code is not ours, and it frequently gets updated by the vendor. I can only build onto it.


How are requirements determined in open source software projects?

In corporate in-house software development it is common for requirements to be determined through a formal process resulting in the creation of a number of requirements documents. In open source software development, this often seems to be absent. Hence, my question is: how are requirements determined in open source software projects? By "determining requirements" I simply mean "figuring out what features etc. should be developed as part of a specific software".


Security issues with freelancing work on an existing website

I currently have a website that has been recently completed. I'm contemplation using a freelance service such as SO for all future components. There is a considerable amount of work to be completed on-top of the existing infrastructure. I've tried searching for an answer to this question, but it's so generic in terms that it's difficult. My site is fairly complex using relational databases, MySQL, PHP, Javascript, JQuery, and Ajax. I'm concerned about using a freelance worker on the site in regards to giving them admin access to the server and allowing them to access the existing databases. Is there a tried and true way to handle / manage this? I'm open to allowing it, but what safety precautions and other ideas do you have to prevent mischief?


How to apply DRY to files shared by repositories?

I've got a few files which are used in several of my repos:   * `functions.sh`, shell library to for example print a colored warning/error message or the documentation of a script file.   * `Makefile`; a standardized one which installs the file `$(CURDIR)/[dirname].sh` to `$(PREFIX)/[dirname]` and references a test script.   * `LICENSE`.   * `tools.mk`; Makefile commands to for example print all the variable definitions in the parent `Makefile`. These are more or less stable, and some are used in probably over a dozen repos. I've been thinking _how to keep this DRY_ , but none of the options so far seem satisfactory:   1. Keep doing it like now, creating a **copy for each new repo.** This keeps the code together with all its dependencies (avoiding bugs when the general solution is not general enough), but changes which are applicable in multiple places have to be applied in each separately.   2. Add an **executable** to each of the repositories to **download the files** needed. This means that developers and end users will have to run an extra command to get all the relevant files, and it breaks the possibility for developers to modify and `commit`/`push` the included files.   3. Use **`git submodule` or equivalent.** This at least keeps the repositories connected, but in the Git case it seems like it's restricted to "a dedicated subdirectory", so no top-level files, and no mixing with parent repository files which belong in the same directory. This could be circumvented with symlinks, but that's an ugly workaround for the obvious ideal situation. The _ideal solution_ should:   1. **Communicate with the correct repository** when doing an operation on a file.   2. Allow includes in the **same directories as the parent directory**.   3. **A single, simple command** should be enough to update the entire repository and all includes, no matter how many or how deeply nested.   4. Allow includes in the **top-level directory**.   5. **Not incur** significant developer or user **constraints** (must be online while installing) or **extra work** (running a "pre-install" command separately from the "install" command).   6. Allow **"cherry-picking" of files** to include. Many projects might need a different `Makefile`, for example, and including one which is not used is just ugly (and would get uglier as more files are added). Is this sort of thing possible with current software?


Windows 8 development in Mac

Is there any way to start programming for Windows 8 mobile on Mac OS X platform. I'm already programming for iOS and want to developing for Windows 8 mobile but don't want to install Windows.


Is scanning the ports considered harmful?

If any application is scanning the ports of other machines, to find out whether any particular service/application is running, will it be considered harmful? Is this treated as hacking? How else can one find out on which port the desired application is running (without the user input)? Let's say I only know the port range in which the other application could be running, but not the exact port. In this case, my application ping each of the port in range to check whether the other application is listening on it, using already defined protocol. Is this a normal design? Or is this considered harmful for the security?


Random access (read/write) in datastructures

Certain datastructures, like Python's Dictionary, are unordered/random read/written. As programming in python is iterative (and programming in general is?), how do these unordered datastructures work? I understand that Python's Dictionary is in essence a hashtable. But I figured that the datastructure gets stored in the memory by order of inserting, and are thus read, when iterating over the full datastructure, in a similar order. But this is not the case. Aside from not understanding how this works, I also wonder of the benefit of this. But that may be all too clear when I understand how it works :) ps. Didn't think this was a StackOverflow Question, so put it here...


Is such modification allowed by GPL? Which licences allow this which not?

Assume that I have **library X** which contains **class A** with **method b** and that library X is realeased under **GPL licence**.               public class A {       public void b() {          // this is an example of b method's body. But assume that the body of method b           // is very complex          System.out.println("operation a");          System.out.println("operation b");          System.out.prinltn("operation c");        }         }      Assume that I am using library X and that I need a behaviour similar to the behaviour of the method b but with one addtition which I cannot achieve by simple extension of class A and overriding some of theirs methods. **The first question is:** May I extend class A and override method b in shown below way and is it really still allowed by the GPL licence.               public class AExt extends A {       public void b() {          // this is an example of b method's body. But assume that the body of method b           // is very complex          System.out.println("operation a");          System.out.println("operation b");          doOperationINeed();          System.out.prinltn("operation c");        }         }      **The 2nd question is:** Which from the common used opensource licences allow such extension and which do not?


Filesystems that use logging: If you're writing the data in the log (on disk), and in the actual locations themselves (also on disk) then...?

Aren't you essentially writing the same data twice, to the disk? Doesn't this cause a slowdown of a factor of ~2x? What optimizations can be made to minimize the cost of having to write things twice?


SQL Strings vs. Conditional SQL Statements

Is there an advantage to piecemealing sql strings together vs conditional sql statements in SQL Server itself? I have only about 10 months of SQL experience, so I could be speaking out of pure ignorance here. Where I work, I see people building entire queries in strings and concatenating strings together depending on conditions. For example:               Set @sql = 'Select column1, column2 from Table 1 '          If SomeCondtion         @sql = @sql + 'where column3 = ' + @param1     else         @sql = @sql + 'where column4 = ' + @param2      That's a real simple example, but what I'm seeing here is multiple joins and huge queries built from strings and then executed. Some of them even write out what's basically a function to execute, including Declare statements, variables, etc. Is there an advantage to doing it this way when you could do it with just conditions in the sql itself? To me, it seems a lot harder to debug, change and even write vs adding cases, if-elses or additional where parameters to branch the query.


What is the best C++ source code to read for a beginner?

I'm trying to improve my c++ coding technique by reading c++ source code. Which open source project would you recommend? Is the code of Boost C++ Libraries a good one?


Storing in-text metadata in a discrete data structure

I am developing an application which will need to store _inline_ , _intext_ metadata. What I mean by that is the following: let's say we have a long text, and we want to store some metadata connected with a specific word, or sentence of the text. What would be the best way to store this information? My **first thought** was to include in the text some kind of **`Markdown` syntax** that would then be parsed on retrieving. Something looking like this:               Lorem ipsum dolor sit amet, consectetuer adipiscing elit,     sed diam __nonummy nibh__[@note this sounds really funny latin]     euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.      This would introduce two problems I can think of:   1. A relatively small one, is that if said syntax happen to be fortuitously on the said text, it can mess with the parsing.   2. The most important one is that this doesn't maintain this metadata **separate** from the text itself. I would like to have a discrete data structure to hold this data, such a different DB Table in which these metadatas are stored, so that I could use them in discrete ways: querying, statistics, sorting, and so on. * * * **EDIT:** Since the answerer deleted his answer, I think it might be good to add his suggestion here, since it was a _workable_ suggestion that expanded on this first concept. The poster suggested to use a similar syntax, but to link the metadata to the `PRIMARY KEY` of the `metadata` database table. Something that would look like this:               Lorem ipsum dolor sit amet, consectetuer adipiscing elit,     sed diam __nonummy nibh__[15432]     euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.      Where `15432` would be the `ID` of a table row containing the necessary, queriable information, as per example below. * * * My **second thought** was to store information of this kind in a DB Table looking like this:               TABLE: metadata          ID    TEXT_ID    TYPE    OFFSET_START    OFFSET_END    CONTENT     1     lipsum     note    68              79            this sounds really funny latin      In this way the metadata would have a unique id, a `text_id` as a foreign key connected to table storing the texts and it would connect the data with the text itself by using a simple character **offset range**. This would do the trick of keeping the _data_ separated from the _metadata_ , but a problem that I can immediately see with this approach is that the text would be fundamentally _not editable_. Or, if I wanted to implement the editing of the text after the assignation of metadata, I would basically have to calculate characters additions, or removal compared to the previous version, and check whether **each** of this modifications adds or remove characters before or after **each** of the associated metadata. Which, to me, sounds like a really unelegant approach. Do you have any pointers or suggestions for how I could approach the problem? * * * ### Edit 2: some XML problems Adding another case which would make quite necessary for this separation of data and metadata to happen.   * Let's say I want to make it possible for different users to have **different metadata sets of the same text** , with or without the possibility of each user actually displaying the other user metadata. Any solution of the _markdown_ kind (or HTML, or XML) would be difficult to implement at this point. The only solution in this case that I could think about would be to have yet another DB Table which would contain the single user version of the original text, connecting to the original text table by the use of a `FOREIGN KEY`. Not sure if this is very elegant either.   * **XML has a hierarchical data model:** any element which happens to be _within_ the borders of another element is considered as its _child_ , which is most often not the case in the data model I'm looking for; in XML any _children_ element must be closed before the _parent_ tag can be closed, allowing for no overlapping of elements. Example: > `<note content="the beginning of the famous placeholder">` _Lorem ipsum > dolor sit_ `<comment content="I like the sound of amet/elit">` _amet_ > `</note>`, _consectetuer adipiscing elit_ `</comment>` _,_ `<note > content="adversative?">` _sed diam_ **`<note content="funny latin">`** > _nonummy_ `</note>` _nibh_ **`</note>`** _euismod tincidunt ut laoreet > dolore magna aliquam erat volutpat._ Here we have two different problems:   1. **Different elements overlapping:** The first comment starts within the first note, but ends after the end of the first note, i.e. it's not its child.   2. **Same elements overlapping:** The last note and the boldfaced note overlap; however, since they are the same kind of element, the parser would close the lastly opened element at the first closure, and the first opened element at the last closure, which, in this circumstance, is not what is intended.


Is there a standard way of cleaning data files?

Having spent quite a lot of time working in software companies that deal in medium to large data sets, I've seen that a choke point in their processes is often prepping data files for loading into databases. For example, searching for formatting errors, peculiar whitespace or line-end characters, wrangling with Unicode formats, that sort of thing. Everyone I've ever known deals with this in a bespoke manner because the requirements are so varied and often unique to the companies involved. I normally just fiddle about in a combination of hex editors, excel, powershell and SQL to get the job done. But this is such a perennial problem that I find it hard to believe that there isn't some standards already in place to take some of the basic grunt-work out of the process. Is there a standard technique that is tailored for the purpose of cleaning data files?


Broadcasting - Listening to replies

We use JS by the way, but I think it's language agnostic. I'm open to ideas. We have this "pub-sub" framework that we use at work to fix the problem of tightly-coupled code. Works fine. Modules listen to events, things run, broadcasts events, more things run. It's amazing. However... For instance I wanted to click on a link to open a modal, modify the passed data, and send it back to the called. Sending it to the modal would be as simple as broadcasting an event with the data. Modal, subscribed to the event, responds and does some alteration to the data. The problem is getting the data back to the caller. Scenarios:   * Module broadcasts an event, and at the same time listens to an event in the hopes of a response (event from another module). How would I know that the response was in effect of the event that was broadcast just before it?   * Another is that I plan to send out a callback function with the data sent through the event. That way, the receivers can just call the callback with the data from their side. However, the module would be receiving an unknown amount of callback calls, depending on how many subscribers. The scenario is more of directed messaging, which is somewhat contradictory to the fire-and-forget nature of a broadcast. Are there any patterns which still maintains loose coupling, modularity and the "unknown to the other" type of architecture?


So many alternative languages available, is it good to read and implement application using those?

I meant alternative languages not in sense **if not Java use C#**. But I meant **if not Java use Groovy, Jruby etc, if not HTML use HAML** and so on. Yes, there are many alternative languages available, which makes coding fun and reduce the developers works. Trying these languages is good or bad? Well learning new things never going to hurt, these alternative languages are pretty easy to read and write them. As a student for example, using Groovy I can create a Swing based application easily and it would take very less lines of code when compared to Java. When I enter into a IT company where they use Java to build the Swing applications, will it be tough for me to build in Java(because I have used alternative languages a lot in my college days)? ### Note: Example is given with Java and Groovy, but I need an answer that is common. Hope my question is clear enough!


How to deal with too much pragmatism in the project?

My team and I took over a medium sized codebase over a year ago when the previous tech lead left the company. Originating from the lack of man power I fear we favored _pragmatic_ solutions over best practices a little too much. Now, I have to deal with a constant decline in code quality and some kind of _organic growth_ of day-to-day processes. I regret that when asked for code conventions a year ago I basically gave _common sense_ as the only rule. Soon I had programmers using different syntactic styles and failing to see the difficulties this induces in a merge process. Another example is my push for database migration scripts. I tried to incorporate Flyway into our process but after only a week I was quickly overruled by my boss. Even despite me warning them about the upcoming mandatory use of database migration scripts and providing them with as many clues, hints and tools to mitigate the problem of not starting applications because of missing or failing migrations they decided that it would be best do complain to my boss about them not being able to do their work. I forcefully disabled Flyway again and we now live with migration steps in arbitrary named SQL files on a network share that you have to remember to apply to the respective database at the right time. One problem in our process was that we never did formal code reviews. So a lot of _hacks_ went under the radar and into the code base without someone noticing on time. Nowadays I tend to read checkins of my team mates when there is time (that's not often the case) but there is no automatic process to prevent unwanted changes. It is up to me to go to the developer in question and try to ease them into acknowledging why their code is bad. I thought to introduce lint-like tools like FindBugs and Checkstyle but I fear I would face the same psychological problems like I did with the database migrations. After all I would make their jobs harder for them and I can understand why this might lead to misunderstandings. So my question is: How can I go about improving our process and our code quality in an environment where _getting the job done_ is valued much higher than _doing it right_?


Submitting software to a competition, it becomes their property?

So I'm about to submit a game to a competition, but as I looked through the rules a chunk grabbed my attention: > All Entries become the sole and exclusive property of Sponsor and will not > be acknowledged or returned. Sponsor shall own all right, title and interest > in and to each Entry, including without limitation all results and proceeds > thereof and all elements or constituent parts of Entry (including without > limitation the Mobile App, the Design Documents, the Video Trailer, the > Playable and all illustrations, logos, mechanicals, renderings, characters, > graphics, designs, layouts or other material therein) and all copyrights and > renewals and extensions of copyrights therein and thereto. Without > limitation of the foregoing, each Eligible Entrant shall and hereby does > absolutely and irrevocably assign and transfer all of his or her right, > title and interest in his or her Entry to Sponsor, and Sponsor shall have > the right and may authorize others to use, copy, sublicense, transmit, > modify, manipulate, publish, delete, reproduce, perform, distribute, display > and otherwise exploit the Entry (and to create and exploit derivative works > thereof) in any manner, including without limitation to embody the Entry, in > whole or in part, in apps and other works of any kind or nature created, > developed, published or distributed by Sponsor and to and register as a > trademark in any country in Sponsor’s name any component of the Entry, > without such Eligible Entrant reserving any rights or claims with respect > thereto. Sponsor shall have the exclusive right, in perpetuity, throughout > the Territory to change, adapt, modify, use, combine with other material and > otherwise exploit the Entry in all media now known or hereafter devised and > in any manner, in its sole and absolute discretion, without the need for any > payment or credit to Entrant. So the game will become the sponsor's property; however, they don't ask for source code. So will I still own the rights to the source code, whatever that means? And if it doesn't win said competition, will I be able to publish it myself without their trademarks? I am very new to software legality stuff, so I would appreciate any clarification. Since there's a possibility I won't even own the source, is it possible to make the game core engine open source software with a not-very-restrictive license and include that in the project, so I at least still own the game engine? Or does it not work that way?


What's the best way to explain branching (of source code) to a client?

The situation is that a client requested a number of changes about 9 months ago which they then put on hold with them half done. They've now requested more changes without having made up their mind to proceed with the first set of changes. The two sets of changes will require alterations to the same code modules. I've been tasked with explaining why them not making a decision about the first set of changes (either finish them or bin them) may incur additional costs (essentially because the changes would need to be made to a branch then if they proceed with the first set of changes we'd have to merge them to the trunk - which will be messy - and retest them). The question I have is this: How best to explain branching of code to a non-technical client?


Why do HDFS clusters have only a single NameNode?

I'm trying to understand better how Hadoop works, and I'm reading > The NameNode is a Single Point of Failure for the HDFS Cluster. HDFS is not > currently a High Availability system. When the NameNode goes down, the file > system goes offline. There is an optional SecondaryNameNode that can be > hosted on a separate machine. It only creates checkpoints of the namespace > by merging the edits file into the fsimage file and does not provide any > real redundancy. Hadoop 0.21+ has a BackupNameNode that is part of a plan to > have an HA name service, but it needs active contributions from the people > who want it (i.e. you) to make it Highly Available. from http://wiki.apache.org/hadoop/NameNode So why is the NameNode a single point of failure? What is bad or difficult about having a complete duplicate of the NameNode running as well?


Managing Alerts in Web Application Using RESTful API

I have designed a RESTful API and I am now working on creating a web application to use the service. One thing I am struggling with is how to manage alerts in the web application (similar to the alerts stackoverflow gives in your profile for a new answer, response etc). Basically the web application is a workflow between a user and his clients. Certain tasks have to be completed in order, and the web application alerts both the user and his clients of any actions. The user also gets alerted to any client actions that are outstanding. The way I have my architecture setup at the moment is that the API has no knowledge of alerts. It simply stores the resources that are retrieved by the web application. To work out if an alert needs to be displayed, the web application looks at all the resources, and based on a set of rules, decides what alerts need to be displayed. The problem I have is that I'm not sure this is a very efficient way to do things. There are a number of different alerts that can be displayed, and they depend on different API resources which will all need to be retrieved when a user or client logs in. My question: Is this the best way to achieve what I want, or are there other methods which are better to use and will help decrease web application load time and api calls?


How Do Computers Process Conditional/Input/ Event Based Code?

I understand that computers are basically a complex system of electrical signatures that can calculate based on logic boards, and some sort of gate mechanism, but how do computers process something like if the number produced by the keyboard is less than 10, or if a mouse is clicked two times in a certain amount of time it equals a double click?


How to compare and relate together the concept of DBMS to the concept of Cloud Storage system?

I am a student of Computer Science and I am writing my disseration on a **Cloud Storage** application developed in the company for wich I work. My problem is the following one: my supervisor (the teacher that is that oversee my work) ask me to execute a **comparison** between the **Database Concept** and the **Cloud Storage system** that I am presenting in the disseration. He raccomended to me to focus on the **ACID** property that have to be guaranteed in a DBMS concept but, in some way, also in a Cloud Storage application (for example if I put a new file into my Cloud Storage account this operation have to be durable in time, and so on for the others ACID properties) My problem is how to link together the DBMS concept with the Cloud Storage concept. I have write some pages following this street (and I ask you if it could be a good way to link togheter these 2 arguments that, in my opinion, are pretty different...):   1. I describe wath is a **DBMS** as something that decouples the data model seen by applications from the physical representation of the same data on the hard drive.   2. I describe the **Relational Model** (and the concept of **RDBMS** as the classic model to access data). In this section I introduce the concept of relational algebra and I speack about of the **limits of the Relational Model** in the Cloud Context speacking about of **scalability problems** and about **low performance when accessing data in particular contexts** (mainly caused by the **JOIN** operator).   3. Starting from the previous problem of _low performance when accessing data in particular contexts_ * I explain why the **JOIN** operator is the cause and I speack about of the **Object Oriented Databae** as possibile solution of this problem (an object attribute could be the reference to another object and so I often no need the use of JOIN operator to relate together 2 objects but simply I have to follow a pointer, in this way the temporal complexity is dropped from **O(n)** to **O(1)** ensuring performance incredibly higher when the number of data access is hight).   4. Then I put in relaction the presented concept of **Object Oriented Database** to the **Cloud Storage System** developed, stating that they could be see as similar tools because the server that implement our Cloud Storage System use an **object storage architecture** designed to manage petabytes of information and billions of objects across multiple geographic locations as a single system. An **Object storage** is a storage architecture that manages data as objects...and this concept is pretty similar to how **Object Oriented DBMS** see the data.   5. Finally I speack about the **ACID** properties explaining the importance of these properties in the transaction managment of a DBMS (both RDBMS and OODBMS) and traslating these properties into the **Cloud Storage** context. (for example if I put a new file into my Cloud Storage account this operation have to be durable in time, and so on for the others ACID properties). What do you think about this way to relate the DBMS topic with the Cloud Storage Topic? it makes sense or is it a stretch? Other ideas are welcome Tnx Andrea


Ethics of collecting non-identifiable information on install

I wrapping up an application I'm writing that I'm hoping will get a decent user base. It will be free and open source, but I'm interested in collecting some analytic data on the install base. Essentially a small version of Google Analytics, but for a desktop application instead of a website. Details I would like to collect are:   * Previous App Version (if any)   * Current App Version   * OS Version   * Regional Geographic Location (Country/City level only, probably IP based).   * Unique System Hash (To determine # of unique installs) I have a feeling that the first three could probably be done with no real worries as they are data points gathered by pretty much EVERY website in existence without ever asking permission. Geographic location I'm still fairly comfortable is OK. Again, collected by every website out there... and heck, they even get your actual IP. I wouldn't get this, but actually resolve the geo location client side and send ONLY that. All this data would probably be submitted to a google docs form, so I wouldn't have IP access even at the collection level. I'm a little more worried about the unique system hash as people might see this as identifiable. However, my current thought is to gather the systems motherboard and CPU serial, concatenate them together and then create a hash (probably MD5) out of that string. Same thing that's done with passwords, no way to reverse it so really NO way to discern who the data actually belongs to. You'd have to have that specific hash from every computer along with their owner info to match them up. So, I'm probably fine, but I just want to cover my ass here. Any thoughts from the community as to if the data I want to collect is reasonable or if there are some data points I should not collect (or none at all). As previously mentioned, the application will be totally open source, so they would be more than able to look at the code and verify that no questionable data is sent. The only thing I might be tempted to "hide" is the actual address of the collection form, purely so someone doesn't decide to spam it with bogus data (maybe I'm being to paranoid). As it is, the app uses some web APIs for which I have personal keys that cannot be given away in the checked in source, so I have a file that is omitted from source control that contains things like those API keys. The application still works without them, just in a more limited fashion and anyone could get a key of their own and compile to make it full featured. I figure I could put the form URL in this section. Thoughts?


What is the right way to group this project into classes?

I originally asked this on SO, where it was closed and recommended that I ask it here instead. I'm trying to figure out how to group all the functions necessary for my project into classes. The goal of the project is to execute the following process:   1. Get the user's FTP credentials (username & password).   2. Check to make sure the credentials establish a valid connection to the FTP server.   3. Query several Sharepoint lists and join the results of those queries to create a list of items that need to have action taken on them.   4. Each item in the list has a folder. For each item:      * Zip the contents of the folder.     * Upload the folder to the FTP server using SFTP     * Update the item's Sharepoint data.   5. Email the user an Excel report showing, e.g.,      * Items without folder paths     * Items that failed to zip or upload Steps 2-5 are performed on a periodic basis; if step 2 returns an invalid connection, the user is alerted and the process returns to step 1. If at any point the user presses a certain key, the process terminates. I've defined the following set of classes, each of which is in its own .cs file: `SFTP`: file transfer processes `DataHandler`: Sharepoint data retrieval/querying/updating processes. Also makes and uploads the zip files. `Exceptions`: Not just one class, this is the .cs file where I have all of my exception classes. `Report`: Builds and sends the report. `Program`: The main class for running the program. I recognize that the DataHandler class is a god object, but I don't have a good idea of how to refactor it. I feel like it should be more fine-grained than just breaking it into Sharepoint, Zip, and Upload, but maybe that's it. Also, I haven't yet worked out how to combine the periodic behavior with the "wait for user input at any point in the process" part; I think that involves threads, which means other classes to manage the threads... I'm not that well-versed in design patterns, but is there one that fits this project well? If this is too big of a topic to neatly explain in an SO answer, I'll also accept a link to a good tutorial on what I'm trying to do here.


Branch per feature: What are the actual benefits (and risks)?

I've read quite a lot of posts lately about different branching strategies (e.g a lot of links from To branch or not to branch?), and while almost every article explains on how to do this or that strategy they rarely explain the why. Currently our team is investigating whether or not to switch to "feature branches". We're currently using a "everyone commits to trunk" model and we have release branches, which we use to do hotfixes to previous releases. All in all, this model has worked very well in the past. So actually I'd say - if it ain't broken, don't fix it. However, there might be a point that I'm missing, so I'd like to ask: What are actual tangible benefits of using a feature branch strategy over "everyone commits to trunk"? What are the drawbacks of feature branches in your experience?


What can I do to keep my skills sharp without the internet?

This probably sounds like a funny question from the graybeards out there, but I seriously don't know what I'm supposed to do without the Google to offer help. Long story short, I'm planning on being pulled away for a deployment overseas. Things I can expect from this:   * lots of downtime   * effectively no internet   * probably electricity I will be bringing a laptop with me, but I'm making an assumption that what little internet access I do have will probably be spent talking to my kids and family via Skype and IM. To add to that, the internet overseas is controlled tightly, so no USB sticks, external HD, or connecting my laptop up. What I can see on the screen will be probably all I can take away from it (when or if I have it at all). * * * I'm looking for ideas on things I can download on my laptop for a lengthy time away from the internet. I'm not too concerned which platform, language, or kit I download, since I will have alot of time to get proficient at anything. I really just want a fairly self-contained, well-documented and rich environment that I could download the whole thing and not feel the internet is even necessary to code in it. Am I asking too much in this always-on Internet connected world?


How do you learn to take a more OO approach to problems?

I have been learning C# and am trying to tackle some common projects / works of my own to become even better. Currently I am working on understanding the Mars Rover Problem. I read the description and have seen several solutions, they seem nice and follow the principles of OO design.   * How do you come to understand what classes you need to make for a project?   * Is there a book I can read to grasp the concept of OO design better? I understand in theory, but I just don't get how and what I would do when actually given a problem. For instance I see the Mars Rover problem and instantly in my head I think Ok I can get that done with just 3 classes, a Rover, Grid and a CommandCenter class. Then I look at online examples and there are a lot more classes, interfaces and overall breakdown.


Learning good OOP design and unlearning some bad habits

> **Possible Duplicate:**   >  What books or resources would you recommend to learn practical OO design > and development concepts? I have been mostly a C programmer so far in my career with knowledge of C++. I rely on C++ mostly for the convenience STL provides and I hardly ever focus on good design practices. As I have started to look for a new job position, this bad habit of mine has come back to haunt me. During the interviews, I have been asked to design a problem (like chess, or some other scenario) using OOP and I doing really badly at that (I came to know this through feedback from one interview). I tried to google stuff and came up with so many opinions and related books that I don't know where to begin. I need a good through introduction to OOP design with which I can learn practical design, not just theory. Can you point me to any book which meets my requirements? I prefer C++, but any other language is fine as long as I can pick-up good practices. Also, I know that books can only go so far. I would also appreciate any good practice project ideas that helped you learn and improve your OOP concepts.


Local Stack vs Call Stack

On the matter of Recursion: When you create a recursive function, you create a call stack. Ok, no problem; However, a comment on this page (look for comments by "LKM") triggered my curiosity (and google was no help):   * What is a local stack?   * Why would it be faster than a call stack?   * How would you actually implement it (pseudo-code, js/php/ruby/python are ok)? Subsidiary question (might deserve another question, but I don't know on which (.*\\.)?stack.*\\.com to ask): In these conversations about programming, I often see the "recursion" theme and how bad/newbie programmers don't grok it. I'm self-taught, and I never understood what the big fuss is all about. I use recursion a lot in my everyday coding, both for solving problems and sometimes just because I think they are beautiful. But these articles make me feel like maybe there is something there I just don't see. So:   * What's all the fuss about recursion? What's there not to grok?


Many small scripts, one repository or multiple?

A co-worker and myself have run into an issue that we have multiple opinions on. Currently we have a git repository that we are keeping all of our cronjobs in. There are about 20 crons and they are not really related except for the fact that they are all small python scripts and essential for some activity. We are using a `fabric.py` file to deploy and a `requirements.txt` file to manage requirements for all of the scripts. Our issue is basically, do we keep all of these scripts in one git repository or should we be separating them out into their own repositories? By keeping them in one repository it is easier to deploy them onto one server. We can use just one cron file for all the scripts. However this feels wrong, as the 20 cronjobs are not logically related. Additionally, when using one `requirements.txt` file for all the scripts, it's hard to figure out what the dependencies are for a particular script and they all have to use the same versions of packages. We could separate all of the scripts out into their own repositories but this creates 20 different repositories that need to be remembered and dealt with. Most of these scripts are not very large and that solution seems to be overkill. A related question is, do we use one big crontab file for all cronjobs, or a separate file for each? If each has their own, how does one crontab's installation avoid overwriting the other 19? This also seems like a pain as there would then by 20 different cron files to keep track of. In short, our main question and issue is do we keep them all closely bundled as one repository or do we separate them out into their own repository with their own requirements.txt and fabfile.py? We feel like we're also probably looking over some really simple solution. Is there an easier way to deal with this issue?


Month long creative challenges for programmers?

Does anybody know of any one month creative challenges for programmers, sort of like National Novel Writing Month (NaNoWriMonth) but for programmers. One month in which you must create something, not just a series of challenges for you to overcome, or problems for you to solve. Something like: National Website Building Month (NaWebBuMo), or National Game Building Month (NaGaBuMo), but real instead of fabrications spun from my mind? I'm looking for something that asks that you have a (relatively) finished product at the end of thirty days.


Distance Education in Computer Science - HCI

I have been a software engineer / graphic designer for a few years and have recently been considering furthering my education in the field. (It was actually a very generous Christmas present) I would primarily be interested in something like Human Computer Interaction or a similar "creative technology" that involves heavy UI/UX Design, prototyping or Information Architecture. Anyways - I still plan on working full-time and was looking into part-time distance programs and was wondering if anyone had some experience with pursuing a similar degree (either from a distance or in-person) and could share their experiences. Thanks!


Writing Tests for Existing Code

Suppose one had a relatively large program (say 900k SLOC in C#), all commented/documented thoroughly, well organized and working well. The entire code base was written by a single senior developer who no longer with the company. All the code is testable as is and IoC is used throughout--except for some strange reason they did not write any unit tests. Now, your company wants to branch the code and wants unit tests added to detect when changes break the core functionality.   * Is adding tests a good idea?   * If so, how would one even start on something like this? **EDIT** OK, so I had not expected answers making good arguments for opposite conclusions. The issue may be out of my hands anyway. I've read through the "duplicate questions" as well and the general consensus is that "writing tests is good"...yeah, but not too helpful in this particular case. I don't think I am alone here in contemplating writing tests for a legacy system. I'm going to keep metrics on how much time is spent and how many times the new tests catch problems (and how many times they don't). I'll come back and update this a year or so from now with my results. **CONCLUSION** So it turns out that it is basically impossible to just add unit test to existing code with any semblance of orthodoxy. Once the code is working you obviously cannot red-light/green-light your tests, it usually not clear which behaviors are important to test, not clear where to begin and certainly not clear when you are finished. Really even asking this question misses the main point of writing tests in the first place. In the majority of cases I found it actually easier to re-write the code using TDD than to decipher the intended functions and retroactively add in unit tests. When fixing a problem or adding a new feature it is a different story, and I believe that this is the time to add unit tests (as some pointed out below). Eventually most code gets rewritten, often sooner than you'd expect--taking this approach I've been able to add test coverage to a surprisingly large chunk of the existing codebase.


How do you learn to program?

> **Possible Duplicates:**   >  I still can't figure out how to program?   >  I'm graduating with a Computer Science degree but I don't feel like I know > how to program I don't known if you guys have super brains specifically for programming but I would like to know how you do manage to learn, understand and apply Java programming. I am in grade 11 and we have learnt statements, objects, classes and arrays. We get programming test each week and I'm failing them. Now we have a project to do BlackJack using a JPanel form. Also memorizing the while loop is not the problem; I think that the problem is applying it to the situation (my friend never programs the same way as the teacher but still gets the same results).


Is it necessary to map integers to bits in a genetic algorithm?

From what I've read, genetic algorithms are usually (always?) applied to chromosomes of bits. So if a problem involves maximizing a function that takes integer values, the integers are first encoded as bits. Is this mapping necessary? It seems that you could take chromosomes of integers and apply crossover and mutation directly. So, if I have a function that takes 35 integer inputs, I can just apply the genetic operators to those integers, rather than on the 35xB bits (where B is the number of bits needed to encode an integer). Is there a reason this isn't done? Perhaps the algorithm would suffer because the problem is defined more coarsely (that is, a problem can be defined with shorter chromosomes if we're not using bits), but I'm curious if anyone has a better answer.


Is there a license where all rights are granted?

The licenses I know, including open source and the less restrictive ones like BSD, make it mandatory to:   * Retain the copyright notice, and/or:   * Indicate that the precise part of source code was written by the original author. Let's say I want to share source code I've written and I want to grant all rights, including the right to:   * Remove the copyright notice or substitute another one,   * Sell the source code or use it in a commercial product with no restrictions,   * Never indicate that this source code was written by me¹, but at the same time disclaim any warranty as it is the case in BSD license. Are there licenses which match this case? Note: public domain is not a solution, since the term is unclear and change from one country to another. * * * ¹ Why would anyone do that? Because we all have pieces of code which are not worth real licensing, but still useful for the community (example: removing diacritics from a text). Providing it "completely free" is in this case much for friendly that saying that in order to use your code, the person must read a few paragraphs or pages of an UNREADABLE ALL CAPITAL text, understand it, accept it, and then copy-paste your name and copyright notice every time the code is used.


Switch to Java?

I have been doing .NET and MS tech/arcitecture for 4+ years. I have reached a dead end in my current job and is considering moving to a new job. Most of the current available jobs in my city are Java based. J2EE and the like. Is it wise to leave all those years of experience and start from scratch in the Java world?


Possibility to switch over to Java from .Net

I am an MCA fresher and will be working on dot Net for next few months (almost 10-12 months). After that I want to switch over to Java. How is the possibility that I can switch over to it? What type of preparation I am supposed to do? I am also planning to appear for SCJP but don't have any knowledge how to get registered an registration fees. Please also guide me what is company's approach towards the candidates switching their technologies. What are the things that companies look for?


Planning Poker and wordy developers

My team is composed of 4 developers; all seasoned and skilled. One of them is a wordy, well intended chap who insists on defining the technical solution to our stories before we put down our estimates with Planning Poker. He refuses to estimate if he doesn't have a rough idea of the agreed technical solution (which sounds reasonable, right?). The problem is that our estimating sessions are taking forever to finish!! In your experience, how do you deal with this kind of personality when playing the planning poker?


How should I implement Transaction database EJB 3.0

In the CustomerTransactions entity, I have the following field to record what the customer bought:               @ManyToMany     private List<Item> listOfItemsBought;      When I think more about this field, there's a chance it may not work because merchants are allowed to change item's information (e.g. price, discount, etc...). Hence, this field will not be able to record what the customer actually bought when the transaction occurred. At the moment, I can only think of 2 ways to make it work.   1. I will record the transaction details into a String field. I feel that this way would be messy if I need to extract some information about the transaction later on.   2. Whenever the merchant changes an item's information, I will not update directly to that item's fields. Instead, I will create another new item with all the new information and keep the old item untouched. I feel that this way is better because I can easily extract information about the transaction later on. However, the bad side is that my Item table may contain a lot of rows. I'd be very grateful if someone could give me an advice on how I should tackle this problem. **UPDATE:** I'd like to add more information about the current design.               public class Customer implements Serializable {         @OneToMany         private List<CustomerTransactions> listOfTransactions;     }          public class CustomerTransactions implements Serializable {         @ManyToMany         private List<Item> listOfItemsBought;     }          public class Merchant implements Serializable {         @OneToMany         private List<Item> listOfSellingItems;     }


name convention for variables in C#

I'm watching a video on C# about Variables. The author declares a variable inside a method and he named it like this: string MyName ="James"; my question is: which convention is recommended by .Net Framework. Is it Pascal casing as in the above example or is it camel case?


How/Where do I give my github commit a version?

I 'm just learning to give project versions. I understand writing details about the changes in my project when committing, but where should I put my version number for my project?


what is storing data in constant space?

"bloom filter allows us to store data in constant space" Can someone explain what exactly does that sentence means?


Why would I learn C++11, having known C and C++?

I am a programmer in C and C++, although I don't stick to either language and write a mixture of the two. Sometimes having code in classes, possibly with operator overloading, or templates and the oh so great STL is obviously a better way. Sometimes use of a simple C function pointer is much much more readable and clear. So I find beauty and practicality in both languages. _I don't want to get into the discussion of "If you mix them and compile with a C++ compiler, it's not a mix anymore, it's all C++" I think we all understand what I mean by mixing them._ Also, I don't want to talk about C vs C++, this question is all about C++11. C++11 introduces what I think are significant changes to how C++ works, but it has introduced many special cases, exceptions and irregularities that change how different features behave in different circumstances, placing restrictions on multiple inheritance, identifiers that act as keywords, extensions of string literals, lambda function variable capturing, etc. I know that at some point in the future, when you say C++ everyone would assume C++11. Much like when you say C nowadays, you most probably mean C99. That makes me consider learning C++11. After all, if I want to continue writing code in C++, I may at some point need to start using those features simply because my colleagues have. Take C for example. After so many years, there are still many people learning and writing code in C. Why? Because the language is good. What good means is that, it follows many of the rules to create a good programming language. So besides being powerful (which easy or hard, almost all programming languages are), C is regular and has few exceptions, if any. C++11 however, I don't think so. I'm not sure that the changes introduced in C++11 are making the language better. So the question is: **Why would I learn C++11?**


Where does "method" as a special term in OOP originate?

"Method" is a special term in Object-Oriented Programming. Does anyone know when the word began to be used in this particular sense, and in connection with what programming language or other branch of quantitative learning?


Serializing network messages

I am writing a network wrapper around `boost::asio` and was wondering what is a good and simple way to serialize my messages. I have a message factory which can take care of dispatching the data to the correct builder, but I want to know if there are any established solutions for getting the binary data on the sender side and consequently passing the data for deserialization on the receiver end. Some options I've explored are: passing a pointer to a `char[]` to the serialize/deserialize functions (for serialize to write to, and deserialize to read from), but it's difficult to enforce buffer size this way; building on that, I decided to have the serialize function return a `boost::asio::mutable_buffer`, however ownership of the memory gets blurred between multiple classes, as the network wrapper needs to clean up the memory allocated by the message builder. I have also seen solutions involving `streambuf`'s and `stringstream`'s, but manipulating binary data in terms of its string representation is something I want to avoid. Is there some sort of binary stream I can use instead? What I am looking for is a solution (preferrably using boost libs) that lets the message builder dictate the amount of memory allocated during serialization and what that would look like in terms of passing the data around between the wrapper and message factory/message builders. PS. Messages contain almost exclusively built-in types and PODs and form a shallow but wide hierarchy for the sake of going through a factory. Note: a link to examples of using `boost::serialization` for something like this would be appreciated as I'm having difficulties figuring out the relation between it and buffers.


How do you run a sprint retrospective to maximize participation and honesty? And what about follow up on action items?

I've seen it done as a free-for-all where the scrum master just asks everyone to throw out comments. Or a time-boxed session where "anonymous" comments are posted on the walls bucketed by category. My current team is constrained by being spread out, so it has be done online/over the phone. What is everyone's best experience with soliciting constructive feedback? And how do you follow through on action items for improvement?


How analysis is different from design?

I'm sure you all have heard managers saying that "we need an analyzer", or "we need a designer". While I'm a .NET developer, I hardly can differentiate an analyzer from a designer (not web designer or UI designer). Who is analyzer? Who is designer? Do they overlap?


Are "Proactive" designs on new projects useful?

When starting a new project, are "proactive" designs useful? I mean, if you create a UML diagram/Activity diagram/Use Case/Class diagram/etc. for anything and everything can think of, then when you _think_ you're done, you start coding. Afterwards, you realize an important feature or method was left out. All your spiffy UML diagrams are nice stacks of worthless paper now. Is it easier/better to design one class, work on it a bit, refine it, then work on it more?


I think client's project will be a flop; should I discuss with him?

I have a meeting with a prospective client tomorrow for a certain e-commerce project he wants to commission. I had an overview of it over the phone and from what I understand there are gazillion such concepts already floating and most of them are disasters and I have reasons to believe that his project is significantly likely to have the same fate. Should I raise/discuss the commercial feasibility of his idea with him or simply accept the project, give my best and leave out all the rest?


Is it best to minimize using pointers in C?

I think most people would agree that pointers are a major source of bugs in C programs (if not the greatest source of bugs). Other languages drop pointers entirely for this reason. When working in C, then, would it be best to avoid using pointers whenever practical? For example, I recently wrote a function like this:               void split(char *record, char *delim, int numfields, int fieldmax, char result[numfields][fieldmax]);      While not as versatile as a dynamically allocated variable, in that it requires the programmer to know the number of fields in advance and anything over `fieldmax` is truncated (which is sometimes acceptable), it eliminates the need for memory management, and the potential for memory corruption. I think this is a pretty good trade, but I was wondering what the opinions of other programmers on this were.


Should non-interface code be hidden from the client?

I am working on a library which had several headers that are meant to only be used by the library itself. I also have a few classes and functions in headers that I do not want the client to use. For instance, I have a header that contains debugging functions, but they should not be used outside of the library as it could cause problems. Should this code be hidden from the client? If so, how?


How Do Computers Work?

This is almost embarrassing ask...I have a degree in Computer Science (and a second one in progress). I've worked as a full-time .NET Developer for nearly five years. I generally seem competent at what I do. **But I Don't Know How Computers Work!** Please, bare with me for a second. A quick Google of 'How a Computer Works' will yield lots and lots of results, but I struggled to find one that really answered what I'm looking for. I realize this is a huge, huge question, so really, if you can just give me some keywords or some direction. I know there are components....the power supply, the motherboard, ram, CPU, etc...and I get the 'general idea' of what they do. But I really don't understand how you go from a line of code like `Console.Readline()` in .NET (or Java or C++) and have it actually _do_ stuff. Sure, I'm vaguely aware of MSIL (in the case of .NET), and that some magic happens with the JIT compiler and it turns into native code (I think). I'm told Java is similar, and C++ cuts out the middle step. I've done some mainframe assembly, it was a few years back now. I remember there were some instructions and some CPU registers, and I wrote code....and then some magic happened....and my program would work (or crash). From what I understand, an 'Emulator' would simulate what happens when you call an instruction and it would update the CPU registers; but what makes those instructions work the way they do? Does this turn into an Electronics question and not a 'Computer' question? I'm guessing there isn't any practical reason for me to understand this, but I feel like I should be able to. (Yes, this is what happens when you spend a day with a small child. It takes them about 10 minutes and five iterations of asking 'Why?' for you to realize how much you don't know)


Is it ok to write "extra" unit tests?

My understanding of how TDD should work is that you write a failing test for the next bit of functionality you want to add to a function or object, code until the test passes and then write the next test. Is it ever ok to write tests that pass with the code as is? One example of that happened today. I was writing a function that could Manchester encode an arbitrary number of bits. I wrote failing tests for encoding one single bit and coded until it passed, then wrote a failing test for passing two bits to the function and coded until it passed. But the solution I used to handle two bits made the code work for any number of bits. Because passing a byte to the function will be it's most common use, I added a unit test to make sure it worked for 8 bits, which did in fact pass. Did I violate TDD principles? Is there anything wrong with adding redundant tests just for my peace of mind? I understand part of the problem is that I could have written a faulty tests and would never know because it didn't fail in the first place, but I'm not sure what the alternative is.


Creating a webservice API - how much "credit" should I give the client/developer

When creating a web service API, how much should I count on the developer to act by my rules? We are really aimed on creating an API so the developers shouldn't develop client side logic too much... for example, if in one of my methods we require the client to send us a unique ID - we are relying on the client that the ID sent is really unique - so the client should also keep track of it's requests and add logic to it's code. is it ok or should we try to solve ths kind of issues in a different more transparent ways?


Split skilled Scrum team

A Scrum team has been forced together and is feeling very uncomfortable. They are constantly saying that it is not working for them and that they are fed up with hearing the words _Agile_ and _Scrum_. They are feeling that the business if simply forcing a new buzz word on them. They don't have any Agile experiance before this, including the Scrum master. Also, the team consists of a very disconnected skill set.   * 1 manual tester   * 1 .NET developer   * 2 Cobol developers   * A BA turned PO   * The scrum master The .NET dev doesn't want to learn Cobol and the Cobol devs don't want to learn .NET. I've been asked to help out with making them more Agile, however, one of the main tennets of Agile is that the power for change must lie with those with the domain knowledge. Kanban could help, but it wouldn't tackle the broken skill set. _Any advise on where to start?_ Currently my plan is to start with the PO and see how stories are being written, but I am not sure where to go from there.


Uniform variable naming across HTML, CSS and JS

I'm sorry if this is opinion based, but how do you guys make sure that HTML, CSS and JS have uniform variable naming? I use vim, but I don't know if IDEs are smart enough to do this on their own. In case it's not clear, the issue is that if I change a variable name in HTML, I need to go and change the variable names in CSS and JS.


What's a "Polymorphic method"?

Sometimes people use the phrase "Polymorphic method/function". Does it mean:   1. A method that takes a Polymorphic type as a parameter, and performs some operation on it. By "Polymorphic type" I mean a super-type with multiple sub-types.   2. An abstract or virtual method in a super-type, with multiple sub-types that implement/override the method differently.


Are 'The Pragmatic Programmer' and 'The Mythical Man Month' good books for people with limited practical experience programming

I was once told to read the books titled 'The Pragmatic Programmer' and 'The Mythical Man Month'. I have very little experience programming (basic HTML, CSS and JS). If I were to purchase these books, read through them, would it be beneficial to me with such a limited understanding or would I benefit from them? I ask because I am currently learning HTML5 and CSS3 from an online source and want some general reading material to add to my kindle.


Designing online exam

I need to design an online exam server for an exam like GRE in which question difficulty increases if you answer correctly and decreases if you answer wrong. > Questions are multiple choice questions > > Difficulty scale of question is 1-10, 1 being the easiest and 10 being the > hardest. > > If two continuous questions are answered wrong, decrease the difficulty by 1 > and if two questions answered right increase the difficulty by 1. > > Test starts with a question of difficulty level of 4. > > Question carries marks equal to its difficulty. **My question is** : Which data structure should I use to store the questions? Which is the best algorithm to fetch the question by its difficulty, etc.? I am currently considering a doubly linked-list:               struct node {              int data;         node *prev;         node *next;         int n         int MAX;     };      Here, 2 n's we need to store. One is MAX (actual size) and n is possible random size to pick questions from n - MAX we selected already for each double linked list you can add extra int data where you can store prev link, next link, pointer to array, int Maxdata(MAX size), int n(current size). Each node is a pointer to an array of questions for each level. If the answer is correct, it moves next node and picks the random questions from that list, otherwise it moves to the previous node and picks a question. For example, let's say an array has 10 questions 1 - 10. Since the array size is n = 10, you know that   1. now you selected a random question rand() % 10 = 6 th questions   2. now swap the question number 6 & 10, make n-- and return the 6th question   3. now n = 9 so next time 10th will not be considered   4. random will return 1 - 9 only Is there any better way of doing it?


Is there a difference learning VBA on Mac vs Windows

I'm a programmer who'd like to learn VBA, but I don't have a Windows box. However, I have a MacBook Pro with the latest version of MS Office for Mac on it (2011 I think). Since I work in a .Net shop, I'd like to learn VBA. Is there anything I'm missing out on not having a Windows machine to learn it on?


Why isn't functional language syntax more close to human language?

I'm interested in functional programming and decided to get head to head with Haskell. My head hurts... but I'll eventually get it... I have one curiosity though, why is the syntax so cryptic (in lack of another word)? Is there a reason **why it isn't more expressive** , more close to human language? I understand that FP is good at modelling mathematical concepts and it borrowed some of it's concise means of expression, but still it's not math... it's a language.


Assignments in mock return values

(I will show examples using php and phpunit but this may be applied to any programming language) The case: let's say we have a method `A::foo` that delegates some work to class `M` and returns the value as-is. Which of these solutions would you choose:               $mock = $this->getMock('M');     $mock->expects($this->once())          ->method('bar')          ->will($this->returnValue('baz'));          $obj = new A($mock);          $this->assertEquals('baz', $obj->foo());      or               $mock = $this->getMock('M');     $mock->expects($this->once())          ->method('bar')          ->will($this->returnValue($result = 'baz'));          $obj = new A($mock);          $this->assertEquals($result, $obj->foo());      or               $result = 'baz';     $mock = $this->getMock('M');     $mock->expects($this->once())          ->method('bar')          ->will($this->returnValue($result));          $obj = new A($mock);          $this->assertEquals($result, $obj->foo());      Personally I always follow the 2nd solution, but just 10 minutes ago I had a conversation with couple of developers who said that it is "too tricky" and chose 3rd or 1st. So what would you usually do? And do you have any conventions to follow in such cases?


What would you think about a new Java persistence tool, that's not really an ORM?

## Persistence in Java Over the past years, I have gathered experience in the field of persistence abstraction in Java, using concepts such as EJB 2.0, Hibernate, JPA and home- grown ones. They seemed to me to have a steep learning curve and lots of complexity. In addition, as a big fan of SQL, I also thought that many abstraction models provide too much abstraction over SQL, creating concepts such as "criteria", "predicates", "restrictions" that are very good concepts, but not SQL. The general idea of persistence abstraction in Java seems to be based on the Object-relational model, where RDBMS are somehow matched with the OO world. The ORM-debate has always been an emotional one, as there does not seem to exist a single solution that suits everyone - if such a solution can even exist. ## jOOQ My personal preference of how to avoid ORM-related problems is to stick to the relational world. Now the choice of data model paradigm should not be the topic of discussion as it is a personal preference, or a matter of what data model best suits a concrete problem. The discussion I would like to start is around my very own persistence tool called jOOQ. I designed jOOQ to provide most of the advantages modern persistence tools have:   * A Domain Specific Language based on SQL   * Source code generation mapping the underlying database schema to Java   * Support for many RDBMS Adding some features that few modern persistence tools have (correct me if I'm wrong):   * Support for complex SQL - unions, nested selects, self-joins, aliasing, case clauses, arithmetic expressions   * Support for non-standard SQL - stored procedures, UDT's, ENUMS, native functions, analytic functions Please consider the documentation page for more details: http://www.jooq.org/learn.php. You will see that a very similar approach is implemented in Linq for C#, although Linq is not exclusively designed for SQL. ## The Question Now, having said that I'm a big fan of SQL, I wonder whether other developers will share my enthusiasm for jOOQ (or Linq). Is this kind of approach to persistence abstraction a viable one? What are the advantages / disadvantages you might see? How could I improve jOOQ, and what's missing in your opinion? Where did I go wrong, conceptually or practically? ## Critical but constructive answers appreciated I understand that the debate is an emotional one. There are many great tools out there that do similar things already. What I am interested in is critical but constructive feedback, based on your **own experience** or articles you may have read.


What is the aim of software testing?

Having read many books, there is a basic contradiction: Some say, "the goal of testing is to find bugs" while other say "the goal of the testing is to equalize the quality of the product", meaning that bugs are its by-products. I would also agree that if testing would be aimed primarily on a bug hunt, who would do the actual verification and actually provide the information that the software is ready? Even e.g. Kaner changed his original definition of testing goal from bug hunting to quality assessment provision but I still cannot see the clear difference. I perceive both as equally important. I can verify software by its specification to make sure it works and in that case, bugs found are just by products. But also I perform tests just to break things. Also what definition is more accurate? Note above I am primarily referring to software testing as a process.


Should I still consider using Appcelerator Titanium for building mobile apps if I don't have any web dev skills?

I'm an experienced desktop developer who's recently begun writing iOS apps and would like to venture into Android development as well. I've been hearing a lot of talk surrounding the Appcelerator Titanium framework lately, but I'm not sure I fully understand it's purpose. As I understand it, it's a framework for building native mobile apps using web technologies. If I don't have any web dev skills, are there any ways that using Appcelerator Titanium would benefit me? Thanks for your thoughts, I'm going to continue researching this right now.


Forking an open source project nicely

It's time. You've worked long and hard to add your vision to the open source project you love, on which you've worked, debated, and to which you've contributed inestimable amounts of code and insight. But it's not going to work out with the existing developers. **You finally need to fork the code.** How do you do this and remain on the best terms possible with the existing project? How do you not say, "Oh yeah? Fork you!" Aside from the mechanics of cross-polination and assuming that the reasoning for forking is sound, logical, and acceptable, what issues come up? Competition? Resource sapping? User poaching? How do you go through this arguably difficult and long process until you've diversified enough that these are no longer seen as problems? Rather than discussing the reasoning behind the decision, please assume that you have already been convinced that forking the code is the best overall solution, and now the point is to move forward in the best way possible.


What is the name for a NON-self-calling function?

I have a collection of normal functions and self-calling functions within a javascript file. In my comments i want to say something along the lines of "This script can contain both self-calling and XXX functions", where XXX is the non-self-calling functions. "Static" springs to my mind, but feel that would be incorrect because of the use of static methods in PHP, which is something completely different. Anyone any ideas? Thanks!


Types of databases

I read that there exists three main types of databases               * Transactional (Client-Server database// OLTP database)     * Decision support system (DSS) (Data warehouse database // Data mart // Reporting database)     * Hybrid      What is the type of database considered for a social network, like Facebook or Twitter? I guess the category is:               Transactional > Client -Server database.      From the book: **A transactional database is a database based on small changes to the database (that is, small transactions).The database is transaction-driven. In other words, the primary function of the database is to add new data, change existing data, delete existing data, all done in usually very small chunks, such as individual records.** But, as I said, I am not sure.


How to unit test a missing case in a switch statement where all cases are true

I often use `enum` types in my code with a switch to apply logic to each type. In these cases it's important that each `enum` has code implemented. For example;               public enum eERROR     {         REQUIRED,         DUPLICATE,         UNKNOWN,         MISSING_VALUE     }          public void Error(eERROR pError)     {         switch (pError)         {             case eERROR.REQUIRED:                 // ......                 return;             case eERROR.DUPLICATE:                 // ......                 return;             case eERROR.MISSING_VALUE:                 // ......                 return;             case eERROR.UNKNOWN:                 // ......                 return;         }              throw new InvalidArgumentException("Unsupported error type");     }      At the bottom I've added an exception as a last resort check that a programmer remembered to add any new `enum` types to the `switch` statement. If a new type is added to `eERROR` the exception _could_ be thrown if the code is not updated. Here is my problem. The above code generates unit test coverage of only **99%** because I can not trigger the exception. I could add a generic `unhandled` to `eERROR` and call `Error(eERROR.unhandled)` just to get **100%** coverage, but that feels like a hack to solve something that is not a problem just to get full coverage. I could remove the line but then I don't have the safety check. Why is _99%_ a problem? because the code base is so large that any uncovered method doesn't move coverage to _98%_. So I always see _99%_ and don't know if I missed a method or two. How can I rewrite `Error()` so that all newly added enums that are not added to the switch will be caught somehow by the programmer, and also be covered by tests. Is there a way of doing it without added a dummy enum?


How to deal with Interviews where HR is missing?

The situation: Person X, who already has a full-time job, applies to Company A. Money is good at A, but the real reason X had applied is 'cause the work at A really excites X. Next someone from the technical dept. from A calls up X, gives some assignment and holds a round of technical interview over phone. X does very well in all of it so far. Finally, X asks the tech guy from A "What's next?" The guy says we'd get back to you in 3-4 days time and then doesn't call up in the next 3-4 days. X is confused. He's got the mail-id of the tech guy but not sure if he should inquire -- this is no HR after all. In fact HR was never anywhere in this process. What should he do? **My Take** : Don't mail. You already have a full-time job and this shows desperation. **The Problem** : This isn't me and people tell me that some companies wait for candidate to get back just to double check their interest level. * * * **Update** Mailing the engineering team proved very useful, they apologized for being busy and now I am told the next round is early January.


Which is more important in a web application code promotion hierarchy? production environment to repo resemblance or unidirectional propagation?

Lets say you have a code promotion hierarchy consisting of several environments, (the polar end) two of which are development (dev) and production (prod). Lets say you also have a web application where important (but not developer controlled) files are created (and perhaps altered) in the production environment. Lets say that you (or someone above you) decided that the files which are controlled/created/altered/deleted in the production environment needed to go into the repository. Which of the following two sets of practice / approaches do you find best:   1. Committing these non-developed file modifications made in the production environment so that the repository resembles the production environment as closely and as often as possible.   2. Generally ignoring the non-developed production environment alterations, placing confidence in backups to restore the production environment should it be harmed, and keeping a resolution to avoid pushing developments through the promotion hierarchy in the reverse direction (avoiding pushing from prod to dev), only committing the files found in the production environment if they were absolutely necessary in other environments for development. So, 1 or 2, and why? PS - I am currently slightly biased toward maintaining production environment to repository resemblance (option 1), but I keep an open mind and would accept an answer supporting either.


Question about modeling with MVC (the pattern, not the MS stuff / non web)

I'm working on an application in which I'm looking to employ the MVC pattern, but I've come up against a design decision point I could use some help with. My application is going to deal with the design of state-machines. Currently the MVC model holds information about the machine's states, inputs, outputs, etc. The view is going to show a diagram for the machine, graphically allowing the user to add new states, establish transitions, and put the states in a pleasing arrangement, among other things. I would like to store part of the diagram's state (e.g. the x and y state positions) when the machine information is stored for later retrieval, and am wondering how best to go about structuring the model(s?) for this. It seems like this UI information is more closely related to the view than to the state-machine model, so I was thinking that a secondary model might be in order, but I am reluctant to pursue this route because of the added complexity. Adding this information to the current model doesn't seem the right way to go about it either. This is the my first time using the MVC pattern so I'm still figuring things out. Any input would be appreciated.


Alternative Scripting Language to Lua?

I would like to add scripting support to an applications and with plenty scripting languages available I am a bit overwhelmed. At first I thought about Python but I guess Python is a little too big for my taste and the application (although I like it very much, it gets a lot of things right in my opinion while the syntax is clean and simple especially if you are not doing heavy OOP). I am also very fond of Lisps. I like scheme and it is the perfect extension language - at least in some ways, but I would like to stay syntactically more conservative. I remember having heard a lot of positive things about Lua and indeed Lua seems a good possibility. Unfortunately there is this one thing that really "turns me off": Its the `local` keyword for local binding. This is really ugly to my taste and I frankly do not quite grok why languages are still designed this way and in essence knowing about `local`. This is also a major drawback of JavaScript in my opinion and I feel like it all boils down to bad language design. My major concern is, that a user might just override a function from just within her/his function just by omitting `local`. But then Lua gets a lot of things right, size, speed, and it is surprisingly scheme-esque. Yet I am really afraid that it is not suitable for non- programmers who have no sense of scope.   * Any alternatives on the horizon?   * Might hacking the Luacore to make local the default be an option? Lua sources appear to be quite decent and modular, so this would be an interesting project ;)


Is it safe to assume that one controller will only ever use one primary model?

So, I'm designing an MVC framework. In the name of keeping everything statically typed and non-magical, I've come to quite a problem with "automatically" passing models to a controller. So, traditionally, I usually see no more than one model used at a time in a controller as far as automatic-population. For instance, take this tutorial. There is a method like this in the controller:               [HttpPost]     public ActionResult Create(Movie newMovie)     {              if (ModelState.IsValid)         {             db.AddToMovies(newMovie);             db.SaveChanges();                  return RedirectToAction("Index");         }         else         {             return View(newMovie);         }     }      My concern is passing a `Movie` model to the `Create` method which is populated by FORM values "magically". In my API, this should be easily possible and would look something like this at routing:               var movie=router.Controller((context) => new MovieController(context))                      .WithModel(() => new Movie());     movie.Handles("/movie/create").With((controller, model) => controller.Create(model));      My concern with this is that it is much harder to have multiple models because of limitations with C#'s type system. Of course, the controller can always manually create the models from FORM values and such, but it's not nearly as pretty. So, my question: Is it common to have something like `Foo(Movie model)` and `Bar(SomeClass model)` in the same controller class? Is it a good idea for me to attempt to support such a scenario, or is it just a symptom of putting too much unrelated logic in a single controller? Note: if you're concerned about how this fluent API is even possible, the answer is generic delegates.. lots and lots of generic delegates :) (but so far very little reflection)


How to develop a Delete command through Behavior Driven Development?

I am trying to develop a Delete command through BDD that will simply delete an user from the database, given user_id as a parameter. What can be some possible behavioral tests that will drive me to write a proper implementation for the command?


Writing OOPS code in Non Object Oriented Language

I was reading some article on the internet as I was preparing for interview and I found out below statement- > Writing object oriented code, even in non-object oriented language? Is this statement true?? Can anybody provide an example to justify the above statement if somebody asked me this question in the interview. And when do we write object oriented code in non object oriented language? I mainly worked in Java. So any example corresponding to that will be helpful. Thanks in advance.


Is the market of small-scale development/production tools that difficult?

I was wondering, is there an economic rationale in developing and marketing a small tool (standalone or rather plugin)? Of course, let's assume that the tool does indeed solve a real problem from the production process. And by small, I mean an application that can be developed by 1-2 developers within 2 years. Do you know any contemporary success stories? I have two observations that make me wonder:   1. Anyway I turn around people ask for free and preferably open-source tools. Even when the price is low, and the software is worth its price, I see this big reluctance to spend any money on commercial development software. An application author would probably have to assume that only a very small percentage of all people who might find his application useful, will actually purchase it.   2. I've seen a few good commercial software examples that after some time started offering free licenses. The most notable example for me was gDEBugger from Graphic Remedy. Last time I checked it didn't even had any worthy competitor (commercial or noncommercial) in the market of OpenGL debuggers. I have no idea what might have made them do that, other than poor sales.


Should I fork for a major re-write that uses a small amount of the original code?

I'm writing a library. It's a completely rewritten version of another one, to suit my needs (PCL compatibility, mainly). However, the API will be completely rewritten, as I'll need to change a lot of stuff around for PCL compliance. Also, as it is a rewrite, I won't be able to just start from the library and just change it bit by bit, as I typically see with forks. I tried that, but it just didn't work. So what should I do? Should I fork here or should I make a new library?


Deploy PHP project without giving away the source code?

I am working on developing range of web based software solutions. But the problem is that for some clients we need to deploy the applications in their local intranet. In such a situation I have to stick with Java as development language as I cannot give away the source code of the project. Now in order to tap on more consumers we put these solutions online. Now considering the fact that Java hosting is more expensive than PHP we are left with no choice but to again re develop the entire solution in PHP. Thus we end up having two version of same solution for maintenance and upgrading in different platforms. So can any point us to some good solution in which we can have the online solution and also have a deployable version of the application in which we can ship the application without its source code and at the same time we also need the application to be cost effective from hosting point of view?


How to find method and class usages along git repositories

We got some code in a git repository that's used along different projects (with git different repositories), the problem is that we got now so many different projects that's difficult to track which projects will be affected and how when there is a change in the shared module. Is there any way to find classes and methods usages along different git repositories? Or who would you manage an architecture like that?


Is it possible to shuffle team in between a sprint?

We are working on scrum framework. Now a situation arise that we have to shuffle 2-3 scrum team members in between sprints. Is it possible to shuffle sprint team members in between a sprint? What are the potential drawbacks of doing this?


Migrating Web based projects from Java to PHP

At our work place after hours of coding, testing and QA we have successfully added a couple of software tools in our product line. We specialize in web based software solutions so in order to tap on more users we are now considering putting our developed solutions online for hosting and providing online access to all our clients for their products. But what is coming in our way is that we have developed all these solutions in Java and compared to PHP Java hosting is very expensive. So we are now planing to migrate all these solutions to PHP while also maintaining their Java counterpart. How we should start with these migration task? We used AJAX in all our Java based solutions. Tech specs are   1. Front end web pages in JSP   2. Back end server side in Java using Apache Struts2   3. Database in MySQL   4. PDF report generation using iText PDF lib. for Java NB: We have started a little with Code Igniter Framework in PHP.


Java Frameworks

I would just want to ask what Java frameworks are worth learning, specially when it comes to web applications, but other frameworks are welcome too. Could you please state:   * The learning curve    * The availability of resources   * The performance of that framework   * Would you recommend it or not I want to study frameworks on my free time. If it's not too much a bother thanks to those that will answer! If it's too vast: How about for web applications? Should I learn Spring or Struts 2? iBatis or Hibernate? Stuff like that Still if it's vast: What frameworks would you recommend out there? Really. Anything. I want to learn and I'm used as a JEE guy now so if it's related with web app then I would take that as a bonus.


Can You Make An Entire Website With JavaScript?

I have looked at the aims of Java-script and it intends to `provide and enhanced user-interface and dynamic websites`. I am trying to get into the Web Development Business and am learning Javascript. But unfortunately, I have never seen an entire website implemented in Java script. Javascript is usually just used for Ads. People use things like PHP or ASP .NET (and C#) for serious web development. So will learning Javascript seriously enable me to make **Dynamic Websites** , and are there any good websites made with Javascript. Is Javascript a good choice for making websites? Is it even possible?


How do you keep consistent self confidence while coding?

As the number of bugs in a codebase increases, that number not only decreases the quality of the code, it also affects the mindset of the developers. Developer self-confidence falls when things are not going well. If self- confidence is not right, things more easily become a mess. How do you guys keep your self confidence up in these situations?


What algorithm should I use to find the shortest path in this graph?

I have a graph with about a billion vertices, each of which is connected to about 100 other vertices at random. I want to find the **length** of the shortest path between two points. I don't care about the actual path used. Notes:   * Sometimes edges will be severed or added. This happens about 500 times less often than lookups. It's also ok to batch up edge-changes if it lets you get better performance.   * I _can_ pre-process the graph.   * If it takes more than 6 steps, you can just come back with infinity.   * It's acceptable to be wrong 0.01% of the time, but only in returning a length that's too long.    * All edges have a length of 1.   * All edges are bidirectional. I'm looking for an algorithm. Psuedocode, english descriptions, and actual code are all great. I could use A*, but that seems optimized for pathfinding.   I thought about using Dijkstra's algorithm, but it has a step which requires setting the shortest-path-found attribute of every vertice to infinity _(If you're wondering about the use-case, it's for the Underhanded C Contest.)_


What is watershed in the context of image processing?

I am new to image processing using Python. Now I am learning OpenCV and the mahotas module in Python. Many functions in these modules are related to watershed of an image. I don't know what watershed means for an image. Here is an example from the OpenCV documentation: http://docs.opencv.org/search.html?q=watershed&check_keywords=yes&area=default