instruction
stringlengths
34
19.9k
I am looking for a good Java Graph Library which is thread safe for concurrent access. JGraphT, JUNG, JTS are very good but again for concurrent access I will have to synchronize it externally which is becoming a pain. It is a pain because say If thread A have to access 50 vertices, Thread B for another 50 with the int...
I work in a bunch of tools that do things to customer's computers. Some of these tools allow scripting, which allows someone to run a script to nuke files, registry keys, or the like. Of course, if the script is bad, or if there's a serious bug in the tool, it could cause damage to the person's system. I'm concerned th...
I am working on a webapp project using flask framework and sqlalchemy orm in python. Its the first time I am working on a project like this and I am having trouble in how to divide work properly among my teammates. We are 5 guys, one is handling designing, two front end and 2 on backend. I am on the backend. Flask foll...
In minecraft, before creating a world you have an option to input a seed. The algorithm takes the seed and creates a completely unique world. How does this work?
I am looking for some advices, resources or articles about how to expose a Platform API to outside developers. My main concern is what is the standards or best approach to do that, basically I have a set of REST API services of the platform and need to understand how to address the following issus : API Hosting and Ma...
I am new to Django. I have found the official topic guides https://docs.djangoproject.com/en/1.3/ an excellent place to learn from. But now I am in a place where I need quick reference to see what methods an object has, what arguments it takes, what it returns etc, kind of like the Python docs or Java docs. More of a r...
I have seen and read quite a few books about software design (using UML, etc.), and others about user experience, GUIs, etc. but I'm looking for books that describe the process that happens before all of that. I'm looking for the pre-development stuff. How to develop a cohesive and comprehensive plan for what the appli...
A little overview about what my group does ... I work in a development team in a fairly large insurance company. My group's responsibility consists mostly of building applications for our employees. Stuff like tracking systems, scheduling applications, contact directories, etc. Of course we have a decent amount of "s...
What document types could be used when describing software testing automation (on any phase, automation planning, test design, implementation, reporting)? Is there any standard types of documents? If someone could provide any examples and templates for different types of documents? What is the difference between manual...
I'm curious how other development teams (especially those that work in moderate to large development groups) track "future" features/wishlists for functionality for internally developed frameworks or components. I know the standard advice is that a development team should find one good tool for tracking bugs/features a...
Very short introduction (this is quite a context-heavy question): I'm a 17 year old programmer, doing some projects, usually netting around 20 files of 200 lines each. I usually don't program very low-level, more high-level with battery included API's like Python + pygame and Lua + WoW API. Nevertheless I've written qu...
Python has a nice function in the standard library random.choice which returns a random element from a sequence. But none of the other languages I've developed in have thought to include such a feature. Do other languages provide such a feature? Why not?
So, I've been tasked to work on an integration project where we will ask customers for credit card information and send it over to our integration partners, who will process the payment/cc info and process the rest of the order. So, one the tasks for become PCI compliant. However, the partner is also looking to get PC...
Studying some classes of Android, I realized that most of the variables of methods are declared as final. Example code taken from the class android.widget.ListView: /** * @return Whether the list needs to show the top fading edge */ private boolean showingTopFadingEdge() { final int listTop = mScrollY + mListPaddin...
I wonder why are weakly-typed languages still being actively developed. For example, what benefit can one draw from being able to write $someVar = 1; (...) // Some piece of code $someVar = 'SomeText'; instead of using the much different, stongly-typed version int someInt = 1; (...) string SomeString = 'SomeText'; It...
We currently use a system called AsciiDoc which allows us to create documentation in a simple text markup. From that we can generate multiple output formats. We only make use of the pdf output and chm output formats. I was wondering if there was an alternative to chm? What I am looking for is something that can be used...
I need 2 capabilities: calculating mutual friends distinguishing between different types of edges, (e.g. FRIEND, ENEMY and other) getting relationships distinguishing between different types of edges as over My problem is speed: If I use a database as MySQL, I can get thousands of relationships in few moments, but if...
Let's say you're looking at breaking up your applications into services. Are there any good reasons to adopt a SOA approach vs. just creating a library API that can be loaded by the applications that need it.
I am designing an WPF app shell using MEF. I would like to have the app start a "view" upon startup. I also would like the option of having another add-in have a "startup" attribute and then the app would load that one instead. I've made an interface: [InheritedExport] public interface IStartupParams { /// <summary...
I've been using the MVC pattern in my applications for years (with full separation of the controller from its views). Having to implement several hundred views to represent a little over 100 model's for a potential contract, this time around I'd like to reduce the development time of my UI tasks and also add a few addi...
I haven't touched algorithm complexity stuff in quite a while, so I am trying to do a refresher. I am trying to figure out the number of steps in the following for loop. for(i = 0; i < n; i++){ //code for(j = i + 1; j < n; j++){ //code } } The inner loop will be executed times I mean t ti...
My team has been using Scrum for years with a goal to deliver a potentially releasable build each sprint. We recently started using a Kanban board moving away from time-boxed delivery to feature-boxed delivery. So far, this seems to better fit the teams natural way of working. With feature-boxed delivery, stories ar...
I have some problems in my hand and would like to resolve them by myself (rather than hiring some professional, obviously due to cash problem!): build a really good website (planning to set-up my own start-up). build some good software (preferrably with exe installation files) on many mathematical and statistical tech...
I am just about to start my Java journey, ( I've already dabbled in C++) but I am getting really confused about all the different versions of Java: JavaSE JavaEE JavaFX etc. Can someone explain these in detail?
TLDR: Are models supposed to be application-dependant and totally worthless when starting a new application, or are you supposed to design models independently so that they act as stand-alone classes/libraries? (This would make little sense with a framework such as CodeIgniter where you extend the CI_Model which obviou...
I'm in the very early stages of writing an application to mine through Twitter data looking for certain types of information. I've been using Twitterizer, which I have found effective in downloading the information (it provides interfaces to the "old" REST based API, and the newer streaming one). This would only be fo...
Possible Duplicate: I don't know C. And why should I learn it? I start my programming from Java, and learned PHP. Also, because of the work, I learned Objective-C. But most of the programmer learn from C. So, is this necessary for a programmer to learn C? If yes, how important it is? Please drop your comments, thank...
I'm confused about the PO's responsibility here. I was a developer on a Game Feature Team, but also a PO. The daily work of the developer is almost full time, so I have to work over time to take care my PO duty, and the responsibility of PO seems to be against developer's thoughts. As a PO, I will chose more features ...
My goal is to learn how to program a website with Python/Django in the next year. From what I've understood, I also have to learn HTML, CSS, JavaScript. I understand in order to build a website, I will need to find a co-founder whose skills far exceed mine. But still, the situation will be way different if I'm a person...
I'd like to draw (pen and pencils) threads interaction in a UML(-like) notation. I don't insist on UML, anything that is obvious to the reader should do. I started with sequence diagrams, but I don't feel this is the best way to do that. All the time, there would be "action initiators" coming from off-screen which kind...
I'm the lead designer in our team, which means I'm responsible for the quality of the code; functionality, maintainability and readability. How clean should I require my team members' code to be if we are not short on time? In my view, we should clean up old code we modify; adding a line to a method means you clean up ...
I know it may have been asked before, but here goes nothing... Is Perl still something that would be considered useful? If someone was a new programmer (either completely new to programming or just a few month/years of experience) would Perl be something to be considered worthwhile to learn? Is Perl still used with fre...
There are some great libraries for Python that have cousins in the .NET world, but some are unmatched. Realizing that Python is a dynamic language, which makes it difficult to mix with a (largely) statically typed language like C# (though this is seemingly getting easier with .NET 4.0), there are options like IronPyt...
I'm planning to buy a book to learn C Language. Many say K&R is a must-have book for C programmers so I chose it. I see that there are two editions. What are the differences between them?
A professional full-time programmer can do a great job by continuously learning from their work. How can an amateur programmer train to become a good programmer? ** If you like to play music or sing, you can do it because it is your hobby and you are interested, and you can become a good singer or music player. But yo...
I'm talking about unit tests in the TDD sense. (Not automated "integration", or what you like to call it tests.) Legacy code as in: (C++) code without tests. (see: Michael Feathers' Working Effectively with Legacy Code) But also legacy code as in: Code that our team has been working with for the last 10-5 years, so we...
We're in the business of automated trading and our team consists of two bigger groups, I call them data producers and data consumers. The producers' primary task is to maintain a chain of smaller tools that push some real-time data through an indicator system and out comes an order. All the data that was needed or pro...
Possible Duplicate: How do I create my own programming language and a compiler for it Note: This is not a possible duplicate; it is more specified. What is the first step into making your own programming language? Is it something you jump into, or are there steps you must take? Thanks!
I'm creating an object whose sole purpose is to read in a file of one format and create another of a different format. Is it best to create the output file implicitly during object initialization or to have a public method that gives the user the choice when this file will be created?
We have implemented Scrum quite successfully for the past 5 months. Though, we are 3 weeks away from PROD without ever doing any end-to-end integration test. OUCH! I need help. Without tackling the causes of this (at THIS point), we need now to plan the current iteration, which consists of minor improvements and MANY s...
I started using Github now that I'm working on a project with some guys. And I started to wonder if I should use it in my personal projects too. I'm not sure if this will help me in some way or if it is unnecesary?
Possible Duplicate: What should every programmer know about web development? Where do I start if I want to build a web based application? Books, tutorials, online resources. From a quick look at the web I can see that Html, Css and JavaScript should be the subjects to learn. Do you agree? What would you recommend ...
I have recently been reading Hohpe and Woolf's Enterprise Integration Patterns, some of Thomas Erl's books on SOA and watching various videos and podcasts by Udi Dahan et al. on CQRS and Event Driven systems. Systems in my place of work suffer from high coupling. Although each system theoretically has its own database,...
I am reading the following in a book on algorithms (Cormen's to be specific): That is, we are concerned with how the running time of an algorithm increases with the size of the input in the limit, as the size of the input increases without bound. I can not understand what is the meaning of the phrase: with the...
I have entered into an existing project that is all about maintaining nested data structures. You have companies which are assigend to accounts, and contacts and notes and... basically the usual bunch of 1:1, 1..n, n:m Database relations, stored in mysql or postgres, wrapped by Doctrine. Of course, every node comes wit...
I watched a Google Tech Talk presentation on Unit Testing, given by Misko Hevery, and he said to avoid using the new keyword in business logic code. I wrote a program, and I did end up using the new keyword here and there, but they were mostly for instantiating objects that hold data (ie, they didn't have any functions...
After having hard time trying to remember details of my past projects several years ago I was wondering how programmers usually keep track of that? This kind of information comes handy with job interviews etc. Do you write down technologies used, challenges faced etc to some kind of "jumbo CV"? Or do you just trust you...
I've thought for about six months now that I should join an open-source iPhone or iPad project to hone my skills in Objective-C, but every time I go to do it I see thousands of lines of code on huge projects that I end up convincing myself I would never understand. I always think that my commits would just end up being...
Alright I'm new to programming and I admit this is a fairly abstract question. The natural language we speak every day exist because people can understand each other. How can computers understand my code written in a certain language? Let's say Mr. A creates a new language. How is that accepted by machines? Must the cr...
What is the fascination with taking old concepts coming up with a buzzword for them and pitching it as new technology complete with 800 page tome with nerd on the cover? A long long time ago, lets say the 80's, I wrote software. It was designed reasonably well and it worked and was maintainable. It separated out differ...
Assumptions: Minimalist ASP.NET MVC 3 application for sending emails where the view represents the contents of an email. Over 500+ email types. I would NOT like to have 500+ actions in my controller corresponding to each email type. Email types are stored in an enum named MailType, so we could have: MailType.ThankYou...
I just read Balancing Agility and Discipline. Poor title aside, it contrasted a plan-driven project team that was employing PSP/TSP and an agile team using Extreme Programming. When the authors provided an example of a plan-driven methodology, they used Personal Software Process/Team Software Process. Although, out-of-...
The BitBucket capabilities, and pricing (up to 5 users for free) left me wondering what the catch was... there is no such thing as a free lunch, after all. What is BitBucket getting out of my unpaid participation, besides a handsome man to freely include in their promotional materials (per the TOS)?
I don't know much about C# but I've been programming in Java for a few months now. I had always heard what C and C++ were, but was a little curious about where C# came from. I'm a little confused about the C# language since even though it's one of the 'C' languages (C, C++, C#), on the other hand all of my professors s...
We waste a lot of time using tool specific terms when we are all really talking about the same things. The problem is that person1 is familiar with toolset1, person2 with toolset2 etc. So each uses a set of terms that they are the most comfortable with and in the end, we end up talking at cross purposes. Has anyone com...
Aren't you essentially writing the same data twice, to the disk? Doesn't this cause a slowdown of a factor of ~2x? What optimizations can be made to minimize the cost of having to write things twice?
I was talking to a co-worker and was talking of how Database operations usually can be broken down into one of the elements of CRUD- Create, read, update and delete. That's when I realised that I do not know how to pronounce CRUD. So is there a definite, well accepted way to pronounce CRUD?
When I make a web app I test my work on the browser to see if I receive any errors and fix them. I have made complex applications and testing this way has been easy and fast. I have watched many videos on youtube regarding phpunit and cannot find a purpose for it. Why is this library useful? Is phpunit more for php fra...
How do I unit test a web forms site? It seems to me that as so much of it depends on state and user input it wouldn't be feasible. If it's not feasible is there a valid automated alternative?
Please excuse the artwork, I know it looks like an elongated imperial shuttle, but it's the way I visualise a multiple team (or multiple stream) version control strategy. The central core, is the trunk (or master) repository. If there were lots more streams you can imagine more planes projecting out from the trunk, in...
I am looking to incorporate a domain name lookup facility in my website to make sure if a domain is available or not. The only api I could find on the net is http://www.domaintools.com/api/docs/domain-search/ . But this is paid. Is there any other api available which might be cheaper / free. I am working with php, quer...
I am using Hg for my development. Recently, I upgraded to Lion and Xcode 4.2 and I have created a Xcode project in my source tree. The Xcode by default uses Git and created .git folder in the project folder. Being able to do versioning in Xcode is a plus but it is sort of redundant with both Git and Hg. The problem is...
I have a confession to make: Formalized automated testing was never a part of my programming background. I now work in a very large company with many developers (most of them web developers of one sort or another), and it's apparent that most of them don't test* either. (*I'm not going to keep saying formally; please i...
I'm making a java app. Is to solve a problem in engineering. I'm thinking that it would be nice to sell it as an app in the google chrome market, but I'm worried about security. I've been trying to find any info on the subject, but to no avail. Does anybody have any thoughts on this? how secure is the google chrome mar...
I am creating a rails app with following constraints It has no database It uses a web API to store and retrieve the data The connection to the web API is via a custom gem. The Gem has a basic functionality to make a web API call based on the parameters given. I have 2-3 different kinds of object that I can think of (...
I've been reading about the C10K Problem, and of particular note is the part that refers to asynchronous server I/O. http://www.kegel.com/c10k.html#aio I believe this pretty much summarises what Node.js does on the server, by allowing threads to process user requests whilst relying on I/O interrupts (events) to notify ...
How widely used is alloca in the real world? Should I teach my students to use alloca when it makes sense? Or should I teach them never to use it? Coming from a C++ RAII background, the idea of not having to call free manually sounds promising, especially in functions with multiple exit points.
I have developed a few websites and applications using C#, and lately I've been developing a website in ASP.NET MVC. To be honest, this has pissed me off somewhat as it has me feeling like I have zero knowledge. So many things work under the hood in .NET that I'm just not able to focus and understand what is left to th...
In class today we were introduced to the MVVM architecture for Silverlight/WinPhone/WPF; it looks nice for big projects, but what are your thoughts on MVVM? What are the pros and cons? I want to get more into the architecture so that I know when I should use it.
I'm reviewing my peer's code. I use SourceGear DiffMerge as my diff program, on a Windows environment. While I'm using the diff program, I can clearly see the code changes, etc. Is it possible to save the diff display somehow, with all its colorful rendering and strike-throughs so that I can send my comments by mail? I...
My understanding is that C++ is usually offered as the 1st OOP language, and as the 2nd programming language (after C) in my country (Bangladesh). I've taught it several times, and the problem I've run into is that students often tend to think C++ as an extension of C, i.e. C with cin and cout! This has lead me to thin...
We're considering teaching some employees who have either zero or general hobbyist level programming experience to take workload off me. We use Python/Django which has some of the friendliest documentation around and a breeze to learn. I'm currently a one man IT department for my company and I don't have enough hours ...
I confess: I have a problem to "Keep It Simple and Short" most of the time because trying to make it according to the books I have read, design-patterns I have heard etc. gives me such an enthusiasm -an enthusiasm coming from the sense of that I am on the right path to a probable perfection. On the other hand, yes, it ...
This is somewhat similar to this question but more broad. In general, with ORMs like EF 4.1 supporting POCOs, does it now make sense to have your domain entities be the objects that are persisted to your database? With older ORMs like EF 4 or Linq-to-SQL, your "database objects" were auto-generated, and tightly coupled...
Consider conflict markers. i.e.: <<<<<<< branch blah blah this ======= blah blah that >>>>>>> HEAD In the particular case which has motivated me to post this question, the team member responsible had just completed a merge from upstream to our branch, and had in some cases left these in, as comments, as a sort of docu...
need some of you to remember back to a time when you might have been bad at programming... Been at my new job (as a software developer) for a couple of months now, passed probation period. Have very little programming experience (C++ only) and am currently working with asp.net MVC and silverlight. So there's a website ...
I'm just starting out with some articles and tutorials. I am looking for some guidance on which languages to start with and what is the best way to go about learning code, books, tutorials, classes. Which tutorials or books are best? Is it possible to learn this stuff online? If so how? Thanks for any help!
When is it appropriate to use a fall-through (classic) switch statement? Is such usage recommended and encouraged or should it be avoided at all costs?
Possible Duplicate: Do people in non-English-speaking countries code in English? I am from the Netherlands and we speak Dutch. I have worked on quite a few projects now in various languages, and I must say what always annoys me is the mixing of Dutch and English words in the naming of urls, variables, classes, file...
I generally favour using small methods, as recommended by, amongst others, Bob Martin in Clean Code. I've also read enough about Objective-C's internals to have at least some idea about how its message dispatch works (bbums series is particularly informative on this). Premature optimisation concerns notwithstanding, I'...
I found this question on stack overflow and I have a question about one of the answers: In Zend Framework, forms are typically objects with decorators, but usually (I thought) processing is done using a combination of controllers and models, with the main objective to keep the controller as lightweight as possible, an...
I'm writing an online game that has to run in a web browser and I'm worried about whether my server-side architecture will be able to handle the load. I'm designing for 1000-2000 simultaneous clients. Each client will need to query the server once every 2 seconds - so 500-1000 transactions per second is my design goal...
Background So I have developed an order system and order tracking for a organisation. Currently it is web based with plans to develop a mobile application and a desktop application. The business model is an exclusive membership where you sign up to be able to distribute their products at a cheaper price than other comp...
My team and I are developing an enterprise-level application and I have devised an architecture for it that's best described as an "Expression Tree". The basic idea is that the leaf nodes of the tree are very simple expressions (perhaps simple values or strings). Nodes closer to the trunk will get more and more complex...
I'm using the Model View Presenter (MVP) pattern as described in The Humble Dialog Box paper (pdf) with an MFC project. I'm sure the issue is the same with most GUI toolkits. The thing that's bothering me is the concrete view (i.e., the dialog class) is creating not only the presenter but also the services that the pr...
I am trying to solve programming challenges on www.interviewstreet.com using PHP. Are there certain techniques I should keep in mind that will optimize the efficiency of the algorithm? For example, I read that using PHP's language constructs versus function calls are faster. Is this true? Any other tips?
I'm working on a project that involves the chaining of separate jobs into a single master job, though there may be parallel paths in the chain leading up to the final output. Job and chain details will be stored in a database. Eventually what I want to end up with is a GUI in which blocks representing the individual jo...
I want to compare the performance of two search trees of integers (an AVL tree and a RedBlack tree). How should I design/engineer the tests to accomplish this? For example, let's consider the insert operation; what steps should I follow in order to state that on average this operation is faster in the RB case? What con...
Is there any view on whether using the #define to define full lines of code for simplifying coding is good or bad programming practice? For example, if I needed to print a bunch of words together, I'd get annoyed typing << " " << To insert a space between words in a cout statement. I could just do #define pSpace << " ...
I really like pair programming for particular projects or features. It can act as an immediate sanity check and increase code coverage across your development team. That said I always seem to run into an issue regarding editors. I primarily code Ruby and I personally like to use VIM whereas other developers on my team ...
You can have different HTML input elements on a single HTML form and all of them, have their associated remembered values (values that you've entered in those fields); Is it related to the id or name attribute of the input element? No. Proof? Your email address appears on many input elements across different websites, ...
Possible Duplicate: Why do most programming languages not nest block comments? Most languages I've worked with don't have support for recursive/nested comments. Is there any reason why language designers would choose not to implement this? Is it deceptively complex? Would it have undesired results? I know there co...
I'm trying to understand if JavaBeans is a good example of encapsulation. In my view, it's not as usually all the internal state is exposed through getters and setters. A simple example is public class Test { private List<String> names = new ArrayList<String>(); public List<String> getNames() { return ...
I have an HTML form, with more than 30 fields in it. When this form is submitted to the server, all of the values of the fields should be trimmed. In other words, no value should start/end with any kind of whitespace (\b). There are many options available for me: Manually trim each value Looping over values and trim ...
When Java was developed, it's designers chose to discard an unusual amount of the conventional wisdom established in the UNIX and C oriented toolchains. For one (and in my view) the most major example, they chose to discard the practice of header files and Makefiles and tried to build a monolithic, dependency-aware com...
One of my friend was asked this interview question - "There is a constant flow of numbers coming in from some infinite list of numbers out of which you need to maintain a datastructure as to return the top 100 highest numbers at any given point of time. Assume all the numbers are whole numbers only." This is simp...
At the company I'm working we support two versions of the software we develop. One version is available for customers, and one version the developers are developing new functionality in. The version available for customers is also changed by developers, to fix the bugs our customers have found. So, for example we have...
Back in my self-employment days, I've once taken on a small and rather well-paid project: "A newsletter system", the spec stated. Everything was fine, invoices were paid with each milestone reached, me was a happy developer … Until Mr. Client started demanding mail header spoofing and a bunch of other functionality ev...
Counting lines of code and comments is sometimes bogus, since most of what we write may be written in one or more lines, depending column count limitations, screen size, style and so forth. Since the commonly used languages (say C, C++, C# and Java) are free-form, wouldn't it be more clever to count characters instead?...
I have written a warehouse management web app. The application handles batch picking, warehouse routing, packing, and the final piece is handled by UPS worldship to "ship" the packages. Worldship will write a record to my postgres db after every shipment or void. I need a way to cleanly see that the record was written/...