instruction stringlengths 34 19.9k |
|---|
I have a Entity Framework Database First Model.
I want to write a MSTest/nUnit test to verify that all the stored procs, tables and views that are defined in my edmx model are still valid on the database.
|
So I've lead the charge with my fellow engineers to, at the very least, start "thinking" Lean. We hit on a few major areas of waste, and 2/3 lead to the exact same point..."Extra Features". We dogfood our own software on two fronts, sales and project management. It works great for sales, because that's what a CRM is gr... |
First some backgrounds, I'm interning at a company that makes parallel processing hardware.
We're currently working out the design for a component of our driver that is supposed to evolve over a few generations of our products. The next gen is still in simulation phase and the specification we have now may change when ... |
A few sprints ago I was assigned a task that was primarily research. I had to figure out how to get our product to interoperate with a very complex black box that we did not develop.
I couldn't think of a way to estimate this work. Even if I got the ball rolling and knew the immediate problem I faced, I could not g... |
Here's a basic example of what my unit test needs to be, using qunit:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<link rel="stylesheet" hre... |
I can certainly see the need for CLAs with a terser license like MIT or BSD, but the more verbose Apache seems to already have that type of verbiage in it. I would prefer to not add this level of complication an open source project if it is not necessary with the Apache 2.0 license.
CLAs seem to primarily grant a copyr... |
I am working on a project where I'd like these licensing terms:
Allow unmodified redistribution, with attribution to the author
Disallow modified redistribution
Non-commercial use
Now the CC BY-NC-ND 4.0 license is perfect for this... however, it does not cover any software topics, and CC themselves say that you shou... |
I appreciate the need for a Contributor License Agreement (CLA) in open source software projects and even understand that some tools are starting to make this process easier (like the low-friction CLAHub for GitHub and Project Harmony). However, rather than requiring a third-party form submission for an electronic sign... |
First, I want to say this seems to be a neglected question/area, so if this question needs improvement, help me make this a great question that can benefit others!
In my experience, there are two sides of an application - the "task" side (where the users interact with the application and it's objects where the domain m... |
I am working with Forgot password, where I have single EditTextBox and a single submit button.
So whenever I am opening this Forgot password page, my keyboard is opened at the start of this page.
In my mind there is a question that it is not a smart choice to open a keyboard at the start of the Forgot password Activity... |
First, I want to say this seems to be a neglected question/area, so if this question needs improvement, help me make this a great question that can benefit others! I'm looking for advice and help from people who have implemented solutions that solve this problem, not just ideas to try.
In my experience, there are two s... |
For the last 3 years I have used git on an almost daily basis for all my pet projects and at work for small projects that were not in the global SVN repository. My workflow is quite similar to the famous git branching model from http://nvie.com/posts/a-successful-git-branching-model to sum it up:
I work in branches, o... |
There are various refactoring options in Visual Studio to use at the time of coding. When we extract and create a new method. Then Visual Studio decide whether the new method will be static or instence depending on the usage inside the new method. If that method use some intence member of the class then it creates as i... |
We have 6 people in my group. My boss and the others are all SQL developers with little understanding of programming, design patterns, good object oriented design, etc. But, they have all taken a Java course in college.
When new projects come up, I am usually asked to give a time estimate for how long my part will ta... |
I got probably "micro optimization" problem.
I got "History number", "Next Number", "Reset" buttons, as well "label" for text.
Every time I click At "Next number" button I would like to show random number in the label, and add this number to history array where I keep track of the past number.
Every time I click at "Hi... |
I have some javascript that creates a canvas image that I want users to be able to share. I simply need to save the image somehow. Nothing else.
I've been contemplating using bits and pieces of ruby and activerecord, or perhaps sinatra but I feel like both would be over kill for this simple task.
Ideally I'd like to d... |
Many Builder Pattern examples make the Builder an inner class of the object it builds.
This makes some sense since it indicates what the Builder builds. However, in a statically typed language we know what the Builder builds.
On the other hand if the Builder is an inner class, you should know what class the Builder bui... |
I work for a company that is moving heavily into mobile. We find the majority of our customers use our mobile app pretty regularly.
We have tons of things we want to add to it -- as well as to deliver all these new features on Andriod- and iOS-native apps.
But I wonder how big we could possible make a mobile developme... |
I work for a company of <60 people. I understand that larger companies typically are ISO9000/9001 certified, as a matter of quality assurance. I also understand that for a company my size, such certification is not cost-effective. However, one could still make a case that as a matter of QA best-practice, I think it mak... |
Using third party libraries for productivity gains in software development is common. Unfortunately, along with the library's functionality we also import its bugs. Some of them get fixed in subsequent releases. So, to upgrade or not to upgrade, this is the question.
I am interested in learning from experiences when... |
It seems commonsense nowadays that polling is a bad practice and pushing is the way to go when developing mobile applications that require to constantly receive data from a remote server.
All major mobile shops provide their version of a push notification service:
Apple Push Notification Service
Google Cloud Messaging... |
in my current project have:
module Stats
class Site
...
end
class Product
def initialize(product_id)
@product_id = product_id
end
end
class Profile
...
end
end
now in my Product class have methods to get/set product views(day, week, month) and methods to get/set product sales(day... |
This is less a question about the nature of duck typing and more about staying pythonic, I suppose.
First of all - when dealing with dicts, in particular when the structure of the dict is fairly predictable and a given key is not typically present but sometimes is, I first think of two approaches:
if myKey in dict:
... |
When working with user interface based Java programs, one way of attaching behaviour to a certain actions (e.g. to a button click) is through the use of anonymous classes. In the example below, the GUI framework is SWT, however I have the same issues with Swing or Android UI components. Namely the structuring of my pro... |
Let's say we have a function like this:
public void myStart()
{
for (int i = 0; i<10; i++) myFunction(i);
}
private int myFunction(int a)
{
a = foo(a);
a = bar(a);
return a;
}
private int foo(int a)
{
//do something here
//something gnarly here
//etc
return aValue;
}
private int... |
Lets look on a simple example: assume that I have three classes implemeting IPersonRepository: SQLPersonRepository, WebPersonRepository, InMemoryPersonRepository. I also have PersonRepositoryFactory class which is simple Factory method pattern implementation - contains GetPersonRepository methods which have enum/string... |
There are currently multiple approaches for building web applications:
1. Server-side only
This is a classical approach where you render pages on the server by a web framework like Ruby on Rails, Django, Express, Play! Framework and etc.
Typical workflow: Build all your business logic, models and view templates on the ... |
About a year ago I had an idea in mind which was using my friends computers to help me process my data, so I programmed a socket server application with boost::asio, and gave the client part of it to my friends.
When they connect they send the server (my machine) a message containing their computer specs (available cor... |
Is it any indications of poor programming if the support staff for a given product requires you to clear the cookies in order to troubleshoot issues with their web-site?
As a point of example, if you're trying to activate a new SIM on a tablet, and the carrier's activation web-site is giving you an error message that t... |
Where can I find Turbo Pascal dialect description/reference? Is it still availiable in some place? I'm looking for the famous Turbo Pascal dialect description/reference(yes, the one from 80s/90s time) but I'm not having luck with google.
|
The way i am doing it now is using boost::asio TCP sockets handling everything manually with a main server that orchestrates the processes between the available machines, but the number of machines is increasing and when i need communication between specific machines i have to do it through the server and the number o... |
What kind of problems have you encountered when building plugin interfaces for your application? And how did you resolve them?
Background
I want to refactor an application so that various features can be moved into plugins, allowing them to be easily added and removed in future.
I hope this will be a neater system tha... |
This is a very naive question about input validation in general.
I'm a MATLAB user (1.5 years old) and I learned about input validation techniques such as "parse" and "validatestring". In fact, MATLAB built-in functions are full of those validations and parsers. So, I naturally thought this is the professional way of c... |
I have a test database with few user accounts. I don't want to break any tests.
If I am writing a function that updates password for user in db and one that reads the password.
Should I ideally reset the password to the previous one, once I am done testing update function ?
I have never written unit tests before, so I ... |
I've recently started a new job and I've been tasked with completing a feature that another developer didn't finish before he left the company.
The existing tests are out of date (i.e useless)... technical debt everywhere. I think it would be a very bad idea to implement features without tests, I've put this across to ... |
I program and I am dyslexic. My vision is excellent. I do poorly processing symbols and am a visual thinker.
When I code, I'm slower than normal people because I am unpredictably unaware of the errors I make. I am learning python and the text only development environments cause me a lot of visual stress; I am using Win... |
I'm writing a brief for a new starter at the company.
I've pointed out the aims of what I want to achieve and now I'm writing some suggested (but not concrete) solutions.
For each of the aims, I'd like to suggest a fast, dirty method, and a slower, but more robust solution. I don't mean 'dirty' as in uncommented and un... |
I am trying to implement a graph data structure in C#. I have the following interfaces:
public interface IVertex<TValue>
{
TValue Value { get;}
VertexList<IVertex<TValue>> Neighbours { get;}
int InDegree { get;}
int OutDegree { get;}
}
public interface IWeightedEdge<TValue, TWeight>
{
IV... |
Given that all else is equal, and there are no coding standards defining the best approach, what would be the recommended way in C++ to check that a value exists and return it if it does?
For example, something like one of these declarations:
bool getMethod(double& ret);
double getMethod(bool& ok);
void getMethod(bo... |
Suppose there is a function get-data which returns a map of information about the id of the user passed in. Now this function uses 3 functions source-a, source-b and source-c to get three different kinds of maps. Now we combine all these maps into one map and return from get-data.
When I test get-data, should I test fo... |
I'm the main author of a multiplatform free software/open source GUI program. Although the program gets thousands of direct downloads per month, I have no idea of the number of people regularly using it. It is also included in some Unix distributions and download sites making the counting harder. It would be interestin... |
I'm trying to use Shake and I stumbled upon the following problem: there's no easy and convenient way to interpolate a string. I know about Text.Printf — it's not what I'm looking for. The interpolation syntax I'm talking about is like this:
(Make)
HEADERS_DIR := /some/path/to/dir
CFLAGS := "-g -I$(HEADERS_DIR) -O2"
... |
Java 8 has a whole new library for dates and times in the package java.time which is very welcome thing to anyone who has had to use JodaTime before or hassle with making it's own date processing helper methods. Many classes in this package represent timestamps and have helper methods like getHour() to get hours from t... |
I'm not sure how to proceed in the following situation.
say we have a function as so:
def runsATask(codes):
myDicts = [helperFunc(code) for code in codes]
for item in myDicts:
# some logic.
Here's the problem, codes is some iterable and should be either a list or a tuple, ie it should be used as so: ru... |
Trying to build a case against this as we have a developer that likes to use class properties in place of methods. I think it's a bad idea. In some cases he is accessing the data layer inside the setter and getter.
here is a snippet of code, what are your thoughts on this?
private Dictionary<string, List<string>> _acti... |
I have a proprietary project, with parts of it written in javascript. We would like a software license to include in the header file for this code which ensures the work remains:
proprietary
cannot be reverse engineered (as it will be obfuscated / minimized)
cannot be reused elsewhere
cannot be linked to
does the D... |
When I see the term pattern in a description of syntax I infer a regular expression is being specified. Is there a separate term that specifies a wildcard expression?
^foo.*(bar|baz){3} <-- 'regular expression' or 'pattern'
foo*bar.txt <--- 'wildcard expression' or ...?
Or is a wildcard expression just another... |
I understand that a process a unit of resource ownership and executable instructions. Threads allow a process to share its resources with multiple executions, and it's easier for an OS to schedule threads because of all the overhead associated with whole processes.
But why the name thread? Does it have some reference t... |
I don't know how a 4-bit instruction could be enough to do something so I read about the Intel 4004 and it says that it used 8-bit instructions and then I can understand how opcode and numbers has enough digits.
Is it true that there never were any 4-bit instructions and that 4-bit systems use 8-bit instructions?
And ... |
I am building a small application and I am trying to understand the best way to approach the design. I am looking for some guidance/advice how best to approach the following issue.
What I have is that I receive a set of data, real time. I then analyze the data for patterns. The patterns are classes that derive from an... |
After so much research, I thought I should ask the experts.
I am working on a project for my corporate employer, we have android and iPhone mobile apps that make request to a web service, the request is logged in pending state for processing.
A windows service retrieves the pending requests and spins a new thread for e... |
I am building a small application and I am trying to understand the best way to approach the design. I am looking for some guidance/advice how best to approach the following issue. Please bear with me. Thank you.
What I have is that I receive a set of data, real time. I then analyze the data for patterns. The patterns ... |
I am seeing the benefits of Portable Class Libraries for centralizing Models and ViewModels to a single code-base. Where should dependency injection management (IoC container) take place, though? My Models have dependencies that I believe would benefit from being supplied through injection. I'm not sure how to go about... |
I have a style question about overloading methods/constructors. I have a constructor which
does something very simple, and then calls a method with some side effects. Sometimes however I don't want the side effects so I made a separate overloaded constructor. I show two versions here. Version 1 is simple: if I pass an... |
What are the main benefits of Facebook's React over the upcoming Web Components spec and vice versa (or perhaps a more apples-to-apples comparison would be to Google's Polymer library)?
According to this JSConf EU talk and the React homepage, the main benefits of React are:
Decoupling and increased cohesion using a co... |
I am looking for a good analogy to help the concept of a method in ruby stick in my head. When I truly understand a concept, an image flashes in my mind that relates something physical to the abstract concepts I am trying to learn.
For example, someone explained the concept of a variable to me in the following way:
A ... |
NOTE: This is in reference to the question I asked on Stack Overflow but was told to post this here
I'm building a trading application that matches buyers/sellers that own subscription. Subscriptions have a certain quantity amount for a certain duration of time. There are 8 order types which are:
Buy/sell subscription... |
I am about to start a new project and I cannot decide if I should pick OCaml or Lisp for the project. My main concern is about the difference of productivity — if any.
I program OCaml since 1998 and, while I neither tried to measure this precisely nor to even define precisely what the productivity I would like to mea... |
I'm searching an algorithm to store my data (which are moving objects' coordinates) and allow me to query objects within a specific radius of a specific point.
I came up with R* Tree which is said as good solution for geographical data, but as I studied further, R* Tree stored data in secondary memory and its data most... |
I see many examples of libraries that use a 'chunker' and also people asking how to write chunkers, but what is this for and why do we need it? Isn't it enough to split a text by whitespace or other characters that delimit boundaries between words?
|
By non-MVVM code, I mean things like highly generalized components, like one with common extension methods for CLR types, and other 'homeless' helper classes etc? I have a Core project that most others reference, but to resolve circular dependencies I had to refactor the extensions to another project. This seems a comm... |
How would I express the speed of the following sort algorithm? I know bubblesort is n^n (er, I mean n^2...as someone pointed out below). In the following the array decreases each time you call it recursively.
thanks.
$myarray = array("21","4","8","8","1","2","19","21");
mysort($myarray);
function mysort($myarray,$so... |
I am trying to make an UPDATE STATEMENT generator using C# Winforms. I would like to build a statement generator which will print statements like this:
UPDATE Customers
SET ContactName='Alfred Schmidt', City='Hamburg'
WHERE CustomerName='Alfreds Futterkiste';
But my problem is, how can I let the user paste in multiple... |
input: C matrix 2xN (2D points)
output: C matrix 2xM (2D points) with equal or less points.
Lets say we have C matrix 2xN that contains several 2D points, and it looks something like that:
What we want is to group "close" points to one point, measured by the average of the other points. For example, in the second im... |
This was a question proposed by a friend of mine. Define an algorithm that, given 40 unique integers in the range 1-1000, returns 41 unique integers in this range. Given these 41 integers, we must then be able to map them back to our original 40.
Does anyone have any insights? I have an idea, but it definitely isn't e... |
In RFC 2617 HTTP Authentication: Basic and Digest Access Authentication they speak always of username and password for the authentication.
Why should I choose to take a username as identifier for a website? Usernames are often hard to choose a not existing one or one which is unique. But everyone getting an account som... |
SELECT
* #Case 1
cp.* #Case 2
FROM crawl_page AS cp
LEFT JOIN artist AS a
ON cp.cpURL LIKE CONCAT('%',a.artistPageID,'/',a.artistPageURL,'%')
WHERE cpPageType = 'SONGS'
AND cpPageAdded < (
SELECT cpCrawlDate
... |
So I need to code a simple program, and I need to define 2D coordinates?
Is there any coordinate system I can use in Fortran?
I was told it might have to be all in arrays? And if so, can anybody push me in the right direction as to how to set up 2d arrays?
Many thanks.
|
I have a value between 0 and 8000 and I want this number to resolve to another number between 0 and 2000. I could just divide it by 4 but I have a special need here.
For values above 4000 I want the mapped value to be biased towards the 2000. But for values lower than 4000 I want the mapped value to be biased towards 0... |
I'm trying to develop a minimal MP3 player with some cool but light features. It is so simple that it doesn't matter if it is console application or not.
Since my purpose is to consume the sources as small as possible which one should I pick?
Extra info: I will be using a single textbox if it's going to be an applicati... |
Take for example the following:
public interface IManager
{
void AddItem(CollectionItem item);
void RemoveItem(CollectionItem item);
}
public interface IManagerCustomCollection
{
ManagerCollection Systems;
}
Is it usually more preferable to create a collection, and allow the consumer to operate directl... |
the title says it all. I'm still a university student studying IT. Whenever I'm doing coding, I will frequently look back on codes that I've done before or looking for codes online or on reference book on how to do certain task like using classes, HTML stuffs and such. Is this behaviour acceptable on working place or d... |
I don't know how to organize my code. Right now I just dumped everything in MainPage for testing. But what is the proper way to handle getting data from REST web service in Windows Phone 8? I have multiple pages that need to utilize the data that is returned.
/// <summary>
/// State information for our BeginGetR... |
I saw many RoR developers use command line to interact with interfaces and to deploy their web applications. Is that necessary step to earn for asp.net developer?
|
I'm trying to get to grips with unit testing.
Say we have a die which can has a default number of sides equal to 6 (but can be 4, 5 sided etc.):
import random
class Die():
def __init__(self, sides=6):
self._sides = sides
def roll(self):
return random.randint(1, self._sides)
Would the following... |
In order to convert e.g. a python object to json you would use a serializer. As far as I understand it, serialization leaves the possibility to change the converted object back to the original.
Where does the term serialization come from/why is the process called serialization?
|
I want to model simple objects as functions, to see where the pure functional approach gets me. Let's say my object is a person. There is some function that returns me a new person, but instead of just some data structure, it returns me a function that represents the person. I'm having difficulties to see what this fun... |
A few days ago, I appeared in an interview in a software company for .net developer. There I was asked the following question:
If we close browser window without getting logout, what will happen when
we provide same URL in the browser?
My answer was that user will be able to view the home page with login details in... |
I'm reading about eventual consistency in couchDB. I'm somewhat confused by the term and its consequences on an application.
Let's say I'm building a distributed e-commerce website where monetary transactions are critical. There could be online auctions running and people bidding on them in real time.
Will using a even... |
When choosing a title for a new issue, there are several grammatical options to choose from. Here are four different options for an example issue I just made up:
Descriptive: "Newlines are not stripped when multi-line headers are parsed"
Imperative - negative: "Avoid leaving newlines when parsing multi-line headers"
I... |
There is a rule in writing: When you break a section into subsections, typically it should have more than one subsection. This goes back to the old high school composition rules: if you have an A. section you also need a B. section.
To check a chapter of a book I'm writing in LaTeX I do this:
$ egrep -h '^\\(chapter|(s... |
I'm thinking about something I've read in a book: "A well designed system is a testable system" and I'm wondering why it is so.
Certainly, a system that is much tested is probably well designed. Build from the ground up on test-first principles and assuming basic competence, it is hard to imagine a very bad design.
But... |
In many languages there are libraries, either built into the language itself or built separately outside of the language, which allow information to be taken from the operating system at some level. Examples are metadata about a file, current memory usage and the OS version itself.
How is this information generally acc... |
I'm working with a new senior programmer who has almost the same amount of experience as me. He his own project to work on -- but I have to make sure he does not mess things up.
Now, how can I monitor him since he's not junior?
Do I examine his code? Cons of this are that I am not as deep into project as himself so i... |
We have a pretty complex project with 100 or so classes, multiple custom elements, etc. We have a new senior programmer who will work on this project.
How should we approach the task of introducing the senior programmer to the project? How can we make sure the programmer does not break some other feature while fixing ... |
We are a team of programmers and are employing a new person who will be a project manager only. Our project are only programming ones and we are not sure how to decide who will be the best for project manager.
Shall we find a senior programmer from our programming field?
Or we must find a regular guy (economics or man... |
Okay, it sounds odd, but the code is very simple and explains the situation well.
public virtual async Task RemoveFromRoleAsync(AzureTableUser user, string role)
{
AssertNotDisposed();
var roles = await GetRolesForUser(user);
roles.Roles = RemoveRoles(roles.Roles, role);
await Run(TableOperation.Repla... |
In the code sample below the Rental object is using Movie's fields to do a switch statement. Martin says : this is a bad idea but he does not give any deeper explanation as to why ?
Of course, you can say that this means a lot of coupling between Movie and Rental, or that Movie is badly encapsulated but those are just... |
Hello I am trying to use the alienTile problem described at www.alientiles.com using the A* algorithm but I cannot find any good heuristic function so far.
In alien tiles you have a board with NxN tiles, all colored red. By clicking on a tile, all tiles in the same row and column advance by a color, the color order be... |
I am not very educated on this topic of programming so I am seeking any advice/knowledge. I am coding a web app in PHP, and this particular task requires updating the display after the server has new information available. So, one seemingly-bad solution is to have a repeating AJAX request that spams the server on an in... |
While I think how to direct the future development:
Mini-introduction
As a fixed rule, I start with SOA (and REST as protocol) then I work on the interfaces (and that interface is a customer of my service, and usually is a separate project). I assume my deviation is because I'm first of all a back-end developer (with p... |
In a team of developers, how do you get the developers to feel pride in their code and write good code (I realize this is subjective and everyone is different, but there is a point when I write code that i can say, this is a good piece of code that I am happy to show off).
To often I hear we have no time to write good ... |
Is there a standard pattern in OOP to kind of "atomically" update a pair of objects, like a pair of bank accounts on a transaction?
I would like to have somehow a single public method exposed that does it all at once, but can only come up with ways of doing it by making two calls of public methods to update objects sep... |
What is a "variable"/data type?
How does a compiler / interpreter handle types?
My specific concern has to do with the different types in lower and higher level languages. For instance in Python, as list is really flexible. You can just define it and put in at runtime whatever you want.
ints
floats
strings
sets
even... |
For example, like:
The inaugural International Olympiad in Frogleaping is being held in Australia in 2013 and you are determined to win. While you want nothing to do with such slimy, jumpy creatures, you plan to enter a frog-like robot that you know will be faster than all the other organic entrants.
The IOF takes pla... |
I analyzed my algorithm and I deduced that in the best case it requires n^3 iterations while in the worst case it requires n^4 iterations. Then I asserted that my algorithm is in \Omega(n^3) and in \BigO(n^4). Is this assertion correct and useful?
(sorry for the format but I'm not able to add LaTeX text, so if you can ... |
In some articles and books that I read, I some time see the term 'Bootstrapping'. For example I see this sentence "Bootstrapping X.JS" in angular js document: http://docs.angularjs.org/tutorial/step_00
Bootstrapping AngularJS apps automatically using the ngApp directive is very easy and suitable for most cases. In adv... |
I'm writing a Jersey 1.9 JAX-RS application. I have to use 1.9 because it's the only supported version.
I'm trying to decide if there is any benefit to using EJBs as my Jersey Resources, rather than POJOs.
My Resources are strictly for my REST API; they delegate to my business service EJB as soon as the domain translat... |
I've used both webapp2 + GAE for python and a number of Java/JEE webapp frameworks. The python WSGI framework could keep users logged in while I redeploy the app while none of the Java web framework that I tried could do it. If I redeploy, users of the Java webapp will get logged out but if I use GAE for python then a ... |
I need your help how to implement it nice and well. It's quite a simple problem. I can solve it but I need help on how to do that better.
My class has logic working using three parameters. It gets them from another class. The problem is:
the first parameter is enum (it's required)
the second parameter is another enum... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.