instruction
stringlengths
34
36.1k
I am currently creating my first iPhone app in Objective C and getting a lot of warnings because I've in many places taken advantage of the fact that Objective C is a dynamically typed language. I get a lot of 'class' may not respond to '-message:' warnings. Should I strive to remove all these warnings? If yes, then wh...
When you write a code to listen from a port, like 80 for example, what happens under the hood? Is the method the OS uses to listen is pull, or push? In other words, does the OS checks that port every x milliseconds for example? I just don't get it. The more I think about it, the more it seems to me that it can't be an...
Ok, so I am trying to learn front-end programming. Trying to figure out how javascript is a pain, and various projects (GWT, Coffeescript, Capuccino's objective/j...) are trying to fix this with languages that compile to JS. What would you do if you were to reinvent the browser? I think I would embed a VM rather than ...
I'm an 'okay' Javascript developer working on browser javascript and node.js. However because I'm self taught, starting from copying and pasting jquery, there are a lot of holes in my programming/CS education. I don't really have the time to devote myself to fully learning all the CS concepts that might be taught in a ...
As many of you guys know, concepts, C++'s approach for constraining possible types for a template argument has failed to be included in C++11. I learned that the D programming language 2.0 has a similar feature for its generic programming. Its solution seems to me quite elegant & simple. So my question is why C++ canno...
We have been working with a shopping cart for DotNetNuke, and have had endless problems with the developer's releases of their product. Every release fixes one thing but new bugs pop up elsewhere. I know that bugs are inevitable and that we cannot squash all of them at the time, but can someone please tell me what perc...
I'm a teen who has been programming for about 3 years, I can do some basic Software and so, but I feel I can't do all by myself. What can I do to find people interested in Programming ? None of my friends does, I only have a Cousin which is studying Software Engineering, but he is in another country. I live in Spain, s...
I have a server and many clients (around 50 clients) who connect to that server based on a web application, which is of course based on HTTP protocol, which in turn uses TCP/IP (correct me if I'm wrong, cause I'm not really good at networking). The problem is that, I should develop an alert mechanism, in which, when so...
I am working on a mobile application and I would like to ask you a question. Is there an API or a method to get/calculate the average speed that a car should have in a road. I am working on a GPS like application and I want to calculate the average time that it will take a user to cover a certain path. Thanks.
I am sure there's a name for this anti-pattern somewhere; however I am not familiar enough with the anti-pattern literature to know it. Consider the following scenario: or0 is a member function in a class. For better or worse, it's heavily dependent on class member variables. Programmer A comes along and needs functio...
In 1977, Maurice Howard Halstead introduced his complexity measures for software systems, which included measurements of the program vocabulary, program length, volume, difficulty, effort, and an estimated number of bugs in a module. According to Wikipedia, difficulty relates to the difficulty of understanding the prog...
Consider a parameterless (edit: not necessarily) function that performs a single line of code, and is called only once in the program (though it is not impossible that it'll be needed again in the future). It could perform a query, check some values, do something involving regex... anything obscure or "hacky". The rati...
I understand that when we try to implement swarm intelligence, it basically has multiple independent units communicating and with each other. What I am unsure of is if swarm intelligence an extension of artificial intelligence or if it is a discipline in and of itself.
As a player, I found the following problems about creating and using "extensions" (aka mods) for games: 1) Whenever the game is updated, all the mods break. 2) Most mods don't work with each other, so the player "has to choose" 3) If you ever de-install a mod, your "saved games" almost always become unusable. I want ...
One of the languages I have to use at work is a very small, niche language called psl. One of the largest complaints I have about it as a language is that the libraries are very limited. While that's understandable for a small language developed by a couple of guys, it does cause me some dilemmas. Specifically, I find ...
I've been messing around with functional programming languages for a few years, and I keep encountering this phrase. For example, it is a chapter of "The Little Schemer, which certainly predates the blog by this name. (No, the chapter doesn't help answer my question.) I understand what lambda means, the idea of an anon...
Coming from a OOP background (Java), I'm learning Scala on my own. While I can readily see the advantages of using immutable objects individually, I'm having a hard time seeing how one can design a whole application like that. I'll give an example: Say I have objects that represents "materials" and their properties (I'...
Possible Duplicate: When is Singleton appropriate? I've seen many explanations why is Singleton is evil. But is there really no such a case when Singleton is the only beautiful solution?
I'm trying to design the "main" classe(s) of a Rich Desktop Application based on NetBeans Platform 7. This application will consume HTTP services and, through a "push system" over TCP, will receive messages. We are 3 developpers and we want to develop modules in parallel Application will be layered (Data, Business, Pr...
How would one go about to use tdd/bdd on a mostly data driven webapp? For example a blog or a forum?
I just discovered some lovely code in our companies app that uses Try-Catch blocks as logical operators. Meaning, "do some code, if that throws this error, do this code, but if that throws this error do this 3rd thing instead". It uses "Finally" as the "else" statement it appears. I know that this is wrong inherently, ...
let's assume - regardless from technology and programming languages - you have a type and the type has an association to another type. This association has the complexity of 'at least one' (1..n). How would you specify the behavior, when removing elements from this association based on a predicate? Say, the predicate f...
I need to develop, or at least conceptualize a module that does efficient data deduplication. Say we have millions of data records already. Insertion of another 100 mn records, making sure that there are no duplicate records in the resultant dataset, is what the module needs to do, at the top level. Now this may mean c...
Usually when writing unit tests I create a helper class with extension methods. I use these methods exclusively for generating generic data for things that I am too lazy to type out. I usually name these classes something relevant to the class under test - for example, I'll follow a pattern like TestHelper.cs. I've re...
I'm working (a bit) on a (turn-based strategy) game. There are two classes relevant for the question: State: This is an immutable class, which exposes all its fields (either via getters or another way, as I felt appropriate). The state is a bit complicated, so I decomposed it into several classes in the package ...sta...
Setup I have a project (pynliner, a python module) on github that I never gave much thought about licensing. Today I got an email asking what license it is under because someone wants to use it in their commercial software. My first thought is that I would love to have 2 licenses one that is free for non-commercial use...
Do you just move the story to a new iteration, or delay the next iteration? It gets a bit tricky when you use something like Jira when you have to copy or move around stories between iterations as it effects calculations of velocity/points etc. Is there a best-practice?
In another question, I asked about why developers might don't like daily scrum. We talked to developers and we decided to not hold daily scrum for a while (to give it a try and customized scrum in our first attempt). This is the output of consulting with developers directly. On the other hand, we don't want to lose go...
I have been asked to put down the architecture and features of our Java application (more from infrastructure/software point of view). It will go on a Powerpoint presentation, so I need to provide the list. Please let me know how do I go about this.
Possible Duplicate: Are design patterns really essential nowadays? I recently read a book on design patterns. A few of them seem very usefull in specific situations. Im not sure how much use they will be in everyday coding though. How often do you use design patterns in your everyday work? Should I be trying to find...
Almost every article I can find about recursion includes the examples of factorial or Fibonacci Numbers, which are: Math Useless in real life Are there some interesting non-math code examples to teach recursion? I'm thinking divide-and-conquer algorithms but they usually involve complex data structures.
I'm sure lots of you have experienced this problem. A website or web application is running and is live. You want to upload the next version, but you haven't figured out everything, like setting a value to false in configuration file, inserting another record into the database, and doing lots of minor stuff which can s...
I work in a small software company where my boss is a great fan of Visual Foxpro. We are working on an ASP.NET project but my boss is insisting to use Visual Foxpro DBF instead of SQL Server. I want to know what may be the advantages and disadvantages of using a Foxpro database file with ASP.NET 3.5.
I have a question about implementing a data structure (with algorithm) that has these features: There are too many places (like stores), and each place can store too many items, I want to store items in the places. The point is we need to have optimized insertion (or deletion) and optimized search feature. Search can ...
AGPL is a fairly new license that was meant to go GPL-over-networks. However, not being a lawyer, and actually not having read the whole license, I can't understand what exactly you can do freely and what not with AGPL. My uncertainty is fed by this post about MongoDB (which is AGPL) and even more by the comments below...
Till recently my development workflow was the following: Get the feature from product owner Make a branch (if feature is more than 1 day) Implement it in a branch Merge changes from main branch to my branch (to reduce conflicts during backward merging) Merge my branch back to main branch Sometimes there were problems...
When should you put Key/Value type of data in it's own class instead of using a pre-built generic structure, such as a KeyValuePair or a Tuple? For example, most ComboBoxes I create contain a DisplayName and a Value. This is the kind of data I am trying to decide when to put in a new class, and when to just use a KeyVa...
After a year programming a web based business management system, I got my idea divided into two differents ways to do what I'm doing... I will try to explain in follow lines: First I will describe my enviroment: Webserver: apache, ngynx Programming Language: PHP, Shell Script, Java Script, SQL Database: Mysql Operati...
I have a application that is part console application written in C# and part PHP web application. The console application connects to multiple serial devices and reads data pertaining to moisture and temperature in a Grain Dryer. [The application] then stores the information in a MySQL database. The PHP reads the MyS...
In your experience, how long should a Sprint Planning meeting (Scrum) last? 8 hours? Or should it be shorter (succinct) and further discussions should be planned as part of the sprint? Our Sprints are 10 days long.
This question may seems a little bit silly, but what the heck. I started to learn Python. I know basic syntax, etc. When I work with HTML, PHP, etc., I simply write code, put it inside .html or .php file and double click this file. Then my code runs. I can work with databases and other stuff - it's just simple. But h...
For past year I have been working a lot on concurrency in Java and have build and worked on many concurrent packages. So in terms of development in the concurrent world, I am quite confident. Further I am very much interested to learn and understand more about concurrent programming. But I am unable to answer myself wh...
I used Foxpro 2.6 a decade ago. In my present company, few new projects are being developed in Visual Foxpro 9.0 and few projects are on .NET platform. From time-to-time I notice how Visual Foxpro is more powerful as compared to .NET when comparing dependency issues. Here are some of the advantages of VFP I noticed: ...
Does anyone know what the difference between these are? It seems to me that kernel threads correspond to the code that runs the kernel (intuitively), but I'm not sure about the other two... Also, would the pthreads standard be considered user-level and kernel-supported, since you are accessing a library while the kerne...
What is Big and O in Big O notation? I've read the definitions and it doesn't tell what is O pronounced as 'oh'. For example - I understand that O(n) is complexity of a linear algorithm where n could be the number of operations. but what is an O?
A developer writes if/else blocks with one-line code statements like: if (condition) // Do this one-line code else // Do this one-line code Another uses curly braces for all of them: if (condition) { // Do this one-line code } else { // Do this one-line code } A developer first instantiates an object, t...
I was using Microsoft SQL Query Analyzer the other day and wrote a very simple select statement: SELECT 22/7 as [PI Equiv] I was suprized that the result was 3, when I was expecting to see 3.1428571. Even if you declare the output to be Numeric(18,7), you still get 3.0000000. DECLARE @Answer Numeric(18,7) SET @Answer ...
If I buy a symbian(S60, nokia E51) mobile, and I want to write a program to control the PC(launch programs, control mouse/keyboard): Is it possible to make a mobile app and a windows app which communicates via WiFi, or its easier/faster via bluetooth? Which framework should I choose? (symbian/java) (other info that I ...
Client need something done, I need to write up a quote, how do I approach it? If you have any general strategy on this issue would also be appreciated. This is to build a website/database for a few grand.
There is a new developer in our team. An agile methodology is in use at our company. But the developer has another experience: he considers that particular parts of the code must be assigned to particular developers. So if one developer had created a program procedure or module it would be considered normal that all ch...
What other tech synonyms are there for a master-slave relationship? The situation is a knob that controls other knobs, or a button that controls other buttons.
I've been interviewing some potential interns for a project I'm working on. We use git, so I'm looking for someone familiar with DVCS (or SVN/CVS or a desire to learn). A response that threw me off was "I've worked with github" with no further information, so it forced me to consider what to expect from a programmer wo...
I've done some work looking at Next3 and ext3cow, and a few other file systems that provide snapshots and/or file versioning. It seems a bit strange to me that file systems only go part-way with version control, though. Are there fundamental reasons for keeping the two separate? How challenging would it be to, for exam...
Obviously i'll have to make some sort of choice at what DB i choose to go with (MS-SQL/MYSQL/etc) but this question isn't about that. The question mainly is what other languages/tools would be helpful for someone wanting to get into Database Programming/Administration. I assume PHP would be helpful with MySQL along wit...
Given some (relatively) complicated line of code, I would often be inclined to split it onto multiple lines to make its function/purpose clear to others. However, if it is quite clear from context what a line does, would you still do the same thing merely to make clearer how it does it? Or would you take the attitude t...
I've been developing a site and I've been trying to come up with a method to make sure all Social Network accounts of a certain user are linked together. I've had one snag from the start, and maybe someone here has an idea of what to do. This is the problem. Let's say someone comes to my site and they click login with ...
I'm a newer enthusiast programmer. I've been doing small and big projects on and off for the past two or three years. I always hit small snags in my code that add up to big memory hogs or unnecessary lines of code down the road. My philosophy on big projects has always been to just 'get it out of my head' and write all...
My friend has 15 years of programming experience and Ph.D. in mathematics. He has also cerebral palsy with speech impairment. Because of his handicap, he chose to being a software developer after his Ph.D. As far as I can see, he is still an excellent c# developer. Nowadays, however, he has hard time to find a job for ...
I am a web developer. My office sets a list of criteria such as Discipline Attendance Project Schedule Teamwork Problem Solving Idea Sharing Dedication for evaluating employees performance. Each criteria is allocated some points and the review is based on the total points scored in each criteria. My problem is I fee...
It's now about 4 years of development that I'm using, hearing, talking about, and implementing hash tables and hash functions. But I really never understand why it's called hash? I remember the first days I started programming, this term was kind'of cumbersome terminology to me. I never figured out what is it, based on...
Given the announcement of the windows 8 tablet edition and more details on the app store, it would be amazing if this infrastructure could be leveraged for the OSX desktop and or MonoTouch. http://www.wired.com/gadgetlab/2011/09/windows-8-experience/ Technically how hard would it be for Microsoft to do this? Is the onl...
I personally stay awake late at night, coding and enjoying working on personal projects. My other colleagues also feel the same and like coding at night. However, it's not about being passionate about personal hobbies, rather, I really feel that I'm more productive at night. I think that there is something about night,...
When trying to explain the concept of Inheritance in OOP, the common example is often the mammals example. IMHO, this is really a bad example, because it will lead the newbies to use this concept the wrong way. And moreover, it is not a common design that they will face in their day-to-day design job. So, what will be ...
According to W3Tech, this link, this link, this link, and many other sources, jQuery is really becoming what IE experienced in the world of web browsers (gaining more than 80% of the market for a period). I don't have the knowledge of any other JavaScript library like MooTools, YUI, etc. because when I started web dev...
Do you find reasonable to practice coding dojos on a regular basis? I understand dojo may be a good starting point to introduce somebody to some approach but what is the point of making similar dojos regularly? So currently we have two teams which are working on real project written in TDD. One team wants to work on T...
We are developing a Qt-based application to navigate through and paint on a volume treated as a 3D pixel graphic. The layout of the app consists of three orthogonal slice views on which the user may paint stuff like dots, circles etc. and also erase already painted pixels. Think of a 3D Gimp or MS Paint. How would you...
I'm having some trouble working this one out, probably more than I should. This is a pretty large project, with a very clearly defined structure, with no obvious problems, but I can't seem to figure out the optimal solution for this case, even after reading several convention documents and such. For example, given the ...
So far, most of the fastest and common sorting method is quicksort. Although it has its pro and cons. However, i'm thinking that although this sorting method is fast but does it provide shortest swapping step? Because quicksort divide a set of element into 2 and then sorting, will it double up the swapping step?
I'm currently in the process of writing a human date parser. By human date, I mean it should be able to interpret strings as "tomorrow at 2" and return a valid date depending on the current time. The issue I'm facing is the automatic detection of missing AM/PM token. For example, if I receive an email that says "Lets m...
A friend of mine in another department had a problem and came to me with a question that I wasn't sure how to help him with. He recently became promoted to architect and he was put in charge of design and leading a team of developers that are of questionable quality and little to no experience with following a project...
Situation: The dba is an offsite contractor who keeps the entire DAL code checked out in TFS. It would be nice as the front end developer to be able to add columns, and tweak procs and whatnot, without having to rely on waiting for this dude to respond to your emails to do the work. Question: What would be a recommende...
I'm currently testing Visual C++ 10 on some trivial pieces of code. For example, like this one (taken from here): int main() { int i; clrscr(); for(i=0,i++,i<=5;i++,i<=2;i=0,i<=5,i+=3){ printf("%d ",i); } return 0; } For the code above the compiler emits machine code that in effect does thi...
I have been studying and coding in C# for some time now. But still, I can't figure the usefulness of Interfaces. They bring too little to the table. Other than providing the signatures of function, they do nothing. If I can remember the names and signature of the functions which are needed to be implemented, there is n...
A meeting today went well where I explained that cloud computing which one of the persons recognized was something else than a traditional RDBMS and I said that cloud computing is that everthing is software. It didn't seem like "Aha!" when I said it so I wonder what I should say. I thought the main specifics of cloud c...
In agile (scrum), how should one ideally break down things into a user story. The team size is about 6 developers if that makes a difference, and iterations are 3 weeks. Is breaking a user story with points and hours considered agile, or is it ONLY user points for a given user story? Should we break a user story into t...
A computer science degree (like any undergraduate degree) does not prepare you to be productive immediately. And my sense is that employers are less and less willing to provide that initial training. (Or at least if you DO have those core skills*, you have a broader selection of "first jobs" to choose from). What skill...
A web application is often designed to be layered. Typically there would be a Repository (Dao) layer, a Service layer and a Control (web handling) layer. The Control layer uses the Service layer which in turn uses the Repository layer. Often you'll see the Control layer using the Repository layer directly. Also quite p...
Often I come across documentation that says "use a regular expression here" I have to spend quite some time digging around trying to work out which regular expression format they are expecting. As far as I can tell, there are many types of regular expression. But, at my last place of work I was made to feel stupid whe...
I am working a project that is licensed under the MPL 1.1 and would like to incorporate some code that is licensed under the APL 2.0. I know in 2010 Mozilla announced they were updating the MPL to make it more "Apache compatible" among other things. I'm no lawyer. Exactly what part(s) of the MPL 1.1 don't jive with the...
I am trying to get a job as Java developer. I have been developing web pages with Java for a while, but now trying to go to another path and develop server-client solutions. In this specific company they are using these technologies for web developing: Spring, Hibernate, Ant, Velocity etc. All of the hot techs for Java...
I've read through the previous posts on freelance websites and used most of them. I'm looking for a website dedicated to high-end professionals and high-end work. Such as writing software compilers, designing database engines, etc. Probably no such website exists (there would have to be some kind of moderation), but I'...
I had an interview yesterday with a member of our organization who wanted to create a system to help him to do his job, the problem I had with him was that he had only a general idea about what he want. I tried to get more information from him by asking him specific questions which he had no answer to, such as what he ...
Can you recommend a free compiler/IDE for writing some simple Io programs? I want to learn the language at home in my spare time.
I have developed a web application that is used mainly for archiving all sorts of textual material (documents, references to articles, books, magazines etc.). There can be any given number of archive tables in my system, each with its own schema. The schema can be changed by a moderator through the application (imagine...
My friend and I are relatively new TDD and have a dispute about the "Obvious Implementation" technique (from "TDD By Example" by Kent Beck). My friend says it means that if the implementation is obvious, you should go ahead and write it - before any test for that new behavior. And indeed the book says: How do you impl...
What's the historical significance of abbreviating say, an L1 cache as L1$?
I've recently reviewed a resume for a very promising student who is not a native English speaker (I believe his native language is Bengali). His academic record has some gaps, too - he could use a couple of solid data-structure and algorithms type courses. Where would you advise this student to look, in order to find ...
I just accepted a new job. Our application is in the 50,000 lines of code area. None of which is commented. I am finding it difficult to understand how the application works. Id like to prevent this for the next person that joins the project by getting the team to start to use comments. Forget about if you support com...
Since I discovered the powers of the final keyword in Java a few years ago, it helped me to make my codes a lot more readable, since people can easily see what are read-only variables. It may also provide a little boost to the JIT, and while that's a very limited one, it can't harm, especially when targeting embedded d...
I have a 3-tiered .NET solution. Database (SQL SERVER 2008) Web Service (SOAP Service - *.asmx) WPF Client I am comfortably writing Unit Tests within (3) The Client. I am currently working on writing tests between (1)Database & (2)Service. My question is, what are some useful ways to run integration tests across all ...
In programming, various terms like abstraction are mentioned quite heavily. What, however, is composition? What is a basic but effective example of composition at play to result in good quality code (good quality meaning easy to understand, short and concise, etc).
Let me preface this by apologizing if this has been covered elsewhere, but I was unable to find sufficient information in my searching. Background information I work at a non-software company developing desktop applications in a team of four members, where I have been employed for more than 18 months. Being my first jo...
Is the time spent refactoring a code base worth it in the long run, in terms of developer productivity? It seems pretty clear to me that modifying a clean, well designed system is much simpler and faster than working on a poorly designed one, but I'm after some solid evidence. Are there any studies around this topic?
I was asked the following question in an interview today and I've been thinking about it ever since. I was not able to answer it and haven't been able to find a solution online. Given a chess board with dimensions X by Y and N queens, determine whether it is possible to arrange these queens on the board such that they ...
What should be the core functions of games which represents an excellent game? What quality goals it should achieve to become successful game? Any concise formed answer will get me on track.
One of the goals of modular frameworks like Kohana or Alloy is to make it easy to add and remove components (i.e. "plugins" or "modules"). However, in all the larger projects I have ever worked - the system often becomes dependent on the modules it is built on. After all, that is why they are there - to build with them...
I've been given a non-disclosure agreement (NDA) to sign by my current employer that I do not want to sign. It is incredibly open ended and I feel that it should have been a condition of my initial employment agreement, which I signed three weeks ago. The document contains very many definitions in the form of "includi...
I would like to run SVN server on my local machine along with WAMP. All SVN server binaries include Apache. Whereas I don't need Apache as I'm already running WAMP. Please let me know if there are any installs available that includes only the SVN server. If there are none available, shall I go ahead with what's availa...
Why or when is "explicit" preferred when implicit solutions often are more readable and less code? It says "explicit is better than implicit" when for example an implicit loop is better than an explicit loop isn't it? for every in all: every.updated = True The above looks implicit to me and better than an explicit ...
Possible Duplicate: Thoughts on Development using Virtual Machines My boss has been singing the praises of leveraging virtualized desktops for all our developers in the company - about 100 people. I think this is a horrible idea and can think of no other companies pursuing a similar course of action. He believes th...