instruction
stringlengths
34
36.1k
I am here to ask a question that has been asked many times before. What programming language should I learn to become a intelligent conceptual programmer? Many people agree, you do not have to learn any one programming language; you need to learn programming as a concept itself (Most of us can become semi proficient...
I'm currently running a start-up with a buddy and I noticed that some of my university assignments could be finished by simply copying some code from some of the programs we've developed. Are there any legal troubles I could run into? Or is this just a bad idea in general(as it is starting to feel right now)? Sorry if ...
I've spent 3 days debugging one very obscure bug in a library made by my colleague, this bug happens very infrequently. After all I found that this bug happens due to cross-thread access to an object without any lock. Actually this is not a first bug of this kind, there were similar bugs before. He just runs his unit t...
Are there any actual business cases that have made any company move from a DVCS to a CVCS (regardless of whether they were on a CVCS originally)?. Other than having a closed mind and rejecting the paradigm shift altogether (for the particular case of companies coming from a CVCS) I cannot think of any cause for this ha...
I was wondering how safe is to say that —because developers are free to version and have better and more organic workflows— code will be delivered faster. A big factor here is team size of course, and I'd say the team is big enough to see this benefit (10-15 core devs, and maybe 5 to 15 more contributors to the common ...
In the blog post Don't structure data all the way down, the author discusses different ways to structure a circle datatype and how to implement the parameters to a Radius function. area({circle, {point,0,0}, 17.4}) Kind of messy. What about a function to build a circle for us? Then we could do this: area(make_circle(...
I'm writing a compiler that uses the time-honored strategy of using a C compiler as the back end, and I'm trying to figure out exactly how to handle integer sign. I'm using machine word integers as the default (translating into intptr_t and uintptr_t in the generated C), and while for myself I would prefer to make the ...
Once when I was refactoring my code, I went up the IDE to the using section of my C# class, and cleaned unused namespaces and duplicate namespaces, and sorted them all. My pair (pair programming) asked me the reason. I had no idea why I did that. I did it out of my habit to keep all of my code clean and tidy. I mean, I...
I have been learning some Ruby recently and I had the following experience. I had written a small tool of about 200 lines of code and, as an inexperienced Ruby programmer, I had used several loops to build arrays from other arrays. E.g. gs = ... # Some array of input data. l = gs.size i = 0 r = Array.new while (i < ...
I want to integrate Spring framework in my project especially into server side. So, I don't want to put it within WEB-INF folder of war file. Should I put an applicationContext.xml it into each layer (means each project since divided in distinct projects? (Services, Domain, and DAO) What is the good practice ?
I was just wondering how API's can be shared between different Programming languages. I mean, MS have .Net which uses VB.net C# and various other technologies. I doubt .Net is written for each programming language. How are structs and classes shared between languages? Also the same for Unity3D - Javascript shares API'...
I am a big fan of good coding style, producing clean, clear code that runs well and is easy to use and integrate into larger systems. I believe that we programmers are essentially craftspeople who should take pride in our work, every line. I am not fond of code that is inconsistently formatted, cluttered with commented...
I have been running into this problem more and more: I am not happy with the current API, and end up making my own class that does what I wish the API did; however, I don't extend the 'super class' as I don't feel it fully fits. I can't imagine that this is good practice, so should I just extend the 'super class' or sh...
Possible Duplicate: Version control for independent developers? I am not sure if I should use a code repository when I am the only one working on a project.
I've read a couple of definitions and discussion on REST and/or RESTful applications, but I still do not understand the real meaning of it. I usually work with the apps which either fetch data via GET or send data via POST to some web service (usually a PHP script) which then either get data from the database or do wr...
As we have a wonderful concept called hooking where we can create a reference to a function and connect another function In the same way can we create a reference to DOM objects. For example can we create a function and hook it to document.location so that whenever document.location is used the other function must be t...
Is there any algorithm that works better than O(n²) to verify whether a square matrix is a magic one (e.g. such as sum of all the rows, cols and diagonally are equal to each other)? I did see someone mention a O(n) time on a website a few days ago but could not figure out how.
I am trying to draw a use-case diagram for a software project. Two requirements for the software I am trying to model in use-case diagram are: A customer (i.e. Client) should be able to cancel its previous request. In this case, the client must select the relevant request from their list of request. A travel agent sho...
I have read that doing a select case is often a code smell. There are cases however where an interface cannot solve my problem. For instance, I have a set of date filter objects (last 7 days, last year, ect.) that implement a IDateFilter interface. In another part of the code, I need to determine the type of date filt...
I am trying to draw a UML use-case diagram to model requirements for a software project. The two requirements I have issue to model are: TravelAgent creates a booking for a [old] client who is requesting a home. When a new client wishes to make a booking, the TravelAgent register him/her to the system before doing the...
Are there screencasts on the Internet showing screens of programmers that decided to record their daily work and show their programming style? I'm interested in seeing how other programmers effectively use tools like an editor with various features, debugger, looking for bugs, profiler etc. Maybe such "crazy programmer...
Many apps have a Free version and a Full version. How is it compared to, installing a single version, and use an in-app purchase of $0.99 or $1.99 to unlock to the program to make it a full version? It does have the advantage that the user doesn't have to go to the App Store and install the program one more time and ...
I got interested in the Soviet space program and was interested to discover that the software on the Buran spacecraft circa 1988 was written in Prolog. Does anyone know what languages might have been used in earlier missions, especially the Mars PrOP-M rover missions of the early 1970s which were somewhat autonomous ...
I understand that threading is needed to get the maximum performance out of today's multicore processors but starting a thread is rather costly so you can't put every single calculation that can be done in parallel in an own thread. For example answer = new thread(plus(1,2)) + new thread(plus(3,4)) will run much slowe...
I just got a batch of LED matrix modules from Sure Electronics (http://www.sureelectronics.net/goods.php?id=1120) and a driver board (http://www.sureelectronics.net/goods.php?id=972). I've got it wired up, and connected to my Mac. I found the right drivers, and I'm now able to send text to the displays using the virtua...
I would like to know if the name of an open-source application can be trademarked by the original author and what it means when it comes to distributing it through major linux distros, that is, will they accept this kind of software?
I have a debug and a live server running a LAMP setup with some python scripts. By now I'm working with eclipse and Expandrive (via SSH) on the debug server. Whenever I want to release new code on the live server, I copy and paste the code via windows explorer from debugdrive to livedrive. I think this environment real...
A colleague of mine suggested using a factory class for creating viewmodel objects in our ASP.NET MVC solutions. The idea being that it can help with the design, and maintainability, of the way viewmodels are built in our apps. I wanted to find out if anyone else has experience of this. I've done some research and foun...
Please have a look at this link: http://en.wikipedia.org/wiki/Maze_generation#Depth-first_search Here, the theoretical algorithm given is: Consider the space for a maze being a large grid of cells (like a large chess board), each cell starting with four walls. Starting from a random cell, the computer then selects...
I'm looking for the term that applies to a certain kind of filtering behavior. It's often used in webshop-like interfaces, where large amounts of data are filtered based on a selection of filter criteria. The most distinguishing feature is that it's impossible to pick a filter criterium that leads to no results, as the...
What would be the best approach to achieving private communication between my iOS app and its server component? Is having a single unchanging “secret key” baked into the app source enough, or do I need to set up generations of such “handshake” keys dynamically somehow? The server by itself doesn’t have access to any se...
Possible Duplicate: Hand over source code to customer I have developed a couple of form based windows application in vb.net for a client and they all work well and he paid me through a freelance site. I have handed over the executable and the setup to the client and all was well. Now the client wants the source code ...
What do you think about SCM-based (subrepositories in mercurial, submodules in git) dependencies management? Is it definitely a good way of managing dependencies? Or definitely bad way? Should I prefer some build system (ant/phing/rake) over subrepositories? Some particular example for you to have a context: I have sev...
I know this is kind of time-management question. I do well in short assignments, but fail miserably, when it comes to projects that require hours and hours of work to be done day after day. I cannot code more than 10 minutes, unless there is a deadline. I kinda wander and come back and code. It takes me ridiculously la...
We're implementing an adapter for Jaxen (an XPath library for Java) that allows us to use XPath to access the data model of our application. This is done by implementing classes which map strings (passed to us from Jaxen) into elements of our data model. We estimate we'll need around 100 classes with over 1000 string ...
C# style suggests using CamelCase in identifiers to delimit words. Lisp tradition suggests using-dashes-instead. Has there ever existed a programming language where using spaces in identifiers was not only allowed, but a commonly used idiom when employing multi-word identifiers? It's possible to have identifiers with s...
We've probably all been in the situation where you'd like to alert your team members to some change ("I changed X, so now it's running every hour instead of every day"). But the change is non-urgent, and email can be disruptive - or get tuned out. Anyone have any techniques where the team can have a running log of chan...
I would like to know if it is possible to make an application to be sold on Apple AppStores that is linked (during compilation) to a BSD-licensed library.
Disclaimers (Please read before jumping to answer): I've seen a number of questions similar to the one I would like to ask, so here are some similar questions. IMHO They are neither completely what I'm asking, nor are they as thorough as I hope to be (I don't mean to brush off the answers to the below questions, nor am...
In a interview I was asked, Suppose we are going to create a software that runs on both desktop machines and smartphones. Name a software design pattern that could be used to enable the application to create different classes for display at runtime depending on the platform. I know there are simple solutions to imple...
Generally GC is not a good choice to get a soft real-time attribute. But Erlang is GC based language can be soft real-time. Does it mean Erlang have almost no GC latency? How does it work?
Iam not sure if this topic is ok to ask, but we are talking about this since years in our Developer-"Shop". How to write concepts for Web- Applications? We are using Zend Framework (MVC), OOP Based, Databases, LDAP and such stuff. But no one ive ever meet can show me an good example for some kind of "technical concepti...
I am new to openGL C++ and what I wanted to know is if there was a pre-existing function in the OpenGL library that would allow me to import a 3d or 2d model? For example, if I make a 3d image using photoshop, or a 3d model using 3ds max could I use a library in openGL example (not real function): glUse3dimage(3dmo...
What is the fastest way to find the first (smallest) integer that doesn't exist in a given list of unsorted integers (and that is greater than the list's smallest value)? My primitive approach is sorting them and stepping through the list, is there a better way?
I was thinking, is there a particular time in your coding where you verify that it works? Say, after coding a function, or an entire class, or an entire section of an app, or after every 'significant' block of code? I ask this, because I tend to verify my app too often, sometimes after every 3rd or 4th change. This is ...
I have been working for a couple of months now in a company that estimates (for the general population, not juniors specifically) tasks and then we are given the task, solve it, it goes through two tests and at the end the estimate should be somewhat met. I am beyond stressed because some of the estimates are simply im...
I have just begun development of a web application (that will be deployed using Google app engine), without going into the specifics, the web app will allow users to deploy a small website of their own, part of app allows the users to create a form to allow customers to sign up to the users website, however each user m...
I'm not sure I have the correct verbage in my question, so let me explain: What I mean by "software architectural design": I have (what I believe) is a unique and useful design concept for an architecture that involves multiple clients, shared states, blah-blah, etc. etc. This architecture would be used in multiplay...
If I am not storing credit card info, do I have to be concerned with PCI-compliance? I will be using a payment processor with a bank in my country. Literally just taking the credit card info and passing it to the gateway and processor. I would love to get an idea of the various technologies I might need to consider fro...
This type of conditional statement is generally frowned upon if(condition) statement; because if you add another statement, like this if(condition) statement; statement; it gives the impression that the second statement is part of the if block when it isn't. That said, my IDE does automatic indentation, which I...
I have spent some time studying Django and I've done some applications. But I really don't know what is the best approach while developing an application, I mean, there are several options: Make all the models, then all the urls, the views and then make all the templates. Other people recommend using an agile approach,...
I'm a member of my high school's robotics club, and am responsible for programming the robot. One suggestion I keep hearing from various adults is that I should be writing unit tests to help validate my code. The code base is getting a bit big, and I do agree that unit tests would be really helpful in helping me catc...
I was wondering if I can use a Python script to test a C program automatically. Suppose I have a very simple C program which reads data (numbers as test cases) from the console, calculates them, then outputs it to the console. Now I want to read data from a file then output whatever the program outputs into a file. Sup...
Should catch blocks be used for writing logic i.e. handle flow control etc? Or just for throwing exceptions? Does it effect efficiency or maintainability of code? What are the side effects (if there are any) of writing logic in catch block? EDIT: I have seen a Java SDK class in which they have written logic inside the ...
I work on some iphone/android apps and the “data stored on a centralized server” pattern seem fairly common. So far, I have done one app like this, doing everything myself at a low level without using many libraries: MySQL database PHP/HTML web forms allowing the app manager to enter/update content with some validatio...
I'm currently studying for an examination and one of the sample paper questions is to discuss the limitations of UML. Most of the material I'm finding on the net is relating to a specific UML implementation or language. I'm wondering from a generalists point of view what would you consider the limitations of UML to be?...
I've recently forked a project on Github and made some modifications to it, pushed them back to the forked repository and asked the original developer to pull the changes. (I gather this is the preferred way of contributing on Github.) The project is licensed under GPLv3. I am the author and the copyright holder of the...
Short Version: What is the term/concept which describes the efficient design of programming the data layer for efficient data access and what are some sources/books/articles/website which discuss this concept? Long Version: So I had a recent conversation with the senior developer at my small company about how and why w...
If I am about to develop an Enterprise application, but as far as I understand from agile process, I break features into small chunks and develop them iteratively. I used to create the database and the core of the application first, then I extend these iteratively. The question is: Do I have to keep what I used to do p...
Is there a better way to compute cartesian product. Since cartesian product is a special case that differs on each case. I think, I need to explain what I need to achieve and why I end up doing cartesian product. Please help me if cartesian product is the only solution for my problem. If so, how to improve the performa...
I am building a web app that manipulates fairly complex data: guitar tabs. As a reference, guitar tabs look like this: Eb|-------------------------------------------------------------------------| Bb|-------------------------------------------------------------------------| Gb|--5-5-5-5-----------------------------...
I'm writing something on how iterative Fibonacci is substantially better than recursive Fibonacci - a few lines. The main reason of this I find, as do many prominent researchers I believe, is that you don't recalculate values - space vs time. From this I thought ah ha! caching! But I'm not sure if it is caching, memoiz...
Many software companies preach in their Website Banners: "Global Delivery Model". Has it anything to do with Deployment?
Our app basically is a few forms that are filled out by people.. Then these forms are validated and reviewed and reports are created.. So I was thinking about DI and messing with a simple example of Unity + MVC http://netmvc.blogspot.com/2012/04/dependency-injection-in-aspnet-mvc-4.html So could it be useful for somet...
Background Looking to leverage an existing GIS system for exploring organizational data. Architecture The following figure represents a high-level overview of the system's desired features: The most basic usage would be as follows: The user visits a web site. The system presents a map (having regions, cities, and bui...
I'm using asp.net (c#). I have a factory that uses a dictionary of keys that are mapped to objects types. I originally used a static variable to track the dictionary but realized it would be shared among all sessions. Then I'm left with the idea of passing the object map around everywhere, which seems messy. Should ob...
Disillusionment with the Portal Space I'm seeing a disturbing number of large, enterprise clients who have become disillusioned with their enterprise Portal experience, especially those in the WebSphere Portal Server (WPS) space. Millions have been invested, yet the promise of personalized content with aggregation and ...
I recall back from my days of programming in C that when two strings are joined, the OS must allocate memory for the joined string, then the program can copy all the string text over to the new area in memory, then the old memory must manually be released. So if this is done multiple times as in the case of joining a l...
Is there a language that is capable of developing apps to cross platform OSs (win,*nix) and mobile apps (IOS, android) .. I'm a pro web developer but want to explore more environment to deploy my code into... Python ? Ruby ?
I'm working on a webapp (python/javascript) to modify a game's save file. The file has certain bytes representing player information, such as the gun, the equipment, etc. The idea is to show an interface representing the information in the file, allow the user to make changes, send the data back to the server, which mo...
According to canonical agile development, what is the appropriate amount of learning that an engineer should engage in before implementing a solution to a problem? If an engineer knows she is too ignorant of a given topic (say, compression) to start implementing, she goes and learns what she thinks she needs to know, a...
I'm refreshing my CS Theory, and I want to know how to identify that an algorithm O (log n) complexity. Specifically, is there an easy way to identify it? I know with O(n), you usually have a single loop; O(n^2) is a double loop; O(n^3) is a triple loop, etc. How about O (log n)?
For this question, I'll give an example module to facilitate the discussion, Let's say the module is a calculation engine, It currently servers its purpose for its current audience. The requirement is to clone the same engine but with some tweaking for an entirely new audience. Given that, these are Considerations/Fact...
I have an API that is EJB based (i.e. there are remote interfaces defined) that most of the clients use. As the client base grows there are issues with updates to the API and forcing clients to have to update to the latest version and interface definition. I would like to possibly look at having a couple versions of t...
If data is simple and objects are complex, I'm curious if there are any existing statically typed languages that would be able to augment(?) a map type into a type with guaranteed fields. I realize that at runtime, in any language this type of check is pretty doable. But in theory I also believe this should be possible...
There are some types of bugs which are very hard to reproduce, happen very rarely and seemingly by random. It can happen, that I find a possible cause, fix it, test the program, and can't reproduce the bug. However, as it was impossible to reliably reproduce the bug and it happened so rarely, how can I indicate this in...
It is always stated that it is hard to store applications objects in relational databases - the object-relational impedance mismatch - and that is why Document databases are better. However, is there really an impedance mismatch? And object has a key (albeit it may be hidden away by the runtime as a pointer to memory),...
I'm going to start a side project to build a "single page" web application. The application needs to be real-time, sending updates to the clients as changes happen. Are there any good resources for best-practice approaches wrt the architecture for these kinds of applications. The best resource I've found so far is the ...
I'm trying to build a very small, niche search engine, using Nutch to crawl specific sites. Some of the sites are news/blog sites. If I crawl, say, techcrunch.com, and store and index their frontpage, then within hours my index for that page will be out of date. Does a large search engine such as Google have an algori...
We use TortoiseSVN, but we have no bug tracking system. I know, lame, but beyond my control. There were times when svn wasn't in daily use. Now I've had succeeded in pressing for using it regularly, with proper merging, branching, tagging etc. As you could expect, the number of revisions increased in result, which mak...
The challenge proposed to me as to create a widget to apply in other sites that makes a website compliant with the cookie law[1]. Can I do this without changing server code? I mean, if there's code on server-side that writes an affiliate cookie to the response and my JavaScript widget deletes it after on window.load ev...
Say you have a traditional dev > test > production process say on a monthly release cycle. What are some of the steps you need to take and put into place to move towards a model of continuous delivery with frequent releases per day. Please make one suggestion per response. I would be interested in using voting to indi...
I realised the other day that I don't know how to talk about anonymous methods. It's easy enough to talk about named methods (The X method takes a Y1, Y2 and Y3) and classes (The X class has A, B and C methods), but it's harder with anonymous methods. How does one go about talking (and writing) about them? From the num...
...for project-based work. So far I didn't, and always got paid when work was complete and didn't ran into any problems. Does this make me look unprofessional? :) Should I ask like 25% - 50% advance before I start working? The work I usually do also includes graphic design to some extent (user inteface for my app)
Many of the custom projects I take include things that could be useful to the open source community. I'd like them to open Github repos with them :) Most of them are jQuery plugins. I'm almost always ending up creating my own jQuery plugins for features I need to implement in the project, for example autocomplete, edit...
In the first line of a git commit message I have a habit of mentioning the file that modified if a change doesn't span multiple files, for example: Add [somefunc] to [somefile] Is this a good thing to do or is it unnecessary?
I want to design a software for my musical instrument which is a rhythmic one (there is no melody). All I want these software to do is : make the user able to compose music play what user has composed for that purpose I need to record diffrent sounds of that instrument and match each sign with the appropriate soun...
I have two classes that I want related to each other in an JEE application using JPA2. In an OO world, I would say that a Chatroom has an attribute List messages. In the relational world composition doesn't exist like this. If I weren't involving a database at all, I would definitely code these two things as a composit...
After reading this interesting question, I felt like I had a good idea of which insecure hashing algorithm I'd use if I needed one, but no idea why I might use a secure algorithm instead. So what is the distinction? Isn't the output just a random number representing the hashed thing? What makes some hashing algorithm...
IF a 3 dot vector and a 3x3 matrix can rotate, scale and transform things in a virtual 3D space, could you use a 3x3x3 matrix and a 3.3.3 vector to do something to the games sense of time?
I'm a website owner and I develop in Yii so in short, I think I'm working with more or less the "best" PHP has to offer (e.g. PDO, OOP...etc). My primary website (which is not built in any framework just native PHP) of 2.5 years is finally making enough money I can hire my first employee who I want to be a developer to...
First let me say that I think that an agile process can work because of the following underlying principles: It brings focus Limits the noise which really brings focus Secondly I am wondering what are the initial conditions needed so that an Agile process can succeed? For example do we need to have: No existing bug...
Possible Duplicate: My Dad is impatient with the pace of my learning to program. What do I do? I am 14 and have been studying programming for 4 months now (3 months Python, 1 Month of Ruby). I haven't been pushed by my parents to do it, I took it up on my own. Whenever I try to show something I made to my dad, he sa...
I wrote this code: #include <iostream> int main() { int a; std::cin >> a; if(a*a== 3){ std::cout << a; } return 0; } On MSVC I turned ON all optimization flags. I expected that since a*a can never be 3, so compiler should not generate code for the section: if(a*a== 3){ std::cout << a; }...
I have implemented merge sort and quick sort using C (GCC 4.4.3 on Ubuntu 10.04 running on a 4 GB RAM laptop with an Intel DUO CPU at 2GHz) and I wanted to compare the performance of the two algorithms. The prototypes of the sorting functions are: void merge_sort(const char **lines, int start, int end); void quick_sor...
I have a project where my files have gotten out of hand because of the volume of them. I have started to combine classes of similar types in single header files because you can, and it still is good practice, now can i do the them same for those classes functions, that are declared in the source files. Is it a good id...
I have read somewhere that the cost of resolving bugs increases if it is not resolved at the initial stage. Which approach should I take while creating programs? Divide program development in modules. Complete coding one module. Fix ALL bugs of that module before starting coding other modules. Divide program developme...
Is there currently a way of developing android apps on an android phone? In other words, write, compile, install and run regular android java on the phone without using a pc? If not, what would make it possible, if at all? (would rooting be necessary? Or an android emulator compiled for android?)
I would like to know the ideas that are being used for explaining to the client the limitations of the language used for enhancement of the existing project. Given a scenario was that the project existed in VC++ 6.0 and the client had asked for enhancement that could include transparency (alpha) component in the colo...
General text editors don't change greatly. Syntax highlighting and code collapsing are not big changes really. If an editor is structure or domain aware, this usually comes with a different layouts - treeviews, context-menus, drag-and-drops and so on. So are there good example to add more domain control when editing wi...