instruction stringlengths 34 19.9k |
|---|
I have read recently that it is not good practice to use the repository pattern in conjunction with an ORM. From my understanding this is because the abstraction they provide over the SQL database is too leaky to be contained by the pattern.
I have a couple of questions about this:
What do you do if you want to switch... |
We have a bunch of data (several TB) in Hadoop HDFS and it's growing.
We want to create a dashboard that reports on the contents in there e.g counts of different types of objects, trends over time etc.
Our first thought was to use something like Oracle Tableau or d3.js and
to use Hive queries. But Hive is just too darn... |
I own a repository on GitHub to which someone sent a pull request with one single commit. I only want to implement his solution partially, and use about half of the code changes the user made. What should I do in this situation?
Make a branch of his version, then go back and copy and paste the "old" code that I want to... |
For the last year or so, I have been working on a very large application. I am currently on version 17 of it, and every time, I start over with some of the code from before. But now, this is starting to become unmanageabley large.
When I do the design for the application, I generally start with a Word document, outlini... |
Where I work, we're in the process of automating a lot of tasks that currently need to be run manually by an IT person to determine if the next task can be performed (the second task depends on certain outcomes of the first task). We're ending the first phase of our script automation process, having reworked the first ... |
I'm new to this type of programming, but proficient in web development... looking to expand my palette a little.
I have this file. In Windows 7 the file properties window claims its a 'system file', my assumption is that this is a generic description and isn't particularly useful, no file extention. This file resides o... |
I currently have my font stack:
font-family: "Courier New", Courier, monospace;
In all browsers that I test in I see the font displayed in the Courier New font except for my android devices - my nexus and my kindle. And although they have a monospace fallback I would rather have my site displayed the same across these... |
I've worked in a team that developed and gave support for SW practices tools. Those tools were written (and will be written) in many programming languages.
According to Scrum, a given story, can be implemented by several team members (according to what I know).
When organized in a team that is oriented to a specific SW... |
I often hear that a real programmer can easily learn any language within a week. Languages are just tools for getting things done, I'm told. Programming is the ultimate skill that must be learned and mastered.
How can I make sure that I'm actually learning how to program rather than simply learning the details of a lan... |
This intro is only my naive attempt at a mile-high snapshot helping me to position my question. Any user trying to answer my question, that tries to nail down one aspect of programming, will have to overcome my naive understanding, simply because of my idiosyncratic education. So here I'm placing my subject in the arra... |
I'm a planetary science researcher and one project I'm working on is N-body simulations of Saturn's rings. The goal of this particular study is to watch as particles clump together under their own self-gravity and measure the aggregate mass of the clumps versus the mean velocity of all particles in the cell. We're tr... |
Creating a C++ library also means documenting it so that others can use it, and that documentation can vary dramatically in quality.
How should a website for a C++ library be structured so that it is most effective?
I would frame "most effective" as being divided among three specific groups of library stakeholders, wh... |
I have a big pdf with the documentation for a project and I need to render this to doxygen (so take each function from the pdf and write it out into doxygen).
Any suggestions on how to do this quickly and effectively (other than doing it by hand)?
|
A coworker and I were trying to brainstorm and list the different ways an application developer can write a program enabling a user on one computer to run remotely on another computer while being displayed on their own computer. She suggested all possibilities would fall into only three categories:
remote desktop soft... |
This week I could optimize using a reduced C library that allowed a drastic shrinkage in code size - from about 60 K to about 6 K and then we could load the code in the 8 K on-chip memory of an FPGA (Altera DE2) which I suppose is SRAM so there is SRAM both on-chip and off-chip(?)
The program was rather small itself a... |
i wanted to know what is the meaning of return False in an function.
go Through this function:
function reset_password($password,$user_id)
{
$sql="UPDATE user SET password='$password' WHERE user_id='$user_id'";
if(!mysql_query($sql,$this->mycon))
{
array_push($this->err_msg,"Error in Inserting - ".... |
We are new to using cucumber with selenium to write automated test suites.
Our initial approach was to have one java class per feature file.
Now we added instance methods in each class for corresponding step definitions.
Now if we need to re-use a step definition in some other feature file we are facing problems as we ... |
After spending over one year working on a social network project for me using WordPress and BuddyPress, my programmer has disappeared, even though he got paid every single week, for the whole period. Yes, he's not dead as I used an email tracker to confirm and see he opens my emails, but he doesn't respond. It seems he... |
I'm struggling with a task as I was given to practice UML and use cases. The problem is that I should model computer version of a board game so I am unsure about a few things. obviously it does not matter if you play against the PC or another player, the actions are the same.
The game is simply like tic tac toe.
E.g.
... |
When I fix a bug I mention briefly what was the issue and in which revision its fixed. But this way nobody would know how much tricky the issue was and how much effort went in analysis and findings.
What is the best practice for a developer to show such things to higher management to get noticed?
|
There are two types of documentation.
One type, the Implementation Documentation, contains information about specific implementation of a construct (eg. Class, Method, etc.). It is targeted to the future me, maintainer, debugger and so on.
And there is Usage Documentation, containing information how to use a provided a... |
I'm trying to test a class which calls some Hadoop web services. The code is pretty much of the form:
method() {
...use Jersey client to create WebResource...
...make request...
...do something with response...
}
e.g. there is a create directory method, a create folder method etc.
Given that the code is de... |
I have a TableSqlBuilder interface which has a method getCreateTableSql. This interface is used in some other class as follows:
function createTable( $tableDefinition ) {
$sql = $this->tableSqlBuilder->getCreateTableSql( $tableDefinition );
$this->db->execute( $sql );
}
The TableSqlBuilder interface has multip... |
There is the ongoing argument of free trial versus a freemium model (that is, a free-for-life version of their software with restricted and/or stripped down features) for allowing potential customers and users to test run their product. Upon my research, I can conclude that the free trial is the way to go on both for t... |
In Java, by convention getter and setter for boolean fields will be isField() and setField(). This works perfectly fine with field names that are adjectives like active, visible, closed, etc.
But how do I name a field that has meaning of a verb, like haveChildren? Add “_ing” to the verb (havingChildren), maybe?
To clar... |
I have been writing my website, front-end: html, JS, jquery and css, back-end: php mysql. However my php files only contain php and mysql code. Is this a really bad thing? In what situation should PHP files contain html/javascript?? Currently my php files are just there to receive request and response with array of inf... |
I faced this question in one interview. I explained that String is immutable and StringBuffer is mutable class. I don't know very much about mutable and immutable and also don't know the exact answer. What are the key concepts to be able to distinguish the two ideas? Is there a performance impact when chosing one over... |
A few years ago, I worked for a small company that went so far into developing in-house frameworks that they dedicated their most senior developer, and their architect to developing a custom MVC framework and ORM from scratch. These two things were orthogonal to their core product. Unfortunately the support for this fr... |
Say you have a few applications which deal with a few different Core Domains.
The examples are made up and it's hard to put a real example with meaningful data together (concisely).
In Domain Driven Design (DDD) when you start looking at Bounded Contexts and Domains/Sub Domains, it says that a Bounded Context is a "pha... |
I don't have much knowledge of the subject but as I know, when servers receive an email they have two sources of data to classify it as SPAM or not. The contents of the message (subject + body) and the metadata that goes with it (from who / to who / server that sent the message, etc).
I know you can do basic filtering ... |
This is kind of a vague question so I apologize in advance.
When software is "smarter", I tend to interpret that as really just saying that it covers more edge cases. First of all, is this correct?
Assuming it is, does this mean that the software is full of if/switch statements to make sure input is handled properly, ... |
I just want feedback on what one considers 'most elegant design' for a situation like this.
I have an object that is immutable with some (sort of) copy constructors to allow creating a similar but modified version of my immutable object. So something like this:
class ImmutableObject{
Fee fee;
Fi fi;
Fo fo;
... |
I was just experimenting with the Chain of responsibility design pattern, implementing my own version.
I'm currently reading Design Patterns, but I'm not really sure whether DP tells to stop the forwarding of the requests when a single action is accomplished, or just continuing to the end of the chain.
What I'm intere... |
I'm writing documentation for some software that I wrote. Specifically, I'm writing a guide to installing the software. I'm delivering the source-code to my client, so I expect that they will want to be able to build from source.
I explain to open the solution in Visual Studio 2010 and to right-click on the project a... |
Does the web industry have any standard or common name that refers specifically to web applications that don't use the conventional window-HTTP-navigation model, instead relying on mostly or wholly on DOM manipulation?
These applications usually have the following attributes:
load an application frame from the server ... |
So, I've got an interesting design problem and I honestly don't know how to tackle this. I have an application that will be ran on a dozen of workstations. Of those workstations, it is impossible to know at any given time how many of them will be on or using my application. Every 4 hours of local time if any of the ... |
I have a data structure that describes a tree. Nodes are ordered, with "depth" information, and knowing the order and the depth the tree can be reconstructed. I'm not entirely sure how to describe it so I'm hoping this small example will illustrate it
node #1, depth 0 // parent: none
node #2, depth 1 // parent: #1
node... |
I have read that story point estimation is not intended to actually tie with number of hours , but is used to identify the relative capacity. I have a java application which has a adapter layer , a service implementation layer , a DAO layer and an external connector service layer. If I am given a high level requirement... |
I'm new to objective C, I'm following "Objective C 5th Edition Stephen Kochan and I don't have anyone to ask my doubts to. I'm confused with this question:
Q. Is it necessary to use "-" or "+" before every property or method declaration in Interface? What will happen if I don't use "-" or "+" before every property or m... |
I'm interested in developing a large-scale user-facing website that is written in Java.
As for design, I'm thinking of developing independent, modular services that can act as data providers to my main web application.
As for writing these modular services (data providers), I can leverage an existing framework like Sp... |
I've recently started two introductory level courses - one using Python, the other Java.
I've read the answers to this Question but still have difficulty understanding how each ends up with machine code and what the main differences between the two models are:
Is an interpreter doing the same job as something like the... |
I am working on a fairly large open source project (Drupal) and the next major version will begin to use UUIDs for a lot of things, including configuration objects. If we put UUIDs into the configuration we ship with and then various sites change their configuration then there will be many, many objects in the wild wit... |
In my project we assign 4 hours for 1 story point and estimate based on story point. So in this case one ideal day of work will be done in 2 elapsed days. From an agile standpoint are we doing story point estimation or ideal days estimation or none of these?
|
Why does:
something = false
always return false?
Since it is an assignment and not a comparison, it seems it would make more sense to return the result (success/failure) of the assignment (like pretty much every other assignment you do).
EDIT - this is wrong, as the answers below point out. My bad. Slight brain fart. ... |
I am designing a language, and wondering which character (or string) to use to represent that something is an attribute of something else.
In all languages I have used, this is done with a dot - my_class_instance.attribute.
However, in this language, I want to have what would usually be methods as syntactic sugar for n... |
I presently have a clock app that calculates from scratch at every iteration. This means O(1) corrupt bits in my doubles and heavy object creation and deletion as well.
I am wary of running indefinite calculations with doubles or any other floats because O(n) corrupt bits normally accompany every step.
I would like to ... |
I am currently employed as a software developer using C# and C++. However, I want to find a new job for personal reasons and applied for a job ad that listed PHP, CSS, and Javascript as the skills the company is looking for. I am interested in learning about PHP, CSS, Javascript. That company wants to interview me. How... |
Since this statement is so common:
while (true) (Java)
or
while (1) (C)
or sometimes
for (;;)
Why is there not a single instruction for this? I could think that an instruction that could do it is just do but do requires a while at the end of the block but it would be more logical to write an infinite loop like this
do ... |
I've just looked for a formal definition and haven't found one.
The term - "bug in the requirements" was always confusing for me, what does mean exactly?
|
When I think of pretty much any programming language - like C, C++, PHP, SQL, JavaScript, Python, ActionScript, Haskell, Lua, Lisp, Java, etc - I'm like awesome I would love to develop a computer application using any of those languages.
But when I think of web frameworks(I do mostly PHP) - like Cake, CI, Symfony, Lara... |
Just as in the title, why doesn't git daemon start the service in the background, since it's a "daemon", being a background process? I know that I can start it in the background using git daemon &, but I'm just wondering about the philosophical reason for this decision.
|
I'm delving into multi-threaded programming with Java, but I'm finding it hard to test my program for bugs. My computer simply has too many resources and cores, making it hard to see how my program acts under stress.
Is there any way to limit the resources available to my program? It seems ridiculous that my only opti... |
I found by Valgring that some GTK+ programs leaks memory. How important it is to fix those leaks? I mean, often those programs works very well but on the other hand, one can never be sure if one wants to copy part of the leaking code to some other program. And I'm not sure if the idea of GTK+-programs is to work fast a... |
What are some best practices for using functions to break up large blocks of code into discrete chunks of logic when those functions are only ever going to be used once within the lifetime of a function?
The canonical example for web development is the initialization of a home page. When the page loads, you might do s... |
I am designing a bit of software that will integrate with our enterprise system using web services. We are dealing with work orders that are needed to maintain equipment.
We have a bit of a disagreement in regards to the structure of the contract. There are two methods on my side, I would like a single work order clas... |
From my experiences in software development (Eg. Waterfall ) I see it that most of the times it is the development team that sweats it out with the BA folk to get requirement clarity. The development folks then slog it out to meet deliverable deadlines.
Where is the QA - they might be free - but will only hitch onto t... |
This is a theoretical question, but after many years of programming in what I now realize is "normal" imperative technique, using C++ mainly, I've discovered this other world of functional programming, which I stumbled upon accidentally while casually learning JavaScript.
This has led me to wonder if you could technica... |
We are considering using the Dynamic.CS linq-sample included in the "Samples" directory of visual studio 2008 for our WebAPI project to allow clients to query our data.
The interface would be something like this (In addition to the normal GET-methods):
public HttpResponseMessage List(string filter = null);
The plan i... |
I'm wondering, why would one (consider it not just a single developer, but a company) prefer C# or Java for web applications? What's their considerations regarding the question. I mean, a company, has an assignment to make a web-site for customer, or online game, or web-portal, how does the project management or/and th... |
I'm writing a system that has a number of objects with data in them. For example one object has a user name attribute, another has a date, another shopping cart item etc.
I'm making an object that generates a MD5 hash based on a concatenated string of these values. So for example md5(username + date + special_number +... |
By default, the installer for my product copies files to the Users\Username\AppData\local\MyProduct directory (though the user can change this during installation, of course).
I want to bundle some other files with product - documentation, sample spreadsheets (it includes an Excel add-in) etc. It doesn't seem approp... |
I have a sequence of binary strings that I want to find a match for among a set of longer sequences of binary strings. A match means that the compared sequence gives the lowest average Hamming distance when all elements in the shorter sequence have been matched against a sequence in one of the longer sets.
Let me try t... |
Can I bundle my proprietary JavaScript code with MIT licensed libraries (e.g. JQuery, AngularJS) into the same file, distribute it via HTTP but disallow my users to use my own code as an MIT licensed code?
This way I could minimize the number of browser requests, and reduce errors due to network errors. I don't want to... |
Preamble:
I am making a simple board game in C++, in which AI characters move around squares on the board. There are different types of squares, each inherited from an abstract class, each with different effects on the AI character. For example, some are shops where the character can buy stuff, others are workplaces wh... |
I have a static Jekyll website.
The website is constructed once, on my computer, and then sent to the server in the form of plain HTML, image, and CSS files, to be served by a regular HTTP server.
This construction process involves a template engine that has to glue various components together.
For example, this is the... |
My background is Ruby, C#, JavaScript and Java. And now I'm learning Clojure. What makes me feel uncomfortable about the later is that idiomatic Clojure seems to neglect the Uniform access principle (wiki, c2) and thus to a certain degree encapsulation as well by suggesting to use maps instead of some sort of "structur... |
Let's say 3-5 years ago (more or less) n-tier application on the server side - and some javascript/html/CSS for the UI was a basic approach for web development.
Nowadays we can see that traditional web development paradigm changes a lot. Each day I saw more and more application who do not have server side in traditiona... |
We have a single-page web application, and we have a new SSO site (also our own) using OAuth2, and are looking to hook them up.
On our production/staging/CI deployments, it's easy to hook everything up. For instance:
on production we'll have https://app.company.com access our prod backend point to https://sso.company.... |
Whenever I come across a new API or programming language or even simple Linux man pages, I always (ever since I remember) avoided them and instead lazily relied on examples for gaining understanding of new concepts.
Subconsciously, I avoid documentation/APIs whenever it is not straightforward or cryptic or just plain ... |
Is it legal to use a third party library in a software project that is itself licensed under MPL 2.0?
So some potential project hierarchies would look like this
Library Project [MPL 2.0] (Open Source, Distributed)
Third party library [Proprietary] (Closed source, not distributed)
Someone else's project [MPL 2.0] ... |
Me and my team use feature branches (with git). I'm wondering which is the best strategy for code review before merge to master.
I checkout a new branch from master, lets call it fb_#1
I commit a few times and than want to merge it back to master
Before I merge someone is supposed to make a code review
Now there are ... |
I am the Director of a small startup organisation. We currently have two programmers (one experienced, one less experienced) who are building a web application platform.
One of the greatest challenges so far is the planning process. The programmers usually are in charge of planning their own work, but we keep exceeding... |
One of the things you see in numerous places in the standard java library is final classes. It is claimed that this is for immutability which I understand...to an extent.
Suppose you have a class:
final public class ImmutableTest {
private String value;
public ImmutableTest(String value) {
this.value = ... |
I'm designing a REST API for a three-tier system like: Client application -> Front-end API cloud server -> user's home API server (Home).
Home is a home device, and is supposed to maintain connection to Front-end via Websocket or a long poll (this is the first place where we're violating REST. It gets even worse later ... |
I and my co-worker are developing a web application with rails and node.js and we can't reach a consensus regarding a particular architectural decision.
Our setup is basically a rails server working with node.js and redis, when a client makes a http request to our rails API in some cases our rails application posts the... |
I have seen animation, and i can't figure out how to do something like in this video(youtube). I want to discuss how it's made. I don't think that they're using sprites.
I have one idea how to do this: for example i want to create animation of "walking" animal (when animal moves, he's legs "runs" moving animation), i s... |
I am aware that for the general case, the answer to "should I throw an exception from a property" is "generally don't, but in some special circumstances it is OK to do so". There is a Microsoft guideline which gives this general answer, and also a question on this site.
Now I am faced with a situation which I think ma... |
I've been working on a utility app for a while, and when we're in the final phases the boss is asking for adding user behavior and location tracking and was explicit about publishing them to 3rd party developers to make use of them.
He seems to have set his mind about it, is there anything I can/should do about it?
Cla... |
I am trying to figure out what is the best way to setup a FSM and also keep my interfaces clean and use an IOC container to use DI.
Let's just visit the Head First design pattern textbook example of the gumball machine.
interface IState
{
InsertQuarter();
EjectQuarter();
TurnCrank();
Dispense();
}
Is t... |
Please tell me if this is mad, but basically, I've created a custom rake task, and before it does its thing, it gives the user a warning message:
Warning, please back up your database before continuing
Just in case something does go wrong. But I thought this would be awesome:
Warning, please back up your database befo... |
The end goal is to have a variety of data sets that can all be graphically plotted against eachother.
All data should correspond to a date, so that when plotted against each other, they show the correct relationship through time.
The key feature though, is to be able to add a new parameter to log at any time which will... |
I titled the question jokingly because I'm sure that "it depends," but I have some specific questions.
Working in software that has many deep layers of dependency, my team has become accustomed using mocking fairly extensively to separate each code module from the dependencies beneath it.
Therefore I was surprised that... |
We process messages through a variety of services (one message will touch probably 9 services before it's done, each doing a specific IO-related function). Right now we have a combination of the worst-case (XML data contract serialization) and best-case (in-memory MSMQ) for performance.
The nature of the message means... |
I just assumed tech lead for a project which has had a problem with its very part-time (maybe 2-5 hours / week) contractors:
submitting code that brings down the production app,
pull requests that cannot be auto-merged,
writing misnamed tests that don't actually test what they claim, and
not writing tests for the ... |
On a code review, I've stumbled on an interesting idea, which I can't properly judge alone.
Is it OK to improve readability of code by means of not widely known language syntax? When the original writer didn't use a special syntax designated for solving a specific coding problem, and solved it by simulating with workar... |
I am currently developing an Ajax chat application that uses PHP on the back-end. Some of the features it has right now are different types of users (admin/mod/banned), public and private rooms, commands, and announcements. I recently learned about unit/integration testing and it sounds like a good alternative to manua... |
I have an old habit of avoiding calling references multiple times, both for easier to read/maintain code, and for possible efficiency. But I'm wondering which is more efficient (memory, performance, both?).
For example when working with XML using a VTD parser
if( vn.toString( vn.getCurrentIndex() ).equalsIgnoreCase( "... |
I have a web app that occasionally (after some idleness) will block a very simple request for small chunks of data (30~50 kb) up to 20 or so seconds. Assuming I can't refactor or modify the API, is there some pattern in javascript or jquery to accommodate a situation like this?
I'm thinking to set a timeout for 5 secon... |
I'm employed at a mobile app development company since 4 months as Android developer. Currently I'm using my two private Android devices for development. Is it common practice that developers use their own hardware devices for development in mobile development companies, or should I ask for company devices?
|
I am in the process of structuring a small program to perform some hydraulic analysis of pipe flow. As I am envisioning this, the program will read an input file, store the input parameters in a suitable way, operate on them and finally output results. I am struggling with how to structure the input file in a sane way;... |
Problem
In Codeigniter (PHP framework), I am trying to create a helper function that will inject an ActiveRecord (for MySQL) command into a chain of existing ActiveRecord calls. The reasoning for this is that the current ActiveRecord commands available are not reliable enough, and produce differing results depending on... |
I am currently learning about delegate and the Law of Demeter. I understand the Law of Demeter, but I can't seem to find a good example of where using delegate to avoid breaking the law would actually even be useful.
I want to find an example related to my project, since I have to give a presentation. The only line of ... |
I'm very new to programming and I'm using Java. I got interested to learn programming because I want to create games. I love playing computer games and I know that game developers make money. I told myself that instead of just playing why not create my own game and probably make some money.
I read some articles about g... |
I am a newbie, studying programming and I came across this question today:
How can I make sure that I'm actually learning how to program rather than simply learning the details of a language?
A commenter, ChaosPandion, had asked the question if the programmer thinks in syntax or in a faster mental model.
I, while writ... |
I read much about GPL license. But it couldn't clear my doubt.
I want to develop a small web application using ExtJs because of its features. I won't use much of it. But some features are very good.
Now, as my understanding I think I can give this app to my friend for free for his business needs, right?
Or should I ta... |
[Warning]: I am new to the whole unit testing and have been trying to learn as much as possible.
I am working on a MS CRM 2011 project and I have been trying to introduce unit testing in my company. For unit testing JavaScript web resources, I found this link at MSDN blog.
The Solutions Architect in my company suggest ... |
With normal form submission I use the pattern Post / Redirect / Get, when processing the forms.
I have a database application built with Django. I want to allow the users to select a number of items from the database, then launch a computationally intensive task based on those items.
I expect the task to take between... |
Suppose you have two interfaces:
interface Readable {
public void read();
}
interface Writable {
public void write();
}
In some cases the implementing objects can only support one of these but in a lot of cases the implementations will support both interfaces. The people who use the interfaces will have to do... |
Is an automation tester supposed to know concepts of OOPS and design patterns to write Tests in a way where changes & code re-use are possible?
For example, I pick up Java to write cucumber step definitions that instruct a selenium webdriver.
Should I be using a lot of inheritance, interfaces, delegation etc. to make l... |
This is a bit of an open ended question but I wanted some opinions, as I grew up in a world where inline SQL scripts were the norm, then we were all made very aware of SQL injection based issues, and how fragile the sql was when doing string manipulations all over the place.
Then came the dawn of the ORM where you were... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.