instruction
stringlengths
34
36.1k
I would like to know recommendations about Implicit Line Joining versus Explicit Line Joining in Python. In particular, do you favor one form over the other? What do you recommend as the general default? What criteria do you have for choosing one over the other, and if you do have a preference of one, when do you make...
I've worked for two years in a great Investment Bank. I made some technical projects with the desire of creating code the most optimized, respecting the adapted good design patterns, SOLID principle, law of demeter and avoiding all sorts of duplicate codes ... When delivery in production => zero bugs, all has happened ...
Commenting nowadays is easier than ever. In Java, there are some nice techniques for linking comments to classes, and Java IDEs are good at making comment shells for you. Languages like Clojure even allow you to add a description of a function in the function code itself as an argument. However we still live in an ag...
I've been developing web apps for a while now and it is standard practice in our team to use agile development techniques and principles to implement the software. Recently, I've also become involved in Machine Learning and Natural Language Processing. I heard people primarily use Matlab for developing ML and NLP algor...
I applied for a job in a company. The initial conversation went well.They sent me an assignment and asked me to write a web application, and send it in a specified time. It seemed fairly simple. I completed and sent it to them. Now my mind is completely revolving on the code that I wrote, and now I feel that, there was...
We have a really huge MS Access application developed in-house initially for our personal needs which then was turned into a commercial software and successfully sold. The software is a sort of "all-round-software-for-your-business" and contains several modules including Document Management System, Enterprise Resource ...
My colleague uses the Binary Calculator functions in bandwidth calculations; as much as terrabytes, and with percentage splitting on allocation. His usage of these functions appears correct in order not to lose a byte; although he seems to be using them now for everything. The manual only says: For arbitrary precisio...
I have this portfolio website containing some personal projects/algorithm implementations. I want to get attribution if and when other people use my code or snippets of it. I initially thought of using Creative Commons but, as CC itself points out, CC doesn't fit well with software/code distributions. I would've used C...
I am the development team lead of a new project at my company. This is the first project where the company will use Scrum. We have a waterfall/iterative SDLC. The BAs write requirements docs, hands over to dev and test, dev start developing and will release to testing in iterations. Testers take long time to test a rel...
Isn't it counter-productive to ask for 384 Swiss franks for C11 or 352 Swiss franks for C++11, if the aim is to make the standards widely adopted? Please note, I'm not ranting at all, and I'm not against paying; I would like to understand the rationale behind setting the prices as such, especially knowing that ISO is ...
Possible Duplicate: Should I Bother To Develop for JavaScript Disabled? In this Modern time of HTML5 API jQuery Modernizr HTML5 Shim Respond.JS Google Chrome app store Canvas Has the time gone to think about user with JavaScript disabled in browser? Ot it's still need to be consider
I want to distribute a .NET library that is .NET 3.5 compliant. The library holds references only to external managed libraries that are targeted against .NET 3.5 client profile or lower. Is there any point in distributing my library as separate .NET 3.5 and 4.0 targeted assembly?
What is an efficient, OOP way to count child records of an object? In my current project, a District may contain zero or more School records. The Districts object acts as a collection of District, and can perform a single query to get the data behind several District in one go, rather than each District (Active Record)...
I need to write requirements/specs for a WCF service interface between our system and a third-party BizTalk server. I'm not quite sure how to do this, so I'm looking for a template. I guess I should at the very least define the interface itself, authentication policy and error handling. Any resources regarding document...
I'm performing some research and analysis on bug/issue tracking databases and more specifically on how programmers and teams of programmers actually interact with them. What I'm looking for involves understanding how those databases change over time. So what I don't need for example: is a database of all the bugs of so...
If I'm doing a website, I end up with folders like "Controllers, Views, Models, Extensions, and Helpers". If I'm doing a DLL library I end up with folders reflecting the namespaces of my classes. If I write a desktop app, I end up with "Presentation and models" where models is subdivided further by namespaces. My quest...
I am trying to make my code more robust and I have been reading about unit testing, but I find it very hard to find an actual useful use. For instance, the Wikipedia example: public class TestAdder { public void testSum() { Adder adder = new AdderImpl(); assert(adder.add(1, 1) == 2); assert(...
This question is about best practices in architecture. Our Current Architecture I have a PHP class that accesses MySQL for user info. Let's call it User. User is accessed many times, so we have implemented layers of caching to reduce load. The first layer is what we call the "per request" cache. After the data has b...
My question is in a sense a follow up of this post on Time Series in .Net. Ideally, you would like to expand the basic TimeSeries<T> class by something like NumericTimeSeries<T>, where you would want to make sure that the type T implements the common numerical operators +, -, *, `/', ... I am not sure what would be the...
I've seen a number of question asking whether someone should learn procedural or OO first. But is this even possible? Can you learn OO programming without first having an understanding of procedural programming? Obviously, they can learn to program in an OO language like Java or Python first. But you can write Fortran ...
As a serious programmer, how do you answer the question What is MVC? In my mind, MVC is sort of a nebulous topic — and because of that, if your audience is a learner, then you're free to describe it in general terms that are unlikely to be controversial. However, if you are speaking to a knowledgeable audience, especia...
I believe I have some good suggestions to improve the C++ language. Who should I contact to discuss this? Do I have the chance to be heard, especially if I'm not a renowned expert?
Sorry for the blunt question, I will try to explain further. I am going to have a website which uses jQuery, and I feel that at some point in time, there will be A LOT of jQuery code, meaning A LOT of functions, jQuery selectors, etc. Is there a way to limit the availability of jQuery code for specific pages? Perhaps u...
I've noticed than many numerical sorting methods seem to sort by 1, 10, 2, 3... rather than the expected 1, 2, 3, 10... I'm having trouble coming up with a scenario where I would need the first method and, as a user, I get frustrated whenever I see it in practice. Are there legitimate use cases for the first style over...
I'm developing various websites and functionality to cater to various different use-cases up in Django. Is there a good notation for showing what behaviour is at each stage, e.g., swimlanes. I use BPMN 2 notation for everything, but feel that I am overusing this, and probably abusing the notation :P Example: Please re...
Working as a freelancer, I receive many weird, invalid or incomplete requests from the actual or potential customers. The most frequent case is this one: Hi, I need a website where people can register and there are also postings and ratings. How much will it cost to me? Thank you. The request sucks, but it doesn't me...
I am not very clear on this aspect. Let's say you have a bunch of .py files that are their own separate modules. Why does each .py file need to import the others when they use that class? Or do they? Because I was pretty sure that other languages (Java, for instance), did not require import when referring to classes/fi...
I know the 32 bit registers were named like the 16 bit registers with an 'E' prefix to mean extended. I've always assumed that meant extended from 16 to 32 bits although I've never seen that explicitly stated. I was trying to find out what the 'R' stands for but my google skills have failed me. Anyone know?
What are some characteristics of Python that makes it unique as its own language? I'm looking for any sort of characteristics ranging from good to bad, useful to hindrance, syntax to real-world usage, but non-obscure observations would be the most useful for the average developer. I'm a newb here, so intuitive things m...
Is Javascript a functional language? I know it has objects & you can do OOP with it also, but is it also a functional language, can it be used in that way? You know how OOP became/seems like the next evolution in programming, does that mean that 'Functional Programming' is the next evolution(Note: this is NOT a prompt...
This is something that bothered me a lot at school. Five years ago, when I learned SQL, I always wondered why we first specify the fields we want and then where we want them from. According to my idea, we should write: From Employee e Select e.Name So why does the norm say the following? Select e.Name -- Eeeeek, what ...
If you decide "Program to An Interface" trumps YAGNI and decide to create a supertype where you don't envision anything other than one obvious implementation - is there a convention for naming the obvious concrete type? E.g. this morning I wrote a a class called PlainOldConversionReport and I wonder if that name betra...
I am having a confusion in this Binary Tree Coding. I know the concept of binary tree and I know how those work and all, but in this source code i am confused with "Find" operation. I cannot understand how it works and all. Please help me, I am so interested in this area. package binarytree_task4; class Node {...
I am a C, C++ developer. I am interested in mobile development. I want to know how can I develop Android apps using C and C++, I have read that they are providing a kit for C, C++ developers but it does not have all functions as of Java kit. Should I go for C/C++ development kit or it's better to learn java as they may...
Through colleagues and exit interviews, I have heard that at my small company I am "responsible" for anywhere from 3-10 times more code than I would be at another job. I'm trying to look for some sort of fuzzy metric that I can use to compare my workload with others in my field. By "code responsibility", I don't mean "...
I am looking for an open source license for a library I want to publish. Ideally, one should be allowed to use this library in free or commercial applications without paying me a fee, but if any derivative work from the library is created (any improvement of the library for example), it should be made available to ever...
Doesn't it seem relatively duplicative to define your Models in your backend code AND on your front end for a rich internet application? I'm porting a GUI application I had written to have a web interface, which is all grand and nice any all, but things like Spine, SproutCore, JavascriptMVC would have you define your m...
I'm working on 2 projects projA and projB, and both projects are maintenance projects. For projA there are 3 programmers and for projB there are 2 programmers. In each case all are working on separate points. As code documentation is very important, can you tell me which one is the better practice? Examples: {Author...
I started my programming career with BASIC, during 9th grade. I learned a bit of BASIC by writing simple programs to add, subtract and to print. Then I went to the university and took Computer Information and Systems Engineering. In the first year I was taught C, and I have good command over it. Next I learned C++ in ...
I was just wondering what skills and technologies I need to know to in order to start a career path in Sharepoint. I know that it primarily depends on the job I am applying for but there must be a number of baseline skills that are common among most Sharepoint jobs. Btw, I'm currently a CS student who has only learnt J...
In this video, the speaker says: "Some people get confused about how commas work. They think they should be delimiters rather than separators. Now you can think about them either way." I don't understand the difference between a delimiter and a separator (if there is one). The implication in the video is that now...
Just wondering if someone could suggest a good algorithm in the collaborative filtering vein that I could use to suggest music choices based on top ten lists. This is a personal project, I am a member of a private music blog where most of the users recently submitted "best of 2011" lists. The lists range in size (say ...
Which aspects do I need to consider when designing and publishing software that must meet the US export restrictions for cryptographic software? Wikipedia says that there are various categories which you can assign to cryptographic software. And the export destination (e.g. China, Russia) does play a major role as well...
I'm trying to add a scheduling feature to my web scraping application that will let the user schedule scraping jobs so he can, for instance, perform a job every Monday, or every 2 hours or stuff like that. On one end, I could make a very simple scheduler that let you pick a specific date and time and pick a time inter...
I see lots of discussions flying around about performance of db 'x' or that moving from 'x' to 'y' improved our site performance. I'm yet to see proper benchmarking that works across different types of databases. Is it possible to write a meaningful benchmark that could be used across multiple db types, such as Relati...
I am considering how I can add tasks to Android Activities in a flexible way. I can only use implementation inheritance for one thing in Java and I would like to use it, if I use it at all, for something else. I think I need to draw the domain first a bit: Activities are UI windows basically, with intrinsic lifecycle ...
Why do I hear that it is not good to share instance variables between controllers and views. I kind of like it because I can see immediately via the @ that something is coming from the controller. I see a nice way to use helpers in controllers here: http://www.stephencelis.com/2008/09/06/rails-controllers-views-and-v...
I am struggling with the best way to structure a program that I am writing because the method I currently have feels very clunky and each part depends a lot on the others. This is what the program needs to do: Parse a word document to extract a list of contacts. Get a list of contacts in a specified group from my Goo...
I'm building an open source SMSC from scratch; it's almost finished, The SRI and the forwardSM operations are working, but I still have few things to do for the receiving part. I've built the SS7 stack already, but I'm using DB for saving the TCAP transactions IDs to be updated later to get/generate responses. My app...
To get that out of the way - i am not asking about which platform is faster or try to start a flame war. Question: Why is the .NET version slower 5x in the first test ? The results i got were: .NET Test1: 48992696 Test2: 1210070 Java Test1: 9651995 Test2: 1029374 Is this strictly behind list implementations ? If yes,...
From a very high level view, to me it seems there are generally 2 types of Project Management tools: Traditional issue trackers like Fogbugz, JIRA, BugZilla, Trac, Redmine etc. Virtual card boards / agile project management tools like Pivotal Tracker, GreenHopper, AgileZen, Trello etc. Sure, they overlap in one way o...
Possible Duplicate: How to productively spend “free time” at the office Sometimes, especially at the end of the year in software companies, there is less work for the team, which happens in my company. What should I ask my developers team to do during these cold days? What things can they do to keep them focused and ...
Lets say I am building a jQuery plugin that has a number of non-configurable css attributes it needs to apply to DOM elements the plugin itself creates. Is it consider better practice to apply the css directly in the javascript code or is it better to create a css file and just include both the css and javascript file...
Serious help needed here. I love programming. I've been reading bunch of books(such as K&R) and articles/forums online for C language lately. Even tried looking into Linux code(although, i was lost where to start but peeking into small libraries helped?). I started as a Java programmer and in Java it's pretty cut and ...
What are good resources on how to write a lexer in C++ (books, tutorials, documents), what are some good techniques and practices? I have looked on the internet and everyone says to use a lexer generator like lex. I don't want to do that, I want to write a lexer by hand.
Given the following assumptions: The amount of available data storage is highly limited All data is international As much storage as possible must be preserved since it will be used for something else Is there any widely accepted standard or best practice which defines how much storage should be allocated for those ...
I will quote the problem from ACM 2003: Consider a string of length n (1 <= n <= 100000). Determine its minimum lexicographic rotation. For example, the rotations of the string “alabala” are: alabala labalaa abalaal balaala alaalab laalaba aalabal and the smallest among them is “aalabal”. As for the solution - I know...
Possible Duplicate: Do you think that exposure to BASIC can mutilate your mind? BASIC, and related dialects, have long been branded "bad". I've seen it said by some of the best programmers I know, professors at Stanford, and even one of the most brilliant computer scientists: It is practically impossible to teach g...
Possible Duplicate: Why do most of us use 'i' as a loop counter variable? I was just writing a nested loop and got to the point where I was using l and m as variables to control for loops, and I realized this could get very confusing; Ive already had a few bugs when I copied blocks of code to different levels. So I...
For my app that I'm about to release, I have used a bunch of 3rd party classes found for free online. I checked all the liscenses before using the code and each one said I could use the code commercially So now what I'm concerned about is do I have to give credit somewhere in my app to the creater of that class? Also...
Is it possible for a method to know the type of the method it is called under? So for example in the following object orientated psuedo code: Instance io = new InstanceSubclass(); io.doStuff(); Is there a language that allows doStuff() to know that it was called as an Instance? The question arose out of the fact the ...
Given the existential type T = ∃X.{op₁:X, op₂:X→boolean} and this generic Java interface: interface T<X> { X op₁(); boolean op₂(X something); } What are the fundamental differences between the existential type and the Java interface? Obviously there are syntactical differences, and Java's object-orientation (...
Recently I came across a number of undefined features in C, one of them being the following: https://stackoverflow.com/questions/8698048/behaviour-of-non-const-int-pointer-on-a-const-int Could someone tell me what should I answer when such a question is asked during online exams ( and None of These / Undefined option i...
I have a class that is meant to generate a random password of a length that's also random, but limited to be between a defined min and max length. I'm constructing unit tests, and ran into an interesting little snag with this class. The whole idea behind a unit test is that it should be repeatable. If you run the t...
What are the legal obligations to put into evidence that my application (I am the author) is open-source (especially when it is derivate), if I want to sell copies of it? I mean, could my open-source application be sold, with all the licensing stuff and source code inside and not hidden, but without saying so in the ad...
I was discussing with a senior developper coding conventions to apply to our projects (mainly Java/JEE projects). I disagreed with one convention he proposed: Instance variable names should start with "_", local variables with "loc", and method parameters with "par", so it would be easy to identify a variable orig...
I'm implementing a bounding volume hierarchy in F#. Since it would be for a game, I want the garbage collector to be as quick and infrequent as possible. It seems though that I may have to pull some whacky tricks, probably pre-allocating everything. That means that I can't have many things immutable, and that I have to...
We have a bigger application server which customers would like to have deployed locally. It consists of an MySQL server database, a REDIS database, multiple Web servers for sub parts, a NGINX reverse proxy so that these web servers are reachable from Port 80 and a homegrown C++ server. All sub parts (DB, Webservers, .....
I am trying to practice writing code for a long period of time before compiling and write unit test (if possible) for what I wrote (the language is C++). Of course, I got the IDE support (Emacs or Eclipse for on the fly error detection and code completion) with minimal or no error. I practice this ability because the p...
I have about 4000 lines of code for a web-application in JavaScript / PHP / CSS / HTML. How can I test it properly? I only support the latest version of IE and Safari. I've worked out all the bugs. Is there a good way to test it so that I could go so far as to call the code robust? I've considered using perl Mechaniz...
Possible Duplicate: How do you prevent the piracy of your software? Is possible to protect some file from copying if you are administrator of machine? I heard some story about some behavior: one software developer sells his software in some way. He is installing it on every client's computer and this software does n...
I know C# pretty well (self-taught, sadly) and need to do some C++ programming for a Windows application. I have been able to find a ton of information for C++ developers learning C# but haven't been able to find much on learning C++ when you already know C#. Has anyone come across a good rundown of the basics? MSD...
Should I learn Lisp as my first programming language? I have no prior experience but have heard great things about it from programming friends.
I am interested in ultra high frequency trading and Java is the language I know best. I was always under the impression I would have to perfect my C++ skills in order to work within the ultra high frequency domain (no pun intended) because a lot of job specs seemed to ask for this. Elsewhere on the internet i have se...
I am working on a project in PHP that does a lot of input validation and can throw different custom exception classes in various layers of the application. To make the project code easier to read, I've displaced all the validation code into static methods of a validation class, which performs the check and throws the a...
Are there any specific reasons for a developer that deals with web applications (let's say writing html and js) to download a browser's source code (like Chromium) and learn how the engine works (renderer, javascript vm, network processing, etc.)?
I'm working on the UI-side of a project which is under intense scrutiny by our Marketing group. Most of the time, we're reviewing functionality requirements. Once in a while, however, they will get very in-depth regarding colors, styles, etc. For example, I've been tasked by Marketing to make one particular button a ...
I have been doing some research on developing on the Android platform and found that the only way to develop an app using C++ is using the NDK. I also came to know that the NDK has limited support to C/C++, with C++ having even lesser support than C. Here's the problem. I need to develop using C++ as I'm not very famil...
I am part of a development team that is relatively new to Scrum, suppose that at the end of the sprint a few large stories are either in progress or were not accepted by the PO. Firstly, what happens with those user stories? Do you just carry them over into the next sprint? If so, should they be re-estimated? In my vi...
I'm converting a procedural based site to an OOP design to allow more easily manageable code in the future and so far have created the following structure: /classes /templates index.php With these classes: ConnectDB Games System User User -Moderator User -Administrator In the index.php file I have code that detec...
I believe this is a little related with this question: How to be a zero-bug programmer?. But I believe this is more regarding clumsiness in programming because I know it is impossible to become a zero bug programmer. Often, I write a very buggy code caused by my own clumsiness. For example in writing a currency rate c...
I am looking for sorting algorithms that can work on a large amount of data, i.e. that can work even when the whole data set cannot be held in main memory at once. The only candidate that I have found up to now is merge sort: you can implement the algorithm in such a way that it scans your data set at each merge withou...
I'm aware of some general best practices when designing a database for an application, but what about redesigning? I'm on a team tasked with re-designing an internal business application, though despite me saying "internal," I'm unfortunately many, many layers of people away from contact with the actual users of the sy...
I've been tasked with creating a small web application, where users have a series of forms (I can't currently think of a better way of doing this) which will contain, either a)text input fields or b)drop down lists. The form will look as follows: form1 input box input box drop down box form2 input box input box drop do...
Given a 3rd party API with a very cumbersome object with many different responsibilities-- we decide to wrap using small, manageable, single-responsibility objects. This is the gateway pattern (I think). So any time you do this there is going to be some kind of "connection" where you have to connect to the resource. ...
I'm writing a code review process document for our team; we've never had a formal process in place although we do do some code review. I've found lots of articles talking about how important code review is, but I have one question in particular that I haven't found the answer to on the web... is the programmer part of ...
I know the concept of orthogonality, but from a programming language point of view, is there a way to verify/prove it? For instance in C#, one can use public or static for a method signature. You can use either or both and they wouldn't interfere with each other, so they are orthogonal to each other, right? My question...
I know a lot of software shops keep binaries under source control. However, our shop had come to store entire frameworks on the repository: DirectX runtime, CUDA, nVidia Optix, whatever. It is said to make a dev machine setup easier (supposedly, get latest and start coding). However, it considerably bloats the reposito...
If we look at typical implementation of a Class, we usually see the private members defined at the beginning and public( mostly functions and Accessors) defined towards the bottom. Now, is this a Industry standard agreed by a lot of people? How about keeping the private members towards the end as updates and additions ...
Currently, I'm following a course on embedded software development. The lecturer has chosen J as an architecture language for model-driven software development. J itself is a very terse programming language and one of his main arguments for this language is its terseness. For instance, this is a Quicksoft implementatio...
I'm currently in my placement year and working for a great software development company. It was always my intention of getting to this stage through university, getting enough academic experience as well as the year’s placement and then try to get a full time programming job without the need to finish my degree. I deci...
We have a web application that we want to start running regression tests on, and have pretty much decided that we will be using Selenium 2. Not all of the testers are programmer savvy. Is Selenium IDE usable for this? Which other recorder alternatives are best for Selenium 2?
We have a web application that we want to start running regression tests on, and one of the things I'm supposed to look for when choosing an alternative is a tool that has a recorder. However, I get the general feeling that it is frowned upon, and that writing tests in code is preferred. What are the eventual disadvant...
My idea of an enterprise app store is that there is a page on the company's website where all the apps that that company developed for its employees are listed so they can use them. And access to this apps is restriceted to the employees of the company. As far as I know you can download an Android App from any website ...
How are exception messages commonly stored? for any domain. I'm thinking about this from a maintenance standpoint. if(!Condition1) throw new Exception("Some exception"); if(!Condition2) throw new Exception("Some exception"); If it was decided that the exception message in that snippet needed to be changed, i...
Like many websites, we use email addresses as user identifiers for logins. RFC 5321 [#2.3.11] states that the local parts of email addresses: MUST be interpreted and assigned semantics only by the host specified in the domain part of the address This means that applications processing email addresses can't second gue...
I'm currently using Codebase for all my project management (where I'm learning Agile). I use it for tracking bugs, user stories (via tickets), wikis, files and git hosting. However, I'm looking to improve on this and find some tools better suited to things like bug tracking, managing stories, git hosting, collaboration...
We have a crawling engine that uses curl and caters to about 400,000 ppl / month. Although curl supports concurrent downloads, it does not support bandwidth limiting ( only in php 5.4.0 ) which is why my boss wants me to move to aria2. He also says Aria2 is faster ( which seems to be true to me as well ) Aria2 would r...
I have made an Asp.net MVC website and hosted it on a shared hosting provider. Since my website surrounds a very generic idea, it might have number of concurrent users sometime in future. So, I was thinking of a way to test my website for on-load performance. Like how will the site perform when 100 or 1000 users are on...
When dealing with a project that has many different files, I always seem to loose track of how the parts interact with one another. I've never really had much of a problem understanding smaller components in isolation, but as the complexity of the project increases, I find myself unable to mentally construct an underst...