instruction
stringlengths
34
19.9k
Is a pointer pointing to 0x0000 the same as a pointer set to NULL? If NULL value is defined in the C language, then what location does it physically translate to? Is it the same as 0x0000. Where can I find more details about these concepts?
I have a sort of blog application that I'm working on for constrained writing. The posts have several types, and share some columns in common (title, body for instance), but they also have columns that they don't share in common. Please correct me if I'm wrong, but I feel like my two database design options are: Crea...
I am yet another Subversion user struggling to re-educate myself in the Tao of distributed version control. When using Subversion, I was a big fan of the project-minor approach, and, with most of my former employers, we would structure our repository branches; tags & trunk as follows: branches-+ +-personal-+ ...
So In my app, I have a bunch of images. And in order to keep the app size down, I could store those images on my serve, and just download and cache them as needed. But my question is, will that hurt user experience? Is it likely an iOS user won't have internet access while using my app?
By "enterprise ready" I am referring to availability of tools: dependency management, build management, message servers, databases, application platforms and servers, and are secure and scale well? For example, is there a lisp (or ML) alternative to j2ee? Please exclude FP's ported to JVM or .NET CLR. EDIT: I know tha...
Do web pages load faster or load slower when all headers, footers and basic functions are placed in external files and called using the statements below? Are there any other benefits to separating such content? <?php include("includes/functions.php"); ?> <?php include("includes/header.php"); ?> <?php re...
Is it considered bad practice to throw NotImplementedException for code you haven't written yet? Possibly TODO comments would be considered safer?
I've written a class that manages recipients on a MailChimp list, called MailChimpRecipient. It uses the MCAPI class, which is an third-party API wrapper. http://apidocs.mailchimp.com/api/1.3/ http://apidocs.mailchimp.com/api/downloads/ I pass the MCAPI object into the constructor of the MailChimpRecipient object, so I...
I've inherited a custom made authentication system that needs some refactoring. I'm not quite sure what the best way to split it up the password section and could use some help. The password class(es) need the following functionality: Check to see if a password conforms to restrictions. It needs to be able to provid...
What is the best way to ensure that programmers ask for help when they get stuck on a problem, rather than spending too much time trying to figure something out when they've hit a wall? I'm especially interested in how to optimize this with a distributed team. Some ideas that come to mind: pair programming co-locating...
As a digital security consultant when is it 'ok' to use tools someone else made (dumb to reinvent the wheel, right?) and when should I make my own?
I have recently become curious about open source licenses. I have a question about the LGPL. I created a Java web project and built it as a WAR package. Can I add LGPL jars to this WAR file?
My friend and I have started to try to collaborate on some projects. For background, I come from a PHP/Wordpress/Drupal coding background, but recently I've become more experienced with the RoR framework, while he is more experienced as an HTML/CSS designer, working with PHP and WordPress. We're both relatively new to...
Even though Ruby on Rails seems to be the most popular with the most job openings, is there a compelling employability reason to learn django for example? Maybe because everybody's learning RoR and there's a shortage of django developers in relation to the demand? Or is php along with a popular php framework the way ...
I am working on a Javascript Web App & I am finding as I expand the program & add new features(new animations) it causes existing features to break or work differently than prior to adding that new feature. So as I continue to finish the app, it keeps breaking old features & I have to go back & redo/update those featur...
I've read the article about fixing bug in this post What process do you normally use when attempting to debug a problem/issue/bug with your software?. One of the answer which I noted is "take a rest" when you have spent too long to try to fix the bug. I believe it is a good idea too. But sometime I am in a tight deadli...
I'm a growing programmer who's finally putting unit testing into practice for a library that I'm storing on GitHub. It occurred to me that I might include the test suites in the repo, but as I look around at other projects, the inclusion of tests seems hit-or-miss. Is this considered bad form? Is the idea that users ar...
I'm putting together a spec for a REST service, part of which will incorporate the ability to throttle users service-wide and on groups of, or on individual, resources. Equally, time-outs for these would be configurable per resource/group/service. I'm just looking through the HTTP 1.1 spec and trying to decide how I w...
A linked list can be used when you want cheap insertion and deletion of elements and when it doesn't matter that the elements aren't next to each other in memory. This is very abstract and I would like a concrete explanation of why a linked list should be used rather than an array. I'm not very experienced with program...
I forked a project that hasn't been maintained for a while now. I have a lot of changes I'd like to implement and want to actively maintain the project and keep it open source. How does the licensing work for situations like this? The original project is licensed under MIT and I would like to keep it that way. Would I ...
I got this question in one of the interviews I took. I started by explaining that it is like a set of rules that should be followed while moving resources around, but I did not feel convinced. Is there any other analogy or take on this question ?
Just going out on a limb here. Is doing a code review by sampling a few classes and units of code by a developer good enough to judge what he has done wrong to provide inputs? This is just in case you are pressed for time and can't review every single line written by them. I am working on the assumption that the develo...
I would like to ask members of the community about the role of Configuration Manager, as you see it. I'm not asking what Configuration Management is, as long it had been asked before. What I need to know is: What tasks do you think Configuration Manager should perform (or performs) in your team? What is primary respo...
I have a program which has a GUI and performs some very heavy mathematical computations for a couple of minutes and then outputs a result. When I try to directly interface it through its DLL's, it runs fine, but it doesn't run at 100% CPU usage like the GUI does. Why is this? I understand the reason why computational h...
Are there any substantiated recommendations how many testers a team should have per programmer? I'm more interested in opinions referring to an old-school development approach (no agile stuff) and larger projects. Sources are welcome.
We are introducing a master / slave replication schema in our web application. At certain scenarios we would prefer to explicitly direct reads to a slave and writes to the master, which to me is an obvious advantage of the schema. Instinctually, I'd prefer for the switch to happen somewhere in the ORM, we use Doctrine ...
Well, I've just started doing puzzles and it's so annoying to see puzzles which are easy to do but also need to handle very large numbers. That's the problem. Say I have to deal with numbers like 10 ^ 6 / 2147483647 / etc. Need to do arithmetic operations on! However, I feel that these shouldn't be handled in brute for...
I was reading through Oracle's introduction to OOP concepts and I came across this description: Real-world objects share two characteristics: They all have state and behavior. Dogs have state (name, color, breed, hungry) and behavior (barking, fetching, wagging tail). Software objects are conceptually similar to...
I know this is hard to answer without examples, so I'm looking for general principles or guidelines here. I'm thinking within the realm of small- to medium-sized mobile games and apps. I've read a few times the object reuse is a touchstone of creating efficient programs. So, I generally strive to reuse everything possi...
I'm trying to really understand how exactly a high-level language is converted into machine code and then executed by the cpu. I understand that the code is compiled into machine code, which is the low level code that a CPU can use. If I have an assignment statement say: x = x + 5; y = x - 3; Does the CPU execute each...
When searching the web for a solution to a particular problem, I often find a perfect solution posted on someone's blog, or in a public repository (GitHub, Google Code). Most of the time, the code has no copyright information, nor does the author mention any sort of attribution rules. I'm pretty sure short snippets ar...
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 ...
I am looking for a good way to rate the expertise in a particular programming language. The idea arose when I found the following article: Taking falsely all the credits? You don't know JavaScript. It lists, in a comprehensive way, language features and concepts of JavaScript. I wish there would be a list for every pro...
I talked myself into a hole at work, and I need some good ideas to help me better describe why we should include both Dojo and Knockout in our new web project. A little background: I do mostly computer-computer interactions when I program; updating states, reading/writing to the database -- Knockout is exactly where I ...
I am curious about the Google Closure Compiler. Why did they name it that? Does it have anything to do with lexical closures? EDIT: I tried researching it in the FAQ and documentation, as well as doing Google searches such as "closure compiler name". I couldn't find anything definite, hence the reason I am asking. I do...
It seems that as experience with the specific set of tools you have to work with grows, the incentive to try out new things weakens. When I was new at this programming job, trying out new things, researching online, made me more productive, because I often found a way (or library) that made the task easier that the cod...
So I have including the files to my projects by simply : #include "myheader.hpp" and adding the headers into the solution explorer. But recently I have realized that I may omit the step of adding the headers to the solution explorer because it does not change anything. The only important fact is to define proper includ...
I have two business classes: TimesheetDay and TimeSlot. One TimesheetDay can have one or more TimeSlots. The TimesheetDay and TimeSlot classes will be dependent on an object that implements a corresponding TimesheetDayData and TimeSlotData interface. That way, I can write data classes to map the objects to a MySQL data...
Almost all questions and information on both SO and "Google" describes how different licenses works and what license to choose for your work? But how do they work in reality. Almost everyone I have spoken to have vastly different thoughts of how they work, including hard core open source developers that gladly share t...
I am trying to learn creating apps for IPhone and IPad, apps like database oriented websites where user can save their data. I am a normal php programmer and use only Windows PC. Any good tips that you guys can suggest me to begin with would be highly appreciated. Thanks!
Quite a few of my friends want to have their own personal website to showcase their talents. However, they don't want to deal with such technical things as writing html and managing web server. Neither do I. It would be nice that we go to our URL and view our pages and we edit and update our information when logging i...
I'm in the process of designing the access control portion of a moderately complex application, but I feel like I'm re-discovering a lot of wheels. Does there exist a good overview of the "access control" domain, including terminology, discussion of the tradeoffs of different schemes (RBAC, ACL, ???), how it interacts ...
I am throwing this question out to the 'greater creativity' for some suggestions on search methodology that might solve this problem. I have come up with a somewhat contrived example to attempt to explain the problem well enough that some solution(s) might be recommended. The problem: We are using a relational DB (MSSQ...
I've been doing quite a lot of refactoring of C++ and C# code recently, and found that 90% of the patterns I use are: Template method Factory Singleton Are these generally the most commonly used patterns in refactoring or is it just me? Can you share your refactoring experiences?
It's unclear to me what the format is, if there's systematic/command-line requirements for creating it, etc. Basically, just to need to know the specs, and if there's technical steps for generating the README file.
I recently discovered Design by Contract (DbC) and I find it an extremely interesting way to write code. Among other things, it would seem to offer: Better documentation. Since the contract is the documentation, it's impossible for one to be out of date. Additionally, because the contract specifies exactly what a rout...
I've been thinking about an application that I want to develop for a while now. In short, I want this application to perform some crud operations. The application will be for a law firm so overall security is going to be very important. My primary programming language is php but I wouldn't mind learning some Java or po...
At my company, we have your typical svn structure. Each project has branches, tags and trunk. repo -Project A * trunk * branches * tags -Project B * trunk * branches * tags -Project C * trunk * branches * tags -Project D * trunk * branches * tags -Application 1 * trunk * branches * tags So Project A ...
In Javascript there are a few clearly prominent techniques for create and manage classes/namespaces in javascript. I am curious what situations warrant using one technique vs. the other. I want to pick one and stick with it moving forward. I write enterprise code that is maintained and shared across multiple teams, a...
I realize this sounds silly. Let me explain: I just came across this page about using CSS elements to create shapes- square, circle, triangle, star, yin-yang (yin-yang!), etc. using pseudo elements. Having struggled with HTML5 Canvas drawing in the past, I immediately thought that some combination of JavaScript and CS...
According to answers I've seen on stackoverflow, stored procedures (and to a lesser extent db functions) tend to perform better vs. LINQ + ORM frameworks (e.g. Entity Framework). I want to determine if the performance difference is large enough to justify an increase in development time, assuming it takes more time to...
I'm currently reviewing a system built by some developers that previously worked at my job. The system works pretty well from a user's point of view, but when delving into code review it's a utter mess. I'm more than convinced that the way the application is built won't hold up for future updates, let alone high increa...
I was recently assigned a task of managing a small project. The project has some technological aspects but the job is mainly doing managerial things: scheduling, making sure people do what they are suppose to, going to a lot of meetings, etc. Basically, it's not how the average programmer or even a team leader would li...
I am dealing around with C# .Net for almost around a year now. I got lots of experience (I owe most of it to guys at stackoverflow). Now I am thinking to start working with C++ as well. Mainly because I would like to be able write codes resulting in applications that are not .Net dependent so they can be executed in mo...
I was building an application in .Net for almost a year (almost alone), I took the decision to build it with a 3-layer design. Recently when finished the project, I analyzed if the effort of creating this application with layer design in mind really compensate for the "benefits" obtained implementing such design. Out o...
According to this article from the BBC and this post on Microsoft's Exploring IE Blog, Microsoft has planned to automatically upgrade Windows XP, Windows Vista, and Windows 7's IE to the latest version. Microsoft has stated that they will also allow people to opt-out of this update through the use of the The Internet E...
I'm a PHP developer who started with CodeIgniter. In it, designing models was easy: it seemed like each method defined in models was the equivalent of static methods in a normal, objected-oriented environment. I tried FuelPHP, which has an built-in active record style ORM, and PHP ActiveRecord to use with CodeIgniter. ...
I have "logic engine" which executes set of user configured steps. These steps are saved in the database as "Step" entities. The engine gets the first step and then executes steps until there are no more steps to execute: public void Execute(details, data, Step firstStep) { var step = firstStep; while (null != ...
We need to do some user documentation for a product we have been working on for the past few sprints. We are now starting a new project in the next sprint and the PO is making the documentation for the product produced previously a User story for this sprint. I am just wondering your opinion on this approach. Personall...
It's 2012! Mercurial and Git are both still strong. I understand the trade-offs of both. I also understand everyone has some sort of preference for one or the other. That's fine. I'm looking for some information on level of usage of both. For example, on stackoverflow.com, searching for Git gets you 12000 hits, Mercuri...
I'm building an app that I think would benefit from the use of MySQL stored procedures. I know stored procedures have a bad reputation, but I think they suit my application well. Using stored procedures would reduce the number of queries per request significantly (mostly inserts), as well as allow me to leverage the pr...
I have two books geared toward learning JSP. From what I've read, one motivating feature/benefit is that it is easier for web designers (they apparently don't, as a rule, know Java) to work with dynamic pages via EL/JSTL. From what I've seen so far, learning EL/JSTL requires a basic understanding of Java. I have yet to...
I have an interview coming up soon next week and there's a few things on their list of responsibilties for this software development job (the job position title is vague, it says java developer) that I am worried about: Unit test features Debug new features Provide recommendation on test case design (what is this?) I...
How does one prevent users from creating erroneous input sets, when there is no practical way to vet the input? The scene I modify a small ERP package written in Visual FoxPro. One part of the package concerns itself with printing truck manifests and invoices to be sent with the drivers on their delivery routes. The ...
I have an interview for a C++ internship position. Now, the thing is I've taken two out of three quarters of the basic CS classes (in C++) at my community college and we covered the basics up to arrays, pointers, linked lists, recursion, etc (basically all of Walter Savitch's Absolute C++ book). I spoke to the intervi...
The problem I have, is that most of the C++ books I read spend almost forever on syntax and the basics of the language, e.g. for and loops while, arrays, lists, pointers, etc. But they never seem to build anything that is simple enough to use for learning, yet practical enough to get you to understand the philosophy an...
I've recently started to work on some iPhone apps, starting from a base where I had essentially no programming experience (I studied Maths & had very few programming modules) I worked my way through Beginning Mac Programming: Develop with Objective-C and Cocoa and found it useful, while it gave me the feeling that I ne...
When I began to use parser combinators my first reaction was a sense of liberation from what felt like an artificial distinction between parsing and lexing. All of a sudden everything was just parsing! However, I recently came across this posting on codereview.stackexchange illustrating someone reinstating this distin...
I'm having trouble determining what I might put in the body of a response to an OPTIONS request? are there conventions? standards? What do you put? do you just provide a list of other METHODS? should you give the representation?
Web developers code in a minimum of four languages (HTML, CSS, JavaScript, and a server-side language), must produce a working result in several different browser implementations, and may work on the top of a custom software stack that they don't control. How should a code review take these things into account? Should...
I'm a first-year PhD student in Ireland. My background is in mathematics, though I'm going to stream my career into programming with Python, Java and C++ languages. I have some good experience with C++ what allowed me to have a presentation in Europe quite recently - I participated in an open-source cloud computing pro...
Let us suppose we have a set of functions which characterise something: in the OO world methods characterising a type. In mathematics these are propositions and we have two kinds: axioms and lemmas. Axioms are assumptions, lemmas are easily derived from them. In C++ axioms are pure virtual functions. Here's the proble...
Possible Duplicate: What to plan before starting development on a project? I was wondering when you start developing a software what process should you generally go through to do it? By this I mean after you get an idea, do you just sit down and start pushing out code directly, or is there some planning process that...
I'm creating a simple MVC at the moment and am wondering if it's 'correct' to be able to call any model class directly from the controller to get the data to send to the view? I have the following folder structure: .htaccess index.php /controller /model /templates I also have the needed model classes within the /model...
We are thinking of doing Continuous Integration with nightly builds here. Some of our sticking points is when to do code reviews. Is anyone out there doing Continuous Integration with nightly builds AND doing code reviews? If you can give a brief outline of your process that would be great. For example, here's what...
I keep getting the following question in interviews; and judging from the reactions I've gotten, I'm not giving the best answer. "What methodology do you use for developing user interfaces?" Which seems like a rather broad question. Besides dividing work between markup, stylesheets, and javascript (control logic), what...
Some context for thisi question: it is not about development time over the entire iteration of development, but just the stage of deploying changes from dev to prod environment. "LINQ" here really means LINQ, ORM, or C# where T-SQL would otherwise be used. And here "stored procs" is just a general term that encompasses...
I am new to ASP.NET MVC and EF. I read about open source implementations of MVC pattern like Spring, FubuMVC, Castle etc. I want to know how flexible these alternatives are when compared with ASP.NET MVC. Which one is widely used and whose help is easily available on the NET?
I'm VB.NET user and now learning LINQ. The book I'm reading now focus on LINQ 2008 VB.NET. I want to know whether there are changes/improvement in LINQ 2010? p/s: I'm reading this book: Pro LINQ Language Integrated Query in VB 2008
For example, I've got a root object exposed in a SOA service, say Invoice (Invoice has line items as children). Sometimes, I need to retrieve its detail line items. I'm thinking to make it lazy loading, because it's a traffic overhead to transfer line items every time Invoice is required. But in SOA fashion, it seems ...
I am talking of stuff related to programming only and not system or network administration. I am about to finish college and get a programming job, so I am interested to know about this. Although this may seem a subjective question, I think this is not quite and falls in the category of best practices. I don't think a ...
I'm looking at a programming language design decision that's difficult to make precisely because there seems to be no objective basis for choosing one option over the other. The question is, given that a language doesn't have a ++ operator, would the better choice for an increment operator be as in C: a += 1 a += b or...
In OO programming, what's the preferred way of handling multiple instances (objects) of a single class? Say you want to write a program where a random number of circles get drawn on screen, where every circle is an instance of a Circle class, and when you click a button, every circle changes color. How would you do tha...
I'm a student and I've been programming for not very long. Particularly, I'm learning CodeIgniter framework - The book I'm reading is "Professional CodeIgniter". In the book, the author mentioned Agile Methodologies ( and I find it somewhat little bit difficult to understand ). I want to know if it is essential to lea...
From a security perspective, the special characters like '&' or <b> are a big no no in URLs and query strings. I could find the articles that explained the ways to bypass this restriction, but could find something that explained with example how can this be a security risk. Please explain the risks of these special cha...
I am a Hobbyist Java programmer and I would like to further my programming skills by learning C or C++ and Python. I have read many C vs C++ articles but none of them contain the information I'm looking for. I would like to know if it is better to learn C or C++. In most articles I read most people recommend C++ sayin...
I'm currently in the process of what I hope to be a career change into the programming field. Despite my wide range of knowledge in the field and additional exposure to concepts in college (which in the end left a lot to be desired), I feel I might be missing out on what really matters when appealing to employers. I f...
I'm creating a UI table component that returns an array of selected indices. Some typical return values would be var myRetVal1 = [0];//one value selected var myRetVal2 = [0,1,2,3,8,11];//multiple value selected as you can see I'm always returning an array. I had an idea to return -1 when nothing is selected, but the...
I have an environment that supports both dictionaries (json style) and databases (not relational or anything, just formatted data by row and column). My application doesn't really need database functionality, butI'm somewhat more comfortable with the database system than I am with dictionaries. Is there a major perform...
There are several podcasts with lectures from universities. I am looking for "other" podcasts. So are there any non-lecture podcasts about compiler development?
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 t...
I have a member class which stores the IP, and ports used on that member. Another class P2P stores a list of all the members currently in the network and provides join,leave functionality. What kind of relationship will exist between them in a class diagram?
I am trying to spend as much time as I can on GitHub nowadays (even I am the only person in team at work) to really feel how it is going to be like for a real world corporate application. One question I am having is to controlling the version. Let's say we started a project. Then, team members created some branches and...
Possible Duplicate: When to use abstract classes instead of interfaces and extension methods in C#? When I read and looked at codes using Abstract classes, I was able to justify it because it allows you to add common methods for any subclasses extending the abstract class. So for example, if objects behavior is simi...
I work for a small company that has had a product development department for quite a while. What we haven't had, however, is a QA/testing group. We are looking to add a testing group, but are struggling to determine where best to put them in the organizational structure of the company. Specifically, we are going to hir...
My understanding is that one of the key features of a B-Tree (and a B+Tree) is that it is designed such that the size of its nodes are some multiple of the block size of whatever media the data is stored on. Considering that, in a memory managed language like java/c#, we don't really have access to how, when and what o...
I'd like to hear some ideas how to sync calendar events. Say I have two calendars having fields (id, title, start, end, updated, location and description). I'm struggling with starting point. Its easy if all events are new and not overlapping with each other. But say I already have events on calendars, some are suppose...
I am reading the book The Elements of Computing Systems: Building a Modern Computer from First Principles, which contains projects encompassing the build of a computer from boolean gates all the way to high level applications (in that order). The current project I'm working on is writing an assembler using a high leve...
Possible Duplicate: Why does it matter that HTML and CSS are not programming languages? As I understand a programming language is something that can be used to solve a problem/perform an alogrithm. Then someone just said to me "I programmed a website using HTML, JavaScript, and CSS", and my immediate reaction was HT...
I am aware of several tools/services that provide DVCS browsing and management such as Bitbucket, Github, Kiln, SCM-Manager and Rhodecode. However, the use case I am considering is one such that: Any source code must reside on an employers internal servers. The solution must be open source. It should provide a Bitbuck...