instruction stringlengths 34 19.9k |
|---|
Years ago, I used to suggest Visual Basic 6 to rank beginners as a way to learn what programming is. Key point: This was NOT for career training, but just as a primer to the basic concepts of programming. I subscribe to the KISS principle (many programmers do not) Detest Microsoft as we may, the instant graphical... |
I plan on migrating a website from PHP to ASP .NET MVC. However, since the website is large and this migration can't be done in a short time I plan to use both MVC and PHP pages together. So the idea is to replace each PHP page or group of pages with an MVC equivalent.
I have to refactor each page and rewrite it overa... |
I'm interested in the conceptual (programming language agnostic problem) process of sending a game object to another player of the game in exchange for another game object without a face-to-face online presence of both parties. This should be done so that in theory in game exploitation of inherent bugs of the trading s... |
This is one of the definitions that I asw for user stories -
When the time has come for creating user stories, one of the developers (or the product owner in Scrum) gets together with a customer representative. The customer is responsible for formulating the user stories. The developer may use a series of questions to ... |
Some development teams in my company are switching to Agile development practices and their developers' work seem to be diminishing to discuss and program minutia about trivial software features because of two week iteration cycles. And also because of "any developer can fix any bug" mentality. I have recently joined o... |
I'm developing a suite of software tools that I need help with which is why I want to release my software open-source. People should be able to use and modify my code as they please while contributing to my project. Ultimately, the tools that I develop will require a paid commercial license, but may be free to those fo... |
When I read pro and con lists of using Entity Framework (or any modern ORM really), I'm surprised that the following point doesn't arise (self quote):
Using strongly-typed domain entities allows for type checking at
compile-time which essentially performs a verification of all your
database operations. This is so... |
I am doing some research on the ScalableColor descriptor in MPEG-7 and I came across this passage:
The descriptor extractions starts with the computation of the colour
historgam with 25 bins in the HSV colour space with the Hue (H)
component quantised to 16 bins, and Saturation (S) and Value (V)
quantised to 4 ... |
What traits / skills does the Business Intelligence Developer role expect over a traditional Web Developer role?
|
I'm currently working on a project that need to be dynamically scaled on demand according to the need.
My question is about scaling spring context. My web application has a classical multi module core (service, persistence, domain), which use use by client application (webapp, api).
The user end application could be cl... |
This may be very naive, but I was wondering, it the context of binary trees (plain, sorted and balanced), of all the traversal types:
depth-first pre-order
depth-first in-order
depth-first post-order
breadth-first
what's the actual utility of pre and post-order ones? I mean, is there some type and/or configuration of... |
Recently i was re-visiting the basic concepts of operating systems. Since I am a java developer, I have inherently started looking at everything from java point of view. I am also reading 'Inside the JVM fundamentals' from
http://www.artima.com/insidejvm/ed2/jvm.html
so when I see the basics of operating systems and JV... |
We have a tricky question in a project using Java & Hibernate, with a model containing bi-directional relationships.
As it's a small project with few users, few entities, and few rows involved in relationships (not more than 100 in 1-n relationships), we don't really need a 2nd level cache.
Operations done with entiti... |
The organisation I work for has recently employed a testing officer to run manual tests, but when I asked about being given time as a developer to write unit tests the response was that the manual testing would provide a bigger bang for the buck. That is something that feels wrong to me and I'm looking for a means to r... |
I know that when building applications (native or web) such as those in the Apple AppStore or Google Play app store that it's very common to use a Model-View-Controller architecture.
However, is it reasonable to also create applications using the Component-Entity-System architecture common in game engines?
|
I have a list of varying length where items is strings of varying length. I want to print them by (a mirrored N)/order by column.
Major points being:
Columns shall have fixed width == widest data in that column.
It shall be as compact as possible.
Number of columns is varying/induced by available width of canvas.
Or... |
I've recently been working on a project and I've been seeing two different forms of url's being used.
src="../MyLinkUrl"
and
src="/MyLinkUrl"
We are using MVC .NET and the times I have seen the .. usages have been in Javascript code files and not when it's been generated by the MVC URL helpers. Typically the usages ... |
Has anybody got an idea why the area of main memory where objects are allocated is referred to as the heap. I can understand the rationale for that of the stack LIFO but would like to know what the rationale is for the 'heap' name.
|
I'm using Shiro as my security manager for a Spring MVC web application.
The login basically happens in these lines:
Subject user = SecurityUtils.getSubject();
user.login(new UsernamePasswordToken(username, password));
Where should I put this logic? login() can throw exceptions if the requested user doesn't exist or ... |
This website is supposed to be a game where the players have some 'buildings' and these buildings produce resources. E.g. an iron mine may produce 30 pieces of iron ore per minute and automatically add it to the user's inventory. It doesn't matter whether the user is online or not, it should be running 24/7. So when th... |
I have a silverlight app that connects to a entity framework over WCF ria service.
These calls have to be secure. What can I do so only valid users can call the ria service, and to make the call secure?
The user has to log in to get to the silverlight app, so maybe that login in some way can be saved for authenticatio... |
I've read in multiple places that the requirements must not be influenced by solution and must not contain solution. So in the below example , please can you help in letting me which is correct -
Application A is interacting with Application B to install a new service / change the service type and disconnect a service.... |
Do you think that using akka actors in front of transactional service beans, is a good idea ?
Actors are waked up by a facade used by a client application, and actor use a message to handle right service call.
Is it a good practice ?
This article (http://honeysoft.wordpress.com/2012/08/05/akka-actor-dependency-injecti... |
I recently started at a new company, with a handful of programmers. Its a medium sized company, with around 70 employees, but IT only has 9-10, and there are 3 "programmers" beside myself. However, these guys have very limited experience and are doing a lot of stuff really terribly. For example, one of our projects is ... |
I currently report my production exceptions to a mysql database, where they have been collecting dust for the most part. The problem I faced is grouping the stack traces. I would like to be able to see kind of an aggregate of the stack traces that are the same, so that I can work them into the workflow.
I know one issu... |
I just learned you can write
'{}{}'.format(string_a, string_b)
instead of
'{0}{1}'.format(string_a, string_b)
in Python, i.e. you can omit the numerals for the string format parameters when you want things to slot in one by one in order.
Is this considered Pythonic?
NOTE: "Pythonic" is a commonly used term among Py... |
I am working with a trading application (reading data from the exchange) which generates a bucket load of data on a per second basis. We have different "log-levels" but even the minimal log-level generates so much data ! This process of log creation is quite I/O intensive.
Since I can write assembly using __asm__ , I ... |
Firstly, I'm not exactly sure if this question is a better fit over here, or on workplace.SE. So forgive me if it is in the wrong place.
We are interviewing some candidates for a development position, and currently they are not in our city.
We would like to give them simple coding tests to see how they will perform on ... |
I'm working on refactoring a legacy application where I implemented the State pattern successfully as shown in the following diagram:
As you see there is a common behavior between the 3 states, so I decided to extract the common method Refund() to a parent abstract class RefundableState where I implemented it:
Refact... |
One of my team members, a junior programmer, has impressive programming skills for his level of experience.
And during code reviews, I believe in emphasizing learning, not pointing out mistakes.
But should junior programmers be involved in code reviews for more senior programmers? Or should code reviews be attended on... |
As an example, if I have a Post service and have a method to retrieve all posts for the logged in user, is it OK to have a findPosts() method that uses an injected Security service to get the user ID and then pass that user ID to my post DAO to get the records? Or should the findPosts() method explicitly require the us... |
I recently started at a company and am working on statistical data analysis and data handling (market research). A lot of my tasks were previously done entirely by hand, so I created a few tools to automate much of my work.
My boss asked if I could go ahead and look for other automation-possibilities. I certainly have ... |
I'm a complete beginner to Java, only in my second quarter of classes. I'm having trouble understanding our current chapter about calculating big-O for methods. So I thought I was right in saying that the big-O for these two methods is simply O(N), since there is only one loop that loops through the entire list, but ap... |
What are the major obstacles (and potential solutions, if known) for implementing "continuous delivery" software development when an application relies on varied programming languages or modules... especially when the same version-control and/or automated testing packages do not exist for those disparate platforms?
For... |
I've been wondering about applications that have a set of checkboxes or radio buttons, even collections of form fields in their UI.
At this moment I'm handling all the choices separately but of course this becomes a complete mess very quickly. There has to be an established way to deal with this that I don't know of.
I... |
I have come across many blogs and books where it is stated that it is bad for a system requirement to contain conjunctions like "and". However in reality I am often coming across scenario where a requirement is satisfied when a certain set of conditions are met. For instance, Shopkeeper should sell alcohol only if the ... |
I have a very basic game loop whose primary purpose is to check for updates & changes to a list.
I have contemplated using event driven programming to replace the game loop/list idea with an ObservableCollection, however I just have this big cloud of doubt on event driven programming. I'm posing these questions to tho... |
I'm currently re-designing my Entity System, for C++, and I have a lot of Managers. In my design, I have these classes, in order to tie my library together. I've heard a lot of bad things when it comes to "manager" classes, perhaps I'm not naming my classes appropriately. However, I have no idea what else to name them.... |
According to the Wikipedia article on Spurious Wakeups
"a thread might be awoken from its waiting state even though no thread signaled the condition variable".
While I've know about this 'feature' I never knew what actually caused it until, in the same article
"Spurious wakeups may sound strange, but on some multi... |
I have read in few blogs that as part of agile development , the product owner closely interact with developers to state their requirements and come up with a solution. However in case of a large project (in terms of number of applications involved) involving multiple systems , is this possible? Shouldn't the project h... |
I have an abstract class called Address and I am deriving three classes ; HomeAddress, Work Address, NextOfKin address.
My idea is to bind this to a usercontrol and based on the type of Address it should bind properly to the ASP.NET user control.
My idea is the user control doesn't know which address it is going to p... |
I am writing a library in C++ (making use of many C++11 features) that (as far as I can tell) implements the promise pattern.
The library consists of a class that makes asynchronous network requests. When a user of this class invokes a method that issues a network request, an instance of another class (we'll call it th... |
Functional Requirements state "WHAT" needs to be done from a user's perspective
Functional Specification state "HOW" it needs to be done from technical standpoint.
Do QA teams focus and Functional Requirements whereas development team focus primarily on functional specification though they need to have an understanding... |
I'm developing some code that utilizes generics, and one of my guiding principles was to make it usable for future scenarios, and not just today's. However, several coworkers have expressed that I may have traded off readability for the sake of extensibility. I wanted to gather some feedback about possible ways to reso... |
When you look at the code for the Winforms Designer, you see things like this:
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", ... etc.
instead of
using System.Drawing;
label1.Font = new Font("Microsoft Sans Serif", ... etc.
The same is true of tools like Linq to XSD, XSD2Code and, I suspect, of Li... |
After having had endless issues with INI-style configuration files and parsing them correctly (let along getting binary data right), a crazy idea crossed my mind recently:
What if an INI file like
# settings.ini
[Windows]
DirectorySeparator='\\'
PathSeparator=';'
[Linux]
DirectorySeparator='/'
PathSeparator=':'
Would... |
My coworker who is a senior guy is blocking me on a code review because he wants me to name a method 'PerformSqlClient216147Workaround' because it's a workaround for some defect ###. Now, my method name proposal is something like PerformRightExpressionCast which tends to describe what the method actually does. His argu... |
The global interpreter lock (GIL) seems to be often cited as a major reason why threading and the like is a touch tricky in Python - which raises the question "Why was that done in the first place?"
Being Not A Programmer, I've got no clue why that might be - what was the logic behind putting in the GIL?
|
My company wants to purchase new software for our General Ledger. We want to be able to interface it with various other sytems, all purchased. Nothing is custom built. The software our Accountants like does not have any APIs. However it does allow for imports and exports through various file formats.
The imports (... |
I'm the only software developer maintaining a subset of products at a small company. The main product I'm concerned with here is a web app which is installed on various clients' machines, with a database and background processes.
I make changes on a need-to basis for this program. It's not the company's flagship produc... |
Say I have a function.
function foo(){
//do stuff
}
And then I create an object of that function.
var fooObj = new foo();
What is fooObj called? An instance, An object instance, or something else entirely? Pardon the newbie question, but I am rather new to prototype based programming(and all programming really).
|
I am refactoring a large codebase where most of the classes are located in one package. For better modularity, I am creating subpackages for each functionality.
I remember learning somewhere that a package dependency graph should not have loops, but I don't know how to solve the following problem: Figure is in package... |
A page built so that is has server side scripts implemented on the page.
Should indentation of the code be according to the server side logic (making it easier to read while coding) or according to the HTML/ASP.NET markup (making it easier to read while debugging etc.)?
|
I have following piece of code:
int sum = 0;
for (int i = 1; i <= N; i++)
for (int j = 1; j <= N; j++)
for (int k = 1; k <= N; k = k*2)
for (int h = 1; h <= k; h++)
sum++;
So I'v calculated how much does each cycle executes and then whole script, and I think I might be wrong for... |
I'm currently in the middle of refactoring an important method in a legacy-system. There were almost zero test until I've started working on it, and I've added quite a lot to ensure the correct work after my refactorings.
Now I've came across the most crucial part: the algorithm that calculates an indicator. It's some... |
There are instances which cane be seen while testing the application, both by developers and testers, some NullPointerExceptions arriving while clicking on a node in the table, or while doing an action too fast or under a zillion test-cases which do not come under the Test Cases document used in testing the application... |
I have started to separate my unit tests from my integration tests by using Maven Surefire and Failsafe.
Now I'm wondering what good ways there are to deal with separate environments. Take for example these two integration tests scenarios:
Given a customer id, can I get a list of orders belonging to that customer.
Giv... |
I am working on a Selenium + java project where all Web Element in a class are declared as -
public class CheckoutPaymentConfirmpage extends WebPage{
public final Button btnPrintorder = new Button("//input[@id='but_Print']");
public final TextField txtpassword = new TextField("password", "//input[@id='pass']");
... |
We have developed one product for payroll processing. We have 10+ customers who are using this software product.
Our existing and new customers are giving us customization changes w.r.t. their needs, and now we are facing the problem of product management. Please give some guidelines to us.
How to manage single softwar... |
I was reading up on data structures from Code Complete. This is when I stumbled through this piece about arrays:
Think of arrays as sequential structures Some of the brightest people in computer science have suggested that arrays never be
accessed randomly, but only sequentially (Mills and Linger 1986).
Their argu... |
I have been having a debate about what to do with a trailing slash in a RESTful API.
Lets say I have a resource called dogs and subordinate resources for individual dogs. We can therefore do the following:
GET/PUT/POST/DELETE http://example.com/dogs
GET/PUT/POST/DELETE http://example.com/dogs/{id}
But what do we do wi... |
I was reading this blog post: http://kjellkod.wordpress.com/2012/02/25/why-you-should-never-ever-ever-use-linked-list-in-your-code-again/
and I found there a code to run: http://ideone.com/62Emz
I've compiled it using gcc 4.7.2 with g++ -std=c++11 on my old laptop with T5450 cpu with two cores with 32 Kbytes L1 cache e... |
I'd like to know if it's possible to detect the delete error commented below at compile time? Especially, I'd like to hear about g++ compiler.
ClassTypeA *abc_ptr = new ClassTypeA[100];
abc_ptr[10].data_ = 1;
delete abc_ptr; // error, should be delete []
|
I think I can count WebAPI out, but WebForms, WebPages, and MVC are all possibilities.
I want to create an asp.net web site that is primarily static content and links to other sites. The only "fancy" bit will be a Bing map with pushpins that I add - but even these are static. And there will be a photo gallery. Oh, and... |
I want to do the following:
I have a number of computers. On each computer a programm will run. There is no centralized server.
The program can choose by defined criteria to give another computer specified data. While doing so, the other computer should not do the same. (A sort of 2 way synchronize)
Let's make an examp... |
I am making a simplistic in-browser IDE for some very domain-specific coding. Because I like Bret Victor's thoughts on Learnable Programming so much I thought I'd throw in some draggable numbers ala Tangle.js (click here to see what I'm talking about).
My implementation is a much simpler slider input control but the i... |
Use cases are primarily meant for interaction between user and a system. It could be used for interaction between system and another system. The actors are primarily roles.
It is easy to document the use cases for a front end application like a portal where in all the activities and role performing the activity could ... |
I have a scenario where a specific webservice must be consumed based on the state to setup user info. For instance if the state is NY or NJ call service A , if state is WA call service B etc. But specifying what service must be called is I guess is "HOW" to setup a user info and not a "WHAT".
So should I just have sing... |
I have a single page application where everything in the UI is javascript driven so any operation requiring data or updating of data is done via Ajax requests. The way things are setup right now is that my Ajax called are made to one ajax.php file which takes care of routing them to the proper service method. This work... |
I have something like this:
public byte[] EncodeMyObject(MyObject obj)
I've been unit testing like this:
byte[] expectedResults = new byte[3]{ 0x01, 0x02, 0xFF };
Assert.IsEqual(expectedResults, EncodeMyObject(myObject));
EDIT: The two ways I've seen proposed are:
1) Using hardcoded expected values, like the above ex... |
This can apply to many error handling scenarios, but I'm curious about how to do it in a login scenario.
Given this Spring controller method:
@RequestMapping(value = "/account/login", method = RequestMethod.POST)
public String login(@RequestParam("username") String aUsername,
@RequestParam("password") String aP... |
I'm writing a simple chess-related code with intention to write it clearly (performance doesn't matter at all). And this method I have doesn't look clean to me at all:
public static Piece GetClosestPiece(Square squareFrom, Direction direction)
{
//TODO: rework this mess
switch (direction)
{... |
I thought of asking on SO, but it seems this is more of a "concept" type question than a "problem" type question. If it needs to be moved, please do so.
Anyway, I'm having a tough time finding straight info on this. I'm using Unity.Mvc3 to setup dependency injection for controllers and other components the controllers ... |
Friend asked me to develop a software application for him. I did and he paid me.
There was no written contract. I live in UK and he resides in Canada.
My question is: who is the owner of the software now?
Can my friend make and sell copies without my permission? Can I do the same?
I'm asking this because another person... |
I played a bit with WebSockets and started to implement a tiny chat. Last time I did something like this was when there was no such thing as threads and computers had single core. I started to think how to implement it with todays programming patterns but I didn't come to any final conclusion.
How you implement chat's ... |
How can one become better at debugging in general? I do not mean specific tools or tactics that apply to a certain programming language or stack, but simply how to make your mind better at it, hopefully something beyond "just more exercise".
I am fairly good at "blank sheet" type programming problems: I can easily code... |
I remember that in our first programming class with Java, while explaining data types, the following occurred (kinda):
Professor: So, what data type would you choose if your program needs
to store the user's gender?
Someone: How about a boolean? You know, true for male and false for
female.
Professor: Sure, that m... |
We have a system whereby the database connection is get once using a common method, and being pass throughout the relevant class to be used. There are doubts that passing the database connection as a parameter to different classes would cause problem, so i'm checking here to see whether this is actually viable, and are... |
There isn't any cool LINQ sugar for creating unions. The Enumerable.Union() method is usually called like this:
var bigList = list1.Union(list2);
The alternative is to call Enumerable.Union() which can be more readable:
var bigList = Enumerable.Union(list1, list2);
However neither of these methods are very stylish (m... |
I'm a student and I work as an undergrad in an IT department. They are very effective programmers, but as far as documenting what they do and tracking what time is spent on specific tasks - not so much.
I was put in charge of setting up project management software. So far, I've created a satisfactory solution with Tra... |
I have recently been looking at some testscripts which looks a bit like
...
try {
receiveSomething();
// something was received even though it shouldn't
failTest();
} catch (TimeoutException e) {
// nothing should be received
succedTest();
}
The problem I have with these types of tests is
They are not deter... |
I have a bulk emailing service within the system which allows for a template to be used. When the mail is sent the template is parsed or run through a parser to replace tags with actual information. i.e "[Foo] has logged in" is parsed to "Bar has logged in"
Is it better to have 1 service for sending and parsing emails ... |
The main difference between themes/skins and CSS are the HTML & Server Side Controls (SSC) only. We use skin files to format & cosmetics SSC which are not in HTML like <asp:Label>, <asp:TextBox> & </asp:RadioButtonList> etc...
But what if we use the rendered HTML SSC in CSS instead skin files to handle <asp:Label> & <a... |
I have been reading DDD Quickly and wondered about how to avoid naming clashes with technical terms and domain terms. For example, if I commonly used the repository pattern (with classes such as AddressRepository), but a customer also has something called a repository in their domain. How would I best avoid confusing t... |
I've just read two statements that seem to be very different:
Des Weiteren ist mangelnde Kommunikation zwischen Programmierern und Nutzern eine nicht zu vernachlässigende Quelle von unzureichenden Produkten.
Translated:
A lack of communication between programmers and users is a source of poor [software] products.
Sou... |
I was always under the assumption that trial softwares write a registry value of the installation date and then the software makes a comparison of the current date of the system with the remaining days + installation date to verify whether the trial period is still valid or not. If this assumption is to be true, windin... |
I was assigned to fix some issues in a PHP project. Later on, I was asked to implement some new features, which I did. The project neither uses any framework nor does it use OOP. It lacks a proper structure, except for the use of folders (no sub-folders) to organize files. There was no documentation created by the or... |
I think my book (Programming Languages: Principles and Paradigms) is wrong. a is a vector, assume a C-like language:
b = 0;
a[f(3)] = a[f(3)] + 1;
int f(int n) {
if(b == 0) {
b = 1;
return 1;
}
else return 2;
}
It has the effect of assigning the value of a[1] + 1 to a[2] whenever
the e... |
Basically we now have 2 developers for an iOS project, 2 developers for an Android project and 1 designer doing designs for both projects.
Right now, the way we exchange designs and images is through mail...so not very advanced or efficient. We're switching to Dropbox, but I feel like we could go a step further and som... |
TODO indicates "task to be completed", FIXME to be fixed etc. Is there a code tag to indicate "need improvement" on code comments?
|
So, I work in .Net. I make open source projects in .Net. One of my biggest problems with it isn't necessariyl with .Net, but with the community and frameworks around it. It seems everywhere that magical naming schemes and strings is treated as the best way to do everything. Bold statement, but look at it:
ASP.Net MVC:... |
I'm wondering what is better in terms of good OOP desing, clean code, flexibility and avoiding code smells in the future. Image situation, where you have a lot of very similar objects you need to represent as classes. These classes are without any specific functionality, just data classes and are different just by name... |
When thinking about testability and modular code, I recently thought about whether I should split out the synchronization part of a class from the actual behavior part.
By example:
The app "needs" this:
class Mogrifier { // Mogrifier accesses are thread safe
private:
unsigned int m_state;
mutex m_sync;
public:
Mo... |
I currently have the following models and am designing search functionality that searches within these 3 models:
Locations
Users
User_friends
Should I create a search controller or should I put the action in one of the existing locations, users, or user_friends controllers? If so should it be pluralized - searches_con... |
We manage a range of client sites built in Wordpress and Joomla and these require regular updates to the core CMS and extensions. We keep these sites in subversion and place updates in subversion. We try to use a single revision for this.
We face some difficulties in making this process efficient, over time we would li... |
Under which application development scenarios C# dynamics and ExpandoObject can be used or when to consider using c# dynamics and ExpandoObject
|
I would like to develop a bit of functionality for a web site that involves a bit of 3D - the user can move around objects, rotate them and texture them.
So far I've looked into:
WebGL (in particular three.js) and it looks great, but it's not supported in IE nor IOS.
IOS supports the <canvas> tag, but only 2d. It loo... |
if(true/false){
//if condition is true
}else {
// if condition is false
}
Everyone knows about the structure of if-else. But what is if actually? Is it a class method, static method or keyword? I'm little confused about this.
|
I have a client that asked me to develop his Windows Application and use MS Access instead of SQL database. I did and now he asked me that he deployed the Application through several of his offices.
Now he wished to have a "main Server" with all information from the "client applications" for Reporting purposes and also... |
On my filesystem (Windows 7) I have some text files (These are SQL script files, if that matters).
When opened with Notepad++, in the "Encoding" menu some of them are reported to have an encoding of "UCS-2 Little Endian" and some of "UTF-8 without BOM".
What is the difference here? They all seem to be perfectly valid s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.