instruction
stringlengths
34
19.9k
This question is intended to apply to any OO programming language that supports exception handling; I am using C# for illustrative purposes only. Exceptions are usually intended to be raised when an problem arises that the code cannot immediately handle, and then to be caught in a catch clause in a different location (...
I work for an engineering consultancy who do a combination of industrial design, mechanics, electronics and software. By their nature - or perhaps simply by history - the overall development philosophy has been waterfall. But when I joined I was surprised that Agile, which I would now say is an industry standard, had b...
I'm managing a team of like 15 developers now, and we are stuck at a point on choosing the technology, where the team is broken into two completely opposite teams, debating over usage of WCF vs. Web API. Team A which supports usage of Web API, brings forward these reasons: Web API is just the modern way of writing ser...
I am new to the construction and design of a web app so I'd like some advice please (Django is my framework). I'm trying to code up a "how-to" website instructing users the step-by-step process for doing a certain task. I'd like the navigation of the website to be something like this... http://technet.microsoft.com/...
So I am building an application with Angular and have started to get into UI testing with DalekJS (http://dalekjs.com). As I have been writing these tests I have been thinking to myself, should I even bother with writing unit test that that are UI/UX components. Now my angular services generally don't have anything to...
I do not have the book “Practical C++ Programming” by Steve Oualline but I was reading his Ten Commandments for C++ programmers at The Ten Commandments for C++ Programmers and I was wondering if the first has been correctly transcribed? For reference the transcription is: Thou shalt not rely on the compiler default m...
BACKGROUND:optional Since 2002 I've been slowly building my own Windows Native C++ library. And let's just say that I have jumped 150KLOC (reusable code) having everything I need and the kitchen sink in it (from most of the Windows API objectualized to a decent IMAP4 client implementation and the WordPress XMLRPC clien...
I am reading a book on Java Programming, and want to confirm I understand the definition of the word "vector". Wikipedia says vector is "A one-dimensional array", source http://en.wikipedia.org/wiki/Vector. Wouldnt it be simpler to call the array simply an array? Is there any reason we need to use such fancy langu...
I'm usually very careful to keep my Model, View, and Controller code separate. The thing is JavaFx properties are so convenient to bind them all together. The issue is that it makes my entire code design dependent on JavaFx, which I feel I should not being doing. I should be able to change the view without changing too...
There are a few questions around this subject: Is creating all indexes at the start (design) over engineering? In reality, I've added indexes after performance issues were found and we 'explain plan' and add indexes as needed (i.e. not for all relationships). Should I just skip creating indexes before it's needed beca...
I have a rasterized image that contains two colors: white and black. The black portion is entirely connected and looks like a big blob. Is there a good way to estimate the length of the boundary between the regions? One method I have considered is to simply count how many "edges" of the rasterized grid have a differe...
I have two classes Output and Timeline, neither of which violate SR, but the two of them are linked together. So what I'd like to do is have a class called Elco (there's a reason behind the name) that has both of them as subclasses. For various reasons (this is just a simplified version) it's important that I don't vio...
I'm working on a legacy VB.Net code base. There are very few functions that return values, most of the code is in subs/void methods. The general strategy seems to be to pass everything in by reference, mutate it, and then observe the mutated state. There are some methods that have as many as a dozen parameters that are...
'Cohesive classes reduce coupling' So, if cohesive classes or connected classes reduce coupling (union), which piece of the puzzle is missing me? BTW, I took this sentence from an article about identifying classes before any developmemt, which I'm trying to figure out the whole sense of why, when, how to use 'that' par...
This is a theory question for me just to try and write better code. I am pretty new so hopefully I am using terms like state in the correct way. How I should be thinking about this problem? I am coding something that sort of works but whatever I do it seems complicated, hard to understand and hard to modify. I'm playin...
I currently have several web applications that offer document upload and storage. I am now trying to create a central document management service that these application can leverage to store and retrieve these documents. Currently the documents are stored on disk. The file name is a Guid and its real file name and data...
A recurring theme that I came across in my career is being the new developer to arrive in a team, and quickly having an inherent distrust of the existing unit and integration test suites. During the interview you are told by the management that they "strongly support unit testing" and that they openly encourage it. The...
I have a web app that needs to be able to display a PDF. It needs to allow the user to page through the PDF, and my application needs to be able to know which page is currently being viewed, because other aspects of the web app will change based on the current page. Ideally it would not be dependent on the client hav...
I'm currently in the process of updating a design document so that it is correct and up-to-date for future developers. Currently, the document focuses on only the facts, presenting how the design is. There is no rationale for any decisions presented. I believe that it's important to capture rationale so that developers...
I'm creating a pretty simple database driven application. Whenever I create a db app, I create classes that mimic the data in the db. Is this good practice? Am I better off making one big call to the database and populating my objects and working with these objects, or should I retrieve data from the db only when neede...
I am looking to buy an Android phone to test my first Android app on. What things should I pay attention to to make sure I pick the most suitable device?
Recently my university updated their password storage procedure, and they have several criteria such as that the password must contain a number, symbol, and uppercase character, and has a length requirement. Realistically, when a brute force / dictionary attack is being performed, doesn't this just make it easier for t...
It seems to me that you cannot possibly write a software specification in English that is completely free of ambiguities, simply due to the informal nature of natural language - and therefore that a truly unambiguous specification must include code written in a formally specified language. Is this a known result or am ...
What is the difference between templates and design patterns in JavaScript? I read about the template method design pattern and now I wonder how it relates to JavaScript templates (if at all).
..by this I mean a logic handler for a chess game. Basically validating a move and checking if somebody has won. Now ignore the complexity of the game(if you can..) I'd like some sort of psuedo code on how it would look using callbacks in javascript. For arguments sake imagine once a move is completed in the browser it...
I have a domain expert to work with, but he would throws a lot of details to me verbally. The business logics are complex, business rules change often, the business process is long and multi-ending / intermediate wait-state. There are a lot of cases to deal with (because there are many states for the account, product...
I just started using git, and because I tend to live in emacs, I want to use one of the emacs integration packages. Looking at this list, I see that there are a lot of packages available, but the blurbs for each of them don't explain very much about their capabilities, especially since I don't know git very well. Whic...
Five methods within my API call the same third-party method. In trying to abide by DRY, does it make sense to wrap this call in a private method?
I am a junior in high school and I've developed an optimization system for functional languages that could be very powerful. My computer science professors at Boise State University believe I should write a paper and take my idea as far as I can. I've formalized my method, but I haven't had an expert look at it rigoro...
What is the difference between idiom and design-pattern? It seems that these terminologies overlap somewhere; where exactly, I don't know. Are they interchangeable? When should I use what? Here is a list of C++ Idioms. Can I call them design patterns? Wikipedia defines, Programming Idiom as a low-level Design Pattern...
I'm a beginning programmer, trying to get a grasp on everything, so pardon the probably mundane theoretical question: I see in a C++ tutorial that prototyping is needed to let the compiler know that a function(?) is coming up and not to throw up any errors. Why does it not search throughout a document to find the func...
In applications that I write at work, I often need to have an external properties/settings file so that certain parameters can be configurable after the application is deployed with the end-user. The file will usually be text or XML and I will usually be implementing in C++ or Java. In the past, I have created Singleto...
Most of the logic for my webservice involves talking to our supplier's webservices (checking availability, ordering etc.) They don't have a test environment and the majority of calls can't be run arbitrarily (for example a cease would be run once and would actually stop a service). Is it feasible to run unit tests in t...
A few years ago I immigrated to another country and early last year I managed to get my master's degree. Back then I was desperately looking for a job and I was fortunate to get offered a job in a small software development company. For the record, back in my home company, I was a well-known developer with a very good ...
I need to take backup of calendar on my phone. We have requirement that we need to take backup of entire calendar data. Now, phone always supports recurring events. So, event may exist from 01-01-1601 to 31-12-3000. Logically, there is no point of taking backup from 01-01-1601 to 31-12-3000. I just want to know your vi...
Possible Duplicate: When do you not give help to less experienced programmers? Currently, I am finding a lot of my day is taken up by people asking domain knowledge/system questions. This impacts personal productivity. Should developers learn to say "no" more to ensure they get asked less questions and be more pr...
Ok, as a software engineer, I feel that my skills are valuable in other contexts, for instance, a friend came to me and asked me to setup a website for her research and I did it for free. At first I thought it would put my name out there and give me something to work with and hone my skills in my spare time... But I co...
In the more traditional projects that I've worked on, the project manager (and, on larger projects, there might be associate/deputy/assistant project managers should one person be unavailable) is the person responsible for communicating with the customer, receiving project health and status updates, determining schedul...
I intend on hiring 2-3 junior programmers right out of college. Aside from cash, what is the most important perk for a young programmer? Is it games at work? I want to be creative... I want some good ideas
the term "client" used here is not referring to client's browser, but client server Before cache workflow 1. client make a HTTP request --> 2. server process --> 3. store parsed results into memcache for next use (cache indefinitely) --> 4. return results to client --> 5. client get the result, store into client's loca...
I've noticed that Node.js has become very popular, and I've seen several instances of people doing small-scale projects in it. I've also looked at pros and cons lists to get an idea of what Node.js can do, but I'm still not clear on how it differs from other, more mature server-side tech like PHP, Perl, or Ruby on Rail...
I've just finished the first rails tutorial and now want to learn something about how other developers use it. So is it possible to "read" rails web applications to learn about its architecture and design?
I have a xmpp server design problem, I have been thinking and searching about this for a while, but cannot reach a decision, I hope experts here can give me a hint, really appreciate. <Requirement>    Build a mobile chatting server, this server should allow: 1. Register new user 2. upload user photos 3. edit their pers...
Sandboxie is a program that will let you read from the hard drive, but when you try to write back it will redirect the file to a separate container. I would like to learn how to do something similar. I do not know what terms or libraries to look for. Is there a file redirection API in windows? Is there a open source li...
I would like to know how people approach with developing their websites that are in production. For example:- How do you manage versions, etc. Also, do you create a subdirectory within the production server and work there or do you use any other environment and roll the updates there Do you have any special management...
I'm new to scrum and using it on a project. We do 3 week iterations, estimate at the beginning and then collect the points at the end. We have a product back log (probably not complete). If you do estimates of the entire back log at the beginning aren't those estimate just 'wild ass guesses' So when do you estimate ...
Roles: Development Manager Program Manager Project Manager I have read a bit and independently I understand them well enough. However when you combine them, it seems to me that some responsibilities overlap and it becomes uncertain who is responsible for what. Does anyone have a clear way of defining how each role di...
When I first started programming, I relied heavily on flowcharts (and printer spacing charts). While I was in COBOL class, I couldn't start writing any code until my flowchart was signed off by the instructor. Back then, I had to make flowchart for everything. Today, twenty-five years later, I find myself only flowchar...
I am a programmer, but since I've barely been in the professional market my portfolio is rather bare right now. Still, I started to try and get my website up and running to help a little bit, but what I really need right now is to be able to expand my portfolio. I have a guy who wants me to do a lot of work for him, an...
I have a project to develop an inventory system for a medical shop. Till date, I confronted simple requirements which were fulfilled with XML as the backend db. My interaction knowledge with XML is pretty-good and I can make almost anything with XML using LINQ-TO-XML. Since, this is an inventory system, I am bit confus...
I know that Emacs is a very powerful editor out there. I try to use it occasionally and want to learn it better. But to learn it better i have to use it more frequently than I am using now. But one big obstacle is that I could not find the basic properties like a project auto completion. Maybe I am lazy but I dont wan...
I'm a beginner programmer I have been learning PHP for a while, though not consistently. But for the past few months (say 3 months) I have been a bit consistent in my learning, largely because of a project a friend ask me to do for him since he knew I was into web design. Though I struggled to complete the tiny project...
I have been programming for many years, but one task that still takes me inordinately long is to specify a grammar for a parser, and even after this excessive effort, I'm never sure that the grammar I've come up with is good (by any reasonable measure of "good"). I don't expect that there is an algorithm for automating...
I have a web site and I want to offer a few levels of service - one free, one for a one-off payment, and one for a subscription. My first inclination is to use Paypal for the payment options. I understand that I can make some login page on my site where you create an account or login to an existing account, and then ...
I have created an iPhone application and I have submitted it to Apple and it is currently waiting for review and I have been debating with myself for the past half an hour if I should release a lite version of an app. I was wondering when one should release a lite version of an app once the full app is in the App Store...
A common argument against operator overloading is that it can be and is abused, e.g. A+B doing something completely different to addition. Examples are often quoted in C++ snippets, where the functions overloading the operators don't name the operators (e.g. operator+()). Compare this to Python, where the operators are...
Today, I started reading the book CSS Mastery 2nd edition. It is really a good book for anyone who is interested in learning some techniques. On page 151, I discovered the box-reflect property from CSS3. I tried to find out more information about which browser suports it and the syntax of the property, but I only found...
Could spending time (and actively participating) on Programmers.SE and Stack Overflow help me improve my programming skills any close to what spending time on reading a book like Code Complete 2 (which would otherwise be next in my reading list) will help. Ok, may be the answer to this question for someone who is begin...
Are there any resources for paying more attention to detail as a software developer? (Especially edge cases, or small mistakes in code, details in the problem description, ramifications for certain changes to a large system) Some thoughts so far: - Books of some sort? - Exercise of some sort (e.g. just solving math pr...
We read on Wikipedia > Iterative deepening depth-first search that The space complexity of IDDFS is O(bd), where b is the branching factor and d is the depth of shallowest goal. Wikipedia also gives some decent pseudocode for IDDFS; I pythonified it: def IDDFS(root, goal): depth = 0 solution = None while not so...
Up until now, I've been a great fan of the MVC pattern for developing web applications. For the web, I've developed mostly in PHP (with the Kohana and CodeIgniter frameworks) and Ruby (RoR). As my applications become heavier on the Ajax side (single-page apps etc) I noticed that I can't help but betray the very basic c...
A lot of answers on here suggest linking to your Stack Overflow account on your CV. I only have 300 some points over on Stack Overflow, so I don't think I'll be mentioning it just yet. Still, I'm curious to know how much reputation I should get before "boasting" about it on my CV.
I ran across this question on SO: https://stackoverflow.com/questions/7373066/webpage-source-code-incomplete-hidden-code Without trying to infer too much or start a side-discussion of the sort that SO discourages, I think it's fair to conclude that the OP is someone who is familiar with HTML, Javascript, CSS and the b...
Most projects I am involved with use several open-source components. As a general principle, is it a good idea always to avoid binding all components of the code to the third-party libraries and instead go via an encapsulating wrapper to avoid the pain of change? As an example, most of our PHP projects directly use log...
I'm working on a BlackBerry app, however I'm loading data from various 3rd party websites around the web. (E.g, posts from stackoverflow or currency rates off Yahoo.com) I'd like to know if this could cause any trouble, would it be allowed? Thank you!
Suppose I have a class (forgive the contrived example and the bad design of it): class MyProfit { public decimal GetNewYorkRevenue(); public decimal GetNewYorkExpenses(); public decimal GetNewYorkProfit(); public decimal GetMiamiRevenue(); public decimal GetMiamiExpenses(); public decimal GetMiamiProfit();...
IronScheme is mentioned on Wikipedia as a successor to a failed project called IronLisp, bringing Lisp to CLR and .NET, the way Clojure does for the JVM. Does anyone have experience with this language? It looks fairly complete (99%) but I'm not sure how to judge whether it's worth my time to fiddle with getting it set ...
I have been reading about different software methodologies. Every method has a design phase to some extent, more or less. I am not clear on what we mean by designing. Does this mean writing your thought process on how you will code the feature? Or it is a way of saying what you have coded or will code. The point where ...
I write utility programs (converters, compression tools, etc.) with simple UI’s, which I put for sale of for free download on the Mac App Store. I write these programs in English, and usually add a French localization (which I do myself). By comparing the distribution of sales per country between a localized app and no...
I am building a photography website and I want to allow the user to put tags on their photos for easy searching. But I'm not sure if I want the tags to be an nvarchar field in each picture and then search for that tag in each record or if I want to pull them out and create a separate table of tags and tagIds and then h...
I want to develop an app for a website (let's say stackoverflow.com in this case). Will I violate the Blackberry terms of service if I list an (paid) app for a website which I do not own? What about the website I'm going to use?
Newer systems such as OpenCL are being made so that we can run more and more code on our graphics processors, which makes sense, because we should be able to utilise as much of the power in our systems as possible. However, with all of these new systems, it seems as if GPUs are better than CPUs in every way. Because G...
Well, I basically understand how to use pointers, but not how best to use them in order to do better programming. What are good projects or problems to resolve involving the use of pointers so I can understand them better?
There are lots of academic papers on the merits of functional programming floating around. There's also a lot of debate that I see (on the internet) going on about the relative merits of imperative vs. functional programming. I'm interested to know if that debate extends in academia with actual published papers (the mo...
In an OO language (e.g. but not limited to Java) how do you fix duplicate code depending on the scope of it's occurrence? I would start with (for example) in the same class (scope) perform the Extract Method refactoring (fix) in classes of the same hierarchy (scope) perform Extract Method and Pull Up (fix) ...
I'm starting a new project in PHP, a plugin for a website that grabs additional data from it through cURL, getContents etc and re-tabulates it in excel. It's a local project, basic script like with a very limited UI. Iv'e been using Codeigniter and it's a great framework for websites, and even the Twitter application I...
I'm currently building a fun script, that basically matches given phrases and gives a predefined response based on the match-points. You can ask it to retrieve some information based on live feeds, run tasks, tell anecdotes or just chat with her. I already have built-in detection for badwords, caps lock or both. The pr...
I've been tasked with a solo project to investigate & resolve memory leaks in 8000 lines of Javascript code. I anticipate the project to take up to a month. Please recommend a development methodology I can use to structure my efforts. Prefer something light & easy to pickup and run with. Thanks
as a project manager or CTO how would I calculate the "time" it takes to develop a software system? For Example I would be responsible for developing a large web application in Java, MySQL, HTML, JSF. How do I correctly calculate how much time this takes? Prerequisites: I do not know the team that will do this job (so...
In my scenario, we have a team of experienced developers with 3+ years and they are not co-located. We are in a learning phase in terms of the domain and technology. I want some recommendations in regards to what software methodology we should adapt. I have thought of implementing waterfall, since we have to design up...
At a web startup, is it more common to have an engineer working the front-end AND back-end of the feature (basically in charge of the whole feature)? Or have engineers separated between the back-end and front-end? Which ones are more beneficial and for what situations? The downside, I've noticed, regarding having one e...
I will be mentoring a team of high school students for the FIRST Robotics Competition, most teams here develop[ their robot software using C++. For many of the students on the team this will be their first introduction to programming. I wouldn't have chosen C++ for teaching programming to high schoolers (e.g. Python or...
I work for a large government department as part of an IT team that manages and develops websites as well as stand alone web applications. We’re running in to problems somewhere in the SDLC that don’t rear their ugly head until time and budget are starting to run out. We try to be “Agile” (software specifications are n...
This is more of a design question and i was hoping to get pros and opinions on what makes sense. BACKGROUND Imagine something that holds one or more event listeners. Every now and then the thing fires events to its listeners. PROBLEM The problem is of course that listeners that follow after a listener that throws never...
I've made a 4-line bug fix to a minor issue in a library on github. The project is actively maintained with changes every few days. What is the ideal way to submit a fix that small? Is it to fork, fix and submit a pull request; file an issue and a pull request; or just file the issue with my fix copy-pasted? (Or somet...
I am currently creating my first iPhone app in Objective C and getting a lot of warnings because I've in many places taken advantage of the fact that Objective C is a dynamically typed language. I get a lot of 'class' may not respond to '-message:' warnings. Should I strive to remove all these warnings? If yes, then wh...
When you write a code to listen from a port, like 80 for example, what happens under the hood? Is the method the OS uses to listen is pull, or push? In other words, does the OS checks that port every x milliseconds for example? I just don't get it. The more I think about it, the more it seems to me that it can't be an...
Ok, so I am trying to learn front-end programming. Trying to figure out how javascript is a pain, and various projects (GWT, Coffeescript, Capuccino's objective/j...) are trying to fix this with languages that compile to JS. What would you do if you were to reinvent the browser? I think I would embed a VM rather than ...
I'm an 'okay' Javascript developer working on browser javascript and node.js. However because I'm self taught, starting from copying and pasting jquery, there are a lot of holes in my programming/CS education. I don't really have the time to devote myself to fully learning all the CS concepts that might be taught in a ...
As many of you guys know, concepts, C++'s approach for constraining possible types for a template argument has failed to be included in C++11. I learned that the D programming language 2.0 has a similar feature for its generic programming. Its solution seems to me quite elegant & simple. So my question is why C++ canno...
We have been working with a shopping cart for DotNetNuke, and have had endless problems with the developer's releases of their product. Every release fixes one thing but new bugs pop up elsewhere. I know that bugs are inevitable and that we cannot squash all of them at the time, but can someone please tell me what perc...
I'm a teen who has been programming for about 3 years, I can do some basic Software and so, but I feel I can't do all by myself. What can I do to find people interested in Programming ? None of my friends does, I only have a Cousin which is studying Software Engineering, but he is in another country. I live in Spain, s...
I have a server and many clients (around 50 clients) who connect to that server based on a web application, which is of course based on HTTP protocol, which in turn uses TCP/IP (correct me if I'm wrong, cause I'm not really good at networking). The problem is that, I should develop an alert mechanism, in which, when so...
I am working on a mobile application and I would like to ask you a question. Is there an API or a method to get/calculate the average speed that a car should have in a road. I am working on a GPS like application and I want to calculate the average time that it will take a user to cover a certain path. Thanks.
I am sure there's a name for this anti-pattern somewhere; however I am not familiar enough with the anti-pattern literature to know it. Consider the following scenario: or0 is a member function in a class. For better or worse, it's heavily dependent on class member variables. Programmer A comes along and needs functio...
In 1977, Maurice Howard Halstead introduced his complexity measures for software systems, which included measurements of the program vocabulary, program length, volume, difficulty, effort, and an estimated number of bugs in a module. According to Wikipedia, difficulty relates to the difficulty of understanding the prog...
Consider a parameterless (edit: not necessarily) function that performs a single line of code, and is called only once in the program (though it is not impossible that it'll be needed again in the future). It could perform a query, check some values, do something involving regex... anything obscure or "hacky". The rati...
I understand that when we try to implement swarm intelligence, it basically has multiple independent units communicating and with each other. What I am unsure of is if swarm intelligence an extension of artificial intelligence or if it is a discipline in and of itself.
As a player, I found the following problems about creating and using "extensions" (aka mods) for games: 1) Whenever the game is updated, all the mods break. 2) Most mods don't work with each other, so the player "has to choose" 3) If you ever de-install a mod, your "saved games" almost always become unusable. I want ...
One of the languages I have to use at work is a very small, niche language called psl. One of the largest complaints I have about it as a language is that the libraries are very limited. While that's understandable for a small language developed by a couple of guys, it does cause me some dilemmas. Specifically, I find ...