instruction stringlengths 34 19.9k |
|---|
Suppose you have this code in a class:
private DataContext _context;
public Customer[] GetCustomers()
{
GetContext();
return _context.Customers.ToArray();
}
public Order[] GetOrders()
{
GetContext();
return _context.Customers.ToArray();
}
// For the sake of this example, a new DataContext is *req... |
Is there a reason that a semi-colon was chosen as a line terminator instead of a different symbol?
I want to know the history behind this decision, and hope the answers will lead to insights that may influence future decisions.
|
I currently have a web application and I would like to add a messaging feature to it.
In order to do that, I use JMS(actually OpenMQ, the implementation provided with Glassfish 3).
The problem is that I do not know how to get the message notification from the background(from the listener) to the foreground.
I am using ... |
I am a Software Engineer professional. I have studied calculus as a core course in my graduation studies. I want to ask question, that what/where is the implementation of calculus in computer science?
|
The project I am putted in is running awful. :-) Main Problem is a missing architecture and a missing guidline how to organize projects. In this case I have done a sample project architecture with UML class and component diagrams and layer diagrams. The main problem is, that I have to present this architecture to the m... |
At work, we're deploying a software bundle of a Java application (written by us) which has lots of external dependencies, most of them being LGPL and BSD-licensed third-party-libraries distributes as JAR archives.
Currently, we're deploying a test-client of the software which is distributed as a single java fat jar arc... |
I am developing an application using WebSocket to exchange messages; it is based on JSF 2.0.0, but the idea is similar and HTML5 have WebSocket support.
Is the only difference between those language the used tag and the syntax? Is the logic behind it the same?
I wonder if there any converter for this.
|
How do most companies define and manage message format specifications? Is it common for companies to create custom tools for creating and working with these documents?
At work we have a lot of systems that communicate via UDP messages. Each system has its own Interface Control Document (in Word or in HTML) which descri... |
I am from Java background and am new to JavaScript. I have noticed many JavaScript methods using single character parameter names, such as in the following example.
doSomething(a,b,c)
I don't like it, but a fellow JavaScript developer convinced me that this is done to reduce the file size, noting that JavaScript files... |
I make a lot of typing mistakes when I program. I have a good keyboard writing speed but I try to write faster and in the process end up making typos.
I want to type faster, but make less errors. Can I do something to improve the situation?
|
When building an application from scratch, should I start with the object-oriented (OO) model or the entity-relationship (ER) model?
|
I love being a programmer. There, I said it. However, with that said, I've realized lately that I really can't stand bug-fixing. At all.
In fact, while I'm developing something, my productivity is extremely high. Even when writing unit-tests and doing self testing of my development, I'm generally really productive. I ... |
Is there any recommended/generally accepted coding style for handling situations where a function returns a tuple of values but only one of those values is used afterwards (note that this is mostly meant for library functions I can't change -- writing a wrapper around the call is probably a bit of overkill…)?
Instead o... |
The requirements are to take an existing list of identical tables (AAA0001 - AAA9999) which generally don't meed our current requirements and need to be swapped out with three tables (XXX0001-XXX999, YYY0001-YYY999 and ZZZ0001-ZZZ999).
Currently, the guy who is programming this update which is supposed to take place on... |
So I was speaking to one of the folks I work with here a few days ago, and they were complaining that their company no longer allows workers to work remotely at all any more due to the decrease in productivity. As someone that has heard this excuse used for justifying onsite only staffing in my search for remote opport... |
Having messed around with several scripting languages and being a bit of a linguist, there seems to be a way to divide dynamically typed languages into two groups: languages that give variables a default value, and languages that treat accessing an up-to-now unused variable an error.
For instance, consider this code:
p... |
We are planning to use Google Analytics in our organization and I am in charge for setting it up. I was wondering how to deal with multiple environments. We sure do not want to collect data during development and QA (or maybe collect data to a different analytics account), but we want to when the site goes to productio... |
Most programming languages have some design decisions that influence their usage and applicability.
For example:
Python focused on maintainability/readability of code and had indentation be a part of the language itself.
Java's intention was to be cross platform OOP 'easier' and 'friendlier' than C++
Objective-C was... |
After doing a rough sketch of a high level object model, I am doing iterative TDD, and letting the other objects emerge as a refactoring of the code (as it increases in complexity). (That whole approach may be a discussion/argument for another day.)
In any case, I am at the point where I am looking to refactor code blo... |
I'm dealing with pretty stressful (in my opinion) situation in my current work place.
We've started developing new project, get some requirements, implemented it and then show to someone you can call a 'business advisor' (person who knows business requirements but will not use the program). That person is supposed to ... |
I was reading up on design patterns, to better my understandings of ones I know and reveal ones I didn't. One of the last ones I looks at was the Flyweight Pattern. It preaches about shared common function, and I understand this. Keeping with the game example (in the link), sharing functions for units in an RTS I'm sur... |
We're using agile methods in my current project at the moment, and we have heaps of stories like these:
As an assistant, I want to pay a customer a refund so that they can
get some money when they request it
As a customer, I want to pay for a purchase so that I can receive my
item.
How we've done it so far is to pick... |
I've been using CoffeeScript for a while now. On Wikipedia, it is said that CoffeeScript is influenced by Haskell. But after I check out the syntax of Haskell, I have found little resemblance from CoffeeScript.
Which aspect of CoffeeScript is influenced by Haskell?
|
I'm working through designing a RESTful API. We know we want to return JSON and XML for any given resource. I had been thinking we would do something like this:
GET /api/something?param1=value1
Accept: application/xml (or application/json)
However, someone tossed out using extensions for this, like so:
GET /api/som... |
I've read all of the posts I can find on this and I'm still not sure of the answer.
I'd like to use a jQuery plugin on my website that is dual licensed under MIT and GPL.
Does the dual license mean that as long as one or the other is satisfied I'm fine, or does it have to be both?
I've read that a GPL javascript being... |
I very often find myself in situations where I should have opened a parentheses, but forgot and end up furiously tapping the left arrow key to get to the spot I should have put it, and doing the same to get back to where I was - that, or removing one hand from the keyboard to do it with the mouse. Either way, it's a st... |
Recently I have project in which a directory listing is enabled, due to which some scripts can be seen by outside world. I asked website administrator and he said it's not his responsibility, its the programmer's job. I also asked programmer about this and he said that the script is actually a cron job, and according t... |
I love Rich Hickey, Clojure and Haskell and I get it when he talks about functions and the unreliability of side-effecting code.
However I work in an environment where nearly all the functions I write have to read from the database, write to the database, make HTTP requests, decrement a user's balance, modify a fronte... |
Possible Duplicate:
Techniques to re-factor garbage and maintain sanity?
Code maintenance: keeping a bad pattern when extending new code for being consistent, or not?
I was hired about 6months by a company that uses Agile, but after learning the code I've realized that it's bad code - methods with over 100 lines of c... |
I'm slowly trying to migrate our web application to use CQRS principals. In particular, I have separated "write" and "read" interfaces into commands and queries.
I have implemented a "reader" class that can read some data from the DB. I have also implemented a decorator for this reader that caches the data to avoid... |
There are several approaches on how to model a business process in software applications (BPM software). For instance, a processes can be described in BPMN, EPC, IDEF0, SOMF, etc.
Additionally, different process execution languages such as BPEL, RPC, Wf-XML are available.
If I were to develop software for the BPM-mark... |
I would like to investigate whether ClojureScript, with the associated Google Closure library is a reasonable tool to build modern, in-browser, Javascript applications.
My current Javascript stack consists of jQuery, Backbone and RequireJS with the possible additions of some widgets libraries like jQueryUI or KendoUI. ... |
I am basically asking this question to see if I am being unreasonable. My current employer has locked down the machines of all developers so that we do not have access to the root or c: drive. For example, I cannot write a directory under C:. I also cannot install any software which touches the registry. Is this an... |
Performance testing is something that I, as a developer do when optimizing. However, if the change is purely optimization, should the QA or business user perform their own performance testing? I would reckon they should, aside from testing that the functionality remains the same. If that's the case, is it acceptable fo... |
While searching for jobs online I noticed that most PHP web developer jobs ask you to know about algorithms and data structures.While I don't know PHP yet I have started to learn it in order to obtain a job in that field.
While I have seen some similar questions on the forum I don't feel like the answers satisfied my n... |
After reading another question about JQuery and CDN's, is it feasible for tools like JQuery to "come with" the browser, thus reducing/eliminating the need for the first download from a CDN, or from your own host server.
JQuery files specifically are pretty small, so you could easily have a number (all?) of the differen... |
My understanding of a primitive datatype is that
It is a datatype provided by a language implicitly (Others are user defined classes)
So different languages have different sets of datatypes which are considered primitive for that particular language. Is that right?
And what is the difference between a "basic datat... |
I have a database design question. Basically I want to be able to create a schema for a User model, then use this User model in other models that extend User but I want to design it in such a way that it's generic enough to be used in every application.
For example a Profile or Account model might extend User, and in b... |
As I understand it, writing your objects in an immutable style can help the performance of your program for compiled languages, as the compiler tends to rewrite your code in single static assignment form under the hood anyway.
Is there a performance benefit to using immutable objects in an interpreted language like Pyt... |
Short version: I want "Login on program startup" checkbox like in Skype, for example, but don't know how to protect saved credentials securely.
I'm writing client application which, before doing actual requests to server, should be authorized by server. Authorization goes as follows: user fills in standard login dialog... |
These days I've been learning a lot about how different scientific fields are trying to move their data over to the Semantic Web in order to "free up data from being stored in isolated silos". I read a lot about how these fields are saying how their efforts are implementing the "visions" of the Semantic Web.
As a learn... |
Our current user's guide is built using asciidoc. The documentation is managed by a non-technical person, but we keep the source text files as well as generated HTML in source control. Issues arise when they are making doc updates for version x.z in the x.y branch. Typically, one of the developers will update their env... |
I started with PHP a little while ago. I've been doing a lot of tutorials, practice sites, etc. and it's going great.
One thing I like about PHP is how easy it is to get started (downloading WAMP and voila). However, up until I learned about PEAR and MVC frameworks, I haven't put much thought in using a command line I... |
I was wondering what advantages the ontology languages of RDFS/OWL has over using a tagging/markup system (such as http://www.schema.org/) for managing and creating metadata?
|
Many books about algorithms and data structures are coded by imperative languages. Is there any book that can show functional programming languages can do the same thing or do them better?
In particular I am interested in sorting, searching, data structures and graph.
|
About 3 months ago, our engineering group rolled out Review Board to be used for all peer code reviews. Today, I had a discussion with one of the people involved in that process and found out that we are already looking for a replacement (possibly something commercial) because of several missing features.
One of the f... |
I have multiple entities like Hotels, Destination Cities etc which can contain images. The way I have my system setup right now is, I think of all the images belonging to this universal set (a table in the DB contains filePaths to all the images).
When I have to add an image to an entity, I see if the entity exists in ... |
When programming in C, I often get the advice to turn on many or all warnings and not ignore warnings.
Does the same hold in PHP, should I enable all warnings in the PHP log?
|
I was browsing a github project and found this module which has more than 10 thousand lines.
Is it a common practice to have that much code in a single module?
It seems to me that this should be split over multiple modules. Maybe one for each db engine.
What benefit does the developer get from making one huge module li... |
This is basically a logging/counting application that is counting the number of packets and counting the type of packet, etc. on a p2p chat network. This equates to about 4-6 million packets in a 5 minute period. And because I only take a "snapshot" of this information, I am only removing packets older than 5 minutes e... |
I am learning "Programming languages principles" and there is a lot of information about stuff which make up a programming language . Unfortunately every material I came across until now has a lot of technical jargon involved and is very difficult to understand (Atleast for a beginner sincerely trying to understand the... |
What's the role of a Project Manager in Scrum?
I have heard that it is not advisable for the PM to be a SCRUM Master which I can see as making sense as the PM oversees the project whereas the SCRUM Master is more concerned with managing the work packages.
To my mind it would seem that having a PM as SCRUM Master goes a... |
I'm in a code shop of two. And while I understand that a bug tracker is useful where the number of programmers is greater or equal to one, I'm not so convinced that logging bugs, changes, and fixes is worth the time when they're trivial. When I find a simple bug, I understand it, fix it, and run it through some testing... |
I am a contract data analyst, so I bounce between jobs every 3-6 months, which I find to be a good fit for me, but it leads to some problems when it comes to coding. I mostly do statistics (I've asked a similar question on cross validated, but the answers there are not relevant here), but I have also found out that the... |
Here's a problem I frequently run into: Let there be a web shop project that has a Product class. I want to add a feature which allows users to post reviews to a product. So I have a Review class which references a product. Now I need a method that lists all reviews to a product. There's two possibilities:
(A)
public c... |
I have a library that makes architecture to load data from server and display all controls in table layout. It works great but it have a lot of TODOs there.
Also, this library in 99% created by me. I starts developing it in when I working in one company, continue developing in in other company - I just move code protot... |
It's a bit subjective, but I'm hoping to get a clearer understanding of what factors make an operator clear to use vs obtuse and difficult. I've been considering language designs recently, and one issue that I always circle back around on is when to make some key operation in the language an operator, and when to use ... |
I am deriving a class, for use in my application, from a class provided by another group. Should the derived class be in the namespace for my application or the namespace of the parent class?
While I am extending the class to add features I need, the added features are not specific to my application. The project that ... |
I, perhaps, made a wrong choice of going with a Component-based Framework like JSF for an internet facing, high traffic web application.
Development with JSF has although been easier but what I fear now is whether JSF would allow me that scalability & performance with all it fundamental problems & issues. State saving ... |
I've come across Twitto, which basically is a web framework that fits in a tweet. It is so short that I can post the code here :
require __DIR__.'/c.php';
if (!is_callable($c = @$_GET['c'] ?: function() { echo 'Woah!'; }))
throw new Exception('Error');
$c();
It basically searches for a file named c.php and calls wha... |
I read an article a while back (forgot from where) that essentially stated that someone wrote a virus and inserted it into an image. The end result allowed the cracker to have his way with the system.
How is this possible?
|
I work on enterprise Java projects that do not have a single entry point from where I can trace the flow of execution. Some of the projects have hundreds of classes, and when I'm asked to add a feature to a project, I often find myself at a loss as to where to start looking at code.
What's the best way to dive into suc... |
Today at work I found the following situation:
We had two tables, A and B, with B having a foreign key linked to the primary key of A.
On our application, we got two main situations that created the problem :
One where we had to add add some records in A, followed by the creation of some records in B referring to the... |
I want to create something useful of my own which others can use it. This can be free or it can make a little money for sustaining its development and increase income little. However, when think about the market, I don't know what market is lacking applications, what types of domain can be possible for a solo developer... |
We are trying to make our releases more frequent. As part of that we have blocked out a day of the week where we told users that we'll be doing updates. Similar how Microsoft has Patch Tuesday.
This is for a web app running completely server side, by the way. So updates are not a huge problem to deploy. Though they can... |
A lot of my research over the next few weeks will be into different CMS's. I've already had a brief look at episerver and umbraco. While reading into these systems I can't help but think that providing content management features are achievable without learning the details and structure of many of these (rather large) ... |
Me and my friend are developing a web-app in Python + Flask + PostgreSQL. We have been working on it for the past few months and have developed a lot of schema/use-cases specific to Python + Flask + PostgreSQL. Now, all of a sudden, we plan to move to another NoSQL database (Neo4j) because it somehow fits better to wha... |
In Agile development you work on small user stories and produce a working iteration.
But what happens when the next user story comes in and affects the design for the already done iteration?
Sometimes it seems like re-doing the last iteration or another user story to incorporate the new user story in the last iteration... |
I'm writing a document describing process improvement recommendations. I have some best practices I've learned so far. I use those practices most of the time. But I suppose there are other ways to approach the task of writing formal process description document.
So, how do you usually structure your documentation? As y... |
My primary day job is making HTML applications. With that I mean internally used CRUD-type applications with lots of editable gridviews, textboxes, dropdowns, etc. We're currently using ASP.NET webforms, which do get the job done, but the performance is mostly dismal, and quite often you have to jump through hoops to g... |
We are putting together some distribution software, selling about 150K SKU's. Some of our items have additional requirements in order to be sold that are dictated by our vendors. For instance one type of product that we sell are prosthetic feet. Some vendors require that we capture the users weight, activity level, and... |
I always hear that PHP is for medium and small websites whereas .NET and Java for enterprise applications. My question is about PHP. Why is PHP not a good option for enterprise web applications? Is it because if the web application becomes bigger then PHP will be slower as it is an interpreted language?
I know that cor... |
I have a complex non-binary graph model.
Each tree node can have multiple children&parents (a node can also have a connection to it's "brother").
A node is represented as square on screen with lines to the connected nodes.
For that I want to use Draw2D and GEF libraries.
The problem I am facing is the graph layout... |
I have been practicing agile for more than a year now. As part of our sprint, some times we will have Investigation Tasks. We skip poker planning for theses tasks, and adds blanket numbers.
Theses are tasks like investigating some tricky defects or technical feasibility of some features etc..
Is this proper or is ther... |
First allow me to coin a term:
code goal-tending: Checking out code in the morning, then silently reviewing all of the changes made by the other developers the previous day
file by file, (especially code files you originally developed), and
fixing formatting, logic, renaming variables, refactoring long
methods, ... |
Our customer wants us to write a custom application for him that he can use on a handful of iPads in his company. This application is probably only useful for this one customer (maybe for two or three more in the future, but only after additional customization).
I read that if the customer subscribes to Apple's Volume ... |
I have a CRUD app for <DomainObject>s. They are persisted in a database.
There is a new requirement: keep track of the <DomainObject>s that have been created since the app was opened, so that the user can see what he/she has done.
I see three ways to implement this:
every time the app is opened, create a new session... |
Is it possible to use a non relational database be in an Order management system for an e-commerce company with a large number of orders everyday, like Amazon? Can the benefits of Non Relational databases (scalability, reliability etc) be exploited in this scenario, or, is it impossible to give up ACID properties and h... |
Best Practice of making a Composite Control with a repeater activity
It's Templated-Based,
have paging support via a DropDown and 2 Buttons
It should have Event-Handling also
Needed to work as a package for
( so didn't want to give template-editability
or much programming options )
Key Parts to answer :
A Custom Rep... |
There are multiple ways of tracking code ownership (i.e., collective, team or individual).
In case of team or individual ownership, how do you:
track ownership?
deal with situations when dev leaves or team splits/re-organizes for new projects?
|
I am an above average programmer (I take interest in the development of languages, frameworks and technology in general and have a good grasp of systems), but I constantly find my self not being able to deliver things (on time). This does not affect my day to day work as it has good control process (bite sized tasks wi... |
PHP is not a bad language (or at least not as bad as some may suggest). I had teachers that didn't even know PHP was object oriented until I told them. I've had clients that immediately distrust us when we say we are PHP developers and question us for not using chic languages and frameworks such as Django or RoR, or "e... |
This is a problem because when I do email campaign,
There is a link on the email, that link to my company homepage,
I would like to differentiate between the visitor come from another way (e.g. search on google) or the visitor come from the email I have sent.
Is it able to check such kind of information ? Thankyou
|
My team at work is moving to Scrum and other teams are starting to do test-driven development using unit tests and user acceptance tests. I like the UATs, but I'm not sold on unit testing for test-driven development or test-driven development in general.
It seems like writing tests is extra work, gives people a crutch... |
The company I work for sends a lot of emails, and in return we get a lot of bounces.
We currently don't have a good way of sorting them and help us archive the routine ones while putting the important ones in front of human eyes.
From a format of view these email bounces are not well structured, but there are some sort... |
Exchange 2010 has a delegation model where groups of winrm cmdlets are essentally grouped into roles, and the roles assigned to a user.
(Image source)
This is a great & flexible model considering how I can leverage all the benefits of PowerShell, while using the right low level technologies (WCF, SOAP etc), and requir... |
To start with the background, this post is what Jeff Atwood says about CSRF tokens. In this very page, he goes on to say:
An even stronger, albeit more complex, prevention method is to
leverage server state -- to generate (and track, with timeout) a
unique random key for every single HTML FORM you send down to the... |
Everyone seems to implicitly assume that the free market of ideas will eventually converge on the "right" solutions in software development. We don't assume that in medicine - we recognise that scientific experiments are needed there - so why should we assume it in software development?
I am not arguing for regulation ... |
I have a program that I wrote in Delphi. The program is available for download, but some antivirus like Norton detects it as malware, while other antivirus, like AVG, has no issues with it.
Moreover, Google Chrome also gives a malware warning when you want to download the program from my website.
Is there some way to ... |
I have 300-500 images and other files that my program uses. I realize I have two options:
Save them in a binary format such as BMP which is loaded dynamically.
Save them in a C source file such as XPM which allows it to be compiled into the program, but it also can be loaded dynamically.
Assuming both are just as eas... |
At now I mainly create a mail account separately (with different domain name eg.noreply@example.com) and i add this mail as one return path. So the bounce message will only go to that mailbox and i parse the mail message one by one to check the failure receipent and the error code, then i convert the error code to the... |
My team is considering moving to test-driven development. Currently we have almost no unit testing, we have been only relying on the user acceptance test, and developer's own manual test. Not everyone have agreed with this proposal. In the team, no one really has an experience on unit testing, so it's hard to convince ... |
I've found many Code Review tools:
Phabricator (by Facebook) - http://phabricator.org/
Rietveld (by Google) - http://code.google.com/appengine/articles/rietveld.html
GitHub - https://github.com/
Crucible - http://www.atlassian.com/software/crucible/overview
GitLab - http://gitlabhq.com/demo.html
SmartBear - http://sma... |
I've been reading about Semantic Web technologies such as RDF/RDFS and "ontology", but was wondering how each of these are related? At the moment the terms all seem interchangeable, or I'm not understanding a fundamental concept here.
|
How can I prove that a dynamic programming (dp) strategy for a problem will work or not? For greedy algorithms, we can prove by showing the sub problems exhibits matroid property.
Is there any such methods for dp algorithms?
|
For example, there are some key-value configuration in .properties file. Such like someFeatureEnable=true. It must be bool type value which will be parsed by framework, in my case it's typical Java Spring configuration. Spring will handle the configuration and throw Exception when users set someFeatureEnable=123.
My qu... |
I'm fairly new to Azure but I noticed that Visual Studio auto-creates the following folders (among others)
...
/<nameOfAzureProject>/bin
/<nameOfAzureProject>/obj
/<nameOfAzureProject>/csx <==
...
Now the bin and obj folders are fairly standard. But I'm not clear about the purpose of the csx folder. Any ideas?
|
I'm learning web development. My main OS is windows 7 but I've used Linux and currently dual-booting with Ubuntu. My Linux knowledge however, is pretty limited. I can work with the command line on simple tasks but that's pretty much it. I don't do any shell scripting, don't know very well the most important commands, n... |
I recently joined a rapidly growing startup. In the past 3 months the development team has grown from 4 to 12. Until now they were very laissez-faire about what developers used to do their work. In fact one of the things I initially found attractive about the company is that most programmers used Linux, or whatever OS... |
Possible Duplicate:
I don't program in my spare time. Does that make me a bad developer?
A lot of blogs and advice on the web seem to suggest that in order to become a great developer, doing just your day job is not enough. For example, you should contribute to open source projects in your spare time, write smartpho... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.