instruction stringlengths 34 19.9k |
|---|
I am looking at this excellent article from Jon Skeet.
While executing the demo code, Jon Skeet says that we can expect three different kinds of behaviours. To quote that article:
The runtime could decide to run the type initializer on loading the
assembly to start with... Or perhaps it will run it when the static
... |
Possible Duplicate:
Arguments for or against using Try/Catch as logical operators
Efficient try / catch block usage?
I was recently on a job interview and I was given a task to write simple method in C# to calculate when the trains meet. The code was simple mathematical equation.
What I did was that I checked all t... |
From a RESTful point of view, what is the most appropriate HTTP method for the action of upvoting a forum post (like on StackExchange)?
I would say POST for voting and DELETE for canceling vote, but since users are only allowed to cast one vote per message, voting can be considered an idempotent operation so PUT can al... |
I am working on refactoring an old simulation of a Turing machine.
The application uses a class that contains the state and the logic of program execution, and several panels to display the tape representation and show the state, messages, and the GUI controls (start, stop, program listing, ...).
I would like to refac... |
If anybody has ever noticed that when you open a image in Facebook something like this happens:-
suppose you are at your homepage on Facebook:-
the URL is
https://www.facebook.com/
now if you open a image it gets opened in new modal like window and URL changes to:-
https://www.facebook.com/photo.php?fbid=10151125374887... |
Our project consists of user application and server application. The server application prepares data files that the user application consumes. Because the data is huge, it is stored in custom format. So the project includes many classes related to reading and writing the data. The user application does not need the wr... |
Representing geographical locations within an application, the design of the underlying data model suggests two clear options (or maybe more?).
One table with a self referencing parent_id column
uk - london (london parent id = UK id)
or two tables, with a one to many relationship using a foreign key.
My preference is f... |
I know that it is possible to sell GPL code, but I wanted to know if it was possible to sell GPL code that has been forked and modified. The forked and modified code will still be available to use, modify, and redistribute.
|
I'm developing web site on self made MVC engine.
I have actionController that handles operations like register, login, post submit and etc. actionController receives operation name and parameters.
Of course it mast handle errors such user with same nick already exists or password is to short about which action handler ... |
The method is described in Dragon Book, however I read about it in ""Parsing Techniques" by D.Grune and C.J.H.Jacobs".
I start from my understanding of building channels for NFA:
channels are built once, they are like water channels with current
you "drop" lookahead symbols in right places (sources) of the channel, an... |
I have a big repository and git svn dcommit takes pretty big time.
Will my repo be in consistent state if I'll modify sources (without any git operations) while dcommit is in progress?
|
Almost every article I've read 1 comparing Git and Mercurial it seems like Mercurial has a better command line UX with each command being limited to one idea only (unlike say git checkout).
But at some point Git suddenly became looking super popular and number of Git submitters on Debian popcon graph (see graph image b... |
Is the introduction of the new lambda notation (see e.g. this article) in Java 8 going to require some kind of type inference?
If so, how will the new type system impact the Java language as a whole?
|
I am creating an application that maintains a database of files of a certain type in a given folder (and all subfolders) Initially the program will recurse the folders and add any file it finds of that type to the database.
I want the application to have the ability to re-scan the folder and add any files that were n... |
I am creating a class diagram for what I thought was a fairly simple problem. However, when I get to the bottom of the hierarchy, all of the classes only contain one field and it is the same one.
This to me looks very wrong, but this field does not belong in any of the parent classes. I was wondering if there are any s... |
I'm having a problem I don't understand. I'm developing an OpenGL app for iOS. Because at some points I want to force the orientation of the view programatically, and Apple for whatever reason doesn't make it easy (or even possible), I'm doing it by hand.
I return always NO in shouldAutoRotateToInterfaceOrientation, an... |
I have a question :
Why do I need to sign a .JAR using jarsigner?
is there a specific reason or use of that ?
Same question when I tag a version on github ?
|
Due to rather strange circumstances, I only have until Monday to learn (at least) the basics of PHP and .NET programming. I'm already fairly competent (though there is a lot of room for improvement) in C++ so I feel I have some of the concepts nailed already, but I need to get into the two languages in a bit more depth... |
I have a site with a public API, and some mobile app developers have been brought in to produce an iPhone app for the site. They insist they need to see the database schema, but as I understand it, they should only need access to the documented public API.
Am I right? Is there something I've missed? I've told them that... |
I've heard that PHP is somewhat secure because Apache won't allow the download of raw PHP. Is this reliable, though? For example, if you wanted to password protect something, but didn't want to create a database, would something like $pass = "123454321"; be safe?
Bottom line, is it safe to assume that nobody has access... |
Which would be considered more maintainable?
if (a == b) c = true; else c = false;
or
c = (a == b);
I've tried looking in Code Complete, but can't find an answer.
I think the first is more readable (you can literally read it out loud), which I also think makes it more maintainable. The second one certainly makes mor... |
My requirements consist of using ehCache to send and store data via RESTful web service calls. The data can be stored in-memory or via the filesystem...
Never used ehCache before so I am having some issues deciding on which bundle to use.
Have downloaded the following bundles:
ehcache-2.6.2
ehcache-standalone-server-1.... |
Problem number 18 from Project Euler's site is as follows:
By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23.
3
7 4
2 4 6
8 5 9 3
That is, 3 + 7 + 4 + 9 = 23.
Find the maximum total from top to bottom of the triangle below:
75
95... |
If a map contains pushpins/waypoints that span only a couple of miles, the map should be zoomed way in and show a lot of detail. If the pushpins/waypoints instead cover vast areas, such as hundreds or even thousands of miles, it should be zoomed way out.
That's clear. My question is: is there a general guideline for ma... |
What sections of the software industry (i.e. healthcare, aerospace, games, etc) are most likely to practice software engineering with the engineering rigor + depth and breadth defined in the SWEBOK?
|
If the player steps on a Button-Tile when its true, it becomes false. If the player steps on a Button-Tile when it is false, it becomes true.
The problem is, when the player stands on (intersects) the Button-Tile, it will keep updating the condition. So, from true, it becomes false. Because its false and the player int... |
Are there some theoretical reasons for that (like that the type checking or type inference would become undecidable), or practical reasons (too difficult to implement properly)?
Currently, we can wrap things into newtype like
newtype Pair a = Pair (a, a)
and then have Pair :: * -> *
but we cannot do something like λ(... |
I need to write a notification system manager.
Here is my requirements:
I need to be able to send a Notification on different platforms, which may be totally different (for exemple, I need to be able to send either an SMS or an E-mail).
Sometimes the notification may be the same for all recipients for a given platform... |
I've seen code merges being used as an argument for bracing even single statement ifs. For example:
if (condition) {
do something;
}
Unfortunately I can't think of a change that would break a non-braced version during an automatic code merge. Could someone post an example?
|
I'm faced with implementing interfaces for some rather archaic systems, for handling online deposits to stored value accounts (think campus card accounts for students).
Here's my dilemma: stage 1 of the process involves passing the user off to a thrid-party site for the credit card transaction, like old-school PayPal.... |
I hope I have asked this in the right forum.
Basically, we're designing an Online Store and I am designing the class structure for ordering a product and want some clarification on what I have so far:
So a customer comes, selects their product, chooses the quantity and selects 'Purchase' (I am using the Facade Pattern ... |
I am interested in taking this online course on machine learning. As it stands my math is very elementary, and I am basically learning math from scratch on khan academy. Programming-wise I have a decent amount of experience, and a good overall understanding. My question is, what math skills are required for me to be ab... |
In the delegate pattern, only one object can directly listen to another object's events. In the observer pattern, any number of objects can listen to a particular object's events. When designing a class that needs to notify other object(s) of events, why would you ever use the delegate pattern over the observer pattern... |
Could anyone give a clear and concise explanation for when you use graphs vs when to use trees for data structures?
|
I have a background as UI designer. And I realized that it is a bit hard for me to write a pieces of logic. Sometimes I get it right, but most of the time, I end up with something hacky (and it usually takes a lot of time). And is not that I don't like programming, in fact, I'm starting to like it as much as design. It... |
I have an app with the following three tables
Email (emailNumber, Address)
Recipients (reportNumber, emailNumber, lastChangeTime, status)
Report (reportNumber, reportName)
I have a C# application that uses inline queries for data selection.
I have a select query that selects all reports and their Recipients. Recipie... |
On Google plus, when I click on a Google plus profile or any Google plus link the page gets redirected to that link without a full page load but the URL changed and a record added to browser history.
How this can be done? Is there any tutorial or document?
|
I don't think Objective C was in use from the beginning of Apple hardware development. What languages did app developers use for the earlier Apple computers, such as Apple II or Mac Classic?
|
I'm reading "Effective Java" by Josh Bloch and in there is Item 16 where he tells how to use inheritance in a correct way and by inheritance he means only class inheritance, not implementing interfaces or extend interfaces by other interfaces. I didn't find any mention of interface inheritance in the entire book.
Does... |
There are several options that are available like C, C++, Matlab and some more. But is there a language that naturally feels like Event programming?
For example: If I see a red ball (Event) ---> Do this (Action)
|
Applying styles to the body tag will be applied to the whole page, so
body { font-family: Verdana }
will be applied to the whole page. This could also be done with
* {font-family: Verdana}
which would apply to all elements and so would seem to have the same effect.
I understand the principle that in the first insta... |
I'm just running NDepend against some code that I have written and one of the warnings is Overrides of Method() should call base.Method().
The places this occurs are where I have a base class which has virtual properties and methods with default behaviour but which can be overridden by a class which inherits from the b... |
When under a particularly strict programming deadline (like an hour), if I panic at all, my tendency is to jump into coding without a real plan and hope I figure it out as I go along. Given enough time, this can work, but in an interview it's been pretty unsuccessful, if not downright counter-productive. I'm not alwa... |
I have a class diagram that is like this:
< Order > (1) CAN HAVE (M) < products >
But therefore Order has the following:
Order_Id
Customer_Id
Order_date_day
Order_date_month
Order_date_yeah
But I do not know how it would handle the Products? Because, I couldn't have ProductID because that would mean that each item in... |
One of the new requirement of our dev team set by the CTO/CIO is to become test driven development, however I don't think the rest of the business is going to help because they have no sense of development life cycles, and requirements get changed all the time within a single sprint. Which gets me frustrated about wast... |
I have been working with Indy 10 HTTP Servers / Clients lately in Delphi XE2, and I need to make sure I'm understanding session management correctly. In the server, I have a "bucket" of sessions, which is a list of objects which each represent a unique session. I don't use username and password to authenticate users, b... |
I have over the last 30 days been developing a Python application that utilizes a MySQL database of information (specifically about Norwegian addresses) to perform address validation and correction. The database contains approximately 2.1 million rows (43 columns) of data and occupies 640MB of disk space.
I'm thinking ... |
I have come across many relational database management systems (RDBMS). But recently I used hibernate which made me start wondering why Object Oriented databases aren't more popular.
If object oriented languages like Java or C# are so popular, then why aren't object-oriented database management systems (OODBMS) more p... |
Sorry if this is a duplicate, I looked.
We're moving to Git. In Subversion, I'm used to having \trunk, \branches and \tags folders.
With Git, switching between branches will replace the contents of the working directory, so am I right to assume that the way we used to work just doesn't apply with Git?
My guess is that ... |
I have a private final field in one class and then I want to address that field in a subclass. I want to change field access/visibility modifier from private to protected, so I don't have to call getField() method from subclass and I can instead address that field directly (which is more clear and cohessive). Will ther... |
It might be obvious, but I am not sure.
Should the analyst who interview the client, gather and analyse requirements then give an estimate, also specifies how many and with how much experience developers should be required to develop it?
Maybe I'am not so sure on how I go about this allocation thing, maybe this is just... |
We have IAppContext which is injected into ViewModel.
This service contains shared data: global filters and other application wide properties.
But there are cases when data is very specific. For example one VM implements Master and the second one - Details of selected tree item. Thus DetailsVm must know about the selec... |
This all is with respect to Microsoft project CodeBook:
CodeBook
There is huge amount of code in the repository, many classes , a call hierarchy of functions, testcases etc. I am interested in knowing how this crawling process takes place, and how this data is sorted?
|
I'm working on setting up Jenkins to handle our release builds. A release build consists of a Windows installer that includes some binaries that must be built on Linux.
Here's what I have so far:
The Windows portion and Linux portion are set up as separate Jenkins projects.
The Windows project is parameterized, takin... |
I have a question regarding the appropriate use of SQL Server database schemas and was hoping that some database gurus might be able to offer some guidance around best practice.
Just to give a bit of background, my team has recently shrunk to 2 people and we have just been merged with another 6 person team. My team had... |
I'm working on a software problem at work that is fairly generic, but I can't find a library I like to solve it, so I'm considering writing one myself (at least a bare-bones version). I'll be writing some if not all of the 1.0 version at work, since I need it for the project. If turns out well I might want to bring th... |
Possible Duplicate:
What is the point of Java’s package naming convention?
What package name to choose for a small, open-source Java project?
I write Java (and derivative languages with package names) for personal use, but I don't have a personal domain name, so the standard packaging naming convention doesn't hold.... |
Background
I'm trying to improve my group's current web app development pattern. Our current pattern is something we came up with while trying to rich web apps on top of ASP.NET WebForms (none of us knew ASP.NET MVC). This is the current pattern:
!
Our application is using the WinForms Framework.
Our ASPX pages are e... |
I have a situation where a custom class is a property of another class.
What I need to be able to do, if it is possible at all, is obtain a reverse to the "parent" class (ie the the class that holds the current class as a property).
For Instance:
Public Class Class1
...
public readonly property Prop11 as Class2
p... |
There is an option in C# to execute code unchecked. It's generally not advised to do so, as managed code is much safer and it overcomes a lot of problems.
However I am wondering, if you're sure your code won't cause errors,
and you know how to handle memory then why (if you like fast code) follow the general advice?
... |
I have a data intensive iOS app that is not using CoreData nor does it support iCloud synching (yet). All of my objects are created with unique keys. I use a simple long long initialized with the current time. Then as I need a new key I increment the value by 1. This has all worked well for a few years with the app run... |
I'm about to participate in a Coding Kata and I would like to do it in JavaScript.
What tools and libraries do I need for TDD in JavaScript?
|
Please note, I am asking about writing LALR parser, not writing rules for LALR parser.
What I need is...
...to mimic YACC precedence definitions. I don't know how it is implemented, and below I describe what I've done and read so far.
For now I have basic LALR parser written. Next step -- adding precedence, so 2+3*4 c... |
I have developed a library at my former employer.
After my employment ended, I got to take the library with me.
Does the Apache v2 prohibit renaming packages as long as I keep the license header intact?
|
I'm writing a class which is roughly analogous to a CancellationToken, except it has a third state for "never going to be cancelled". At the moment I'm trying to decide what to do if the 'source' of the token is garbage collected without ever being set.
It seems that, intuitively, the source should transition the assoc... |
I'm developing an application to help school principals in dedicating teachers to classes and courses over the hours of a week (scheduling). The scenario is roughly something like this:
User enters the list of teachers and their free times into the system
User enters the list of courses for this semester
User enters t... |
When I write code in Visual Studio, ReSharper (God bless it!) often suggests me to change my old-school for loop in the more compact foreach form.
And often, when I accept this change, ReSharper goes a step forward, and suggests me to change it again, in a shiny LINQ form.
So, I wonder: are there some real advantages, ... |
I'm looking to build a Virtual Machine as a platform independent way to run some game code (essentially scripting).
The Virtual Machines that I'm aware of in games are rather old: Infocom's Z-Machine, LucasArts' SCUMM, id Software's Quake 3. As a .net Developer, I'm familiar with the CLR and looked into the CIL Instruc... |
I am trying to implement a virtual file system structure in front of an object storage (Openstack). For availability reasons we initially chose Cassandra, however while designing file system data model, it looked like a tree structure similar to a relational model. Here is the dilemma for availability and partition tol... |
I have modified the source code of an MIT licensed project, and I have added new classes to it as well. Please correct me if I am wrong, but I think that it is legal to add my copyright notice above the license and remove the other one. But how should I attribute the contribution of the previous authors? Should I use ... |
I'm looking for process-relative information on open-source Swing projects:
how the task was described
how many developers were involved
how much time the solution was taken
etc.
Are there any open source (online) chronicles in that direction? I strongly prefer projects that include the authors' names.
I watched thi... |
What reasons to companies have for open-sourcing libraries and applications?
Doing this may allow a developer to better understand the code, but could doing this allow people to find and exploit vulnerabilities in the library or application?
|
Consider this:
int f(int x)
{
return 2 * x * x;
}
and this
int squareAndDouble(int y)
{
return 2*y*y;
}
If you found these in independent bodies of code, you might give the two programmers the benefit of the doubt and assume they came up with more-or-less the same function independen... |
I have a fairly in depth question which probably doesn't have an exact answer.
As a software engineer, I am usually tasked with working on a program or project with minimal understanding of how other components or programs in the project interact with each other. When one program fails in a sea of multiple components ... |
I'd like to release an application that basically has the license of "the code is GPLd but forks cannot use the name or logo", with the intent of avoiding confusion to users.
Is that possible or is it an all or nothing deal?
|
This is somewhat related to my other question, but is actually different.
I would like to license a Windows Phone application under the GPL. All other Windows Phone Marketplace issues aside (I'll ask those on the forums), I'd like to include icons that ship with the SDK in my application. While this is common practice ... |
I support and develop a large system that uses various technologies e.g. c++,.net,vb6 etc. I am a sole developer.
I am debating whether now is the right time to approach my manager (who is not a developer) to ask if another developer can be recruited.
I don't have any experience working in software teams. I have alw... |
I have seen several developers looking for a solution for this problem: accessing session information from a different WAR (even when inside the same EAR) - here are some samples: Any way to share session state between different applications in tomcat?, Access session of another web application, different WAR files, sh... |
KISS ("keep it simple, stupid" or "keep it simple stupid", see e.g. here) is an important principle in software development, even though it apparently originated in engineering. Citing from the wikipedia article:
The principle is best exemplified by the story of Johnson handing a team of design engineers a handful of ... |
In our team meeting today a senior member brought up the proposal that we should be having a common location/structure for our development solutions.
A couple of his points were:
Making it common meant when talking about projects and emailing stuff everyone is on the same wavelength and knows where to look.
If there i... |
We filter and analyse seats for events. Apparently writing a domain query language for the floor people isn't an option. I'm using C# 4.0 & .NET 4.0, and have relatively free reign to use whatever open-source tools are available. </background-info>
If a request comes in for "FLOOR B", the sales people want it to sho... |
I tried to evaluate a Clojure expression with nested shorthand functions today, and it wouldn't let me.
The expression was:
(#(+ % (#(+ % (* % %)) %)) 5) ; sorry for the eye bleed
The output was:
IllegalStateException Nested #()s are not allowed clojure.lang.LispReader$FnReader.invoke (LispReader.java:630)
...and a b... |
Before being release to the public, has the syntax of any programming language undergone usability testing? If so, what kinds of testing was performed, what were the results, and what impact did the testing results have on the design of the language?
|
When someone refers to "Development Automation", what is it exactly?
What are some frameworks for development automation?
My boss asked me to develop a strategy for implementing such in the company but I have not found much information related to the matter. Google seems to think I am referring to testing automation, w... |
In Objective-C, there are several methods like initWithContentsOfFile:encoding:error: where one passes in a reference to an NSError object for the error: parameter. In this example, the value of the NSError object passed in can change based on what goes on at runtime when the method is being called and whether the body... |
Problem Summary:
Long story short, I inherited a code base and a development team I am not allowed to replace and the use of God Objects is a big issue. Going forward, I want to have us re-factor things but I am getting push-back from the teams who want to do everything with God Objects "because its easier" and this m... |
Our team is considering using Mule in a large scale medium volume internal facing transactional banking application.
At first Mule would just be used as an application server although it is possible some of its esb/orchestration features would be used in the future.
I have no experience with mule, being new on the team... |
I am building a WPF client application using the MVVM pattern that provides an interface on top of an existing set of business logic residing in a library which is shared with other applications. The business library followed a domain-driven architecture using CQRS to separate the read and write models (no event sourc... |
After looking around the internet, I decided to create DAOs that returned objects (POJOs) to the calling business logic function/method.
For example: a Customer object with a Address reference would be split in the RDBMS into two tables; Customer and ADDRESS. The CustomerDAO would be in charge of joining the data from... |
My manager pushes me to use his self defined best practices. All of these practices are based on is own assumptions. I disagree with them and I would like to have some feedback of well experienced people about these practices. I would prefer answers from people involved in the maintenance of huge products and people wh... |
I find myself pondering over this question from time to time, again and again. I want to do things the right way: to write clean, understandable and correct code that is easy to maintain. However, what I end up doing is writing patch upon a patch; just because there is no time, clients are waiting, a bug should be fixe... |
Are there any common practises for commenting the regular expressions: inline comments referring different part of RegEx or general comment for all expression?
|
I post the origin question in stackoverflow, some people suggest me to post here
I've always have trouble with dynamic language like Python.
Several problems:
Typo error, I can use pylint to reduce some of these errors. But there's still some errors that pylint can not figure out.
Object type error, I often forgot wha... |
Quoting from Wikipedia
The Document Object Model (DOM) is a cross-platform and language-independent convention for representing and interacting with objects in HTML, XHTML and XML documents.
and from wc3
In order to provide a precise, language-independent specification of the DOM interfaces, we have chosen to define... |
How do you evaluate a product owner? More specifically, how would one conduct a performance review of a product owner? What qualities or characteristics would one look at when reviewing a product owner?
|
In my work (writing scientific software in C++), I often get asked by the people who use the software to get their work done to add some functionality or change the way things are done and organized right now. Most of the time this is just a matter of adding a new class or a function and applying some glue to do the jo... |
I am considering writing an Android reader software that can read ePubs and display them. I checked the ePub standard documents. However, these contain a lot of information. So I am wondering what is the process of implementing a standard for a file format. What are the steps to get a working implementation without... |
From my general understanding I believe UserContext for a web application is supposed to hold user authentication and authorization (user roles) information.
As part of user roles, there are definitions on who can access what data and accordingly the corresponding reference data is loaded into the UserContext as well.
... |
I'm doing work that involves writing code and managing developers in a "special projects" division of a large company. I'd like to define my role better and figure out if there's an industry standard term for what I do, so that it will be easier for me to research best practices and work on a career path
What I do all... |
So I got started with a real project of mine on GitHub and things are going pretty well and ideas are flowing a lot faster than I initially thought. In order to keep things organized, I setup some branches so I can develop different features separately.
Now when I push my branch to GitHub, I have that section where I ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.