instruction stringlengths 34 19.9k |
|---|
Automapper is an "object-object mapper" for .Net, which means copying objects from a class into another class that represents the same thing.
Why is this ever useful? Is the duplication of classes ever useful/good design?
|
I ran into a classroom problem yesterday (business oriented class, not computer science) and I found it interesting from an algorithmic perspective.
The problem goes something like this:
Assume there is a shop floor with N different rooms, and you have N different departments that need to go in those rooms. The depart... |
What would a large project that spanned multiple files and >1000 lines show to an employer that a few individual files and a couple hundred lines couldn't capture?
|
For example, if a person creates an application that they open-source under a license that says you can use this code but you cannot sell it, has that person just bound himself to not selling it now as well?
|
Suppose that I have
three classes P, C1, C2,
composition (strong aggregation) relations between P <>- C1 and P <>- C2, i.e. every instance of P contains an instance of C1 and an instance of C2, which are destroyed when the parent P instance is destroyed.
an association relation between instances of C1 and C2 (not nece... |
My fellow developers and I are at a crossroads in how to go about continuing our auditing of database changes.
Most of our applications log changes via INSERT, UPDATE, and DELETE triggers.
A few of our newer applications audit at the ORM layer; specifically using Hibernate Envers.
While ORM layer auditing provides a mu... |
If an employer asks for a large code sample, one for an entire project, what characteristics should the project have to show architectural skills and the ability to manage a large codebase?
For example, should I show off managing modules/dependencies? writing test/build scripts? design patterns? etc.
|
Possible Duplicate:
How could the first C++ compiler be written in C++?
You probably heard that Microsoft released a new language called TypeScript which is a the typed superset of JavaScript.
The most interesting thing that makes me wonder is the fact that its compiler writen in TypeScript itself.
Call me ignorant ... |
I've been working in Ruby for the last couple weeks, and I've come to the subject of procs, lambdas and blocks. After reading a fair share of examples from a variety of sources, I don't how they're much different from small, specialized functions. It's entirely possible that the examples I've read aren't showing the ... |
For example, if I break a project into n discrete work products (say classes or functions or components) is there a time t such that n*t is a suitable amount of time to spend on estimation?
|
I am attempting to model a card game where cards have two important sets of features:
The first is an effect. These are the changes to the game state that happen when you play the card. The interface for effect is as follows:
boolean isPlayable(Player p, GameState gs);
void play(Player p, GameState gs);
And you could ... |
I am working on a MVC 4 project that will serve as an API layer of a larger application.
The developers that came before me set up separate Areas to separate different API requests (i.e Search, Customers, Products, and so forth).
I am noticing that each Area has separate Area registration classes that define routes for... |
I have the feeling that a lot of developers disregard corner and edge cases. Often they tend to just ignore these.
I was once working on a logistics project. In the order management of the application there was a case where about 5-10% of the orders had to be specially handled. One colleague said that we just shouldn't... |
I'm an ASP.NET Webforms developer, and I face some problems when I deal with designers.
Designers always complain about the asp.net server controls. They'd rather just have an html file and create css files along with the required images to go with those. Sometimes, if the design phase is done in advance, I get html fi... |
I've been using python for a few days now and I think I understand the difference between dynamic and static typing. What I don't understand is under what circumstances it would be preferred. It is flexible and readable, but at the expense of more runtime checks and additional required unit testing.
Aside from non-func... |
Recently i have looked at the "timeline" of Programming Languages and while a lot has changed in the past 5-10 years, there are a lot of languages that have pretty much "stayed" the same in their niche/use.
For example, let's take C language. We don't really ever see much languages being developed (correct me if i'm wr... |
After arriving at this point in Learning Python The Hard Way I am wondering if this is a good practice to create a list of symbols and define what they do as noted in bold below, for every programming language. This seems reasonable, and might be very useful to have when jumping between programming languages?
Is this s... |
I'm studying Java right now, and I'm thinking of this tool as my practice project.
The game is "League of Legends" in case anyone knows it, I'm not actually simulating the game as in simulating game play, I'm just trying to create a tool that can compare different champions to each other based on their own abilities an... |
Currently i'm working on a Purchased Order System Application Project for a small scale company.
The Software that i am working on is personalized based on the on their business requirement.
The company told me to create proposal include the price how much is the application is so they can process the check for me.
Th... |
Preconditions
Team uses DVCS
IDE supports comments parsing (like TODO and etc.)
Tools like CodeCollaborator are expensive for budget
Tools like gerrit are too complex for install or not usable
Workflow
Author publishes somewhere on central repo feature branch
Reviewer fetch it and start review
In case of some questi... |
I have a server-client application. Sometimes the server is updated which requires some DLLs in the client to be updated as well (The DLLs are the dependencies of the main executable). For now, we have to close the client, manually deploy the DLLs, and then start the client again. This is kind of an inconvenience becau... |
Based on many sources I do not believe the simple definition that aim of testing is to find as many bugs as possible - we test to ensure that it works or that it does not. E.g. followint are goals of testing form ISTQB:
Determine that (software products) satisfy specified requirements ( I think its verificication)
De... |
There is this question ( which is now closed as not constructive) that asked about the average productivity per day.
My question is, is there any scientific study on the productivity of programmers? I can't help but feel that doing 8 hours of quality programming work from Monday to Friday consistently is very hard. And... |
I'm working on an application that creates HTML log files. I'm tired of having to manually reload and scroll to the bottom in the browser to see the latest entries.
A solution that does not really satisfy me is using the Firefox plugins ReloadEvery and ScrollyFox. In many situations reloading frequency and scrolling sp... |
The domain expert in our team uses UML class diagrams to model the domain model.
As a result, the class diagrams are more of technical models rather than domain models (it serves of some sort of technical specifications for developpers because they don't have to do any conception, they just have to implement the model)... |
I have recently become curious about Factor, which, as far as I understand, is the most practical stack-based language around. Forth seems not to be used much these days - I think it is because it was meant to be used on its own, instead of inside an operating system, although ports of course exist. It is also pretty l... |
I'm starting to need an access control for roles in my app.
I don't know much of this, but I understand how vBulletin works:
I create groups, then give permissions to groups.
I think that what I need is the Role Bases Access Control (RBAC) , but i'm not sure, because I need groups to give permissions instead of single... |
I'm currently trying to write a class library for a connection to a database. Looking over it, there are several different types of queries: Select From, Update, Insert, etc.
My question is, what is the best practice for writing these queries in a C# application?
Should I have a separate method for each of them(i... |
I have this issue with licensing.
I downloaded a third-party class from GitHub and it's under the GPL v3 license. However, I used this class on another open-source project which is under the GPL v2 license, and submitting my script there, requires that everything is under GPL v2 from my side too.
Am I allowed to chang... |
For those who are not aware of Kindle's whispersync, here is how it works (from amazon.com):
"...Whispersync synchronizes the bookmarks and furthest page read among devices registered to the same account. Whispersync is on by default to ensure a seamless reading experience for a book read across multiple Kindles."
Can ... |
I'm new to PHP in a professional context. I want a few macro thumb rules to keep me on the enlightened path. Here are a few I'm proposing to myself:
no absolute paths in include|require(_once)? statements
no .. dirname(foo), or other means of walking up in include|require(_once)? statements
put libs on the include pat... |
a) As far as I understand it, in most cases Domain Model DM doesn't contain code for creating/deleting domain entities, but instead it is the job of layers ( ie service layer or UI layer ) on top of DM to create/delete domain entities?
b) Domain entities are modelled after real world entities. Assuming particular real... |
It's been a while I have been thinking on what could be the best scenario for creating a secure login in a client-server application running on internet or any other networks ! So I became with the idea to ask this question on programmers and I hope that this question will make awareness of new aspects of threads and s... |
I work for a great little software company which makes good revenue from our main software package. The problem for me is that it's almost unmaintainable. It's written in Delphi 7 (has upgraded versions over time) and has been worked on by a lot of developers over the past 20 or so years.
The software lacks any meani... |
Problem Link - http://opc.iarcs.org.in/index.php/problems/NUMTRIPLE
In my opinion, the problem can be solved by a data structure, that shows how each number is connected to another, and via recursion find the smallest possible value. But my question is, what data structure (most efficient) can hold/represent such data?... |
Will performance be better (quicker) if I manually compile the source for a software component for the actual machine that it will be used on, compared to if the source was compiled on another platform perhaps for many different architectures? I got some good results compiling source that I downloaded and I wonder whet... |
Theoretical situation:
One trillion foobars are stored in a text file (no fancy databases). Each foobar must have some business logic executed on it. A set of 1 trillion will not fit in memory so the data layer cannot return a big set to the business layer. Instead they are to be streamed in 1 foobar at a time, and hav... |
Consider a text index such as a suffix tree or a suffix array supporting Count queries (number of occurrences of a pattern) and Locate queries (the positions of all the occurrences of a pattern) over a given text. How would you go about unit testing such a class ?
What I have in mind is to generate a big random string ... |
In my experience, a Software Development Team that comprises:
1 Project Manager
1 Tech Lead
1 - 2 Senior Dev
2 - 3 Junior Dev (Fresh grad)
Only the Tech Lead & PM (and/or Senor Dev/s) will participate in a meeting with Clients, Domain Experts, Client's technical resource.
I can think of the ff potential pitfalls:
... |
I am working in Linux Kernel area and my work includes:
code study / Understanding
Porting (say from one kernel version to another kernel version)
Implementation of new kernel module / Device driver
How to do estimation in such Linux Kernel assignments? Is there any technique? How the community is doing?
|
Just a few days ago I discovered Codility, and I tried their challenges. And I must say. I got my behind handed to me on a platter. I'm not sure what the problem was, but I'll lick my wounds and wait for the solution to come out and compare it with my own. In the meantime, I want to get ready for the next challenge so ... |
At the delivery of every version of software we have to write a release note.
For example, here are some of the terms I add when I write a release note:
Release Date
Bug Solved
Is that enough, or is there anything else?
|
Having read many books, there is a basic contradiction:
Some say, "the goal of testing is to find bugs" while other say "the goal of the testing is to equalize the quality of the product", meaning that bugs are its by-products.
I would also agree that if testing would be aimed primarily on a bug hunt, who would do the ... |
I'm interested in functional programming and decided to get head to head with Haskell. My head hurts... but I'll eventually get it...
I have one curiosity though, why is the syntax so cryptic (in lack of another word)?
Is there a reason why it isn't more expressive, more close to human language?
I understand that FP i... |
I have a condition
if(exists && !isDirectory || !exists)
{}
how can I modify it, so that it may be more understandable.
|
In Common Lisp, defmacro basically allows us to build our own DSL.
I read this page today and it explains something cleverly done:
But I wasn't about to write out all these boring predicates myself, so I defined a function that, given a list of words, builds up the text for such a predicate automatically, and then eva... |
Following the recent release by Microsoft of TypeScript I was wondering if this is something that should be considered for a experienced WinForm and XAML developer looking to get into more web development.
From reviewing a number of sites and videos online it appears that the type system for TypeScript makes more sense... |
As we know a many to many association are shown by two asterisks in both end of association. Now I have a association between two entities "Good" and "Invoice" so Good and Invoice have a many to many association but I want to show the "count of each good" in each invoice on class diagram.
How can I show it?
|
Java generics look quite different from those available in Scala, although both were designed by Martin Odersky. From my point of view, the design of generics in Java is worse, for instance:
there is no possibility to specify variance
one can get around the previous limitation by using wildcards, but this means the bu... |
I know that if a computation takes linear or linearithmic time based on the size of the input, that's good, and if it takes quadratic time, then that's not so good.
However, what about memory usage? Suppose a program takes a file as input and does something with that file. Is it okay for the memory usage to be linea... |
According to Roy Fielding (one of the principle authors of the HTTP specification) in his seminal thesis Architectural Styles when discussing REST, he mentions:
[E]ach request from client to server must contain all of the information necessary to understand the request, and cannot take advantage of any stored context ... |
Тitle might be a little bit incorrect. :) Anyway, I'm building a software where employees input time they worked per day (work hours) and employer "pays" for this time. "Payment" is done outside this system, so employer just "confirms" (checkbox or something like this) which work hours are paid.
So the question is - wh... |
It is easy to define the Equals operation in ways that are not commutative. When providing equality against other types, there are obviously situations (in most languages) were equality not being commutative is unavoidable. However, within one's own inheritance hierarchy where the root base class defines an equality ... |
When freelancing / contracting a customer will typically specify functional requirements, acceptance criteria, etc, and the implementation details are in the developer's hands.
As a developer your technology choice is a balancing act between what you are most familiar with, technologically what the right tool appears t... |
I'm about to make a simple web application with just image uploading and user management. I'm browsing through several web app frameworks I could use yet I'm still thinking if I should still make use of them or just make one from scratch for this specific application.
Any suggestions from experienced web app developers... |
I have searched the idea of address space that is The set of all legal addresses in memory for a given application. The address space represents the amount of memory available to a program. I am unable to find that how this concept is implemented? And how it works with operating system? Any help would be appreciated.
|
A situation has arisen where (if I don't scream and run away) I will be involved in an ERP system. This project will be using OpenERP specifically. My background is entirely science/engineering/music/games/art/whatever. I've never set foot in the realm of business systems or anything describable with the word "enterpri... |
Let's say I write a mobile app and I want to sell it on all three:
Apple Market Place
Android Market Place
Windows Market Place
Will any of these market places tell me that it's not possible, that
in order to sell it I must only go through them and not through the
other ones?
p.s I know Angry Birds sells on all three... |
I wonder why would anybody want to use identity comparison for fields in equals, like here (Java syntax):
class C {
private A a;
public boolean equals(Object other) {
// standard boring prelude
if (other==this) return true;
if (other==null) return false;
if (other.getClass() != ... |
I have some experience writing small tools in Haskell and I find it very intuitive to use, especially for writing filters (using interact) that process their standard input and pipe it to standard output.
Recently I tried to use one such filter on a file that was about 10 times larger than usual and I got a Stack space... |
I was talking with my architect about some concerns with a particular approach that may result in very low level of cohesion in a set of classes. However, I couldn't think of the word that represents a low level of cohesion.
I said something along the lines of "Obviously, we want cohesive classes not... uh ... not cohe... |
I am working through some Lisp exercises using Clojure. If I were to convert Lisp lists to Clojure vectors, solving some of the problems would be simpler, so here is my question:
Does using vec or vector cost a lot in terms of time and/or processing? Does using either function cause a meta state change, or are the valu... |
For a few decades the programming language of choice for AI was either Prolog or LISP, and a few more others that are not so well known. Most of them were designed before the 70's.
Changes happens a lot on many other domains specific languages, but in the AI domain it hadn't surfaced so much as in the web specific lan... |
If the header file supplied by a vendor of something with whom one's code must interact is deficient in some way, in what cases is it better to:
Work around the header's deficiencies in the main code
Copy the header file to the local project and fix it
Fix the header file in the spot where it's stored as a vendor-supp... |
After receiving some threats of the copyrights holder of a dual licensed software(GPL2 and commercial) to buy the commercial version for projects in production, I am thinking to make a fork.
In a case of GPL2 and commercially dual licensed with business owned copyrights software, is forking the GPL2 version an option?
... |
The "Verbally Readable !== Quicker Comprehension" argument on http://ryanflorence.com/2011/case-against-coffeescript/ is really potent and interesting. I and I'm sure others would be very interested in evidence arguing against this. There's clear evidence for this and I believe it. People naturally think in images, not... |
What things should absolutely always/never be included in a header file?
Functions: what must go in the header file and what mustn't
Constants: Is it good practice to define lot of constants in a header file?
Any other good practices for C header files?
Example
I'm writing a parser for a documented industry standard ... |
Maintaining bug database is an important for every project. I am used to store the followings at bug database
Issue date time
Who is assigned to
Whether it has been solved or not
If solved then, solved date time
Is those enough to maintain a good bug database?
|
We currently are using CCNet as our continous integration server. Most projects check for changes every 30 seconds (the default) and if needed perform a build (unit tests, stylecop, fxcop, etc).
We've gotten quite a few projects now, and the server spends most of its time near 100% cpu utilization. This has alarmed s... |
I currently have some code that checks if squash and tennis scores are valid, both in javascript and PHP.
This results in 4 blocks of code existing, 2 languages * 2 sports, which does not scale well should any extra sports come around, or extra languages...
How can one describe the valid scores of games via a settings/... |
I'm really struggling with my software specs. I am not a professional programmer but enjoy doing it for fun and made some software that I want to sell later but I'm not happy with the code quality. So I wanted to hire a real developer to rewrite my software in a more professional way so it will be maintainable by oth... |
The development team that I'm a member of has recently adapted to work according to Agile practices. This has personally highlighted the fact that I can't stop myself gold-plating code (and documentation) and I consequently exceed original estimates, when I could've delivered solutions that meet the requirements much e... |
Hi I recently learned asp.net webforms and looking to get some experience under my belt using it.I found a website that provided some exercises here:
asp.net exercises
There weren't that many and I managed to finish them all.Are there any other website or books with similar exercises or tasks that could help me get so... |
I've been wondering about this. What do we exactly mean by design and verification.
Should I just apply TDD to make sure my code is SOLID and not check if it's external behaviour is correct?
Should I use BDD for verifying the behaviour is correct?
Where I get confused also is regarding TDD code Katas, to me they looked... |
In my understanding, the GPL prohibits static linking from non-GPL code to GPL code, but permits dynamic linking from non-GPL code to GPL code. So which is it when the code in question is not linked at all because the code is written in an interpreted language (e.g. Perl)?
It would seem to be too easy to exploit the ru... |
Let's say we have a class called 'Automobile' and we have an instance of that class called 'myCar'. I would like to ask why do we need to put the values that our methods return in a variable? Why don't we just call the method?
For example, why should one write:
string message = myCar.SpeedMessage();
Console.WriteLine(m... |
What exactly is C# version of Java RMI?
I want to invoke the methods of client from the server, ping the client from server etc.
How the server and client communication is done with c#?
|
To clarify, when I mean use the terms persistent and immutable on a data structure, I mean that:
The state of the data structure remains unchanged for its lifetime. It always holds the same data, and the same operations always produce the same results.
The data structure allows Add, Remove, and similar methods that ... |
I've got an interesting tiling problem, I have a large square image (size 128k so 131072 squares) with dimensons 256x512... I want to fill this image with certain grain types (a 1x1 tile, a 1x2 strip, a 2x1 strip, and 2x2 square) and have no overlap, no holes, and no extension past the image boundary. Given some proba... |
A variable refers to a value. A variable is also stored in a memory address. People say that it's good to have this memory model in mind. Is that true? What is some sample code that shows this as beneficial in practice?
You dont have to use programming, you can use a real-world analogy if you like.
edit: they keep remo... |
It seems that both Apple and Microsoft prohibit GPLv3-licensed software in the app stores for their locked-down devices (i.e. iOS, Windows Phone and the Metro part of Windows). I have heard various explanations for this. However: Would they even be able to allow this license in their app stores if they wanted to, or do... |
There's two of us working on something. We're using this branch structure
master
dev-A
dev-B
We both work on separate branches (dev-A,B) and whenever we're done - we promote our changes to master.
But the drawback of this is we can't get changes the other developer makes. Everything exists in the master tree - but we... |
I was reviewing my notes and stumbled across the implementation of different sorting algorithms.
As I attempted to make sense of the implementation of QuickSort and MergeSort, it occurred to me that although I do programming for a living and consider myself decent at what I do, I have neither the photographic memory no... |
I am working through the Windows 8 app tutorial.
They have some code about saving app data like so:
private void NameInput_TextChanged(object sender, TextChangedEventArgs e)
{
Windows.Storage.ApplicationDataContainer roamingSettings =
Windows.Storage.ApplicationData.Current.Roaming... |
I am reading/learning about interfaces in C# at the moment, and thus far I managed to understand how it differs from an abstract class. In the book I am reading the author explains that interfaces are the ultimate abstract class and that it simply sets the standard of certain methods the inheriting class will have, but... |
Every library, open-source project, and SDK/API I've ever come across has come packaged with a (usually large) documentation file, and this seems contradictory to the wide-spread belief that good code needs little to no comments. What separates documentation from this programming methodology?
a one to two page overview... |
Plenty of sentiment exists that measuring commits is inappropriate.
Has any study been done that tries to draw in more sources than commits - such as:
browsing patterns
IDE work (pre-commit)
idle time
multitasking
I can't think of an easy way to do these measures, but I wonder if any study has been done.
On a pers... |
I don't have any question related to coding. My concerns are about embedded systems programming independent of any particular programming language.
Because I am new in the realm of embedded programming, I would quite appreciate responses from those who consider themselves experienced embedded systems programmers.
I ba... |
I am interested in multicore programming at the kernel level. I expect this affects many areas and is probably different for each architecture. What are some must read sections of the kernel? If I wanted to compare and contrast code for an Intel I7 and an ARM Cortex-A9 MPCore where would I find the differences?
|
I have been reading about the MIPS architecture and learned that it has been used a multiprocessor architecture in the past. Is anyone presently using it in a multicore SoC?
|
Is there a way to get the version of Ubuntu that Google uses for development? Even better would be a full up VMWare or Virtual Box Virtual Machine image that might include a full complement of preinstalled tools as well.
|
I have to import data from Excel to an SQL database. The Excel data contains various parameters and their values, like P1, P1, P4, P5, etc. I have to apply business rules. Like if (P1 > 100 and P1 < 200) then insert the record in database. Similarly, in some cases, string values are also validated. Can I have any open ... |
Do you need to take account of the different processors and their instructions when writing a compiler? Have instructions been standardised? Or what tools and techniques are available to assist with this? E.g. Ignoring machine instructions that are specific to a certain processor model.
|
According to Stephen Schach, “Classical and Object-Oriented Software Engineering”, chapter 6:
a module consists a single block of code that can be invoked in the way that a procedure, function, or method is invoked
This seems very vague and broad. So could anyone explain it clearly and show some actual examples of ho... |
I work for a medium company that has around 250 developers. Unfortunately, lots of them are stuck in a procedural way of thinking and some teams constantly deliver big Transactional Script applications, when in fact the application contains rich logic. They also fail to manage the design dependencies, and end up with s... |
I'm taking my first steps with Clojure. Otherwise, I'm somewhat competent with JavaScript, Python, Java, and a little C.
I was reading this artical that describes destructuring vectors and maps. E.g.
=> (def point [0 0])
=> (let [[x y] point]
=> (println "the coordinates are:" x y))
the coordinates are: 0 0
but I'm ... |
I'm rewriting a PHP client/proxy library that provides an interface to a SOAP-based .Net webservice, and in the process I want to add some unit and integration tests so future modifications are less risky.
The work the library I'm working on performs is to marshall the calls to the web service and do a little reorgani... |
I'm trying to detect if an article or forum post is a duplicate entry within the database. I've given this some thought, coming to the conclusion that someone who duplicate content will do so using one of the three (in descending difficult to detect):
simple copy paste the whole text
copy and paste parts of text mergi... |
I want to add databases (traditional client/server RDBMS's like Mysql/Postgresql as opposed to NoSQL, or embedded databases) to my toolbox as a developer. I've been using SQLite for simpler projects with only 1 client, but now I want to do more complicated things (ie, db-backed web development). I usually like follow... |
In particular, I'm curious about the following aspects:
How do you know that your test cases are wrong (or out-of-date) and needed to be repaired (or discarded)? I mean, even if a test case became invalid, it might still pass and remain silent, which could let you falsely believe that your software works okay. So how ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.