instruction stringlengths 34 19.9k |
|---|
I have several classes with a reasonably complex (but acyclic) dependency graph. All the dependencies are of the form: class X instance contains an attribute of class Y. All such attributes are set during initialization and never changed again.
Each class' constructor has just a couple parameters, and each object knows... |
I'm working with ASP.Net and trying to style an ImageButton. I tried to do this via CSS only to discover that for some reason, .Net writes out an inline style setting the border width to 0 automatically. This overrides the border width from CSS, so I have to set it manually in the codebehind.
My question is, should I... |
I'm working on a toy compiler (for some simple language like PL/0) and I have my lexer up and running. At this point I should start working on building the parse tree, but before I start I was wondering: How much information can one gather from just the string of tokens? Here's what I gathered so far:
One can already ... |
I have seen code like this in several places:
(function() {
var method;
var noop = function noop() {};
var methods = [
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
'markTimeline', 'profile', 'profile... |
I'm asking because approach in my company looks as follows:
stories in the backlog are not estimated
team that picks the story estimates it in story points during sprint planning part two
|
After exposing to Windows App Store development for a month, I begin to feel that async / await programming model does more harm than good. It makes simple thing complicated.
Take an example, folder creation. In Java or Desktop .NET, I can simply do
Java
public Constructor()
{
new File("c:\\folder").mkdirs();
S... |
When connecting to a server using the DRDA protocol, is it true that the first Client-To-Server command MUST be EXCSAT chained with ACCSEC?
I found 2 different answers when I googled it.
If you look at The Open Group web site (https://collaboration.opengroup.org/dbiop/) it can be understood that the answer is NO.
Howev... |
I would like to know if there's a known algorithm or best practice way to do the following:
I have a collection with a subcollection, for example:
R1 R2 R3
-- -- --
M M M
N N
L L
A
What i need is an algorithm to get the following result:
R1, R2: M N L
R2: A
R3: M
This is -not- what i want, it has more repeatin... |
Say I have a method like this:
public void OrderNewWidget(Widget widget)
{
if ((widget.PartNumber > 0) && (widget.PartAvailable))
{
WigdetOrderingService.OrderNewWidgetAsync(widget.PartNumber);
}
}
I have several such methods in my code (the front half to an async Web Service call).
I am debating if i... |
I use Visual Studio 2012 and he have cases where we added templates parameters to a class "just" in order to introduce a "seam point" so that in unit-test we can replace those parts with mock objects.
How do you usually introduce seam points in C++: using interfaces and/or mixing based on some criteria with implicit in... |
Here is a query language, more specifically, it's JQL, you can use it in Jira, to search for issues, it's something like SQL, but quite simpler.
My case is that, I need to construct such queries programmatically, in my application.
Something like:
JQLMachine jqlMachine = new JQLMachine()
jqlMachine.setStatuses("Open", ... |
I don't really understand the term.
I got a survey about either getting gift card or a complimentary license for a SDK control set.
But I really wonder what's complimentary license means?
I tried to search in their official site but didn't say anything about it...
Is it last for the life and I can use the controls in ... |
I'm making a program that will post data to a database, and I've run into a pattern that I'm sure is familiar: A short table of most-likely (very strongly likely) fixed values that serve as an enum. So suppose the following table called Status:
Status
Id Description
--------------
0 Unprocessed
1 Pending
... |
I have forked a repo and branched that clone to code a story, and because I didn't understand the problem, wrote code that isn't solving my task at hand, but may prove useful later.
Should I:
Delete it, and don't worry about it. Then commit without the extra code.
Make yet another branch for just that work, commit it,... |
A google scholar search turns up numerous papers on testability, including models for computing testability, recommendations for how ones code can be more testable, etc.
They all come with the assertion that more testable code is more stable, however I can't find any studies which actually demonstrate this.
I tried loo... |
What is the best process for code review when using GIT? We have an external GIT provider (Unfuddle) and have caps on resource usage - so we can't have dedicated remote repositories for every dev.
Current process:
We have a GIT server with a master branch to which everyone commits
Devs work off the local master mirro... |
I've built an application that requires users to authenticate with one or more social media accounts from either Facebook, Twitter, or LinkedIn.
Edit
Once the user has signed in, an 'identity' for them is maintained in the system, to which all content they create is associated. A user can associate one account from ea... |
I am working on a freelance job at home. The client wants me to write some new functionality for his CMS, but it is taking me a lot of time to figure out what the code is doing, because it is written in a very unreadable style.
Below is just an example of what I mean. The previous programmer made extensive use of anony... |
I'm wondering what generic build tools out there include their binary run-times and do not depend on another environment not shipped with them.
For example, ANT requires Java, Rake requires Ruby, etc..
would be great if talking about also target-platform-agnostic tools, where I'd just give whatever command for building... |
Is it preferable to have # in a link's href attribute when I am implementing the click event via jQuery, or is it ok to leave href empty?
i.e.
<a id="myLink" href="#" />
vs
<a id="myLink" href="" />
When I'm doing
$("#myLink").on('click', function() {
// do ajaxy stuff
});
Although I understand the click event co... |
I've been setting up debug tags for automated testing of a GWT-based web application. This involves turning on custom debug id tags/attributes for elements in the source of the app. It's a non-trivial task, particularly for larger, more complex web applications. Recently there's been some discussion of whether enabling... |
Our company is looking at implementing BDD in our .NET application. Specifically, SpecFlow.
We can foresee a large number of common steps being created ('Given a customer', etc), so what methods have been used to document these, so that the business can reference them? Is XmlDoc on the step definition classes sufficien... |
Recently we got a requirement for converting a classic asp project to asp.net.
This one is really a very old project created around 2002/2003. It consists of around 50 asp pages. I found very little documentation for this project, FSD and design documents for only a few modules.
Just giving a quick look into this proje... |
If I had a code which terminated based on if a random number generator returned a result (as follows), would it be 100% certain that the code would terminate if it was allowed to run forever.
while (random(MAX_NUMBER) != 0): // random returns a random number between 0 and MAX_NUMBER
print('Hello World')
I am also i... |
What is the capitalization conventions for protected field names in C#?
Is it _myVar (like private field) or MyVar (like properties)?
|
I've always done this wrong, I'm sure a lot of others have too, hold a reference via a map and write through to DB etc..
I need to do this right, and I just don't know how to go about it. I know how I want my objects to be cached but not sure on how to achieve it. What complicates things is that I need to do this for a... |
I have been looking at the terms constructor injection and dependency injection while going through articles on (Service locator) design patterns.
When I googled about constructor injection, I got unclear results, which prompted me to check in here.
What is constructor injection? Is this a specific type of dependency i... |
I was a freelance web developer until circa 2004 when I started going down the management route but have decided to try to get back into development again (specifically JavaScript and HTML5 web/mobile web apps) and I really get the impression to be truly good at these and similar fast moving technologies a constant amo... |
I have a few (view) classes.
Table, Tree, PagingColumn, SelectionColumn, SparkLineColumn, TimeColumn.
currently they're flat under app/view like this:
app/view/Table
app/view/Tree
app/view/PagingColumn
...
I thought about restructuring it, because the Trees and Tables use the columns, but there are some columns, which... |
I have a problem when implementing the MVC-pattern on iOS. I have searched the Internet but seems not to find any nice solution to this problem.
Many UITableViewController implementations seems to be rather big. Most examples I have seen lets the UITableViewController implement <UITableViewDelegate> and <UITableViewDa... |
It is obvious that first cout prints 7 7 but why the second one prints 8 8 7 ? Why not 7 8 8? How does such constructions work in c++?
int ink(int *x){
*x += 1;
return *x;
}
int main(){
int *a;
int b = 6;
a = &b;
cout << ++b << " " << b << endl;
cout << b << " " << ink(a) << " " << ... |
I've seen countless times the following approach suggested for "taking in a collection of objects and doing X if X is a Y and ignoring the object otherwise"
def quackAllDucks(ducks):
for duck in ducks:
try:
duck.quack("QUACK")
except AttributeError:
#Not a duck, can't quack, don't worry about it
... |
I have just started working with symfony2 and have run across comment annotations.
Although comment annotation is not an inherent part of PHP, symfony2 adds support for this feature.
My understanding of commenting is that it should make the code more intelligible to the human. The computer shouldn't care what is in co... |
I don't use C++ or bitwise operations at my current job but I'm thinking of applying to companies where it is a requirement to be fluent with them (on their tests anyway).
So my question is: Can anyone suggest a project which will require gaining a fluency in bitwise operations to complete?
On a side note, is there a c... |
I did not study CS nor IT. I just became a developer, now working with Java. Actually, since I now work with a big company writing high-scalable web applications, I think I need to be better with details.
I have no understanding of what happens underneath of Java. Java Performance, Server-Side Java might be the buzz wo... |
Being a PHP programmer for the last couple of years, I'm just starting to get into advanced programming styles and using polymorphic patterns. I was watching a video on polymorphism the other day, and the guy giving the lecture said that if at all possible, you should get rid of if statements in your code, and that a s... |
I'm a software developer working in an embedded systems company.
We have a Project Manager, who takes care of the overall project schedule (including electrical, quality, software and manufacturing) hence his software schedule is very brief.
We also have a Software Manager, who's my boss.
He makes me write and maintain... |
So I got my first job recently as junior web-developer.
My company creates small/medium sites for wide variety of customers: autobusiness companies, weddign agencies, some sauna websites, etcetc, hope you get my point. They don't do big serious stuff like bank systems or really big systems, it's mostly small/medium-siz... |
I am reading an explanation (awesome "Parsing Techniques" by D.Grune and C.J.H.Jacobs; p.292 in the 2nd edition) about how to construct an LR(1) parser, and I am at the stage of building the initial NFA. What I don't understand is how to get/compute a lookahead symbol.
Here is the example from the book, the grammar:
S ... |
I am working with a group where part of the responsibilities is managing a certain set of configuration files which, of course, have the same skeleton/structure across different environments but different values (like server, user, this setting, that setting etc.). Pretty classic scenario...
The problem is that everyo... |
If a programmer contacts you and asks to contribute to your project, how do you handle it?
You don't know if this guy is any good. Perhaps he'll be more trouble than he's worth.
He might be trying to attach his name to a successful project just for the kudos.
He might be trying to take the project in a direction you d... |
In the release notes for PHP 5.5.0 it's announced that Windows XP and Windows 2003 are not supported anymore:
Drop Windows XP and 2003 support. (Pierre)
Why is this? Many people in different companies develop applications under Windows XP.
So, can anyone tell me what is the sense of dropping Windows XP and 2003 sup... |
I've checked many websites to be inspired about what the look and feel of a serious enterprise web-application should look like. But the whole I saw were designed for being used by single users and not serious corporate users. The designs I saw were mostly happy-colored, and looked like being developed by a small team ... |
As a developer, can you tell your project manager that an application is unworkable? Or, if you're a project manager, how would you need this presented to you in order to be compelled? This isn't about "how to work on a poor project", it's assuming you cannot.
I can provide an example of the situation if anyone thinks ... |
I am reading an explanation (awesome "Parsing Techniques" by D.Grune and C.J.H.Jacobs; p.293 in the 2nd edition) and I moved forward from my last question: How to get lookahead symbol when constructing LR(1) NFA for parser?
Now I have such "problem" (maybe not a problem, but rather need of confirmation from some more ... |
This approach is pretty much the accepted way to do anything in our company.
A simple example
When a piece of data for a customer is requested from a service, we fetch all the data for that customer(relevant part to the service) and save it in a in-memory dictionary then serve it from there on following requests(we ru... |
How do I correctly sub-license a library that is under the MIT license.
I am using and extending the library. The MIT license states that I am free to sub-license the library.
Can I simply state:
<Software library> is copyright <original author> and licensed under the MIT license.
<orignal license>
Extensions to <Sof... |
I have an HTTP Server Service application which has its own logging mechanism. It's written in Delphi. I would like to provide a way for multiple clients to connect to this service and get a real-time update of the log. The log in the service moves rather fast, there's a lot of things to log. There may be up to 50 mess... |
Suppose I'm developing a (javascript) library which is hosted on a public repo (e.g. github). My aim in terms of how version numbers are assigned and incremented is to follow the guidelines of semantic versioning.
Now, there's a number of files in my project which compose the actual lib and a number of files that 'supp... |
I understand that User Stories dominate the agile world, but how are these artifacts stored, so that new developers who join the team can come up to speed with the requirements?
What if the User Story changes later, how is it updated and kept as an artifact? I've seen many teams just open a new ticket/feature request/b... |
I have a client, for which I'm going to do an Web application about patient care, managing patients, consults, history, calendars, everything about that basically.
The problem is that this is sensitive data, patient history and such.
The client insists on encrypting the data at the database level, but I think this is g... |
User creates a folder in client and in the client-side code I hit an API to the server to make this persistent for that user. But in some cases, my server is so busy that the request timesout. The server has executed my request but timedout before sending a response back to client. The timeout set is 10 seconds in clie... |
As a java programmer, I have always been critical of Unchecked Exceptions. Mostly programmers use it as an en-route to coding easiness only to create trouble later. Also the programs (though untidy) with checked exceptions are much robust compared to unchecked counterparts.
Surprisingly in Scala, there is nothing calle... |
I have an awesome URL, I've had it since the mid 90's, and up until around 2002 I was having an awesome time writing music reviews and features into static pages and adding their URL to static index pages and everything was just great.
Then things got complicated really fast, and for one reason or another I handed the ... |
The procedure in my team is that we all commit our code to the same development branch. We have a test server that runs updated code from this branch so that we can test our code on the servers. This test server is exposed on the internet so that we can test callbacks from third-party services like sendgrid. (where you... |
I have website that crawls data from many third party services when user browse to webpage. This can be really slow because I hit third party server and process returned data before showing it to user. I am hosting website on Azure (shared mode). I am thinking to improve my implementation. Here is what I am thinking...... |
I have a slideshow of images (and links) on a page. These images are part of a JSON response to a request sent after the page loads. The slideshow is set to play at an interval of 2 seconds. The slideshow can be paused, played over, and all other controls a normal slideshow would have.
As a Rails dev, I proposed cucumb... |
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.