title: What alternatives are there for cross cutting concerns other than aspect oriented programming?

text: Aspect oriented programming promises to deal with cross cutting concerns, but I'm not completely sold on it yet. Have there been any other attempts to deal with this problem?


title: Programming as a conversation

text: I have often wondered if it would be possible to write a programming language that would work as a conversation. I would tell the computer that I want to store coordinates and it would ask what representation I would use. I would then ask to find the shortest path between points and it would ask if I want to use Djkstra's, brute force or use Floyd's? What research has been done towards producing a system like this?


title: What product is better: ADFSv2, Ping Identity, CS Siteminder?

text: I'm comparing different STS's for claims based authentication and am trying when it's appropriate to use each one. It appears that ADFSv2 should be used in all Windows Environments. Ping and Siteminder are more for the Unix side... although a sales rep said Ping was better for Windows, I didn't really understand "why" Any comparative information is much appreciated!


title: How to support different API Versions

text: I am writing a Rest API and am wondering how best to handle supporting the different versions. By this I don't mean how to define a URI as V2 or V3, but rather how to structure the code given that it'd need to:   * Support multiple versions at the same time, eg. V1 & V2 & V3 URIs must be live at the same time. I would retire V1 when say V4 comes in in order to constrain the amount supported at any one time.   * Avoid as much code duplication as possible   * Make it easy to add non-breaking changes to a version, without it impacting on other versions  It would seem that there are few approaches that could be taken:   * Use Git to control the versions, with a branch for the different versions (and old versions essentially having no new development work done on it). This would mean no code duplication as only the latest version is in the code, but previous versions would need to work with the new version of the DB until they are retired.    * Duplicate code so that each version is handled in the same application and has a totally separate code path, but this would mean a lot of duplication   * Re-use a lot of code across the versions, but this would make it harder to maintain as changing one version is more likely to impact a previous version Is there any best practice to deal with this problem as all options seem to have their own problems?


title: C#/C++ GUI development without drag and drop?

text: I'm currently programming Java, I have played around with C++ before, but I have never touched GUI as I feel "cheat-like" when using its drag and drop system. I feel good and enjoy programming my own GUI like I do in Java, it feels much more rewarding. Is there any way I can program the GUI for C#/C++ like in Java, without the drag and drop system, and if so could someone possibly recommend me a tutorial (A lot of the tutorials are using the drag and drop system)? So far I have tried researching this and really can't find much explaining how I would do it.


title: Simple dependency tree diagram generator

text: I have a need to produce a simple dependency tree diagram. The input data would be in the following simple format:               ITEM_NAME   DEPENDENCY     ----------------------------     ITEM_101    ITEM_75     ITEM_102    ITEM_77     ITEM_102    ITEM_61     ITEM_102    ITEM_11      This means that ITEM_101 depends on ITEM_75 and ITEM_102 depends on items ITEM_77, ITEM_61 and ITEM_11. So the diagram would have items ITEM_77, ITEM_61 and ITEM_11 in one vertical level and ITEM_102 would be below it with a line connecting each of the three dependencies to ITEM_102. The same would be for ITEM_101, ITEM_75 would be somewhere above it and there would be a line connecting it. In the real world this tree represents a hierarchy of scheduling jobs. We have a very extensive workload automation hierarchy in `Autosys` and I have heard that its front end utility has something like this tree visual representation, however, for some reason, that utility has been disabled by admins. My business users want to see this hierarchy in an easy-to-consume format. I was hoping that I won't have to program something like this from scratch because it seems like quite a common reporting requirement and the input data is simply formatted. My question is: is there a FOSS tool that takes standardized data input and produces such a hierarchical tree? Thanks


title: How do I mutate a value in a genetic algorithm using Gaussian distribution?

text: I've been reading 'Introduction to Evolutionary Algorithms'. This method is stated, but not described, and I can't find anything more specific online. p44/45 of 2nd Ed for reference. "adding to the current gene value an amount drawn randomly from a Gaussian distribution with mean zero and user-specified standard deviation" Would be great to get the step by step, from initial to mutated value, including how Gaussian distribution works (or a link to something that could fill that gap). Thanks!


title: Microkernel architectural pattern and applicability for business applications

text: We are in the business of building customizable web applications. We have the core team that provides what we call as the **core _platform_** (provides services like security, billing etc.) on top of which **core _products_** are built. These core products are industry specific solutions like telecom, utility etc. These core products are later used by other teams to build **_customer specific_ solutions** in a particular industry. Until now we have a loose separation between platform and core product. The customer specific solutions are build by customizing 20-40% of the core offering and re-packaging. The core-platform and core products are released together as monolithic apps (ear). I am looking to improvise the current situation so that there is a cleaner separation on these 3. This allows us to have evolve each of these 3 separately etc. I've read through the Mircokernel architecture and kind of felt that I can take apply the principles in my context. But most of my reading about this pattern is always in the context of operating systems or application servers etc. I am wondering if there are any examples on how that pattern was used for architecting business applications. Or you could provide some insight on how to apply that pattern to my problem.


title: Does the windows 8 store only support windows RT?

text: I'm in a project for creating a game engine and eventually a game, and we need ideas on how to get our game out into the internet. I had an idea with putting it onto the windows 8 store at a low cost(or free) in order to get the word out, but **does the windows 8 store only support apps programmed in windows RT?** Our game will be built in C++ / OpenGL / GLEW / Actionscript / GLM / etc.. , so we won't be using any windows RT functionality at all.


title: Entity-Attribute-Value table vs single table for storage of posts, events and pages

text: I am trying to decide whether to just use individual tables with more fields for storing posts, pages and events or using tables with basic fields plus having EAV tables as well for fields that are optional. Also EAV would allow to add more 'attributes' to each entity without actually changing the database at all (just changing the application code slightly). However, what I am worried about is performance. Would EAV decrease performance in such scenario (storing data like events)? Also, is it worth adding an EAV table like event_meta to the database just in case I will need to add extra fields/attributes to the model later on (when specs change and the system has to be expanded)? Currently I can think of two options:   1. Not using EAV tables and just having single tables for each entity type (posts, pages and events) and having all data (about 15 fields) in the entity table.   2. Use EAV tables to store optional data that is not usually entered by users (this would prevent the entity tables from having many empty fields) but store all required and crucial data in the entity tables. Also, for option two I might actually be able to just have one generic table 'posts' to instead of 3 tables posts, pages and events and just use more attribute-value rows in the EAV table (and have a type field in the posts table). However that would probably reduce the performance even more. Option 1 is much easier to implement. However option 2 might make it easier to extend the entities in the future as database would not have to ever be adjusted. Another important thing to consider is performance. What happens when we have millions of rows in the events_meta. Every time someone would view an event the application would have to perform queries on both tables which would be quite big and I am afraid that would reduce performance. So which option should I use for my situation?


title: Application Settings, Status and more as Singleton?

text: I am relatively new to programming (1yr field experience now) and I think that I am overusing the singleton pattern and I need some input on how to do it in a better way. Right now I am using singletons as an excuse for static global data. I use singleton for Application Status, Application Settings and also a lot for "Managers". Basically they are all objects which are needed by different parts of my application. I think this pattern makes it easier then creating one object and inject it into all parts that need this. Any downsides to this approach? Any suggestion regarding this matter?


title: Using single characters for variable names in loops/exceptions

text: I've had a couple of discussions with a co-worker about the use of single letter variable names in certain circumstances inside our codebase, at which we both disagree. He favours more verbose naming convention for these, and I do not. There are three scenarios in my opinion where I use single letter variable names:   * **Loops** \- `i` `for(int i = 0; i < 10; i++) { ... }`   * **Lambda expressions in C#** \- `x/y/z`: `.Where(x => x == 5)`   * **Exceptions** \- `e`: `try { ... } catch(ExceptionType e) { /* usage of 'e' */ }` These are the **only** scenarios where I would use it, and I obviously use more verbose naming conventions elsewhere. My colleague put forward the following arguments for exceptions and loops:   * `i` \- it doesn't mean anything.   * `e` \- it's the most common letter in the English language. If you wanted to search the solution for exceptions, you'd find lots of undesired instances of `e`. I accept these arguments, but have retorts that, if one does not know what `i` means in a for loop, then they probably shouldn't be a programmer. It's a very common term for loops and exceptions, as is `e`. I have also mentioned that, if one wanted, they could search for `catch` in the case of the exception. I realise that this is subjective, but then, one could argue that coding standards are just that - opinions, albeit opinions by academics. I would be happy either way, and will forward the results to him, but would rather that we (our company) continue to use a single coding standard, rather than have two developers with different opinions on what to use.


title: When do I need to use Session Replication?

text: I am working on a number of web projects for a firm. Most of the projects are about one or two pages of input and then doing a save to a MySQL database. My system administrators are pushing to try to get session replication working in JBoss, but I don't really see any need for it and all of its overhead. We need load balancing and clustering so if the server does go down we can move the new requests to the backup server, but I am not to big in session replication. This is very low volume projects. In my eyes, what are the odds of a user being in the project as the server goes down on the one or two pages? I am trying to convince the system administrators that session replication is an unnecessary complication in this instance. In my situation, should I be using session replication? If not, what are the best reasons to not use it so I can convince the system administrators?


title: Is it a bug or a task when something doesn't work, yet, in development process

text: We usually have this dilemma in our team. Sometimes, in order to implement a task or a story we find out that the system must be in a specific state. For example, a specific system configuration has to be made beforehand. The task / story can be completed and it is working as specified on it with the proper configuration in place. Note that the configuration is not directly related with the task. Next, we have to create a new ... ??? ... something for the process of generating that configuration file. This is where the problems appear. Some say that it is a _bug_ others say it is a _task_ or an extra _feature_. So, where is the limit between bugs and tasks in the development phase? Should we even consider something a bug if all the tasks are working as stated in their definitions? Can a thing be considered a bug because one compares it to the current (unstable) state of the system? _Short example_ :   * A feature requires configuring a communication service for a specific operation.   * In the process of the implementation the team discovers that the service requires the hostnames of the pears to be resolvable to an IP address.   * The team adds the hostnames to the DNS server (or hosts files) and continues implementing the required feature.   * After the initial feature is working, a question is risen. Should the sysadmin configure the DNS or hosts file or should our application do it automatically?      * An automatic solution is possible. So a decision is made to implement it.   * ... here start the discussions ... is this a bug or an extra feature / task? PS: I know that I mixed feature / task / story in the question. It is intentional. I am interested in separating bugs from the rest. Doesn't matter what _the rest_ means in a particular case.


title: How to store data for Windows Store apps?

text: I have a application which requires me to save data to a database not located on the users computer. Which approach is the best to save and access data for this scenario? Normally I would use Entity Framework and MS Sql Server but this seems not to a options for me with windows store apps.


title: Cost-Effective, Cross-Platform Mobile Hardware/Cell Service

text: What is the recommended acquisition strategy for having multi-platform, service-connected devices for mobile developers? Is it necessary to have separate phone numbers and service plans for each platform? My guess is that having a Droid, iPhone and Windows 7 phones all on the same plan and same phone number is out.


title: How do I get a feeling for visual design as a programmer?

text: Over the last years of web programming, I've noticed how bad I am at designing things. I have substantial knowledge of HTML and CSS, I can make a website look like I want it to, I have some pretty intense knowledge about usability. My only problem is: I can't design a web-site or even an element of it to look good and solid. Either the colors are wrong or the spacing, I can't pinpoint it most of the time, but something is off every time. How could I get a better feeling for design matters like compositing or coloring? Could you recommend any books, articles or maybe trainings?


title: Planning development when academic research is involved

text: Dear fellow programmers, how do you do "software planning" when academic research is involved? And, on a side note, how do you convince your boss that writing software is **not** like building a house and it's more like writing a novel? The gory details are below. I am in charge of a small dev team working in a research lab. We started developing a software with the purpose of going public one day (i.e. sell and make money off that). Such software depends on, amongst other things, at least two independent research lines: that is, there are at least two Ph.D. candidates that will, hopefully, one day come out with a working implementation of what we need. The main software depends also on other, more concrete resources that we as developers can take care of: graphics rendering, soft bodies deformation, etc. My boss asked me to write the specifications, requirements AND a bloody GANTT chart of the entire project. Faced with the fact that I don't have a clue about the research part, and that such research is fundamental for the software, he said "make assumptions." For the clarity of the argument, he is a professor whose Ph.D. students should come up with the research we need. And he comes from a strictly engineering background: plan everything first, write down specifications and only then write down code that "it's the last part". What I am doing now:   1. I broke down the product in features; each 'feature' is, _de facto_ , a separate product;   2. Each feature is built on top of the previous one;   3. Once a feature (A) has a working prototype the team can start working on the next feature (B), while QA for is being done for A (if money allows, more people can be brought in, etc.);   4. Features that depend on research will come last: by then, hopefully, the research part will be completed ( _when_ is still a big question) ; Also, I set the team to use SCRUM for the development of 'version 1.0', due in a few months. This deadline could be set based on reasonable assumptions: we listed all required features, we counted our availability, and we gave a reasonable estimate. So my questions, again, are:   * How do I make my boss happy while at the same time get something out the door?    * How do I write _specifications_ for something we -the developers- have no clue whether it's possible to do or not? (We still haven't decided which libraries to use for some tasks; we'll do so when we'll need to)   * How do I get the _requirements_ for that, given that there are yet no clients nor investors, just lots of interests and promises?    * How do I get peace in the world? I am sure at least one of my questions will be answered :) ps: I am writing this anonymously since a potential investor might backfire if this is discovered. Hope you'll understand. However I must say I do not like this mentality of 'hiding the truth': this program will likely benefit many, and not being able to talk openly about this (with my name and my reputation attached) feels like censorship. But alas, I care more about your suggestions now.


title: Best solution for a large database transaction

text: I have a COBOL CICS process running on a mainframe legacy system. The process does over 2K DMLs in a highly concurrent DB environment. After each CRUD operation, the result is used to make further computations followed by CRUD operations again. This entire process runs under a transaction block such that any failure before its successful completion results in the entire set of DB changes to be rolled back, only on success of each and every step in the process till the end, there is a commit. The COBOL program is written in a manner that it doesn't consume more than 20 odd seconds for its completion or failure lest the other process starve for DB resource(locks, stalls etc.) due to the enormity of this transaction. Now we are commissioned to expose this legacy application as a Java SOAP web service. The three approaches I have are:   1. The Service layer of my Java code sends a message to the queue with input parameters, the already existing COBOL program picks the message from the queue and does the transaction. Java layer pings the queue asynchronously and when it has got a result from the COBOL process, it sends it back to the Controller.   2. Write a Stored Procedure which mimics the job done by the COBOL process including the DB transaction and call that SP from Java Service layer.   3. Write the Business logic inside Java Service/DAO layer and the transactions inside a Spring transaction block. Business doesn't want the #1 approach as it means dependency on the legacy COBOL program. I have two doubts here :   1. I have an understanding that SPs are better from performance point of view. But will the SP be able to handle 2K or more odd DMLs within a transaction block and do the job in time at least equivalent to the time which COBOL process takes ? If yes, then will it be efficient enough in locking-releasing DB resources as the DB is highly concurrent and I don't want other processes to starve due to it.   2. I have never done a DB transaction of this magnitude from the Java code and I doubt whether Spring transaction block can hold 2K DMLs in a single block effectively. Even if it does I'm sure that it wouldn't match the speed of COBOL or SPs, hence it may acquire locks on records etc. and starve other processes which needs to access the same for long time.  The transactions are not on a particular DB table, it is distributed over 20 odd different tables containing critical financial data. I was thinking of breaking the large number of CRUD operations in chunks of Spring transaction blocks, but then it would have been a humongous task to code the entire roll back logic in Java, but it's alright, my main concern is locking other processes from DB access in the meanwhile. I am a Java developer with meager knowledge of RDBMS and practically no knowledge of COBOL. I would be grateful if someone can help me point to the right direction so that I can come out with a solution myself.


title: Should I update blog posts or rewrite them as technology (and me) changes?

text: I started a programming blog earlier this year, and since I started it some things have changed. Some changes are due to technology changing, some changes are due to my code libraries improving, and some (ok, probably most) are due to me changing as I learn more. I want to go back and completely re-write certain blog posts. Is it better to rewrite posts to remove old information and update them with new stuff, or to create entirely new posts and possibly take down old ones? I'm not talking about small changes to the code, or an extra few sentences, but complete rewrites with new code, new information, etc. Some things to consider are comments on the post, subscribers who receive updates when new posts are created, and user bookmarks.


title: Making an HTML5 application for both Android and iOS

text: I was checking out a video tutorial on HTML5 using Dreamweaver to do Android and iOS apps (using Phonegap) and it clearly mentioned that you need a Mac to debug and simulate for iPhone, iPod, etc. Is there any way around this? I really want to develop apps for iOS and android (more iOS) using HTML5 but what I need to know is if you develop an app with HTML5 and debug it in an android environment, is it still portable to iOS? My apologies if this question seems a bit ignorant but none of my google searches return results that answered my question. Maybe I'm not even asking the right question.


title: What advantages do simple text editors like TextMate have over Eclipse for Java development?

text: I'm torn which IDE to use. The power of eclipse or the simplicity of TextMate. I'm wondering which one has specific advantages over the other, productivity wise.


title: Is there a canonical book on simulation programming?

text: I've taken an interest in writing life-based simulations in C. I've been trying to find resources online and books, but haven't found anything. Is there a book out there that's the de-facto standard for describing best practices, design methodologies, and other helpful information on simulation programming? What about that book makes it special?


title: How to handle errors back in an API environment

text: We're discussing the best way to handle errors in calls to a method. We have a credit model where we allow users to deduct credits for certain actions. We'd like to make a call to:               User.DeductCredits(10);      Then the Deduct method will check things like   1. Does the user exist?   2. Is the user active?   3. Does the user have at least 10 credits? If not, this result should fail. We're currently writing this just as a class library, but trying to keep it open to convert to a web service in the future. The options we've discussed so far are:   1. Throw an exception when an error occurs.   2. Create a new Result object that would have T has the type of data expected back, and wrapping that with a status code and message. We didn't like option #1, because then code to call deduct credits would look something like:               try     {        user.DeductCredits(10);     }     catch(InvalidUserException e)     {     }     catch(InactiveUserException e)     {     }     catch(CreditBalanceException e)     {     }      Additionally, if we turn this in to a service, we can't force exceptions on the user. The main reason we didn't like option #2 was that it seemed to be returning more data than what we need. For example:                 var address = user.GetMailAddress();      Now address has the status code and message, as well as a data property, or value property. So to get the city, you'd have code like:               if(!address.HasError)        state = address.Data.State;      as opposed to:               state = address.State;      So is there a best practice for this type of situation? Is one option really any better than the other?


title: Where can I find localized information about our industry?

text: Questions like 'What sort of jobs are available in Houston', or 'What do developers get paid in London' are notoriously off-topic here. My question is: where do those questions belong? Is there a suitable place online that I can pose these sort of questions, or do some research into how the market looks on the other side of the world? With a medium-term plan to move internationally, it would be helpful to know what the potential job market might look like in my destination. Different technologies and vendor products are more popular in different regions, the relative pay rates vary dramatically, and skills required for different industries (technology, communications, manufacturing, marketing) are very diverse. This sort of information is very valuable. Where can I find it?


title: Standard text samples

text: I need to use a long text as sample. Afterwards with an algorithm I will take a substring of it whose length is fixed (passed as parameter), but the startIndex is random, therefore each time it should take a different portion of that text. However I would take, if possible, a standard text as sample for my application. Looking in internet it is almost always used the Lorem Ipsum text. Can this be considered "standard" or is there a rela standard one? Thanks


title: Given number which equals the sum of some of the 10 numbers. How to determine that given number contains one of 10 numbers?

text: I have:   * ten numbers: +1, +2, +4, +8, +16, +32, +64, +128, +256, +512.   * flag == sum of some of this ten numbers. How to determine that sum contains 2 or 32?


title: SOLID Principles and code structure

text: At a recent job interview, I couldn't answer a question about SOLID \-- beyond providing the basic meaning of the various principles. It really bugs me. I have done a couple of days worth of digging around and have yet to come up with a satisfactory summary. The interview question was: > If you were to look at a .Net project that I told you strictly followed > SOLID principles, what would you expect to see in terms of the project and > code structure? I floundered around a bit, didn't really answer the question, and then bombed out. How could I have better handled this question?


title: Is there a benefit in compiling your code as you go along?

text: I recently had a job interview in which they gave me an hour to write some real code. It wasn't a huge amount, probably less than 100 lines. After about 45 minutes, I compiled, ran it, and got it to work. I may have spent 5-10 minutes working out compile errors and a couple minor bugs, but overall it was very smooth. (Incidentally, I did get an offer from them.) However, what puzzled me was that after I handed over the completed code, the interviewer told me that the only thing I did wrong was "not compiling as I go along". I asked him what the difference is, and he said "what would you have done if you finished the code and it didn't compile in time". In my understanding that's an invalid argument, because "getting code to compile" for a given length of code generally involves fixing a constant number of compile errors and takes a fairly constant amount of time, which should be the same whether you do it after you finish writing the code, or if you interleave it with your coding time. If anything, interrupting your coding to search for missing semicolons would probably be detrimental to your efficiency. Except in extreme circumstances when I'm experimenting with obscurities around edge-cases on things like virtual functions in derived classes, etc. it seems reasonable to expect that code written by a an experienced developer will compile, minus the occasional typing error, and even if it doesn't, it's not as if I would have to rewrite a portion of the code in order to fix the compile error. In another similar incident, I was given an incomplete codebase in an interview, and asked to finish it and make necessary modifications to get it running. I started by reading through the existing code, and then after a few minutes (even before I had finished looking at the code), the interviewer told me that's enough. When I asked him what he would have done (i.e. "what did I do wrong"), he told me that he would have started by immediately getting the code to compile. Why is that even relevant? In my opinion and in my experience, whether or not a piece of code compiles is essentially random, involving things like whether or not semicolons are missing, and has little to do with the correctness of the underlying program. (To me, focusing on compiling is like running an article through a spell-check without proofreading to check the grammar.) If you give me a piece of incomplete code, the first thing I do will be to read it. I won't even try to compile it until I know what the code is doing and I know the algorithm is correct. Anyway, these have been just a couple recent incidents, but in general I've heard many developers talk about compiling their code as they go along, and yet nobody has been able to tell me the benefit of doing so. I understand the benefits of _testing_ your code as you go along, but why compiling? So my question is this: Is there something I missed? Is there actually a benefit to compiling as you go along? Or is this some sort of myth propagated by the software community that you must compile your code frequently?


title: Is it an antipattern, modifying an incoming parameter?

text: I am programming in Java, and I always make converters sort of like this:               public OtherObject MyObject2OtherObject(MyObject mo){         ... Do the conversion         return otherObject;     }      At the new workplace the pattern is:               public void MyObject2OtherObject(MyObject mo, OtherObject oo){         ... Do the conversion     }      For me it is a little bit smelly, as I got used to not to change the incoming parameters. Is this incoming parameter alteration an antipattern or is it OK? Does it have some serious drawbacks?


title: design in agile process

text: Recently I had an interview with dev team in a company. The team uses agile + TDD. The code exercise implements a video rental store which generates statement to calc total rental fee for each type of video (new release, children, etc) for a customer. The existing code use object like:   * Statement to generate statement and calc fee where big switch statement sits to use enum to determine how to calc rental fee    * customer holds a list of rentals    * movie base class and derived class for each type of movie (NEW, CHILDREN, ACTION, etc)  The code originally doesn't compile as the owner was assumed to be hit by a bus. So here is what I did:   * outlined the improvement over object model to have better responsibility for each class.    * use strategy pattern to replace switch statement and weave them in config  But the team says it's waste of time because there is no requirement for it and UAT test suite works and is the only guideline goes into architecture decision. The underlying story is just to get pricing feature out and not saying anything about how to do it. So the discussion is focused on why should time be spent on refactor the switch statement. In my understanding, agile methodology doesn't mean zero design upfront and such code smell should be avoided at the beginning. Also any unit/UAT test suite won't detect such code smell, otherwise sonar, findbugs won't exist. Here I want to ask:   1. is there such a thing called agile design in the agile methodology? Just like agile documentation.    2. how to define agile design upfront? how to know enough is enough? In my understanding, ballpark architecture and data contract among components should be defined before/when starting project, not the details. Am I right?    3. anyone can explain what the team is really looking for in this kind of setup? is it design aspect or agile aspect?    4. how to implement minimum viable product concept in the agile process in the real world project? Is it must that you feel embarrassed to be MVP?


title: How important is to avoid name collisions between libraries belonging to different domains?

text: I have written a small open source Java library for facilitating conversions between different types of objects (in the style of Google's gson, but quite more general). It seems to me that a nice natural name for my library is _JConverter_ , after browsing in the web to see if another library with the same name already exists, I found a library with the same name for Joomla. My concrete question is: How important is to avoid naming collisions when creating an open source library if an existing library with the chosen name already exists in a complete different domain ? (in my concrete case, these are libraries even implemented for different languages).


title: Best way of storing a small number of user credentials

text: I'm working on a messaging application, based on a server/client architecture. Now I am thinking about the way how to store the user credentials. It's not a huge number, just about 20 entries with their User-IDs, Usernames and hashed passwords. Storing it with a SQL Server in my opinion is overkill. Is it better to store it in sort of a text file or in a SQLite database file? These methods would keep the server portable and the installation simple. And is password hashing enough to keep the passwords secret? What is the best way to handle this?


title: OOP :What are some of the situations in which class based design is better than interface based one?

text: I was reading JDOM's website. > Why is the JDOM API defined in terms of concrete classes rather than > interfaces? > > Jason Hunter summarizes the arguments against an interface-based API for > JDOM: > > With interfaces everything becomes a factory, elements have to be 'imported' > into new documents instead of just added, features like long-term > serialization cannot be guaranteed, and the list goes on. > > We started with interfaces actually. During our pre-release review to some > peers we received the feedback we should try concrete classes. We did, and > the design was much better for it. I am a beginner designer. All the advice I have heard about till now is **_advising against_** using designing with concrete classes. May be using concrete classes are appropriate in certain places. Are there any common class problems for which using concrete classes in design is okay?


title: How to outsource the UI of a dynamic Web application?

text: I have a web application developed using Spring and Hibernate, which uses a REST API and Javascript to display and update content. The project is nearly completed, but I want to enhance the look and feel. This will include better graphics and some extra behaviour. I want to outsource this task to a freelancer over the Internet. I don't have experience with outsourcing and don't know how to incorporate an outsider to the project. I mean I'd like to avoid other people to access the back-end source if I can. The only code that i want to be changed runs on the client side. Is this doable? I thought I can just give the URL to the designer and require them to use "Augmented Browsing" tools, like Greasemonkey or Tampermonkey to work on the UI. Is this something Web designers are accustomed to or willing to do? Or are there any better options to accomplish this? **EDIT** : A basic requirement: There are items on a list which are generated on-the-fly according to JSON data, using handlebars templates. I want these items to be removable, like when the mouse is over these items a button should appear. I also want those items to look better. This will require some Javascript, HTML and CSS integrated into existing code.


title: In objective C, where does the inheritance chain end?

text: In objective C, classes are objects, but what object owns the class objects? I am trying to get as detailed an understanding of iOS programming as I can, and this question popped into my head, so I decided I should know the answer.


title: How to indicate that a class might implement an interface?

text: Say I have a class User and an interface Administrator. Some users are administrator and can thus implement the interface. Most aren't, however, so it's false to say that "User implements Administrator". How can I represent that in a class diagram? Should I use the classic implementation arrow, or is there an existing stereotype for a class that **can** implement an interface?


title: Schema/Code for respecting different schedules

text: We accept leads from lead providers. We only allow certain providers to post leads to us during certain days/times. Currently, we have 3 schedules, but we might add 1 or n more in the future:   1. Sunday @ 8AM - Friday @ 3PM -- all hours in between.   2. Monday - Friday from 8AM - 5 PM.   3. 24 hours a day, every day. In addition, we want to be able to one-off certain hours -- so, we would have told some of the lead providers, "I know you normally post 8 AM - 5 PM M-F, but Monday is a holiday, so don't post then." The problem is that some lead providers are not setup to handle a schedule (or just ignore it if they want to sell us more leads). So, I now have to add this check into our system at the point in which we take in leads, and first check to see if that lead provider (they identify themselves in the XML they send) is allowed to post leads at this particular time. I honestly don't know where to begin. Has anyone done this before? How did you handle it, and what is good/bad about your method?


title: Architectural questions regarding, MV** frameworks, NoSQL data models, and gradual refactoring

text: I have a web app I would like to gradually refactor by adding structure to it. I have narrowed down the options to Backbone (with some plugins), Ember.js and AngularJS My goal is to refactor that app, which has the usual jQuery spaghetti and _gradually_ add some structure to it. **Requirements**   * not a "all or nothing" framework, e.g. allow gradually moving code from "before" to "after" without rewriting the app from scratch (winner - Backbone?)   * something that has a future, people seem excited about and has a big company behind it (Angular takes this bullet)   * Let me sometimes do things "my way" and not force a paradigm (Backbone a clear winner here)   * Something that will really boost my productivity and remove the need for boilerplate code (Angular + Ember)   * Something that is good not just with the obvious things, but also the complex things, e.g. animation transitions, nested models, handling modal dialog views, drag and drop support, widget system etc One option is to become an advanced developer in all 3 and then, the other is to ask people who did something similar I know that with Backbone I can do everything I want, but I want to know if I'm not to "careful" and wonder if I'm not missing out by not taking the risk of using AngularJS / Ember.js **Questions** So my specific, answerable, constructive (as much as I could) questions are:   1. Is Angular / Ember able to support drag and drop without bending over backward?   2. Can either of these frameworks support animation transitions well?   3. Which of these 2 frameworks is easier to "add in" gradually and not to fully rewrite things "their way"   4. Which of these has better support for NoSQL /document based models as in MongoDB like documents (e.g. a JSON doc rather than a relational model)   5. Which of these has better built in support for complex models (similar to #4) Both Ember Data, and Backbone-relational seem to come from a relational database paradigm, and I wonder if there is anything that can build a model from an arbitrary multilevel / nested tree like structure without having to define a NoSQL model in a relational like data structure (e.g. hasMany, belongsTo instead of just a JSON like document). Also I don't want to stop using JqueryUI because it's not 100% done the "Ember way" or the "Angular way", is Backbone really my best option? Are the nice bells and whistles that come with Angular / Ember are in a trade-off with flexibility? Is it a good architectural choice to use either Angular or Ember when refactoring an existing jQuery callback pasta in a gradual, iterative approach?


title: Make PHP code run on .net?

text: I can write PHP application in linux platform.   However, I getting a request to explore the idea to run PHP application into .NET. I have zero .NET knowledge.   So wondering, is it possible? Is it advisable? Implication ? Or maybe I should just install a .NET to playaround first? In short, zero code changes, except setup the PHP environment in .net. Also, wondering, will this benefits from .net security? The reason why I explore this idea is because Singapore government website must run on .NET (and I intend to save few bucks by not hiring dot net developers). I think the idea of application must run on .NET is absurd (a joke to me), just showing one of the "world-class" standard in Singapore :)


title: Overcoming general lack of UI design skill in developers

text: I have been told, and have found for myself, that lots of developers are not good at UI design (I don't know how true is this) but _it is true about me at least_. In web development good code development skills are not enough without great skills in UI design to go with them. So for me, and many developers like me, that only have half of the thing (good development skills) how should we complete our other half other than paying for a designer? Is using Open Source web templates with little modifications the best solution for this, or are there other options?


title: What is the best way to keep both html document structure and php control structure strongly visible in complex view file

text: I create a lot of views in my work as part of the common MVC pattern applied in web frameworks like Code Igniter and Cake. I also adhere to the following maxim as best I can: fat models and library objects doing the logic; skinny controllers responding to user actions server side; and views presenting request results and providing UI. This leads me to a situation where a lot of views are just html, variable echos and for loops, with the accompanying mark up for css and javascript application. Nice and clear. However, in some cases views need to be more complex. We might need to do different things based on the state of each looped item for example and sometimes this gets quite complex. The problem with this is that the identing applied to both html and php soon gets out of sync. A very simple example:               <ul>        <li> ... </li>        <li> ... </li>        <?foreach>            <li> ... </li>        <?endforeach>     </ul>      We now have li elements that are at the same depth in the output document but not at the same level in the code. If we start using other control structures this can get worse:               <ul>        <li> ... </li>        <li> ... </li>        <?foreach>            <li> ... </li>            <?if>                <li> ... </li>            <?endif>        <?endforeach>     </ul>      And so on ... Is there a well used pattern I can follow that minimises this problem even with complex views ?


title: How are mock objects commonly misused?

text: I read an article recently which said that mock objects are often misunderstood and misused. Are there any clear mocking anti-patterns which I can look out for?


title: What are the options when Sql generated by ORM needs tuning?

text: I am starting working on a web project using django. While researching whether to use Sqlalchemy or raw sql when django orm is not sufficient which is also a question I asked here Raw Sql vs SqlAlchemy when Django ORM is not enough One question bugged me. As the load on the website increases and we find out that sql queries ran by ORM needs tuning. But we have no control on how does an ORM executes queries. In that case we have to use raw sql queries because they give us the best control. But if we start using raw sql queries, all the benefits of using an ORM in first place are gone. We are stuck with both sql and orm code which will surely mess up the reading and maintainability of the code. It feels to me that we are opting for easy code in lieu of many problems later. No doubt our initial code will be fast and easy maintainable but this can cause later problems. I would like to know thoughts of others on it. I am not starting a question comparing orms and sql but I would like to know what are the options when we have created web app using ORM and comes the situation when its clear that ORM is not supporting our cause?


title: Set distances algorithm question

text: I have multiple sets containing integers. An integer maybe present in one set or multiple sets. I would like to find/match the sets with the most common integers. Example s1 {1, 2, 3, 4} s2 {1, 3, 4, 5} s3 {6, 7, 8, 9} s4 {1, 6, 8, 10} In this case, I would like to "efficiently" group s1+s2 as they have the most overlapping elements (3) followed by s3+s4(2) s1+s4(1). You can do this the brute force way (match all possibilities - then sort) Looking for an efficient way to do this.


title: Why was the C syntax for arrays, pointers, and functions designed this way?

text: After having seen (and asked!) so many questions similar to > What does `int (*f)(int (*a)[5])` mean in C? and even seeing that they'd made a program to help people understand the C syntax, I can't help but wonder: Why was the syntax of C designed this way? For example, if I were designing pointers, I would translate "a pointer to a 10-element array of pointers" into               int*[10]* p;      and _not_               int* (*p)[10];      which I feel most people would agree is much less straightforward. So I'm wondering, why the, uh, unintuitive syntax? Was there a specific problem the syntax solves (perhaps an ambiguity?) that I'm unaware of?


title: Best practice for storing information from a php script for future use

text: My employer uses forms to help people search for products. The product lists can change from time to time and the forms need to be updated again. The product information can be accessed through a third party API which I started tinkering with, I've recently built a script that retrieves the information with PHP and creates and populates a form dynamically with Javascript. **So far so good, but...** There are limitations to the API, mainly it can only be accessed a certain number of times per hour, it is probably more than my form/script would use but I want to create a script that is minimally intrusive. **My main question is...** **What is the best practice for accessing the information once and storing it long enough to let the API reset?** I was wondering about creating a cookie but there is the possibility of users that have them disabled. _(Also, I am doing this as a personal project but I like the people I work for and I think this would help them out.)_ Thanks in advance.


title: Should the name of my program be a verb ("frobnicate") or a noun ("frobnicator")?

text: If I have a program that takes some input data, frobnicates the data, and outputs the result, should the name of the program be the verb, "frobincate", or the noun, "frobnicator"? Here's a hypothetical invocation with the verb form:               cat data.txt | frobnicate > frobnicated.txt      and here is the same invocation with the noun form:               cat data.txt | frobnicator > frobnicated.txt      (Obviously, "frobnicate" is an imaginary verb used as an example here.)


title: Does a prose to code compiler exist?

text: I have seen some horrible code in my time including people virtually duplicating the code in comments               // add 4 to x     x+=4;          // for each i in 0 to 9      for (int i = 0; i < 10; i++) {         // multiply x by i         x *= i;     }      Taking this concept further, I'm curious whether prose to code compilers exist.   * Is there a valid use case for English prose to code?   * Do compilers exist that do this? The distinction between this and auto generated code, is that auto generated code is generally always a subset of a project. Can we have complete projects auto generated from english prose? I realise that this might overlap with the concept of declarative languages.


title: Does over-reliance on tools imply that you are lazy?

text: I started programming in C++ at uni and loved it. In the next term we changed to VB6 and I hated it. I could not tell what was going on, you drag a button to a form and the ide writes the code for you. While I hated the way VB functioned I cannot argue that it was faster and easier than doing the same thing in C++ so i can see why it is a popular language. Now I am not calling VB developers lazy in just saying it easier than C++ and I have noticed that a lot of newer languages are following this trend such a C#. This leads me to think that as more business want quick results more people will program like this and sooner or later there will be no such thing as what we call programming now. Future programmers will tell the computer what they want and the compiler will write the program for them like in star trek. Is this just an under informed opinion of a junior programmer or are programmers getting lazier and less competent in general? EDIT: A lot of answers say why re invent the wheel and I agree with this but when there are wheels available people are not bothering to learn how to make the wheel. I can google how to do pretty much anything in any language and half the languages do so much for you when it come to debugging they have no idea what there code does of how to fix the error. That's how I cam up with the theory that programmers are becoming lazier and less competent as no one cares how stuff works just that it does until it does not.


title: Is there a canonical book on parallel programming with focus on C++ ?

text: I am looking for a good book about parallel programming with focus on C++. Something suitable for a person reasonably good in C++ programming, but with no experience in concurrent software development. On the other hand, I'd prefer a practical book, without loads of silly examples about philosophers eating lunch. Is there a book out there that's the de-facto standard for describing best practices, design methodologies, and other helpful information on parallel programming with focus on C++ ? What about that book makes it special?


title: About grammar, Chomsky hierarchy and obj file format

text: Considering the Wavefront obj file format where this syntax fits in the Chomsky hierarchy and why ? I'm also not sure if PEG grammars are being considered in the kind of classification made by Chomsky and if an obj is a real example of a PEG grammar . to formalize this: what kind of grammar and parser I need in order to read an obj file ?


title: Caching's Effect on Program Performance

text: How does caching effect the performance of a running program? From my understanding, the assumption that each instruction always takes the same amount of time is not always correct, because of the effects of caching. How does caching affect algorithmic performance? Thanks in advance. **EDIT 1:** To further elaborate, lets say I'm running this Java program that's reading one million integers. From what I understand about this program, it's order of growth is cubic and will take a while to finish running. How would caching improve the performance of this program while it is running?


title: How do I get myself out of a dead-end programming job?

text: I have almost 9 years of IT experience of which 7 years was worked in an IT company. For past 2 years I have been stuck in a non-IT based company using outdated technology and methodologies. We don't follow any good practices nor do we upgrade to the latest technologies due to budgetary constraints. For a time, there was some amount of work to keep me active, but lately, there's just maintenance work for a product running on an old technology stack. So I'm looking to get out of this job and into one that's more my speed: using the latest technology, writing new things, and actually in the IT field. But I keep coming up short on interviews due to the last few years of being in a job that's behind the technology times. What can I do to prepare myself and prove to more cutting-edge companies that I'm up to the job?


title: How do you break out of the role of a code maintainer?

text: In my last three jobs, I was a code maintainer. In all three cases, I was hired _after_ the majority of the code for the project was already written. I'm a self taught programmer. Before I ever started my first professional job, I had maybe a dozen projects under my belt that I started and shipped successfully. Writing new code and maintaining existing code are two completely different jobs. Its like comparing an aeronautical engineer with an aircraft mechanic. It especially sucks when you're an aircraft mechanic working on an airplane that was designed by an engineer who made no attempt to engineer the plane to be in any way logical or easy to maintain. I'm starting to feel like to be around when the project is first starting out, you have to be one of those _special_ people who has somehow transcended the rest of the people in the computer science field. What does it take to be in that position? I kind of feel like this question doesn't really have any easy answer, but could anyone give me some insights? Have you ever been on the ground floor of a new project? What did it take to get there?


title: Becoming a "maintenance developer"

text: So I've kind of been getting angry about the current position I'm in, and I'd love to get other developers' input on this. I've been at my current place of employment for about 11 months now. When I began, I was working on all new features. I basically worked on an entire new web project for the first 5-6 months I was here. After this, I was moved to more of a service oriented role (which was still great, all new stuff for me), and I was in this role for about the past 5-6 months. Here's where the problem comes in. Basically, a couple of days ago I was made the support/maintenance guy. Now, we have an IT support team, so I'm not talking that kind of support, I'm talking more of a second level support guy (when the guys on the surface can't really get to the root of the issue), coupled with working on maintenance issues that have been lingering in the backlog for a while. To me, a developer with about 3 years of experience, this is kind of disheartening. With the type of work place this is, I wouldn't be surprised if these support issues take up most of my days, and I barely make it to working on maintenance issues. Also, most of these support issues aren't even related to code, they are more or less just knowing the system architecture, working with making sure services are running/getting started properly, handling/fixing bad data, etc. I'm a developer, so this part sucks. Also, even when I do have time to work maintenance, these are basically just bug fixes/improving bad code, so this sucks as well, however at least it's related to coding. Am I wrong for getting angry here? I don't want to really complain about it, but to be honest, I wasn't spoken to about this or anything, I was kind of just sent an e-mail letting me know I'm the guy for this type of thing, and that was that. The entire team took a few minutes to give me their "that sucks" talk, because they know how annoying it is to be on support for the type of work we do, so I know I'm not the only guy that knows it's not that great of an opportunity. I'm just kind of on the fence about how to move forward. Obviously I'm just going to continue working for the time being, no point making a bad impression on anybody, but I'd like to know how you guys would approach this situation, or how you think I should be feeling about it/how you guys would feel.


title: How do I deal with a dead-end job?

text: > **Possible Duplicate:**   >  How do I get myself out of a dead-end programming job? I'm a passionate programmer in a well-paid dead-end software job. The downside is that I am patching crap code (this week I made several hundred changes much like a human script), and for various reasons I can't quit. The upside is that they are paying me fairly well, and I only need to work about 6 (real) hours per day, maybe even 4. My dream is to work in a more interesting job: startup, game company, Google, whatever. I am willing to work hard for it. How do I keep my head above water and eventually transition into something I would enjoy doing? I'm a .NET programmer; people who do interesting stuff avoid .NET like plague. And I have to stay in Canada for legal reasons (US is not an option). I am 35 years old, but in the last 5 years, or so, I did mostly business software.


title: How can I transition out of a maintenance-only job?

text: After I started working at a company, I found out that the job is to maintain a software product. Most of the work that I'm doing is finding and fixing bugs. It's not easy work. However, there is no new feature development. I am worrying about this, as it might mean I won't ever get the chance to focus on development. What can I do to transition from a job that's maintenance-only to one where I'm creating and designing software?


title: What prevents a race condition on a lock?

text: I understand the basics of what data races are, and how locks/mutexes/semaphores help prevent them. But what happens if you have a "race condition" on the lock itself? For example, two different threads, perhaps in the same application, but running on different processors, try to acquire a lock _at the exact same time_. What happens then? What is done to prevent that? Is it impossible, or just plain unlikely? Or is it a _real_ race condition waiting to happen?


title: Delegation and MetaClass in C++

text: We have an OOP course at our university, while discussing the concepts I came across MetaClass and Delegation. As far as I know, these don't exist in C++. Could someone give an example by which I can better understand how to simulate them instead.


title: HTTP Response Header for a unique Request ID for REST service

text: For our REST service I want to send back a unique request ID with every response; useful for debugging internal projects but also for offering support to any third parties who might use the service in the future. I have decided that I need to use a response header, since not all REST requests need to result in a response body (often lower-level REST APIs take advantage purely of status code and description), but would still need to send back this request ID. I want to ensure, if possible, that I use an HTTP Response Header that is _unlikely_ to be stripped out by any proxies along the way. This could be very important since a large number of clients will likely be mobile devices with what is bound to be 'interesting' network topologies between them and our servers. However, the same services are likely to be marketed to other businesses with their own corporate firewalls/proxies too. Because of this I've basically chucked out the idea of using a custom response header in favour of a well-known header. My current winning well-known header would be the `ETag` header, but while it's _almost_ right, it's not quite - because an `ETag` is for a resource, not a request (i.e. two separate requests for the same resource will legitimately return the same `ETag`). Moreover, if I do use that, it'll mean I can't do any entity-tagging for anything else. Anyone have any better ideas? _Update_ The Pragma header, it appears, could be used, but I'm having issues writing to it within the Asp.Net WebAPI. Here's a related question on SO.


title: Should I calculate hotness of a post on request or pre-calculate it?

text: Here is the Reddit's hot algorithm:               cpdef double _hot(long ups, long downs, double date):         """The hot formula. Should match the equivalent function in postgres."""         s = score(ups, downs)         order = log10(max(abs(s), 1))         if s > 0:             sign = 1         elif s < 0:             sign = -1         else:             sign = 0         seconds = date - 1134028003         return round(order + sign * seconds / 45000, 7)      My brain says hotness of a post should be calculated on every request because old posts should have a low hotness score. I implemented this function in MySql but as you might guess, it's slow. Very slow even indexes are there. And then I think to update the hotness field of the post on every upvote or downvote of the post. Let's assume we have a post just posted now and has 100 upvote and 1 downvote and it's hotness is 78 (example). But it doesn't get any votes for 3 days. After 3 days a new post appears and gets 100 upvotes and 1 downvote and has 78 score. If I'm updating hotness score on votes, the 3 days old post and the new post will be show together. But in theory, the 3 days old post shouldn't even show up in front page. What is the most viable method to implement for this situation?


title: How do you make sure a .net client application is not being hacked to bypass authorization claims?

text: We wrote a simple .NET (C#) desktop application in Wpf. We also used WIF (Windows Identity Framework) to get a list of claims for the authenticated user. Some examples are:   * CanOverrideSalesAmount   * CanAddContact   * etc. This works fine and all, the client seems very protected. But, when I was debugging the application it occurred to me that all of the authorization is happening on the client side. A devious person could use a tool such as Snoop to hook into the application and make changes to the domain model that s/he isn't supposed to do. We thought about moving the authorization checks on the property setters, but even that isn't good enough because when we serialize the object graph to send over the wire, the serialized data can be altered (far fetched, but still possible). It seems to me that the only true way to protect my object graph is to have it only reside on the server and to have the client make calls to update it, but that seems like such an overkill. Is there a better way to handle this situation? I want our application to be as secure as possible.


title: Unit testing newbie team needs to unit test

text: I'm working with a new team that has historically not done ANY unit testing. My goal is for the team to _eventually_ employ TDD (Test Driven Development) as their natural process. But since TDD is such a radical mind shift for a non-unit testing team I thought I would just start off with writing unit tests after coding. Has anyone been in a similar situation? What's an effective way to get a team to be comfortable with TDD when they've not done any unit testing? Does it make sense to do this in a couple of steps? Or should we dive right in and face all the growing pains at once?? **EDIT** Just for clarification, there is no one on the team (other than myself) who has ANY unit testing exposure/experience. And we are planning on using the unit testing functionality built into Visual Studio.


title: Time Management System on Local PCs

text: I am looking to build a time management "app" that can be downloaded and used on an individual basis throughout my company. In theory, this app would be used to track time spent on several different projects, thus a need to store/track time based on username or employee ID seems like it would be the best route. I was looking to do this via C# WPF. My confusion arises from the architecture: Do I deploy a separate database per download? Or do I host one main database located on a client/server the entire company can use? From my perception - I don't necessarily see any privacy concerns or a need for a login management system. Simply username (as the PK), project name, hours and date would essentially be all fields in the table. While I say I am going to build it for internal use within my company, it is actually not going to be used BY the company - merely for personal tracking per project. This data will likely not be used (unless the company mandates it) by anyone else other than the person who is on the project.


title: Should I charge a client for mistakes that I made?

text: After developing a website for a client, I've realized that the load time is too extreme, and some changes need to be made. The extreme load times are attributed to the bloated css/js frameworks that I've been using. Much of the code that was included with these frameworks is not even being used and is slowing the site load time. My plan is to get rid of the css framework and just use a bare bones responsive css framework which is only like 1kb in size, and just add only the code needed. So my question is, should I charge the client for back-stepping and fixing this mistake?


title: Next step after creating mock-up screens

text: I have created some mockup screens for my app in HTML/CSS. I have 4 screens in total.   They contain no client-side coding i.e. Javascript or jQuery. The screens themselves are quite bland at the moment, and I realise they require some further work. Some of my plans for the app going forward are:-   * Introducing client-side templating : eg Mustache/Dust.js   * Add some effects and transitions using jQuery   * Improve the visual look of the screens (through css and images) I'm indecisive on the best way forward. My main aim is that I want changes to be easy to manage, and that's why I did mockup screens first as per the recommendation in the _Getting Real_ book by 37Signals. I'm currently in the process of gathering feedback for the mockup screens. From a programming point of view, which of the 3 steps above, would be a good logical step forward considering my requirement of making changes easy to manage? I should point out that i am very new to programming and development, and this is the first time i am learning programming. Some terms may not make sense to me and you may have to elaborate.


title: Software for requirements and use cases

text: I am looking into some UML modeling software, which there is plentiful of on the market, but only a few I found support recording of requirements and written use cases (not the diagrams yet). Are there any tools or methods I should check out for making requirements and use cases? Or should I just fire up Word and create a separate document for each use case?


title: What is the diffrence between the BSD and MIT licenses?

text: I assume based on this answer that the only difference between the MIT and BSD is the fact that MIT doesn't require credits when redistributing. Is that right? Is there any reason to use one over the other?


title: Effective Information Management on a Personal Level

text: Have you had problems managing information and found ways to effectively manage information? When I say "manage" I'm talking about storing, grouping, tagging, prioritizing, searching, sharing, etc. When I say information I'm talking about website links, feeds, videos, emails, documents, your thoughts, tasks, appointments, etc. It's difficult to really give this question better context without writing a lengthy (and possibly boring) monologue but let me clarify a little. I'm not asking about information overload necessarily (that's been recently asked), or how to write software or databases for managing information (software already exists). And when I say "personal" I'm not talking about your love life; I'm talking about the ways that you personally manage information as it relates to your work. This question might be better suited to independent consultants or employees who have to juggle and manage a lot of tasks and information at their job. I'd like to hear about any tools or "methods" that you feel are effective or revolutionary when it comes managing information.


title: Should I write a test to prove that deleting code fixes a bug?

text: Occasionally I'll run into the situation where fixing a bug requires that I _delete_ a section of code. The TDD purist would (I assume) advocate writing a failing test, deleting the code, then watching the test pass. Now, it seems really strange to have a test asserting that some code was removed. Sure, I suppose it would ensure no one dug into source control and put that code back in, but is it worth it? If it is worth it, it certainly seems less valuable than writing a test for code that has been _added_ , right?


title: How could I deal with conflicting personalities in a Scrum/Agile based team?

text: We apply Scrum/Agile and we have two teams. The other team has a conflict of interest (or rather personalities) between two developers. I would like to help resolve this and would like to know how to deal with it should it ever happen in my team. I am not a team lead as we use a flat structure. The conflict mostly comes to light during the daily stand-ups and during the end-sprint retrospectives. So far there has been no open bursts of shouting or even "violence" but at the current rate i would guess either of those may be inevitable. The conflicts are on areas of code or standards or ways of dealing with Scrum in the project. Neither team member is actually more wrong or sight than the other, so choosing a side is impossible. The effect of this underlining conflict is a negative impact of team morale and the newbies not feeling safe enough to give opinions or start taking charge of their tasks through fear of being involved in this or similar situations with the seniors. Thus from a Scrum/Agile perspective how would / could one go about getting the developers to set their differences aside and work as a whole team again?


title: Is it best practice to always capitalize class file names in PHP, and other languages?

text: I ask because I've seen a couple of OO PHP tutorials which do not adhere to this, but to me it just makes sense. It makes it easy to instantly see if a file is a class or not, if non-class files all use lowercase names.


title: How (and where) to organize a team to make a website?

text: Please take this question seriously. I have some moneys and ideas and I would like to hire developers/graphics to write down my ideas into a website. I could do it all myself, I have the right knowledge but I don't have time. Now the problem is: If i hire some good developers and tell him my ideas who assures me he will not steal my idea and build the website on his own? (take the social network film) The best thing to do would be to create a team with firends and make it, But sincerly in my city and in my country my friends maximum are able to do is start pc -> open facebook.com What would be your moves? Other than the "steal part" I would like to know tips for the team-management too


title: taking notes while reading source code of large projects

text: Whenever we start reading a big project source code it's often necessary to note down the calling chains and notes that reason why a specific code pattern was chosen, for example. I found primitive tools like A4 sheets lack the cut and paste or find capabilities. Consider working with a very simple editor like command line ones (such as `vim`/`emacs` or `nano`), or other lite IDEs like `Geany`. What are your methods to take notes to help you track the code folds and- ummm- mazes?


title: What strategies are you using to migrate your web site from Silverlight to HTML5 + JavaScript?

text: Microsoft released Silverlight 5 but there has been no news of any future versions (except service releases) being released. Combined with the increasing visibility of HTML5 and modern JavaScript libraries it now makes a lot of sense to start adopting the new and emerging technology instead of relying on Silverlight whose future is in doubt. Given this what are the migration strategies that you are using to move away from Silverlight? Any lessons learnt so far?


title: Do Java applets have any place on the web today?

text: Many browsers now disable Java applets by default, requiring them to be enabled on a per-page basis. It seems like applets have not changed much in the past few years. In fact, it seems that client-side Java (applets, desktop applications, ...) is dying completely, and Java is primarily becoming a server-side language. Except for the sake of compatibility, is there any place where applets are still useful on today's web? As a web developer who is familiar with Java and with JavaScript, why would I ever choose to use an applet instead of some JavaScript?


title: Does CC0 allow sublicensing of derived works?

text: I want to release all my future FOSS projects under a "public domain" license such as CC0. This is in order to avoid the requirement for attribution present in most FOSS licenses, mainly when the code is compiled into a binary, but also when somebody decides to copy a small portion of my code into their own open source project. So suppose somebody copies a method from my code into their own, which they are planning to release under an MIT license. In order to release the code under MIT, they must claim copyright of the code; but can they claim copyright of the whole if a portion of the code was not their creation? Is that what it means to claim copyright of a derived work? It may seem strange that somebody could take a piece of public domain code, modify it, and apply a new license to the modified version that imposes further restrictions on its usage, such as the attribution requirement of MIT. But since their additional restrictions would apply only to the modified version and not the original version, this seems legitimate. My main concern is maximizing the ways in which people can utilize my code, without worrying about licensing requirements, and also to avoid a viral effect where any derivative works have to be themselves licensed under CC0.


title: Can anyone explain Developer Twin Syndrome?

text: I realise this is a fairly odd question to ask but in recent rounds of hiring we have noticed a rather odd trend in new developers that spectacularly fall short of our expectations. So much so that they to all intents and purposes appear to be an entirely different person to the one interviewed and tested. We pre-screen applicants during their initial interview with a fairly nasty PHP/MySQL written test which tests both their knowledge of the PHP/MySQL as well as some fundamental aspects of application design. You cannot score highly on this test by simply memorizing the PHP and MySQL manuals (We've made that mistake in the past). I'm sure It is by no means fool-proof, but is intended to be sufficient to weed out those who have clearly lied on their resumés. Applicants that pass this stage are offered a second interview which is followed by a 2 hour practical test where they are required to develop a small application to a given specification. They are not necessarily expected to complete the task but are judged on their approach to the given task. Three times now he have hired the "best" applicant based on interview and test results, and each time the person that has showed up for work on the first Monday morning has been completely devoid of the skills and experience they have previously demonstrated. Each of these applicants scored over 90% on the written test and exceeded our expectations when given a practical task to complete. Hence my coining of the phrase "Developer Twin Syndrome" Has anyone else experienced a similar trend in hiring developers?


title: Do modern languages still use parser generators?

text: I was researching about the gcc compiler suite on wikipedia here, when this came up: > GCC started out using LALR parsers generated with Bison, but gradually > switched to hand-written recursive-descent parsers; for C++ in 2004, and for > C and Objective-C in 2006. Currently all front ends use hand-written > recursive-descent parsers So by that last sentence, (and for as much as I trust wikipedia) I can definitely say that "C (gcc), C++ (g++), Objective-C, Objective-C++, Fortran (gfortran), Java (gcj), Ada (GNAT), Go (gccgo), Pascal (gpc),... Mercury, Modula-2, Modula-3, PL/I, D (gdc), and VHDL (ghdl)" are all front-ends that no longer use a parser generator. That is, they all use hand-written parsers. My question then is, is this practice ubiquitous? Specifically, I'm looking for exact answers to "does the standard/official implementation of x have a hand-written parser" for x in [Python, Swift, Ruby, Java, Scala, ML, Haskell]? (Actually, information on any other languages is also welcome here.) I'm sure I can find this on my own after a lot of digging. But I'm also sure this is easily answerable by the community. Thanks!


title: Using Django without a database

text: Is Django a good solution for creating applications that won't use any database and communicate only through an internal API?


title: Is Haskell function composition an instance of pipe & filter architectural pattern

text: The pipe & filter architectural pattern is defined as a chain of processing elements, arranged so that the output of each element is the input of the next. Every example seems to consider inter-process or inter-thread connection performed through some kind of shared buffer. To me, it seems that Haskell function composition is performing the same task. Can we say that it is an instance of this pattern even if it is just about function ordering and no explicit buffer is use as pipe? If yes, can we say the same thing for non-lazy language?


title: Handling Dynamic amount of Strings for persistent and runtime storage in an IOS App

text: **Background** I am dynamically building an FQL query statement and because of the nature of the app, I exclude FB family members, this is the base portion of the query and remains fairly static. The query returns the FB profile pic and I display it on the UI. However, after the FB friends are displayed on the UI, I want to give the user the option to select a returned FB friend to never be returned in future queries and to return a new user in that users place Currently I am storing the other returned member uid's as a temporary exclusion in a Mutable Array, to prevent duplicate members being on the screen at once, I am also storing the excluded member in a different mutable array. I then build the query statement dynamically inserting the exclusion of all of the uids in the temp array and in the excluded array and then I dump the temp array after I return a new user in the place of who they picked to exclude. **Questions** What are some recommendations on the following:   1. storing these excluded uids(strings) during the apps lifetime? resort to a persistent storage method(core data/sqlite) or store in an array that is a part of a user object (NSUSer Defaults seems like a bad choice as this list can potentially be very long)   2. What are recommendations on some persistent storage so that exclusions can be taken into a query statement after the app is shutdown and started up (core data/sqlite/nsuserdefaults seem to be the only options here, userdefaults seems to be the least favorable because the reason mentioned above)   3. What are recommendations on injecting these unknown amount of uids(strings) into an FQL query statement which will be a string itself?


title: Choosing the right language for the job

text: I'm currently working for a company on the engineering team of about 5-6 people and have been given the job of heading up the redesign of an embedded system tester. We've decided the general requirements and attributes that would be desirable in the system, and now I have to decide on a language to use for the system, or at the very least come up with a list of languages with pros and cons to present to the team. The general idea of the project is that we currently have a tester written in c++, which was never designed to be a tester, but instead has evolved to be such over the course of 3-4 years due to need. Writing tests for a new product requires modifying the 'framework' and writing code that is completely non- human readable or intuitive due to the way the system was originally designed. Now, we've decided that the time to modify this tester for each new product that we want to test has become too high and want to partially re-write the system so that we can program the actual tests in a scripting language that would then use the modified c++ framework on the back end to test the actual systems. The c++ framework would be responsible for doing all the actual work and the scripting language would just integrate with that to tell the framework what to do. Never having programmed in a scripting language (we program embedded systems), I've run into a wall where I have no experience with any of the languages that we could possibly use, but must somehow give pros and cons of each language so that we can choose the best one for the job. Currently my short list of possibilities includes:   * Python   * TCL   * Lua   * Perl My question is this: **How can a person evaluate a language that he/she has never used before? What criteria are good indicators for a languages potential usability on a project?** While helpful suggestions for my particular case are appreciated, I feel that this is a good skill to possess and would like to be able to apply this to many different projects if at all possible


title: Is there a core set of language agnostic problems?

text: I would like to design a programming language by solving a specific set of problems. I am looking for a core set of programming problems that are language agnostic. It seems that there are a number of problems that are repeatedly solved by programmers. The implementation details vary from language to language, but, by and large, the problem they are solving remains the same. For example:   * Numerical libraries (http://en.wikipedia.org/wiki/List_of_numerical_libraries)   * Cryptography   * Certain networking libraries   * Plotting / graphs   * Unit testing Have there been any enumerations of these in literature?


title: What is the preferred access modifier for instance variables of a data transfer object?

text: I'm creating a data transfer object and can't decide whether it would be better to just give public access to the instance variables or if there would be a purpose to using getters and setters to access the data? According to the Data transfer object Wikipedia Article: > A DTO does not have any behavior except for storage and retrieval of its own > data (accessors and mutators). DTOs are simple objects that should not > contain any business logic that would require testing. It seems that public access would be justified for a DTO's instance variables. Here is the example I'm working on: **Ivars with public access modifier:**               class ServerContext     {         public String host;         public String user;         public String password;         public int port;              ServerContext(String host, String user, String password, int port) {             this.host = host;             this.user = user;             this.password = password;             this.port = port;         }     }      vs. **private access modifiers:**               class ServerContext     {         private String host;         private String user;         private String password;         private int port;              ServerContext(String host, String user, String password, int port) {             setHost(host);             setUser(user);             setPassword(password);             setPort(port);         }              public String getHost() {             return host;         }              public void setHost(String host) {             this.host = host;         }              public String getPassword() {             return password;         }              public void setPassword(String password) {             this.password = password;         }              public String getUser() {             return user;         }              public void setUser(String user) {             this.user = user;         }              public int getPort() {             return port;         }              public void setPort(int port) {             this.port = port;         }     }      **EDIT:** Could these be valid arguments for keeping the ivars private:   1. The potential of refactoring a DTO later to have more functionality?   2. Wanting to keep implementation consistent between DTO and regular objects?


title: How does the GPL work in regards to languages like Dart which compile to other languages?

text: Google's Dart language is not supported by any Web Browsers other than a special build of Chromium known as Dartium. To use Dart for production code you need to run it through a Dart->JavaScript compiler/translator and then use the outputted JavaScript in your web application. Because JavaScript is an interpreted language everyone who receives the "binary"(Aka, the .js file) has also received the source code. Now, the GNU General Public License v3.0 states that: "The “source code” for a work means the preferred form of the work for making modifications to it." Which would imply that the original Dart code in addition to the JavaScript code must also be provided to the end user. Does this mean that any web applications written in Dart must also provide the original Dart code to all visitors of their website even though a copy of the source code has already been provided in a human readable/writable/modifiable form?


title: Does anybody ever uses the OpenId url Log in?

text: As programmers I think we are the most inclined to use new technologies and things that are not so mainstream. I absolutely love OpenId's ability to log in with credentials you already have, but I always use a provider that I already use and that is the fastest to log in, like google. God knows I'd never used it if i had to type in the whole "https://www.google.com/accounts/o8/id" I like to click on the google button and then just say yes (the first time, then its just clicking the button). Does any of you ever uses the Generic "Enter your own provider" OpenId? Do you think its worth to even offer it to more casual end users?


title: Appropriate License for Available-Source, No-Unauthorized-Distribution

text: I have a program (technically an addon to a program) whose code I want to be freely available for educational purposes or to create derivatives for personal use. However, I do NOT want to allow unregulated redistribution of either modified or unmodified code, whether for free or for profit. However, I do want to allow the possibility of "pre-approved" derivative works - that is, the ability for a developer to request permission to distribute a derivative work (essentially an addon to an addon). Finally, the licensing for the parent program (which I do not own) forbids selling my addon directly but does not forbid monetization via other means (such as adfly). I do not want to allow others to monetize my original code, but do want to allow them to monetize pre-approved derivative works. Because of the rather nuanced nature of these requirements, and the fact it is NOT a free-distribution license like would be required for a "true" Open- Source license (as per the official definition), I do not know what license to use. Would creating my own be the best choice? Note that I do not have a lawyer nor do I have the resources to obtain one. It appears on its face to be closest to a "visible source" license, but those do not seem to accommodate the "approved derivative work" aspect I want. Here is the license as I have it so far. Is this a valid format and are these terms permitted to be used in this manner?                   /*******************************************************************************         * @author Reika         *          * This code is the property of and owned and copyrighted by Reika.         *          * Any and all users are permitted to use the source for educational purposes, or to create derivative works         * for private use only.         *          * Unless given explicit written permission - electronic writing is acceptable - no user may redistribute this         * source code nor any derivative works. These pre-approved works must prominently contain this copyright notice.         *          * Additionally, no attempt may be made to achieve monetary gain from this code by anyone except the original author.         * In the case of pre-approved derivative works, any monetary gains made will be shared between the original author         * and the other developer(s), proportional to the ratio of derived to original code.         *          * Finally, any and all displays, duplicates or derivatives of this code must be prominently marked as such, and must contain         * attribution to the original author, including a link to the original source. Any attempts to claim credit for         * this code will be treated as intentional theft.         *          * Due to the Mojang and Minecraft Mod Terms of Service and Licensing Restrictions, compiled versions of this code         * must be provided for free. However, with the exception of pre-approved derivative works, only the original author         * may distribute compiled binary versions of this code.         *          * Failure to comply with these restrictions is a violation of copyright law and will be dealt with accordingly.         ******************************************************************************/


title: Anemic Domain Model vs. DDD by definition example(s)?

text: What is an example of "Business Logic" that should reside in the DomainModel i.e. inside an Entity instead of inside a (Domain) Service, as well as some example logic that should be in a service. Here are what I would consider to be pretty clear cases(?): Basic Validation would be done by the ViewModel definition attributes and jQuery validation. Therefore data correctness should be fine by the time data gets to the Service/DomainModel(Entity). Some business logic that depends on other Entities would belong somewhere outside the Entity in a service (naturally/presumably). Something that I could picture existing in a DomainModel (Entity) would be simple adding items to a list property (ensure no duplicates exist etc.). Perhaps some basic copy functionality. What else do you put in the Entity/DomainModel, instead of the Service? It's hard to make a clear distinction, or at least it feels like most of the logic would end up in the Service(s).


title: Efficient way to shuffle objects

text: I'm writing a program for some quiz software. I have a question class containing the ArrayLists for the question, answer, options, marks and negative marks. Something like this:               class question     {         private ArrayList<Integer> index_list;         private ArrayList<String> question_list;                 private ArrayList<String> answer_list;               private ArrayList<String> opt1_list;                 private ArrayList<String> opt2_list;         }      I want to shuffle all questions, but for questions to be shuffled, all the objects need to be shuffled. I would have approached this problem in this way: First of all, I would not have used this design and used String not `ArrayList<String>` type as instance variables, and would then have used the `Collections.shuffle` method to shuffle objects. But my team insists on this design. Now, the question class is containing increasing ArrayLists as the entry to the questions are made. How to shuffle the questions now?


title: What's the Best way to create a trial version of software for OS X?

text: I am having someone develop a program for me and I want to sell it for like $10. I was wondering what's the best way to create a trial version that I can tell my programmer to do. Like 30 day trial. And what's one way I can make it so once they pay, I can send them a unlock code. What's done in the program to allow that? If you could give me an answer that I could tell my programmer, that would be much appreciated. Thanks!


title: modelling data / UI models in relation with the Data Layer

text: I have a user interface in Asp.Net MVC, which would for example need to load a list of products to show. Let us assume this calls `ProductRepository.GetProducts()` . In the data layer, I have a class `ProductData` which is the actual data stored in the product. I would like to seperate the frontend (UI) from accessing the data layer directly. Would it be best to have an interface say an `IFrontendProduct`, which would be implemented by `ProductData`. Then, the `ProductController` would interface directly with the `ProductRepository`, or should the controllers not even 'know' about `ProductData`, but only about the frontend- exposed interface, `IFrontendProduct`? Would it make more sense to have a model, say `FrontendProductModel`, rather than an actual interface? Then, the backend would bridge between `ProductData` => `FrontendProductModel`. I always like to think of it as having two seperate entities developing the frontend and the backend. In that case, the entity developing the frontend would not 'know' about `ProductData`, but only the interface/model exposed by the API developed by the entitiy developing the backend. Does this make sense, or is this taking seperation to an extra, un-needed level? Personally, I think the best-scenario would be to have a `FrontendProductModel` which the frontend can only access, and the frontend wouldn't even know about `ProductData`. Then, any calls which the frontend makes to the backend services, they would return them as `FrontendProductModel`. The backend would then translate the results from the data-layer to the model. I find this creates the best seperation between the layers, but it can be quite cumbersome to implement at times as it involves a lot of redundant code and copy properties to/from data-layer and frontend- models.


title: Get License Information for all Used nuget Packages

text: To keep our house in order, I want to automatically assemble licenses for project dependencies in our documentation, rather than having to add them manually. Does anybody know a simple way to traverse a set of CSPROJ files and extract the license information for the referenced packages?


title: Who manages a CMS after a freelance project is complete?

text: I've been a full stack .net developer for several years now using C#/MVC4/SQL Server and have never taken on a freelance project. This is because up until now I have worked only as a full-time consultant by hour or on start-ups for equity. Also, I have only worked on very large complex projects that needed to be built for scale and thus had many layers. I'm now faced with a potential client who wants a website that is fairly easy:   1. Existing client-side   2. Build new database of products   3. Create a few pages to existing client-side    4. Add search/filtering functionality to search products in the database My usual development routine for building complex, scalable applications is very much overkill for the task so I'd like to use a CMS for the first time. Being that I'm a .NET developer, Orchard CMS looks great and I'd like to jump right in. I'm trying to come up with an estimate on the work but I'm not familiar with how freelance projects work in regards to source code. After I set everything up do I expose the WebMatrix project to the client so they can begin using the CMS as the administrator, adding content through the dashboard, etc themselves or do I only publish the end product and they have to come back to me for me to add functionality through the CMS dashboard? Obviously the agreement can be either way, but do programmers generally charge more for actually exposing the project and dashboard to the client or is this generally by default for CMS projects? As a side question, should I feel obligated to even disclose the use of a CMS behind the scenes (Assuming that I actually charge for the true time taken to set up the CMS)?


title: Can PHP and Javascript do backend together?

text: I am creating an application with a friend, which we are planning on writing the back end partially in PHP and partially in Javascript with Node.js. Javascripts front-end involvement with PHP makes this a tough question to Google. We are also using ejs templates, MySql database and it will be run on a Fedora server if those factors matter. **Question:** I would like a basic understanding of how they combine and maybe more importantly if it is better to prepare for this merge now or if it is something we can figure out later?


title: How do I pitch ASP.NET over PHP to a potential client?

text: I work at a Microsoft shop doing mainly web development. We had a client who asked us to review (improve) the data model for his web app, but said that he wants to develop his app in PHP (he knows "a guy" who can do it). When I asked him why he wants to go with PHP, he gave me the standard set of arguments from the 90's:   1. Microsoft is evil, and PHP is free   2. Writing an ASP.NET app is more expensive (software-wise)   3. Why would Facebook use PHP if it was a bad idea? **[classic]** He had a few more comments about the costs associated with going .NET. The truth is that "Microsoft is expensive" does not hold water any longer, with their "Express" suite, you can develop an ASP.NET app without paying anything for software. When it comes to hosting, you can save a few bucks with PHP over .NET, but that's a small fraction of the projected development costs (we quoted 10-15k). Going back to my question, **what arguments would I give to a client in favor of ASP.NET over PHP? [please provide sources for quantitative claims]**