title: Not-for-profit universities that offer computer science undergraduate degree online?

text: There are many masters degree programs in computer science online offered by reputable organizations. However, I've found very few bachelors only degree programs offered by non for-profit institutions. I am looking for a degree in computer science and also any programs for entrepreneurship/management or algorithmic trading. I've found only 2 programs so far that fit: http://www.regis.edu/regis.asp?sctn=cpcis&p1=ap&p2=cs&p3=ol http://depaul.edu Requirements: 100% online undergraduate non-profit Options: Bachelor of Science Bachelor of Arts Bonuses: accelerated recognized ABET cost effective Update: I've answered my question with a list. If anyone knows an online program that combines skills in entrepreneurship (getting capital, starting a business) or algorithmic trading with a computer program that would be ideal.. maybe too much to ask though


title: How does an agile process deal with ORM?

text: This question was prompted by this answer, where I quote,"agile + ORM on a large constantly changing database is brutal". So, how can an agile process deal with a constantly changing database? I am interested in both cases:   1. Where the database design will stablelize, after using it a while to see how it works   2. Where constantly changing data schemas require that the database changes often A couple ideas I had were:   * Use a NoSQL database   * Creating key/value tables for different classes of data. This could create bigger tables, but might work well for data that is not inherently relational.


title: Dependency properties outside the realm of WPF?

text: Is there a more general concept or name for what WPF calls "dependency properties"? I imagine this is not a WPF-ism and in fact other libraries or frameworks have employed a similar approach? If so, what are these other instances and what are the similarities and differences compared to Microsoft's dependency properties? I am at a junction where I'm considering adding "dependency properties" to my own type system and object model (unrelated to WPF), as the construction seems appropriate for my design requirements; however, I want to consider what others have created as well, not just WPF's particular implementation.


title: Using a relational database vs JSON objects for event/activity data

text: I am working on a project where I am trying to decide between using a standard SQL relational database or JSON objects to store data about an event or activity. The project will store data on multiple event types so I have decided to just describe one event type for this question. The live music event (described in full using the JSON schema at the bottom of this question) is an object that stores data such as where the event will take place, the time/date of the event and the cost of the event. The live music event object has both one-to-one (event--> name, event --> description) and one-to-many (event--> venues, event--> dates, event--> ticket types) relationships. Furthermore, the event object can contain one or more performer IDs, which link to the performer object. The performer object stores data on musicians who are performing at the live music event. The data will be queried by users using both simple ("Find me events with 'x' name") and complex ("Find me events with 'x' music genre and 'y' cost within a radius of 'z' from my current location") queries. The data will be submitted by users using a web form. As you can probably tell from the defined JSON schema, I was originally going to use JSON objects to store this data but I've heard from some people who say that because my data is purely relational, I should stick to the older methods. I would appreciate any thoughts on the pros and cons of each approach given my needs. If you need anything clarified, please feel free to ask.               {         "event": {             "eventID":{                 "type":"string"             },               "eventType":{                 "type":"array",                 "eventTypeItem":{                     "type":"string"                 }             },             "eventName":{                 "type":"string"             },                   "eventDescription":{                 "type":"string"             },             "eventVenueList":{                 "type":"array",                 "eventVenueListID":{                     "type":"integer"                 }             },             "eventURL":{                 "type":"string"             },             "eventTwitter":{                 "type":"string"             },             "eventFB":{                 "type":"string"             },             "eventInstagram":{                 "type":"string"             },             "eventEmail":{                 "type":"string",                 "format":"email"             },             "eventContactPerson":{                 "type":"string"             },             "eventDoorTime": {                 "type":"string",                 "format":"date-time"             },               "eventPerformerIDList":{                 "type":"array",                 "liveMusicPerformerID":{                     "type":"integer"                 }             },               "eventSetList":{                 "type":"array",                 "eventPerformerID":{                     "type":"integer"                 },                 "eventPerformerStartTime":{                     "type":"string",                     "format":"date-time"                 },                 "eventPerformerEndTime":{                     "type":"string",                     "format":"date-time"                 }                                                },             "eventDateList": {                 "type":"array",                 "eventDateItem": {                     "type":"string",                     "format":"date-time"                 }                },             "eventDateStartTime": {                 "type":"string",                 "format":"date-time"             },             "eventDateEndTime": {                 "type":"string",                 "format":"date-time"             },             "eventTicket":{                  "type":"array",                 "eventTicketType":{                     "type":"string"                  },                 "eventTicketLowPrice":{                     "type":"number"                 },                 "eventTicketHighPrice":{                     "type":"number"                  },                 "eventDatesAdvancePrice": {                     "type":"number"                 }                }         },           "performer": {             "performerID": {                 "type":"integer"             },             "performerType": {                 "type":"string"             },             "performerName": {                 "type":"string"             },             "performerAlternateName": {                 "type":"array",                 "performerAlterateNameItem":{                     "type":"string"                 }             },             "performerGenreList": {                 "type":"array",                 "performerGenreItem":{                     "type":"string"                 }             },             "performerURL": {                 "type":"string"             }                                                }     }


title: Are (C) object files created with different compilers binary-compatible?

text: I understand that C++ compilers are not compatible with each other. However, I was unable to find anything on this topic for C in particular. I know that the C standard leaves a lot of room for compilers to implement things however they see fit: for example, the size and alignment of most (all?) data types is implementation-defined save for some minimal guarantees. Therefore, two compilers (or two versions of the same compiler) can disagree on numerous details. Am I correct in thinking that there's no guarantee that two object files compiled with different compilers will actually link properly? For example, the size of pointers could be 32 bits in one object file and 64 bits in the other. But if that's so, why are C libraries sometimes distributed in precompiled form? Is there an expectation that I'll use the same compiler they did (e.g. gcc), or some _de facto_ standard being used to ensure binary compatibility? And how do other languages with a Foreign Language Interface ensure things will line up properly when linking with C object files?


title: Work released under creative common

text: I have some questions regarding creative common.I'm reading the documentation at http://creativecommons.org/licenses/by/3.0/, yet I'm still confused about these licenses. Suppose there is a company which released a database or ontology about cars on creative common, say based on this license. Suppose I use this database to create a REST API and a mobile application which uses this database or ontology. My questions are:   1. Should I release all my source codes, i.e. the REST API source codes and the mobile application source codes   2. Can I limit API calls to the web service From what I've read, I've only understand that I should publish all mods I made to the current work I took on the license


title: How to not take risks with new collaborators?

text: My team is going to add new team members and my manager doesn't want to take any risks. I don't think it's a large problem but my manager is concerned that a new programmer would sabotage and accidentally destroy parts of the code or the data e.g. cause data disaster. I say that probability is not very high but still I've been told that it's important to limit the rights of what new collaborators can do. But this is not practical and we can't eat the cake and have it - adding a collaborator to source control gives the new collaborator access to all the source code and even if there was a way to only let a new member in to parts of the source code (we're using bitbucket for source control) it still wouldn't work since technically the whole project is usually needed to build it so one can't just take a part of the code and expect it to work and able to build on independently. We're using Google App Engine and nor is it a working idea to create a clone of the app that my collaborator can build on. I said that we are not the first ones with this problem and that a solution that works for someone else should work for us but my manager seemed not satisfied with that answer. Can you comment on my situation or give concrete advice what could be done about the "problem" / scenario since it's just a scenario that a newly added developer accidentally deletes the whole datastore, but we don't want it to be possible.


title: How can I Tap into EF code creation in Visual Studio 2013

text: I'm use the Repository pattern along with EF at work. I'm wondering if there is a way for me to make an addon or somehow tap into the EF code generation of the table classes when the model is saved. So that I can automatically generate the repository stub as well. I'd also like to check if it already exists and if so not to regenerate (as the stub might have custom code for that EF type).


title: How to learn an API

text: When I find some interesting project (e.g. on GitHub) I often would like to use it and try it out to see how it works, but if there isn't a good documentation or some kind of tutorial it's hard to figure out how to use it. So my question is: how do you approach such a situation? How do you figure out which classes are important and how to chain them to put them to use? What would you look at first? An advice I found is to look at the tests (if there are any). But if there are unit tests for every class, how do you know which ones to look at first?


title: Creating nested functions for purely aesthetic reasons?

text: I've always wondered what other programmers think about the idea of creating pure aesthetic functions. Say I have a function that processes a chunk of data: `Function ProcessBigData`. Say I need several process steps, only valid for that data: `Step1`, `Step2`, `Step3`. The normal aproach I see the most in source code is to write comments like so:               Function ProcessBigData:         # Does Step1         Step1..         Step1..              #Does Step2         Step2..         Step2..      What I usually do, but always felt wrong due to the lack of such coding style by fellow peers is:               Function ProcessBigData:         Function Step1:             Step1..             Step1..              Function Step2:             Step2..             Step2..              Step1() -> Step2()      I am mainly concerned if there any drawbacks for such style in **Javascript** and **Python** Are there any alternatives that I'm not seeing?


title: Storing hierarchical template into a database

text: If this title is ambiguous, feel free to change it, I don't know how to put this in a one-liner. **Example:**   Let's assume you have a html template which contains some custom tags, like `<text_field />`. We now create a page based on a template containing more of those custom tags. When a user wants to edit the page, he sees a text field. he can input things and save it. This looks fairly easy to set up. You either have something like a template_positions table which stores the content of those fields. **Case:**   I now have a bit of a blockade keeping things as simple as possible. Assume you have the same tag given in your example, and additionally, `<layout>` and `<repeat>` tags. Here's an example how they should be used:               <repeat>       <layout name="image-left">         <image /> <text_field />       </layout>            <layout name="image-right">         <text_field /> <image />       </layout>     </repeat>      We now have a block which can be repeated, obviously. This means: when creting/editing a page containing such a template block, I can choose between a layout `image-left` and `image-right` which then gets inserted as content element (where content for `<image />` and `<text_field />` gets stored). And because this is inside a `<repeat>`, content elements from the given layouts can be inserted multiple times. How do you store this? Simply said, this could be stored with the same setup I've wrote in the example above, I just need to add a parent_id or something similiar to maintain a hierarchy. but I think I am missing something. At least the relation between an inserted content element and the origin/insertion point is missing. And what happens when I update the template file? Do I have to give every custom tag that acts as editable part of a template an identifier that matches an identifier in the template to substitue them correctly? Or can you think of a clean solution that might be better?


title: Why is FRACTRAN turing complete?

text: I've tried to google for explanation but most links only say things like "FRACTRAN is turing complete. As an example, let's look at multiplication." I remember seeing an xkcd forum post say that FRACTRAN helped the poster understand Turing Completeness. I am looking for an intuitive explanation as to why this esolang is Turing complete, as it's not very obvious looking at the language mechanics.


title: Algorithm to create permutations for a given alphabet based on a sequence number

text: I would like to have a function that will create a word (always the same word) for a given sequence number based on a given alphabet.               word(0, [a,b,c]) = a     word(1, [a,b,c]) = b     word(2, [a,b,c]) = c     word(3, [a,b,c]) = aa     word(4, [a,b,c]) = ab     word(5, [a,b,c]) = ac     word(6, [a,b,c]) = ba     word(7, [a,b,c]) = bb     word(8, [a,b,c]) = bc     word(9, [a,b,c]) = ca     ...      I was able to recursively create all permutations of a given length but starting with length 5 it already gets quite big in memory.


title: Should I use SignalR to synchronize & cache CRUD data to a mobile app?

text: I'm considering using SignalR to send data to a mobile app, but need to have a way to synchronize data while it's closed or pending updates. Is it a good idea to use Backbone.js <\--> SignalR to manage queued CRUD updates to the server? If not, what is?


title: Lexing: One token per operator, or one universal operator token?

text: When lexing, what would be the best way to tokenize operators? Would one just create a `BinaryOperator` token, or a separate token for every single binary operator? Examples: `PlusOperator`, `MinusOperator`, `DivisionOperator` ... I am tended towards having a universal one, but going from the documentations and project sources I've read the vast majority of lexers are using one token per operator. Is there a particular reason for this? Does it even matter? Does it give you any advantages?


title: Logging events for reporting purposes

text: Are there any design patterns or best practices around logging events for use in reporting and BI systems. For example in a system which manages orders from a website, it would be beneficial if a customer support worker could type in an order number and see that it the order was placed on a certain day, dispatched on a certain day and delivered on another. I can see 2 ways around this. I have an order object which has the fields:               OrderDate     DespatchDate     DeliveryDate      and populate them if they have happend otherwise they will be null OR log some sort of events like which are messages like:               Order Number - "12312312" - Ordered on '2014/01/01'     Order Number - "12312312" - Despatched on '2014/01/01'      and add store the events in a database. Are there any guidelines for this? For example how does the work item history in TFS work? ![TFS History](http://i.stack.imgur.com/TlnCP.png)


title: How should semi-agile team operate during management-imposed waterfall-like "testing phase"

text: I'm not looking for advice how agile process should work. I know that part. I'm curious what the best way to adapt the process to a typical large, well- established corporation who loves its "processes" and gate/passport reviews. For those lucky enough not to know what they are, gates/passport things are essentially waterfall milestones presented by development teams to executives: Gate 0 - kick off, identifying positive npv projects; Gate 1 - planning work for the release, coding begins, Gate 2 - code complete/testing phase, Gate 3.... While within our team we've tried to embrace agile as much as we could (peer reviews, iterations, constant communication, doing what makes sense, continuous improvement...), these gates come from way up and there's nothing we can do about them. Of many things that bug me, one of them is that the corporate environment we are in, imposes some constraints which seem to have adverse effects on how we work. One example is that during development we only focus on new features and ignore existing bugs and even introduce new bugs. This is unfortunate and goes against agile, but we have no choice since code complete could be in 2 months, but "testing/bug fixing" phase can last 6 months after that. We are under constant pressure to "finish work" but emphasis is on completing features, not getting a stable product. This part we sorta learned to live with. My question is what strategy (successful mode of operation) other teams/companies have found for the "testing" phase that follows a "code complete" milestone? During "new development" we have iterations and each one gets filled in with stories and tasks. However, currently once development is "done", there's no more iterations and no more planning. Instead, we solely use bug tracking database to monitor how many new bugs are being found and how fast the bugs are being resolved. Personally, I don't see the difference between adding new UI feature and making existing UI feature work. To me work is work. I proposed that we continue having iterations as normal and continue to schedule work as before, but neither management nor other team members seemed to be on board with that. So 1) am I way off and is bug track database the best we can do? and 2) if there's a better approach, I'd like to explore it and maybe acquire enough ammunition to take back to my boss. At the same time I somewhat agree that a lot of times when reacting to bugs we don't have the luxury of waiting till next iteration. **\--- Slight clarification based on first few responses ---** We just entered the testing phase. At the moment, there's no more stories, no more iterations. Only bug tracking database. That doesn't sit right with me, that's why I'm curious what other teams would do in this situation. Also some bugs are definitely the size of a medium size story, while other bugs would take 5 min to fix. Should 5-min bugs also become stories if we were to continue with iterations? The other argument we've been having is that during "new development" we only interact with Agile tracking tool (Rally) but in "testing" if we continue with iterations, we'd have to maintain paper trail in Rally as well as in bug tracking software.


title: What do ptLineDist and relativeCCW do?

text: I saw these methods in the Line2D Java Docs but did not understand what they do? Javadoc for `ptLineDist` says: > Returns the distance from a point to this line. The distance measured is the > distance between the specified point and the closest point on the > infinitely-extended line defined by this `Line2D`. If the specified point > intersects the line, this method returns 0.0 Doc for `relativeCCW` says: > Returns an indicator of where the specified point (PX, PY) lies with respect > to the line segment from (X1, Y1) to (X2, Y2). The return value can be > either 1, -1, or 0 and indicates in which direction the specified line must > pivot around its first endpoint, (X1, Y1), in order to point at the > specified point (PX, PY). > > A return value of 1 indicates that the line segment must turn in the > direction that takes the positive X axis towards the negative Y axis. In the > default coordinate system used by Java 2D, this direction is > counterclockwise. > > A return value of -1 indicates that the line segment must turn in the > direction that takes the positive X axis towards the positive Y axis. In the > default coordinate system, this direction is clockwise. > > A return value of 0 indicates that the point lies exactly on the line > segment. Note that an indicator value of 0 is rare and not useful for > determining colinearity because of floating point rounding issues. > > If the point is colinear with the line segment, but not between the > endpoints, then the value will be -1 if the point lies "beyond (X1, Y1)" or > 1 if the point lies "beyond (X2, Y2)".


title: What design pattern can I use to represent processing data from any stream?

text: I'm reading data from a stream in buffered series of bytes (say 1024 bytes at a time) and do some comparison, checking, or processing, before writing it back to the same type of stream. Currently data comes from file. But in the future it may come from other sources (memorymapped file, TCP etc) Is there a design pattern I can implement? Or is that not necessary?


title: Do I need to get permission to access a site's data or functionality programmatically?

text: I'm creating an application which will programmatically sent HTTP GET and POST requests to a site and processing the data received. If I want to release that application, do I have to get permission from the site's owners?


title: Synchronized access to network industrial equipment

text: I have an industrial equipment which is controlled by a software. The software connects to it using sockets, and keeps the connection all the time alive, while from time to time sending commands to the equipment. Now, this equipment is represented by a class which encapsulates the sending and receiving of data. Next, I need to make a UI, that will show the state of the equipment, independent from the controlling software (controlling is on a different thread same solution). Refresh to the UI must be done lets say every second, but it can happen that UI wants to read data, and the controlling software wants to write. The problem is that the equipment might respond from 50 ms to 1 second, we don't know, and during the response no one must interfere! How can I best synchronize calls to the equipment communication class? There might be at least 2 solutions:   1. Using simple `lock(obj) {}` statement in C#, for each method in the common. class   2. Using events and a message queue with a subscriber concept While the first one might be simple, I assume for my case is the worst solution because it can block everything. The second one seems more OK, but the problem is that there will be for sure some delay on receiving the results if many subscribers are, or dunno, I'm not really sure.


title: Working with Multiple Versions of Websites (Git)

text: I have a main template like website I have made that will allow me to quickly roll out and make new websites on demand when I need them, for my personal use. I'm wondering what is the best practice when using a Git repo is for this practice. My goal is that if for example down the road I'd like to make a change to all the sites at once, I can simply change the master (Repo) and have this change applied to all other versions of the template. Currently I have my template hosted privately on BitBucket. I'm assuming it is best to git clone the repo, and then makes changes on the clone. Then when I make changes to the template I do a git pull on the sites. Is this is the ideal approach, or are there better methods to do this?


title: Differences between messages and methods?

text: In Objective C you have the concept of sending messages to other objects, and, well this is very similar to method calling in languages like C# and Java. But what **exactly** are the subtle differences? How should I think of messaging when thinking about my code? Note: Just a bit of background here, I'm a C#/Java developer trying to understand some concepts about Objective C.


title: How to test a code online?

text: I am preparing for technical interview and would like to brush my coding skills. I have written a C++ program and would like to test it online. I don't have access to any linux compiler on my machine. Where can I do it? I have perception that I can do it in code.google.com -> Google Code Playground but I don't see where I can choose my compiler. I have written a simple C hello world program in "edit code" panel and have clicked on "Run code" but it has been a while and nothing appears in bottom output window. Please help. Thanks,


title: My client wants me to add background music to a site. How do I tell them this is a terrible idea?

text: I'm having a rather Oatmealesque experience with a particular client's website. The latest 'feature' they have requested is that background music play automatically when the site loads. What should I say to gently convince them that this is a bad idea?


title: Do Universal iOS Apps have more "issues" when new versions of iOS come out?

text: I was discussing developing an iOS App with a client and I mentioned that we should ideally have a Universal App that would perform as an iPhone App on an iPhone and as an iPad App on an iPad. The client likes the idea of an iPad-specific version of the App but prefers the idea of a separate App entirely for the iPad version. And not for some "Angry Birds/Angry Birds HD" type of reason (the App in question will be free, so there's nothing to be gained financially) but rather because "other [organizations in his industry] have told him" that "Universal Apps have more compatibility issues with older devices when new versions of the operating system [iOS] are released" and having discrete apps for this alleviates this issue. I believe he may have been referring to the concept of an App requiring a version of iOS that is more recent than the last one available on the phone. Or maybe the concept of releasing an App or an update that requires a version of iOS beyond the last one available on a device (original iPhone is stuck at 3.1.3 forever, iPhone 3G is stuck at 4.2.1 forever). But I presume you can still make a Universal App for 3.1.3 since the original iPad shipped with iOS 3.2 and Universal Apps existed before 4.0. And while I'm having a difficult time finding out what the minimum iOS version is for Apps submitted to the App Store, I presume that the original iPhone can still download and buy Apps or else the one guy in the office here who still has his OG iPhone would probably have complained more by now. But I really don't know. Do Universal Apps have more issues with compatibility on devices (and more specifically older devices) than individually developed separate (but otherwise pretty equivalent) Apps? Has anyone ever run into this?


title: Are 'edited by' inline comments the norm in shops which use revision control?

text: The senior dev in our shop insists that whenever code is modified, the programmer responsible should add an inline comment stating what he did. These comments usually look like `// YYYY-MM-DD <User ID> Added this IF block per bug 1234.` We use TFS for revision control, and it seems to me that comments of this sort are much more appropriate as check-in notes rather than inline noise. TFS even allows you to associate a check-in with one or more bugs. Some of our older, often-modified class files look like they have a comment-to-LOC ratio approaching 1:1. To my eyes, these comments make the code harder to read and add zero value. Is this a standard (or at least common) practice in other shops?


title: What are the different meanings of 'fixture'?

text: I have some difficulty understanding the concept of "fixture". I know what a test suite is, a test case, a test run, but what exactly is a "fixture"? A parameterized test case? It seems to me that the meaning or semantics of the term "fixture" can vary slightly by programming language or by testing framework? I think a _phpunit fixture_ > " _the code to set the world up in a known state and then return it to its > original state when the test is complete. This known state is called the > fixture of the test._ " is slightly different from a "fitnesse fixture", where > " _Fixtures are a bridge between the Wiki pages and the System Under Test > (SUT), which is the actual system to test_ ". Is there an expert in software testing around here who can answer this question? References to other programming languages are welcome. **Updates:** I'll add more definitions of _fixture_ here as when I encounter new ones. That'll be fun. Alternative definitions   * (anything that implements the ITestFixture interface) Source: sqa


title: Functional metrics in Agile methodologies

text: I'm preparing a presentation about Agile methodology for managers (not programmers) and I'm looking that, from a side, the Agile talks about **functional perspective*^ (in Scrum we have _planning game_ ) but, from other side, it lacks any (standard) definition of **functional measure**. In my opinion it's strange: how I can give a magnitude of effort by functional needs of user if Agile methodology doesn't use a formal/univocal definition of **functional needs** and doesn't adopt any formal functional measurement (Function Point, COSMIC). If you have played to _planning game_ or _User Story_ , what was your measure unit? Have you used the FP or COSMIC?


title: Essential roles for web application team

text: Some friends of mine came up with an idea for a web application which we (so far) think could be great. I made the analysis and all the early stages of the development process and I'm about to start the coding. I'm talking about something that is barely a mid-level project, so I consider one developer (myself) should be enough. The thing is that we are trying to assign roles to each one of us so we can be focused on our duties and have clear our responsibilities within the team. We are a crew of four people, three of us (my friends) are business people who would do the marketing, customer relationship, management and accounting stuff and I'm basically the developer. I have in mind to get them involved into the development process by giving them documentation to write and use them as testers, all of that besides the management duties they have. Perhaps someone out there have been in the same situation, so I would appreciate if the experience is shared so we can effectively give ourselves positions in the project based on what I explained above. Which are the essential roles or the optimal team layout so the idea can be developed successfully? The question is not strictly about programming, but it's related to build a software entrepreneurship beyond the code, that is something that I'm sure plenty of us are looking. Any help is really appreciated! Regards.


title: Guidelines About Using Code Repository

text: I'd like to have some suggestions about using code repository. I don't need to know how to check out or how to check in or how to create a branch. What I need to know is, how to maintain the repository tree or how to structure it for optimal usage. For example, for a given project, when to create a branch? Where to create a branch with respect to the project's location? What should be done when one or more than one developer are working on same project but different features? When to merge? Where goes the bug fix? How the QA team should checkout a specific version? Etc.


title: I'm working on a PaaS similar to Heroku or Google App Engine, and was curious which pricing structure users prefer. Ideas?

text: My current project is a cloud deployment platform similar to GAE or Heroku. I'm trying to figure out what pricing method works best for us and the users. Assuming that I cannot _currently_ provide a free plan, here are the options: 1) Have fully unlimited scaling (GAE-like), and charge for usage ($5 per project + x cents per CPU hour the project uses on our system, also charge a certain amount for bandwidth in/out, database storage + I/O, r/w data store, memcached, etc.) This ends up being cheaper (around $20 for a moderately loaded website) and more "fair" for the user (pay **only** for what you use), but much more complicated with the many different factors that affect final price. This type of architecture is more resilient to what you throw at it, so if you get a traffic spike, it will work perfectly fine, you'll just get charged more. 2) Pay for "application readiness"/specific scalability (have a specific amount of processes per user available to accept requests, maybe $20 a month (3 cents per hour) per process), and for a specific tier of a database. No bandwidth/IO charges (within fair use, of course). Add-ons like email and memcached are extra. (Heroku-like) This option is a lot more simple, and much easier to project costs on. However, the pricing curve is rather steep. You do end up likely paying more (probably $40-$60 a month for a moderately-loaded website), but all of those miscellaneous costs are completely abstracted. Which would you more likely pay for? Also, is there another option I may be overlooking?


title: The nature of callbacks in Node.js

text: In the plain javaScript world I've learned that nested functions can be problematic because the inner function is "re-created" every time the outer function is called:               function outer(a) {         function inner(arg1,arg2){             return arg1 + arg2;         }         return inner(a, 6);     }     myVar = outer(4);      Apparently the inner function is garbage collected and the constant re- creation of it has a cost on performance. This could be re-factored as:               function inner(arg1, arg2) {         return arg1 + arg2;     }          function outer(a) {         return inner(a, 6);     }          myVar = outer(4);      If I am correct it seems that the tradeoff lies in the changing scope of inner; the fact that function inner no longer has access to outer's own variables. If I am correct so far, lets move to Node.JS. Node is heavy on callbacks, and my question is, are asynchronous callback functions typical in Node also "re-created" every time they are fired? Take the following common Node construct:               http.createServer(function (req, res) {         res.writeHead(200, {'Content-Type': 'text/plain'});         res.end('Hello World\n');     }).listen(1337, '127.0.0.1');      In reality the function can get pretty large; it can encompass a lot of functionality. Is the above callback "re-created" every time a client GETs or POSTs the server? If so, would it be better to always de-couple the callbacks as in the plain javaScript example:               function handleGET(req, res) {        res.writeHead(200, {'Content-Type': 'text/plain'});        res.end('Hello World\n');     }          http.createServer(handleGET).listen(1337, '127.0.0.1');      as a related bonus question, are event functions re-created too? Would they benefit from prior declaration?               myObj.on('someEvent', function someFunction() {...});      vs.               function someFunction() {...}     myObj.on('someEvent', someFunction);


title: The number of years experience needed to be a contract developer

text: Suppose you are a programmer in your mid-20's who has had several years industrial experience working for both big tech and a few internet startups but now you'd like to try contracting in the hope you'll be able to choose more interesting and varied work and be able to have a few months off between jobs to focus on things like open source, travelling and developing your own startup ideas. Now this is possibly one of those 'grass is greener' daydreams.. Even if in the workplace you manage to have the enthusiasm and skill to work equally alongside much more experienced co-workers, how realistic do you think it would be for someone with too few years of experience to appear 'specialist' or 'experienced' to compete for contracts and afford to live this lifestyle?


title: C/C++: Which conversion warnings make sense in practice?

text: C/C++ implicit conversions can cause bugs. Here's one example:               int foo, bar;     scanf("%d", &foo);     scanf("%d", &bar);     float foobar = foo / bar;      If I input `7` and `2`, it's not `3.5` as expected - it's `3` -> bug (let's ignore the buffer overflow). gcc's `-Wconversion` warns about this kind of stuff, so I turned it on. But it just seems to me like it's going over the top with the warnings. For instance, this:               int foo;     float bar;     scanf("%d", &foo);     scanf("%f", &bar);     float foobar = foo / bar;      Causes a warning:               warning: conversion to 'float' from 'int' may alter its value [-Wconversion]      Even though it works as intended, returning `3.5` when I input `7` and `2`. I know that float cannot represent all possible int values precisely, but I'm questioning if adding a cast here does anything to help - other than adding more code. In the example above, casting one of the int values in the expression to float actually changed the result, replacing an implicit cast by an explicit one in this example doesn't. So much for float to int conversion warnings, but that's not all. There's also sign conversion warnings. Traditional example:               std::vector<char> chars = get_chars();     for (int i = 0; i < chars.size(); i++)         std::cout << chars[i] << std::endl;      Causes this warning:               warning: comparison between signed and unsigned integer expressions [-Wsign-compare]      I could use the more cumbersome `unsigned int` for the index variable instead - which will require further casting when I do calculations with it. All for the unusual situation that I have between `2^31 + 1` and `2^32` elements in my vector and don't do any calculations with the index variable that cast it to int. So, my question is: Which conversion warnings make sense in practice? Does adding explicit casts to fix them really improve anything?


title: How to figure out how to write a program

text: I have a program that i need to do. I know what the program should do, but i dont know how to approach making it What is the best way to arrange my ideas and thoughts, layout the what the program should do, aproach doing it correctly and transform my thoughts and ideas into code?


title: Switching to a career in Machine Learning

text: My day job is plain old software development. I am also doing my Masters in CS (part time, course based). I took a course on AI and found machine learning quite fascinating but like most courses it only offered a basic intro. I intend to learn more about Machine Learning and if possible get a job in that field. When I look at job postings in this field it is clear that a Phd in Machine learning (or prior experience in the field with considerable expertise) is required for most of them. I'm looking for advice on self learning to gain experience that'll useful in industry. At least, enough experience to get my foot in. I will do the obvious ones like reading text books, papers etc. Perhaps any open source efforts that I can participate in or something I could do on my own? Apologies if I'm being vague here but I hope there are at least a few of you who done a similar switch and can advise. Thanks !


title: Best design for a "Command Executer" class

text: Sorry for the vague title, I couldn't think of a way to condense the question. I am building an application that will run as a background service and intermittently collect data about the system its running on. A second Android controller application will query the system over tcp/ip for statistics about the system. Currently, the background service has a tcp listener class that reads/writes bytes from a socket. When data is received, it raises an event to notify the service. The service takes the bytes, feeds them into a command parser to figure out what is being requested, and then passes the parsed command to a command executer class. When the service receives a "query statistics" command, it should return statistics over the tcp/ip connection. Currently, all of these classes are fully decoupled from each other. But in order for the command executer to return statistics, it will obviously need access to the socket somehow. For reasons I can't completely articulate, it feels wrong for the command executer to have a direct reference to the socket. I'm looking for strategies and/or design patterns I can use to return data over the socket while keeping the classes decoupled, if this is possible. Hopefully this makes sense, please let me know if I can include any info that would make the question easier to understand.


title: What is the best strategy for licensing a desktop application using a web service, when all I need to know is when people use the product?

text: Our company's main application is a desktop program that is used at warehouses and written in C# and Windows Presentation Forms. The next thing we want to be able to do is track when customers open up the application and when it is being used. The reason for this is so we can charge them per month, based on if they are/arn't using the application. My boss is having me research different ways to "license" the product under these requirements. Not having any experience doing this, a few things come to mind. I could create a web application that runs on a server, and every time the desktop application is opened and the user logs in, the application connects to the server and marks a database with the DateTime. Or is there licensing software that I can use to accomplish this? Just looking for tips/advice from people who have experience with this type of stuff.


title: How to discriminate from two nodes with identical frequencies in a Huffman's tree?

text: Still on my quest to compress/decompress files with a Java implementation of Huffman's coding (http://en.wikipedia.org/wiki/Huffman_coding) for a school assignment. From the Wikipedia page, I quote: >   * Create a leaf node for each symbol and add it to the priority queue. >   * While there is more than one node in the queue: >     * Remove the two nodes of highest priority (lowest probability) from the > queue >     * Create a new internal node with these two nodes as children and with > probability equal to the sum of the two nodes' probabilities. >     * Add the new node to the queue. >   * The remaining node is the root node and the tree is complete. > Now, emphasis: >   * **Remove the two nodes of highest priority (lowest probability) from the > queue** >   * **Create a new internal node with these two nodes as children and with > probability equal to the sum of the two nodes' probabilities.** > So I have to take two nodes with the lowest frequency. What if there are **multiple nodes with the _same_ low frequency**? How do I discriminate which one to use? The reason I ask this is because Wikipedia has this image: ![enter image description here](http://i.stack.imgur.com/2yhN2.png) And I wanted to see if my Huffman's tree was the same. I created a file with the following content:               aaaaeeee       nnttmmiihhssfffouxprl      And this was the result: ![enter image description here](http://i.stack.imgur.com/DNOwz.png) Doesn't look so bad. But there clearly are some differences when multiple nodes have the same frequency. My questions are the following:   * What is Wikipedia's image doing to discriminate the nodes with the same frequency?   * Is my tree wrong? (Is Wikipedia's image method the one and only answer?) I guess there is one specific and strict way to do this, because for our school assignment, files that have been compressed by my program **should be able to be decompressed by other classmate's programs** \- so there must be a "standard" or "unique" way to do it. But I'm a bit lost with that. My code is rather straightforward. It literally just follows Wikipedia's listed steps. The way my code extracts the two nodes with the lowest frequency from the queue is to iterate all nodes and if the current node has a lower frequency than any of the two "smallest" known nodes so far, then it replaces the highest one. Just like that.


title: What is the most performant CSS property for transitioning an element?

text: I'm wondering whether there is a performance difference between using different CSS properties to translate an element. Some properties fit different situations differently. You can translate an element with following properties: `transform`, `top/left/right/bottom` and `margin-top/left/right/bottom` In the case where you do not utilize the `transition` CSS property for the translation but use some form of a timer (`setTimeout`, `requestAnimationFrame` or `setImmediate`) or raw events, which is the most performant–which is going to make for higher FPS rates?


title: Programming and Ubiquitous Language (DDD) in a non-English domain

text: I know there are some questions already here that are closely related to this subject but none of them take Ubiquitous Language as the starting point so I think that justifies this question. For those who don't know: Ubiquitous Language is the concept of defining a (both spoken and written) language that is equally used across developers and domain experts to avoid inconsistencies and miscommunication due to translation problems and misunderstanding. You will see the same terminology show up in code, conversations between any team member, functional specs and whatnot. So, what I was wondering about is how to deal with Ubiquitous Language in non- English domains. Personally, I strongly favor writing programming code in English completely, including comments but ofcourse excluding constants and resources. However, in a non-English domain, I'm forced to make a decision either to:   1. Write code reflecting the Ubiquitous Language in the natural language of the domain.   2. Translate the Ubiquitous Language to English and stop communicating in the natural language of the domain.   3. Define a table that defines how the Ubiquitous Language translates to English. Here are some of my thoughts based on these options: 1) I have a strong aversion against mixed-language code, that is coding using type/member/variable names etc. that are non-English. Most programming languages 'breathe' English to a large extent and most of the technical literature, design pattern names etc. are in English as well. Therefore, in most cases there's just no way of writing code entirely in a non-English language so you end up with mixed languages anyway. 2) This will force the domain experts to start thinking and talking in the English equivalent of the UL, something that will probably not come naturally to them and therefore hinders communication significantly. 3) In this case, the developers communicate with the domain experts in their native language while the developers communicate with each other in English and most importantly, they write code using the English translation of the UL. I'm sure I don't want to go for the first option and I think option 3 is much better than option 2. What do you think? Am I missing other options? **UPDATE** Today, about year later, having dealt with this issue on a daily basis, I have to say that option 3 has worked out pretty well for me. It wasn't as tedious as I initially feared and translating in real time while talking to the client wasn't a problem either. I also found the following advantages to be true, based on my experience.   * Translating the UL makes you pay more attention to defining the UL and even the domain itself, especially when you don't know how to translate a term and you have to start looking through dictionaries etc. This has even caused me to reconsider domain modeling decisions a few times.   * It helps you make your knowledge of the English language more profound.   * Obviously, your code is much more pleasant to look at instead of being a mind boggling obscenity.


title: How to make a license apply to a whole library?

text: I'm creating a standard library for a programming language, and I'd like to license each and every single class or function in there under the MIT license, so they're completely FOSS. All of the files reside in a single directory. Would it be enough to put a LICENSE.txt file in the same directory, containing the MIT license? Do I need to say that the following license applies to all features of the library, or is the library itself considered to be a program?


title: How fundamental to good development is BDD?

text: I am learning to be a web developer and am using rails. I have read lots of advice and books on the subject and am trying to build my own app, so learning by doing. My question is about that learning journey and the path to take. I have been convinced that BDD is a very sensible and helpful way to develop so I am studying this technique. I am using Cucumber and RSpec and am working through the RSpec book and the Cucumber book. I have now reached a point of total frustration though as I try to write features and steps because I don't know how to use rails or write code. I am new to it but wanted to make sure I built in the good habits as I learn. If I make BDD the way I code from the beginning it will be second nature to me once I am an experienced developer, but because of how slowly I am progressing and how lost I am I am thinking I should scrap BDD for now and just learn the framework. But them I am in the habit of not writing tests as I go and getting lazy. What are your experienced feelings on this matter? Should I keep plugging away at the BDD tests to build good habits? Or am I putting to much importance on it? Thank you for advice,


title: Pseudocode for an echo using recursion

text: Using pseudocode, what would the code for an echo using recursion be? UPDATE: Appears I should have been more clear. By echo I mean the pattern sound exhibits when it echos, not echo as in repeatly add one to self where self equals zero. Any thought on what the code would look like for a "real" echo? For example, I'd thought about "echo(reduce-volume();exit-if- silent;echo())" but was sure if the logic made sense. UPDATE-2: Working through my own logic above an noticed it lacks a way to account for "positive feedback", which I'm guessing is required. http://en.wikipedia.org/wiki/Positive_feedback


title: SQL RDBMS : one query or multiple calls

text: After looking around the internet, I decided to create DAOs that returned objects (POJOs) to the calling business logic function/method. For example: a Customer object with a Address reference would be split in the RDBMS into two tables; Customer and ADDRESS. The CustomerDAO would be in charge of joining the data from the two tables and create both an Address POJO and Customer POJO adding the address to the customer object. Finally return the fulll Customer POJO. Simple, however, now i am at a point where i need to join three or four tables and each representing an attribute or list of attributes for the resulting POJO. The sql will include a group by but i will still result with multiple rows for the same pojo, because some of the tables are joining a one to many relationship. My app code will now have to loop through all the rows trying to figure out if the rows are the same with different attributes or if the record should be a new POJO. Should I continue to create my daos using this technique or break up my Pojo creation into multiple db calls to make the code easier to understand and maintain?


title: Is there a perf hit using mule as a container vs. standard JEE container like Weblogic?

text: Our team is considering using Mule in a large scale medium volume internal facing transactional banking application. At first Mule would just be used as an application server although it is possible some of its esb/orchestration features would be used in the future. I have no experience with mule, being new on the team. But my gut says Mule would not be as performant as Weblogic or Glassfish as a deployment container. Does anyone have any comparison stories to share that might shed light?


title: Can one always design for scale out?

text: When designing an application where scalability is going to be important, it would be useful if the application could be designed to "scale out" on cheap commodity servers. However, there are many scale up applications (see my previous question). Is it always _possible_ to design an application to scale out, or do some requirements make scale out impossible, even if all software can be designed from scratch and no legacy software is involved? I am looking for cases where scale out is an inferior solution to scale up, and where good application design could not mitigate this. In other words, the application _cannot_ be designed to scale out effectively, no matter how hard one tries. I am _not_ looking for cases where legacy software or data structures -- or even entire architectures (as in the answer to the previous question) -- were not designed to scale out and could not be changed. Alternatively, if there is reason to believe that one can _always_ scale out, if the application is well designed, I would love to know that as well. Edit: I am looking for an explicit example of such a system, if there is one.


title: Distinguishing between UI command & domain commands

text: I am building a WPF client application using the MVVM pattern that provides an interface on top of an existing set of business logic residing in a library which is shared with other applications. The business library followed a domain-driven architecture using CQRS to separate the read and write models (no event sourcing). The combination of technologies and patterns has brought up an interesting conundrum:   * The MVVM pattern uses the command pattern for handling user-interaction with the view models. .NET provides an ICommand interface which is implemented by most MVVM frameworks, like MVVM Light's RelayCommand and Prism's DelegateCommand. For example, the view model would expose a number of command objects as properties that are bound to the UI and respond when the user performs actions like clicking buttons.   * Many implementations of the CQRS use the command pattern to isolate and encapsulate individual behaviors. In my business library, we have implemented the write model as command / command-handler pairs. As such, when we want to do some work, such as create a new order, we 'issue' a command (CreateOrderCommand) which is routed to the command-handler responsible for executing the command. This is great, clearly explained in many sources and I am good with it. However, take this scenario: > I have a ToolbarViewModel which exposes a CreateNewOrderCommand property. > This ICommand object is bound to a button in the UI. When clicked, the UI > command creates and issues a new CreateOrderCommand object to the domain > which is handled by the CreateOrderCommandHandler. This is difficult to explain to other developers and I am finding myself getting tongue-tied because everything is a command. I'm sure I'm not the first developer to have patterns overlap like this where the naming/terminology also overlap. **How have you approached distinguishing your commands used in the UI from those used in the domain?** (Edit: I should mention that the business library is UI-agnostic, i.e. no UI technology-specific code exists, or will exists, in this library.)


title: What is minimalistic setup for Agile Development for a small team?

text: I have 10 developers and 3 Testes team and I want to setup CruiseControle as CI for automated builds, tests and deployment to production server and some repository for SCM ( Source Code Management). I need something that would enable the team lead to create tickets (tasks) for each sprint in SCRUM and issue/bug tracking and task time tracking. I want to use simplest possible solution that just gets the job done with the minimum requirements specified in this SO question. I do not want to use heavy weight or feature rich software ( either free or costly), just the simplest possible setup. Each developer is using Eclipse STS IDE. So it must be something that is integrated into STS (like available as STS plugin, again to keep things as simple as possible). This is for development of Java web application.


title: What's so special about x64 and programming x86?

text: I know this is a little funny question, but I didn't have the chance to realize what makes any difference when programming x64 or x86 at high level languages (.NET for instance). Any explanations would be appreciated.


title: Is there a quasi-standard set of attributes to annotate thread safety, immutability etc.?

text: Except for a blog post here and there, describing the custom attributes someone created, but that do not seem to get any traction - like one describing how to enforce immutability, another one on Documenting Thread Safety, modeling the attributes after JCIP annotations \- is there any standard emerging? Anything MS might be planning for the future? This is something that should be standard, if there's to be any chance of interoperability between libraries concurrency-wise. Both for documentation purposes, and also to feed static / dynamic test tools. If MS isn't doing anything in that direction, it could be done on CodePlex - but I couldn't find anything there, either. <opinion>Concurrency and thread safety are really hard in imperative and object-languages like C# and Java, we should try to tame it, until we hopefully switch to more appropriate languages.</opinion>


title: Misconceptions about purely functional languages?

text: I often encounter the following statements / arguments:   1. Pure functional programming languages do not allow side effects (and are therefore of little use in practice because any useful program does have side effects, e.g. when it interacts with the external world).   2. Pure functional programming languages do not allow to write a program that maintains state (which makes programming very awkward because in many application you do need state). I am not an expert in functional languages but here is what I have understood about these topics until now. Regarding point 1, you can interact with the environment in purely functional languages but you have to explicitly mark the code (functions) that introduces side effects (e.g. in Haskell by means of monadic types). Also, as far as I know computing by side effects (destructively updating data) should also be possible (using monadic types?) even though it is not the preferred way of working. Regarding point 2, as far as I know you can represent state by threading values through several computation steps (in Haskell, again, using monadic types) but I have no practical experience doing this and my understanding is rather vague. So, are the two statements above correct in any sense or are they just misconceptions about purely functional languages? If they are misconceptions, how did they come about? Could you write a (possibly small) code snippet illustrating the Haskell idiomatic way to (1) implement side effects and (2) implement a computation with state?


title: What is the difference between _Procedural Generation_ and _Random Generation_?

text: Today, I got into an argument about the term "procedural generation". My point was that its different from "classic" random generation in that _procedural generation_ is based on a more mathematical, fractal-based, algorithm leading to a more "realistic" distribution and the usual randomness of most languages are based on a pseudo-random-number generator, leading to an "unrealistic", in a way, ugly, distribution. This discussion was made with a heightmap in mind. The discussion left me somehow unconvinced about my own arguments though, so, is there more to it? Or am I the one who is, in fact, simply wrong?


title: Class/Object with different sets of configurations, singletons etc (PHP)

text: I want to produce maintainable code for configuring one or multiple classes differently depending whether in a production or development environment. For example, making a `Paypal` class/object that handles API calls to Paypal, using different settings depending on some sort of global switch set to either Dev or Live. The first would connect to the sandbox account, the other the live account. I want to keep it as simple as possible - I would not be loading configuration variables from a file or database, but instead specifying them in either a subclass's constructor, one subclass for dev and one for live, or similar:               class Paypal {         private $endpointUrl;         public static function makeSandbox(){             return new Paypal('http://....');         }         public static function makeLive(){             return new Paypal('http://....');         }         // ....         public function Paypal($url){             $this->endpointUrl = $url;         }     }      However this leaves me with so many questions, like for other classes who's configuration is different between live/server, do I store the different initialisations in it's class, or should I have a class dedicated to all configuration details, should it be a singleton, and so on. The application will be rather simple, and only be maintained by myself so the idea of XML configuration files etc seems over the top, a PHP configuration file with a switch statement and global variables seems like bad form. Using a sort of global `Config` class brings a whole load of questions. I'm feeling pretty overwhelmed here. I've read around and there seem to be so many opinions. The one rule that sticks in my mind is use OOP patterns to solve a problem, not just for the sake of it. Being a very small site with just me developing it, I'm very hesitant introducing multiple extra classes or objects just for dealing with two sets of global configurations. Please help


title: Server requests optimisation - size vs frequency

text: my map-like app loads data from google map API but it also loads some extra data - in the form of XML - from my server. When the app loads it really needs only small amount of data to cover the currently visible area but there is a chance of 2% (aka conversion rate) that the user will interact with the map and more data will be needed. My problem is that I can not really estimate the probability that user will need certain part of the map data, therefore I can not estimate the optimal size of the data packet. Should I sent just the minimal chunk of data that user needs right now or should I send him data for all the nearby screens, or even more? **In theory, what is the trade of between sending one big chunk of data - lots of bytes (lot bandwidth) but few server requests - or sending small pieces of data whenever needed - small but frequent server requests?** The XML chunks will be cached but the bigger chunks I generate the higher the chance I will have to update it every time something changes in the data (that will happen quite frequently). I can not quantify the sizes and probabilities yet so please treat this question as highly theoretical. I would like to hear your opinions.


title: iOS Networking/Backend : has anyone found the ultimate knowledge source ?

text: I have a hard time trying to find a moderne (updated), complete knowledge source (book or tutorial) that would tackle from scratch the server side of iOS App Development. My goal is to create an app in which users can talk to each others, see each others' profiles, share images... I am fairly new to backend implementation, I only know the basics of PHP (but I am good in other iOS development topics). I have been searching for a lot of books/tutorials, but I am frustrated for the following reasons : \-- code is too old and needs to be updated \-- a third-party library needs to be used Has anyone ever found something that would take the newbie from scratch, explaining and giving examples of backend side implementation in a modern way? I know this is a broad question, but if someone has already stumbled upon a great resource, I'd be happy to read it ! Thanks, BM


title: Java GUI with JFrames

text: Today I started learning Java GUI and tried to create a simple window on my Ubuntu. I am using jre7 for now. I wrote code exactly from tutorial because from experience there are stuff that doesn't work even if it's correctly typed onto my screen. So, now I used thenewboston's first tutorial with Java GUI. Typed all syntax correctly, classes seems fine, no errors. He got window that was expected - mine only got blank window with no title and no text. Screenshot with that http://screencloud.net/v/ywtW Code in JFrames.java file:               import java.awt.FlowLayout; // importē plūstošo skatu / default layout     import javax.swing.JFrame; // dod iespēju piekļūt pamata logu struktūrai     import javax.swing.JLabel; // ļauj rakstīt tekstu logos          public class JFrames extends JFrame {              private JLabel item1;              public JFrames() {             super("The Title Of The Program"); // parāda title bar ar tekstu             setLayout(new FlowLayout());                  item1 = new JLabel("This is sentence with something");             item1.setToolTipText("This is tooltip on hover");             add(item1); // pievieno logam šo lietiņu         }     }      Please, ignore latvian comments, that's just for my reference. So I want to know - why my window appears blank?


title: What mistakes do your users make, and how can you update your application to handle them?

text: In fact this question is about cautions to be taken to enhance quality user experience and reduce avoidable support calls.


title: Repository Pattern: Exposing Data Context to Underlying Layers

text: My team is in the process of updating a legacy project. We've decided to incorporate the Repository Pattern along with `Entity Framework` in our Data Access layer. Below is a high-level view of this organization: ![enter image description here](http://i.stack.imgur.com/ATCVY.png) `IRepository<TEntity>` is a generic interface used to perform common operations on an entity set:               public interface IRepository<TEntity> where TEntity : class     {         ObjectSet<TEntity> EntitySet { get; set; }              TEntity Get(object key);              void Insert(TEntity entity);              void Update(TEntity entity);              void Save();     }      For example if I have an `Employee` entity, I can create the `EmployeeRepository:IRepository<Employee>` object. The `DataFactory` class is then used as a wrapper object to take care of `ObjectContext` generation, disposal, and exception handling:               public class DataFactory<TContext, TEntity> : IDisposable             where TContext : ObjectContext, new()             where TEntity : class     {         private bool _disposed = false;         private TContext _context;         private IRepository<TEntity> _repository;              public DataFactory()         {             _context = new TContext();             IRepository<TEntity> repoistory;                  bool isRepositoryFound = TryGetRepository(out repoistory);                  if (!isRepositoryFound)             {                 throw new InvalidOperationException(                     string.Format("Unable to find repository of type {0}.", typeof(TEntity).FullName));             }                  _repository = repoistory;         }              public DataFactory(TContext context, IRepository<TEntity> repository)         {             _context = context;             _repository = repository;         }              public void Do(Action<TContext, IRepository<TEntity>> action)         {             try             {                 action(_context, _repository);             }             catch (Exception ex)             {                 ProcessException(ex);             }         }              public TResult DoAndReturn<TResult>(Func<TContext, IRepository<TEntity>, TResult> action)         {             try             {                 return action(_context, _repository);             }             catch (Exception ex)             {                 ProcessException(ex);                 return default(TResult);             }         }              private bool TryGetRepository(out IRepository<TEntity> repository)         {             Type repositoryType = Assembly.GetExecutingAssembly().GetTypes().SingleOrDefault(t =>                 typeof(IRepository<TEntity>).IsAssignableFrom(t));                  if (repositoryType == null)             {                 repository = null;                 return false;             }                  repository = (IRepository<TEntity>)Activator.CreateInstance(repositoryType, _context );             return true;         }     }      And finally to use this class in the Business Layer, we would have something like:               using (var factory = new DataFactory<MyDataContext, Employee>())     {         factory.Do((context, repository) =>         {            // Interact with the repository         });     }      My coworker and I had a long conversation about whether the data context object should be exposed to the underlying layers in the `Do()` and `DoAndReturn()` methods. While I do see cases where having direct access to the context could be useful (for example in a case where we might want to turn on/off lazy loading for a particular entity set), I think doing so defeats the whole purpose of abstracting the Data Access layer (which is achieved by providing a common `IRepository` contract) since now objects can be directly accessed/manipulated through the `ObjectContext`. He suggested having two different versions of these methods: one that exposes only the repository, and one that exposes both the context and repository. Is this an acceptable approach? Any suggestions are appreciated.


title: Is it okay to use a language that isn't supported by your company for some tasks?

text: I work for a company that supports several languages: COBOL, VB6, C# and Java.   I use those languages for my primary work, but I often find myself to coding some minor programs (e.g. scripts) in Python because I found it to be the best tool for that type of task. For example: An analyst gives me a complex CSV file to populate some DB tables, so I would use Python to parse it and create a DB script. What's the problem?   The main problem I see is that a few parts of these quick & dirty scripts are slowly gaining importance and:   1. My company does not support Python    2. They're not version controlled (I back them up in another way)   3. My coworkers do not know Python  The analysts have even started referencing them in email ("launch the script that exports..."), so they are needed more often than I initially thought. I should add that these scripts are just utilities that are not part of the main project; they simply help to get trivial tasks done in less time. For my own small tasks they help a lot. In short, if I were a lottery winner ~~to be in a accident~~ , my coworkers would need to keep the project alive without those scripts; they would spend more time in fixing CSV errors by hand for example. Is this a common scenario? Am I doing something wrong? What should I do?


title: How to make the working environment of a programmer less shiny?

text: Last year I had a sport accident and since then my left eye is a little bit sensitive. Especially if looking in bright and shiny colors, I get tired very fast and can't literally focus on anything. White is the worst color ever! Unfortunately most application that I use in my work environment (Firefox, Eclipse, Visual Studio, Tetris) have a very bright white background. This really hurts my eye. So is there an easy way to generally use color schemes on the laptop so that everything isn't that bright? Obviously I could everywhere change the default color scheme, but isn't there a simpler solution to do that? Or any recommendations what are good color schemes to be less bright but still clearly readable?


title: What are good examples of using assertions to detect bugs?

text: Most examples of using assertions that I find seem to be about dealing with _runtime errors_ , such as out of memory conditions. That's not what I'm after. One good example of using assertions to detect bugs is the following excerpt from the Wikipedia article about assertions:               int total = countNumberOfUsers();     if (total % 2 == 0) {         // total is even     } else {         // total is odd and non-negative         assert(total % 2 == 1);     }      Here, the programmer erroneously assumed that `i % 2` can only have two distinct values, and the assert will catch that bug. What other good examples of using assertions to detect bugs are there?


title: Reading assembly useful for insights when writing C/C++?

text: While in most cases its not necessarily, recently I have taken to reading the generated assembly of my C code every so often, when I'm curious as to the kinds of optimizations my compiler is making. _Especially for low level code or functions which are called many times._ Examples include:   * Checking if a change to the C code has any impact on the generated code.   * Checking if the same expression used twice is optimized into one, or if assigning a variable makes a difference.   * Check for changes which may bloat-generated code-size. Now this is not a perfect method by any means, its possible that some difference in the generated output is a red-herring, because of all sorts of internal logic & thresholds within the compiler, but its still interesting at times. At this point while looking at the assembly I can lookup each command, but not really read the assembly _(amd64 as it happens)_. So my question is, has anyone found it useful to learn a certain amount of assembly to write better C code? (or at least get more insights into their code).   * If so, how much is useful to know?   * What kinds of issues did it help you resolve? * * * _Note, the danger here is that one writes C code targeting the assembly which is very specific to the developers own system - any advantage may be lost on a different compiler or architecture, taking that into account, Im still interested in other developers experience_


title: How to prevent the vicious circle of testing via customer

text: I recently asked this question and this comment and made me ponder the whole process of releasing an update to the customers. The next update for our software is planned and the previous time it went horribly wrong because of regression, bad testing, etc... This time we want to prevent the scenario that we test via our customer and made some unit tests and other minor improvements. However, there is not enough time to make unit tests for all the features that lack unit tests or the features that need to be build yet. So the answer for this question 'Make more unit tests' is not fitting because of the lack of time, infrastructure etc... Every bug and feature will be tested/reviewed by a different developer, but that won't be done perfectly of course (we're still human :)). My question is: Once we released the update, how do we prevent the vicious circle of testing via customers while not be able to add more unit tests? * * * The previous time we tried our best to test the software before and after release. After the deadline we were still searching and fixing bugs but the customer would also find some of these. So we post an update as soon as we were confident that the patch was increasing quality. We were so busy with finding bugs and fixing them that we weren't spending any time on creating unit tests. This time we don't have a solid plan yet, hence the question. As stated before we did added some unit tests, but surely not enough. We are also looking for new colleagues but they are not easy to come by and management has rather high standards. We do have quite some candidates and it looks like we do get at least one new colleagues very soon, but it still takes time to get him/her up and running. The first thing we put the new colleague on will be creating unit tests. So the dependencies there are experience, skills and the time he/she can join the time. Another problem that comes in hand with the lack of developers is that we are so focused on getting the bugs and features fixed that we don't have much time to spend on thinking about 'how we can improve the update process'. (I ask these questions in my own spare time). * * * Summary of steps I will try to take:   * Try to get a tester before the release is done   * Add unit tests while creating the features, if there isn't enough time, schedule them for after the release.   * After releasing, if there is any regression, create unit tests when fixing the bugs.   * Release more often in smaller chunks after the release, making it easier to release features and repair bugs with a minor priority.


title: What is the mathematical model of a Python's class?

text: I understand that the classical model from the lambda-papers is not valid for Python. And the closures are not the mathematical model of the implementation of the Python system. So which model is it?


title: Should a development machine be inside a VM?

text: This post by Rob Conery (note the slug) says that development environment should be run inside a virtual machine. I see what he's saying and tend to agree, but still feel a little uneasy. Now that virtualization is so mature that even production systems run inside VMs speed is pretty much a non-issue, but as I say something bothers me here. What's your take on virtualizing your development machine? Have you already done so? If you did, any pitfalls or gotchas along the road?


title: What should I do to scale out a high-traffic website?

text: What best practices should be undertaken for a website that needs to "scale out" to handle capacity? This is especially relevant now that people are considering the cloud, but may be missing out on the fundamentals. I'm interested in hearing about anything you consider a best practice from development-level tasks, to infrastructure, to management.


title: Cheap programmable, portable device

text: Since a long time I have thrived for being able to program something I can take with me - a very small computer like a programmable calculator, gameboy, pocket PC or cellphone. However, I didn't find anything fitting yet! The thing I'm looking at is the price, because I can't afford to spend too much money on it.   * What are some cheap portable programmable devices? All I'd need is support for uploading assembler code from my computer. I don't care about the display, a simple LCD would be sufficient. Same goes for the buttons I have looked at programmable calculators, portable gaming consoles such as the PSP and more, however didn't find anything that fit :(


title: What does a "bodyshop" (in context of a programming job /environment) mean

text: I've kept on coming across the term "bodyshop" in terms of a programming job/environment but despite googling I can't find out what exactly this is referring to? Can someone please enlighten me?


title: Technique to Solve Hard Programming logic

text: I have heard about many techniques which are used by developer/software manager to solve hard programming logic or to create flow of an application and this flow will be implemented by developers to create an actual application. Some of the technique which i know, are:   1. Flowchart   2. Screen-Layout   3. Data Flow Diagram   4. E-R Diagram   5. Algorithm of every programs I'd like to know about two facts: (1) Are there any techniques other than this ? (2) Which one is the most suitable to solve hard programming logic and process of application creation?


title: Entity Framework and layer separation

text: I'm trying to work a bit with Entity Framework and I got a question regarding the separation of layers. I usually use the UI -> BLL -> DAL approach and I'm wondering how to use EF here. My DAL would usually be something like               GetPerson(id)     {         // some sql         return new Person(...)     }      BLL:               GetPerson(id)     {         Return personDL.GetPerson(id)     }      UI:               Person p = personBL.GetPerson(id)      My question now is: since EF creates my model and DAL, is it a good idea to wrap EF inside my own DAL or is it just a waste of time? If I don't need to wrap EF would I still place my Model.esmx inside its own class library or would it be fine to just place it inside my BLL and work some there? I can't really see the reason to wrap EF inside my own DAL but I want to know what other people are doing. So instead of having the above, I would leave out the DAL and just do: BLL:               GetPerson(id)     {         using (TestEntities context = new TestEntities())         {                 var result = from p in context.Persons.Where(p => p.Id = id)                                     select p;         }     }      What to do?


title: Advice on JavaScript library for visualizing Yahoo Pipe Output

text: I'm currently writing a JavaScript library. It is a project for school were I need to make it easier to visualize data from Yahoo Pipes. The data format is a JSON string, which can contain anything, but mostly contains a list of items, with different attributes for each item.   This approach is quite general and now I was wondering which functionality I could insert into this library. Also how I can deal with this general flow of data to make a usable library for all kinds of data.. The data from Yahoo Pipes can be news items (title, description, postdate, images, links,..) Yahoo Pipes also has functionality for parsing CSV files, so "data tables" are also possible.   Also I was thinking about the structure of the library, what the best way is to implement it. In general the library needs to load in the data from the pipe (JSON string) and pass it to a visualization library like Google Chart or D3.js (formerly Protovis)   I would consider my Javascript skill level as 'Rookie' :)      Thanks for the replies, any advice is welcome!


title: Does a batch of operations violate REST principles?

text: Does it violate REST principles for a REST API to support a batch of operations (perhaps with transactional guarantees) that can be added to a queue via a POST? This design seems outside the scope of REST architecture but not necessarily in violation of it, but I'm looking for authoritative sources here, and/or supporting explanations when/why to avoid or prefer this approach. For example, the Parse API supports a POST to create a batch of requests, each representing what could be a separate REST request, such as the following (quoting):               curl -X POST \       -H "X-Parse-Application-Id: ${APPLICATION_ID}" \       -H "X-Parse-REST-API-Key: ${REST_API_KEY}" \       -H "Content-Type: application/json" \       -d '{             "requests": [               {                 "method": "PUT",                 "path": "/1/classes/GameScore/Ed1nuqPvcm",                 "body": {                   "score": 999999                 }               },               {                 "method": "DELETE",                 "path": "/1/classes/GameScore/Cpl9lrueY5"               }             ]           }' \       https://api.parse.com/1/batch


title: Introducing a (new) test method to a team

text: A couple of months ago I was hired in a new job. ( **I'm fresh out of my Masters in software engineering** ) The company mainly consists of ERP consultants, but I was hired in their fairly small web department (6 developers), our main task is ERP/ecom integration ( **ERP-integrated web shops** ). The department is growing, and **recently my manager asked me to start thinking about introducing tests to the team** , I love a challenge, but frankly I'm a bit scared (I'm the least experienced member of the team). Currently the method of testing is clicking around in the web shop and asking the customer if the products are there, if they look okay, and if orders are posted correctly to the ERP. We are getting a lot of support cases on previous projects, where a customer or a customer's customer have run into errors, which - I suppose - is why my manager wants more structured testing. Off the top of my head, I though of some (obvious?) improvements, like looking at the requirement specification, having an issue tracker, enabling team members to register their time on a "tests"-line on the budget, and to circulate tasks amongst members of the team. But as I see it we have three main challenges:   1. **general website testing**. (javascript, C#, ASP.NET and CMS integration tests)   2. (live) **ERP integration testing** (customers rarely want to pay for test environments).   3. **adopting a method in the team** I like the responsibility, but I am afraid that I'm in a little bit over my head. I expect that my manager expects me to **set up some kind of workshop for the team** where I present some techniques and ideas and where we(the team) can find some solutions together. What I learned in school was mostly unit testing and program verification, not so much testing across multiple systems and applications. **What I'm looking for here, is references/advice/pointers/anecdotes; anything that might help me to get smarter and to improve the current method of my team.** (TL;DR: read the bold parts)


title: Stereo images rectification and disparity: which algorithms?

text: I'm trying to figure out what are currently the two most efficent algorithms that permit, starting from a L/R pair of stereo images created using a traditional camera (so affected by some epipolar lines misalignment), to produce a pair of adjusted images plus their depth information by looking at their disparity. Actually I've found lots of papers about these two methods, like:   * "Computing Rectifying Homographies for Stereo Vision" (Zhang - seems one of the best for rectification only)   * "Three-step image rectiﬁcation" (Monasse)   * "Rectification and Disparity" (slideshow by Navab)   * "A fast area-based stereo matching algorithm" (Di Stefano - seems a bit inaccurate)   * "Computing Visual Correspondence with Occlusions via Graph Cuts" (Kolmogorov - this one produces a very good disparity map, with also occlusion informations, but is it efficient?)   * "Dense Disparity Map Estimation Respecting Image Discontinuities" (Alvarez - toooo long for a first review) Anyone could please give me some advices for orienting into this wide topic? What kind of algorithm/method should I treat first, considering that I'll work on a very simple input: a pair of left and right images and nothing else, no more information (some papers are based on additional, pre-taken, calibration infos)? Speaking about working implementations, the only interesting results I've seen so far belongs to this piece of software, but only for automatic rectification, not disparity: http://stereo.jpn.org/eng/stphmkr/index.html I tried the "auto-adjustment" feature and seems really effective. Too bad there is no source code...


title: A* Algorithm Completeness Proof

text: The A* Algorithm is the optimal (provided the heuristic function is underestimated), complete & admissible (provided some conditions). I know the proofs of admissibility & optimality. But how do you prove that the A* Algorithm is complete?


title: What are some feasible ideas for building a smart-device/console development portfolio?

text: I would like to start getting more contracts in the mobile, smart-device, and console development space and, having little prior work experience in the field, I need to build a portfolio of example projects. Most of my professional experience is based on the .NET stack, so that is helpful in covering Windows Phone, Windows Metro, and XBOX (non-game) development such as Kinect UI development, media applications, etc. But I also need to demonstrate that I can handle Android development, Linux development (i.e. Smart TV apps), possibly Arduino development and so forth. I have the tools and the knowledge to at least knock out some Android and Arduino examples, though iOS and Linux is stretching a bit out of my comfort zone. In any case, what are some ways in which I could demonstrate that I understand and can code for these platforms? Media search and filter apps? Kinect navigation? Android app that gets you the location of the nearest Starbucks based on GPS coordinates? Any ideas would be greatly appreciated.


title: How can I use JIRA for project management with Green Hopper

text: I am thinking of using JIRA + GreenHopper for my project management. I have seen that Green Hopper is for making User stories, sprints. I am not able to find how do i need to add tasks, or how to break user stories in to sub stories. Do I first need to create project in JIRA and then use Green Hopper or I can use use Green Hopper standalone for project management? I am thinking of JIRA as issue tracker not project management.


title: Design Pattern dilemma. Strategy seems wrong?

text: I would like some help/advice on a design pattern or similar I could use for my problem. I have some shared functionality in my code and I use the Strategy pattern at present. I have a base class named "ProjectSectionBase" and from here I have 2 derived classes, "ProjectSectionStandard" and "ProjectSectionSuperior". Now the problem is that "ProjectSectionSuperior" has a lot of extra functionality than "ProjectSectionStandard" and I'm finding that throughout my code i am calling methods like this: DirectCast(_projectSection, ProjectSectionSuperior).DoSuperiorStuff And I am also wrapping IF statements such as IF typeof(_projectSectio) is superior then. It just feels like bad class design. Both standard and superior share a lot of common functionality but then Superior has so much more functionality. Any advice would be greatly appreciated.


title: Why would companies allow these practices?

text: Here's a situation that usually happens in some companies: Announce interesting product X. Promise a release date. Release on the promised released date, ready or not. Users discover and report defects. Send patch after patch after patch after patch after patch. My question is: Ummm, what could be the factors that would lead them to tolerate these undesirable practices? So, in the name of quality, what can be practically and realistically improved in those practicies? I can think of time constraints, user feedback, sponsors pressuring the company, lack of money.


title: How do you learn Regular Expressions?

text: I'm not asking **where** to learn. I've found lots of good resources online, and books etc. But how the heck do I tackle them. Where is the start of it, the end? When does the regexp processor advance on the text, when does it hold its stand and tries another match? etc. I feel like trying to figure out hieroglyphs on the Egyptian pyramids.


title: Common mistakes with javascript arithmetic

text: I've ran into several oddities using javascripts floating point arithmetic, but I can never recall them off the top of my head! **What are some common mistakes when using JavaScript to do math?**


title: Preferred way for dealing with customer-defined data in enterprise application

text: Let's say that we have a small enterprise web (intranet) application for managing data for car dealers. It has screens for managing customers, inventory, orders, warranties and workshops. This application is installed at 10 customer sites for different car dealers. First version of this application was created without any way to provide for customer-specific data. For example, if dealer A wanted to be able to attach a photo to a customer, dealer B wanted to add e-mail contact to each workshop, and dealer C wanted to attach multiple PDF reports to a warranty, each and every feature like this was added to the application, so all of the customers received everything on new update. However, this will inevitably lead to conflicts as the number of customers grow as their usage patterns are unique, and if, for instance, a specific dealer requested to have an ability to attach (for some reason) a color of inventory item (and be able to search by this color) as a required item, others really wouldn't need this feature, and definitely will not want it to be a required item. Or, one dealer would like to manage e-mail contacts for their employees on a separate screen of the application. I imagine that a solution for this is to use a kind of plugin system, where we would have a core of the application that provides for standard features like customers, inventory, etc, and all of the customer's installed plugins. There would be different kinds of plugins - standalone screens like e-mail contacts for employees, with their own logic, and customer plugin which would extend or decorate inventory items (like photo or color). Inventory (customer,order,...) plugins would require to have installation procedure, hooks for plugging into the item editor, item displayer, item filtering for searching, backup hook and such. Is this the right way to solve this problem?


title: Are RSpec and Cucumber really worth it?

text: I'm a quite new programmer to Rails (about a year) always trying to discover new gems, new ways of thinking, I just love this framework. The only thing that's kind of disturbing me is testing. I know the major part of the RoR programmers are testing addicts and I understand the advantages of a large testing suite but when I start testing, I never get such a large suite and I always wonder "Am I testing the right way ? Are there really efficient ?". I'm often dealing with integration tests testing only the way the application behave... So I have some questions to improve myself as a Rails programmer. First, is testing really worth it ? I mean, is the time spent on writing tests really worth it ? Then, I use RSpec, I've recently discovered Cucumber, used it for a while but I don't know if writing all these steps is really worth the trouble ? I know I can reuse steps but I never know if these steps are too complete or not : For instance, I've been using a `Given I am logged in as (.+)` but I don't know if I must say in its definition `Given there's a user called $1` because it can duplicate the user if ever created but that's not worthwhile always having a step before `Given I am logged in as (.+)`. It's quite a lot of code that will maybe rarely be useful. I guess there are not new bugs on the parts tested every day... So is Cucumber really worthwhile compared to RSpec ? I really want to thank you for having read me because that's the first message I post that's really long and to thank you in advance for all your answers, hoping it could help other Rails newbies just like me in the future.


title: Is there any license restriction to avoid binary translation of CIL to custom bytecode?

text: Prior to actual question, let me summarize what I'm trying to do. I plan to implement a small, JIT-enabled, register-based VM runtime. Instead of making a proper compiler (which is hard IMO) for a super-fancy home-brew language, I decided to implement a binary translator from a appropriate bytecode (much like Dalvik VM approach). Considering CIL vs. Java bytecode, CIL is best for my needs. As a note, I wanted to list some important things to avoid possible confusions:   1. Base Core Library (BCL) or any Microsoft specific assemblies won't be decompiled and translated. Instead, BCL references will be subject to substitution with my VM specific codes at translation phase (much like COSMOS Plugs approach).    2. All CIL opcodes won't be translated. So, directly using CIL is not an option.   3. "Any" .NET executable is not targetted for translation. .NET will be a tool, not target.   4. Dalvik VM is good example what I'm trying to do. In Dalvik case, programs are written in Java, but Java byte codes translated into Dalvik opcodes. In my case, programs will be written in .NET, but CIL will be translated into "fancy" VM opcodes.   5. Custom VM itself will be closed source and it will be in a free software initially. But, in time, it might be used in open source and/or commercial projects. So, is there any license restriction to avoid me doing this? If so, how can I avoid the restrictions? Making only non-profit applications or making it open source? **EDIT:** I won't use **CLI** , **CLR** or any other thing which is distributed from Microsoft. I won't redistribute or integrate **SSCLI** into my applications either. **The question is about translating _CIL_ code into custom byte codes which will be done with my own tools**. So, it's actually decompilation of my own custom .NET executables into a different byte codes to serve my needs in production phase. So, essentially I'll use .NET compilers as a front-end for my decompiler, but I won't redistribute .NET compilers either. **EDIT2: CLI AND CIL ARE DIFFERENT THINGS!**