instruction
stringlengths
34
19.9k
I have recently started using require.js (along with Backbone.js, jQuery, and a handful of other JavaScript libs) and I love the module pattern (here's a nice synopsis if you're unfamiliar: http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth). Something I'm running up against is best practices on i...
I have a project. The server which based on a phone PCI-board is responsible for received phone calls from the customer and then redirect the phone calls to the operators. I have decided to code the server using c++ programming language and qt framework because the PCI-board SDK's interface is c/c++ originated and fo...
How can I measure the performance of my C++ programs using C++? Specific metrics I want to measure are: Memory used (space) Duration taken (time)
A while ago I started to create a winform application and at that time it was small and I did not give any thought of how to structure the project. Since then I added additional features as I needed and the project folder is getting bigger and bigger and now I think it is time to structure the project in some way, but ...
Caveat: I am a political science student and I have tried my level best to understand the technicalities; if I still sound naive please overlook that. In the Symantec report on Stuxnet, the authors say that once the worm infects the 32-bit Windows computer which has a WINCC setup on it, Stuxnet does many things and tha...
I'm doing a research on formulating a requirements analysis model as a stage of requirements engineering for mobile-application development by considering the limitations and the needs of it ( agility and etc.. .), what I'm trying to figure out is that which parts of this process (requirements analysis for mobile deve...
I was thinking about issue tracking software like Redmine, Trac or even the one that is in Fossil and something hit me: Is there a reason why Redmine and Trac are not possible to be distributed? Or maybe it's possible and I just don't know how it's possible? If it's not possible, why? By distributed I mean like Faceboo...
For fun and by request I am updating this ImageGrid component, a kind of listbox for images that has a FileNames property of type TStrings. For ease of writing, I have been misusing its FileNames.Objects property for bitmap storage. But since the TStrings type suggests that users of the component could or would want to...
How can I explain C# interfaces and constructors to a 8 years old genius kid?
Dear All, I am working for iOS application developement. Now am considering to go for certification in iOS application development. I am thinking about expertrating.com. Please guide me if you know any other certification in iOS development with more market value of the certification. Thanks in advance a...
Background I am recently in the process of enduring grueling tech interviews for positions that use the .NET stack, some of which include silly questions like this one, and some questions that are more valid. I recently came across an issue that may be valid but I want to check with the community here to be sure. When...
How should I comment a method? What are the best practices on commenting code? Example: /* Checks if a color is allowed in a given point * of the bitmapdata of the current floor * @param value - color to be checked * @return boolean - if color is allowed returns true, else, return false */ private function isAllowed(v...
For example, ISerializable and the Serializable Attribute are both in the System.Runtime.Serialization namespace, but not the assembly of the same name. On the other hand, DataContract attributes are in the namespace/assembly System.Runtime.Serialization. This causes confusion when a class can have using System.Runtime...
Thanks all for your help before. So, this is what I came up with so far, the requirements are, application has two or more threads and each thread requires a unique session/transaction ID. is the below considered thread safe? thread 1 will register itself with get_id by sending it's pid thread 2 will do the same then ...
I hope this post isn't too "Fringe" - I'm sure someone will just kill it if it is :) Three things made me want to reach out about this now: Decoupling is so in the forefront of design. TDD inspires the idea that it doesn't matter how a program comes to exist as long as it works. Seeing how often the adapter pattern is...
I had always thought that the "head" of a queue as the next element to be read, and never really questioned that usage. So a linked-list library I wrote, which is used for maintaining queues, codified that terminology: we have a list1_head macro that retrieves the first element; when using this library in a queue, this...
Program slicing is one of those software technologies where there is much more activity in the research community than in the industry community. Does anybody outside of the research community using slicing tools on production code to help with debugging or other tasks? If so, what tools did you use?
I have been looking around on the internet and have not found a good answer yet. If anyone could be so kind and supply a code sample I would greatly appreciate it. I apologize for the simplicity of the question.
Given the standard North American phone number format: (Area Code) Exchange - Subscriber, the set of possible numbers is about 6 billion. However, efficiently breaking down the nodes into the sections listed above would yield less than 12000 distinct nodes that can be arranged in groupings to get all the possible numbe...
I have a destination repo that is remote and I have a source repo that is also remote. I would like my local machine to act as a proxy to allow me to push to the destination from the source without ever download the repo to my machine. Is this possible?
I have the following problem scenario: I have a text file and I have to read it and split it into lines. Some lines might need to be dropped (according to criteria that are not fixed). The lines that are not dropped must be parsed into some predefined records. Records that are not valid must be dropped. Duplicate reco...
I am currently publishing a paper on skin detection. However, I need to find the appropriate histogram bin size for each colorspace. I recently came upon a paper that published what it found to be the ideal bin size. The paper can be found at: http://www.inf.pucrs.br/~pinho/CG/Trabalhos/DetectaPele/Artigos/OPTIMUM%20CO...
Is there a preferred/recommended Internet Media Type for RESTful POST requests? For example, if I want to add a new user, should I send the data as a URL encoded string like: name=Foo&otherData=Bar or does REST recommend I send the data as whatever format the response is going to be sent as (e.g. JSON/XML)? <user> <...
Why were frames removed in HTML5, but not iFrames? After all, there is almost no difference between the two. In many instances using either of them would give the same output (pardon me if I am wrong)?
I'm in the middle of a project and I was asked to write UML diagrams (use cases,class diagram,etc). The project isn't very complex. I was wondering if this be a waste of my time? Should I just be doing other fun stuff like writing code? And when is it not ok to build something without going through all of the conceptu...
I have a project that needs Hibernate jars. I added them as dependencies in the pom.xml and Maven compiles my project well. However, in the IDE, all annotations and calls to Hibernate API are marked as unresolved (red). How could I get IntelliJ being able to resolve them ? Is there a way to use Maven when I click on Bu...
Just like the question asks, is there a need to add Debug.Assert into your code if you are writing unit tests (which has its own assertions)? I could see that this might make the code more obvious without having to go into the tests, however it just seems that you might end up with duplicated asserts. It seems to me th...
Possible Duplicate: How many developers before continuous integration becomes effective for us? I'm new with continous integration though I have used it without know the term. So, I'm interested about the mechanism can be possible to implement and my question is: can a continuous integration server be useful for a t...
I have a project A (a webapp), depending on project B (B.jar) and this one depending on project C (C.jar). I would like to create a maven goal named "Rebuild War", that clean all compiled code for these 3 projects and rebuild the whole in order to obtain a fresh War file. I tried mvn clean package on project A, but I n...
Every one of us make errors leading to bugs. Once I wanted to start logging my errors for future analysis, probably mentioning project title, approximate time spent and the most important, the type of error. For example when I copy-pasted a fragment about 'x' and replaced every occurrence of 'x' with 'y' and forgot to ...
I recently had to update an abstract base class on some OSS that I was using so that it was more testable by making them virtual (I could not use an interface as it combined two). This got me thinking whether I should mark all of the methods that I needed virtual, or if I should mark every public method/property virtua...
In reference to broken windows, are there times when refactoring is best left for a future activity? For example, if a project to add some new features to an existing internal system is assigned to a team that has not worked with the system until now, and is given a short timeline in which to work with - can it be ever...
I have noticed something in my code in various projects that seems like code smell to me and something bad to do, but I can't deal with it. While trying to write "clean code" I tend to over-use private methods in order to make my code easier to read. The problem is that the code is indeed cleaner but it's also more dif...
I'm finding it very difficult to write complex SQL queries involving joins across many (at least 3-4) tables and involving several nested conditions. The queries I'm being asked to write are easily described by a few sentences, but can require a deceptive amount of code to complete. I'm finding myself often using tem...
We are a company and we want to use 30% of the BSD opensource software to plug and play it with our source code, can we do that. Further this program will not be distributed and only will be accessed by our clients using our own software. Is it possible for us to do the above without any restrictions. Kindly give me f...
What's the best way to review a code before it's committed to the SVN trunk? One idea that I am thinking of is to having the developer to commit his code to a branch and then reviewing his code while merging the branch revisions into the trunk. Is this a good practice? If not, what else could be done to review a code b...
I'd like to know, why would I want to have a special prefixes for a function arguments, like "p_name", "p_age", "p_sex"? On the one hand it helps to distinguish parameter from local variable or field further in the function body, but would it help? On the other hand, I didn't saw such naming recommendations anywhere in...
Today I was asked this question during an interview: What will happen if we do not override the hashcode method for our class, then add it to HashTable and then try to get objects? What could go wrong?
I've been under impression, that monkeypatching is more in quick and dirty hack category, rather than standard, good programming practice. While I'd used from time to time to fix minor issues with 3rd party libs, I considered it temporary fix and I'd submit proper patch to the 3rd party project. However, I've seen th...
I am developing apps on my sparetime. I am the sole developer, and two non-programmer friends of mine provide vision, content, algorithms and ideas. We always agree happily on all the features, todos and prioritizations. But naturally, coding it is the biggest part. When selling, we agree on splitting profit equally, t...
In many User Interface libraries, we have concept of views and subviews. so according to MVC pattern every view should update the model as soon as it changes. For that view should have a reference of its model. If we have a subview and it does some calculation, then should that model also be passed to the subview or p...
I'm using CSS3 for the first time, but using specific styles with prefix for each browser looks strange. The need of using -moz-, -o-, -webkit- and another prefix turns the CSS bigger and harder to maintain. I want to know if the browsers are implementing some standardization to avoid the usage of prefix for styles.
Would a competent asp .net C# developer be disregarding a lot of their skills in order to have more concern with configuration and server-side coding when moving their career into the sharepoint 2010 arena? Or is asp .net C# in fact just a good base to begin the study of sharepoint on?
In this Stackoverflow anwer I dimly recall being taught that it's better to use as "wide" a condition as possible to terminate a loop, rather than testing for an exact termination condition. i.e. use: while (x < 10) rather than while (x != 10) however I cannot recall (or find) any formal basis or rationale for this....
I have some trouble getting a good folder structure in my project and i would like to know what other ways i could use to structure my files. I'm currently working in an MVC sturctured folder. www/ Controllers/ Models/ Views/ Nothing special so far. But i'm also using an ORM system. With it i can easily get an '...
It seems to me that the list terminator in Lisp could be any arbitrary value. For example, the string terminator in C is the null pointer. Is there a philosophical reason why the empty list was chosen to terminate lists?
I have worked in software development for over 10 years now, and it's dawning on me that I rarely get to create anything "new". I realize that "new" is a vague term, but I would define it as anything from an obvious new large-scale project to a new large feature in an existing project (say something that would require...
A little background. A developer I used to work with insisted on disabling Tempdata and using Session Flash for passing data in the return view. Question is, is there any advantage to doing it this way? using a flash message is great for returning data to the user but I've had headaches with passing data from one...
I'm working on a new programming language, which determines structure with indentation instead of braces in the manner of Python and CoffeeScript. Obviously placing lines indented with spaces next to lines indented with tabs will mess up that kind of syntax, so I'm disallowing that - any given source file must use one ...
I'm nearing the end of a prototyping/proof of concept phase for a side project I'm working on, and trying to decide on some larger scale application design decisions. The app is a project management system tailored more towards the agile development process. One of the decisions I need to make is whether or not to go...
I was reading about software inspection in Software Engineering by Ian Summerville and I came across the term Software inspection and I started reading about it on Wikipedia. I am unable to understand what is the difference between verification and software inspection?
I am developing desktop based GUI (single form) using wxPython and loads it using remote citrix access from client private network. Suppose, the GUI has certain group of select and text boxes which are loaded together when application starts. The value of select boxes come from database and on the basis of selection of...
I would like to organize my company's software releases by platform. I've looked at how Mozilla, Perforce, and Apache organize their releases, and it seems that I should partition by OS and processor architecture. I was thinking of something like this: Linux (x86-32) Linux (x86-64) Neutrino (x86-32) Windows (x86-32) W...
I'm coding in C++. I have a server that will have clients connect to it, and each client gets spun off into its own thread for communication. This server is hosting a game, so there is information that must be shared between all client threads, as well as any other threads I choose to spawn off. This data is like level...
I would like to group a population based on two criteria. I will use an analogy to simplify my question. Let's say I want n number of groups. I want to populate those groups based on person's age and weight, so that all groups contain about the same total age and are evenly distributed by weight (so that there are abou...
I'm not asking from a business sense exactly, but for example, both reddit and Twitter are completely open source. It is my understanding that at least the large majority of their profit comes from advertising on their website. So what exactly is to prevent someone from copying their code and making their own website...
I find whenever I work with GUI code, the code tends to bloat faster then other kinds of code. It also seems harder to refactor. Whereas in other kinds of code I can refactor pretty easily -- I find I can decompose a larger class into smaller pieces of functionality -- with most GUI frameworks I'm often bound to a fram...
I have been reading about MapReduce for a while -- but what I can't understand is how someone would make a decision to use (or not use) MapReduce. I mean, what are the problem patterns that signal that MapReduce could be used.
When I learned the C++ language for the first time I learned that besides int, float etc, smaller or bigger versions of these data types existed within the language. For example I could call a variable x int x; or short int x; The main difference being that short int takes 2 bytes of memory while int takes 4 bytes, a...
We've been having constant requirement changes of having to choose which graphic rendering library to use for our project. In a team of about 10 members, two of us are exploring the new graphic library. The team lead expects that we learn what's necessary within 2 days and introduce it to the rest of the team (wants ...
Background Recently, I have been fascinated about the possibilities of dataflow-based programming approaches - in particular, signal/event-based concepts as realized by functional reactive programming, Boost::Dataflow::Signals, and the like. Sample scenario: Consider a car that has four speed sensors, one at each of it...
I have a ASP.NET web based application that allows the end user to export data to a flat file format. (essentially taking a point-in-time backup of their work) At a later date they can re-upload (import) that data back into the web application. The actual format of the backup is pretty trivial. An object graph is seria...
I am working on a web application which operate with different types of objects such as user, profiles, pages etc. All objects have unique object_id. When objects interact it may produce "activity", such as user posting on the page or profile. Activity may be related to multiple objects through their object_id. Users m...
A situation that has arisen several times in open source projects goes like this: I notice a bug in our deployment, and figure out a quick hack patch. (For example, simply commenting out code that we don't actually need.) I spend a little bit of extra effort to figure out the real bug, come up with a patch, and submit...
We have various projects in source control for web and desktop applications. Invariably, many of them use third-party open source projects or even common libraries within our organization as dependencies. Should we include the full projects of these dependencies in our various solutions? Or should we just include the ....
I'm starting to check in the SQL files for creating/maintaining our database. Previously SQL files were kept totally separate from our codebase's version control. I'd like to pragmatically store my database construction/manipulation files with my other code. Do they make the most sense in a subdirectory of my Models or...
I just wrote my first SAX-based (Java) XML schema validator, where you pass it a schema URL (pointing to the .xsd file), and an XML instance, and it determines whether or not that instance is valid or not. I'm now looking to write several unit tests for the validator (TDD people, I know, I know!) and was wondering what...
Could someone help me understand what is the difference between blocking and non-blocking frameworks? So far, I understand that when request comes to a blocking framework it creates new thread for that request and processes it, if second request comes to server before the first one has finished it execution it will c...
My company is looking to implement a CI solution pretty soon, and I am worried about one thing in particular... we are scaling up, which means our solutions are growing with more projects. One thing I wanted to look into is to split off rarely changed projects into a separate project, and then having other projects sim...
Possible Duplicate: How to decide between using an existing eCommerce solution and building your own? I am starting a ecomm business and my site idea is pretty similar in functionality to ETSY. I am sure that I could build it in wordpress (or drupal or magento) and just use plugins to get all the functions i want - ...
Ok, I've been teaching a buddy how to program for a while now. He's a very fast learner, and he's quite good at programming so far. However, he has one "issue" I keep trying to correct. He jumps in and starts doing highlevel programming without learning some of the basics (He's created a full blown web application but ...
There seems to be a lot of buzz around software craftsmanship lately. Is it a well-defined concept? What does imply? To what extent is programming effectively a craft activity?
My current day job is mostly project management and client liaison work, but I sometimes get involved in actual coding. I do this either because I have a clear vision of what I want the result to look like (and it's easier to implement than to explain it), because I have relevant expertise, or simply to add resources. ...
I need to handle and process ~5 million news articles, an amount small enough to fit on a commodity desktop but too large to process serially. Thus far, I have been using Python/pickle for serialization, but this is easily getting out of hand. However, I do not have a server much less a cluster immediately available...
We are building a Windows Mobile based application to interface with a customer's existing web application. We are reading and writing data to the customer's SQL server 2008 database. The customer wants all reads to happen through SQL views, and all writes to happen through stored procedures. But taking a look at their...
I have a bunch "Property Sets" (which are simple structs containing POD members). I'd like to modify these property sets (eg: add a new member) at run time so that the definition of the property sets can be externalized and the code itself can be re-used with multiple versions/types of property sets with minimal/no cha...
Once upon time ago I asked a question on Stack Overflow about inheritance. I have said I design chess engine in OOP fashion. So I inherit all my pieces from Piece abstract class but inheritance still goes. Let me show by code public abstract class Piece { public void MakeMove(); public void TakeBackMove(); } p...
I am currently writing an extended report on a software library I have written. The reviewer will be a professor at my univeristy. He knows basically what I had to do, but the report will be evaluated. I have produced some samples results with the library which I already plan to include in the work. What I want to know...
I'd like to provide a very lightweight method to describe my web services. No WSDL, WADL or similar complex stuff. Just a mapping from the web service's base URL to a simple description which can be detected and parsed automatically. Basically The name of the service A link to some human readable documentation (option...
I have various windows forms applications that contain various controls that build up custom "group by" and "where" clauses for my class methods. I am thinking to pass a collection structure of some kind in order for the methods to be able to build the group by's and the where clauses. Let's say a list containing the ...
I found in legacy code a class which name is BucketService. Because english is not my native language I was trying to translate that, but it doesn't make sense. I found few termins like bucket sorting and so on, but I still don't get it. Actually this word is used quite frequently in programming I would be helpfull for...
Let me start this out by saying I've been a asp.net web forms developer for a while now and that I understand mvc is a new way of doing things. As I'm learning mvc and going through tutorials and training videos, I have questions that these tutorials don't address. This is my attempt to address them here... I started a...
I have a paid application on the android marketplace, however, I want to release a free ad-supported version. The easiest way I thought to do this was to set up a branch on my subversion repository that has the additional code to add the ads. However, when I went to submit this to the android marketplace, they require ...
Lately, I've been writing code in SAS Enterprise Guide, which produces "code" that looks like this (screenshot from the linked page): My question is twofold: Do you think it's necessary to perform code review on this type of code? My gut feeling is yes, given that (1) it's still code, just visually laid out, and (2) ...
In previous web applications I've built, I've had issues with users entering exotic characters into forms which get stored strangely in the database, and sometimes appear different or double-encoded when retrieved from the database and displayed back in the browser. I'm starting a new project now, and I want to preven...
I wanted to know if anyone had any tips for transitioning from small personal projects and coursework, to a large enterprise scale project? Im in my second year at university and have attained a placement with a large tech company, to work on a pretty large project, I'm just a little apprehensive about 'finding my way ...
Currently at my work place we use FogBugz for managing all our features and bugs for our different web applications. When a new feature is to be added to one of our web applications, a new Case is created. For example "Create CSV Upload Form". I then work on the case recording the amount of time I've spent on it. Once ...
I'm an Undergraduate Computer Science Student currently on a placement year at a company that produces and supports a large enterprise web application. I'm loving the experience of seeing how software is produced in the real world, and feel very lucky to find a company that offers a chance to not only maintain and exte...
How to decide if have to take the <<access>> or <<use>> notation for "-->" arrows in Component diagrams written in UML?
I have a situation where most people in my group come from an object oriented programming background with little to no understanding of functional programming. Not even basics like closures. Any suggestions about what might be a good way to introduce them to functional coding style? A lot of coding that we do can be s...
I've noticed a few functions I work with have 6 or more parameters, whereas in most libraries I use it is rare to find a function that takes more than 3. Often a lot of these extra parameters are binary options to alter the function behaviour. I think that some of these umpteen-parametered functions should probably be ...
Are there any open source applications that are developed using test driven development that serve as models of how good unit testing should work? I'd prefer to see examples in C# and .NET. (Note that I mentioned applications, not just libraries.) I'm a mid-tier programmer who really wants to believe in and practice ...
I am assuming the implementations/compilers/generated C code (referred to hereinafter as generic, 'interpreter') for most functional programming languages are written in non-pure functional languages. If this is the case, the underlying interpreter for any given functional programming language exhibits destructive upd...
If I am developing a Java library, is it good practice to issue log statements from within the library's code? Having logging within the library will make debugging and troubleshooting more transparent. However, on the other hand, I do not like littering my library code with logging statements. Are there any performanc...
Instead of compiling the source code for the respective OS (on which it is targeted), you compile once and run everywhere. For the sake of this question, I would call it VM (for example, both for Java and .NET). So this the execution of programs becomes something like ------------ ---- ---- | Executable | ...
I'm not a graphic designer. I'm pretty bad at drawing anything. I struggle to build things that look even as nice as "sample" applications bundled with development tools; primarily because I don't have squat in the way of art assets. What strategies might I take to mitigate this?
I have always preferred cross platform development over most other concepts as long as I can remember. Which is one of the reason I never got into .Net. Currently, I use php/javascript/python as my primary languages of choice for web development. Which I also have been using at work. But the need to learn c# has come u...
First, some background. I have an application that requires the use of several external geocoding providers which I don't control. It uses a central service layer inside the application to dispatch to the appropriate provider. I have a number of classes that are arranged in this way: GeocodingService: Responsible for ...
I see an emerging trend in "cloud" computing to move work load to a third-party server and get charged pennies for amount of work done in this way. This could be anything from file hosting to user authentication. So I thought about this for a bit and thought, why can't these services be offered in a peer-to-peer way ...
This question is appropriate only for programs created on the windows platform. If I build a release of my program with the /Zi option (create pdb file and store path to file in exe) then I don’t have to ship pdb file with release but we could retain for internal use. The pdb file would be retained for our internal Qu...