instruction
stringlengths
34
19.9k
I always veto JavaScript by using CSS as much as possible. i.e. I create tabs and rollover buttons using CSS rather than JavaScript. I have seen some solutions—specifically the Wt web-framework—which advocate JavaScript; but gracefully downgrade to CSS if the browser isn't capable/js-disabled. I know CSS and JavaScript...
Object orientation has helped me a lot in implementing many algorithms. However, object-oriented languages sometimes guide you in "straightforward" approach and I doubt if this approach is always a good thing. OO is really helpful in coding algorithms fast and easily. But could this OOP be a disadvantage for software b...
I'm developing a web application for a university project. My professor wants we to use a multi-tier architecture (Client, Web, Business and Data tiers) with EJB. For the Web and Business I have chosen to use the MVC pattern. Anyway, little by little, I build the tiers in this way: the View (JSP and Servlet) ALWAYS for...
I have my mind set that I'm learning Java as my second language (I am a Perl developer). But just from reading a little of the online tutorials, I really can't find any similarities between the two. What will I have an easy time understanding when learning Java?
I'm exposing Data objects via service oriented assembly (which on future usages might become a WCF service). The data object is tree designed, as well as formed from allot of properties.Moreover, some services return one objects, others retrieve a list of them (thus disables throwing exceptions). I now want to expose ...
There's an open-source project that I'm interested in and use regularly. It's licensed under the Apache License 2.0 and it has basically no activity any more. It's hosted on Google Code and I'm interested in continuing it's development. I'm new to the open-source process and I'm trying to figure out the appropriate way...
Suppose this: void func() { ... if( blah ) { int x; } ... } Is the space for x reserved on the stack immediately when func is entered, or only if the block is actually executed? Or is it the compiler's choice? Do C and C++ behave the same about this?
I'm currently working with Java / C++. I'm interested in web development and am planning to shift my stream. I heard that PHP is a good platform to start off and also it does not require that much of knowledge in technologies like JSP / Servlets or frameworks like springs / struts / hibernate. I have basic ideas about...
I'd like to note your experience of full scale IDEs on Linux. I personally work mostly with vim, however other programmers would like to see a real IDE. So I'd like to hear your personal opinion about different IDEs and comparison between them, in following context: C++ and maybe some C development (not Java, Python a...
Is it acceptable to have a dummy generic parameter in the parameters list in order to save method consumers from the need to specify type arguments? For example - public T Generate<T>(int paramForInstance) where T : MyClass { return MyClass.SomeFactoryMethod<T>(paramForInstance); } //calling code needs to specify ...
This is a follow up to my previous not answered question, so I try to make it more clear: last question. I have a n-size buffer that is filled up from an external source, it has 2 main methods get() and add(), get() blocks (via wait()) if buffer is empty and add() blocks if buffer is full. This buffer object referenc...
I have an entity and I've realised that there is a group of properties that work together. So, I moved them to a value object (together with their behavior) and now I have a reference from my entity to this value object. I've read "Domain Driven Design Quickly" (PDF) and I came across the following statement when expla...
I'm a university student and I've just started learning about design patterns and im struggling to understand the purpose of them. I have tried researching them but all the resources I have found seem to talk about them in an academic, not professional, way. What is their purpose and are they important to learn?
Free software as defined by FSF. Are its standard libraries free/open source? Is its implementation free/open source? Which parts of it are not free/open source? Any other relevant information.
I've been looking for various licenses that I can use for an open-source project of mine, but all of the projects that I've seen, with all kinds of licenses, appear to have a giant, obnoxious (in my opinion) notice in each source file that states that the file is listed under a certain license. I don't think that I've...
A lot of bad practices were being committed at the beginning of a project, and I recognized them and fought against all of them. Since I didn't pick and choose my battles, my boss now assumes anything out of my mouth is an over complicated response, and spends a lot of time defending himself personally, instead of look...
I have a two entity objects Site and Customer where there is a many to many relationship. I have read you try not to model this in DDD as it is in the data model and go for a unidirectional flow. If I wanted to show this in UML, would I show it as it is in the data model: Site * ----->*Customer but the direction arrow ...
I have a conceptual question about 'translating' between objects I have stored in Django (in Postgres) that I want to use on the front-end. So I have a user object in Python that holds basic things: an id, a username, a password. Let's say I want to output all of that information using Javascript on the client side. Ca...
I'm developing an authentication library (*) for a website and I realized that maybe I'm not completely understanding what an "autologin" feature is, and how to develop it. While gathering infos and studying other code I came across a couple of libraries which implement the option to login the user without having to s...
Reading these two questions, I see that understanding CPU caching behaviour can be important when dealing with large amounts of data in memory. I would like to understand the way the caching works to add another tool to my optimisation toolbox. What are the core points about the way the CPU cache works so I can write c...
I was just reading another explanation of the halting problem, and it got me thinking all the problems I've seen that are given as examples involve infinite sequences. But I never use infinite sequences in my programs - they take too long. All the real world applications have lower and upper bounds. Even reals aren't t...
Are there any languages that have both high- and low-level facilities? If not, is it feasible to create one? Why or why not? In theory, it would be very helpful to have a programming language that has both shell and regular programming language facilities, like Forth for example can easily be made to, and also to have...
Due to my bad performance on past job interviews, I decided to perform daily programming exercises out of my work. Currently, I am concentrating on algorithms, design patterns, and unit testing in C++ language platform. But I'd like to have balance over more important areas. So if I may, I'd like to know how other pro...
I have some hidden divs that I show via JavaScript when a button is clicked. Right now, I'm hiding them with by using inline styling (i.e. style="display:none;"). This works, but are there general rules or guidelines to follow to determine if I should use inline styles or styling via stylesheets and class selectors?
I am from a country in which the use of the word "Engineer" or "Engineering" is strictly regulated by legislation. This means that you must hold a degree in Engineering AND passed an exam to join the Engineers' professional association to use the title. I am a bit confused about the term "Software Engineer" as used in ...
I am working on a very small project and my design would be using technologies such as JSP, servlets, and POJOs. I'm considering a workflow where a JSP page will receive input data, then submit it to a servlet. The servlet would then have a lot of helper POJOs in it that would do all the real work. One thing I've notic...
Have you ever shipped test code (JUnit, NUnit etc) with your application that could be runnable by the end-user ? Basic Idea is this : The application can be deployed in a varied environment and it is hard to gather all the possible hardware - software combination or pre-requisites for the application. It is however p...
What happens when concurrent requests call the same static Java method running on an application server? Say that a method run takes 2 seconds and receives 100 calls in a given second. The method itself wouldn't read/write outer state. Could it be better to let it be an instance method instead?
I have to document my program for a school project and we have section called "problem domain" but I have no idea what to discuss in this section. So the question is: What should be discussed in the problem domain?
Is it a good practice to separate the handlers and database queries in different classes? There will be a separate class containing all the necessary event handlers, and there would also be another class for database queries?
To be more specific, let me explain my end result goal or more of what I would LIKE to have someday and then you can tell me if its even feasible and if not possibly an alternative method. I really would like to have a tool like smush.it it is a website Yahoo runs that optimizes images, it is currently one of the best ...
I have a series of systems that need to be distributed to a variable number of nodes (at least two, but more likely 8 - 10). For performance reasons, any one piece of state needs to be maintained in memory and replicated to at least two nodes although as demand increases this may be replicated to more nodes as dictated...
I think I have a grasp on the expectations of consumer application development for Windows 8. Create a new Metro-based UI on top of WinRT, deploy it to your customer via the Marketplace, and everyone wins. Seems simple enough. Unfortunately, I'm not in that business. I work on internal, line-of-business applications...
I'm making a web application that will generate revenue from displaying ads. The system is meant for me to run and not sold/distributed to anyone else. My questions are: Can I use GPL licensed jQuery scripts on the website? Can I use GPL licensed scripts while generating ad revenue from the page? Do I need to provide ...
Our functional / business documentation is spread across Word files on our corporate Intranet. It's difficult to find and update information. There has to be a better way. Any ideas? We had thought a Wiki would work great. Would seem to be an easy way to find information and easy for individual developers and analys...
Let's say we're going from 1 to 5. The shortest route will be 1-4-3-5 (total: 60 km). We can use Dijkstra's algorithm to do that. Now the problem is, the shortest route is not always the fastest one, because of traffic jams or other factors. For example: 1-2 is known to have frequent traffic jams, so it should be avo...
I never used SQL Server Reporting Services (SSRS) before but used little Crystal Reports. My present project has extensive use of Crystal Reports for Visual Studio 2005. This choice brought some nasty issues of Crystal Reports in front. The very first report failed to print or export because of a bug. After wasting a w...
I'm choosing a project management solution and narrowed it down to either Assembla or FogBugz + Kiln. These were my criteria: Hosted service but with an option to go to a custom installation (rules out e.g. Codebase HQ) Centered around projects, not repositories (GitHub, although having added some PM features recently...
I am writing a small personal archiving tool. I frequently work with a lot of client databases for short periods, what my tool will do is in overnight batch jobs it will detach the database and zip up the database files and any extra files that where sitting in the folder that the database resided in and move it to a n...
We have a large news-oriented site that has high web traffic. The architecture is your often seen DB - Repo Layer - Services Layer - Asp.Net MVC. The problem that we've been seeing is around read performance. It turns out that all this DDD domain object stuff is great, in theory, for business rules, but has made life h...
What should we include in a SSAS cube design documentation? This is the initial phase of the document. I have included: data models, facts, dimensions, surrogate keys, hierarchies and levels within hierarchies, reports that we can pull from the cube, proactive caching. What else can we include?
In the industry, there is a distinction made between an 'in-house development' environment where the software developers are writing code which will be used by the company itself and a proper 'software development' environment where software is built to be sold/distributed to the public. Among others, one obvious diffe...
First a bit of background: My current development manager is taking another opportunity the end of this week, leaving our team with four fulltime developers, a part-time intern and a web designer (who is technically part of Marketing, not AppDev). At this time we aren't promoting or hiring a new manager. The previous...
So what I wonder about is preaty simple - having in mind next architecture: -> computing unit "A" / gateway --> computing unit "B" same as A \ -> computing unit "C" same as A We do not care to which unit to forward request so we should forward them one by one to A than to B than to C...
I work for the State of California. Our programming team in my opinion is not really a 'team' in that we usually work solo on projects throughout the application/systems complete life-cycle. The end result is a lot of developers are 'reinventing the wheel'... writing their own data layers, even though the vast majority...
Ok, I hope this is not too much confusing (with my poor English). I want to build a small .Net 4.0 app which monitors several other applications on a Windows Server OR on a regular Windows PC. It will have a WPF GUI with a variety of graphical controls. The app will be used in the following scenarios: If installed on ...
Problem: Run commands in the form of a string. command example: /user/files/ list all; equivalent to: /user/files/ ls -la; another one: post tw fb "HOW DO YOU STOP THE TICKLE MONSTER?;" equivalent to: post -tf "HOW DO YOU STOP THE TICKLE MONSTER?;" Current solution: tokenize string(string, array); switch(first ...
Yesterday, I came across Nextag which is a website for comparing prices of various products from different retailers. Is this site automated? Can the process of data pulling from various sites can be automated for comparison with each other. I tried understanding a hell lot, but could not realize this fact and now thi...
Can anyone suggest a java library to perform forward and backward Fourier transform on images? Either RGB or gray-scale or binary , that doesn't matter since I've converted the image to all these ;) I do searched but most of the image processing libraries like marvin, JAI etc don't have Fourier transform. So I thought ...
I am about to start with an application using JSF 2, Seam 3, Hibernate and Hibernate search with the following characteristics: Users will be uploading documents (pdf, doc). There can be millions of documents. The application will be deployed in the cloud. Here are my questions: What will be the best place to store ...
I'm a student, fresh into programming and loving it, from Java to C++ and down to C. I moved backwards to the barebones and thought to go further down to Assembly. But, to my surprise, a lot of people said it's not as fast as C and there is no use. They suggested learning either how to program a kernel or writing a C ...
I'm running a team of 4 developers and 2 testers and trying to abide by the Scrum principle of creating a PSP with every sprint. That means I need to create a potential release with all the user stories that got to Done and store it on some publish server for the PO to do with as they please. My problem is how to techn...
Which is the currently-accepted best practice in terms of C# enum usage, a bitwise [Flags] Enum (compared using | and &) or an IEnumerable of enum values? I'm thinking both from a code-conciseness perspective and from a maintenance perspective. The only downside to using the Flags approach that I can think of is the in...
We are a small company that I am lead developer on, and we have been having on and off meetings with a potential stakeholder for a good opportunity. This stakeholder is helping us directly in getting a proposal together to a group of other stakeholders for software that they have a strong need for. Hopefully if we se...
I am a Web Developer (working with PHP/WordPress/Symfony2) in a small company (still hiring but at the moment 5 staff), has ~8 months experience (currently a Computer Science student) and asked to fulfill more of a Project Manager role. I am not really even good at personal time management nor would I say my programmin...
Possible Duplicate: When to use C over C++, and C++ over C? C still has its own importance in the programming world! And one reason for it is its performance. But, I have some questions. Is there anything that is special to C that other languages missing? What are its importance today, other than performance issue...
Currently one of the major applications that our organisation produces would be regarded as bespoke software as it is specifically designed for one specific client organisation. However, we have specifically retained the intellectual capital on the project and a number of different organisations in different countries ...
In the early days of web programming there was the Java Pet Shop application which was used as a reference type of example application. Currently I am looking for a similar reference but with the emphasis on systems =design=. I.e. what aspects of his / her design should an architect / systems-designer put on paper and ...
I am planning on creating a compiler that will generate assembly, that is as far as I really want to go with this project (don't want to create the object files myself or any of the machine code). Since I'm doing this on linux, I would like to use the gas assembler. I'm not sure the best way to package the application....
I got through the first phone interview at Amazon last week and they asked some basic technical questions during that interview. Today, I had my second phone-interview and I prepared myself well expecting for another technical interview, but it was not technical at all. After we introduced ourselves, he asked question...
Let's suppose (for simplicity) that we have an application featuring client and server; is there a better idea to use one repository for both or a pair of separate repositories? Mixing them will probably make easier to track correlated changes and maintain correlated branches (i.e. protocol evolution), but on the other...
A developer told me they used delegates to bind most of their events in ASP.NET. Until then, I did not even know it was possible to use delegates in ASP.NET in a meaningful way. My understanding is that ASP.NET/MVC3 works via HTTP verbs, not events/delegates. Is it even possible to have an event fire from the clien...
I'd like to insert grammatical mistakes (not typo) in a correct sentence, to make a small game. For instance: My name is John -> My name are John He leaves the room -> He leave the room I only found some tools to detect languages but nothing about verb/noun/adjective detection/transformation. Is there a tool that coul...
In Java, the following code does not compile: int val = 1; short shortVal = val; // Incompatible types Anyone know why Java chooses to complain about this assignment, instead of simply truncating, when an integer × integer is also likely to overflow? To illustrate: int val = 46340; int result = val * val; ...
We're discussing the best way to handle errors in calls to a method. We have a credit model where we allow users to deduct credits for certain actions. We'd like to make a call to: User.DeductCredits(10); Then the Deduct method will check things like Does the user exist? Is the user active? Does the user have at l...
I've been running a company for nearly 10 years, and all this time it's been just myself, another programmer (who's a great friend and cofounder), and a salesman (who's also a friend). Together, we've managed to do decent business and we've all managed to make a living, but we've been trying to expand for a long time n...
This question was reopened on "English Language & Usage": https://english.stackexchange.com/questions/53683/synonyms-for-multiplexing-and-demultiplexing/ This question is related to something written in C#, but it can be answered by programmers familiar with any language, as the question pertains not to the code itself...
Considering I have no programming background, Is there a resource out there that's the de-facto standard for describing best practices, design methodologies, and other helpful information on R programming? What about that resource makes it special?
I am not sure how to specify my datatype as datetime or timestamp, I think I will need both of them but on the different events. My website sells products and services worldwide and also have an account system for user to login. Please clarify the following: Current date and time customer buys products from my website...
Possible Duplicate: How do you keep track of the authors of code? Here's several scenarios which may comment with owner name: bug fixing, i.e. // fixed bug 123 by xxx, solution is ... ... fixme/todo tags, i.e. // TODO: .... by xxx. hacks, i.e. // HACK! ... by xxx For case #2, please refer to Comment Tags The ob...
This is an interview question: Given two Binary Search Trees, write a program to determine whether they contain the same set of values. Assume there are no duplicates. My idea is to perform an in-order traversal for both trees and compare each element one by one. It takes O(n) time and O(n) space. How could I do it i...
I am writing an uber simple blogging platform. The application reads a set of static files that are the articles in the blog, and serves them up. The only time any content on the site will change is when a new article is added, or an existing article is changed. I intend to load 100% of the content into the applicatio...
Although, my question may be entirely irrelevant, but I have sensed a pattern between most programming languages and their official implementations. Interpreted (byte-interpreted?) languages like Python , Lua etc. usually have an extremely lenient and easy syntax and are generally type-less or do not require the devel...
I am refactoring existing set of java test classes for automated UI tests. At times I end up in making massive changes in class file or completely revamping it. This makes me think that when I am rewriting entire class then should I change author name in comment section to mine? Am I being greedy? or is it going to be ...
I've kept on coming across the term "bodyshop" in terms of a programming job/environment but despite googling I can't find out what exactly this is referring to? Can someone please enlighten me?
I'm trying to work a bit with Entity Framework and I got a question regarding the separation of layers. I usually use the UI -> BLL -> DAL approach and I'm wondering how to use EF here. My DAL would usually be something like GetPerson(id) { // some sql return new Person(...) } BLL: GetPerson(id) { Return p...
How do I get people to want to collaborate on a project idea I have/actually contribute? I am a bit sensitive about my idea for a couple reasons: I don't want people to take my idea. I have gotten a couple people who wanted to help but then work/family/school stops them from having time and makes me less enthusiastic ...
At work we use SVN, but in name only. We don't branch or merge. We keep two copies of the repository, one serving as the "tag" branch that gets copied when we do a deployment and kept for bug fixes and immediate "this has to go live asap" type of features. We have to remember to copy changes made in one copy to the ...
I am hoping to create a mind-mapping like application and it needs to have a central workspace that will hold the map. Users should be able to drag items (like rectangles, texts, etc.) from a container to the workspace. The important thing is when a user is dragging an element to the workspace, the element should move ...
I don't know how to say... The XIB is using xml to store the UIElement information, similar to .Net GUI. Is there any open source stuff also convert the xml file to a html layout?
I'm looking at optimizing some string formatting code that's hit a lot in our code. We had been using ostringstream, and I converted the code to use sprintf (actually Microsoft's more secure sprintf_s). I've traded type safety for run-time performance. But I've debugged enough sprintf related weird crashes to know that...
Problem I am a lead engineer for a highly trafficked eCommerce website (upwards of 1m page views an hour). For various reasons we have the opportunity to rebuild large portions of our infrastructure. This brings up a number of interesting problems in balancing flexibility, stability, speed to market, etc... At a high...
I'm currently involved in a migration to TFS from SVN of a large project that is going to be divided into five different sites. This project allows some providers to insert five different product data into the enterprise DB. Like a lot of companies out there, we have a technological debt that should be solved (or at le...
I'm finishing up my app for iPad, and the filename extension (used mostly so that Mail and Dropbox know what program to open the files in) is 12 characters long. The only filename extension that is anywhere near as long is tax2010. Why is there so little variation on this topic, and what kind of problems can I expect b...
Currently I'm starting a new system on my company, and we are using a good separation between models, views and controllers, basically using Asp.Net MVC 3 for the user UI, and a C# class library for the model. The question is about "modelling a model". We are using Linq-to-SQL as a Data Access Layer, and modelling enti...
I am just wondering. I've never licensed any code before and there is so many separate information about that I am a little bit confused; I watched the codes which are published in the Internet and some of them contain their author name and license info so that makes the code some kind of personalized; So my question ...
I am novice in "serious" programming i.e. applications that deal with real-life applications and software projects that go beyond school assignments. My interests include optimization, operations research, algorithms and lately i discovered how much I do like software design/development/engineering. I have already deve...
I am the main author and designer of MELT, a domain specific language to extend GCC (the Gnu Compiler Collection). The implementation is available free software (GPLv3 licensed). If you want a detailed description, from the point of view of a Domain Specific Language, read my DSL2011 paper on MELT. I have chosen a Lisp...
"Programming in C++ is premature optimization" Why does everyone do some people say this?
I'm working on an open source project, and am looking to find collaborators. What's my best bet, in terms of advertising my project, with an eye specifically towards finding other developers interested in contributing?
I'm hoping that this is the right place to ask this question, but my company has recently started a process to look at how we build software, from the tools we use to the methodology. As you can imagine we have the kind of endless meetings where we sit around a table and split hairs. In an effort to actually get someth...
I've been looking around, but I'm still not sure on the what OpenCL is. Other than multi processor stuff... Is it another graphics API like OpenGL and DirectX? Or something that works alongside OpenGL? I'm planning on learning OpenGL soon (with java if it makes a difference) so I want to know how/which direction to lea...
I was reading What makes JNI calls slow? and I was wondering if Python's C interface is any better than JNI. I heard that if you want to make certain parts of your python programs faster, or if a certain part of the program was really hurting your program's performance, you write them in C, and make Python call them. D...
Suppose a FileWriter class that needs validation that it will not erase a file already present, if one is found. It would have two functions: public bool FileExists(string filePath) //... public bool WriteFile(string filePath, string text) //... The main concern is to not erase a file already present. A first interfac...
I am actually considering learning C++. I want to become a quantitative financial analyst, and going to pursue my CFQ soon. Java is not heavily used in this field, but C++ is for its complexity. For someone who already has knowledge in HTML, CSS, JavaScript (intermediate), and PHP (intermediate), how hard would the swi...
I have already searched but didn't managed to find a suitable answer. My problem is this: I use different software packages with different licenses to develop a free and open-source (not commercial) piece of software (a simple data visualization web app that reads data from a specific mysql db and draws graphs and stuf...
I am not much familiar with documenting/System designing stuff. I have to maintain an application written in C# - working as windows service. However there is no documentation for this system which makes it really pathetic to find where some problem (conceptually) occurred. I would like to know the best way to design/d...
I'm learning Python at the moment and to give me reasons to apply what i'm learning I'm having a crack at some of the problems on Project Euler I'm currently on number 3, which is to determine the highest prime factor of said number. I've deduced I need to probably have two algorithms, one to determine primality, and t...
We got a request from one of our customers, and since I've never encountered such a request before, I don't even know where to start looking. Our customer is a network of colleges, and we're building them a site. On that site, among other things, will be a form which potential applicants can fill out in order to get mo...
Suppose that you want to show a user list, on a web application having to handle custom date formats (depending on current selected interface language). Several locations for applying the date format seem possible. Which one would you use, and why? At model, for example doing a DATE_FORMAT(user.birthdate, '%d/%m/%Y') ...