title: How improve learning habits, best practices?

text: > During the freshman year of high school, I had decided to master pre- > calculus on my own during a summer recess. So I spend 2-3 months reading > each chapter and solving all odd problems (to be able to check against the > answers at the back of the textbook). While I've learned the material, in > retrospect, I think it wasn't the best time-efficient approach. Fast forward > 15 years, past my university years and years on a job, I seemingly cannot > master anything in depth; I sort of only scantly familiarize myself with a > material. I only read the material or watch on-line video courses (such as > Khan academy lectures, free video courses offered by leading universities, > etc). I feel that I don't even know how to study or concentrate anymore. > Always multitasking. Please advise on the development of effective study > habits. How do you study independently these days? Friends I am looking for the **actionable** steps, and not just philosophy. What and How I can arrange my study to effectively master a material.


title: Ticketing System / Development Phase

text: At the stage of a project right before you actually start putting code in the editor how do you organize the project and your "tasks". Ticketing systems are great but I can't seem to find a way to make them worthwhile on a project until after launch. When tracking bugs and gathering enhancement ideas for later versions. What is a good methodology or "system" that you have used in the past that has helped keep a project organized and moving forward. A way to track your tasks and notes?


title: Hashing Algorithm: Deleting an element in linear probing

text: While using Linear probing method to implement hashing, when we delete and element, the position of the deleted element is declared as a tombstone/ mark it as deleted. Why can't we just shift all the elements from the current position until the next empty element is encountered? Won't this save the time when too many tombstones are encountered later and a rehashing might be required? Am I missing something? Please tell me if I need to clarify my question. Thanks a lot!


title: Things to do before going to production

text: I am finishing up a decently sized Python/Shell project, and I'm wondering if there's a 'best practice' list of things to do when finishing up development. So far I've done:   * pylint   * pycallgraph   * grep'ed for :TODO: and :FIXME:   * find orphan code   * some more documentation   * install scripts for client and server   * make sure comments match the reality (before I forget the finer points) What other things do you do, generally, or Python-specific?


title: Learning system instead of using sed/replace for reviewing test results

text: For every build of my software I run it through a series of tests that execute a number of commands on a command line and captures the results. Most of the time the output is a combination of: \- Static information that is, and should be, the same between every run. \- Dynamic information that is not easy to predict. For the purpose of testing this software I desire to only verify that the static information is the same between each test. Currently I use sed on the captured output of my automated tests to filter out the dynamic information. Any differences between test runs are then identified using the filtered data resulting from applying the sed rules. Because of the large variety of command output that is processed, maintaining the sed rules has become an onerous job. Is there a system, that with a large sample of executed test results, can show uncommon changes between two files contained in that large sample of test results? To clarify, if I were to diff two files, I would only want to see differences for items that changed 5% of the time between all the files involved. Any other data that changed 95+% of the time would be excluded as differences when comparing two of the files within the large set of test results. In this example, among the large set of test runs, the first column is almost always consistent: Run 1:               1/*/1    6643   2433   12343   232424    112       2/1/1    2311    455    1342    60233   5231     2/1/2    2355   1223      93    12389   1342      Run 2:               1/*/1    3121    112   98832      451   1233       2/1/1    6342   2345   84421     3456   8362     2/1/2   72453      5     421    64321   7634      Run 3:               1/*/1      12     65     312      653    973       2/1/1   12442  54231   46012        6    734       2/1/3     734     28     623       76   1834        On top of the three runs above, there are hundreds of samples of this same commands output generated for each incremental build of the software. When performing a difference between each of the three examples above I would like to have the following results: No Differences between Run #1 and Run #2. Difference showing that "2/1/2" was changed to "2/1/3" when asked to show the difference between Run #3 and either of the other two runs. Currently I have a sed script that replaces all the "random looking" numbers above (counts, timestamps, etc) with hashmarks or other constant indicators so that all that is left to compare is the starting column. What options, if any, exist in this area? Is there a name for this kind of text comparison?


title: Optimize Reading of Multiple files

text: I have a unique problem which I'm hoping someone can assist with. I have One big text file, our **Production** file. The data in the file is delimited in the following format               Reference|Cost Centre|Analytics Base Value|....      UMBY_2288|023437|2883484|...      NOT_REAL|1343534|283434|...      The average size of this file is about 30MB. with about 120000 rows. and then I have about 20 **Regional** files. these files are similar to the Current big file in structure. except that they are smaller. average size 50000 rows. Now I have to loop through each line in the big Prod file. For each **Reference** code, I have to search through each of the 'Regional' files to see which ones contain that specific reference code. and then copying some of the data from that line into a report. There is no way of predetermining what files to look into. And each reference can be in multiple **Regional** files.. As you can imagine, looping through each row in each file, multiple times is a very time consuming process. Due to memory constraints, I can't load the files into memory. Does anyone have any smart ideas on how I can do this? I don't need code samples. just pointers on ways I could solve this problem. I'm developing the tool in C#.


title: How to transfer metadata using Bluetooth between an iPhone and an Android mobile?

text: I would like to develop a hybrid app to transfer data/meta data between an iPhone and an Android mobile device using Bluetooth. I could find BTStack and PhoneGap useful. But, is it possible to support meatadata using these? Ref :   https://code.google.com/p/btstack/w/list   http://www.randdusing.com/2014/02/19/bluetooth-low-energy-plugin-for-phonegap/


title: Computer Science or Computer Engineering for Data Science and Machine Learning

text: I'm a 25 year old data consultant who is considering returning to school to get a second bachelors degree in computer science or engineering. My interest is data science and machine learning. I use programming as a means to an end, and use languages like Python, R, C, Java, and Hadoop to find meaning in large data sets. Would a computer science or computer engineering degree be better for this? I realize that a statistics degree may be even more beneficial, but I'll be at a school which dosn't have a stats department or a computational math department.


title: What is the best retort to "premature optimization is the root of all evil"

text: Often I hear the sentiment ... "Why worry about performance, write slow code, get your product to market ... don't worry about performance. You can sort that out later" The culmination of this sentiment is: "... premature optimization is the root of all evil ... #winning" I was wondering, does anybody have a **good** retort to this one liner. Ideally an equally strong **one liner** that encompasses the reverse of this sentiment?


title: Implementing Lazy Registration

text: I'm interested in setting up Lazy Registration on my website. Ideally, I'd like people to be able to fill out a record that might include their name, email, address, etc. and then record it to a user record later. The problem is, sometimes the person filling out that form will already have a record on the site. At that point, if they enter a new address, this will overwrite the old one if there's already a record with that e-mail address (I don't want to create duplicate records for the same e-mail). Since this is an open website, I have to ensure if someone is changing an existing record, that somehow they have to verify they are who they say they are before the record can be changed. Right now I'm not sure what the best option is for confirming that. Is it better to:   * Avoid lazy registration altogether if this is a concern, and force users to log in if the form they are entering has the potential to change an existing record   * Embed a login into the form -- so if they enter an e-mail for an existing record, it displays a login form that they have to fill out before the data is confirmed   * Pop up an Ajax-based login form while they are filling out the form, if they enter details (email, etc) that match an existing record in the database


title: As a programmer, can you work with noise?

text: I'm here to post this question and know more about your thoughts on it: **Can you work with noise?** Sometimes, when you're developing something really tricky, your deadline is getting close, and someone enters your room talking to your colleagues, with loud talking, suddenly... your logic is gone! :-) About me, it's really funny and ironic this: when it comes to music, I can think better, maybe because I'm focused in my solution avoiding distractions and chit-chat. But I know people who told me that they can't work in silence. I just can't work with too much noise. How about you?


title: What's the scariest piece of Other People's Code you've ever had to maintain?

text: It's happened to all of us. Maybe the original author is no longer with the company, or maybe the boss just doesn't trust him to fix it (Kernighan's Law). Either way, they gave it to you, and you ended up having to fix it. What was it like? What was the problem? How bad was the code, and what did you end up doing with it?


title: Is verification and validation part of testing process?

text: Based on many sources I do not believe the simple definition that aim of testing is to find as many bugs as possible - we test to ensure that it works or that it does not. E.g. followint are goals of testing form ISTQB:   1. Determine that (software products) satisfy specified requirements ( I think its verificication)   2. Demonstrate that (software products) are fit for purpose (I think that is validation)   3. Detect defects  I would agree that testing is verification, validation and defect detection. Is that correct?


title: Naming convention for a method that both sets and gets

text: Let's say we have a method `setFoo` that sets a flag in a Bar object e.g.               class Baz {          public void setFoo(String foo)(            ...         }     }      inside setFoo, the method is doing some expensive load of the `Bar` object from the database.               class Baz {          public void setFoo(String foo)(            Bar bar = expensiveGetBar();            ...         }     }      To avoid the need to get the `Bar` object again, the developer changes the method to return it.               class Baz {          public Bar setFoo(String foo)(            Bar bar = expensiveGetBar();            ...            return bar;         }     }      Questions are:   1. Is this discouraged?    2. If yes, why and what is the alternative    3. Should the solution be adding some sort of cache instead?   4. How would you prefix the method? set? get? seget? geset?


title: About classes and their valid states

text: I get stuck each time I need to write a constructor for any class I design. The reason is that I am not sure what should go into a constructor and what should not. On googling for this, I got the answer that the constructor need to do only as much as to make sure that the opbect created is valid. But my query is > How do you know if an object is in the valid state? My class represents a chess board:               public class ChessBoard     {         List<ICellRow> lstRow;         int cellOffset;              //Other function              public ChessBoard()         {             //What should go in here?         }     }      How do you decide when a class has the minimum information to be in the valid state? In this specific example, makes the board class valid?


title: When should development branches be created?

text: We are moving our project's team from using a single Main/Trunk branch, to multiple Development/Work branches that should be regularly merged into Main. We're basing our new process on this article and the TFS Branching Guide (we are using TFS and Visual Studio 2010). There are currently between 1 and 5 people working on the project at any one time. Main must be stable at all times because we want the option to release whenever we need. We don't have fixed sprints - at least not yet - and at the moment release every 1-2 weeks. Right at this point in time each person is fixing bugs across the application. In a couple of weeks we will be starting development on a new large component for the app. One sticking point we are finding is **when development branches should be created**. We will be implementing multiple user stories in parallel depending on the skill set of the developer. We've thought about creating a branch for each developer but that doesn't make sense because there will always be some need for collaboration on a piece of work. We can't get by with a single development branch because we will want to merge to Main while other work is completed. Does anyone have some guidance on this?


title: Entity Framework limitation

text: I was wondering if anyone had the same need and why (if possible). My problem is: I can't create a model in EF using two tables from different DBs without some weird workarounds. For my scope that is very much necessary. Did any of you ever needed to do this? What did you do? And, like me, do you think MS should add this feature? Thank you all.


title: How will you handle NULL values in your application?

text: At what level do you prefer to handle Null values in your application? My personal preference at the moment is the DB. When I build a view, I ensure that I return a value in place of a NULL value. So if your front-end app were to connect to the application it would never have to handle nulls. In my VB6 apps, I made liberal use of the IsNull function to handle Nulls. Share your experiences.


title: Are there opportunities working as full-time paid programmer for Non-profit organizations

text: Some recent events in my life have made me want to contribute more to causes I believe in rather than just working for a profit-driven company. I have been thinking that if I could find a non-profit organization that I like and believe in then I might feel more fulfilled working for them. I have a decent amount of web development experience and currently work as a Java / Spring web developer. I realize the compensation wouldn't have the same "ceiling" potential as for- profit but am wondering if its possible to get at least something close to a market rate for work as I am planning to start a family sometime soon and still need a legitimate income. If anyone has any knowledge or experience about this sort of thing would be happy to hear from you. EDIT: Without getting in to too much personal detail, I have a relative who recently passed away who suffered from a mental illness so while it doesn't have to be an organization specifically dedicated to this, I am hoping to work for something along these lines at least where there is more of a social cause rather than just working on an open-source project whose only cause is the advancement of technology.


title: How do we avoid GPL violation when modifying and releasing a program using code coverd by this license?

text: A friend and I have started a project using code from another project, that is covered licensed under GPL. We have distributed it freely on our website, and under its download button, we've added a direct download link to the modified source code also for free. At the about section of the application, we have credited the guys who built the original code. Does the fact that we have a different project name violate the terms of the GPL? And also, if we include the original GPLv2 notice from the original app does that help us comply with it? If not, please state exactly what we have to do to comply with the GPL. The code we're using is an older version, released under GPLv2, and that project has been discontinued, and moved to a different one, where they're still developing. We haven't used any of their current coding, which is released under GPLv3.


title: Who gives direction to the overall product offering and innovation?

text: I sometimes wonder how CEOs or Founders of companies like Microsoft and Oracle manage the overall technology movement and product link-up. Take for example Oracle, it started with the database only and now, when you open their official site, the bibliography opens. Take for instance, Oracle database 11g. The core database is continuously improving and new features are being added. At the same time you need to keep a vigil on the current market trends, needs and competitors. Does Larry monitors each and every activity of technology advancement? What about new ideas and innovations? Who is responsible for these? Another example that puzzles me is .NET. With a new thing launching every second day, who is the .NET father and who suggests these guys to add classes for this and that. Who gives direction to the overall product movement and also integration with the other products? This is simply a beauty. This seamless integration or communication between the products and the technology as a whole is remarkable. (Not a biased view). Few years back I read a book titled: _Microsoft Secrets_. The author writes that at Microsoft, even the very senior person has to code because until and unless you are able to code, you can't better run a software company. I sometimes think Ballmer codes or not and what about Bill? Is he coding another OS at home?


title: Test descriptions/name, say what the test is? or what it means when it fails?

text: The API docs for `Test::More::ok` is               ok($got eq $expected, $test_name);      right now in one of my apps I have `$test_name` print what the test is testing. So for example in one of my tests I have set this to `'filename exists'`. What I realized after I got a bug report recently, and realized that the only time I ever see this message is when the test is failing, if the test is failing that means the file doesn't exist. In your opinion, do you think these `$test_name`'s should say what the test means if successful? what it means if it failed? or do you think it should say something else? please explain why?


title: Knowledge Transfer without a Plan

text: We are doing work for a particular client managing their CRM implementation. (The CRM itself is a product which has been largely customized to suit my client's needs). Now, they want us to manage the Oracle batch jobs/ETL as well. And for this, they are ready to provide us with Knowledge Transfer. (The Oracle batch jobs/ETL is managed in-house by the client now). After much persuasion, I got one of the Project Lead (designation-wise) to email the client asking for a KT Plan. (The Project Lead kept saying that they have never had KT plans before and all that for which I offered I will draft a template and even that was rejected!). Email from us to them - > Can you please share with us the KT Plan? Response from them - > Not sure what is expected from my side? The KT is planned for tomorrow from > 11 am onwards where Functional knowledge of existing ETL Data migration > package will be shared. How do you handle such a client? Most likely what is going to happen is this. The person who is giving the KT will say that I have given complete Knowledge Transfer and we will go back and say that "No, this was not covered. For this, they provided an overview alone and left it at that!" and so on... My Project Lead also did not respond to that email. He just said that the meeting is scheduled to happen at 11 AM (basically repeating whatever the email said and left for the day!). What could I possibly do? PS: Look for another job is a very helpful answer, but I am not looking for it. :-) **EDIT** The meeting went on well where they shared a Oracle DB package (which runs to 10K LOC). They told us that ETL which fetches data from other core systems to a Staging_DB is the ETL team (another team's) responsibility. This Oracle DB package will move the data from Staging_DB to my CRM_DB which is what we are to manage/modify. **What I did** Drafted the Minutes of Meeting as below:   1. Listed down what is In Scope and what is Out Scope   2. No documentation regarding the functionality of the Database Package   3. No reports for performance of existing Database Package to baseline the performance   4. ...   5. ... And then went back to my management and told them I need time to do the documentation, baseline the existing performance and so, I will come back with clarifications which the client is supposed to answer. Let us see how that goes.


title: How to connect mvc application using entityframework or ado.net?

text: I am an ASP.NET developer. I want to learn ASP.NET MVC. In fact I am learning it. But Now I am confused at a point. How can I connect my database to my application. Using entity framework or linq or ado.net. I have good knowledge about ado.net. But about entity framework I cant say anything. Now my problem is this whichever ebook or website I see every entity framework is used. So is it essential for me to learn first entity framework before ASP.NET MVC or not?


title: Is there such a thing as Programmer's block?

text: Is it possible for a programmer to suffer the equivalent of writer's block? What strategies are there to overcome it?


title: In the world of .Net, managed code and the web is there still a place for VBA?

text: Microsoft has moved away from the COM stack, VB6 is so last century and .Net rules the (MS) roost. Yet I find myself still banging out reams of VBA code am I dinosaur? The need for VBA is a new project automating Excel seeing as you ask. I've tried to doing the same kind of thing using VSTO and it was just too damn buggy/hard/inefficient with a broken development model. I can't get rid of the feeling that I'm missing something, OTOH I really can't see a better way of solving this problem. What are your thoughts?


title: Creating menu structure using DB - is that fine?

text: Also I have an application that basically consists of a lot of screen so user needs to navigate a lot (like go from A>B>C>D) etc. I have been thinking how to implement this (mainly hold the structure of the menuj) as it needs to be on-screen menu (custom, no menu strips etc.) and did not find any solution. Now I realized I could use a database for that, which would allow me also to change strings later with no impact. My idea would be to have a table for each level (1-5) with options available. Once the user selects an option, the program will select any items in the table (CurrentLevel+1) based on its ID. Seems really a good solution to me but I am not a programmer (rather than an analyst). Or even I could use specific table names and hold the table name in a specific column, for example: > User selects Settings > > Program checks that with Settings, there is a table associated "SETTINGS" > and query this table for all items available Makes sense?


title: When to use the whiteboard pattern versus direct calling

text: I'm creating the architecture for a new embedded project. The system has some inputs that go to wildly different outputs. The whiteboard pattern is very useful for this (see Listeners Considered Harmful: The "Whiteboard" Pattern), as it decouples the input component from the output components (a 1-to-N relationship). However, I'm struggling with the N-to-1 relationship (where one output gets data from wildly different inputs). Should I use the whiteboard pattern there? And what about the 1-to-1 relationship? Advantages that I see of the whiteboard pattern:   * separate deployment and testing of sources and listeners.   * the whiteboard (EventAdmin in the OSGi world) can be monitored separately.   * there is no build-time dependency. Disadvantages that I see:   * there is no compile-time check on the events (if someone makes a typo in the event topic or the data, you're screwed).   * overhead of the whiteboard (I've done measurements, and it's significant on our platform). I'm not quite sure how to balance these trade-offs.


title: Can I use Node to add email functionality to an existing site?

text: I have a client with an existing straight up HTML/JavaScript site. No back end of any kind. He wants to add email functionality to it and I was thinking of using Node to do this for two reasons:   1. It seems like an extremely lightweight way to do it   2. He's talking about adding further functionality in the future. What are the positives and negatives of this approach?


An executive at my workplace asked me and my group of developers the question: > How many lines of code can a C# developer produce per month? An old system was to be ported to C# and he would like this measure as part of the project planning. From some (apparently creditable) source he had the answer of "10 SLOC/ **month** " but he was not happy with that. The group agreed that this was nearly impossible to specify because it would depend on a long list of circumstances. But we could tell that the man would not leave (or be very disappointed in us) if we did not come up with an answer suiting him better. So he left with the many times better answer of "10 SLOC/ **day** " _Can this question be answered?_ (offhand or even with some analysis)


title: Architecture: for a Single website to be supported for different Clients

text: I have developed a system with one company profile. The system is built using WCF services, asp.net. Now another company wants to use our system as well. And they might need some customization and some of their data elements are different. So I am planning to create a separate database for the new company and branch the business logic layer. I thought of different options to architect this and ended up with the following. So what is the best way to design a system of this sort. **Approach A:** Expose the methods as two different WCF services one for each company. So there will be one WCF client interface (IClient) but two different Service classes for each company implenting them. `ClientAService : IClient, ClientBService : IClient.` **Problem:** The problem with this is all my datacontracts and datamembers are exposed to the client in 2 different namespaces. `(ClientAService.ObjectABC and ClientBService.ObjectABC).` So all the objects that I use in the website are conflicted. ie(when I have a list of `ObjectABC` in a datasource in the webpages, the website don't understand whether its from `ClientAService` or `ClientBService`. **Approach B:** Expose the methods as a single WCF Client, but 2 different business logic layer. But they will use the same datacontracts. So the methods will return the same datatype. so I will have one service class               ClientService : IClient          {     public <ObjectABC> Method1(String Companycode)     {     if(CompanyCode == "A")         return new AbusinessLogic().Method1();     else if(CompanyCode == "B")         return new BbusinessLogic().Method1();     }     }      **Problem:** The only problem I can think of right now for every new company, I have add the above else if part for all my methods. I am also open to know if this can done in any other better way than the stated options. note: I was told that there might be more companies to be added in future.


title: Adding complexity to remove duplicate code

text: I have several classes that all inherit from a generic base class. The base class contains a collection of several objects of type `T`. Each child class needs to be able to calculate interpolated values from the collection of objects, but since the child classes use different types, the calculation varies a tiny bit from class to class. So far I have copy/pasted my code from class to class and made minor modifications to each. But now I am trying to remove the duplicated code and replace it with one generic interpolation method in my base class. However that is proving to be very difficult, and all the solutions I have thought of seem way too complex. I am starting to think the DRY principle does not apply as much in this kind of situation, but that sounds like blasphemy. How much complexity is too much when trying to remove code duplication? EDIT: The best solution I can come up with goes something like this: Base Class:               protected T GetInterpolated(int frame)     {         var index = SortedFrames.BinarySearch(frame);         if (index >= 0)             return Data[index];              index = ~index;              if (index == 0)             return Data[index];         if (index >= Data.Count)             return Data[Data.Count - 1];              return GetInterpolatedItem(frame, Data[index - 1], Data[index]);     }          protected abstract T GetInterpolatedItem(int frame, T lower, T upper);      Child class A:               public IGpsCoordinate GetInterpolatedCoord(int frame)     {         ReadData();         return GetInterpolated(frame);     }          protected override IGpsCoordinate GetInterpolatedItem(int frame, IGpsCoordinate lower, IGpsCoordinate upper)     {         double ratio = GetInterpolationRatio(frame, lower.Frame, upper.Frame);              var x = GetInterpolatedValue(lower.X, upper.X, ratio);         var y = GetInterpolatedValue(lower.Y, upper.Y, ratio);         var z = GetInterpolatedValue(lower.Z, upper.Z, ratio);              return new GpsCoordinate(frame, x, y, z);     }      Child class B:               public double GetMph(int frame)     {         ReadData();         return GetInterpolated(frame).MilesPerHour;     }          protected override ISpeed GetInterpolatedItem(int frame, ISpeed lower, ISpeed upper)     {         var ratio = GetInterpolationRatio(frame, lower.Frame, upper.Frame);         var mph = GetInterpolatedValue(lower.MilesPerHour, upper.MilesPerHour, ratio);         return new Speed(frame, mph);     }


title: "sell" coding my next project in an unfamiliar language

text: I want to code my next work project in a language I'm unfamiliar with (python). I can think of plenty of reasons from my point of view why its a good idea (not least of all because it sounds fun). However my manager will probably ask me why. I'm a little stumped on the advantages from his point of view. **EDIT** : I normally code in C# **EDIT2** My reasons for wanting to code in another language;   1. It will make an easy project much harder so I will learn more and it will be more interesting   2. I have just read a book on python. I want the chance to apply it in a business application so I properly understand it   3. It will increase my skill set and make me more employable    4. Python looks fun


title: Where can I find an algorithm for creating 3D anaglyphs using a depth map image?

text: I'm looking for a generic algorithm to calculate a red/cyan anaglyph starting from the original image and its black/white depth map, as in this example? That algorithm is used, for example, in Photoshop but I can't find a readable explanation to reproduce it.


title: Exclusive use of a Jini server during long-running call

text: I'm trying to use Jini, in a "Masters/Workers" arrangement, but the Worker jobs may be long running. In addition, each worker needs to have exclusive access to a singleton resource on that machine. As it stands, if a Worker receives another request while a previous request is running, then the new request is accepted and executed in a second thread. _Are there any best-practices to ensure that a Worker accepts no further jobs until the current job is complete?_ Things I've considered:   * synchronize the job on the server, with a lock on the singleton resource. This would work, but is far from ideal. A call from a Master would block until the current Worker thread completes, even if other Workers become free in the meantime   * unregister the Worker from the registry while the job is running, then re-register when it completes. Might work OK, but something doesn't smell right with this idea... Of course, I'm quite happy to be told that there are more appropriate technologies than Jini... but I wouldn't want anything too heavyweight, like rolling out EJB containers all over the place.


title: What do you call a developer specializing exclusively in microsoft programming languages like T-SQL and C#?

text: What would you call this type of specialty? Is "Microsoft Developer" misleading?


title: Is there such a thing these days as programming in the small?

text: With all the programming languages that are out there, what exactly does it mean to program in the small and is it still possible, without the possibility of re-purposing to the large. The original article which mentions in the small was dated to 1975 and referred to scripting languages (as glue languages). Maybe I am missing the point, but any language that you can built components of code out of, I would regard to being able to handle "in the large". Is there a confusion on what Objects are and do they really figure as being mandatory to being able to handle "the large". Many have argued that this is the true meaning of "In the large" and that the concepts of objects are best fit for the job.


title: Will LAMP meet the following needs?

text: I remember a few years back, when I had a web-site I wanted to develop, that many people recommended I go the LAMP route. Unfortunately, I never got around to studying/practicing that. I'm currently revisiting the web-site idea. The web-site will be dynamic, transactional, and hopefully end up with around 1,000,000 pv/mo and 300,000 members within 18 months. Will LAMP adequately support a site like that (i.e. have you seen it under a site with those specs)?


title: Good practice on Visual Studio Solutions

text: Hopefully a relativity simple question. I'm starting work on a new internal project to create tractability of repaired devices within the buildings. The database is stored remotely on a webserver, and will be accessed via web API (JSON output) and protected with OAuth. The front end GUI is being done in WPF, and the business code in C#. From this, I see the different layers Presentation/Application/Datastore. There will be code for managing all the authenticated calls to the API, class to represent entities (business objects), classes to construct the entities (business objects), parts for WPF GUI, parts of the WPF viewmodels, and so on. **Is it best to create this in a single project, or split them into individual projects?** In my heart I say it should be multiple projects. I have done it both ways previously, and found testing to be easier with a single project solution, however with multiple projects then recursive dependencies can crop up. Especially when classes have interfaces to make it easier to test, I've found things can become awkward.


title: Can programmer experience be expressed in hours of coded like hours of flight for a pilot?

text: How useful would it be for a recruiter? In martial arts there are a minimum number of trainings, not years of practicing, to be evaluated for a higher level. I saw some exceptions but there are rare. In software, maybe this would be valuable to express experience in particular technologies such as OO, OR/Mappers or specific DBMS.


title: What is the most effective grammar to use for issue titles?

text: When choosing a title for a new issue, there are several grammatical options to choose from. Here are four different options for an example issue I just made up:   * **Descriptive** : "Newlines are not stripped when multi-line headers are parsed"   * **Imperative - negative** : "Avoid leaving newlines when parsing multi-line headers"   * **Imperative - context first** : "Fix parsing of multi-line headers: strip newlines"   * **Imperative - desired action first** : "Strip newlines when parsing multi-line headers" At my workplace the issue titles alternate between all of these formats, but I keep thinking it's better to pick a convention and stick to it. Which option (from the above, or a different one) is the preferred one, i.e. the one that will minimize the effort of developers reading these issues? **Edit:** as noted in the comments, different issue types may warrant a different choice of grammar, where an especially important distinction is between bugs and new work. To make the question more specific, let's say we choose, as msell offers in his answer, the descriptive option. Now let's look at a suggestion to improve an existing feature:   * "Add city information to geolocation" If we stick to the descriptive grammar, we should replace that title with   * "City information missing from geolocation" However, this seems less clear, since the lack of city information is not a bug, it is the expected behavior. The reporter is merely suggesting to improve that behavior. So it seems the imperative option is the way to go with that issue. Let's look now at an entirely new feature. Consider these options:   * "No ability to export report to XML"   * "Add ability to export report to XML"   * "Export report to XML" Describing the current behavior seems even more ridiculous here, but the imperative option doesn't look so good too. The third option simply describes the new feature itself, which might be the way to go here, assuming the issue has meta-data that indicates this is a “new feature” issue.   * **So what's more important - sticking to one convention, or matching the grammar to the issue?**   * **Where would you draw the line between a descriptive title and an imperative title?**   * **When would you describe the current behavior and when the desired behavior?**


title: How should I recursively process a file in Haskell?

text: Basically I'm expanding a literate program in Haskell. There are two things I need to look for to expand. Here's an example file:               program.c.lit:     ==============     Some comments in the source file that I can ignore         <main>=         code.. code ...         code..         <a>           Some comments in the source file that I can ignore         <a>=         code... code...         code..      In a file, I need to look at each `<some var>` and substitute it with its matching definition defined below `<some var>=`. All the lines which are indented with 4 spaces below a `<some defn>=` are included in that chunk. In the end i should have a file consisting of only `code ...` lines. How should I approach this problem in terms of file processing, what's a good approach? I'm comfortable with recursion, less comfortable with monads.


title: Is eventual consistency a wrong solution for e-commerce applications?

text: I'm reading about eventual consistency in couchDB. I'm somewhat confused by the term and its consequences on an application. Let's say I'm building a distributed e-commerce website where monetary transactions are critical. There could be online auctions running and people bidding on them in real time. Will using a eventual consistent DB such as couchDB be a wrong solution? Should I favor a more consistent solution such as a relational database? Is couchDB suitable for something non critical such as a social network where one wouldn't mind if his news feed isn't up to date or when comments on his posts are somewhat delayed by few seconds? Update I'm talking about building a distributed system. I think in case of a single server nothing of this will matter.


title: Search results in PhpStorm

text: I have two questions on the search results panel (Find Occurrences of...) in PHP Storm:   1. What does "Unclassified usage" mean? How can results be classified?   2. Is there any way _not_ to group results by file? I am using the latest version (3.0.3)


title: What are the Top Developer Productivity Tools/Plugins for Java in Eclipse?

text: I personally use CodeRush in Visual Studio 2010 to do refactoring, write code faster with templates and generally navigate my code 10 times faster than stock VS. Recently, I've been working on another Android app and got to thinking... **What are the top productivity plugins for Eclipse?** Preferably free. I'm looking for plugins that help write in Java, not PHP or Rails or any of the other languages Eclipse supports.


title: Modeling objects as functions

text: I want to model simple objects as functions, to see where the pure functional approach gets me. Let's say my object is a person. There is some function that returns me a new person, but instead of just some data structure, it returns me a function that represents the person. I'm having difficulties to see what this function should exactly look like, because I mostly associate data/state with a person but not any function. So if I call this person, which is a function now, what input should it take and what should it return? If I look at the lambda calculus and some examples of how to model numbers, 0 is just the identity function. 1 is a function that takes another function and a value as input and returns the argument function applied to the value. 2 applies the function twice, etc. So should the implementation of a person be a function that takes another function as input and applies it to the person, returning its output? So it's actually just a container for the person's data allowing other functions to operate on it. May be it makes no sense to think about this without knowing exactly what a persons consists of. In a most simple case a person could be just a name. A briefly tried to outline this in Clojure:               (defn new-person [firstname lastname] (fn [f] (f firstname lastname)))     (defn get-firstname [person] (person (fn [x y] x)))     (def p (new-person "Maja" "Abel"))     (get-firstname p)     "Maja"      Then again the names are strings and not very functional ... Hope this makes some sense, glad if anybody has some thoughts on it!


title: Pattern for group of entities with one required primary member

text: Given a parent entity with a collection of child entities where there must be exactly one primary child of the group? To make the question more concrete, I've seen a number of ways that this pattern might come up -- a group of people where one person is the leader or the contact details for a person where one is primary. Here are two different approaches that I've seen. **1\. Flag the member as primary** In this approach, a field is added on the member to designate it as primary. The advantage is that it is simple to implement and avoids additional relationships. The disadvantage is that it is more difficult to enforce in the data model that one and only one member is primary and from an object perspective, potentially puts the responsibility on the child that should be on the parent. **2\. Additional association** In this approach the parent tracks the primary member of the group and stores the id of the child. This is in addition to the children storing the id of the parent as a member of the group. This makes it explicit in the data model that there is only one primary member and an index can be added to enforce it. The disadvantage is that it requires two relationships and there is a chance that they can disagree (parent points to a child that doesn't belong to the parent). It seems to me that this is a common pattern and must be documented as a design pattern or model pattern in an architecture book somewhere. A similar pattern might be where the collection is a history and there is one current, but that is a bit easier as each member would have a date range that can be indexed. Are there better approaches? Or can someone point to where this pattern might be documented more formally?


title: How to Console.WriteLine from [TestMethod]?

text: I am trying to show some information from a [TestMethod] method. Usually we use NUnit and a line with Console.WriteLine runs fine and we can see it in 'output' window, but on this project we must to use Testing tools embebed with VS2010 and Console.WriteLine doesn't run because we cannot see anything.


title: Agile development challenges

text: With Scrum / user story / agile development, how does one handle scheduling out-of-sync tasks that are part of a user story? We are a small gaming company working with a few remote consultants who do graphics and audio work. Typically, graphics work should be done at least a week (sometimes 2 weeks) in advance of the code so that it's ready for integration. However, since SCRUM is supposed to focus on user stories, how should I split the stories across iteration so that they still follow the user story model? Ideally, a user story should be completed by all the team members in the same iteration, I feel that splitting them in any way violates the core principle of user story driven development. Also, one front end developer can work at 2X pace of backend developers. However, that throws the scheduling out of sync as well because he is either constantly ahead of them or what we have done is to have him work on tasks that not specific to this iteration just to keep busy. Either way, it's the same issue as above, splitting up user story tasks.


title: How are my licensing options limited when I use and/or include other projects in my own?

text: ### Setup I have a project (pynliner, a python module) on github that I never gave much thought about licensing. Today I got an email asking what license it is under because someone wants to use it in their commercial software. My first thought is that I would love to have 2 licenses one that is free for non-commercial use and one for commercial use. So I started researching software licenses... and got very dizzy. Then I realized I may not even be able to use most of them because my module uses several other modules. So I have a few questions about how licenses filter down. My module uses but does not include code under:   * **MIT License** BeautifulSoup   * **LGPL3** cssutils And my module uses and includes code under:   * **MIT License** soupselect.py This is a relatively minor project but I would like to use it as a learning process for the right way to approach licensing. ### Questions   * If I include someone else's code then any licenses I use must not break the included code's license correct?   * Does the same hold true for other software I use but don't include? _Am I limited by the MIT License on BeautifulSoup or LGPL3 on cssutils if I use them but don't include the source in my project?_ * * * ### edit Thanks for pointing out the licenses I had missed on cssutils and soupselect.py. Once these were pointed out the rest of my questions really come down to what is allowed within the MIT License since it is the only one over code I have included and whether or not the output of cssutils is free. I'm comfortable with looking these up the rest of the way. Thanks all.


title: Applicability of the Joel Test to web development companies

text: **QUESTION** : How can you re-write the questions of the Joel test to apply to web developers? > 1\. Do you use source control?   >  **(source control for _all_ aspects of your app, including configuration, > database and user-based settings?)** > > 2\. Can you make a build in one step?   >  **(can you deploy a site from staging to prod in 1 step?)**   >  ...   >  10\. Do you have testers?   >  **(how do you test AJAX and CSS?)** **BACKGROUND** : This is for people who work in a shop that does some web development but also uses some off-the-shelf tools like Drupal and Wordpress, but doing custom development on top of that. RELATED LINKS: http://www.joelonsoftware.com/articles/fog0000000043.html What do you think about the Joel Test?


title: Is it usual if my employer asks me to get MCP certificates for higher salary?

text: I just got a salary negotiation this morning (I passed three interviews last 3 weeks), and it was like a game. I was stubborn with my expectation, or that number, or I leave. OK, to be honest, it's not about money, but I, a not-very- experienced developer, want to see how much the employer pays me, and it was fun. And at last, my employer gave me this: "OK, _*_ $, but with two conditions, first, you get your spoken skill improved (English is not my native), and second, you got MCPs before the end of the year". He asked me to get 3 MCP certificates. The company will buy any books that necessary to the exam, but I must read them at free time, take and pass the exams . If I not get them, my employer will not kick me out, but, salary discussion will be harder, for me. I accepted that offer, I thought it's good enough. But I wonder, is it usual? If you're an employer, have you ever given that offer to a candidate? If you're an employee, have you ever got, or will you accept an offer like that?


title: Does immutability entirely eliminate the need for locks in multi-processor programming?

text: # Part 1 Clearly Immutability _minimizes_ the need for locks in multi-processor programming, but does it eliminate that need, or are there instances where immutability alone is not enough? It seems to me that you can only defer processing and encapsulate state so long before most programs have to actually DO something (update a data store, produce a report, throw an exception, etc.). Can such actions always be done without locks? Does the mere action of throwing out each object and creating a new one instead of changing the original (a crude view of immutability) provide absolute protection from inter-process contention, or are there corner cases which still require locking? I know a lot of functional programmers and mathematicians like to talk about "no side effects" but in the "real world" everything has a side effect, even if it's the time it takes to execute a machine instruction. I'm interested in both the theoretical/academic answer and the practical/real-world answer. If immutability is safe, given certain bounds or assumptions, I want to know what the borders of the "safety zone" are exactly. Some examples of possible boundaries:   * I/O   * Exceptions/errors   * Interactions with programs written in other languages   * Interactions with other machines (physical, virtual, or theoretical) Special thanks to @JimmaHoffa for his comment which started this question! # Part 2 Multi-processor programming is often used as an optimization technique - to make some code run faster. When is it faster to use locks vs. immutable objects? Given the limits set out in Amdahl's Law, when can you achieve better over-all performance (with or without the garbage collector taken into account) with immutable objects vs. locking mutable ones? # Summary I'm combining these two questions into one to try to get at where the bounding box is for Immutability as a solution to threading problems.


title: Are injectable classes allowed to have constructor parameters in DI?

text: Given the following code:               class ClientClass{              public function print(){             //some code to calculate $inputString             $parser= new Parser($inputString);             $result= $parser->parse();         }     }          class Parser{         private $inputString;              public __construct($inputString){             $this->inputString=$inputString;         }         public function parse(){             //some code         }     }      Now the `ClientClass` has dependency on class `Parser`. However, if I wanted to use Dependency Injection for unit testing it would cause a problem because now I can't send the input string to the parser constructor like before as its calculated inside `ClientCalss` itself:               class ClientClass{             private $parser;             public __construct(Parser $parser){                 $this->parser=$parser;             }             public function print(){                 //some code to calculate $inputString                 $result= $this->parser->parse(); //--> will throw an exception since no string was provided                  }     }      The only solution I found was to modify all my classes that took parameters in their constructors to utilize **Setters** instead (example: `setInputString()`).   However, I think there might be a better solution than this because sometimes modifying existing classes can cause much harm than benefit. So,   * Are injectable classes not allowed to have input parameters?   * If a class must take input parameters in its constructor, what would be the way to inject it properly? **UPDATE**   Just for clarification, the problem happens when in my production code I decide to do this:               $clientClass= new ClientClass(new Parser($inputString));//--->I have no way to predict $inputString as it is calculated inside `ClientClass` itself.      **UPDATE 2**   Again for clarification, I'm trying to find a general solution to the problem not for this example code only because some of my classes have 2, 3 or 4 parameters in their constructors not only one.


title: Documentless platform, how to overcome scarce resources?

text: I am working for a client and the platform we are using is vBulletin. I'm so frustrated with its almost zero documentation and non-existence in Google. We don't have resources and all we have is the source. I almost want to give up now and get a job which I am familiar and uses tools that are open source.


title: Standard GPL friendly clauses in employment contract?

text: My employer is happy for me to release certain work under GPL, however the standard contract has a "All IP belongs to the company" section of the contract. They are happy to amend this to something which is more GPL friendly, but we don't know the precise wording to use. Are there any online resources for such clauses? It would seem to be a sensible thing to exist. I am sure we will have to run it by a lawyer but if there was a standard template, it would simplify the process I am in the UK, so I would imagine that such a resource would have to be specific to that.


title: Is there such a thing as feature bloat?

text: I have come across the expression software/feature bloat, but is this a real thing or should we rather be talking about things like performance problems, memory and disk footprint, user experience and on-demand installation? What am I missing here?


title: Best way to unit test methods that call other methods inside same class

text: I was recently discussing with some friends which of the following 2 methods is best to stub return results or calls to methods inside same class from methods inside same class. This is a very simplified example. In reality the functions are much more complex. Example:               public class MyClass     {          public bool FunctionA()          {              return FunctionB() % 2 == 0;          }               protected int FunctionB()          {              return new Random().Next();          }     }      So to test this we have 2 methods. Method 1: Use Functions and Actions to replace functionality of the methods. Example:               public class MyClass     {          public Func<int> FunctionB { get; set; }               public MyClass()          {              FunctionB = FunctionBImpl;          }               public bool FunctionA()          {              return FunctionB() % 2 == 0;          }               protected int FunctionBImpl()          {              return new Random().Next();          }     }          [TestClass]     public class MyClassTests     {         private MyClass _subject;              [TestInitialize]         public void Initialize()         {             _subject = new MyClass();         }              [TestMethod]         public void FunctionA_WhenNumberIsOdd_ReturnsTrue()         {             _subject.FunctionB = () => 1;                  var result = _subject.FunctionA();                  Assert.IsFalse(result);         }     }      Method 2: Make members virtual, derive class and in derived class use Functions and Actions to replace functionality Example:               public class MyClass     {               public bool FunctionA()          {              return FunctionB() % 2 == 0;          }               protected virtual int FunctionB()          {              return new Random().Next();          }     }          public class TestableMyClass     {          public Func<int> FunctionBFunc { get; set; }               public MyClass()          {              FunctionBFunc = base.FunctionB;          }               protected override int FunctionB()          {              return FunctionBFunc();          }     }          [TestClass]     public class MyClassTests     {         private TestableMyClass _subject;              [TestInitialize]         public void Initialize()         {             _subject = new TestableMyClass();         }              [TestMethod]         public void FunctionA_WhenNumberIsOdd_ReturnsTrue()         {             _subject.FunctionBFunc = () => 1;                  var result = _subject.FunctionA();                  Assert.IsFalse(result);         }     }      I want to know wich is better and also WHY ? Update: NOTE: **FunctionB can also be public**


title: Does LINQ require significantly more processing cycles and memory than lower-level data iteration techniques?

text: ## Background I am recently in the process of enduring grueling tech interviews for positions that use the .NET stack, some of which include silly questions like this one, and some questions that are more valid. I recently came across an issue that may be valid but I want to check with the community here to be sure. When asked by an interviewer how I would count the frequency of words in a text document and rank the results, I answered that I would   1. Use a stream object put the text file in memory as a string.   2. Split the string into an array on spaces while ignoring punctuation.   3. Use LINQ against the array to `.GroupBy()` and `.Count()`, then `OrderBy()` said count. I got this answer wrong for two reasons:   1. Streaming an entire text file into memory could be disasterous. What if it was an entire encyclopedia? Instead I should stream one block at a time and begin building a hash table.   2. LINQ is too expensive and requires too many processing cycles. I should have built a hash table instead and, for each iteration, only added a word to the hash table if it didn't otherwise exist and then increment it's count. The first reason seems, well, reasonable. But the second gives me more pause. I thought that one of the selling points of LINQ is that it simply abstracts away lower-level operations like hash tables but that, under the veil, it is still the same implementation. ## Question Aside from a few additional processing cycles to call any abstracted methods, does LINQ require _significantly_ more processing cycles to accomplish a given data iteration task than a lower-level task (such as building a hash table) would?


title: Using cost estimation models to predict C# software development costs

text: I'm a student currently on an internship. I've been asked to determine the feasibility of migrating an existing Windows-only C# software package to Mono. I've already conducted an analysis to identify the native libraries that will need to be ported or replaced with managed code, and identified the Windows- only API calls for which equivalents on Linux/OS X will need to be found. From this, I've cultivated some (very rough) estimates on what percentage of each assembly will need to be rewritten. I would now like to develop a time estimate for implementation of those changes. It appears people seem to like the COCOMO II for this type of task. However, I'm having trouble deciding on numbers for the SLOC (source lines of code) input. I have used USC's Unified Code Count tool to determine the Logical Lines of Code (LLOC) in the project as a whole and in specific assemblies of interest. Under one strategy, I estimate somewhere around 10% of the 165k LLOC project will need to be rewritten, and about 5% of the remainder will undergo significant modification. Using these numbers, COCOMO II gives me something like 30 man-months of effort. This seems high to me - is it actually? I don't think I have the experience to know for sure. I'm wondering if I should apply a twiddle factor to the LLOC input - I know people do something like this for some languages when using LOC (eg: dividing Python LOC by a factor of 6). Should I do this with C#, and if so, what factor? Finally, is using COCOMO-II even a reasonable method of doing this? All I want is an order-of-magnitude approximation. Fermi-scale inaccuracy is okay here. Is there a better way?


title: question related to iPhone programming certification

text: Dear All, I am working for iOS application developement. Now am considering to go for certification in iOS application development. I am thinking about expertrating.com. Please guide me if you know any other certification in iOS development with more market value of the certification. Thanks in advance and have a great life ahead.


title: How can you denote the access modifiers "friend" and "protected friend" in UML?

text: The symbols for access modifiers that I know are relevant for many different languages: > **public** :        +   >  **private** :       -   >  **protected** :  #   >  **package** :    ~ ( _or none_ )   >    _However_ , in VB.NET there are other such access modifiers -- `friend`, and `protected friend` ( _these are called`internal` and `protected internal` in c#_). What are the UML symbols for these access modifiers?      Is `friend` close enough to "package access" that it could be denoted with a tilde "`~`"? Would that then mean that `protected friend` could be denoted as "`#~`"?


title: In MV* pattern where does non-business model goes?

text: I am passing Menu items to View from ViewModel. My menu definition is a model with properties title, image, hasChildren and isEnabled. But this model is meant for UI unlike business domain models like Person, ContactDetail, Transaction, etc. So, when i see this menu model sitting along with business domain models i felt like polluted. Is there a right place to put these kind of UI specific models? Thanks.


title: How can I explain C# interfaces, and constructors to a 8 years old kid?

text: How can I explain C# interfaces and constructors to a 8 years old genius kid?


title: What are the strategies to become a good open source developer?

text: I always hear that involving with open source projects is good for career and the more (good) open source you release, the closer you will be to getting your dream job before you've even had an interview. I am expert in Java and I am trying to become fluent in Scala. I always think about getting involved in open source development in Java/Scala but the following confusions stopping me to do so. How/where do I start in open source development projects in GitHub etc? Or How to find active/busy open source development projects? How to find an area where improvement is required or enhancement required in such projects? It looks too complex in the first analysis or its pretty hard to find such opportunities. What are the common strategies to follow if I want to become hobbyist/free time open source developer? People who have experience in open source development please share your learnings/expertise from scratch. Thanks in advance.


title: Is it a bad idea to have many protected variables, events and procedures in a unit?

text: I am writing a full fledged p2p networking library on top of Indy's UDP server with an intention of publishing it online. The design I have implemented has a P2P manager ( TIdUDPServer ) which can act as a server or a peer. Each connected peer is represented by a separate object which contains additional features and information about them. The classes are both contained in a single unit. For the purpose of simplification, I have declared those members used by either, under protected. Somehow, my instincts are giving me a bad feeling about this. The P2P manager has very few members but the peer object has nearly everything under protected. Going the other way will most certainly introduce a whole lot of code and method calls. I need to know;   1. Is it a good practice for networking libraries to have protected members?    2. Should I replace the variables with properties under protected? With getters and setters or direct access would be fine?


title: How do I get feedback about whether escape analysis had any affect on my code or not?

text: One problem I have with compiler optimization is, that I actually never know what the compiler (or in this particular case the Jit) does with my code. So is there any possibility for me to know whether a particular compiler optimization took place or not? I just want to be sure about that some objects (math vectors) are created on the stack and not on the heap.


title: How to maintain an example project owned by an area-XX for each organisational area of my company?

text: My company is migrating from SVN to GIT. We have several projects in an only repository. Since SVN basically understands only folders and files, we have folders representing areas of the company, that contains the projects of that area. But in GIT, it seems that projects are owned by users, so if I want to maintain an example project owned by an area-XX of my company, I would need to create an user called "area-XX" to do this? And again and again for each organisational area of my company? I want a structure like `my_git_server/area-XX/project-A` for a project, instead of `my_git_server/user/project-A`. How can I do this?


title: Should developers be forced to check-in before leaving work each day, even if the code does not compile?

text: During a previous consulting position, the developers where told to check-in code on a nightly basis, regardless if it complied or was complete. Managers were afraid of losing any code and said now we only lose one day at most. The place I'm currently it is investigating whether to implement this. Anyone have any pros/cons on this? Should developers be forced into check-ins?


title: If functional testing is referred as black box..how can it be done on unit test level?

text: Preparing myself for ISTQB, I found a bit odd many things in their textbooks. E.g. they call black box testing as functional testing when you are not concerned with structured but only observe the ouput based on inputs. But later they say that functional testing is done at levels..well, how can I do unit testing without the knowledge how it works if I can just see it (and must see it). It is white box but then it is in the conflict..


title: How do i put my head around ISAPI Filters

text: I am a newbie. I have decent command over C++ but i lack domain knowledge when it comes to servers and stuff. My current assignment is to write ISAPI filters for IIS Web Server. I have been googling for a couple of days and have found out that its quite a challenging task. I found some examples here. I need to understand and implement some filters which would log requests to the server and take a count of requests on each resource. I do not seem to understand the code examples. Can you guys please suggest a plan or list of to do's for me. I ask this because i know there are a lot of prerequisites to this project. Where should I start ? How should I proceed ? I am expecting you guys to look at the code examples here and tell me what stuff I should read up to grasp the examples. Then i could imagine writing my own filters.


title: How do scalable bloom filters work?

text: I was reading up on scalable bloom filters and could not understand how each time a constituent bloom filters fills up, a new bloom filter with larger size is added. The elements that contributed to the set bits in the initially created filters cannot be looked up for presence. Perhaps I am wrong in my understanding of this? I do understand basic bloom filters. However, I cannot wrap my head around dynamic bloom filters.


title: How far should I take email address validation when the cost of bad emails is high?

text: **When it's more important to prevent typos than to cover 100% of all possible email addresses, what syntactic email validations do you do?** Imagine this: > You're with the local gas & electric company. 10% of new installations are > cancelled because the customer is not home and it costs your company $50 a > pop. You start taking email addresses with the new install orders so that > you can send reminder emails the day before the appointment. You bring that > number to 0% _when you have a deliverable email_. The only problem is that > 15% of all the emails you take bounce back because of some typo. Email > addresses are recorded by call center agents who talk to the customer over > the phone. In this case, it's important to collect a valid email address. It's also not all that bad if someone cannot successfully use an email address like:               "Big Momma D.'s #1 CA$H Maker, BOY!!!"@naturalhistory.museum      My guess is that Big Momma D. can't use this email anywhere and either doesn't really use email, or has more conventional email address to use. This is related to this more general question: How far should I take e-mail address validation? Let's throw a few more assumptions on here:   1. This is in the US, so it's unlike people will have email addresses like 漢字@gmail.com (good luck communicating that to a call center agent in Austin, Texas)   2. Validation emails are not suitable, since the customer is only in contact with us by phone


title: Necessitas or Java for android application development

text: I'm a Qt/C++ developer for Windows and Linux. Now I need to switch to Android OS and program for this operating system. I'm wondering whether it is reasonable to stay with Qt and use Necessitas project for Android Application Development or switch to Java?


title: Need some input on storing stdin, stdout, stderr information for debugging

text: I am working with a legacy system that is not too bad, but I thought of making some improvements to it, and I wanted to solicit your feedback to help me make good decisions. The platform is Linix (different flavors of it). The system revolves around running [sometimes long] "jobs" - command line programs. The jobs usually succeed but sometimes may fail, and when they do it is very important to diagnose what went wrong efficiently, and fix the underlying problems (if any) and restarting a job. We are not using any third-party software for this because we need full control over the process. Right now information about a job is being saved on disk as files - there is one file for stdin, one file that stores the exit code, one file for stdout and stderr combined, and I also know exactly how the process was started - what was the name of the command and what were the arguments. Now ... I thought about splitting stdout and stderr outputs into different files, but then realized that when they are combined together, one can see the chronological order of messages, except that it now takes a human judgement to tell which was output and which contains the errors. Taking this to a further extreme - why not throw stdin into the mix? It might matter for debugging purposes what the specific line of input was that caused a failure. Ideally the error message would be descriptive enough to give plenty of context, but this does not always happen. I am looking for a clean way to organize this data so that automated logic could be used to aid humans with error diagnostics. With many jobs running these failures do happen rather often. An example of something that I might want to query for - what were the last 20 lines of input that preceded the first line in stderr? I suppose the exact time stamp can be useful, but not that critical. Also, since a logging module is being used, often the output lines already contain time stamps, but not always - I did not write every bit of this legacy system. I can make changes to it; I just do not want to rewrite it. Could you propose a good way to massage these streams (add some sort of metadata perhaps) to organize things cleanly? The requirement is that not much extra computing power or disk / ram space should be utilized. I suspect that my problem is not unique. Thanks in advance.


title: Why doesn't Haskell have type-level lambda abstractions?

text: Are there some theoretical reasons for that (like that the type checking or type inference would become undecidable), or practical reasons (too difficult to implement properly)? Currently, we can wrap things into `newtype` like               newtype Pair a = Pair (a, a)      and then have `Pair :: * -> *` but we cannot do something like `λ(a:*). (a,a)`. (There are some languages that have them, for example, Scala does.)


title: How to create Button/Switch-Like Tile where you can step on it and change its value?

text: If the player steps on a Button-Tile when its true, it becomes false. If the player steps on a Button-Tile when it is false, it becomes true. The problem is, when the player stands on (intersects) the Button-Tile, it will keep updating the condition. So, from true, it becomes false. Because its false and the player intersects it, it becomes true again. True-false-true- false and so on. I use ElapsedGameTime to make the updating process slower, and the player can have a chance to change the Button to true or false. However, it's not the solution I was looking for. Is there any other way to make it keep in False/True condition while the Player is standing on the Button tile?


title: To MVC or not MVC, that is the question

text: Originally, I started off doing jQuery plugins, then moved onto Backbone.js applications, then been experimenting with MicroJS MVC modules, but these days I'm even wondering if there is any need for them at all. Recently, I've been prototyping a new application, and the code is slim, sleek, and beautiful. I then proceeded to rewrite it over 3 hours into a Backbone.js application, and the code turned away from its fitness model petiteness, into a bloated, complex, and ugly mess. The problem is, these days, this always happens. As soon as the MVC/MV* architecture is introduced, it all goes to puke. I'm wondering if the day and age of requiring these things on the client-side are over now, now that browsers are actually quite capable beings, maybe we don't need all the bloat of MV* frameworks anymore. What are your thoughts? Has others run into this? To MVC, or not MVC?


title: How to decompose / model a chessboard

text: As someone new to programming, I am building a chess web application in JavaScript, both for fun and to learn more about design patterns. I keep running into a wall, which is how to decompose the program. To start, I have picked a straightforward representation of a chessboard, here:               Board = function() {       var turn = 0;       var model = [[-4, -2, -3, -5, -6, -3, -2, -4],                    [-1, -1, -1, -1, -1, -1, -1, -1],                    [ 0,  0,  0,  0,  0,  0,  0,  0],                    [ 0,  0,  0,  0,  0,  0,  0,  0],                    [ 0,  0,  0,  1,  0,  0,  0,  0],                    [ 0,  0,  0,  0,  0,  0,  0,  0],                    [ 1,  1,  1,  1,  1,  1,  1,  1],                    [ 4,  2,  3,  5,  6,  3,  2,  4]];      with some basic access routines, such as                 this.move = function(pt1, pt2) {         turn += 1;         model[pt2.x][pt2.y] = model[pt1.x][pt1.y];         model[pt1.x][pt1.y] = 0;       };       ...      It makes sense that the board encapsulates state and is responsible for changing state but may not know the rules of the game--I like the idea of being able to plug in some sort of `RulesContoller` and completely change the nature of the game at runtime. But beyond that, I'm a little paralyzed as to how granular to model the pieces. I see a few options. First, I could define a `Piece` constructor and instantiate a new piece for each index in the nested array, something like:                 _.each(state, function(row, y) {         _.each(row, function(val, x) {           state[y][x] = new Piece(x, y, val);         });       });      `Piece` could easily deduce its color, type (e.g. 'king'), and location from that information. But it also feels redundant, since I'm just translating a model that already completely represents the board. Also, it doesn't seem like the primary purpose of the `Piece` 'class' is this translation, e.g. "Oh, I'm a -5, must be a dark Queen." Another option is to make the pieces dumber, i.e. not able to deduce this information from the model. But then I just build the array in-line, like                 var model = [new Rook(1,1,'dark'), new Knight(1,2,'dark'), new Bishop(1,3,'dark')... ],       ...      This seems closer to the way a chessboard is actually setup: there isn't some elegant formula; rather, you just put pieces in their correct location. But it's also just brute force. There are a few symmetries involved and patterns that might be simplified. Anyway, I'm just spitballing at this point. Any ideas would be useful. Thanks.


title: How should I structure my namespace tree so that I have a Math class and Math namespace?

text: I don't know if this is a good or bad idea, or if it's technically even possible... but I'd like to have something of the following sort:               public class Math {       public int gcd(a,b) // Method for Greatest Common Denominator       public int lcm(a,b) // Method for Least Common Multiple       public int factorial(a) // Method for factorial       ...     }      and then I'd also like to have a namespace called `Math` that has subclasses such as `Math.Matrix`, `Math.RowVector`, `Math.ColumnVector`, etc... so I can define my own Matrix data structure and its associated actions. Is this advisable? I am not too keen on the idea of using some other name for my `Math` class, as I want it to be a static class with all sorts of functions/methods that are useful to me, and at the same time, I want to gather all my relevant data structures under a `Math` namespace.


title: JSON Library - Jackson or Play Framework?

text: Working on a Java and Scala code-base, there's a debate about whether to use Java's Jackson JSON or the Play Framework's JSON Library. After reading the Play JSON Docs, as well as Chapter 9 (JSON) of Play for Scala, I also ran through an example from Mykong on Jackson. Based on looking at a few simple examples, Play's JSON Library seems like the superior choice due to, overall, its Functional Programming Approach:   * Providing compile-time safety when parsing JSON with Option/JsResult data types.   * As a result of the above, higher order functions (map/flatMap) are available and provide power and succintness   * As I understand, Jackson parses via the typical try/catch paradigm. Dealing with JSON errors at compile-time(Play) v. run-time(Jackson) is a no brainer Bottom line - Play's JSON library uses a functional programming approach that results in code that is easier to reason about than the Jackson library. Overall, the choice seems clear to me. Am I missing any pros/cons for either library?


title: Use Case Structure

text: I am creating use cases for a project. A generic user is extended by user "categories" which then is extended by an administrator (that can do all tasks possible). Is the following acceptable to portray? Is there a better way to portray such info? ![sample use case](http://i43.tinypic.com/adm0b4.jpg)


title: Help with learning the C++ Qt Framework

text: I've been a longtime PHP web developer. But now I've reached the limits and web doesn't fascinate me anymore. I am interested in learning cross-platform development. I have learned Java for almost a year and know much of its OOP concepts but I would like to develop high-performance cross-platform programs and I find Java to be somewhat slower unless you have a beast hardware. Searching for programming books on C and C++, I have only found that they only covers the basics which are same for every language. Datatypes, Loops, Conditionals, Operators etc. But the languages are no more this minimal. C++ provides STL and I've yet to find a book which shows you how to develop real- world programs using these standard features. I know PHP very well, I have known ins and outs of MVC and Singleton Design Patterns, but then I stumbled upon Qt Framework and some of the apps it has powered: Skype, VLC, KDE and they all are rock-solid. I've NEITHER faced any bugs or crashing issues with these applications on Windows NOR on Linux. **My request** _How should I approach learning Qt?_ The biggest difference I'm encountering is C++'s static typing which is very different than the dynamically-typed languages (PHP, Python etc.) I have already worked with.


title: CFO's Expectations and Scrum Development

text: When it comes to financial topics, I'm admittedly not well versed. I'm trying to lead my organization in our software development effort using a Scrum based development life-cycle. I am often discouraged when trying to coach executive leadership due to their belief that Scrum and Agile don't play well with their finanacial objectives. The other day I was challenged to show how my software developers could capitalize %60 of their work hours. I've found a few articles on the web ( http://itprojectfinancials.com/insights/2011/06/05/capitalizing-software- development-costs-from-sdcl-to-agile/ ), but haven't come up with any great arguments. I'm looking for advice or examples of organizations that capitalize software costs effectively in an Agile development environment. This article sums up the issue pretty well, but offers no advise http://blogs.collab.net/agile/2007/12/20/the-scrum-gaap/


title: What does backup procedures and troubleshooting guidelines mean for a system

text: I am writing the documentation for a piece of software which I have made but I don't understand what it means in some aspects. It asks me to write about backup procedures but what exactly does this mean? Does this mean like backing up the database on another hosting service or something else entirely? I am dumbfounded by what troubleshooting guidelines are as well. If you have any idea what this could mean feel free to give your insight even if you aren't 100% sure in case it could spark what it means inside of me. Thanks.


title: Handling tough or unexpected technical questions in meetings

text: Depending on the project I'm working on, I may be required to attend more meetings with both internal stakeholders or technical management in client companies. During the course of these meetings, there will inevitably be a few questions crop up that either:   * You do not have an answer to.   * You have not thought about for one reason or another.   * You deem to be irrelevant or completely out of scope of the current meeting. In each case, how do you answer these questions? Any tips or tricks on remaining authoritative while remaining honest?


title: How can open source projects be successful without documentation about their design or architecture?

text: I want to improve my programming skills by studying famous open source projects, but I find it is easy to get lost by just jumping into their source code. So I decided to read their documentation about their design or architecture (such as UML diagrams) to get a general idea about their code's organization first. To my surprise, however, I can't find any architectural documentation for large open source projects such as Hibernate, Spring, ASP.NET MVC, Rails, etc. So I've started to wonder: How can an open source project can be successful if new-comer developers have no architectural/design documentation to read, or if the project manager just opened the source code but closed its documentation?


title: ffmpeg: cut multiple input files with seeking to one output file

text: I have list of video files (loaded from database), each with start and end time of requested interval:                 # file   begin  end       v1.mp4   1:01   2:01       v2.mp4   3:02   3:32       v3.mp4   2:03   5:23      And I need to create single video file containing these intervals:                [0:00]---v1---[2:00]---v2---[2:30]---v3---[5:50]      I preffer usig ffmpeg, since it is installed on server. Caller program is written in PHP. It is easy to cut one input to one output (argument escaping removed for clarity):                 exec("ffmpeg -ss $begin -i $input_file -ss $begin -c copy $output_file");      I there any easier way than executing ffmpeg for each interval and then execute it once more to concatenate prepared clips together? I really do not like to have a lot of temporary files or dealing with complex process handling.


title: Freelancing as an individual. Products as a company. Should I integrate the two to grow?

text: When I started my company in 2005, I began with freelancing projects, but quickly moved to products. My personal site listed my consulting availability and portfolio pieces, which included a selection of the products sold by my company. Over the years, the company has gained rep through the products, and my personal site gained rep through the contract work. Of course, it's no longer just myself either for the products or the consulting work; other people in the company are involved, and the consulting work is technically billed through the company, as it always was. I want to maintain both sources of work; the consulting work that comes through from people finding my personal site, and the products sold by the company. But recently, the company has started receiving requests for custom development work directly, and I'm having trouble deciding what to do to reconcile the two "faces", or even if I should do anything about at all. Basically, the company has a small "services" page, which presents our products as portfolio pieces, and I have my original site which gets a lot of incoming client work, and also presents the same list of portfolio pieces (and some other client work). If I forward clients who contact the company for custom work to my personal page, we may lose some of the bigger clients, whom we are fully capable of serving, but who would prefer to deal with a company rather than a single developer. If I drop my personal site and refocus on the "services" side of the company, then I'd be ignoring the years of reputation building that the personal site has (and the client stream that still arrives at that door). Has anyone dealt with this? Any advice and suggestions would be appreciated. **EDIT:** To clarify, one of the disadvantages of having the two be separate channels is the lack of focus when it comes to marketing. Where do you point the signature in forums that may lead to clients seeking you out? Where do you point the people you hand your business card to? It just seems "cleaner", somehow, to integrate them or select one to concentrate on -- or maybe it's just the programmer in me trying to categorize things and put everything into its proper place.


title: API design pitfalls in C

text: What are some flaws that drive you nuts in C APIs (including standard libraries, third party libraries, and headers inside of a project) ? The goal is to identify API design pitfalls in C, so people writing new C libraries can learn from mistakes of the past. Explain why the flaw is bad (preferably with an example), and try to suggest an improvement. Although your solution might not be practical in real life (it's too late to fix `strncpy`), it should give a heads up for future library-writers. Although the focus of this question is C APIs, problems that affect your ability to use them in other languages are welcome. Please give one flaw per answer, so democracy can sort the answers.


title: Future of web development - Front-end > Back-end development?

text: People used to say it's "better"/"Make more money" to do back-end programming (PHP, asp.net) instead of front-end(HTML, javascript) for web development. But I notice that HTML5, CSS3, WebGL, Javascript are gaining importance. We can even use HTML5, CSS3 and JAVASCRIPT for building mobile web applications(For both iphone/android) and even Windows 8 applications in the future! Does it mean new web developers should now focus on front-end development instead of server-side development?


title: What is meant by binary compatibility? What is its importance during serialization/deserialization in a language like Java that deals in byte code?

text: In computing what is meant by _binary compatibility_? I read about it in context of serialization/deserialization that this process of serialize/deserialize should be binary compatible. What does it mean in this context? In particular I am interested in understanding the role of binary compatibility in a language like Java that deals with byte code. This quote is from Effective Java: > When a serializable class is revised, it is important to check that it is > possible to serialize an instance in the new release and deserialize it in > old releases, and vice versa. The amount of testing required is thus > proportional to the product of the number of serializable classes and the > number of releases, which can be large. These tests cannot be con-structed > automatically because, in addition to binary compatibility, you must test > forsemantic compatibility. In other words, you must ensure both that the > serialization-deserialization process succeeds and that it results in a > faithful replica of the original object. The greater the change to a > serializable class, the greater the need for testing. The need is reduced if > a custom serialized form is carefully designed when the class is first > written (Items 75, 78), but it does not vanish entirely.


title: Do you want to work alone or in a team?

text: If you can choose whether to work on a project alone or in a team, what would be your choice and why? And if you want to work in a team, what is the ideal team size?


title: Java Method Returns Unbounded Type

text: I was reading this article, https://weblogs.java.net/blog/emcmanus/archive/2010/10/25/using-builder- pattern-subclasses, about subclassing a builder class. I understood the article but there was one small bit that bothered me. There was this method,               public static Builder<?> builder() {             return new Builder2();     }      When I changed `Builder<?>` to `Builder`, a raw type, the compiler would not compile the code. What is the additional information was passed to the compiler via with the additional `<?>`? I have pasted the code here:               public class Shape {            private final double opacity;               public static class Builder<T extends Builder<T>> {              private double opacity;                   public T opacity(double opacity) {                  this.opacity = opacity;                  return self();              }           /*              public T height(double height) {                  System.out.println("height not set");                  return self();              }      */              protected T self() {                  System.out.println("shape.self -> " + this);                  return (T) this;              }                   public Shape build() {                  return new Shape(this);              }          }               public static Builder<?> builder() {              return new Builder();          }               protected Shape(Builder builder) {              this.opacity = builder.opacity;          }      }           public class Rectangle extends Shape {          private final double height;               public static class Builder<T extends Builder<T>> extends Shape.Builder<T> {              private double height;                   public T height(double height) {                  System.out.println("height is set");                  this.height = height;                  return self();              }                   public Rectangle build() {                  return new Rectangle(this);              }          }               public static Builder<?> builder() {              return new Builder();          }               protected Rectangle(Builder builder) {              super(builder);              this.height = builder.height;          }               public static void main(String[] args) {              Rectangle r = Rectangle.builder().opacity(0.5).height(250).build();          }     }


title: Configuration Settings Service/Repository: Are They Used in a Real World

text: I’m currently enjoying reading "Continuous Delivery: Reliable Software Releases Through Build, Test, and Deployment Automation" and the part that caught my attention is that on managing configuration settings for applications. What's proposed in the book is that all configuration settings are externalized and centralized in a repository of some sort, be it an LDAP directory, ESCAPE Server or somesuch and then retrieved from there. This sounds really compelling to me as this approach can provide a number of tangible benefits, but after Googling around for a bit it seems to me that this is not exactly a widespread approach. I know there is a Twelve-Factor App article on this subject, but it suggests using environment variables instead of a centralized repository. This approach seems to be the most commonly used one, but it feels like a dirty one compared to a repository-based solution. So, is the central-configuration-repository approach used in any significant manner in a real world, and if not -- what are the reasons for this?


title: Does this in the Observer pattern count as composition?

text: In a classic implementation of the Observer design pattern, the subject has a list of references to all of it's observers, and each observer might have a reference to it's subject. Is this considered composition? As far as I understand, composition means one object 'includes' in itself another object, in order to **use functionality of that object**. In the Observer pattern, the subject does include in itself references to it's observers, but it doesn't exactly use their functionality internally to do things outwardly. It keeps references so it can notify them. On the other hand, the subject and observers maintain a relationship of HAS-A, which often characterizes composition (the subject has observers, the observers have a subject). Is this considered a kind of composition?


title: What are the different aspects to consider when porting code from a single threaded environment to a multi threaded environment or vice versa?

text: I want to provide some library functionality and a reference application, which will run on a fully-featured, POSIX-compliant platform. The app and library will need bi-directional serial port communication, user input from keyboard, user display to text console, and probably timers. I also want to provide a porting guide so that users of the library can port it (with or without the reference application) to their own platforms, which may be POSIX-compliant or not, and may or may not support multiple threads. I am taking care of the main platform portability issue by writing portable code for everything as far as possible and providing a self-contained porting layer for platform-specific code. In my porting guide I will tell the user to replace the porting layer functions with implementations for their own platform. However as far as the threading model goes, I have two choices:   * implement my reference application as a very simple single-threaded program (main loop would poll keyboard, poll serial port, check timer status, and call library functions as needed)    * use the pthreads library and have a main app thread with separate threads for user input, serial port receive, and timer expiry, all of which would post messages to my main app thread for processing.  Whichever model I choose I will have to explain to users how to port it to a platform which may be using a different model. Even if I use a single-threaded implementation for the reference app, I will make sure any library functionality is re-entrant (or put big caveats around it if that isn't possible). What considerations should I bear in mind, in my implementation and the porting guide? What information would you want if you were porting some multi- threaded code to a single threaded system, or vice versa?


title: When and how much should we validate input when working with (C)AP storage?

text: Herein, we consider a server-client architecture. Suppose we keep the details flexible, but there's more than one layer of servers supporting our hypothetical service. The general question is **"When and how much do I validate client data?"**. From other questions and answers I've read, the answer may be summarized as one of the following strategies (or a combination thereof).   1. Validate all data as soon as it arrives from the client. Other servers trust each other.   2. Validate all data on every server in the system. _(this is not heavily favored)_   3. **Validate all data _rigorously_ when it reaches the database, and optionally elsewhere as required by the application.**   4. At all levels, validate exactly as much data as that particular server needs to do its job. Number 3 seems particularly popular. In the answers I've seen, however, there seems to be an **implicit assumption of the classical RDBMS** ("OldSql") centralized data storage. These are the MySQLs and Postgres's of the world. Taking cues from the CAP theorem, let's call these **CP databases** , as they tend to provide tools for consistency at the expense of some class of availability: usually, only a delegated _master_ can write to a particular partition. Recent alternatives to the classical RDBMS (specifically Voldemort, Riak, and Cassandra, which are modeled after the Dynamo storage system) are better classified as **AP databases**. These tools allow natural inconsistencies to appear upon data retrieval (e.g. multiple data values with vector clocks) in exchange for "always writeable" availability. Given that these data stores have rather **unique properties** , I pose the question: **Does the client data validation story change when we use AP datastores? How much of my client data should I validate before and after insertion to an AP database?**